summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
commitd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch)
treeb318cf594dc1da2fa48224005945c9157f35bb41 /Source
parent6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff)
downloadqtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source')
-rw-r--r--Source/JavaScriptCore/CMakeLists.txt3
-rw-r--r--Source/JavaScriptCore/ChangeLog566
-rw-r--r--Source/JavaScriptCore/Configurations/JSC.xcconfig2
-rw-r--r--Source/JavaScriptCore/GNUmakefile.list.am14
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.exp2
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.gypi1
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def3
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj52
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj4
-rw-r--r--Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj498
-rw-r--r--Source/JavaScriptCore/Target.pri3
-rw-r--r--Source/JavaScriptCore/assembler/RepatchBuffer.h1
-rw-r--r--Source/JavaScriptCore/bytecode/CallLinkInfo.cpp57
-rw-r--r--Source/JavaScriptCore/bytecode/CallLinkInfo.h105
-rw-r--r--Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h60
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp54
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.h207
-rw-r--r--Source/JavaScriptCore/bytecode/CodeType.h36
-rw-r--r--Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h (renamed from Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.h)43
-rw-r--r--Source/JavaScriptCore/bytecode/GlobalResolveInfo.h48
-rw-r--r--Source/JavaScriptCore/bytecode/HandlerInfo.h (renamed from Source/WebCore/bridge/jni/v8/JavaFieldV8.h)42
-rw-r--r--Source/JavaScriptCore/bytecode/LineInfo.h41
-rw-r--r--Source/JavaScriptCore/bytecode/MethodCallLinkInfo.cpp50
-rw-r--r--Source/JavaScriptCore/bytecode/MethodCallLinkInfo.h83
-rw-r--r--Source/JavaScriptCore/bytecode/StructureStubInfo.h12
-rw-r--r--Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp10
-rw-r--r--Source/JavaScriptCore/dfg/DFGAbstractState.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp8
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.cpp4
-rw-r--r--Source/JavaScriptCore/dfg/DFGJITCompiler.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGOperations.cpp6
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h2
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp2
-rw-r--r--Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp2
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.cpp27
-rw-r--r--Source/JavaScriptCore/interpreter/Interpreter.h8
-rw-r--r--Source/JavaScriptCore/jit/JIT.cpp3
-rw-r--r--Source/JavaScriptCore/jit/JITExceptions.cpp72
-rw-r--r--Source/JavaScriptCore/jit/JITExceptions.h (renamed from Source/WebCore/bridge/jni/v8/JavaClassV8.h)52
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.cpp179
-rw-r--r--Source/JavaScriptCore/jit/JITStubs.h2
-rw-r--r--Source/JavaScriptCore/parser/Parser.cpp1
-rw-r--r--Source/JavaScriptCore/parser/SourceProviderCache.cpp5
-rw-r--r--Source/JavaScriptCore/parser/SourceProviderCache.h6
-rw-r--r--Source/JavaScriptCore/runtime/ArrayPrototype.cpp6
-rw-r--r--Source/JavaScriptCore/runtime/CommonSlowPaths.h204
-rw-r--r--Source/JavaScriptCore/runtime/Executable.cpp4
-rw-r--r--Source/JavaScriptCore/runtime/JSArray.cpp580
-rw-r--r--Source/JavaScriptCore/runtime/JSArray.h52
-rw-r--r--Source/JavaScriptCore/runtime/JSByteArray.cpp2
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalData.h3
-rw-r--r--Source/JavaScriptCore/runtime/JSObject.cpp4
-rw-r--r--Source/JavaScriptCore/runtime/JSString.h2
-rw-r--r--Source/JavaScriptCore/runtime/PropertyDescriptor.cpp36
-rw-r--r--Source/JavaScriptCore/runtime/PropertyDescriptor.h5
-rw-r--r--Source/JavaScriptCore/wtf/Assertions.cpp46
-rw-r--r--Source/JavaScriptCore/wtf/ByteArray.h2
-rw-r--r--Source/JavaScriptCore/wtf/CMakeLists.txt10
-rw-r--r--Source/JavaScriptCore/wtf/DateMath.cpp1
-rw-r--r--Source/JavaScriptCore/wtf/Functional.h20
-rw-r--r--Source/JavaScriptCore/wtf/ListHashSet.h2
-rw-r--r--Source/JavaScriptCore/wtf/OwnFastMallocPtr.h53
-rw-r--r--Source/JavaScriptCore/wtf/TypeTraits.cpp13
-rw-r--r--Source/JavaScriptCore/wtf/TypeTraits.h46
-rw-r--r--Source/JavaScriptCore/wtf/text/StringImpl.h1
-rw-r--r--Source/JavaScriptCore/wtf/wtf.pro1
-rw-r--r--Source/JavaScriptGlue/ChangeLog9
-rw-r--r--Source/JavaScriptGlue/ForwardingHeaders/wtf/OwnFastMallocPtr.h1
-rw-r--r--Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj20
-rw-r--r--Source/ThirdParty/ANGLE/ChangeLog574
-rw-r--r--Source/ThirdParty/ANGLE/include/EGL/eglext.h125
-rw-r--r--Source/ThirdParty/ANGLE/include/EGL/eglplatform.h23
-rw-r--r--Source/ThirdParty/ANGLE/include/GLES2/gl2ext.h532
-rw-r--r--Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h82
-rw-r--r--Source/ThirdParty/ANGLE/src/common/debug.cpp200
-rw-r--r--Source/ThirdParty/ANGLE/src/common/version.h4
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h4
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp435
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h103
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp50
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.cpp125
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h60
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h3
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp43
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.h2
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp44
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp46
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.h14
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp163
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp125
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h12
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp65
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h52
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h18
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ShHandle.h9
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp53
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp16
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp10
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp4
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/Types.h26
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp47
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h3
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp32
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h4
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp1
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/generate_glslang_lexer.sh11
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/generate_glslang_parser.sh12
-rwxr-xr-xSource/ThirdParty/ANGLE/src/compiler/generate_parser.sh27
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/glslang.l8
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/glslang.y38
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp779
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp1262
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/glslang_tab.h208
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp2
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/intermediate.h22
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/osinclude.h2
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/ossource_posix.cpp10
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c2
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/preprocessor/length_limits.h21
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h5
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/Display.cpp299
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/Display.h29
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/Surface.cpp186
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/Surface.h7
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp115
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/libEGL.rc2
-rw-r--r--Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj167
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Buffer.cpp2
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Context.cpp1009
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Context.h94
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Fence.cpp4
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.cpp69
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.h8
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.cpp38
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.h24
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp1020
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Program.h69
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.cpp295
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.h114
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Shader.cpp32
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Shader.h6
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Texture.cpp2335
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/Texture.h304
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.cpp117
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.h48
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.cpp382
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.h120
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.cpp769
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.h170
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/geometry/vertexconversion.h208
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp985
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.def6
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.rc2
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj164
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/main.cpp33
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/main.h3
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/utilities.cpp171
-rw-r--r--Source/ThirdParty/ANGLE/src/libGLESv2/utilities.h24
-rw-r--r--Source/ThirdParty/ChangeLog9
-rw-r--r--Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj16
-rw-r--r--Source/WTF/ChangeLog9
-rw-r--r--Source/WTF/WTF.xcodeproj/project.pbxproj4
-rw-r--r--Source/WebCore/CMakeLists.txt11
-rw-r--r--Source/WebCore/ChangeLog3405
-rw-r--r--Source/WebCore/DerivedSources.make1
-rw-r--r--Source/WebCore/DerivedSources.pri1
-rw-r--r--Source/WebCore/English.lproj/localizedStrings.jsbin76110 -> 75804 bytes
-rw-r--r--Source/WebCore/ForwardingHeaders/wtf/OwnFastMallocPtr.h1
-rw-r--r--Source/WebCore/GNUmakefile.am15
-rw-r--r--Source/WebCore/GNUmakefile.list.am21
-rw-r--r--Source/WebCore/Modules/intents/Intent.cpp80
-rw-r--r--Source/WebCore/Modules/intents/Intent.h69
-rw-r--r--Source/WebCore/Modules/intents/Intent.idl36
-rw-r--r--Source/WebCore/Modules/intents/IntentRequest.cpp104
-rw-r--r--Source/WebCore/Modules/intents/IntentRequest.h69
-rw-r--r--Source/WebCore/Modules/intents/IntentResultCallback.h51
-rw-r--r--Source/WebCore/Modules/intents/IntentResultCallback.idl (renamed from Source/WebKit/chromium/public/platform/WebMimeRegistry.h)12
-rw-r--r--Source/WebCore/Modules/intents/NavigatorIntents.cpp80
-rw-r--r--Source/WebCore/Modules/intents/NavigatorIntents.h54
-rw-r--r--Source/WebCore/Modules/intents/NavigatorIntents.idl32
-rw-r--r--Source/WebCore/Target.pri16
-rw-r--r--Source/WebCore/WebCore.exp.in8
-rw-r--r--Source/WebCore/WebCore.gyp/WebCore.gyp1
-rw-r--r--Source/WebCore/WebCore.gypi36
-rwxr-xr-xSource/WebCore/WebCore.vcproj/WebCore.vcproj104
-rw-r--r--Source/WebCore/WebCore.xcodeproj/project.pbxproj42
-rw-r--r--Source/WebCore/accessibility/AXObjectCache.cpp2
-rw-r--r--Source/WebCore/accessibility/AccessibilityAllInOne.cpp1
-rw-r--r--Source/WebCore/accessibility/AccessibilityRenderObject.cpp2
-rw-r--r--Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp92
-rw-r--r--Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.h2
-rw-r--r--Source/WebCore/bindings/generic/BindingSecurity.h6
-rw-r--r--Source/WebCore/bindings/js/JSDOMBinding.cpp14
-rw-r--r--Source/WebCore/bindings/js/JSDOMBinding.h19
-rw-r--r--Source/WebCore/bindings/js/JSDOMWindowCustom.cpp4
-rw-r--r--Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp6
-rw-r--r--Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp2
-rw-r--r--Source/WebCore/bindings/js/JSHistoryCustom.cpp10
-rw-r--r--Source/WebCore/bindings/js/JSImageDataCustom.cpp5
-rw-r--r--Source/WebCore/bindings/js/JSLocationCustom.cpp12
-rw-r--r--Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp1
-rw-r--r--Source/WebCore/bindings/js/ScriptController.cpp2
-rw-r--r--Source/WebCore/bindings/js/SerializedScriptValue.cpp3
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm14
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm28
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorJS.pm91
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm14
-rw-r--r--Source/WebCore/bindings/scripts/CodeGeneratorV8.pm67
-rwxr-xr-xSource/WebCore/bindings/scripts/generate-bindings.pl12
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.cpp111
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.h58
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventConstructor.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.cpp95
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.h54
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp43
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h10
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestNamedConstructor.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp173
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h29
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.cpp93
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.h54
-rw-r--r--Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp203
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h83
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h39
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp220
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h74
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h39
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp86
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.h35
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp332
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h228
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.cpp159
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h62
-rw-r--r--Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetterPrivate.h39
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp247
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h147
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp2
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp354
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h156
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp97
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h21
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp383
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestObj.h22
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp220
-rw-r--r--Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.h148
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h (renamed from Source/WebCore/bridge/jni/v8/JavaMethodV8.h)43
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm107
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h38
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.h43
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.mm121
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h38
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.h13
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm45
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h31
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm160
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.h37
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.mm94
-rw-r--r--Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetterInternal.h38
-rw-r--r--Source/WebCore/bindings/scripts/test/TestDomainSecurity.idl37
-rw-r--r--Source/WebCore/bindings/scripts/test/TestEventConstructor.idl2
-rw-r--r--Source/WebCore/bindings/scripts/test/TestEventTarget.idl50
-rw-r--r--Source/WebCore/bindings/scripts/test/TestInterface.idl1
-rw-r--r--Source/WebCore/bindings/scripts/test/TestObj.idl26
-rw-r--r--Source/WebCore/bindings/scripts/test/TestOverridingNameGetter.idl37
-rw-r--r--Source/WebCore/bindings/scripts/test/TestSupplemental.idl9
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp199
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h81
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp3
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp198
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h82
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp93
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h1
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp317
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.cpp135
-rw-r--r--Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.h80
-rw-r--r--Source/WebCore/bindings/v8/ScriptController.cpp5
-rw-r--r--Source/WebCore/bindings/v8/ScriptController.h3
-rw-r--r--Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp4
-rw-r--r--Source/WebCore/bindings/v8/specialization/V8BindingState.cpp5
-rw-r--r--Source/WebCore/bindings/v8/specialization/V8BindingState.h3
-rw-r--r--Source/WebCore/bridge/jni/JNIUtility.cpp13
-rw-r--r--Source/WebCore/bridge/jni/JavaType.h14
-rw-r--r--Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp16
-rw-r--r--Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp241
-rw-r--r--Source/WebCore/bridge/jni/v8/JavaInstanceV8.h62
-rw-r--r--Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp190
-rw-r--r--Source/WebCore/bridge/jni/v8/JavaNPObjectV8.h60
-rw-r--r--Source/WebCore/bridge/jni/v8/JavaValueV8.h75
-rw-r--r--Source/WebCore/bridge/jsc/BridgeJSC.h4
-rw-r--r--Source/WebCore/css/CSSComputedStyleDeclaration.cpp71
-rw-r--r--Source/WebCore/css/CSSFontFaceSrcValue.cpp12
-rw-r--r--Source/WebCore/css/CSSFontFaceSrcValue.h7
-rw-r--r--Source/WebCore/css/CSSFontSelector.cpp3
-rw-r--r--Source/WebCore/css/CSSInitialValue.h6
-rw-r--r--Source/WebCore/css/CSSMutableStyleDeclaration.h2
-rw-r--r--Source/WebCore/css/CSSParser.cpp65
-rw-r--r--Source/WebCore/css/CSSPrimitiveValueMappings.h40
-rw-r--r--Source/WebCore/css/CSSProperty.cpp3
-rw-r--r--Source/WebCore/css/CSSPropertyNames.in3
-rw-r--r--Source/WebCore/css/CSSStyleApplyProperty.cpp3
-rw-r--r--Source/WebCore/css/CSSStyleSelector.cpp49
-rw-r--r--Source/WebCore/css/CSSStyleSelector.h18
-rw-r--r--Source/WebCore/css/CSSValue.cpp5
-rw-r--r--Source/WebCore/css/CSSValue.h18
-rw-r--r--Source/WebCore/css/CSSValueList.cpp56
-rw-r--r--Source/WebCore/css/CSSValueList.h14
-rw-r--r--Source/WebCore/css/StyleMedia.cpp2
-rw-r--r--Source/WebCore/css/StyleMedia.h16
-rw-r--r--Source/WebCore/css/WebKitCSSFilterValue.cpp2
-rw-r--r--Source/WebCore/css/WebKitCSSTransformValue.cpp2
-rw-r--r--Source/WebCore/css/fullscreenQuickTime.css9
-rw-r--r--Source/WebCore/dom/Attr.cpp4
-rw-r--r--Source/WebCore/dom/CheckedRadioButtons.cpp28
-rw-r--r--Source/WebCore/dom/CheckedRadioButtons.h5
-rw-r--r--Source/WebCore/dom/ContainerNode.cpp14
-rw-r--r--Source/WebCore/dom/DOMAllInOne.cpp1
-rw-r--r--Source/WebCore/dom/Document.cpp118
-rw-r--r--Source/WebCore/dom/Document.h45
-rw-r--r--Source/WebCore/dom/DynamicNodeList.cpp71
-rw-r--r--Source/WebCore/dom/DynamicNodeList.h36
-rw-r--r--Source/WebCore/dom/Element.cpp23
-rw-r--r--Source/WebCore/dom/ElementRareData.h10
-rw-r--r--Source/WebCore/dom/NamedNodeMap.cpp4
-rw-r--r--Source/WebCore/dom/Node.cpp182
-rw-r--r--Source/WebCore/dom/Node.h15
-rw-r--r--Source/WebCore/dom/NodeRareData.h5
-rw-r--r--Source/WebCore/dom/NodeRenderingContext.cpp11
-rw-r--r--Source/WebCore/dom/TreeScope.cpp12
-rw-r--r--Source/WebCore/dom/TreeScope.h3
-rw-r--r--Source/WebCore/dom/TreeScopeAdopter.cpp115
-rw-r--r--Source/WebCore/dom/TreeScopeAdopter.h65
-rw-r--r--Source/WebCore/editing/gtk/FrameSelectionGtk.cpp11
-rw-r--r--Source/WebCore/editing/visible_units.cpp2
-rw-r--r--Source/WebCore/html/FormAssociatedElement.cpp74
-rw-r--r--Source/WebCore/html/FormAssociatedElement.h13
-rw-r--r--Source/WebCore/html/HTMLAllCollection.cpp7
-rw-r--r--Source/WebCore/html/HTMLAllCollection.h2
-rw-r--r--Source/WebCore/html/HTMLCanvasElement.cpp11
-rw-r--r--Source/WebCore/html/HTMLCollection.cpp37
-rw-r--r--Source/WebCore/html/HTMLCollection.h15
-rw-r--r--Source/WebCore/html/HTMLDataListElement.cpp2
-rw-r--r--Source/WebCore/html/HTMLDataListElement.h2
-rw-r--r--Source/WebCore/html/HTMLElement.cpp5
-rw-r--r--Source/WebCore/html/HTMLElement.h4
-rw-r--r--Source/WebCore/html/HTMLFormCollection.cpp17
-rw-r--r--Source/WebCore/html/HTMLFormCollection.h2
-rw-r--r--Source/WebCore/html/HTMLFormControlElement.cpp18
-rw-r--r--Source/WebCore/html/HTMLFormElement.cpp16
-rw-r--r--Source/WebCore/html/HTMLFormElement.h4
-rw-r--r--Source/WebCore/html/HTMLInputElement.cpp39
-rw-r--r--Source/WebCore/html/HTMLInputElement.h4
-rw-r--r--Source/WebCore/html/HTMLLabelElement.cpp11
-rw-r--r--Source/WebCore/html/HTMLLabelElement.h2
-rw-r--r--Source/WebCore/html/HTMLMapElement.cpp4
-rw-r--r--Source/WebCore/html/HTMLMapElement.h2
-rw-r--r--Source/WebCore/html/HTMLMediaElement.cpp48
-rw-r--r--Source/WebCore/html/HTMLMediaElement.h12
-rw-r--r--Source/WebCore/html/HTMLNameCollection.cpp3
-rw-r--r--Source/WebCore/html/HTMLNameCollection.h4
-rw-r--r--Source/WebCore/html/HTMLObjectElement.cpp8
-rw-r--r--Source/WebCore/html/HTMLOptionsCollection.cpp15
-rw-r--r--Source/WebCore/html/HTMLOptionsCollection.h2
-rw-r--r--Source/WebCore/html/HTMLPropertiesCollection.cpp13
-rw-r--r--Source/WebCore/html/HTMLPropertiesCollection.h2
-rw-r--r--Source/WebCore/html/HTMLSelectElement.cpp10
-rw-r--r--Source/WebCore/html/HTMLSelectElement.h7
-rw-r--r--Source/WebCore/html/HTMLTableElement.cpp12
-rw-r--r--Source/WebCore/html/HTMLTableElement.h8
-rw-r--r--Source/WebCore/html/HTMLTableRowElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLTableRowElement.h2
-rw-r--r--Source/WebCore/html/HTMLTableRowsCollection.cpp5
-rw-r--r--Source/WebCore/html/HTMLTableRowsCollection.h2
-rw-r--r--Source/WebCore/html/HTMLTableSectionElement.cpp6
-rw-r--r--Source/WebCore/html/HTMLTableSectionElement.h2
-rw-r--r--Source/WebCore/html/TextTrack.cpp19
-rw-r--r--Source/WebCore/html/TextTrack.h3
-rw-r--r--Source/WebCore/html/TextTrackCue.cpp256
-rw-r--r--Source/WebCore/html/TextTrackCue.h38
-rw-r--r--Source/WebCore/html/TextTrackCue.idl27
-rw-r--r--Source/WebCore/html/canvas/WebGLContextEvent.cpp4
-rw-r--r--Source/WebCore/html/canvas/WebGLRenderingContext.cpp3
-rw-r--r--Source/WebCore/html/parser/XSSAuditor.cpp1
-rw-r--r--Source/WebCore/html/shadow/MediaControlElements.cpp13
-rw-r--r--Source/WebCore/html/shadow/MediaControlRootElement.cpp10
-rw-r--r--Source/WebCore/html/shadow/MediaControlRootElement.h2
-rw-r--r--Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp10
-rw-r--r--Source/WebCore/html/shadow/MediaControlRootElementChromium.h2
-rw-r--r--Source/WebCore/html/shadow/MediaControls.h2
-rw-r--r--Source/WebCore/html/track/WebVTTParser.cpp40
-rw-r--r--Source/WebCore/html/track/WebVTTParser.h9
-rw-r--r--Source/WebCore/inspector/DOMEditor.cpp293
-rw-r--r--Source/WebCore/inspector/DOMEditor.h70
-rw-r--r--Source/WebCore/inspector/InspectorDOMAgent.cpp20
-rw-r--r--Source/WebCore/inspector/InspectorDOMAgent.h1
-rw-r--r--Source/WebCore/inspector/front-end/DOMAgent.js26
-rw-r--r--Source/WebCore/inspector/front-end/DebuggerPresentationModel.js29
-rw-r--r--Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js13
-rw-r--r--Source/WebCore/inspector/front-end/NetworkPanel.js2
-rw-r--r--Source/WebCore/inspector/front-end/ResourceView.js6
-rw-r--r--Source/WebCore/inspector/front-end/ScriptsPanel.js2
-rw-r--r--Source/WebCore/inspector/front-end/Settings.js4
-rw-r--r--Source/WebCore/inspector/front-end/SourceFrame.js14
-rw-r--r--Source/WebCore/inspector/front-end/TabbedPane.js2
-rw-r--r--Source/WebCore/inspector/front-end/TextViewer.js3
-rw-r--r--Source/WebCore/inspector/front-end/elementsPanel.css4
-rw-r--r--Source/WebCore/inspector/front-end/externs.js2
-rw-r--r--Source/WebCore/inspector/front-end/treeoutline.js2
-rw-r--r--Source/WebCore/loader/DocumentLoader.cpp18
-rw-r--r--Source/WebCore/loader/FrameLoaderClient.h7
-rw-r--r--Source/WebCore/loader/SubframeLoader.cpp2
-rw-r--r--Source/WebCore/loader/SubresourceLoader.cpp17
-rw-r--r--Source/WebCore/loader/SubresourceLoader.h1
-rw-r--r--Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp6
-rw-r--r--Source/WebCore/loader/appcache/DOMApplicationCache.cpp4
-rw-r--r--Source/WebCore/loader/appcache/DOMApplicationCache.h9
-rw-r--r--Source/WebCore/loader/cf/SubresourceLoaderCF.cpp5
-rw-r--r--Source/WebCore/page/BarInfo.cpp12
-rw-r--r--Source/WebCore/page/BarInfo.h8
-rw-r--r--Source/WebCore/page/ChromeClient.h1
-rw-r--r--Source/WebCore/page/Console.cpp21
-rw-r--r--Source/WebCore/page/Console.h12
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.h2
-rw-r--r--Source/WebCore/page/DOMSelection.cpp14
-rw-r--r--Source/WebCore/page/DOMSelection.h9
-rw-r--r--Source/WebCore/page/DOMWindow.cpp100
-rw-r--r--Source/WebCore/page/DOMWindow.h24
-rw-r--r--Source/WebCore/page/DOMWindow.idl9
-rw-r--r--Source/WebCore/page/DOMWindowProperty.cpp52
-rw-r--r--Source/WebCore/page/DOMWindowProperty.h48
-rw-r--r--Source/WebCore/page/DragController.cpp1
-rw-r--r--Source/WebCore/page/EventHandler.cpp2
-rw-r--r--Source/WebCore/page/FocusController.cpp2
-rw-r--r--Source/WebCore/page/Frame.cpp39
-rw-r--r--Source/WebCore/page/Frame.h16
-rw-r--r--Source/WebCore/page/FrameDestructionObserver.cpp51
-rw-r--r--Source/WebCore/page/FrameDestructionObserver.h47
-rw-r--r--Source/WebCore/page/Geolocation.cpp6
-rw-r--r--Source/WebCore/page/Geolocation.h14
-rw-r--r--Source/WebCore/page/History.cpp12
-rw-r--r--Source/WebCore/page/History.h10
-rw-r--r--Source/WebCore/page/Location.cpp7
-rw-r--r--Source/WebCore/page/Location.h10
-rw-r--r--Source/WebCore/page/Navigator.cpp20
-rw-r--r--Source/WebCore/page/Navigator.h9
-rw-r--r--Source/WebCore/page/Performance.cpp27
-rw-r--r--Source/WebCore/page/Performance.h17
-rw-r--r--Source/WebCore/page/PerformanceNavigation.cpp12
-rw-r--r--Source/WebCore/page/PerformanceNavigation.h10
-rw-r--r--Source/WebCore/page/PerformanceTiming.cpp12
-rw-r--r--Source/WebCore/page/PerformanceTiming.h10
-rw-r--r--Source/WebCore/page/Screen.cpp12
-rw-r--r--Source/WebCore/page/Screen.h10
-rw-r--r--Source/WebCore/page/Settings.cpp6
-rw-r--r--Source/WebCore/page/Settings.h4
-rw-r--r--Source/WebCore/page/mac/FrameMac.mm21
-rw-r--r--Source/WebCore/platform/KURL.cpp30
-rw-r--r--Source/WebCore/platform/audio/AudioBus.cpp36
-rw-r--r--Source/WebCore/platform/audio/Reverb.cpp19
-rw-r--r--Source/WebCore/platform/audio/Reverb.h2
-rw-r--r--Source/WebCore/platform/chromium/PasteboardChromium.cpp10
-rw-r--r--Source/WebCore/platform/graphics/Font.cpp10
-rw-r--r--Source/WebCore/platform/graphics/Font.h15
-rw-r--r--Source/WebCore/platform/graphics/FontDescription.h7
-rw-r--r--Source/WebCore/platform/graphics/ImageBuffer.h1
-rw-r--r--Source/WebCore/platform/graphics/Path.h13
-rw-r--r--Source/WebCore/platform/graphics/SimpleFontData.h1
-rw-r--r--Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp30
-rw-r--r--Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h1
-rw-r--r--Source/WebCore/platform/graphics/WidthIterator.cpp7
-rw-r--r--Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp4
-rw-r--r--Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm17
-rw-r--r--Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp9
-rw-r--r--Source/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp5
-rw-r--r--Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h3
-rw-r--r--Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp4
-rw-r--r--Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp13
-rw-r--r--Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp5
-rw-r--r--Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureManager.cpp1
-rw-r--r--Source/WebCore/platform/graphics/chromium/TextureManager.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp71
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h12
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp21
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h1
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp170
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h162
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerIteratorPosition.h86
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp81
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h2
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp18
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp14
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp94
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h43
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp6
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h4
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h5
-rw-r--r--Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp9
-rw-r--r--Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp7
-rw-r--r--Source/WebCore/platform/graphics/filters/FEGaussianBlur.h4
-rw-r--r--Source/WebCore/platform/graphics/filters/FilterEffect.cpp4
-rw-r--r--Source/WebCore/platform/graphics/filters/FilterEffect.h3
-rw-r--r--Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkia.cpp133
-rw-r--r--Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp6
-rw-r--r--Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp5
-rw-r--r--Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp4
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp9
-rw-r--r--Source/WebCore/platform/graphics/harfbuzz/SimpleFontDataSkia.cpp5
-rw-r--r--Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm28
-rw-r--r--Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp4
-rw-r--r--Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp174
-rw-r--r--Source/WebCore/platform/graphics/opengl/TextureMapperGL.h1
-rw-r--r--Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp5
-rw-r--r--Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp5
-rw-r--r--Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp12
-rw-r--r--Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp9
-rw-r--r--Source/WebCore/platform/graphics/skia/PathSkia.cpp2
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapper.cpp79
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapper.h4
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp62
-rw-r--r--Source/WebCore/platform/graphics/texmap/TextureMapperNode.h16
-rw-r--r--Source/WebCore/platform/graphics/transforms/AffineTransform.h4
-rw-r--r--Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp5
-rw-r--r--Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp5
-rw-r--r--Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp5
-rw-r--r--Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp4
-rw-r--r--Source/WebCore/platform/mac/ScrollAnimatorMac.h7
-rw-r--r--Source/WebCore/platform/mac/ScrollAnimatorMac.mm112
-rw-r--r--Source/WebCore/platform/mac/ScrollElasticityController.h11
-rw-r--r--Source/WebCore/platform/mock/ScrollbarThemeMock.cpp9
-rw-r--r--Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp5
-rw-r--r--Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp11
-rw-r--r--Source/WebCore/plugins/DOMMimeType.h1
-rw-r--r--Source/WebCore/plugins/DOMMimeTypeArray.cpp2
-rw-r--r--Source/WebCore/plugins/DOMMimeTypeArray.h10
-rw-r--r--Source/WebCore/plugins/DOMPlugin.h1
-rw-r--r--Source/WebCore/plugins/DOMPluginArray.cpp2
-rw-r--r--Source/WebCore/plugins/DOMPluginArray.h10
-rwxr-xr-xSource/WebCore/rendering/RenderBlockLineLayout.cpp6
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp23
-rw-r--r--Source/WebCore/rendering/RenderFlexibleBox.cpp55
-rw-r--r--Source/WebCore/rendering/RenderFlexibleBox.h1
-rw-r--r--Source/WebCore/rendering/RenderFrameSet.cpp2
-rw-r--r--Source/WebCore/rendering/RenderFullScreen.cpp14
-rw-r--r--Source/WebCore/rendering/RenderIFrame.cpp2
-rw-r--r--Source/WebCore/rendering/RenderInline.cpp2
-rw-r--r--Source/WebCore/rendering/RenderLayer.cpp5
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.cpp35
-rw-r--r--Source/WebCore/rendering/RenderLayerBacking.h1
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp19
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.h1
-rwxr-xr-xSource/WebCore/rendering/RenderObject.cpp18
-rw-r--r--Source/WebCore/rendering/RenderObject.h3
-rw-r--r--Source/WebCore/rendering/RenderText.cpp3
-rw-r--r--Source/WebCore/rendering/RenderThemeChromiumMac.h1
-rw-r--r--Source/WebCore/rendering/RenderThemeChromiumMac.mm19
-rw-r--r--Source/WebCore/rendering/RenderThemeMac.mm12
-rw-r--r--Source/WebCore/rendering/style/RenderStyle.h7
-rw-r--r--Source/WebCore/rendering/style/RenderStyleConstants.h2
-rw-r--r--Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp6
-rw-r--r--Source/WebCore/rendering/style/StyleFlexibleBoxData.h2
-rw-r--r--Source/WebCore/storage/DOMWindowSQLDatabase.cpp63
-rw-r--r--Source/WebCore/storage/DOMWindowSQLDatabase.h61
-rw-r--r--Source/WebCore/storage/DOMWindowSQLDatabase.idl42
-rw-r--r--Source/WebCore/storage/IDBCursorBackendImpl.cpp16
-rw-r--r--Source/WebCore/storage/Storage.cpp2
-rw-r--r--Source/WebCore/storage/Storage.h7
-rw-r--r--Source/WebCore/webaudio/ConvolverNode.cpp3
-rw-r--r--Source/WebCore/webaudio/ConvolverNode.h5
-rw-r--r--Source/WebCore/webaudio/ConvolverNode.idl1
-rw-r--r--Source/WebCore/workers/DedicatedWorkerContext.cpp4
-rw-r--r--Source/WebCore/workers/DedicatedWorkerContext.h7
-rw-r--r--Source/WebCore/workers/DedicatedWorkerThread.cpp12
-rw-r--r--Source/WebCore/workers/DedicatedWorkerThread.h7
-rw-r--r--Source/WebCore/workers/DefaultSharedWorkerRepository.cpp9
-rw-r--r--Source/WebCore/workers/DefaultSharedWorkerRepository.h3
-rw-r--r--Source/WebCore/workers/SharedWorkerContext.cpp4
-rw-r--r--Source/WebCore/workers/SharedWorkerContext.h7
-rw-r--r--Source/WebCore/workers/SharedWorkerThread.cpp12
-rw-r--r--Source/WebCore/workers/SharedWorkerThread.h7
-rw-r--r--Source/WebCore/workers/WorkerContext.cpp6
-rw-r--r--Source/WebCore/workers/WorkerContext.h3
-rw-r--r--Source/WebCore/workers/WorkerMessagingProxy.cpp5
-rw-r--r--Source/WebCore/workers/WorkerThread.cpp18
-rw-r--r--Source/WebCore/workers/WorkerThread.h5
-rw-r--r--Source/WebKit/ChangeLog33
-rw-r--r--Source/WebKit/WebKit.pri6
-rw-r--r--Source/WebKit/WebKit.xcodeproj/project.pbxproj108
-rw-r--r--Source/WebKit/blackberry/Api/BackingStore.cpp5
-rw-r--r--Source/WebKit/chromium/ChangeLog310
-rw-r--r--Source/WebKit/chromium/DEPS2
-rw-r--r--Source/WebKit/chromium/WebKit.gyp2
-rw-r--r--Source/WebKit/chromium/WebKit.gypi3
-rw-r--r--Source/WebKit/chromium/features.gypi5
-rw-r--r--Source/WebKit/chromium/public/WebContextMenuData.h3
-rw-r--r--Source/WebKit/chromium/public/WebPlugin.h12
-rw-r--r--Source/WebKit/chromium/public/WebPluginAction.h54
-rw-r--r--Source/WebKit/chromium/public/WebSettings.h1
-rw-r--r--Source/WebKit/chromium/public/WebView.h9
-rw-r--r--Source/WebKit/chromium/src/ContextMenuClientImpl.cpp6
-rw-r--r--Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.cpp9
-rw-r--r--Source/WebKit/chromium/src/NonCompositedContentHost.h3
-rw-r--r--Source/WebKit/chromium/src/PlatformSupport.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebFrameImpl.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp4
-rw-r--r--Source/WebKit/chromium/src/WebLayerTreeView.cpp2
-rw-r--r--Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp11
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.cpp5
-rw-r--r--Source/WebKit/chromium/src/WebSettingsImpl.h1
-rw-r--r--Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp3
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.cpp36
-rw-r--r--Source/WebKit/chromium/src/WebViewImpl.h3
-rw-r--r--Source/WebKit/chromium/src/WebWorkerClientImpl.cpp4
-rw-r--r--Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp54
-rw-r--r--Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp275
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp36
-rw-r--r--Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp47
-rw-r--r--Source/WebKit/chromium/tests/CCQuadCullerTest.cpp187
-rw-r--r--Source/WebKit/chromium/tests/TextureManagerTest.cpp231
-rw-r--r--Source/WebKit/efl/ChangeLog54
-rw-r--r--Source/WebKit/efl/ewk/ewk_js.cpp12
-rw-r--r--Source/WebKit/efl/ewk/ewk_js.h15
-rw-r--r--Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp2
-rw-r--r--Source/WebKit/efl/ewk/ewk_view.cpp41
-rw-r--r--Source/WebKit/gtk/ChangeLog32
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp13
-rw-r--r--Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h1
-rw-r--r--Source/WebKit/gtk/tests/testatk.c26
-rw-r--r--Source/WebKit/mac/ChangeLog61
-rw-r--r--Source/WebKit/mac/History/WebHistoryItem.mm8
-rw-r--r--Source/WebKit/mac/WebCoreSupport/WebChromeClient.h10
-rw-r--r--Source/WebKit/mac/WebView/WebDynamicScrollBarsView.h3
-rw-r--r--Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm28
-rw-r--r--Source/WebKit/mac/WebView/WebView.mm1
-rw-r--r--Source/WebKit/qt/Api/qhttpheader.cpp273
-rw-r--r--Source/WebKit/qt/Api/qhttpheader_p.h112
-rw-r--r--Source/WebKit/qt/Api/qwebpage.cpp1
-rw-r--r--Source/WebKit/qt/ChangeLog116
-rw-r--r--Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp2
-rw-r--r--Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp12
-rw-r--r--Source/WebKit/win/ChangeLog14
-rw-r--r--Source/WebKit/win/DOMHTMLClasses.cpp4
-rw-r--r--Source/WebKit/win/Interfaces/IWebViewPrivate.idl3
-rw-r--r--Source/WebKit2/ChangeLog627
-rw-r--r--Source/WebKit2/Platform/CoreIPC/HandleMessage.h22
-rw-r--r--Source/WebKit2/Scripts/webkit2/messages.py19
-rw-r--r--Source/WebKit2/Scripts/webkit2/messages_unittest.py4
-rw-r--r--Source/WebKit2/Shared/NativeWebMouseEvent.h2
-rw-r--r--Source/WebKit2/Shared/NativeWebTouchEvent.h2
-rw-r--r--Source/WebKit2/Shared/NativeWebWheelEvent.h2
-rw-r--r--Source/WebKit2/Shared/mac/SecItemRequestData.cpp16
-rw-r--r--Source/WebKit2/Shared/mac/SecItemRequestData.h16
-rw-r--r--Source/WebKit2/Shared/mac/SecItemResponseData.h2
-rw-r--r--Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp62
-rw-r--r--Source/WebKit2/Shared/mac/SecKeychainItemRequestData.h27
-rw-r--r--Source/WebKit2/Shared/qt/NativeWebMouseEventQt.cpp4
-rw-r--r--Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp4
-rw-r--r--Source/WebKit2/Shared/qt/NativeWebWheelEventQt.cpp4
-rw-r--r--Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp20
-rw-r--r--Source/WebKit2/Shared/qt/WebEventFactoryQt.h6
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.cpp31
-rw-r--r--Source/WebKit2/UIProcess/API/mac/PageClientImpl.h5
-rw-r--r--Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm7
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKPrintingView.h3
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm86
-rw-r--r--Source/WebKit2/UIProcess/API/mac/WKView.mm17
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp168
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h33
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h7
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp182
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h23
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp2
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml230
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/font-preferences.html31
-rw-r--r--Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp50
-rw-r--r--Source/WebKit2/UIProcess/PageClient.h7
-rw-r--r--Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp2
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp15
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.h3
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.cpp11
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.h15
-rw-r--r--Source/WebKit2/UIProcess/WebProcessProxy.messages.in10
-rw-r--r--Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm145
-rw-r--r--Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp7
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPageClient.cpp14
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPageClient.h5
-rw-r--r--Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp4
-rw-r--r--Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp64
-rw-r--r--Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h20
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp94
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h5
-rw-r--r--Source/WebKit2/WebKit2.xcodeproj/project.pbxproj1470
-rw-r--r--Source/WebKit2/WebKit2Prefix.h14
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h10
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp26
-rw-r--r--Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/EventDispatcher.h4
-rw-r--r--Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.h12
-rw-r--r--Source/WebKit2/WebProcess/WebProcess.messages.in5
-rw-r--r--Source/WebKit2/WebProcess/com.apple.WebProcess.sb1
-rw-r--r--Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.mm80
-rw-r--r--Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.h3
-rw-r--r--Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.mm238
-rw-r--r--Source/WebKit2/WebProcess/mac/KeychainShimResponseMap.h (renamed from Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.h)49
-rw-r--r--Source/WebKit2/WebProcess/mac/SecItemShimMethods.h3
-rw-r--r--Source/WebKit2/WebProcess/mac/SecItemShimMethods.mm128
-rw-r--r--Source/WebKit2/WebProcess/mac/WebProcessMac.mm14
722 files changed, 30599 insertions, 11806 deletions
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index c263b2885..00e0296c0 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -34,9 +34,11 @@ SET(JavaScriptCore_SOURCES
API/JSWeakObjectMapRefPrivate.cpp
API/OpaqueJSString.cpp
+ bytecode/CallLinkInfo.cpp
bytecode/CodeBlock.cpp
bytecode/DFGExitProfile.cpp
bytecode/JumpTable.cpp
+ bytecode/MethodCallLinkInfo.cpp
bytecode/Opcode.cpp
bytecode/PredictedType.cpp
bytecode/SamplingTool.cpp
@@ -92,6 +94,7 @@ SET(JavaScriptCore_SOURCES
jit/JITCall32_64.cpp
jit/JITCall.cpp
jit/JIT.cpp
+ jit/JITExceptions.cpp
jit/JITOpcodes32_64.cpp
jit/JITOpcodes.cpp
jit/JITPropertyAccess32_64.cpp
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 441521586..c8b43b41c 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,569 @@
+2012-01-10 Mark Rowe <mrowe@apple.com>
+
+ <rdar://problem/10673792> jsc should install directly in to versioned Resources subfolder
+
+ This ensures that jsc ends up in a consistent location whether built in to the same DSTROOT
+ as JavaScriptCore.framework or in to a different one.
+
+ Rubber-stamped by Dan Bernstein.
+
+ * Configurations/JSC.xcconfig: Update INSTALL_PATH.
+
+2012-01-10 Filip Pizlo <fpizlo@apple.com>
+
+ DFG inlining block linking compares BlockIndex against bytecode index
+ https://bugs.webkit.org/show_bug.cgi?id=76018
+ <rdar://problem/10671979>
+
+ Reviewed by Gavin Barraclough.
+
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::parseCodeBlock):
+
+2012-01-10 Filip Pizlo <fpizlo@apple.com>
+
+ CodeBlock.h declares too many things
+ https://bugs.webkit.org/show_bug.cgi?id=76001
+
+ Rubber stamped by Gavin Barraclough.
+
+ Removed all non-CodeBlock type declarations from CodeBlock.h, and put them
+ into separate header files. Also removed all non-CodeBlock method implementations
+ from CodeBlock.cpp and put them into corresponding cpp files.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * Target.pri:
+ * assembler/RepatchBuffer.h:
+ * bytecode/CallLinkInfo.cpp: Added.
+ (JSC::CallLinkInfo::unlink):
+ * bytecode/CallLinkInfo.h: Added.
+ (JSC::CallLinkInfo::callTypeFor):
+ (JSC::CallLinkInfo::CallLinkInfo):
+ (JSC::CallLinkInfo::~CallLinkInfo):
+ (JSC::CallLinkInfo::isLinked):
+ (JSC::CallLinkInfo::seenOnce):
+ (JSC::CallLinkInfo::setSeen):
+ (JSC::getCallLinkInfoReturnLocation):
+ (JSC::getCallLinkInfoBytecodeIndex):
+ * bytecode/CallReturnOffsetToBytecodeOffset.h: Added.
+ (JSC::CallReturnOffsetToBytecodeOffset::CallReturnOffsetToBytecodeOffset):
+ (JSC::getCallReturnOffset):
+ * bytecode/CodeBlock.cpp:
+ * bytecode/CodeBlock.h:
+ * bytecode/CodeType.h: Added.
+ * bytecode/ExpressionRangeInfo.h: Added.
+ * bytecode/GlobalResolveInfo.h: Added.
+ (JSC::GlobalResolveInfo::GlobalResolveInfo):
+ * bytecode/HandlerInfo.h: Added.
+ * bytecode/LineInfo.h: Added.
+ * bytecode/MethodCallLinkInfo.cpp: Added.
+ (JSC::MethodCallLinkInfo::reset):
+ * bytecode/MethodCallLinkInfo.h: Added.
+ (JSC::MethodCallLinkInfo::MethodCallLinkInfo):
+ (JSC::MethodCallLinkInfo::seenOnce):
+ (JSC::MethodCallLinkInfo::setSeen):
+ (JSC::getMethodCallLinkInfoReturnLocation):
+ (JSC::getMethodCallLinkInfoBytecodeIndex):
+ * bytecode/StructureStubInfo.h:
+ (JSC::getStructureStubInfoReturnLocation):
+ (JSC::getStructureStubInfoBytecodeIndex):
+
+2012-01-10 Anders Carlsson <andersca@apple.com>
+
+ Hang opening movie that requires authentication
+ https://bugs.webkit.org/show_bug.cgi?id=75989
+ <rdar://problem/9601915>
+
+ Reviewed by Sam Weinig.
+
+ * wtf/Functional.h:
+ Add function wrapper for a function that takes three parameters.
+
+2012-01-10 Filip Pizlo <fpizlo@apple.com>
+
+ CodeBlock::m_numParameters should be encapsulated
+ https://bugs.webkit.org/show_bug.cgi?id=75985
+ <rdar://problem/10671020>
+
+ Reviewed by Oliver Hunt.
+
+ Encapsulated CodeBlock::m_numParameters and hooked argument profile creation
+ into it. This appears to be performance neutral.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::CodeBlock):
+ (JSC::CodeBlock::setNumParameters):
+ (JSC::CodeBlock::addParameter):
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::numParameters):
+ (JSC::CodeBlock::addressOfNumParameters):
+ (JSC::CodeBlock::offsetOfNumParameters):
+ (JSC::CodeBlock::numberOfArgumentValueProfiles):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::BytecodeGenerator):
+ (JSC::BytecodeGenerator::addParameter):
+ (JSC::BytecodeGenerator::emitReturn):
+ * dfg/DFGAbstractState.cpp:
+ (JSC::DFG::AbstractState::AbstractState):
+ * dfg/DFGByteCodeParser.cpp:
+ (JSC::DFG::ByteCodeParser::ByteCodeParser):
+ (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
+ * dfg/DFGGraph.cpp:
+ (JSC::DFG::Graph::predictArgumentTypes):
+ * dfg/DFGJITCompiler.cpp:
+ (JSC::DFG::JITCompiler::compileFunction):
+ * dfg/DFGOperations.cpp:
+ * dfg/DFGSpeculativeJIT.cpp:
+ (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
+ * dfg/DFGSpeculativeJIT.h:
+ (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::slideRegisterWindowForCall):
+ (JSC::Interpreter::dumpRegisters):
+ (JSC::Interpreter::execute):
+ (JSC::Interpreter::prepareForRepeatCall):
+ * jit/JIT.cpp:
+ (JSC::JIT::privateCompile):
+ * jit/JITStubs.cpp:
+ (JSC::arityCheckFor):
+ (JSC::lazyLinkFor):
+ * runtime/Executable.cpp:
+ (JSC::FunctionExecutable::compileForCallInternal):
+ (JSC::FunctionExecutable::compileForConstructInternal):
+
+2012-01-10 Gavin Barraclough <barraclough@apple.com>
+
+ Build fix following https://bugs.webkit.org/show_bug.cgi?id=75935
+
+ Fix 32-bit builds.
+
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::getOwnPropertyNames):
+ (JSC::JSArray::setLength):
+
+2012-01-10 Gavin Barraclough <barraclough@apple.com>
+
+ Windows build fix.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+
+2012-01-10 Gavin Barraclough <barraclough@apple.com>
+
+ Do not allow Array length to be set if it is non-configurable
+ https://bugs.webkit.org/show_bug.cgi?id=75935
+
+ Reviewed by Sam Weinig.
+
+ Do not allow Array length to be set if it is non-configurable, and if the new
+ length is less than the old length then intervening properties should removed
+ in reverse order. Removal of properties should cease if an intervening indexed
+ property being removed is non-configurable.
+
+ * JavaScriptCore.exp:
+ - Removed export for setLength.
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncConcat):
+ - JSArray::setLength now takes an ExecState*
+ (JSC::arrayProtoFuncSlice):
+ - JSArray::setLength now takes an ExecState*
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::defineOwnProperty):
+ - JSArray::setLength now takes an ExecState*
+ (JSC::JSArray::put):
+ - JSArray::setLength now takes an ExecState*
+ (JSC::compareKeysForQSort):
+ - Keys extracted from the map can be stored as unsigneds.
+ (JSC::JSArray::getOwnPropertyNames):
+ - Keys extracted from the map can be stored as unsigneds.
+ (JSC::JSArray::setLength):
+ - Check lengthIsReadOnly(), rather than copying the entire map to iterate
+ over to determine which keys to remove, instead just copy the keys from
+ the map to a Vector. When inSparseMode sort the keys in the Vector so
+ that we can remove properties in reverse order.
+ * runtime/JSArray.h:
+ - JSArray::setLength now takes an ExecState*
+
+2012-01-10 Gavin Barraclough <barraclough@apple.com>
+
+ Use SameValue to compare property descriptor values
+ https://bugs.webkit.org/show_bug.cgi?id=75975
+
+ Reviewed by Sam Weinig.
+
+ Rather than strictEqual.
+
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::defineOwnNumericProperty):
+ - Missing configurablePresent() check.
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::defineOwnProperty):
+ - call sameValue.
+ * runtime/PropertyDescriptor.cpp:
+ (JSC::sameValue):
+ - Moved from JSArray.cpp, fix NaN comparison.
+ (JSC::PropertyDescriptor::equalTo):
+ - call sameValue.
+ * runtime/PropertyDescriptor.h:
+ - Added declaration for sameValue.
+2012-01-09 Gavin Barraclough <barraclough@apple.com>
+
+ Error handling : in ISO8601 timezone
+ https://bugs.webkit.org/show_bug.cgi?id=75919
+
+ Reviewed by Sam Weinig.
+
+ * wtf/DateMath.cpp:
+ (WTF::parseDateFromNullTerminatedCharacters):
+ - need to increment the string position.
+
+2012-01-09 Mark Rowe <mrowe@apple.com>
+
+ JavaScriptCore executable targets shouldn't explicitly depend on the JavaScriptCore framework target
+ <http://webkit.org/b/75907> / <rdar://problem/10659862>
+
+ We'd like for it to be possible to build jsc without building JavaScriptCore.framework and the explicit
+ dependencies prevent this.
+
+ Reviewed by Dan Bernstein.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2012-01-09 Adam Treat <atreat@rim.com>
+
+ Log is a little to verbose for blackberry port
+ https://bugs.webkit.org/show_bug.cgi?id=75728
+
+ The BlackBerry::Platform::Log* functions take care of the call to vfprintf
+ which is resulting in unintentional noise in our logs. Add a conditional
+ directive to fix.
+
+ Change to using BlackBerry::Platform::logStreamV which does not insert
+ threading info and newlines unlike BlackBerry::Platform::log.
+
+ Finally, add log locking and unlocking which the BlackBerry platform
+ uses to ensure that N threads do not trample on each other's logs.
+
+ Reviewed by Rob Buis.
+
+ * wtf/Assertions.cpp:
+ (WTFLogLocker::WTFReportAssertionFailure):
+ (WTFLogLocker::WTFReportAssertionFailureWithMessage):
+ (WTFLogLocker::WTFReportArgumentAssertionFailure):
+ (WTFLogLocker::WTFReportFatalError):
+ (WTFLogLocker::WTFReportError):
+ (WTFLogLocker::WTFLog):
+ (WTFLogLocker::WTFLogVerbose):
+
+2012-01-09 Gavin Barraclough <barraclough@apple.com>
+
+ https://bugs.webkit.org/show_bug.cgi?id=75789
+ defineOwnProperty not implemented for Array objects
+
+ Reviewed by Sam Weinig.
+
+ Implements support for getter/setter & non-default attribute properties on arrays,
+ by forcing them into a dictionary-like 'SparseMode'. This fixes ~300 test-262
+ test failures.
+
+ * JavaScriptCore.exp:
+ - Updated exports.
+ * dfg/DFGOperations.cpp:
+ - JSArray::pop now requires an exec state.
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncPop):
+ - JSArray::pop now requires an exec state.
+ * runtime/JSArray.cpp:
+ (JSC::SparseArrayValueMap::add):
+ - Add a potentially empty entry into the map.
+ (JSC::SparseArrayValueMap::put):
+ - Changed to call setter.
+ (JSC::SparseArrayEntry::get):
+ - calls getters.
+ (JSC::SparseArrayEntry::getNonSparseMode):
+ - does not call getters.
+ (JSC::JSArray::enterSparseMode):
+ - Convert into 'SparseMode' - removes the vectors, don't allow it to be recreated.
+ (JSC::JSArray::putDescriptor):
+ - Create a numeric property based on a descriptor.
+ (JSC::sameValue):
+ - See ES5.1 9.12.
+ (JSC::reject):
+ - Helper for the [[DefineOwnProperty]] algorithm.
+ (JSC::JSArray::defineOwnNumericProperty):
+ - Define an indexed property on an array object.
+ (JSC::JSArray::setLengthWritable):
+ - Marks the length read-only, enters SparseMode as necessary.
+ (JSC::JSArray::defineOwnProperty):
+ - Defines either an indexed property or 'length' on an array object.
+ (JSC::JSArray::getOwnPropertySlotByIndex):
+ - Updated to correctly handle accessor descriptors & attributes.
+ (JSC::JSArray::getOwnPropertyDescriptor):
+ - Updated to correctly handle accessor descriptors & attributes.
+ (JSC::JSArray::put):
+ - Pass strict mode flag to setLength.
+ (JSC::JSArray::putByIndex):
+ - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&.
+ (JSC::JSArray::putByIndexBeyondVectorLength):
+ - Pass exec to SparseArrayValueMap::put.
+ (JSC::JSArray::deletePropertyByIndex):
+ - Do not allow deletion of non-configurable properties.
+ (JSC::compareKeysForQSort):
+ - used in implementation of getOwnPropertyNames.
+ (JSC::JSArray::getOwnPropertyNames):
+ - Properties in the sparse map should be iterated in order.
+ (JSC::JSArray::setLength):
+ - Updated to take a 'shouldThrow' flag, return a result indicating error.
+ (JSC::JSArray::pop):
+ - pop should throw an error if length is not writable, even if the array is empty.
+ (JSC::JSArray::push):
+ - putByIndexBeyondVectorLength requires an ExecState* rather than a JSGloablData&.
+ (JSC::JSArray::sort):
+ - Changed 'get' to 'getNonSparseMode' (can't be getters to call).
+ (JSC::JSArray::compactForSorting):
+ - Changed 'get' to 'getNonSparseMode' (can't be getters to call).
+ * runtime/JSArray.h:
+ (JSC::SparseArrayValueMap::lengthIsReadOnly):
+ - Check if the length is read only.
+ (JSC::SparseArrayValueMap::setLengthIsReadOnly):
+ - Mark the length as read only.
+ (JSC::SparseArrayValueMap::find):
+ - Moved into header.
+ (JSC::JSArray::isLengthWritable):
+ - Wraps SparseArrayValueMap::lengthIsReadOnly.
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::defineOwnProperty):
+ - Should be returning the result of putDescriptor.
+ * runtime/PropertyDescriptor.cpp:
+ (JSC::PropertyDescriptor::attributesOverridingCurrent):
+ - Added attributesOverridingCurrent - this should probably be merged with attributesWithOverride.
+ * runtime/PropertyDescriptor.h:
+ - Added attributesOverridingCurrent.
+
+2012-01-09 Pavel Heimlich <tropikhajma@gmail.com>
+
+ There is no support for fastcall in Solaris Studio.
+ Fixes build on Solaris.
+ https://bugs.webkit.org/show_bug.cgi?id=75736
+
+ Reviewed by Gavin Barraclough.
+
+ * jit/JITStubs.h:
+
+2012-01-09 Pavel Heimlich <tropikhajma@gmail.com>
+
+ Fix build failure on Solaris
+ https://bugs.webkit.org/show_bug.cgi?id=75733
+
+ Reviewed by Gavin Barraclough.
+
+ * wtf/ByteArray.h:
+
+2012-01-01 Raphael Kubo da Costa <kubo@profusion.mobi>
+
+ [CMake] Clean up some cruft from WTF's CMakeLists.txt
+ https://bugs.webkit.org/show_bug.cgi?id=75420
+
+ Reviewed by Daniel Bates.
+
+ * wtf/CMakeLists.txt: Remove the unused WTF_PORT_FLAGS variable; add
+ all needed paths to WTF_INCLUDE_DIRECTORIES in a single place.
+
+2012-01-08 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ Fix compilation error about ListHashSetReverseIterator
+ https://bugs.webkit.org/show_bug.cgi?id=75372
+
+ Reviewed by Darin Adler.
+
+ There is a typo in class ListHashSetReverseIterator:
+ typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_reverse_iterator;
+ Should be
+ typedef ListHashSetConstReverseIterator<ValueArg, inlineCapacity, HashArg> const_reverse_iterator;
+
+ * wtf/ListHashSet.h:
+
+2012-01-08 Ryosuke Niwa <rniwa@webkit.org>
+
+ WinCE build fix after r104415.
+
+ * jit/JITExceptions.cpp:
+ * jit/JITExceptions.h:
+
+2012-01-08 Filip Pizlo <fpizlo@apple.com>
+
+ The JIT's protocol for exception handling should be available to other parts of the system
+ https://bugs.webkit.org/show_bug.cgi?id=75808
+ <rdar://problem/10661025>
+
+ Reviewed by Oliver Hunt.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * Target.pri:
+ * jit/JITExceptions.cpp: Added.
+ (JSC::genericThrow):
+ (JSC::jitThrow):
+ * jit/JITExceptions.h: Added.
+ * jit/JITStubs.cpp:
+ * runtime/JSGlobalData.h:
+
+2012-01-06 Hajime Morrita <morrita@chromium.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=75296
+ JSString should not have JS_EXPORTCLASS annotation
+
+ Reviewed by Kevin Ollivier.
+
+ * runtime/JSString.h: Removed JS_EXPORTCLASS annotation.
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
+ Added missing symbols which were hidden by JS_EXPORTCLASS.
+
+2012-01-06 Michael Saboff <msaboff@apple.com>
+
+ JSArray::pop() should compare SparseArrayValueMap::find() to SparseArrayValueMap::notFound()
+ https://bugs.webkit.org/show_bug.cgi?id=75757
+
+ Reviewed by Gavin Barraclough.
+
+ * runtime/JSArray.cpp:
+ (JSC::JSArray::pop): Changed map->end() to map->notFound().
+
+2012-01-06 Filip Pizlo <fpizlo@apple.com>
+
+ JIT stub slow paths that would be identical to that of an interpreter should be factored out
+ https://bugs.webkit.org/show_bug.cgi?id=75743
+ <rdar://problem/10657024>
+
+ Reviewed by Geoff Garen.
+
+ * GNUmakefile.list.am:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/CommonSlowPaths.h: Added.
+ (JSC::CommonSlowPaths::opInstanceOfSlow):
+ (JSC::CommonSlowPaths::opIn):
+ (JSC::CommonSlowPaths::opResolve):
+ (JSC::CommonSlowPaths::opResolveSkip):
+ (JSC::CommonSlowPaths::opResolveWithBase):
+ (JSC::CommonSlowPaths::opResolveWithThis):
+
+2012-01-06 Sam Weinig <sam@webkit.org>
+
+ Fix windows build.
+
+ * wtf/TypeTraits.cpp:
+
+2012-01-05 Michael Saboff <msaboff@apple.com>
+
+ Default HashTraits for Opcode don't work for Opcode = 0
+ https://bugs.webkit.org/show_bug.cgi?id=75595
+
+ Reviewed by Oliver Hunt.
+
+ Removed the populating of the m_opcodeIDTable table in the
+ case where the OpcodeID and Opcode are the same (m_enabled is false).
+ Instead we just cast the one type to the other.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::initialize):
+ (JSC::Interpreter::isOpcode):
+ * interpreter/Interpreter.h:
+ (JSC::Interpreter::getOpcodeID):
+
+2012-01-06 Sam Weinig <sam@webkit.org>
+
+ Add a DecayArray type trait as a first step towards merging OwnPtr and OwnArrayPtr
+ https://bugs.webkit.org/show_bug.cgi?id=75737
+
+ Reviewed by Anders Carlsson.
+
+ * wtf/TypeTraits.cpp:
+ * wtf/TypeTraits.h:
+ Added a DecayArray trait, that can convert T[] and T[3] -> T*. DecayArray
+ is composed of some helpers which are also exposed, Conditional<>, which
+ can provide one type or another based on a boolean predicate, IsArray<>
+ which can deduce array types, and RemoveExtent<>, which removes the extent
+ from an array type.
+
+2012-01-06 Oliver Hunt <oliver@apple.com>
+
+ GetByteArrayLength is incorrect
+ https://bugs.webkit.org/show_bug.cgi?id=75735
+
+ Reviewed by Filip Pizlo.
+
+ Load the byte array length from the correct location.
+ This stops an existing test from hanging.
+
+ * dfg/DFGSpeculativeJIT32_64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+ * dfg/DFGSpeculativeJIT64.cpp:
+ (JSC::DFG::SpeculativeJIT::compile):
+
+2012-01-06 Filip Pizlo <fpizlo@apple.com>
+
+ Fix build.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+
+2012-01-06 Oliver Hunt <oliver@apple.com>
+
+ DFG no longer optimises CanvasPixelArray
+ https://bugs.webkit.org/show_bug.cgi?id=75729
+
+ Reviewed by Gavin Barraclough.
+
+ Rename ByteArray (in its ClassInfo) to Uint8ClampedArray to match
+ the future name when we switch over to the new typed-array based
+ ImageData specification.
+
+ * runtime/JSByteArray.cpp:
+
+2012-01-06 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ Use HashMap<OwnPtr> for SourceProviderCache items
+ https://bugs.webkit.org/show_bug.cgi?id=75346
+
+ Reviewed by Daniel Bates.
+
+ * parser/Parser.cpp:
+ * parser/SourceProviderCache.cpp:
+ (JSC::SourceProviderCache::clear):
+ (JSC::SourceProviderCache::add):
+ * parser/SourceProviderCache.h:
+
+2012-01-06 Sam Weinig <sam@webkit.org>
+
+ Remove unused OwnFastMallocPtr class.
+ https://bugs.webkit.org/show_bug.cgi?id=75722
+
+ Reviewed by Geoffrey Garen.
+
+ * GNUmakefile.list.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * wtf/CMakeLists.txt:
+ * wtf/OwnFastMallocPtr.h: Removed.
+ * wtf/text/StringImpl.h:
+ * wtf/wtf.pro:
+
+2012-01-06 Benjamin Poulain <bpoulain@webkit.org>
+
+ [Mac] Sort the resources of JavaScriptCore.xcodeproj and remove duplicates
+ https://bugs.webkit.org/show_bug.cgi?id=75631
+
+ Reviewed by Andreas Kling.
+
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+
2012-01-06 Eric Seidel <eric@webkit.org> and Gustavo Noronha Silva <gustavo.noronha@collabora.com>
Make the new WTF module build on Gtk
diff --git a/Source/JavaScriptCore/Configurations/JSC.xcconfig b/Source/JavaScriptCore/Configurations/JSC.xcconfig
index c6b527059..8330d3f27 100644
--- a/Source/JavaScriptCore/Configurations/JSC.xcconfig
+++ b/Source/JavaScriptCore/Configurations/JSC.xcconfig
@@ -21,7 +21,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.
-INSTALL_PATH = $(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/Resources
+INSTALL_PATH = $(JAVASCRIPTCORE_FRAMEWORKS_DIR)/JavaScriptCore.framework/Versions/A/Resources
PRODUCT_NAME = jsc;
CODE_SIGN_ENTITLEMENTS = $(CODE_SIGN_ENTITLEMENTS_$(REAL_PLATFORM_NAME));
CODE_SIGN_ENTITLEMENTS_iphoneos = entitlements.plist;
diff --git a/Source/JavaScriptCore/GNUmakefile.list.am b/Source/JavaScriptCore/GNUmakefile.list.am
index 23c7fdd1c..4fb218199 100644
--- a/Source/JavaScriptCore/GNUmakefile.list.am
+++ b/Source/JavaScriptCore/GNUmakefile.list.am
@@ -81,6 +81,10 @@ javascriptcore_sources += \
Source/JavaScriptCore/assembler/RepatchBuffer.h \
Source/JavaScriptCore/assembler/SH4Assembler.h \
Source/JavaScriptCore/assembler/X86Assembler.h \
+ Source/JavaScriptCore/bytecode/CallLinkInfo.cpp \
+ Source/JavaScriptCore/bytecode/CallLinkInfo.h \
+ Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h \
+ Source/JavaScriptCore/bytecode/CodeType.h \
Source/JavaScriptCore/bytecode/CodeBlock.cpp \
Source/JavaScriptCore/bytecode/CodeBlock.h \
Source/JavaScriptCore/bytecode/CodeOrigin.h \
@@ -88,9 +92,15 @@ javascriptcore_sources += \
Source/JavaScriptCore/bytecode/DFGExitProfile.cpp \
Source/JavaScriptCore/bytecode/DFGExitProfile.h \
Source/JavaScriptCore/bytecode/EvalCodeCache.h \
+ Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h \
+ Source/JavaScriptCore/bytecode/GlobalResolveInfo.h \
+ Source/JavaScriptCore/bytecode/HandelerInfo.h \
Source/JavaScriptCore/bytecode/Instruction.h \
Source/JavaScriptCore/bytecode/JumpTable.cpp \
Source/JavaScriptCore/bytecode/JumpTable.h \
+ Source/JavaScriptCore/bytecode/LineInfo.h \
+ Source/JavaScriptCore/bytecode/MethodCallLinkInfo.cpp \
+ Source/JavaScriptCore/bytecode/MethodCallLinkInfo.h \
Source/JavaScriptCore/bytecode/Opcode.cpp \
Source/JavaScriptCore/bytecode/Opcode.h \
Source/JavaScriptCore/bytecode/PredictedType.cpp \
@@ -260,6 +270,8 @@ javascriptcore_sources += \
Source/JavaScriptCore/jit/JITCode.h \
Source/JavaScriptCore/jit/JIT.cpp \
Source/JavaScriptCore/jit/JIT.h \
+ Source/JavaScriptCore/jit/JITExceptions.cpp \
+ Source/JavaScriptCore/jit/JITExceptions.h \
Source/JavaScriptCore/jit/JITInlineMethods.h \
Source/JavaScriptCore/jit/JITOpcodes32_64.cpp \
Source/JavaScriptCore/jit/JITOpcodes.cpp \
@@ -325,6 +337,7 @@ javascriptcore_sources += \
Source/JavaScriptCore/runtime/ClassInfo.h \
Source/JavaScriptCore/runtime/CommonIdentifiers.cpp \
Source/JavaScriptCore/runtime/CommonIdentifiers.h \
+ Source/JavaScriptCore/runtime/CommonSlowPaths.h \
Source/JavaScriptCore/runtime/Completion.cpp \
Source/JavaScriptCore/runtime/Completion.h \
Source/JavaScriptCore/runtime/ConstructData.cpp \
@@ -607,7 +620,6 @@ javascriptcore_sources += \
Source/JavaScriptCore/wtf/OSRandomSource.cpp \
Source/JavaScriptCore/wtf/OSRandomSource.h \
Source/JavaScriptCore/wtf/OwnArrayPtr.h \
- Source/JavaScriptCore/wtf/OwnFastMallocPtr.h \
Source/JavaScriptCore/wtf/OwnPtr.h \
Source/JavaScriptCore/wtf/OwnPtrCommon.h \
Source/JavaScriptCore/wtf/PackedIntVector.h \
diff --git a/Source/JavaScriptCore/JavaScriptCore.exp b/Source/JavaScriptCore/JavaScriptCore.exp
index c5ce181f1..c79c146e9 100644
--- a/Source/JavaScriptCore/JavaScriptCore.exp
+++ b/Source/JavaScriptCore/JavaScriptCore.exp
@@ -281,11 +281,11 @@ __ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
__ZN3JSC7JSArray13visitChildrenEPNS_6JSCellERNS_11SlotVisitorE
__ZN3JSC7JSArray14finishCreationERNS_12JSGlobalDataEj
__ZN3JSC7JSArray15setSubclassDataEPv
+__ZN3JSC7JSArray17defineOwnPropertyEPNS_8JSObjectEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorEb
__ZN3JSC7JSArray25getOwnPropertySlotByIndexEPNS_6JSCellEPNS_9ExecStateEjRNS_12PropertySlotE
__ZN3JSC7JSArray30tryFinishCreationUninitializedERNS_12JSGlobalDataEj
__ZN3JSC7JSArray6s_infoE
__ZN3JSC7JSArray7destroyEPNS_6JSCellE
-__ZN3JSC7JSArray9setLengthEj
__ZN3JSC7JSArrayC1ERNS_12JSGlobalDataEPNS_9StructureE
__ZN3JSC7JSArrayC2ERNS_12JSGlobalDataEPNS_9StructureE
__ZN3JSC7JSArrayD2Ev
diff --git a/Source/JavaScriptCore/JavaScriptCore.gypi b/Source/JavaScriptCore/JavaScriptCore.gypi
index 09b2680f5..c9367911b 100644
--- a/Source/JavaScriptCore/JavaScriptCore.gypi
+++ b/Source/JavaScriptCore/JavaScriptCore.gypi
@@ -182,7 +182,6 @@
'wtf/NullPtr.h',
'wtf/OSAllocator.h',
'wtf/OwnArrayPtr.h',
- 'wtf/OwnFastMallocPtr.h',
'wtf/OwnPtr.h',
'wtf/OwnPtrCommon.h',
'wtf/PageAllocation.h',
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
index 9ee61eaab..577329e94 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
@@ -296,12 +296,12 @@ EXPORTS
?retrieveLastCaller@Interpreter@JSC@@QBEXPAVExecState@2@AAH1AAVUString@2@AAVJSValue@2@@Z
?s_globalObjectMethodTable@JSGlobalObject@JSC@@1UGlobalObjectMethodTable@2@B
?s_info@ExecutableBase@JSC@@2UClassInfo@2@B
+ ?s_info@JSString@JSC@@2UClassInfo@2@B
?setConfigurable@PropertyDescriptor@JSC@@QAEX_N@Z
?setDescriptor@PropertyDescriptor@JSC@@QAEXVJSValue@2@I@Z
?setDumpsGeneratedCode@BytecodeGenerator@JSC@@SAX_N@Z
?setEnumerable@PropertyDescriptor@JSC@@QAEX_N@Z
?setGetter@PropertyDescriptor@JSC@@QAEXVJSValue@2@@Z
- ?setLength@JSArray@JSC@@QAEXI@Z
?setLoc@StatementNode@JSC@@QAEXHH@Z
?setMainThreadCallbacksPaused@WTF@@YAX_N@Z
?setOrderLowerFirst@Collator@WTF@@QAEX_N@Z
@@ -336,6 +336,7 @@ EXPORTS
?timedWait@ThreadCondition@WTF@@QAE_NAAVMutex@2@N@Z
?tlsKeyCount@WTF@@YAAAJXZ
?tlsKeys@WTF@@YAPAKXZ
+ ?toBoolean@JSString@JSC@@QBE_NPAVExecState@2@@Z
?toInt32@JSC@@YAHN@Z
?toInteger@JSValue@JSC@@QBENPAVExecState@2@@Z
?toNumberSlowCase@JSValue@JSC@@ABENPAVExecState@2@@Z
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index 888269623..8fd3c8ab0 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -594,6 +594,10 @@
>
</File>
<File
+ RelativePath="..\..\runtime\CommonSlowPaths.h"
+ >
+ </File>
+ <File
RelativePath="..\..\runtime\Completion.cpp"
>
</File>
@@ -1446,6 +1450,46 @@
Name="bytecode"
>
<File
+ RelativePath="..\..\bytecode\HandlerInfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\CallLinkInfo.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\LineInfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\MethodCallLinkInfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\CallReturnOffsetToBytecodeOffset.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\CodeType.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\ExpressionRangeInfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\MethodCallLinkInfo.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\CallLinkInfo.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\bytecode\GlobalResolveInfo.h"
+ >
+ </File>
+ <File
RelativePath="..\..\bytecode\CodeBlock.cpp"
>
</File>
@@ -1706,6 +1750,14 @@
>
</File>
<File
+ RelativePath="..\..\jit\JITExceptions.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\jit\JITExceptions.h"
+ >
+ </File>
+ <File
RelativePath="..\..\jit\JITStubs.cpp"
>
</File>
diff --git a/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj b/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
index 6491d00e1..6e89b0167 100644
--- a/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
+++ b/Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTF.vcproj
@@ -965,10 +965,6 @@
>
</File>
<File
- RelativePath="..\..\wtf\OwnFastMallocPtr.h"
- >
- </File>
- <File
RelativePath="..\..\wtf\OwnPtr.h"
>
</File>
diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index e095e5ddc..8685f097f 100644
--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -47,8 +47,18 @@
0B4D7E630F319AC800AD7E58 /* TypeTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B4D7E620F319AC800AD7E58 /* TypeTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
0BAC94A01338728400CF135B /* ThreadRestrictionVerifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BAC949E1338728400CF135B /* ThreadRestrictionVerifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
0BCD83571485845200EA2003 /* TemporaryChange.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BCD83541485841200EA2003 /* TemporaryChange.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 0BDFFAE10FC6193100D69EF4 /* OwnFastMallocPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
0BF28A2911A33DC300638F84 /* SizeLimits.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BF28A2811A33DC300638F84 /* SizeLimits.cpp */; };
+ 0F0B83A714BCF50700885B4F /* CodeType.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A514BCF50400885B4F /* CodeType.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83A914BCF56200885B4F /* HandlerInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83AB14BCF5BB00885B4F /* ExpressionRangeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83AD14BCF60400885B4F /* LineInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AC14BCF60200885B4F /* LineInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */; };
+ 0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83B414BCF86000885B4F /* MethodCallLinkInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F0B83B214BCF85E00885B4F /* MethodCallLinkInfo.cpp */; };
+ 0F0B83B514BCF86200885B4F /* MethodCallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83B714BCF8E100885B4F /* GlobalResolveInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F15F15F14B7A73E005DE37D /* CommonSlowPaths.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F16D726142C39C000CF784A /* BitVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F16D724142C39A200CF784A /* BitVector.cpp */; };
0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F2C556F14738F3100121E4F /* DFGCodeBlocks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -58,6 +68,8 @@
0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A461460CBAB00131F8F /* VirtualRegister.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F426A4A1460CD6B00131F8F /* DataFormat.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F431738146BAC69007E3890 /* ListableHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F431736146BAC65007E3890 /* ListableHandler.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F46808014BA572700BFE272 /* JITExceptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 0F46808314BA573100BFE272 /* JITExceptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F46807F14BA572700BFE272 /* JITExceptions.cpp */; };
0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620172143FCD2F0068B77C /* DFGVariableAccessData.h */; settings = {ATTRIBUTES = (Private, ); }; };
0F620175143FCD370068B77C /* DFGOperands.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F620171143FCD2F0068B77C /* DFGOperands.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -289,7 +301,7 @@
651122FE14046A4C002B101D /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D5D8AD00E0D0EBE00F9C692 /* libedit.dylib */; };
6511230714046B0A002B101D /* testRegExp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 651122E5140469BA002B101D /* testRegExp.cpp */; };
651DCA04136A6FEF00F74194 /* PassTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 651DCA02136A6FAB00F74194 /* PassTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; };
+ 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */ = {isa = PBXBuildFile; fileRef = 65303D631447B9E100D3F904 /* ParserTokens.h */; settings = {ATTRIBUTES = (Private, ); }; };
655EB29B10CE2581001A990E /* NodesCodegen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 655EB29A10CE2581001A990E /* NodesCodegen.cpp */; };
65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65DFC92D08EA173A00F7300B /* HashTable.cpp */; };
65E1A3DF122B894500B26097 /* NonCopyingSort.h in Headers */ = {isa = PBXBuildFile; fileRef = 65E1A2F4122B880D00B26097 /* NonCopyingSort.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -710,7 +722,7 @@
E48E0F2D0F82151700A8CA37 /* FastAllocBase.h in Headers */ = {isa = PBXBuildFile; fileRef = E48E0F2C0F82151700A8CA37 /* FastAllocBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
E49DC16B12EF293E00184A1F /* SourceProviderCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E49DC15512EF277200184A1F /* SourceProviderCache.cpp */; };
E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC15112EF272200184A1F /* SourceProviderCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
- E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */; };
+ E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */ = {isa = PBXBuildFile; fileRef = E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
E4D8CEFB12FC439600BC9F5A /* BloomFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D8CE9B12FC42E100BC9F5A /* BloomFilter.h */; settings = {ATTRIBUTES = (Private, ); }; };
F3BD31ED126735770065467F /* TextPosition.h in Headers */ = {isa = PBXBuildFile; fileRef = F3BD31D0126730180065467F /* TextPosition.h */; settings = {ATTRIBUTES = (Private, ); }; };
FDA15C1E12B0305C003A583A /* Complex.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA15C1612B03028003A583A /* Complex.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -718,13 +730,6 @@
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
- 141211350A48796100480255 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 932F5B3E0822A1C700736975;
- remoteInfo = JavaScriptCore;
- };
141214BE0A49190E00480255 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -732,20 +737,6 @@
remoteGlobalIDString = 1412111F0A48793C00480255;
remoteInfo = minidom;
};
- 14270B070A451DA10080EEEA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 932F5B3E0822A1C700736975;
- remoteInfo = JavaScriptCore;
- };
- 14270B0B0A451DA40080EEEA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 932F5B3E0822A1C700736975;
- remoteInfo = JavaScriptCore;
- };
14BD59C60A3E8FA400BAF59C /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -753,13 +744,6 @@
remoteGlobalIDString = 14BD59BE0A3E8F9000BAF59C;
remoteInfo = testapi;
};
- 651122F914046A4C002B101D /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 932F5B3E0822A1C700736975;
- remoteInfo = JavaScriptCore;
- };
651123081404768B002B101D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
@@ -830,8 +814,18 @@
0B4D7E620F319AC800AD7E58 /* TypeTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeTraits.h; sourceTree = "<group>"; };
0BAC949E1338728400CF135B /* ThreadRestrictionVerifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadRestrictionVerifier.h; sourceTree = "<group>"; };
0BCD83541485841200EA2003 /* TemporaryChange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TemporaryChange.h; sourceTree = "<group>"; };
- 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnFastMallocPtr.h; sourceTree = "<group>"; };
0BF28A2811A33DC300638F84 /* SizeLimits.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SizeLimits.cpp; sourceTree = "<group>"; };
+ 0F0B83A514BCF50400885B4F /* CodeType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CodeType.h; sourceTree = "<group>"; };
+ 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HandlerInfo.h; sourceTree = "<group>"; };
+ 0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpressionRangeInfo.h; sourceTree = "<group>"; };
+ 0F0B83AC14BCF60200885B4F /* LineInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LineInfo.h; sourceTree = "<group>"; };
+ 0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallLinkInfo.cpp; sourceTree = "<group>"; };
+ 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallLinkInfo.h; sourceTree = "<group>"; };
+ 0F0B83B214BCF85E00885B4F /* MethodCallLinkInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MethodCallLinkInfo.cpp; sourceTree = "<group>"; };
+ 0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MethodCallLinkInfo.h; sourceTree = "<group>"; };
+ 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GlobalResolveInfo.h; sourceTree = "<group>"; };
+ 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallReturnOffsetToBytecodeOffset.h; sourceTree = "<group>"; };
+ 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonSlowPaths.h; sourceTree = "<group>"; };
0F16D724142C39A200CF784A /* BitVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BitVector.cpp; sourceTree = "<group>"; };
0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakReferenceHarvester.h; sourceTree = "<group>"; };
0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DFGCodeBlocks.cpp; sourceTree = "<group>"; };
@@ -841,6 +835,8 @@
0F426A461460CBAB00131F8F /* VirtualRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VirtualRegister.h; sourceTree = "<group>"; };
0F426A4A1460CD6B00131F8F /* DataFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataFormat.h; sourceTree = "<group>"; };
0F431736146BAC65007E3890 /* ListableHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ListableHandler.h; sourceTree = "<group>"; };
+ 0F46807F14BA572700BFE272 /* JITExceptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITExceptions.cpp; sourceTree = "<group>"; };
+ 0F46808014BA572700BFE272 /* JITExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITExceptions.h; sourceTree = "<group>"; };
0F5F08CC146BE602000472A9 /* DFGByteCodeCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGByteCodeCache.h; path = dfg/DFGByteCodeCache.h; sourceTree = "<group>"; };
0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnconditionalFinalizer.h; sourceTree = "<group>"; };
0F62016D143FCD2F0068B77C /* DFGAbstractState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGAbstractState.cpp; path = dfg/DFGAbstractState.cpp; sourceTree = "<group>"; };
@@ -1574,9 +1570,9 @@
buildActionMask = 2147483647;
files = (
932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */,
+ A731B25A130093880040A7FA /* Foundation.framework in Frameworks */,
932F5BD70822A1C700736975 /* libicucore.dylib in Frameworks */,
932F5BD60822A1C700736975 /* libobjc.dylib in Frameworks */,
- A731B25A130093880040A7FA /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1698,6 +1694,8 @@
1429D92C0ED22D7000B89619 /* jit */ = {
isa = PBXGroup;
children = (
+ 0F46807F14BA572700BFE272 /* JITExceptions.cpp */,
+ 0F46808014BA572700BFE272 /* JITExceptions.h */,
0FD82E37141AB14200179C94 /* CompactJITCodeMap.h */,
A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */,
A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */,
@@ -1717,11 +1715,11 @@
960626950FB8EC02009798AB /* JITStubCall.h */,
14A23D6C0F4E19CE0023CDAD /* JITStubs.cpp */,
14A6581A0F4E36F4000150FD /* JITStubs.h */,
+ A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */,
A76C51741182748D00715B05 /* JSInterfaceJIT.h */,
A7386551118697B400540279 /* SpecializedThunkJIT.h */,
A7386552118697B400540279 /* ThunkGenerators.cpp */,
A7386553118697B400540279 /* ThunkGenerators.h */,
- A76F54A213B28AAB00EF2BCE /* JITWriteBarrier.h */,
);
path = jit;
sourceTree = "<group>";
@@ -1729,15 +1727,13 @@
142E312A134FF0A600AFADB5 /* heap */ = {
isa = PBXGroup;
children = (
- 0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */,
- 0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */,
- 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */,
- 0F431736146BAC65007E3890 /* ListableHandler.h */,
A70456AE1427FB030037DA68 /* AllocationSpace.cpp */,
A70456AF1427FB150037DA68 /* AllocationSpace.h */,
A7521E121429169A003C8D0C /* CardSet.h */,
146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */,
149DAAF212EB559D0083B12B /* ConservativeRoots.h */,
+ 0F2C556D14738F2E00121E4F /* DFGCodeBlocks.cpp */,
+ 0F2C556E14738F2E00121E4F /* DFGCodeBlocks.h */,
142E312B134FF0A600AFADB5 /* Handle.h */,
142E312C134FF0A600AFADB5 /* HandleHeap.cpp */,
142E312D134FF0A600AFADB5 /* HandleHeap.h */,
@@ -1747,6 +1743,7 @@
14BA7A9513AADFF8005B7C2C /* Heap.cpp */,
14BA7A9613AADFF8005B7C2C /* Heap.h */,
14F97446138C853E00DA1C67 /* HeapRootVisitor.h */,
+ 0F431736146BAC65007E3890 /* ListableHandler.h */,
142E3130134FF0A600AFADB5 /* Local.h */,
142E3131134FF0A600AFADB5 /* LocalScope.h */,
14B7233F12D7D0DA003BD5ED /* MachineStackMarker.cpp */,
@@ -1754,20 +1751,21 @@
142D6F0613539A2800B02E86 /* MarkedBlock.cpp */,
142D6F0713539A2800B02E86 /* MarkedBlock.h */,
141448CA13A176EC00F5BA1A /* MarkedBlockSet.h */,
- 142D6F0E13539A4100B02E86 /* MarkStack.cpp */,
- 142D6F0F13539A4100B02E86 /* MarkStack.h */,
14D2F3D8139F4BE200491031 /* MarkedSpace.cpp */,
14D2F3D9139F4BE200491031 /* MarkedSpace.h */,
+ 142D6F0E13539A4100B02E86 /* MarkStack.cpp */,
+ 142D6F0F13539A4100B02E86 /* MarkStack.h */,
14BA78F013AAB88F005B7C2C /* SlotVisitor.h */,
142E3132134FF0A600AFADB5 /* Strong.h */,
+ 145722851437E140005FDE26 /* StrongInlines.h */,
141448CC13A1783700F5BA1A /* TinyBloomFilter.h */,
+ 0F5F08CE146C762F000472A9 /* UnconditionalFinalizer.h */,
0FC815121405118600CFA603 /* VTableSpectrum.cpp */,
0FC815141405118D00CFA603 /* VTableSpectrum.h */,
142E3133134FF0A600AFADB5 /* Weak.h */,
0F242DA513F3B1BB007ADD4C /* WeakReferenceHarvester.h */,
0FC8150814043BCA00CFA603 /* WriteBarrierSupport.cpp */,
0FC8150914043BD200CFA603 /* WriteBarrierSupport.h */,
- 145722851437E140005FDE26 /* StrongInlines.h */,
);
path = heap;
sourceTree = "<group>";
@@ -1775,11 +1773,11 @@
1432EBD70A34CAD400717B9F /* API */ = {
isa = PBXGroup;
children = (
- 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */,
1482B78A0A4305AB00517CFC /* APICast.h */,
865F408710E7D56300947361 /* APIShims.h */,
1CAA8B4A0D32C39A0041BCFF /* JavaScript.h */,
1CAA8B4B0D32C39A0041BCFF /* JavaScriptCore.h */,
+ 1C9051430BA9E8A70081E9D0 /* JavaScriptCore.xcconfig */,
BC0894D50FAFBA2D00001865 /* JSAPIValueWrapper.cpp */,
BC0894D60FAFBA2D00001865 /* JSAPIValueWrapper.h */,
1421359A0A677F4F00A8195E /* JSBase.cpp */,
@@ -1993,7 +1991,6 @@
97941A3F130299DB004A3447 /* OSRandomSource.cpp */,
97941A40130299DB004A3447 /* OSRandomSource.h */,
9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */,
- 0BDFFAD10FC616EC00D69EF4 /* OwnFastMallocPtr.h */,
9303F567099118FA00AD71B8 /* OwnPtr.h */,
440B7AED0FAF7FCB0073323E /* OwnPtrCommon.h */,
0F636D9F142D27D200B2E66A /* PackedIntVector.h */,
@@ -2091,7 +2088,6 @@
7E39D8370EC3A388003AF11A /* parser */ = {
isa = PBXGroup;
children = (
- 65303D631447B9E100D3F904 /* ParserTokens.h */,
A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */,
93F1981A08245AAE001E9ABC /* Keywords.table */,
F692A8650255597D01FF60F7 /* Lexer.cpp */,
@@ -2104,12 +2100,13 @@
93F0B3AA09BB4DC00068FCE3 /* Parser.h */,
93052C320FB792190048FDC3 /* ParserArena.cpp */,
93052C330FB792190048FDC3 /* ParserArena.h */,
+ 65303D631447B9E100D3F904 /* ParserTokens.h */,
869EBCB60E8C6D4A008722CC /* ResultType.h */,
65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */,
+ 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */,
E49DC15512EF277200184A1F /* SourceProviderCache.cpp */,
E49DC15112EF272200184A1F /* SourceProviderCache.h */,
E49DC14912EF261A00184A1F /* SourceProviderCacheItem.h */,
- 65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */,
A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */,
);
path = parser;
@@ -2118,8 +2115,7 @@
7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = {
isa = PBXGroup;
children = (
- 0F7700911402FF280078EB39 /* SamplingCounter.cpp */,
- 0F77008E1402FDD60078EB39 /* SamplingCounter.h */,
+ 0F15F15D14B7A73A005DE37D /* CommonSlowPaths.h */,
BCF605110E203EF800B9A64D /* ArgList.cpp */,
BCF605120E203EF800B9A64D /* ArgList.h */,
BC257DE50E1F51C50016B6C9 /* Arguments.cpp */,
@@ -2203,8 +2199,8 @@
A8E894330CD0603F00367179 /* JSGlobalObject.h */,
BC756FC60E2031B200DE7D12 /* JSGlobalObjectFunctions.cpp */,
BC756FC70E2031B200DE7D12 /* JSGlobalObjectFunctions.h */,
- 8604F503143CE1C100B295F5 /* JSGlobalThis.h */,
BC3C4C9F1458F5450025FB62 /* JSGlobalThis.cpp */,
+ 8604F503143CE1C100B295F5 /* JSGlobalThis.h */,
65EA4C99092AF9E20093D800 /* JSLock.cpp */,
65EA4C9A092AF9E20093D800 /* JSLock.h */,
A72700780DAC605600E548D7 /* JSNotAnObject.cpp */,
@@ -2378,8 +2374,8 @@
0FC0977E1469EBC400CF2442 /* DFGCommon.h */,
0FC0979D146B271E00CF2442 /* DFGCorrectableJumpPoint.cpp */,
0FC0979A146A772000CF2442 /* DFGCorrectableJumpPoint.h */,
- 0FD3C82214115D0E00FD81CB /* DFGDriver.h */,
0FD3C82014115CF800FD81CB /* DFGDriver.cpp */,
+ 0FD3C82214115D0E00FD81CB /* DFGDriver.h */,
86AE6C4B136A11E400963012 /* DFGFPRInfo.h */,
86EC9DB61328DF82002B2AD7 /* DFGGenerationInfo.h */,
86AE6C4C136A11E400963012 /* DFGGPRInfo.h */,
@@ -2389,6 +2385,8 @@
86EC9DBC1328DF82002B2AD7 /* DFGJITCompiler.h */,
86ECA3E9132DEF1C002B2AD7 /* DFGNode.h */,
0F620171143FCD2F0068B77C /* DFGOperands.h */,
+ 86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */,
+ 86EC9DC01328DF82002B2AD7 /* DFGOperations.h */,
0FD82E52141DAEDE00179C94 /* DFGOSREntry.cpp */,
0FD82E53141DAEDE00179C94 /* DFGOSREntry.h */,
0FC0978E146A6F6300CF2442 /* DFGOSRExit.cpp */,
@@ -2397,10 +2395,8 @@
0FC0976F14693AEF00CF2442 /* DFGOSRExitCompiler.h */,
0FC09775146943AD00CF2442 /* DFGOSRExitCompiler32_64.cpp */,
0FC0977014693AEF00CF2442 /* DFGOSRExitCompiler64.cpp */,
- 86EC9DBF1328DF82002B2AD7 /* DFGOperations.cpp */,
- 86EC9DC01328DF82002B2AD7 /* DFGOperations.h */,
- 0FD3C82414115D2200FD81CB /* DFGPropagator.h */,
0FD3C82314115D1A00FD81CB /* DFGPropagator.cpp */,
+ 0FD3C82414115D2200FD81CB /* DFGPropagator.h */,
86EC9DC11328DF82002B2AD7 /* DFGRegisterBank.h */,
86BB09BE138E381B0056702F /* DFGRepatch.cpp */,
86BB09BF138E381B0056702F /* DFGRepatch.h */,
@@ -2450,8 +2446,8 @@
860161DF0F3A83C100F84710 /* AbstractMacroAssembler.h */,
86D3B2BF10156BDE002865E7 /* ARMAssembler.cpp */,
86D3B2C010156BDE002865E7 /* ARMAssembler.h */,
- 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */,
A74DE1CB120B86D600D40D5B /* ARMv7Assembler.cpp */,
+ 86ADD1430FDDEA980006EEC2 /* ARMv7Assembler.h */,
9688CB130ED12B4E001D649F /* AssemblerBuffer.h */,
86D3B2C110156BDE002865E7 /* AssemblerBufferWithConstantPool.h */,
86E116B00FE75AC800B512BC /* CodeLocation.h */,
@@ -2478,29 +2474,39 @@
969A078F0ED1D3AE00F1F681 /* bytecode */ = {
isa = PBXGroup;
children = (
- 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */,
- 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */,
- 0F426A4A1460CD6B00131F8F /* DataFormat.h */,
- 0F426A451460CBAB00131F8F /* ValueRecovery.h */,
- 0F426A461460CBAB00131F8F /* VirtualRegister.h */,
- 0FBD7E671447998F00481315 /* CodeOrigin.h */,
- 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */,
- 0FD82E84141F3FDA00179C94 /* PredictedType.cpp */,
- 0FD82E4F141DAEA100179C94 /* PredictedType.h */,
- 0FD82E50141DAEA100179C94 /* PredictionTracker.h */,
- 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */,
+ 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */,
+ 0F0B83B614BCF8DF00885B4F /* GlobalResolveInfo.h */,
+ 0F0B83B214BCF85E00885B4F /* MethodCallLinkInfo.cpp */,
+ 0F0B83B314BCF85E00885B4F /* MethodCallLinkInfo.h */,
+ 0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */,
+ 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */,
+ 0F0B83AC14BCF60200885B4F /* LineInfo.h */,
+ 0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */,
+ 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */,
+ 0F0B83A514BCF50400885B4F /* CodeType.h */,
969A07900ED1D3AE00F1F681 /* CodeBlock.cpp */,
969A07910ED1D3AE00F1F681 /* CodeBlock.h */,
+ 0FBD7E671447998F00481315 /* CodeOrigin.h */,
+ 0F426A4A1460CD6B00131F8F /* DataFormat.h */,
+ 0FBC0AE41496C7C100D4FBDD /* DFGExitProfile.cpp */,
+ 0FBC0AE51496C7C100D4FBDD /* DFGExitProfile.h */,
969A07920ED1D3AE00F1F681 /* EvalCodeCache.h */,
969A07930ED1D3AE00F1F681 /* Instruction.h */,
BCFD8C900EEB2EE700283848 /* JumpTable.cpp */,
BCFD8C910EEB2EE700283848 /* JumpTable.h */,
969A07940ED1D3AE00F1F681 /* Opcode.cpp */,
969A07950ED1D3AE00F1F681 /* Opcode.h */,
+ 0FD82E84141F3FDA00179C94 /* PredictedType.cpp */,
+ 0FD82E4F141DAEA100179C94 /* PredictedType.h */,
+ 0FD82E50141DAEA100179C94 /* PredictionTracker.h */,
1429D8830ED21C3D00B89619 /* SamplingTool.cpp */,
1429D8840ED21C3D00B89619 /* SamplingTool.h */,
BCCF0D0B0EF0B8A500413C8F /* StructureStubInfo.cpp */,
BCCF0D070EF0AAB900413C8F /* StructureStubInfo.h */,
+ 0FD82E8E14207A5100179C94 /* ValueProfile.cpp */,
+ 0F963B3613FC6FDE0002D9B2 /* ValueProfile.h */,
+ 0F426A451460CBAB00131F8F /* ValueRecovery.h */,
+ 0F426A461460CBAB00131F8F /* VirtualRegister.h */,
);
path = bytecode;
sourceTree = "<group>";
@@ -2508,13 +2514,18 @@
C22C524813FAF6EF00B7DC0D /* dtoa */ = {
isa = PBXGroup;
children = (
+ C22C529613FAF6EF00B7DC0D /* COPYING */,
+ C22C52A013FAF6EF00B7DC0D /* LICENSE */,
+ C22C52A113FAF6EF00B7DC0D /* Makefile */,
+ C22C52A213FAF6EF00B7DC0D /* README */,
+ C22C52A313FAF6EF00B7DC0D /* SConscript */,
+ C22C52A413FAF6EF00B7DC0D /* SConstruct */,
C22C529013FAF6EF00B7DC0D /* bignum-dtoa.cc */,
C22C529113FAF6EF00B7DC0D /* bignum-dtoa.h */,
C22C529213FAF6EF00B7DC0D /* bignum.cc */,
C22C529313FAF6EF00B7DC0D /* bignum.h */,
C22C529413FAF6EF00B7DC0D /* cached-powers.cc */,
C22C529513FAF6EF00B7DC0D /* cached-powers.h */,
- C22C529613FAF6EF00B7DC0D /* COPYING */,
C22C529713FAF6EF00B7DC0D /* diy-fp.cc */,
C22C529813FAF6EF00B7DC0D /* diy-fp.h */,
C22C529913FAF6EF00B7DC0D /* double-conversion.cc */,
@@ -2524,11 +2535,6 @@
C22C529D13FAF6EF00B7DC0D /* fast-dtoa.h */,
C22C529E13FAF6EF00B7DC0D /* fixed-dtoa.cc */,
C22C529F13FAF6EF00B7DC0D /* fixed-dtoa.h */,
- C22C52A013FAF6EF00B7DC0D /* LICENSE */,
- C22C52A113FAF6EF00B7DC0D /* Makefile */,
- C22C52A213FAF6EF00B7DC0D /* README */,
- C22C52A313FAF6EF00B7DC0D /* SConscript */,
- C22C52A413FAF6EF00B7DC0D /* SConstruct */,
C22C52B913FAF6EF00B7DC0D /* strtod.cc */,
C22C52BA13FAF6EF00B7DC0D /* strtod.h */,
C22C52BB13FAF6EF00B7DC0D /* utils.h */,
@@ -2578,9 +2584,9 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */,
- 434A8E7114956A50009126F7 /* ASCIIFastPath.h in Headers */,
860161E30F3A83C100F84710 /* AbstractMacroAssembler.h in Headers */,
+ A1D764521354448B00C5C7C0 /* Alignment.h in Headers */,
+ A70456B01427FB910037DA68 /* AllocationSpace.h in Headers */,
BC18C3E40E16F5CD00B34460 /* AlwaysInline.h in Headers */,
BC18C3E50E16F5CD00B34460 /* APICast.h in Headers */,
865F408810E7D56300947361 /* APIShims.h in Headers */,
@@ -2588,31 +2594,13 @@
BC257DE80E1F51C50016B6C9 /* Arguments.h in Headers */,
86D3B2C410156BDE002865E7 /* ARMAssembler.h in Headers */,
86ADD1450FDDEA980006EEC2 /* ARMv7Assembler.h in Headers */,
- 1429D8860ED21C3D00B89619 /* SamplingTool.h in Headers */,
- 969A072C0ED1CE6900F1F681 /* SegmentedVector.h in Headers */,
- 93052C350FB792190048FDC3 /* ParserArena.h in Headers */,
- BC18C43F0E16F5CD00B34460 /* Nodes.h in Headers */,
- 86CAFEE31035DDE60028A609 /* Executable.h in Headers */,
- 145722861437E140005FDE26 /* StrongInlines.h in Headers */,
- 0FD82F4B142806A100179C94 /* BitVector.h in Headers */,
- 0FD82E85141F3FE300179C94 /* BoundsCheckedPointer.h in Headers */,
- 0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */,
- 0FD82E55141DAEEE00179C94 /* PredictionTracker.h in Headers */,
- 0FD82E54141DAEEE00179C94 /* PredictedType.h in Headers */,
- 0FD82E39141AB14D00179C94 /* CompactJITCodeMap.h in Headers */,
+ A73BE169148420520091204B /* ArrayBuffer.h in Headers */,
+ A73BE16B148420520091204B /* ArrayBufferView.h in Headers */,
BC18C3E60E16F5CD00B34460 /* ArrayConstructor.h in Headers */,
- BC18C46E0E16F5CD00B34460 /* TCSpinLock.h in Headers */,
- 0F963B2F13FC66BB0002D9B2 /* MetaAllocatorHandle.h in Headers */,
- 0F963B2D13F854020002D9B2 /* MetaAllocator.h in Headers */,
- 0F963B2713F753BB0002D9B2 /* RedBlackTree.h in Headers */,
- 0FC815151405119B00CFA603 /* VTableSpectrum.h in Headers */,
- C22B31B9140577D700DB475A /* SamplingCounter.h in Headers */,
- 0FC8150A14043BF500CFA603 /* WriteBarrierSupport.h in Headers */,
- 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
- C2EE59A013FC973F009CEAFE /* DecimalNumber.h in Headers */,
BC18C3E70E16F5CD00B34460 /* ArrayPrototype.h in Headers */,
BC18C5240E16FC8A00B34460 /* ArrayPrototype.lut.h in Headers */,
BC18C3E90E16F5CD00B34460 /* ASCIICType.h in Headers */,
+ 434A8E7114956A50009126F7 /* ASCIIFastPath.h in Headers */,
9688CB150ED12B4E001D649F /* AssemblerBuffer.h in Headers */,
86D3B2C510156BDE002865E7 /* AssemblerBufferWithConstantPool.h in Headers */,
BC18C3EA0E16F5CD00B34460 /* Assertions.h in Headers */,
@@ -2623,31 +2611,45 @@
868BFA0A117CEFD100B908B1 /* AtomicStringImpl.h in Headers */,
BC18C3EB0E16F5CD00B34460 /* AVLTree.h in Headers */,
147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
+ 866739D213BFDE710023D87C /* BigInteger.h in Headers */,
+ C22C52F213FAF6EF00B7DC0D /* bignum-dtoa.h in Headers */,
+ C22C52F413FAF6EF00B7DC0D /* bignum.h in Headers */,
+ 1A08277A142168D70090CCAC /* BinarySemaphore.h in Headers */,
DD377CBC12072C18006A2517 /* Bitmap.h in Headers */,
+ 0FD82F4B142806A100179C94 /* BitVector.h in Headers */,
A7C40C0A130B057D00D002A1 /* BlockStack.h in Headers */,
E4D8CEFB12FC439600BC9F5A /* BloomFilter.h in Headers */,
BC18C3EC0E16F5CD00B34460 /* BooleanObject.h in Headers */,
+ 0FD82E85141F3FE300179C94 /* BoundsCheckedPointer.h in Headers */,
86676D5211FED9BC004B6863 /* BumpPointerAllocator.h in Headers */,
A7A1F7AD0F252B3C00E184E2 /* ByteArray.h in Headers */,
969A07230ED1CE3300F1F681 /* BytecodeGenerator.h in Headers */,
+ C22C52F613FAF6EF00B7DC0D /* cached-powers.h in Headers */,
869D04AF1193B54D00803475 /* CachedTranscendentalFunction.h in Headers */,
BC18C3ED0E16F5CD00B34460 /* CallData.h in Headers */,
1429D8DE0ED2205B00B89619 /* CallFrame.h in Headers */,
95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */,
+ A7521E131429169A003C8D0C /* CardSet.h in Headers */,
2CFC5D1E12F45B48004914E2 /* CharacterNames.h in Headers */,
+ A7BC0C82140608B000B1BB71 /* CheckedArithmetic.h in Headers */,
BC6AAAE50E1F426500AD87D8 /* ClassInfo.h in Headers */,
969A07970ED1D3AE00F1F681 /* CodeBlock.h in Headers */,
86E116B10FE75AC800B512BC /* CodeLocation.h in Headers */,
+ 0FBD7E691447999600481315 /* CodeOrigin.h in Headers */,
BC18C3F00E16F5CD00B34460 /* Collator.h in Headers */,
BC18C3F30E16F5CD00B34460 /* CommonIdentifiers.h in Headers */,
+ 0FD82E39141AB14D00179C94 /* CompactJITCodeMap.h in Headers */,
+ BC66BAE413F492CC00C23FAE /* Compiler.h in Headers */,
BC18C3F40E16F5CD00B34460 /* Completion.h in Headers */,
FDA15C1E12B0305C003A583A /* Complex.h in Headers */,
BC18C3F50E16F5CD00B34460 /* config.h in Headers */,
144836E7132DA7BE005BE785 /* ConservativeRoots.h in Headers */,
BC18C3F60E16F5CD00B34460 /* ConstructData.h in Headers */,
+ 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
97941A7F1302A098004A3447 /* CryptographicallyRandomNumber.h in Headers */,
86565743115BE3DA00291F40 /* CString.h in Headers */,
180B9B080F16D94F009BDBC5 /* CurrentTime.h in Headers */,
+ 0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
BCD2034A0E17135E002C7E82 /* DateConstructor.h in Headers */,
41359CF30FDD89AD00206180 /* DateConversion.h in Headers */,
BC1166020E1997B4008066DD /* DateInstance.h in Headers */,
@@ -2658,20 +2660,41 @@
BC18C3FA0E16F5CD00B34460 /* Debugger.h in Headers */,
BC3135640F302FA3003DFD3A /* DebuggerActivation.h in Headers */,
BC18C3FB0E16F5CD00B34460 /* DebuggerCallFrame.h in Headers */,
+ C2EE59A013FC973F009CEAFE /* DecimalNumber.h in Headers */,
5135FAF212D26ACE003C083B /* Decoder.h in Headers */,
BC18C3FC0E16F5CD00B34460 /* Deque.h in Headers */,
+ 0F620178143FCD440068B77C /* DFGAbstractState.h in Headers */,
+ 0F620177143FCD3F0068B77C /* DFGAbstractValue.h in Headers */,
+ 0FC0976D1468AB4E00CF2442 /* DFGAssemblyHelpers.h in Headers */,
+ 0F620176143FCD3B0068B77C /* DFGBasicBlock.h in Headers */,
86EC9DC51328DF82002B2AD7 /* DFGByteCodeParser.h in Headers */,
+ 0F2C556F14738F3100121E4F /* DFGCodeBlocks.h in Headers */,
+ 0FC0979C146A772500CF2442 /* DFGCorrectableJumpPoint.h in Headers */,
+ 0FD3C82814115D4F00FD81CB /* DFGDriver.h in Headers */,
+ 0FBC0AE81496C7C700D4FBDD /* DFGExitProfile.h in Headers */,
+ 86AE6C4D136A11E400963012 /* DFGFPRInfo.h in Headers */,
86EC9DC61328DF82002B2AD7 /* DFGGenerationInfo.h in Headers */,
+ 86AE6C4E136A11E400963012 /* DFGGPRInfo.h in Headers */,
86EC9DC81328DF82002B2AD7 /* DFGGraph.h in Headers */,
86EC9DCC1328DF82002B2AD7 /* DFGJITCompiler.h in Headers */,
86ECA3EA132DEF1C002B2AD7 /* DFGNode.h in Headers */,
- 142E3136134FF0A600AFADB5 /* HandleHeap.h in Headers */,
- 142E3138134FF0A600AFADB5 /* HandleStack.h in Headers */,
+ 0F620175143FCD370068B77C /* DFGOperands.h in Headers */,
86EC9DD01328DF82002B2AD7 /* DFGOperations.h in Headers */,
+ 0FD82E57141DAF1000179C94 /* DFGOSREntry.h in Headers */,
+ 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */,
+ 0FC0977114693AF500CF2442 /* DFGOSRExitCompiler.h in Headers */,
+ 0FD3C82714115D4F00FD81CB /* DFGPropagator.h in Headers */,
86EC9DD11328DF82002B2AD7 /* DFGRegisterBank.h in Headers */,
+ 86BB09C1138E381B0056702F /* DFGRepatch.h in Headers */,
86ECA3FA132DF25A002B2AD7 /* DFGScoreBoard.h in Headers */,
86EC9DD31328DF82002B2AD7 /* DFGSpeculativeJIT.h in Headers */,
+ 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */,
+ 0FC097A2146B28CC00CF2442 /* DFGThunks.h in Headers */,
+ 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
BC18C3FD0E16F5CD00B34460 /* DisallowCType.h in Headers */,
+ C22C52F813FAF6EF00B7DC0D /* diy-fp.h in Headers */,
+ C22C52FA13FAF6EF00B7DC0D /* double-conversion.h in Headers */,
+ C22C52FB13FAF6EF00B7DC0D /* double.h in Headers */,
14456A321314657800212CA3 /* DoublyLinkedList.h in Headers */,
BC18C3FE0E16F5CD00B34460 /* dtoa.h in Headers */,
D7A46A4F1338FFEA00ED695C /* DynamicAnnotations.h in Headers */,
@@ -2682,17 +2705,25 @@
BC02E90F0E1839DB000F9297 /* ErrorPrototype.h in Headers */,
969A07980ED1D3AE00F1F681 /* EvalCodeCache.h in Headers */,
BC18C4000E16F5CD00B34460 /* ExceptionHelpers.h in Headers */,
+ 86CAFEE31035DDE60028A609 /* Executable.h in Headers */,
A766B44F0EE8DCD1009518CA /* ExecutableAllocator.h in Headers */,
A7FEE67614837B32005DC1A6 /* ExportMacros.h in Headers */,
+ C22C52FD13FAF6EF00B7DC0D /* fast-dtoa.h in Headers */,
E48E0F2D0F82151700A8CA37 /* FastAllocBase.h in Headers */,
BC18C4020E16F5CD00B34460 /* FastMalloc.h in Headers */,
+ C22C52FF13FAF6EF00B7DC0D /* fixed-dtoa.h in Headers */,
A7F19ECE11DD490900931E70 /* FixedArray.h in Headers */,
+ A73BE16D148420520091204B /* Float32Array.h in Headers */,
+ A73BE16F148420520091204B /* Float64Array.h in Headers */,
BC18C4030E16F5CD00B34460 /* Forward.h in Headers */,
+ 1AA9E5511498093500001A8A /* Functional.h in Headers */,
BC18C4040E16F5CD00B34460 /* FunctionConstructor.h in Headers */,
BC18C4050E16F5CD00B34460 /* FunctionPrototype.h in Headers */,
DDF7ABD411F60ED200108E36 /* GCActivityCallback.h in Headers */,
BC18C4060E16F5CD00B34460 /* GetPtr.h in Headers */,
142E3134134FF0A600AFADB5 /* Handle.h in Headers */,
+ 142E3136134FF0A600AFADB5 /* HandleHeap.h in Headers */,
+ 142E3138134FF0A600AFADB5 /* HandleStack.h in Headers */,
1478297B1379E8A800A7C2A3 /* HandleTypes.h in Headers */,
BC18C4080E16F5CD00B34460 /* HashCountedSet.h in Headers */,
BC18C4090E16F5CD00B34460 /* HashFunctions.h in Headers */,
@@ -2701,12 +2732,19 @@
BC18C40C0E16F5CD00B34460 /* HashSet.h in Headers */,
BC18C40D0E16F5CD00B34460 /* HashTable.h in Headers */,
BC18C40E0E16F5CD00B34460 /* HashTraits.h in Headers */,
+ 14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */,
+ 14F97447138C853E00DA1C67 /* HeapRootVisitor.h in Headers */,
7186A6EC13100BA5004479E1 /* HexNumber.h in Headers */,
BC18C40F0E16F5CD00B34460 /* Identifier.h in Headers */,
BC18C4100E16F5CD00B34460 /* InitializeThreading.h in Headers */,
969A07990ED1D3AE00F1F681 /* Instruction.h in Headers */,
+ A73BE173148420520091204B /* Int16Array.h in Headers */,
+ A73BE175148420520091204B /* Int32Array.h in Headers */,
+ A73BE171148420520091204B /* Int8Array.h in Headers */,
+ A73BE180148420A80091204B /* IntegralTypedArrayBase.h in Headers */,
BC11667B0E199C05008066DD /* InternalFunction.h in Headers */,
1429D77C0ED20D7300B89619 /* Interpreter.h in Headers */,
+ 860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
BC18C4130E16F5CD00B34460 /* JavaScript.h in Headers */,
BC18C4140E16F5CD00B34460 /* JavaScriptCore.h in Headers */,
BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */,
@@ -2715,11 +2753,13 @@
86CC85A10EE79A4700288682 /* JITInlineMethods.h in Headers */,
960626960FB8EC02009798AB /* JITStubCall.h in Headers */,
14C5242B0F5355E900BA3D04 /* JITStubs.h in Headers */,
+ A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
BC18C4160E16F5CD00B34460 /* JSActivation.h in Headers */,
840480131021A1D9008E7F01 /* JSAPIValueWrapper.h in Headers */,
BC18C4170E16F5CD00B34460 /* JSArray.h in Headers */,
BC18C4180E16F5CD00B34460 /* JSBase.h in Headers */,
140D17D70E8AD4A9000CD17D /* JSBasePrivate.h in Headers */,
+ 86FA9E92142BBB2E001773B7 /* JSBoundFunction.h in Headers */,
A791EF280F11E07900AE1F68 /* JSByteArray.h in Headers */,
BC18C4190E16F5CD00B34460 /* JSCallbackConstructor.h in Headers */,
BC18C41A0E16F5CD00B34460 /* JSCallbackFunction.h in Headers */,
@@ -2729,11 +2769,13 @@
BC18C41D0E16F5CD00B34460 /* JSClassRef.h in Headers */,
BC18C41E0E16F5CD00B34460 /* JSContextRef.h in Headers */,
148CD1D8108CF902008163C6 /* JSContextRefPrivate.h in Headers */,
+ 978801411471AD920041B016 /* JSDateMath.h in Headers */,
A7B4ACAF1484C9CE00B38A36 /* JSExportMacros.h in Headers */,
BC18C41F0E16F5CD00B34460 /* JSFunction.h in Headers */,
BC18C4200E16F5CD00B34460 /* JSGlobalData.h in Headers */,
BC18C4210E16F5CD00B34460 /* JSGlobalObject.h in Headers */,
BC756FC90E2031B200DE7D12 /* JSGlobalObjectFunctions.h in Headers */,
+ 8604F505143CE1C200B295F5 /* JSGlobalThis.h in Headers */,
A76C51761182748D00715B05 /* JSInterfaceJIT.h in Headers */,
BC18C4230E16F5CD00B34460 /* JSLock.h in Headers */,
BC18C4240E16F5CD00B34460 /* JSObject.h in Headers */,
@@ -2750,17 +2792,20 @@
BC18C42A0E16F5CD00B34460 /* JSType.h in Headers */,
6507D29E0E871E5E00D7D896 /* JSTypeInfo.h in Headers */,
BC18C42B0E16F5CD00B34460 /* JSValue.h in Headers */,
+ 865A30F1135007E100CDB49E /* JSValueInlineMethods.h in Headers */,
BC18C42C0E16F5CD00B34460 /* JSValueRef.h in Headers */,
BC18C42D0E16F5CD00B34460 /* JSVariableObject.h in Headers */,
A7482E93116A7CAD003B0712 /* JSWeakObjectMapRefInternal.h in Headers */,
A7482B9311671147003B0712 /* JSWeakObjectMapRefPrivate.h in Headers */,
BC18C42E0E16F5CD00B34460 /* JSWrapperObject.h in Headers */,
BCFD8C930EEB2EE700283848 /* JumpTable.h in Headers */,
+ A72FFD64139985A800E5365A /* KeywordLookup.h in Headers */,
969A072A0ED1CE6900F1F681 /* Label.h in Headers */,
960097A60EBABB58007A7297 /* LabelScope.h in Headers */,
BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */,
BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */,
86D3B3C310159D7F002865E7 /* LinkBuffer.h in Headers */,
+ 0F431738146BAC69007E3890 /* ListableHandler.h in Headers */,
BC18C4340E16F5CD00B34460 /* ListHashSet.h in Headers */,
BC18C4350E16F5CD00B34460 /* ListRefPtr.h in Headers */,
A7E2EA6B0FB460CF00601F06 /* LiteralParser.h in Headers */,
@@ -2774,21 +2819,29 @@
86ADD1460FDDEA980006EEC2 /* MacroAssemblerARMv7.h in Headers */,
863B23E00FC6118900703AA4 /* MacroAssemblerCodeRef.h in Headers */,
86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */,
+ 86AE64A9135E5E1C00963012 /* MacroAssemblerSH4.h in Headers */,
860161E40F3A83C100F84710 /* MacroAssemblerX86.h in Headers */,
860161E50F3A83C100F84710 /* MacroAssemblerX86_64.h in Headers */,
860161E60F3A83C100F84710 /* MacroAssemblerX86Common.h in Headers */,
BC18C4390E16F5CD00B34460 /* MainThread.h in Headers */,
BC18C43A0E16F5CD00B34460 /* MallocZoneSupport.h in Headers */,
+ 142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */,
+ 141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */,
+ 14D2F3DB139F4BE200491031 /* MarkedSpace.h in Headers */,
+ 142D6F1213539A4100B02E86 /* MarkStack.h in Headers */,
BC18C43B0E16F5CD00B34460 /* MathExtras.h in Headers */,
BC18C43C0E16F5CD00B34460 /* MathObject.h in Headers */,
BC18C52A0E16FCC200B34460 /* MathObject.lut.h in Headers */,
511FC4CB117EE2A800425272 /* MD5.h in Headers */,
90213E3E123A40C200D422F3 /* MemoryStatistics.h in Headers */,
BC18C43E0E16F5CD00B34460 /* MessageQueue.h in Headers */,
+ 0F963B2D13F854020002D9B2 /* MetaAllocator.h in Headers */,
+ 0F963B2F13FC66BB0002D9B2 /* MetaAllocatorHandle.h in Headers */,
86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */,
BC02E9110E1839DB000F9297 /* NativeErrorConstructor.h in Headers */,
BC02E9130E1839DB000F9297 /* NativeErrorPrototype.h in Headers */,
7EFF00640EC05A9A00AA7C93 /* NodeInfo.h in Headers */,
+ BC18C43F0E16F5CD00B34460 /* Nodes.h in Headers */,
BC18C4400E16F5CD00B34460 /* Noncopyable.h in Headers */,
65E1A3DF122B894500B26097 /* NonCopyingSort.h in Headers */,
C0A272630E50A06300E96E15 /* NotFound.h in Headers */,
@@ -2803,22 +2856,32 @@
E124A8F70E555775003091F1 /* OpaqueJSString.h in Headers */,
969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */,
BC18C4480E16F5CD00B34460 /* Operations.h in Headers */,
+ 0FE228ED1436AB2700196C48 /* Options.h in Headers */,
1400067712A6F7830064D123 /* OSAllocator.h in Headers */,
97941A5A13029ACC004A3447 /* OSRandomSource.h in Headers */,
BC18C4490E16F5CD00B34460 /* OwnArrayPtr.h in Headers */,
- 0BDFFAE10FC6193100D69EF4 /* OwnFastMallocPtr.h in Headers */,
BC18C44A0E16F5CD00B34460 /* OwnPtr.h in Headers */,
4409D8470FAF80A200523B87 /* OwnPtrCommon.h in Headers */,
+ 0F636DA0142D27D700B2E66A /* PackedIntVector.h in Headers */,
8627E5EC11F1281900A313B5 /* PageAllocation.h in Headers */,
14FFF98D12BFFF7500795BB8 /* PageAllocationAligned.h in Headers */,
14B3EF0512BC24DD00D29EFF /* PageBlock.h in Headers */,
8690231512092D5C00630AF9 /* PageReservation.h in Headers */,
+ 7934BB7B1361979300CB99A1 /* ParallelJobs.h in Headers */,
+ 7934BB7D1361979400CB99A1 /* ParallelJobsGeneric.h in Headers */,
+ 7934BB7E1361979400CB99A1 /* ParallelJobsLibdispatch.h in Headers */,
+ 7934BB7F1361979400CB99A1 /* ParallelJobsOpenMP.h in Headers */,
BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */,
+ 93052C350FB792190048FDC3 /* ParserArena.h in Headers */,
+ 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */,
BCFBE696122560E800309E9D /* PassOwnArrayPtr.h in Headers */,
44DD48530FAEA85000D6B4EB /* PassOwnPtr.h in Headers */,
BC18C44C0E16F5CD00B34460 /* PassRefPtr.h in Headers */,
+ 651DCA04136A6FEF00F74194 /* PassTraits.h in Headers */,
BC18C44F0E16F5CD00B34460 /* Platform.h in Headers */,
A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */,
+ 0FD82E54141DAEEE00179C94 /* PredictedType.h in Headers */,
+ 0FD82E55141DAEEE00179C94 /* PredictionTracker.h in Headers */,
BC18C4500E16F5CD00B34460 /* Profile.h in Headers */,
95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */,
BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */,
@@ -2831,22 +2894,11 @@
147B84630E6DE6B1004775A4 /* PutPropertySlot.h in Headers */,
088FA5BC0EF76D4300578E6F /* RandomNumber.h in Headers */,
08E279E90EF83B10007DB523 /* RandomNumberSeed.h in Headers */,
+ 0F963B2713F753BB0002D9B2 /* RedBlackTree.h in Headers */,
BC18C4570E16F5CD00B34460 /* RefCounted.h in Headers */,
90D3469C0E285280009492EE /* RefCountedLeakCounter.h in Headers */,
BC18C4580E16F5CD00B34460 /* RefPtr.h in Headers */,
BC18C4590E16F5CD00B34460 /* RefPtrHashMap.h in Headers */,
- C22C52F213FAF6EF00B7DC0D /* bignum-dtoa.h in Headers */,
- C22C52F413FAF6EF00B7DC0D /* bignum.h in Headers */,
- C22C52F613FAF6EF00B7DC0D /* cached-powers.h in Headers */,
- C22C52F813FAF6EF00B7DC0D /* diy-fp.h in Headers */,
- C22C52FA13FAF6EF00B7DC0D /* double-conversion.h in Headers */,
- C22C52FB13FAF6EF00B7DC0D /* double.h in Headers */,
- C22C52FD13FAF6EF00B7DC0D /* fast-dtoa.h in Headers */,
- C22C52FF13FAF6EF00B7DC0D /* fixed-dtoa.h in Headers */,
- C22C531413FAF6EF00B7DC0D /* strtod.h in Headers */,
- C22C531513FAF6EF00B7DC0D /* utils.h in Headers */,
- 0FD3C82714115D4F00FD81CB /* DFGPropagator.h in Headers */,
- 0FD3C82814115D4F00FD81CB /* DFGDriver.h in Headers */,
BC18C45A0E16F5CD00B34460 /* RegExp.h in Headers */,
A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */,
BCD202C20E1706A7002C7E82 /* RegExpConstructor.h in Headers */,
@@ -2861,19 +2913,26 @@
86D3B3C410159D7F002865E7 /* RepatchBuffer.h in Headers */,
869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */,
BC18C4600E16F5CD00B34460 /* RetainPtr.h in Headers */,
+ C22B31B9140577D700DB475A /* SamplingCounter.h in Headers */,
+ 1429D8860ED21C3D00B89619 /* SamplingTool.h in Headers */,
BC18C4610E16F5CD00B34460 /* ScopeChain.h in Headers */,
+ 969A072C0ED1CE6900F1F681 /* SegmentedVector.h in Headers */,
A7C40C0B130B057D00D002A1 /* SentinelLinkedList.h in Headers */,
+ 86AE64AA135E5E1C00963012 /* SH4Assembler.h in Headers */,
76FB9F0F12E851860051A2EB /* SHA1.h in Headers */,
A7C40C0C130B057D00D002A1 /* SinglyLinkedList.h in Headers */,
+ 14BA78F113AAB88F005B7C2C /* SlotVisitor.h in Headers */,
933040040E6A749400786E6A /* SmallStrings.h in Headers */,
BC18C4640E16F5CD00B34460 /* SourceCode.h in Headers */,
BC18C4630E16F5CD00B34460 /* SourceProvider.h in Headers */,
E49DC16C12EF294E00184A1F /* SourceProviderCache.h in Headers */,
E49DC16D12EF295300184A1F /* SourceProviderCacheItem.h in Headers */,
A7386554118697B400540279 /* SpecializedThunkJIT.h in Headers */,
+ 0F2E5BF7146357D5003EB2EB /* Spectrum.h in Headers */,
86D87DDB12BCAF94008E73A1 /* StackBounds.h in Headers */,
868BFA60117D048200B908B1 /* StaticConstructors.h in Headers */,
FE1B447A0ECCD73B004F4DD1 /* StdLibExtras.h in Headers */,
+ A781E359141970C700094D90 /* StorageBarrier.h in Headers */,
A730B6121250068F009D25B1 /* StrictEvalActivation.h in Headers */,
86B99AE3117E578100DF5A90 /* StringBuffer.h in Headers */,
081469491264378500DFF935 /* StringBuilder.h in Headers */,
@@ -2883,11 +2942,13 @@
868BFA0D117CEFD100B908B1 /* StringHash.h in Headers */,
5D63E9AD10F2BD6E00FC8AE9 /* StringHasher.h in Headers */,
868BFA0F117CEFD100B908B1 /* StringImpl.h in Headers */,
- 71DA9D82134F3F3D00B767E7 /* StringOperators.h in Headers */,
BC18C4680E16F5CD00B34460 /* StringObject.h in Headers */,
+ 71DA9D82134F3F3D00B767E7 /* StringOperators.h in Headers */,
BC18C46A0E16F5CD00B34460 /* StringPrototype.h in Headers */,
BC18C5260E16FCA700B34460 /* StringPrototype.lut.h in Headers */,
142E313B134FF0A600AFADB5 /* Strong.h in Headers */,
+ 145722861437E140005FDE26 /* StrongInlines.h in Headers */,
+ C22C531413FAF6EF00B7DC0D /* strtod.h in Headers */,
BCDE3AB80E6C82F5001453A7 /* Structure.h in Headers */,
7E4EE7090EBB7963005934AA /* StructureChain.h in Headers */,
BCCF0D080EF0AAB900413C8F /* StructureStubInfo.h in Headers */,
@@ -2896,6 +2957,7 @@
A784A26411D16622005776AC /* SyntaxChecker.h in Headers */,
BC18C46C0E16F5CD00B34460 /* TCPackedCache.h in Headers */,
BC18C46D0E16F5CD00B34460 /* TCPageMap.h in Headers */,
+ BC18C46E0E16F5CD00B34460 /* TCSpinLock.h in Headers */,
BC18C46F0E16F5CD00B34460 /* TCSystemAlloc.h in Headers */,
0BCD83571485845200EA2003 /* TemporaryChange.h in Headers */,
971EDEA61169E0D3005E4262 /* Terminator.h in Headers */,
@@ -2908,23 +2970,38 @@
BC18C4710E16F5CD00B34460 /* ThreadSpecific.h in Headers */,
A7386556118697B400540279 /* ThunkGenerators.h in Headers */,
14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */,
+ 141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */,
5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
+ A73BE17E148420840091204B /* TypedArrayBase.h in Headers */,
0B4D7E630F319AC800AD7E58 /* TypeTraits.h in Headers */,
+ A73BE179148420520091204B /* Uint16Array.h in Headers */,
+ 866739D313BFDE710023D87C /* Uint16WithFraction.h in Headers */,
+ A73BE17B148420520091204B /* Uint32Array.h in Headers */,
+ A73BE177148420520091204B /* Uint8Array.h in Headers */,
+ 0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */,
BC18C4730E16F5CD00B34460 /* Unicode.h in Headers */,
BC18C4740E16F5CD00B34460 /* UnicodeIcu.h in Headers */,
+ 0FD52AAE143035A00026DC9F /* UnionFind.h in Headers */,
BC18C4750E16F5CD00B34460 /* UnusedParam.h in Headers */,
BC18C4760E16F5CD00B34460 /* UString.h in Headers */,
08DDA5C11264631700751732 /* UStringBuilder.h in Headers */,
BC18C4770E16F5CD00B34460 /* UTF8.h in Headers */,
+ C22C531513FAF6EF00B7DC0D /* utils.h in Headers */,
E17FF771112131D200076A19 /* ValueCheck.h in Headers */,
+ 0F963B3813FC6FE90002D9B2 /* ValueProfile.h in Headers */,
+ 0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
BC18C4780E16F5CD00B34460 /* Vector.h in Headers */,
BC18C4790E16F5CD00B34460 /* VectorTraits.h in Headers */,
+ 0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */,
96DD73790F9DA3100027FBCC /* VMTags.h in Headers */,
+ 0FC815151405119B00CFA603 /* VTableSpectrum.h in Headers */,
142E313C134FF0A600AFADB5 /* Weak.h in Headers */,
14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */,
1420BE7B10AA6DDB00F455D2 /* WeakRandom.h in Headers */,
+ 0F242DA713F3B1E8007ADD4C /* WeakReferenceHarvester.h in Headers */,
BC18C47A0E16F5CD00B34460 /* WebKitAvailability.h in Headers */,
A7DCB97312E5193F00911940 /* WriteBarrier.h in Headers */,
+ 0FC8150A14043BF500CFA603 /* WriteBarrierSupport.h in Headers */,
868BFA18117CF19900B908B1 /* WTFString.h in Headers */,
86D08D5411793613006E5ED0 /* WTFThreadData.h in Headers */,
9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */,
@@ -2934,78 +3011,16 @@
86704B8812DBA33700A9FE7B /* YarrParser.h in Headers */,
86704B8A12DBA33700A9FE7B /* YarrPattern.h in Headers */,
86704B4312DB8A8100A9FE7B /* YarrSyntaxChecker.h in Headers */,
- 5DE6E5B30E1728EC00180407 /* create_hash_table in Headers */,
- 865A30F1135007E100CDB49E /* JSValueInlineMethods.h in Headers */,
- 142D6F0913539A2800B02E86 /* MarkedBlock.h in Headers */,
- 142D6F1213539A4100B02E86 /* MarkStack.h in Headers */,
- A1D764521354448B00C5C7C0 /* Alignment.h in Headers */,
- 86AE64A9135E5E1C00963012 /* MacroAssemblerSH4.h in Headers */,
- 86AE64AA135E5E1C00963012 /* SH4Assembler.h in Headers */,
- 86AE6C4D136A11E400963012 /* DFGFPRInfo.h in Headers */,
- 86AE6C4E136A11E400963012 /* DFGGPRInfo.h in Headers */,
- 7934BB7B1361979300CB99A1 /* ParallelJobs.h in Headers */,
- 7934BB7D1361979400CB99A1 /* ParallelJobsGeneric.h in Headers */,
- 7934BB7E1361979400CB99A1 /* ParallelJobsLibdispatch.h in Headers */,
- 7934BB7F1361979400CB99A1 /* ParallelJobsOpenMP.h in Headers */,
- 651DCA04136A6FEF00F74194 /* PassTraits.h in Headers */,
- 14F97447138C853E00DA1C67 /* HeapRootVisitor.h in Headers */,
- 86BB09C1138E381B0056702F /* DFGRepatch.h in Headers */,
- A72FFD64139985A800E5365A /* KeywordLookup.h in Headers */,
- 14D2F3DB139F4BE200491031 /* MarkedSpace.h in Headers */,
- 141448CB13A176EC00F5BA1A /* MarkedBlockSet.h in Headers */,
- 141448CD13A1783700F5BA1A /* TinyBloomFilter.h in Headers */,
- 14BA78F113AAB88F005B7C2C /* SlotVisitor.h in Headers */,
- 14BA7A9813AADFF8005B7C2C /* Heap.h in Headers */,
- A76F54A313B28AAB00EF2BCE /* JITWriteBarrier.h in Headers */,
- 866739D213BFDE710023D87C /* BigInteger.h in Headers */,
- 866739D313BFDE710023D87C /* Uint16WithFraction.h in Headers */,
- BC66BAE413F492CC00C23FAE /* Compiler.h in Headers */,
- A7BC0C82140608B000B1BB71 /* CheckedArithmetic.h in Headers */,
- A781E359141970C700094D90 /* StorageBarrier.h in Headers */,
- 1A08277A142168D70090CCAC /* BinarySemaphore.h in Headers */,
- A70456B01427FB910037DA68 /* AllocationSpace.h in Headers */,
- 86FA9E92142BBB2E001773B7 /* JSBoundFunction.h in Headers */,
- 0F636DA0142D27D700B2E66A /* PackedIntVector.h in Headers */,
- A7521E131429169A003C8D0C /* CardSet.h in Headers */,
- 0FD52AAE143035A00026DC9F /* UnionFind.h in Headers */,
- 0FE228ED1436AB2700196C48 /* Options.h in Headers */,
- 0FFF4BB4143955E900655BC0 /* DFGStructureSet.h in Headers */,
- 8604F505143CE1C200B295F5 /* JSGlobalThis.h in Headers */,
- 0F620174143FCD330068B77C /* DFGVariableAccessData.h in Headers */,
- 0F620175143FCD370068B77C /* DFGOperands.h in Headers */,
- 0F620176143FCD3B0068B77C /* DFGBasicBlock.h in Headers */,
- 0F620177143FCD3F0068B77C /* DFGAbstractValue.h in Headers */,
- 0F620178143FCD440068B77C /* DFGAbstractState.h in Headers */,
- 0FBD7E691447999600481315 /* CodeOrigin.h in Headers */,
- 65303D641447B9E100D3F904 /* ParserTokens.h in Headers */,
- 0F426A481460CBB300131F8F /* ValueRecovery.h in Headers */,
- 0F426A491460CBB700131F8F /* VirtualRegister.h in Headers */,
- 0F426A4B1460CD6E00131F8F /* DataFormat.h in Headers */,
- 0F2E5BF7146357D5003EB2EB /* Spectrum.h in Headers */,
- 0FC0976A1468A6F700CF2442 /* DFGOSRExit.h in Headers */,
- 0FC0976D1468AB4E00CF2442 /* DFGAssemblyHelpers.h in Headers */,
- 0FC0977114693AF500CF2442 /* DFGOSRExitCompiler.h in Headers */,
- 0FC0979C146A772500CF2442 /* DFGCorrectableJumpPoint.h in Headers */,
- 0FC097A2146B28CC00CF2442 /* DFGThunks.h in Headers */,
- 0F431738146BAC69007E3890 /* ListableHandler.h in Headers */,
- 0F5F08CF146C7633000472A9 /* UnconditionalFinalizer.h in Headers */,
- 978801411471AD920041B016 /* JSDateMath.h in Headers */,
- 0F2C556F14738F3100121E4F /* DFGCodeBlocks.h in Headers */,
- A73BE169148420520091204B /* ArrayBuffer.h in Headers */,
- A73BE16B148420520091204B /* ArrayBufferView.h in Headers */,
- A73BE16D148420520091204B /* Float32Array.h in Headers */,
- A73BE16F148420520091204B /* Float64Array.h in Headers */,
- A73BE171148420520091204B /* Int8Array.h in Headers */,
- A73BE173148420520091204B /* Int16Array.h in Headers */,
- A73BE175148420520091204B /* Int32Array.h in Headers */,
- A73BE177148420520091204B /* Uint8Array.h in Headers */,
- A73BE179148420520091204B /* Uint16Array.h in Headers */,
- A73BE17B148420520091204B /* Uint32Array.h in Headers */,
- A73BE17E148420840091204B /* TypedArrayBase.h in Headers */,
- A73BE180148420A80091204B /* IntegralTypedArrayBase.h in Headers */,
- 860BD801148EA6F200112B2F /* Intrinsic.h in Headers */,
- 0FBC0AE81496C7C700D4FBDD /* DFGExitProfile.h in Headers */,
- 1AA9E5511498093500001A8A /* Functional.h in Headers */,
+ 0F15F15F14B7A73E005DE37D /* CommonSlowPaths.h in Headers */,
+ 0F46808214BA572D00BFE272 /* JITExceptions.h in Headers */,
+ 0F0B83A714BCF50700885B4F /* CodeType.h in Headers */,
+ 0F0B83A914BCF56200885B4F /* HandlerInfo.h in Headers */,
+ 0F0B83AB14BCF5BB00885B4F /* ExpressionRangeInfo.h in Headers */,
+ 0F0B83AD14BCF60400885B4F /* LineInfo.h in Headers */,
+ 0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */,
+ 0F0B83B514BCF86200885B4F /* MethodCallLinkInfo.h in Headers */,
+ 0F0B83B714BCF8E100885B4F /* GlobalResolveInfo.h in Headers */,
+ 0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3024,7 +3039,6 @@
buildRules = (
);
dependencies = (
- 141211360A48796100480255 /* PBXTargetDependency */,
);
name = minidom;
productName = minidom;
@@ -3043,7 +3057,6 @@
buildRules = (
);
dependencies = (
- 14270B080A451DA10080EEEA /* PBXTargetDependency */,
);
name = testapi;
productName = testapi;
@@ -3060,7 +3073,6 @@
buildRules = (
);
dependencies = (
- 651122F814046A4C002B101D /* PBXTargetDependency */,
);
name = testRegExp;
productInstallPath = /usr/local/bin;
@@ -3103,7 +3115,6 @@
buildRules = (
);
dependencies = (
- 14270B0C0A451DA40080EEEA /* PBXTargetDependency */,
);
name = jsc;
productInstallPath = /usr/local/bin;
@@ -3319,31 +3330,27 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 0F16D726142C39C000CF784A /* BitVector.cpp in Sources */,
- 0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */,
- 0FD82E86141F3FF100179C94 /* PredictedType.cpp in Sources */,
- 0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */,
- 0F963B2C13F853EC0002D9B2 /* MetaAllocator.cpp in Sources */,
- 0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
- 0FD3C82514115D4000FD81CB /* DFGPropagator.cpp in Sources */,
- 0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
- 0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */,
- 0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
- 0F7700921402FF3C0078EB39 /* SamplingCounter.cpp in Sources */,
- C2EE59A113FC9768009CEAFE /* DecimalNumber.cpp in Sources */,
+ A70456B11427FB950037DA68 /* AllocationSpace.cpp in Sources */,
147F39BD107EC37600427A48 /* ArgList.cpp in Sources */,
147F39BE107EC37600427A48 /* Arguments.cpp in Sources */,
86D3B2C310156BDE002865E7 /* ARMAssembler.cpp in Sources */,
A74DE1D0120B875600D40D5B /* ARMv7Assembler.cpp in Sources */,
+ A73BE168148420520091204B /* ArrayBuffer.cpp in Sources */,
+ A73BE16A148420520091204B /* ArrayBufferView.cpp in Sources */,
147F39BF107EC37600427A48 /* ArrayConstructor.cpp in Sources */,
147F39C0107EC37600427A48 /* ArrayPrototype.cpp in Sources */,
65FDE49C0BDD1D4A00E80111 /* Assertions.cpp in Sources */,
868BFA08117CEFD100B908B1 /* AtomicString.cpp in Sources */,
+ C22C52F113FAF6EF00B7DC0D /* bignum-dtoa.cc in Sources */,
+ C22C52F313FAF6EF00B7DC0D /* bignum.cc in Sources */,
+ 1A082779142168D70090CCAC /* BinarySemaphore.cpp in Sources */,
+ 0F16D726142C39C000CF784A /* BitVector.cpp in Sources */,
14280863107EC11A0013E7B2 /* BooleanConstructor.cpp in Sources */,
14280864107EC11A0013E7B2 /* BooleanObject.cpp in Sources */,
14280865107EC11A0013E7B2 /* BooleanPrototype.cpp in Sources */,
A7A1F7AC0F252B3C00E184E2 /* ByteArray.cpp in Sources */,
148F21AA107EC53A0042EC2C /* BytecodeGenerator.cpp in Sources */,
+ C22C52F513FAF6EF00B7DC0D /* cached-powers.cc in Sources */,
1428082D107EC0570013E7B2 /* CallData.cpp in Sources */,
1429D8DD0ED2205B00B89619 /* CallFrame.cpp in Sources */,
969A07960ED1D3AE00F1F681 /* CodeBlock.cpp in Sources */,
@@ -3364,11 +3371,31 @@
14280823107EC02C0013E7B2 /* Debugger.cpp in Sources */,
BC3135650F302FA3003DFD3A /* DebuggerActivation.cpp in Sources */,
149559EE0DDCDDF700648087 /* DebuggerCallFrame.cpp in Sources */,
+ C2EE59A113FC9768009CEAFE /* DecimalNumber.cpp in Sources */,
+ 0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */,
+ 0FC0976E1468AB5100CF2442 /* DFGAssemblyHelpers.cpp in Sources */,
86EC9DC41328DF82002B2AD7 /* DFGByteCodeParser.cpp in Sources */,
+ 0FD82E2114172CE300179C94 /* DFGCapabilities.cpp in Sources */,
+ 0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */,
+ 0FC0979E146B272100CF2442 /* DFGCorrectableJumpPoint.cpp in Sources */,
+ 0FD3C82614115D4000FD81CB /* DFGDriver.cpp in Sources */,
+ 0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
86EC9DC71328DF82002B2AD7 /* DFGGraph.cpp in Sources */,
86EC9DCB1328DF82002B2AD7 /* DFGJITCompiler.cpp in Sources */,
86EC9DCF1328DF82002B2AD7 /* DFGOperations.cpp in Sources */,
+ 0FD82E56141DAF0800179C94 /* DFGOSREntry.cpp in Sources */,
+ 0FC09791146A6F7100CF2442 /* DFGOSRExit.cpp in Sources */,
+ 0FC09792146A6F7300CF2442 /* DFGOSRExitCompiler.cpp in Sources */,
+ 0FC09776146943B000CF2442 /* DFGOSRExitCompiler32_64.cpp in Sources */,
+ 0FC0977214693AF900CF2442 /* DFGOSRExitCompiler64.cpp in Sources */,
+ 0FD3C82514115D4000FD81CB /* DFGPropagator.cpp in Sources */,
+ 86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */,
86EC9DD21328DF82002B2AD7 /* DFGSpeculativeJIT.cpp in Sources */,
+ 86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */,
+ 86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */,
+ 0FC097A1146B28CA00CF2442 /* DFGThunks.cpp in Sources */,
+ C22C52F713FAF6EF00B7DC0D /* diy-fp.cc in Sources */,
+ C22C52F913FAF6EF00B7DC0D /* double-conversion.cc in Sources */,
14469DD7107EC79E00650446 /* dtoa.cpp in Sources */,
147F39C7107EC37600427A48 /* Error.cpp in Sources */,
147F39C8107EC37600427A48 /* ErrorConstructor.cpp in Sources */,
@@ -3378,7 +3405,9 @@
86CA032E1038E8440028A609 /* Executable.cpp in Sources */,
A7B48F490EE8936F00DCBDB6 /* ExecutableAllocator.cpp in Sources */,
86DB64640F95C6FC00D7D921 /* ExecutableAllocatorFixedVMPool.cpp in Sources */,
+ C22C52FC13FAF6EF00B7DC0D /* fast-dtoa.cc in Sources */,
14F8BA3E107EC886009892DC /* FastMalloc.cpp in Sources */,
+ C22C52FE13FAF6EF00B7DC0D /* fixed-dtoa.cc in Sources */,
147F39CB107EC37600427A48 /* FunctionConstructor.cpp in Sources */,
147F39CC107EC37600427A48 /* FunctionPrototype.cpp in Sources */,
DDF7ABD511F60ED200108E36 /* GCActivityCallbackCF.cpp in Sources */,
@@ -3386,6 +3415,7 @@
142E3135134FF0A600AFADB5 /* HandleHeap.cpp in Sources */,
142E3137134FF0A600AFADB5 /* HandleStack.cpp in Sources */,
65DFC93308EA173A00F7300B /* HashTable.cpp in Sources */,
+ 14BA7A9713AADFF8005B7C2C /* Heap.cpp in Sources */,
147F39CE107EC37600427A48 /* Identifier.cpp in Sources */,
E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */,
147F39CF107EC37600427A48 /* InternalFunction.cpp in Sources */,
@@ -3404,6 +3434,7 @@
140566C4107EC255005DBC8D /* JSAPIValueWrapper.cpp in Sources */,
147F39D0107EC37600427A48 /* JSArray.cpp in Sources */,
1421359B0A677F4F00A8195E /* JSBase.cpp in Sources */,
+ 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */,
A791EF290F11E07900AE1F68 /* JSByteArray.cpp in Sources */,
1440F8AF0A508D200005F061 /* JSCallbackConstructor.cpp in Sources */,
1440F8920A508B100005F061 /* JSCallbackFunction.cpp in Sources */,
@@ -3411,10 +3442,12 @@
147F39D1107EC37600427A48 /* JSCell.cpp in Sources */,
1440FCE40A51E46B0005F061 /* JSClassRef.cpp in Sources */,
14BD5A300A3E91F600BAF59C /* JSContextRef.cpp in Sources */,
+ 978801401471AD920041B016 /* JSDateMath.cpp in Sources */,
140566D6107EC271005DBC8D /* JSFunction.cpp in Sources */,
E18E3A590DF9278C00D90B34 /* JSGlobalData.cpp in Sources */,
147F39D2107EC37600427A48 /* JSGlobalObject.cpp in Sources */,
14E9D17B107EC469004DDA21 /* JSGlobalObjectFunctions.cpp in Sources */,
+ BC3C4CA01458F5450025FB62 /* JSGlobalThis.cpp in Sources */,
14280875107EC13E0013E7B2 /* JSLock.cpp in Sources */,
A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */,
147F39D4107EC37600427A48 /* JSObject.cpp in Sources */,
@@ -3437,11 +3470,16 @@
14469DDE107EC7E700650446 /* Lookup.cpp in Sources */,
14B723B212D7DA46003BD5ED /* MachineStackMarker.cpp in Sources */,
86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
+ 86AE64A8135E5E1C00963012 /* MacroAssemblerSH4.cpp in Sources */,
06D358B30DAADAA4003B174E /* MainThread.cpp in Sources */,
06D358B40DAADAAA003B174E /* MainThreadMac.mm in Sources */,
+ 142D6F0813539A2800B02E86 /* MarkedBlock.cpp in Sources */,
+ 14D2F3DA139F4BE200491031 /* MarkedSpace.cpp in Sources */,
+ 142D6F1113539A4100B02E86 /* MarkStack.cpp in Sources */,
14469DDF107EC7E700650446 /* MathObject.cpp in Sources */,
511FC4C9117EE28700425272 /* MD5.cpp in Sources */,
90213E3D123A40C200D422F3 /* MemoryStatistics.cpp in Sources */,
+ 0F963B2C13F853EC0002D9B2 /* MetaAllocator.cpp in Sources */,
14469DE0107EC7E700650446 /* NativeErrorConstructor.cpp in Sources */,
14469DE1107EC7E700650446 /* NativeErrorPrototype.cpp in Sources */,
148F21B7107EC5470042EC2C /* Nodes.cpp in Sources */,
@@ -3455,12 +3493,15 @@
E124A8F80E555775003091F1 /* OpaqueJSString.cpp in Sources */,
969A079A0ED1D3AE00F1F681 /* Opcode.cpp in Sources */,
14280850107EC0D70013E7B2 /* Operations.cpp in Sources */,
+ 0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */,
1400069312A6F9E10064D123 /* OSAllocatorPosix.cpp in Sources */,
97941A5713029AAB004A3447 /* OSRandomSource.cpp in Sources */,
14FFF98C12BFFF7500795BB8 /* PageAllocationAligned.cpp in Sources */,
14B3EF0612BC24DD00D29EFF /* PageBlock.cpp in Sources */,
+ 7934BB7C1361979400CB99A1 /* ParallelJobsGeneric.cpp in Sources */,
148F21BC107EC54D0042EC2C /* Parser.cpp in Sources */,
93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */,
+ 0FD82E86141F3FF100179C94 /* PredictedType.cpp in Sources */,
95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
@@ -3476,6 +3517,7 @@
14280843107EC0930013E7B2 /* RegExpObject.cpp in Sources */,
14280844107EC0930013E7B2 /* RegExpPrototype.cpp in Sources */,
1428083A107EC0750013E7B2 /* RegisterFile.cpp in Sources */,
+ 0F7700921402FF3C0078EB39 /* SamplingCounter.cpp in Sources */,
1429D8850ED21C3D00B89619 /* SamplingTool.cpp in Sources */,
14469DEA107EC7E700650446 /* ScopeChain.cpp in Sources */,
76FB9F1112E851960051A2EB /* SHA1.cpp in Sources */,
@@ -3491,6 +3533,7 @@
14469DED107EC7E700650446 /* StringPrototype.cpp in Sources */,
9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */,
8626BECF11928E3900782FAB /* StringStatics.cpp in Sources */,
+ C22C531313FAF6EF00B7DC0D /* strtod.cc in Sources */,
BCDE3B430E6C832D001453A7 /* Structure.cpp in Sources */,
7E4EE70F0EBB7A5B005934AA /* StructureChain.cpp in Sources */,
BCCF0D0C0EF0B8A500413C8F /* StructureStubInfo.cpp in Sources */,
@@ -3503,47 +3546,18 @@
0B330C270F38C62300692DE3 /* TypeTraits.cpp in Sources */,
14469DEE107EC7E700650446 /* UString.cpp in Sources */,
E1EF79AA0CE97BA60088D500 /* UTF8.cpp in Sources */,
+ 0FD82E9014207A5F00179C94 /* ValueProfile.cpp in Sources */,
+ 0FC81516140511B500CFA603 /* VTableSpectrum.cpp in Sources */,
+ 0FC8150B14043C0E00CFA603 /* WriteBarrierSupport.cpp in Sources */,
868BFA17117CF19900B908B1 /* WTFString.cpp in Sources */,
86D08D5311793613006E5ED0 /* WTFThreadData.cpp in Sources */,
86704B8412DBA33700A9FE7B /* YarrInterpreter.cpp in Sources */,
86704B8612DBA33700A9FE7B /* YarrJIT.cpp in Sources */,
86704B8912DBA33700A9FE7B /* YarrPattern.cpp in Sources */,
86704B4212DB8A8100A9FE7B /* YarrSyntaxChecker.cpp in Sources */,
- 142D6F0813539A2800B02E86 /* MarkedBlock.cpp in Sources */,
- 142D6F1113539A4100B02E86 /* MarkStack.cpp in Sources */,
- 86AE64A8135E5E1C00963012 /* MacroAssemblerSH4.cpp in Sources */,
- 7934BB7C1361979400CB99A1 /* ParallelJobsGeneric.cpp in Sources */,
- 86BB09C0138E381B0056702F /* DFGRepatch.cpp in Sources */,
- 14D2F3DA139F4BE200491031 /* MarkedSpace.cpp in Sources */,
- 14BA7A9713AADFF8005B7C2C /* Heap.cpp in Sources */,
- C22C52F113FAF6EF00B7DC0D /* bignum-dtoa.cc in Sources */,
- C22C52F313FAF6EF00B7DC0D /* bignum.cc in Sources */,
- C22C52F513FAF6EF00B7DC0D /* cached-powers.cc in Sources */,
- C22C52F713FAF6EF00B7DC0D /* diy-fp.cc in Sources */,
- C22C52F913FAF6EF00B7DC0D /* double-conversion.cc in Sources */,
- C22C52FC13FAF6EF00B7DC0D /* fast-dtoa.cc in Sources */,
- C22C52FE13FAF6EF00B7DC0D /* fixed-dtoa.cc in Sources */,
- C22C531313FAF6EF00B7DC0D /* strtod.cc in Sources */,
- 1A082779142168D70090CCAC /* BinarySemaphore.cpp in Sources */,
- A70456B11427FB950037DA68 /* AllocationSpace.cpp in Sources */,
- 86FA9E91142BBB2E001773B7 /* JSBoundFunction.cpp in Sources */,
- 86880F1F14328BB900B08D42 /* DFGSpeculativeJIT32_64.cpp in Sources */,
- 86880F4D14353B2100B08D42 /* DFGSpeculativeJIT64.cpp in Sources */,
- 0FE228EE1436AB2C00196C48 /* Options.cpp in Sources */,
- 0F620179143FCD480068B77C /* DFGAbstractState.cpp in Sources */,
- BC3C4CA01458F5450025FB62 /* JSGlobalThis.cpp in Sources */,
- 0FC0976E1468AB5100CF2442 /* DFGAssemblyHelpers.cpp in Sources */,
- 0FC0977214693AF900CF2442 /* DFGOSRExitCompiler64.cpp in Sources */,
- 0FC09776146943B000CF2442 /* DFGOSRExitCompiler32_64.cpp in Sources */,
- 0FC09791146A6F7100CF2442 /* DFGOSRExit.cpp in Sources */,
- 0FC09792146A6F7300CF2442 /* DFGOSRExitCompiler.cpp in Sources */,
- 0FC0979E146B272100CF2442 /* DFGCorrectableJumpPoint.cpp in Sources */,
- 0FC097A1146B28CA00CF2442 /* DFGThunks.cpp in Sources */,
- 978801401471AD920041B016 /* JSDateMath.cpp in Sources */,
- 0F2C557014738F3500121E4F /* DFGCodeBlocks.cpp in Sources */,
- A73BE168148420520091204B /* ArrayBuffer.cpp in Sources */,
- A73BE16A148420520091204B /* ArrayBufferView.cpp in Sources */,
- 0FBC0AE71496C7C400D4FBDD /* DFGExitProfile.cpp in Sources */,
+ 0F46808314BA573100BFE272 /* JITExceptions.cpp in Sources */,
+ 0F0B83B014BCF71600885B4F /* CallLinkInfo.cpp in Sources */,
+ 0F0B83B414BCF86000885B4F /* MethodCallLinkInfo.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -3558,36 +3572,16 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
- 141211360A48796100480255 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 932F5B3E0822A1C700736975 /* JavaScriptCore */;
- targetProxy = 141211350A48796100480255 /* PBXContainerItemProxy */;
- };
141214BF0A49190E00480255 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 1412111F0A48793C00480255 /* minidom */;
targetProxy = 141214BE0A49190E00480255 /* PBXContainerItemProxy */;
};
- 14270B080A451DA10080EEEA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 932F5B3E0822A1C700736975 /* JavaScriptCore */;
- targetProxy = 14270B070A451DA10080EEEA /* PBXContainerItemProxy */;
- };
- 14270B0C0A451DA40080EEEA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 932F5B3E0822A1C700736975 /* JavaScriptCore */;
- targetProxy = 14270B0B0A451DA40080EEEA /* PBXContainerItemProxy */;
- };
14BD59C70A3E8FA400BAF59C /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 14BD59BE0A3E8F9000BAF59C /* testapi */;
targetProxy = 14BD59C60A3E8FA400BAF59C /* PBXContainerItemProxy */;
};
- 651122F814046A4C002B101D /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 932F5B3E0822A1C700736975 /* JavaScriptCore */;
- targetProxy = 651122F914046A4C002B101D /* PBXContainerItemProxy */;
- };
651123091404768B002B101D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 651122F714046A4C002B101D /* testRegExp */;
diff --git a/Source/JavaScriptCore/Target.pri b/Source/JavaScriptCore/Target.pri
index 8b3e77d42..6ea82d102 100644
--- a/Source/JavaScriptCore/Target.pri
+++ b/Source/JavaScriptCore/Target.pri
@@ -49,9 +49,11 @@ SOURCES += \
assembler/ARMv7Assembler.cpp \
assembler/MacroAssemblerARM.cpp \
assembler/MacroAssemblerSH4.cpp \
+ bytecode/CallLinkInfo.cpp \
bytecode/CodeBlock.cpp \
bytecode/DFGExitProfile.cpp \
bytecode/JumpTable.cpp \
+ bytecode/MethodCallLinkInfo.cpp \
bytecode/Opcode.cpp \
bytecode/PredictedType.cpp \
bytecode/SamplingTool.cpp \
@@ -104,6 +106,7 @@ SOURCES += \
jit/JITCall.cpp \
jit/JITCall32_64.cpp \
jit/JIT.cpp \
+ jit/JITExceptions.cpp \
jit/JITOpcodes.cpp \
jit/JITOpcodes32_64.cpp \
jit/JITPropertyAccess.cpp \
diff --git a/Source/JavaScriptCore/assembler/RepatchBuffer.h b/Source/JavaScriptCore/assembler/RepatchBuffer.h
index 6ea6d8df3..e56185fdb 100644
--- a/Source/JavaScriptCore/assembler/RepatchBuffer.h
+++ b/Source/JavaScriptCore/assembler/RepatchBuffer.h
@@ -28,6 +28,7 @@
#if ENABLE(ASSEMBLER)
+#include "CodeBlock.h"
#include <MacroAssembler.h>
#include <wtf/Noncopyable.h>
diff --git a/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp b/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp
new file mode 100644
index 000000000..4c108ecf1
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/CallLinkInfo.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CallLinkInfo.h"
+
+#include "DFGOperations.h"
+#include "RepatchBuffer.h"
+
+#if ENABLE(JIT)
+namespace JSC {
+
+void CallLinkInfo::unlink(JSGlobalData& globalData, RepatchBuffer& repatchBuffer)
+{
+ ASSERT(isLinked());
+
+ if (isDFG) {
+#if ENABLE(DFG_JIT)
+ repatchBuffer.relink(CodeLocationCall(callReturnLocation), callType == Construct ? DFG::operationLinkConstruct : DFG::operationLinkCall);
+#else
+ ASSERT_NOT_REACHED();
+#endif
+ } else
+ repatchBuffer.relink(CodeLocationNearCall(callReturnLocation), callType == Construct ? globalData.jitStubs->ctiVirtualConstructLink() : globalData.jitStubs->ctiVirtualCallLink());
+ hasSeenShouldRepatch = false;
+ callee.clear();
+
+ // It will be on a list if the callee has a code block.
+ if (isOnList())
+ remove();
+}
+
+} // namespace JSC
+#endif // ENABLE(JIT)
+
diff --git a/Source/JavaScriptCore/bytecode/CallLinkInfo.h b/Source/JavaScriptCore/bytecode/CallLinkInfo.h
new file mode 100644
index 000000000..8ec48e4e1
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/CallLinkInfo.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CallLinkInfo_h
+#define CallLinkInfo_h
+
+#include "CodeLocation.h"
+#include "JITWriteBarrier.h"
+#include "JSFunction.h"
+#include "Opcode.h"
+#include "WriteBarrier.h"
+#include <wtf/Platform.h>
+#include <wtf/SentinelLinkedList.h>
+
+namespace JSC {
+
+#if ENABLE(JIT)
+
+class RepatchBuffer;
+
+struct CallLinkInfo : public BasicRawSentinelNode<CallLinkInfo> {
+ enum CallType { None, Call, CallVarargs, Construct };
+ static CallType callTypeFor(OpcodeID opcodeID)
+ {
+ if (opcodeID == op_call || opcodeID == op_call_eval)
+ return Call;
+ if (opcodeID == op_construct)
+ return Construct;
+ ASSERT(opcodeID == op_call_varargs);
+ return CallVarargs;
+ }
+
+ CallLinkInfo()
+ : hasSeenShouldRepatch(false)
+ , isDFG(false)
+ , callType(None)
+ {
+ }
+
+ ~CallLinkInfo()
+ {
+ if (isOnList())
+ remove();
+ }
+
+ CodeLocationLabel callReturnLocation; // it's a near call in the old JIT, or a normal call in DFG
+ CodeLocationDataLabelPtr hotPathBegin;
+ CodeLocationNearCall hotPathOther;
+ JITWriteBarrier<JSFunction> callee;
+ WriteBarrier<JSFunction> lastSeenCallee;
+ bool hasSeenShouldRepatch : 1;
+ bool isDFG : 1;
+ CallType callType : 2;
+ unsigned bytecodeIndex;
+
+ bool isLinked() { return callee; }
+ void unlink(JSGlobalData&, RepatchBuffer&);
+
+ bool seenOnce()
+ {
+ return hasSeenShouldRepatch;
+ }
+
+ void setSeen()
+ {
+ hasSeenShouldRepatch = true;
+ }
+};
+
+inline void* getCallLinkInfoReturnLocation(CallLinkInfo* callLinkInfo)
+{
+ return callLinkInfo->callReturnLocation.executableAddress();
+}
+
+inline unsigned getCallLinkInfoBytecodeIndex(CallLinkInfo* callLinkInfo)
+{
+ return callLinkInfo->bytecodeIndex;
+}
+#endif // ENABLE(JIT)
+
+} // namespace JSC
+
+#endif // CallLinkInfo_h
diff --git a/Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h b/Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h
new file mode 100644
index 000000000..3a7448efd
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CallReturnOffsetToBytecodeOffset_h
+#define CallReturnOffsetToBytecodeOffset_h
+
+#include <wtf/Platform.h>
+
+namespace JSC {
+
+#if ENABLE(JIT)
+// This structure is used to map from a call return location
+// (given as an offset in bytes into the JIT code) back to
+// the bytecode index of the corresponding bytecode operation.
+// This is then used to look up the corresponding handler.
+// FIXME: This should be made inlining aware! Currently it isn't
+// because we never inline code that has exception handlers.
+struct CallReturnOffsetToBytecodeOffset {
+ CallReturnOffsetToBytecodeOffset(unsigned callReturnOffset, unsigned bytecodeOffset)
+ : callReturnOffset(callReturnOffset)
+ , bytecodeOffset(bytecodeOffset)
+ {
+ }
+
+ unsigned callReturnOffset;
+ unsigned bytecodeOffset;
+};
+
+inline unsigned getCallReturnOffset(CallReturnOffsetToBytecodeOffset* pc)
+{
+ return pc->callReturnOffset;
+}
+#endif
+
+} // namespace JSC
+
+#endif // CallReturnOffsetToBytecodeOffset_h
+
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index a14ce64a1..47745268c 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1413,7 +1413,6 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other, SymbolTable* symTab)
, m_numCalleeRegisters(other.m_numCalleeRegisters)
, m_numVars(other.m_numVars)
, m_numCapturedVars(other.m_numCapturedVars)
- , m_numParameters(other.m_numParameters)
, m_isConstructor(other.m_isConstructor)
, m_shouldDiscardBytecode(false)
, m_ownerExecutable(*other.m_globalData, other.m_ownerExecutable.get(), other.m_ownerExecutable.get())
@@ -1448,6 +1447,7 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other, SymbolTable* symTab)
, m_optimizationDelayCounter(0)
, m_reoptimizationRetryCounter(0)
{
+ setNumParameters(other.numParameters());
optimizeAfterWarmUp();
if (other.m_rareData) {
@@ -1469,9 +1469,9 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, JSGlo
, m_heap(&m_globalObject->globalData().heap)
, m_numCalleeRegisters(0)
, m_numVars(0)
- , m_numParameters(0)
, m_isConstructor(isConstructor)
, m_shouldDiscardBytecode(false)
+ , m_numParameters(0)
, m_ownerExecutable(globalObject->globalData(), ownerExecutable, ownerExecutable)
, m_globalData(0)
, m_instructions(adoptRef(new Instructions))
@@ -1538,6 +1538,24 @@ CodeBlock::~CodeBlock()
#endif
}
+void CodeBlock::setNumParameters(int newValue)
+{
+ m_numParameters = newValue;
+
+#if ENABLE(VALUE_PROFILER)
+ m_argumentValueProfiles.resize(newValue);
+#endif
+}
+
+void CodeBlock::addParameter()
+{
+ m_numParameters++;
+
+#if ENABLE(VALUE_PROFILER)
+ m_argumentValueProfiles.append(ValueProfile());
+#endif
+}
+
void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC) const
{
Interpreter* interpreter = m_globalData->interpreter;
@@ -2038,38 +2056,6 @@ void CodeBlock::createActivation(CallFrame* callFrame)
}
#if ENABLE(JIT)
-void CallLinkInfo::unlink(JSGlobalData& globalData, RepatchBuffer& repatchBuffer)
-{
- ASSERT(isLinked());
-
- if (isDFG) {
-#if ENABLE(DFG_JIT)
- repatchBuffer.relink(CodeLocationCall(callReturnLocation), callType == Construct ? operationLinkConstruct : operationLinkCall);
-#else
- ASSERT_NOT_REACHED();
-#endif
- } else
- repatchBuffer.relink(CodeLocationNearCall(callReturnLocation), callType == Construct ? globalData.jitStubs->ctiVirtualConstructLink() : globalData.jitStubs->ctiVirtualCallLink());
- hasSeenShouldRepatch = false;
- callee.clear();
-
- // It will be on a list if the callee has a code block.
- if (isOnList())
- remove();
-}
-
-void MethodCallLinkInfo::reset(RepatchBuffer& repatchBuffer, JITCode::JITType jitType)
-{
- cachedStructure.clearToMaxUnsigned();
- cachedPrototype.clear();
- cachedPrototypeStructure.clearToMaxUnsigned();
- cachedFunction.clear();
-
- ASSERT_UNUSED(jitType, jitType == JITCode::BaselineJIT);
-
- repatchBuffer.relink(callReturnLocation, cti_op_get_by_id_method_check);
-}
-
void CodeBlock::unlinkCalls()
{
if (!!m_alternative)
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h
index 159cb65de..c440c72e1 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.h
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.h
@@ -30,22 +30,31 @@
#ifndef CodeBlock_h
#define CodeBlock_h
+#include "CallLinkInfo.h"
+#include "CallReturnOffsetToBytecodeOffset.h"
#include "CodeOrigin.h"
+#include "CodeType.h"
#include "CompactJITCodeMap.h"
#include "DFGCodeBlocks.h"
#include "DFGExitProfile.h"
#include "DFGOSREntry.h"
#include "DFGOSRExit.h"
#include "EvalCodeCache.h"
+#include "ExpressionRangeInfo.h"
+#include "GlobalResolveInfo.h"
+#include "HandlerInfo.h"
+#include "MethodCallLinkInfo.h"
#include "Options.h"
#include "Instruction.h"
#include "JITCode.h"
#include "JITWriteBarrier.h"
#include "JSGlobalObject.h"
#include "JumpTable.h"
+#include "LineInfo.h"
#include "Nodes.h"
#include "PredictionTracker.h"
#include "RegExpObject.h"
+#include "StructureStubInfo.h"
#include "UString.h"
#include "UnconditionalFinalizer.h"
#include "ValueProfile.h"
@@ -53,12 +62,8 @@
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/SegmentedVector.h>
-#include <wtf/SentinelLinkedList.h>
#include <wtf/Vector.h>
-
-#if ENABLE(JIT)
#include "StructureStubInfo.h"
-#endif
// Register numbers used in bytecode operations have different meaning according to their ranges:
// 0x80000000-0xFFFFFFFF Negative indices from the CallFrame pointer are entries in the call frame, see RegisterFile.h.
@@ -68,191 +73,13 @@ static const int FirstConstantRegisterIndex = 0x40000000;
namespace JSC {
- enum HasSeenShouldRepatch {
- hasSeenShouldRepatch
- };
-
class ExecState;
class DFGCodeBlocks;
- enum CodeType { GlobalCode, EvalCode, FunctionCode };
-
inline int unmodifiedArgumentsRegister(int argumentsRegister) { return argumentsRegister - 1; }
static ALWAYS_INLINE int missingThisObjectMarker() { return std::numeric_limits<int>::max(); }
- struct HandlerInfo {
- uint32_t start;
- uint32_t end;
- uint32_t target;
- uint32_t scopeDepth;
-#if ENABLE(JIT)
- CodeLocationLabel nativeCode;
-#endif
- };
-
- struct ExpressionRangeInfo {
- enum {
- MaxOffset = (1 << 7) - 1,
- MaxDivot = (1 << 25) - 1
- };
- uint32_t instructionOffset : 25;
- uint32_t divotPoint : 25;
- uint32_t startOffset : 7;
- uint32_t endOffset : 7;
- };
-
- struct LineInfo {
- uint32_t instructionOffset;
- int32_t lineNumber;
- };
-
-#if ENABLE(JIT)
- struct CallLinkInfo : public BasicRawSentinelNode<CallLinkInfo> {
- enum CallType { None, Call, CallVarargs, Construct };
- static CallType callTypeFor(OpcodeID opcodeID)
- {
- if (opcodeID == op_call || opcodeID == op_call_eval)
- return Call;
- if (opcodeID == op_construct)
- return Construct;
- ASSERT(opcodeID == op_call_varargs);
- return CallVarargs;
- }
-
- CallLinkInfo()
- : hasSeenShouldRepatch(false)
- , isDFG(false)
- , callType(None)
- {
- }
-
- ~CallLinkInfo()
- {
- if (isOnList())
- remove();
- }
-
- CodeLocationLabel callReturnLocation; // it's a near call in the old JIT, or a normal call in DFG
- CodeLocationDataLabelPtr hotPathBegin;
- CodeLocationNearCall hotPathOther;
- JITWriteBarrier<JSFunction> callee;
- WriteBarrier<JSFunction> lastSeenCallee;
- bool hasSeenShouldRepatch : 1;
- bool isDFG : 1;
- CallType callType : 2;
- unsigned bytecodeIndex;
-
- bool isLinked() { return callee; }
- void unlink(JSGlobalData&, RepatchBuffer&);
-
- bool seenOnce()
- {
- return hasSeenShouldRepatch;
- }
-
- void setSeen()
- {
- hasSeenShouldRepatch = true;
- }
- };
-
- struct MethodCallLinkInfo {
- MethodCallLinkInfo()
- : seen(false)
- {
- }
-
- bool seenOnce()
- {
- return seen;
- }
-
- void setSeen()
- {
- seen = true;
- }
-
- void reset(RepatchBuffer&, JITCode::JITType);
-
- unsigned bytecodeIndex;
- CodeLocationCall callReturnLocation;
- JITWriteBarrier<Structure> cachedStructure;
- JITWriteBarrier<Structure> cachedPrototypeStructure;
- // We'd like this to actually be JSFunction, but InternalFunction and JSFunction
- // don't have a common parent class and we allow specialisation on both
- JITWriteBarrier<JSObject> cachedFunction;
- JITWriteBarrier<JSObject> cachedPrototype;
- bool seen;
- };
-
- struct GlobalResolveInfo {
- GlobalResolveInfo(unsigned bytecodeOffset)
- : offset(0)
- , bytecodeOffset(bytecodeOffset)
- {
- }
-
- WriteBarrier<Structure> structure;
- unsigned offset;
- unsigned bytecodeOffset;
- };
-
- // This structure is used to map from a call return location
- // (given as an offset in bytes into the JIT code) back to
- // the bytecode index of the corresponding bytecode operation.
- // This is then used to look up the corresponding handler.
- // FIXME: This should be made inlining aware! Currently it isn't
- // because we never inline code that has exception handlers.
- struct CallReturnOffsetToBytecodeOffset {
- CallReturnOffsetToBytecodeOffset(unsigned callReturnOffset, unsigned bytecodeOffset)
- : callReturnOffset(callReturnOffset)
- , bytecodeOffset(bytecodeOffset)
- {
- }
-
- unsigned callReturnOffset;
- unsigned bytecodeOffset;
- };
-
- // valueAtPosition helpers for the binarySearch algorithm.
-
- inline void* getStructureStubInfoReturnLocation(StructureStubInfo* structureStubInfo)
- {
- return structureStubInfo->callReturnLocation.executableAddress();
- }
-
- inline unsigned getStructureStubInfoBytecodeIndex(StructureStubInfo* structureStubInfo)
- {
- return structureStubInfo->bytecodeIndex;
- }
-
- inline void* getCallLinkInfoReturnLocation(CallLinkInfo* callLinkInfo)
- {
- return callLinkInfo->callReturnLocation.executableAddress();
- }
-
- inline unsigned getCallLinkInfoBytecodeIndex(CallLinkInfo* callLinkInfo)
- {
- return callLinkInfo->bytecodeIndex;
- }
-
- inline void* getMethodCallLinkInfoReturnLocation(MethodCallLinkInfo* methodCallLinkInfo)
- {
- return methodCallLinkInfo->callReturnLocation.executableAddress();
- }
-
- inline unsigned getMethodCallLinkInfoBytecodeIndex(MethodCallLinkInfo* methodCallLinkInfo)
- {
- return methodCallLinkInfo->bytecodeIndex;
- }
-
- inline unsigned getCallReturnOffset(CallReturnOffsetToBytecodeOffset* pc)
- {
- return pc->callReturnOffset;
- }
-#endif
-
class CodeBlock : public UnconditionalFinalizer, public WeakReferenceHarvester {
WTF_MAKE_FAST_ALLOCATED;
friend class JIT;
@@ -268,6 +95,13 @@ namespace JSC {
public:
virtual ~CodeBlock();
+
+ int numParameters() const { return m_numParameters; }
+ void setNumParameters(int newValue);
+ void addParameter();
+
+ int* addressOfNumParameters() { return &m_numParameters; }
+ static ptrdiff_t offsetOfNumParameters() { return OBJECT_OFFSETOF(CodeBlock, m_numParameters); }
CodeBlock* alternative() { return m_alternative.get(); }
PassOwnPtr<CodeBlock> releaseAlternative() { return m_alternative.release(); }
@@ -657,12 +491,10 @@ namespace JSC {
#endif
#if ENABLE(VALUE_PROFILER)
- void setArgumentValueProfileSize(unsigned size)
- {
- m_argumentValueProfiles.resize(size);
- }
unsigned numberOfArgumentValueProfiles()
{
+ ASSERT(m_numParameters >= 0);
+ ASSERT(m_argumentValueProfiles.size() == static_cast<unsigned>(m_numParameters));
return m_argumentValueProfiles.size();
}
ValueProfile* valueProfileForArgument(unsigned argumentIndex)
@@ -1131,7 +963,6 @@ namespace JSC {
int m_numCalleeRegisters;
int m_numVars;
int m_numCapturedVars;
- int m_numParameters;
bool m_isConstructor;
// This is public because otherwise we would have many friends.
@@ -1195,6 +1026,8 @@ namespace JSC {
m_rareData = adoptPtr(new RareData);
}
+ int m_numParameters;
+
WriteBarrier<ScriptExecutable> m_ownerExecutable;
JSGlobalData* m_globalData;
diff --git a/Source/JavaScriptCore/bytecode/CodeType.h b/Source/JavaScriptCore/bytecode/CodeType.h
new file mode 100644
index 000000000..03485e564
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/CodeType.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CodeType_h
+#define CodeType_h
+
+namespace JSC {
+
+enum CodeType { GlobalCode, EvalCode, FunctionCode };
+
+}
+
+#endif // CodeType_h
+
diff --git a/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.h b/Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h
index 215c55957..f4949a686 100644
--- a/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.h
+++ b/Source/JavaScriptCore/bytecode/ExpressionRangeInfo.h
@@ -1,50 +1,47 @@
/*
- * Copyright 2010, The Android Open Source Project
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * * Redistributions of source code must retain the above copyright
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
+ * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JNIUtilityPrivate_h
-#define JNIUtilityPrivate_h
+#ifndef ExpressionRangeInfo_h
+#define ExpressionRangeInfo_h
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JNIUtility.h"
-#include "npruntime.h"
-#include <wtf/text/WTFString.h>
+#include <wtf/StdLibExtras.h>
namespace JSC {
-namespace Bindings {
-
-class JavaValue;
-
-JavaValue convertNPVariantToJavaValue(NPVariant, const String& javaClass);
-void convertJavaValueToNPVariant(JavaValue, NPVariant*);
-
-} // namespace Bindings
+struct ExpressionRangeInfo {
+ enum {
+ MaxOffset = (1 << 7) - 1,
+ MaxDivot = (1 << 25) - 1
+ };
+ uint32_t instructionOffset : 25;
+ uint32_t divotPoint : 25;
+ uint32_t startOffset : 7;
+ uint32_t endOffset : 7;
+};
} // namespace JSC
-#endif // ENABLE(JAVA_BRIDGE)
+#endif // ExpressionRangeInfo_h
-#endif // JNIUtilityPrivate_h
diff --git a/Source/JavaScriptCore/bytecode/GlobalResolveInfo.h b/Source/JavaScriptCore/bytecode/GlobalResolveInfo.h
new file mode 100644
index 000000000..5576cfacd
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/GlobalResolveInfo.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GlobalResolveInfo_h
+#define GlobalResolveInfo_h
+
+#include "WriteBarrier.h"
+
+namespace JSC {
+
+struct GlobalResolveInfo {
+ GlobalResolveInfo(unsigned bytecodeOffset)
+ : offset(0)
+ , bytecodeOffset(bytecodeOffset)
+ {
+ }
+
+ WriteBarrier<Structure> structure;
+ unsigned offset;
+ unsigned bytecodeOffset;
+};
+
+} // namespace JSC
+
+#endif // GlobalResolveInfo_h
+
diff --git a/Source/WebCore/bridge/jni/v8/JavaFieldV8.h b/Source/JavaScriptCore/bytecode/HandlerInfo.h
index 8f9c9822b..8396c9607 100644
--- a/Source/WebCore/bridge/jni/v8/JavaFieldV8.h
+++ b/Source/JavaScriptCore/bytecode/HandlerInfo.h
@@ -1,51 +1,47 @@
/*
- * Copyright 2010, The Android Open Source Project
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * * Redistributions of source code must retain the above copyright
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
+ * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JavaFieldV8_h
-#define JavaFieldV8_h
+#ifndef HandlerInfo_h
+#define HandlerInfo_h
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JNIUtility.h"
-#include <wtf/text/WTFString.h>
+#include "CodeLocation.h"
+#include <wtf/Platform.h>
namespace JSC {
-namespace Bindings {
-
-class JavaField {
-public:
- virtual ~JavaField() {}
-
- virtual String name() const = 0;
+struct HandlerInfo {
+ uint32_t start;
+ uint32_t end;
+ uint32_t target;
+ uint32_t scopeDepth;
+#if ENABLE(JIT)
+ CodeLocationLabel nativeCode;
+#endif
};
-} // namespace Bindings
-
} // namespace JSC
-#endif // ENABLE(JAVA_BRIDGE)
+#endif // HandlerInfo_h
-#endif // JavaFieldV8_h
diff --git a/Source/JavaScriptCore/bytecode/LineInfo.h b/Source/JavaScriptCore/bytecode/LineInfo.h
new file mode 100644
index 000000000..e9e70138a
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/LineInfo.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LineInfo_h
+#define LineInfo_h
+
+#include <wtf/StdLibExtras.h>
+
+namespace JSC {
+
+struct LineInfo {
+ uint32_t instructionOffset;
+ int32_t lineNumber;
+};
+
+} // namespace JSC
+
+#endif // LineInfo_h
+
diff --git a/Source/JavaScriptCore/bytecode/MethodCallLinkInfo.cpp b/Source/JavaScriptCore/bytecode/MethodCallLinkInfo.cpp
new file mode 100644
index 000000000..1fcf5850f
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/MethodCallLinkInfo.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MethodCallLinkInfo.h"
+
+#if ENABLE(JIT)
+
+#include "JITStubs.h"
+#include "RepatchBuffer.h"
+
+namespace JSC {
+
+void MethodCallLinkInfo::reset(RepatchBuffer& repatchBuffer, JITCode::JITType jitType)
+{
+ cachedStructure.clearToMaxUnsigned();
+ cachedPrototype.clear();
+ cachedPrototypeStructure.clearToMaxUnsigned();
+ cachedFunction.clear();
+
+ ASSERT_UNUSED(jitType, jitType == JITCode::BaselineJIT);
+
+ repatchBuffer.relink(callReturnLocation, cti_op_get_by_id_method_check);
+}
+
+} // namespace JSC
+
+#endif // ENABLE(JIT)
diff --git a/Source/JavaScriptCore/bytecode/MethodCallLinkInfo.h b/Source/JavaScriptCore/bytecode/MethodCallLinkInfo.h
new file mode 100644
index 000000000..2243bc24e
--- /dev/null
+++ b/Source/JavaScriptCore/bytecode/MethodCallLinkInfo.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef MethodCallLinkInfo_h
+#define MethodCallLinkInfo_h
+
+#include "CodeLocation.h"
+#include "JITCode.h"
+#include "JITWriteBarrier.h"
+#include <wtf/Platform.h>
+
+namespace JSC {
+
+#if ENABLE(JIT)
+
+class RepatchBuffer;
+
+struct MethodCallLinkInfo {
+ MethodCallLinkInfo()
+ : seen(false)
+ {
+ }
+
+ bool seenOnce()
+ {
+ return seen;
+ }
+
+ void setSeen()
+ {
+ seen = true;
+ }
+
+ void reset(RepatchBuffer&, JITCode::JITType);
+
+ unsigned bytecodeIndex;
+ CodeLocationCall callReturnLocation;
+ JITWriteBarrier<Structure> cachedStructure;
+ JITWriteBarrier<Structure> cachedPrototypeStructure;
+ // We'd like this to actually be JSFunction, but InternalFunction and JSFunction
+ // don't have a common parent class and we allow specialisation on both
+ JITWriteBarrier<JSObject> cachedFunction;
+ JITWriteBarrier<JSObject> cachedPrototype;
+ bool seen;
+};
+
+inline void* getMethodCallLinkInfoReturnLocation(MethodCallLinkInfo* methodCallLinkInfo)
+{
+ return methodCallLinkInfo->callReturnLocation.executableAddress();
+}
+
+inline unsigned getMethodCallLinkInfoBytecodeIndex(MethodCallLinkInfo* methodCallLinkInfo)
+{
+ return methodCallLinkInfo->bytecodeIndex;
+}
+
+#endif // ENABLE(JIT)
+
+} // namespace JSC
+
+#endif // MethodCallLinkInfo_h
diff --git a/Source/JavaScriptCore/bytecode/StructureStubInfo.h b/Source/JavaScriptCore/bytecode/StructureStubInfo.h
index 830b75594..5c7ee0bb8 100644
--- a/Source/JavaScriptCore/bytecode/StructureStubInfo.h
+++ b/Source/JavaScriptCore/bytecode/StructureStubInfo.h
@@ -231,8 +231,18 @@ namespace JSC {
CodeLocationLabel hotPathBegin;
};
+ inline void* getStructureStubInfoReturnLocation(StructureStubInfo* structureStubInfo)
+ {
+ return structureStubInfo->callReturnLocation.executableAddress();
+ }
+
+ inline unsigned getStructureStubInfoBytecodeIndex(StructureStubInfo* structureStubInfo)
+ {
+ return structureStubInfo->bytecodeIndex;
+ }
+
} // namespace JSC
-#endif
+#endif // ENABLE(JIT)
#endif // StructureStubInfo_h
diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index dec5c826e..bfb1618a6 100644
--- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -230,7 +230,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, ScopeChainNode* s
// FIXME: Move code that modifies the global object to Interpreter::execute.
- m_codeBlock->m_numParameters = 1; // Allocate space for "this"
+ m_codeBlock->setNumParameters(1); // Allocate space for "this"
codeBlock->m_numCapturedVars = codeBlock->m_numVars;
if (compilationKind == OptimizingCompilation)
@@ -401,7 +401,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, ScopeChainN
// Add "this" as a parameter
int nextParameterIndex = CallFrame::thisArgumentOffset();
m_thisRegister.setIndex(nextParameterIndex--);
- ++m_codeBlock->m_numParameters;
+ m_codeBlock->addParameter();
for (size_t i = 0; i < parameters.size(); ++i)
addParameter(parameters[i], nextParameterIndex--);
@@ -459,7 +459,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, ScopeChainNode* scopeCh
emitOpcode(op_enter);
codeBlock->setGlobalData(m_globalData);
- m_codeBlock->m_numParameters = 1; // Allocate space for "this"
+ m_codeBlock->setNumParameters(1);
const DeclarationStacks::FunctionStack& functionStack = evalNode->functionStack();
for (size_t i = 0; i < functionStack.size(); ++i)
@@ -500,7 +500,7 @@ void BytecodeGenerator::addParameter(const Identifier& ident, int parameterIndex
// To maintain the calling convention, we have to allocate unique space for
// each parameter, even if the parameter doesn't make it into the symbol table.
- ++m_codeBlock->m_numParameters;
+ m_codeBlock->addParameter();
}
RegisterID* BytecodeGenerator::registerFor(const Identifier& ident)
@@ -1869,7 +1869,7 @@ RegisterID* BytecodeGenerator::emitReturn(RegisterID* src)
emitOpcode(op_tear_off_activation);
instructions().append(m_activationRegister->index());
instructions().append(m_codeBlock->argumentsRegister());
- } else if (m_codeBlock->usesArguments() && m_codeBlock->m_numParameters != 1 && !m_codeBlock->isStrictMode()) {
+ } else if (m_codeBlock->usesArguments() && m_codeBlock->numParameters() != 1 && !m_codeBlock->isStrictMode()) {
emitOpcode(op_tear_off_arguments);
instructions().append(m_codeBlock->argumentsRegister());
}
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
index 40ad857cf..eb00bcb3c 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp
@@ -51,7 +51,7 @@ namespace JSC { namespace DFG {
AbstractState::AbstractState(CodeBlock* codeBlock, Graph& graph)
: m_codeBlock(codeBlock)
, m_graph(graph)
- , m_variables(codeBlock->m_numParameters, graph.m_localVars)
+ , m_variables(codeBlock->numParameters(), graph.m_localVars)
, m_block(0)
{
size_t maxBlockSize = 0;
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index 3b1f8c860..964618c43 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -53,7 +53,7 @@ public:
, m_constantNaN(UINT_MAX)
, m_constant1(UINT_MAX)
, m_constants(codeBlock->numberOfConstantRegisters())
- , m_numArguments(codeBlock->m_numParameters)
+ , m_numArguments(codeBlock->numParameters())
, m_numLocals(codeBlock->m_numCalleeRegisters)
, m_preservedVars(codeBlock->m_numVars)
, m_parameterSlots(0)
@@ -2478,7 +2478,7 @@ ByteCodeParser::InlineStackEntry::InlineStackEntry(ByteCodeParser* byteCodeParse
inlineCallFrame.stackOffset = inlineCallFrameStart + RegisterFile::CallFrameHeaderSize;
inlineCallFrame.callee.set(*byteCodeParser->m_globalData, byteCodeParser->m_codeBlock->ownerExecutable(), callee);
inlineCallFrame.caller = byteCodeParser->currentCodeOrigin();
- inlineCallFrame.arguments.resize(codeBlock->m_numParameters); // Set the number of arguments including this, but don't configure the value recoveries, yet.
+ inlineCallFrame.arguments.resize(codeBlock->numParameters()); // Set the number of arguments including this, but don't configure the value recoveries, yet.
inlineCallFrame.isCall = isCall(kind);
byteCodeParser->m_codeBlock->inlineCallFrames().append(inlineCallFrame);
m_inlineCallFrame = &byteCodeParser->m_codeBlock->inlineCallFrames().last();
@@ -2556,9 +2556,9 @@ void ByteCodeParser::parseCodeBlock()
// Either the block is linkable or it isn't. If it's linkable then it's the last
// block in the blockLinkingTargets list. If it's not then the last block will
// have a lower bytecode index that the one we're about to give to this block.
- if (m_inlineStackTop->m_blockLinkingTargets.isEmpty() || m_inlineStackTop->m_blockLinkingTargets.last() != m_currentIndex) {
+ if (m_inlineStackTop->m_blockLinkingTargets.isEmpty() || m_graph.m_blocks[m_inlineStackTop->m_blockLinkingTargets.last()]->bytecodeBegin != m_currentIndex) {
// Make the block linkable.
- ASSERT(m_inlineStackTop->m_blockLinkingTargets.isEmpty() || m_inlineStackTop->m_blockLinkingTargets.last() < m_currentIndex);
+ ASSERT(m_inlineStackTop->m_blockLinkingTargets.isEmpty() || m_graph.m_blocks[m_inlineStackTop->m_blockLinkingTargets.last()]->bytecodeBegin < m_currentIndex);
m_inlineStackTop->m_blockLinkingTargets.append(m_graph.m_blocks.size() - 1);
}
// Change its bytecode begin and continue.
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.cpp b/Source/JavaScriptCore/dfg/DFGGraph.cpp
index 487b69206..2a3e23040 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.cpp
+++ b/Source/JavaScriptCore/dfg/DFGGraph.cpp
@@ -344,8 +344,8 @@ void Graph::predictArgumentTypes(CodeBlock* codeBlock)
ASSERT(codeBlock->alternative());
CodeBlock* profiledCodeBlock = codeBlock->alternative();
- ASSERT(codeBlock->m_numParameters >= 1);
- for (size_t arg = 0; arg < static_cast<size_t>(codeBlock->m_numParameters); ++arg) {
+ ASSERT(codeBlock->numParameters() >= 1);
+ for (size_t arg = 0; arg < static_cast<size_t>(codeBlock->numParameters()); ++arg) {
ValueProfile* profile = profiledCodeBlock->valueProfileForArgument(arg);
if (!profile)
continue;
diff --git a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
index c50b84f7f..593e4d930 100644
--- a/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
+++ b/Source/JavaScriptCore/dfg/DFGJITCompiler.cpp
@@ -260,7 +260,7 @@ void JITCompiler::compileFunction(JITCode& entry, MacroAssemblerCodePtr& entryWi
compileEntry();
load32(AssemblyHelpers::payloadFor((VirtualRegister)RegisterFile::ArgumentCount), GPRInfo::regT1);
- branch32(AboveOrEqual, GPRInfo::regT1, Imm32(m_codeBlock->m_numParameters)).linkTo(fromArityCheck, this);
+ branch32(AboveOrEqual, GPRInfo::regT1, Imm32(m_codeBlock->numParameters())).linkTo(fromArityCheck, this);
move(stackPointerRegister, GPRInfo::argumentGPR0);
poke(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
Call callArityCheck = call();
diff --git a/Source/JavaScriptCore/dfg/DFGOperations.cpp b/Source/JavaScriptCore/dfg/DFGOperations.cpp
index 7b4ef3f88..2e6fd9276 100644
--- a/Source/JavaScriptCore/dfg/DFGOperations.cpp
+++ b/Source/JavaScriptCore/dfg/DFGOperations.cpp
@@ -411,9 +411,9 @@ EncodedJSValue DFG_OPERATION operationArrayPush(ExecState* exec, EncodedJSValue
return JSValue::encode(jsNumber(array->length()));
}
-EncodedJSValue DFG_OPERATION operationArrayPop(ExecState*, JSArray* array)
+EncodedJSValue DFG_OPERATION operationArrayPop(ExecState* exec, JSArray* array)
{
- return JSValue::encode(array->pop());
+ return JSValue::encode(array->pop(exec));
}
void DFG_OPERATION operationPutByIdStrict(ExecState* exec, EncodedJSValue encodedValue, JSCell* base, Identifier* propertyName)
@@ -656,7 +656,7 @@ inline void* linkFor(ExecState* execCallee, ReturnAddressPtr returnAddress, Code
return 0;
}
codeBlock = &functionExecutable->generatedBytecodeFor(kind);
- if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->m_numParameters))
+ if (execCallee->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters()))
codePtr = functionExecutable->generatedJITCodeWithArityCheckFor(kind);
else
codePtr = functionExecutable->generatedJITCodeFor(kind).addressForCall();
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 939fef669..feb705ab8 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -1070,7 +1070,7 @@ void SpeculativeJIT::checkArgumentTypes()
for (size_t i = 0; i < m_variables.size(); ++i)
m_variables[i] = ValueSource(ValueInRegisterFile);
- for (int i = 0; i < m_jit.codeBlock()->m_numParameters; ++i) {
+ for (int i = 0; i < m_jit.codeBlock()->numParameters(); ++i) {
VariableAccessData* variableAccessData = at(m_jit.graph().m_arguments[i]).variableAccessData();
VirtualRegister virtualRegister = variableAccessData->local();
PredictedType predictedType = variableAccessData->prediction();
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
index da48d3a2c..3b709400d 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h
@@ -2744,7 +2744,7 @@ inline SpeculativeJIT::SpeculativeJIT(JITCompiler& jit)
, m_compileIndex(0)
, m_generationInfo(m_jit.codeBlock()->m_numCalleeRegisters)
, m_blockHeads(jit.graph().m_blocks.size())
- , m_arguments(jit.codeBlock()->m_numParameters)
+ , m_arguments(jit.codeBlock()->numParameters())
, m_variables(jit.graph().m_localVars)
, m_lastSetOperand(std::numeric_limits<int>::max())
, m_state(m_jit.codeBlock(), m_jit.graph())
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
index bbe6171eb..d6a82b1cc 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp
@@ -3203,7 +3203,7 @@ void SpeculativeJIT::compile(Node& node)
GPRReg resultGPR = result.gpr();
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSByteArray::offsetOfStorage()), resultGPR);
- m_jit.load32(MacroAssembler::Address(baseGPR, ByteArray::offsetOfSize()), resultGPR);
+ m_jit.load32(MacroAssembler::Address(resultGPR, ByteArray::offsetOfSize()), resultGPR);
integerResult(resultGPR, m_compileIndex);
break;
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index c6586a679..7e36165f3 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -3198,7 +3198,7 @@ void SpeculativeJIT::compile(Node& node)
speculationCheck(BadType, JSValueRegs(baseGPR), node.child1(), m_jit.branchPtr(MacroAssembler::NotEqual, MacroAssembler::Address(baseGPR, JSCell::classInfoOffset()), MacroAssembler::TrustedImmPtr(&JSByteArray::s_info)));
m_jit.loadPtr(MacroAssembler::Address(baseGPR, JSByteArray::offsetOfStorage()), resultGPR);
- m_jit.load32(MacroAssembler::Address(baseGPR, ByteArray::offsetOfSize()), resultGPR);
+ m_jit.load32(MacroAssembler::Address(resultGPR, ByteArray::offsetOfSize()), resultGPR);
integerResult(resultGPR, m_compileIndex);
break;
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 38befcd4f..980bf8a1a 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -370,16 +370,16 @@ NEVER_INLINE bool Interpreter::resolveThisAndProperty(CallFrame* callFrame, Inst
ALWAYS_INLINE CallFrame* Interpreter::slideRegisterWindowForCall(CodeBlock* newCodeBlock, RegisterFile* registerFile, CallFrame* callFrame, size_t registerOffset, int argumentCountIncludingThis)
{
// This ensures enough space for the worst case scenario of zero arguments passed by the caller.
- if (!registerFile->grow(callFrame->registers() + registerOffset + newCodeBlock->m_numParameters + newCodeBlock->m_numCalleeRegisters))
+ if (!registerFile->grow(callFrame->registers() + registerOffset + newCodeBlock->numParameters() + newCodeBlock->m_numCalleeRegisters))
return 0;
- if (argumentCountIncludingThis >= newCodeBlock->m_numParameters) {
+ if (argumentCountIncludingThis >= newCodeBlock->numParameters()) {
Register* newCallFrame = callFrame->registers() + registerOffset;
return CallFrame::create(newCallFrame);
}
// Too few arguments -- copy arguments, then fill in missing arguments with undefined.
- size_t delta = newCodeBlock->m_numParameters - argumentCountIncludingThis;
+ size_t delta = newCodeBlock->numParameters() - argumentCountIncludingThis;
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset + delta);
Register* dst = &newCallFrame->uncheckedR(CallFrame::thisArgumentOffset());
@@ -556,7 +556,6 @@ void Interpreter::initialize(bool canUseJIT)
for (int i = 0; i < numOpcodeIDs; ++i) {
Opcode opcode = bitwise_cast<void*>(static_cast<uintptr_t>(i));
m_opcodeTable[i] = opcode;
- m_opcodeIDTable.add(opcode, static_cast<OpcodeID>(i));
}
} else {
privateExecute(InitializeAndReturn, 0, 0);
@@ -603,14 +602,14 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
const Register* end;
JSValue v;
- it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->m_numParameters;
+ it = callFrame->registers() - RegisterFile::CallFrameHeaderSize - codeBlock->numParameters();
v = (*it).jsValue();
#if USE(JSVALUE32_64)
printf("[this] | %10p | %-16s 0x%llx \n", it, v.description(), JSValue::encode(v)); ++it;
#else
printf("[this] | %10p | %-16s %p \n", it, v.description(), JSValue::encode(v)); ++it;
#endif
- end = it + max(codeBlock->m_numParameters - 1, 0); // - 1 to skip "this"
+ end = it + max(codeBlock->numParameters() - 1, 0); // - 1 to skip "this"
if (it != end) {
do {
v = (*it).jsValue();
@@ -669,6 +668,8 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
bool Interpreter::isOpcode(Opcode opcode)
{
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
+ if (!m_enabled)
+ return opcode >= 0 && static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode)) <= op_end;
return opcode != HashTraits<Opcode>::emptyValue()
&& !HashTraits<Opcode>::isDeletedValue(opcode)
&& m_opcodeIDTable.contains(opcode);
@@ -984,13 +985,13 @@ failedJSONP:
CodeBlock* codeBlock = &program->generatedBytecode();
Register* oldEnd = m_registerFile.end();
- Register* newEnd = oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
+ Register* newEnd = oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
if (!m_registerFile.grow(newEnd))
return checkedReturn(throwStackOverflowError(callFrame));
- CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize);
- ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
- newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->m_numParameters, 0);
+ CallFrame* newCallFrame = CallFrame::create(oldEnd + codeBlock->numParameters() + RegisterFile::CallFrameHeaderSize);
+ ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
+ newCallFrame->init(codeBlock, 0, scopeChain, CallFrame::noCaller(), codeBlock->numParameters(), 0);
newCallFrame->setThisValue(thisObj);
TopCallFrameSetter topCallFrame(callFrame->globalData(), newCallFrame);
@@ -1255,7 +1256,7 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* functionE
}
newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), argumentCountIncludingThis, function);
scopeChain->globalData->topCallFrame = newCallFrame;
- CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->m_numParameters, argumentCountIncludingThis };
+ CallFrameClosure result = { callFrame, newCallFrame, function, functionExecutable, scopeChain->globalData, oldEnd, scopeChain, codeBlock->numParameters(), argumentCountIncludingThis };
return result;
}
@@ -1366,8 +1367,8 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSValue
CallFrame* newCallFrame = CallFrame::create(m_registerFile.begin() + globalRegisterOffset);
- ASSERT(codeBlock->m_numParameters == 1); // 1 parameter for 'this'.
- newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->m_numParameters, 0);
+ ASSERT(codeBlock->numParameters() == 1); // 1 parameter for 'this'.
+ newCallFrame->init(codeBlock, 0, scopeChain, callFrame->addHostCallFrameFlag(), codeBlock->numParameters(), 0);
newCallFrame->setThisValue(thisValue);
TopCallFrameSetter topCallFrame(callFrame->globalData(), newCallFrame);
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.h b/Source/JavaScriptCore/interpreter/Interpreter.h
index 368fa27f2..6dfd331f8 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.h
+++ b/Source/JavaScriptCore/interpreter/Interpreter.h
@@ -114,11 +114,9 @@ namespace JSC {
ASSERT(m_initialized);
#if ENABLE(COMPUTED_GOTO_INTERPRETER)
ASSERT(isOpcode(opcode));
- if (!m_enabled) {
- OpcodeID result = static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode));
- ASSERT(result == m_opcodeIDTable.get(opcode));
- return result;
- }
+ if (!m_enabled)
+ return static_cast<OpcodeID>(bitwise_cast<uintptr_t>(opcode));
+
return m_opcodeIDTable.get(opcode);
#else
return opcode;
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index 4a6e3fb3d..025b5b706 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -557,8 +557,7 @@ JITCode JIT::privateCompile(CodePtr* functionEntryArityCheck)
#if ENABLE(VALUE_PROFILER)
ASSERT(m_bytecodeOffset == (unsigned)-1);
if (shouldEmitProfiling()) {
- m_codeBlock->setArgumentValueProfileSize(m_codeBlock->m_numParameters);
- for (int argument = 0; argument < m_codeBlock->m_numParameters; ++argument) {
+ for (int argument = 0; argument < m_codeBlock->numParameters(); ++argument) {
// If this is a constructor, then we want to put in a dummy profiling site (to
// keep things consistent) but we don't actually want to record the dummy value.
if (m_codeBlock->m_isConstructor && !argument)
diff --git a/Source/JavaScriptCore/jit/JITExceptions.cpp b/Source/JavaScriptCore/jit/JITExceptions.cpp
new file mode 100644
index 000000000..24baca41b
--- /dev/null
+++ b/Source/JavaScriptCore/jit/JITExceptions.cpp
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "JITExceptions.h"
+
+#include "CallFrame.h"
+#include "CodeBlock.h"
+#include "Interpreter.h"
+#include "JSGlobalData.h"
+#include "JSValue.h"
+
+#if ENABLE(ASSEMBLER)
+
+namespace JSC {
+
+ExceptionHandler genericThrow(JSGlobalData* globalData, ExecState* callFrame, JSValue exceptionValue, unsigned vPCIndex)
+{
+ ASSERT(exceptionValue);
+
+ globalData->exception = JSValue();
+ HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex); // This may update callFrame & exceptionValue!
+ globalData->exception = exceptionValue;
+
+ void* catchRoutine;
+ Instruction* catchPCForInterpreter = 0;
+ if (handler) {
+ catchRoutine = handler->nativeCode.executableAddress();
+ if (callFrame->codeBlock()->hasInstructions())
+ catchPCForInterpreter = &callFrame->codeBlock()->instructions()[handler->target];
+ } else
+ catchRoutine = FunctionPtr(ctiOpThrowNotCaught).value();
+
+ globalData->callFrameForThrow = callFrame;
+ globalData->targetMachinePCForThrow = catchRoutine;
+ globalData->targetInterpreterPCForThrow = catchPCForInterpreter;
+
+ ASSERT(catchRoutine);
+ ExceptionHandler exceptionHandler = { catchRoutine, callFrame };
+ return exceptionHandler;
+}
+
+ExceptionHandler jitThrow(JSGlobalData* globalData, ExecState* callFrame, JSValue exceptionValue, ReturnAddressPtr faultLocation)
+{
+ return genericThrow(globalData, callFrame, exceptionValue, callFrame->codeBlock()->bytecodeOffset(faultLocation));
+}
+
+}
+
+#endif
diff --git a/Source/WebCore/bridge/jni/v8/JavaClassV8.h b/Source/JavaScriptCore/jit/JITExceptions.h
index e60ca2dc6..59ded187d 100644
--- a/Source/WebCore/bridge/jni/v8/JavaClassV8.h
+++ b/Source/JavaScriptCore/jit/JITExceptions.h
@@ -1,60 +1,56 @@
/*
- * Copyright 2010, The Android Open Source Project
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- * * Redistributions of source code must retain the above copyright
+ * 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
+ * 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JavaClassV8_h
-#define JavaClassV8_h
+#ifndef JITExceptions_h
+#define JITExceptions_h
-#if ENABLE(JAVA_BRIDGE)
+#include "JSValue.h"
+#include "MacroAssemblerCodeRef.h"
-#include <wtf/HashMap.h>
-#include <wtf/Vector.h>
-#include <wtf/text/StringHash.h>
-#include <wtf/text/WTFString.h>
+#if ENABLE(ASSEMBLER)
namespace JSC {
-namespace Bindings {
+class ExecState;
+class JSGlobalData;
-class JavaField;
-class JavaMethod;
+// This header gives other parts of the system access to the JIT's prototocol
+// for the throwing and handling exceptions.
-typedef Vector<JavaMethod*> MethodList;
-typedef HashMap<WTF::String, JavaField*> FieldMap;
-
-class JavaClass {
-public:
- virtual ~JavaClass() {}
-
- virtual MethodList methodsNamed(const char* name) const = 0;
- virtual JavaField* fieldNamed(const char* name) const = 0;
+struct ExceptionHandler {
+ void* catchRoutine;
+ ExecState* callFrame;
};
-} // namespace Bindings
+ExceptionHandler genericThrow(JSGlobalData*, ExecState*, JSValue exceptionValue, unsigned vPCIndex);
+
+ExceptionHandler jitThrow(JSGlobalData*, ExecState*, JSValue exceptionValue, ReturnAddressPtr faultLocation);
} // namespace JSC
-#endif // ENABLE(JAVA_BRIDGE)
+#endif
+
+#endif // JITExceptions_h
-#endif // JavaClassV8_h
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp
index eda8c8fba..3c16efe01 100644
--- a/Source/JavaScriptCore/jit/JITStubs.cpp
+++ b/Source/JavaScriptCore/jit/JITStubs.cpp
@@ -33,6 +33,7 @@
#if ENABLE(JIT)
#include "JITStubs.h"
+#include "CommonSlowPaths.h"
#include "Arguments.h"
#include "CallFrame.h"
#include "CodeBlock.h"
@@ -43,6 +44,7 @@
#include "Heap.h"
#include "InlineASM.h"
#include "JIT.h"
+#include "JITExceptions.h"
#include "JSActivation.h"
#include "JSArray.h"
#include "JSByteArray.h"
@@ -1032,26 +1034,6 @@ static NEVER_INLINE void returnToThrowTrampoline(JSGlobalData* globalData, Retur
} \
} while (0)
-struct ExceptionHandler {
- void* catchRoutine;
- CallFrame* callFrame;
-};
-
-static ExceptionHandler jitThrow(JSGlobalData* globalData, CallFrame* callFrame, JSValue exceptionValue, ReturnAddressPtr faultLocation)
-{
- ASSERT(exceptionValue);
-
- unsigned vPCIndex = callFrame->codeBlock()->bytecodeOffset(faultLocation);
- globalData->exception = JSValue();
- HandlerInfo* handler = globalData->interpreter->throwException(callFrame, exceptionValue, vPCIndex); // This may update callFrame & exceptionValue!
- globalData->exception = exceptionValue;
-
- void* catchRoutine = handler ? handler->nativeCode.executableAddress() : FunctionPtr(ctiOpThrowNotCaught).value();
- ASSERT(catchRoutine);
- ExceptionHandler exceptionHandler = { catchRoutine, callFrame };
- return exceptionHandler;
-}
-
// Helper function for JIT stubs that may throw an exception in the middle of
// processing a function call. This function rolls back the register file to
// our caller, so exception processing can proceed from a valid state.
@@ -2088,29 +2070,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_instanceof)
JSValue value = stackFrame.args[0].jsValue();
JSValue baseVal = stackFrame.args[1].jsValue();
JSValue proto = stackFrame.args[2].jsValue();
-
- // At least one of these checks must have failed to get to the slow case.
- ASSERT(!value.isCell() || !baseVal.isCell() || !proto.isCell()
- || !value.isObject() || !baseVal.isObject() || !proto.isObject()
- || !asObject(baseVal)->structure()->typeInfo().implementsDefaultHasInstance());
-
-
- // ECMA-262 15.3.5.3:
- // Throw an exception either if baseVal is not an object, or if it does not implement 'HasInstance' (i.e. is a function).
- TypeInfo typeInfo(UnspecifiedType);
- if (!baseVal.isObject() || !(typeInfo = asObject(baseVal)->structure()->typeInfo()).implementsHasInstance()) {
- stackFrame.globalData->exception = createInvalidParamError(stackFrame.callFrame, "instanceof", baseVal);
- VM_THROW_EXCEPTION();
- }
- ASSERT(typeInfo.type() != UnspecifiedType);
-
- if (!typeInfo.overridesHasInstance() && !value.isObject())
- return JSValue::encode(jsBoolean(false));
-
- JSValue result = jsBoolean(asObject(baseVal)->methodTable()->hasInstance(asObject(baseVal), callFrame, value, proto));
+
+ bool result = CommonSlowPaths::opInstanceOfSlow(callFrame, value, baseVal, proto);
CHECK_FOR_EXCEPTION_AT_END();
-
- return JSValue::encode(result);
+ return JSValue::encode(jsBoolean(result));
}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_del_by_id)
@@ -2209,13 +2172,13 @@ inline CallFrame* arityCheckFor(CallFrame* callFrame, RegisterFile* registerFile
int argumentCountIncludingThis = callFrame->argumentCountIncludingThis();
// This ensures enough space for the worst case scenario of zero arguments passed by the caller.
- if (!registerFile->grow(callFrame->registers() + newCodeBlock->m_numParameters + newCodeBlock->m_numCalleeRegisters))
+ if (!registerFile->grow(callFrame->registers() + newCodeBlock->numParameters() + newCodeBlock->m_numCalleeRegisters))
return 0;
- ASSERT(argumentCountIncludingThis < newCodeBlock->m_numParameters);
+ ASSERT(argumentCountIncludingThis < newCodeBlock->numParameters());
// Too few arguments -- copy call frame and arguments, then fill in missing arguments with undefined.
- size_t delta = newCodeBlock->m_numParameters - argumentCountIncludingThis;
+ size_t delta = newCodeBlock->numParameters() - argumentCountIncludingThis;
Register* src = callFrame->registers();
Register* dst = callFrame->registers() + delta;
@@ -2276,7 +2239,7 @@ inline void* lazyLinkFor(CallFrame* callFrame, CodeSpecializationKind kind)
if (error)
return 0;
codeBlock = &functionExecutable->generatedBytecodeFor(kind);
- if (callFrame->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->m_numParameters)
+ if (callFrame->argumentCountIncludingThis() < static_cast<size_t>(codeBlock->numParameters())
|| callLinkInfo->callType == CallLinkInfo::CallVarargs)
codePtr = functionExecutable->generatedJITCodeWithArityCheckFor(kind);
else
@@ -2424,25 +2387,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve)
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
- ScopeChainNode* scopeChain = callFrame->scopeChain();
- ScopeChainIterator iter = scopeChain->begin();
- ScopeChainIterator end = scopeChain->end();
- ASSERT(iter != end);
-
- Identifier& ident = stackFrame.args[0].identifier();
- do {
- JSObject* o = iter->get();
- PropertySlot slot(o);
- if (o->getPropertySlot(callFrame, ident, slot)) {
- JSValue result = slot.getValue(callFrame, ident);
- CHECK_FOR_EXCEPTION_AT_END();
- return JSValue::encode(result);
- }
- } while (++iter != end);
-
- stackFrame.globalData->exception = createUndefinedVariableError(callFrame, ident);
- VM_THROW_EXCEPTION();
+ JSValue result = CommonSlowPaths::opResolve(callFrame, stackFrame.args[0].identifier());
+ CHECK_FOR_EXCEPTION_AT_END();
+ return JSValue::encode(result);
}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
@@ -2784,38 +2732,9 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_skip)
{
STUB_INIT_STACK_FRAME(stackFrame);
- CallFrame* callFrame = stackFrame.callFrame;
- ScopeChainNode* scopeChain = callFrame->scopeChain();
-
- int skip = stackFrame.args[1].int32();
-
- ScopeChainIterator iter = scopeChain->begin();
- ScopeChainIterator end = scopeChain->end();
- ASSERT(iter != end);
- CodeBlock* codeBlock = callFrame->codeBlock();
- bool checkTopLevel = codeBlock->codeType() == FunctionCode && codeBlock->needsFullScopeChain();
- ASSERT(skip || !checkTopLevel);
- if (checkTopLevel && skip--) {
- if (callFrame->uncheckedR(codeBlock->activationRegister()).jsValue())
- ++iter;
- }
- while (skip--) {
- ++iter;
- ASSERT(iter != end);
- }
- Identifier& ident = stackFrame.args[0].identifier();
- do {
- JSObject* o = iter->get();
- PropertySlot slot(o);
- if (o->getPropertySlot(callFrame, ident, slot)) {
- JSValue result = slot.getValue(callFrame, ident);
- CHECK_FOR_EXCEPTION_AT_END();
- return JSValue::encode(result);
- }
- } while (++iter != end);
-
- stackFrame.globalData->exception = createUndefinedVariableError(callFrame, ident);
- VM_THROW_EXCEPTION();
+ JSValue result = CommonSlowPaths::opResolveSkip(stackFrame.callFrame, stackFrame.args[0].identifier(), stackFrame.args[1].int32());
+ CHECK_FOR_EXCEPTION_AT_END();
+ return JSValue::encode(result);
}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_global)
@@ -3143,33 +3062,9 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_base)
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
- ScopeChainNode* scopeChain = callFrame->scopeChain();
-
- ScopeChainIterator iter = scopeChain->begin();
- ScopeChainIterator end = scopeChain->end();
-
- // FIXME: add scopeDepthIsZero optimization
-
- ASSERT(iter != end);
-
- Identifier& ident = stackFrame.args[0].identifier();
- JSObject* base;
- do {
- base = iter->get();
- PropertySlot slot(base);
- if (base->getPropertySlot(callFrame, ident, slot)) {
- JSValue result = slot.getValue(callFrame, ident);
- CHECK_FOR_EXCEPTION_AT_END();
-
- callFrame->registers()[stackFrame.args[1].int32()] = JSValue(base);
- return JSValue::encode(result);
- }
- ++iter;
- } while (iter != end);
-
- stackFrame.globalData->exception = createUndefinedVariableError(callFrame, ident);
- VM_THROW_EXCEPTION_AT_END();
- return JSValue::encode(JSValue());
+ JSValue result = CommonSlowPaths::opResolveWithBase(callFrame, stackFrame.args[0].identifier(), callFrame->registers()[stackFrame.args[1].int32()]);
+ CHECK_FOR_EXCEPTION_AT_END();
+ return JSValue::encode(result);
}
DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_this)
@@ -3177,41 +3072,9 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_resolve_with_this)
STUB_INIT_STACK_FRAME(stackFrame);
CallFrame* callFrame = stackFrame.callFrame;
- ScopeChainNode* scopeChain = callFrame->scopeChain();
-
- ScopeChainIterator iter = scopeChain->begin();
- ScopeChainIterator end = scopeChain->end();
-
- // FIXME: add scopeDepthIsZero optimization
-
- ASSERT(iter != end);
-
- Identifier& ident = stackFrame.args[0].identifier();
- JSObject* base;
- do {
- base = iter->get();
- ++iter;
- PropertySlot slot(base);
- if (base->getPropertySlot(callFrame, ident, slot)) {
- JSValue result = slot.getValue(callFrame, ident);
- CHECK_FOR_EXCEPTION_AT_END();
-
- // All entries on the scope chain should be EnvironmentRecords (activations etc),
- // other then 'with' object, which are directly referenced from the scope chain,
- // and the global object. If we hit either an EnvironmentRecord or a global
- // object at the end of the scope chain, this is undefined. If we hit a non-
- // EnvironmentRecord within the scope chain, pass the base as the this value.
- if (iter == end || base->structure()->typeInfo().isEnvironmentRecord())
- callFrame->registers()[stackFrame.args[1].int32()] = jsUndefined();
- else
- callFrame->registers()[stackFrame.args[1].int32()] = JSValue(base);
- return JSValue::encode(result);
- }
- } while (iter != end);
-
- stackFrame.globalData->exception = createUndefinedVariableError(callFrame, ident);
- VM_THROW_EXCEPTION_AT_END();
- return JSValue::encode(JSValue());
+ JSValue result = CommonSlowPaths::opResolveWithThis(callFrame, stackFrame.args[0].identifier(), callFrame->registers()[stackFrame.args[1].int32()]);
+ CHECK_FOR_EXCEPTION_AT_END();
+ return JSValue::encode(result);
}
DEFINE_STUB_FUNCTION(JSObject*, op_new_func_exp)
diff --git a/Source/JavaScriptCore/jit/JITStubs.h b/Source/JavaScriptCore/jit/JITStubs.h
index dfaa3b113..241ace968 100644
--- a/Source/JavaScriptCore/jit/JITStubs.h
+++ b/Source/JavaScriptCore/jit/JITStubs.h
@@ -269,6 +269,8 @@ namespace JSC {
#define JIT_STUB __fastcall
#elif COMPILER(GCC)
#define JIT_STUB __attribute__ ((fastcall))
+ #elif COMPILER(SUNCC)
+ #define JIT_STUB
#else
#error "JIT_STUB function calls require fastcall conventions on x86, add appropriate directive/attribute here for your compiler!"
#endif
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp
index 7fb285a6b..5c2f0383f 100644
--- a/Source/JavaScriptCore/parser/Parser.cpp
+++ b/Source/JavaScriptCore/parser/Parser.cpp
@@ -30,7 +30,6 @@
#include "Lexer.h"
#include "NodeInfo.h"
#include "SourceProvider.h"
-#include "SourceProviderCacheItem.h"
#include <utility>
#include <wtf/HashFunctions.h>
#include <wtf/OwnPtr.h>
diff --git a/Source/JavaScriptCore/parser/SourceProviderCache.cpp b/Source/JavaScriptCore/parser/SourceProviderCache.cpp
index afeec5283..ad1cbe02e 100644
--- a/Source/JavaScriptCore/parser/SourceProviderCache.cpp
+++ b/Source/JavaScriptCore/parser/SourceProviderCache.cpp
@@ -26,8 +26,6 @@
#include "config.h"
#include "SourceProviderCache.h"
-#include "SourceProviderCacheItem.h"
-
namespace JSC {
SourceProviderCache::~SourceProviderCache()
@@ -37,7 +35,6 @@ SourceProviderCache::~SourceProviderCache()
void SourceProviderCache::clear()
{
- deleteAllValues(m_map);
m_map.clear();
m_contentByteSize = 0;
}
@@ -49,7 +46,7 @@ unsigned SourceProviderCache::byteSize() const
void SourceProviderCache::add(int sourcePosition, PassOwnPtr<SourceProviderCacheItem> item, unsigned size)
{
- m_map.add(sourcePosition, item.leakPtr());
+ m_map.add(sourcePosition, item);
m_contentByteSize += size;
}
diff --git a/Source/JavaScriptCore/parser/SourceProviderCache.h b/Source/JavaScriptCore/parser/SourceProviderCache.h
index c7f332d38..e94230d10 100644
--- a/Source/JavaScriptCore/parser/SourceProviderCache.h
+++ b/Source/JavaScriptCore/parser/SourceProviderCache.h
@@ -26,13 +26,13 @@
#ifndef SourceProviderCache_h
#define SourceProviderCache_h
+#include "SourceProviderCacheItem.h"
#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
namespace JSC {
-class SourceProviderCacheItem;
-
class SourceProviderCache {
public:
SourceProviderCache() : m_contentByteSize(0) {}
@@ -44,7 +44,7 @@ public:
const SourceProviderCacheItem* get(int sourcePosition) const { return m_map.get(sourcePosition); }
private:
- HashMap<int, SourceProviderCacheItem*> m_map;
+ HashMap<int, OwnPtr<SourceProviderCacheItem> > m_map;
unsigned m_contentByteSize;
};
diff --git a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
index d972693dd..dcf7a2fae 100644
--- a/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -380,7 +380,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncConcat(ExecState* exec)
curArg = (exec->argument(i));
++i;
}
- arr->setLength(n);
+ arr->setLength(exec, n);
return JSValue::encode(arr);
}
@@ -389,7 +389,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncPop(ExecState* exec)
JSValue thisValue = exec->hostThisValue();
if (isJSArray(thisValue))
- return JSValue::encode(asArray(thisValue)->pop());
+ return JSValue::encode(asArray(thisValue)->pop(exec));
JSObject* thisObj = thisValue.toObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
@@ -523,7 +523,7 @@ EncodedJSValue JSC_HOST_CALL arrayProtoFuncSlice(ExecState* exec)
if (v)
resObj->methodTable()->putByIndex(resObj, exec, n, v);
}
- resObj->setLength(n);
+ resObj->setLength(exec, n);
return JSValue::encode(result);
}
diff --git a/Source/JavaScriptCore/runtime/CommonSlowPaths.h b/Source/JavaScriptCore/runtime/CommonSlowPaths.h
new file mode 100644
index 000000000..ab4de7da8
--- /dev/null
+++ b/Source/JavaScriptCore/runtime/CommonSlowPaths.h
@@ -0,0 +1,204 @@
+/*
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CommonSlowPaths_h
+#define CommonSlowPaths_h
+
+#include "CodeBlock.h"
+#include "ExceptionHelpers.h"
+#include "JSArray.h"
+
+namespace JSC {
+
+// The purpose of this namespace is to include slow paths that are shared
+// between the interpreter and baseline JIT. They are written to be agnostic
+// with respect to the slow-path calling convention, but they do rely on the
+// JS code being executed more-or-less directly from bytecode (so the call
+// frame layout is unmodified, making it potentially awkward to use these
+// from any optimizing JIT, like the DFG).
+
+namespace CommonSlowPaths {
+
+ALWAYS_INLINE bool opInstanceOfSlow(ExecState* exec, JSValue value, JSValue baseVal, JSValue proto)
+{
+ ASSERT(!value.isCell() || !baseVal.isCell() || !proto.isCell()
+ || !value.isObject() || !baseVal.isObject() || !proto.isObject()
+ || !asObject(baseVal)->structure()->typeInfo().implementsDefaultHasInstance());
+
+
+ // ECMA-262 15.3.5.3:
+ // Throw an exception either if baseVal is not an object, or if it does not implement 'HasInstance' (i.e. is a function).
+ TypeInfo typeInfo(UnspecifiedType);
+ if (!baseVal.isObject() || !(typeInfo = asObject(baseVal)->structure()->typeInfo()).implementsHasInstance()) {
+ exec->globalData().exception = createInvalidParamError(exec, "instanceof", baseVal);
+ return false;
+ }
+ ASSERT(typeInfo.type() != UnspecifiedType);
+
+ if (!typeInfo.overridesHasInstance() && !value.isObject())
+ return false;
+
+ return asObject(baseVal)->methodTable()->hasInstance(asObject(baseVal), exec, value, proto);
+}
+
+inline bool opIn(ExecState* exec, JSValue propName, JSValue baseVal)
+{
+ if (!baseVal.isObject()) {
+ exec->globalData().exception = createInvalidParamError(exec, "in", baseVal);
+ return false;
+ }
+
+ JSObject* baseObj = asObject(baseVal);
+
+ uint32_t i;
+ if (propName.getUInt32(i))
+ return baseObj->hasProperty(exec, i);
+
+ Identifier property(exec, propName.toString(exec));
+ if (exec->globalData().exception)
+ return false;
+ return baseObj->hasProperty(exec, property);
+}
+
+ALWAYS_INLINE JSValue opResolve(ExecState* exec, Identifier& ident)
+{
+ ScopeChainNode* scopeChain = exec->scopeChain();
+
+ ScopeChainIterator iter = scopeChain->begin();
+ ScopeChainIterator end = scopeChain->end();
+ ASSERT(iter != end);
+
+ do {
+ JSObject* o = iter->get();
+ PropertySlot slot(o);
+ if (o->getPropertySlot(exec, ident, slot))
+ return slot.getValue(exec, ident);
+ } while (++iter != end);
+
+ exec->globalData().exception = createUndefinedVariableError(exec, ident);
+ return JSValue();
+}
+
+ALWAYS_INLINE JSValue opResolveSkip(ExecState* exec, Identifier& ident, int skip)
+{
+ ScopeChainNode* scopeChain = exec->scopeChain();
+
+ ScopeChainIterator iter = scopeChain->begin();
+ ScopeChainIterator end = scopeChain->end();
+ ASSERT(iter != end);
+ CodeBlock* codeBlock = exec->codeBlock();
+ bool checkTopLevel = codeBlock->codeType() == FunctionCode && codeBlock->needsFullScopeChain();
+ ASSERT(skip || !checkTopLevel);
+ if (checkTopLevel && skip--) {
+ if (exec->uncheckedR(codeBlock->activationRegister()).jsValue())
+ ++iter;
+ }
+ while (skip--) {
+ ++iter;
+ ASSERT(iter != end);
+ }
+ do {
+ JSObject* o = iter->get();
+ PropertySlot slot(o);
+ if (o->getPropertySlot(exec, ident, slot))
+ return slot.getValue(exec, ident);
+ } while (++iter != end);
+
+ exec->globalData().exception = createUndefinedVariableError(exec, ident);
+ return JSValue();
+}
+
+ALWAYS_INLINE JSValue opResolveWithBase(ExecState* exec, Identifier& ident, Register& baseSlot)
+{
+ ScopeChainNode* scopeChain = exec->scopeChain();
+
+ ScopeChainIterator iter = scopeChain->begin();
+ ScopeChainIterator end = scopeChain->end();
+
+ // FIXME: add scopeDepthIsZero optimization
+
+ ASSERT(iter != end);
+
+ JSObject* base;
+ do {
+ base = iter->get();
+ PropertySlot slot(base);
+ if (base->getPropertySlot(exec, ident, slot)) {
+ JSValue result = slot.getValue(exec, ident);
+ if (exec->globalData().exception)
+ return JSValue();
+
+ baseSlot = JSValue(base);
+ return result;
+ }
+ ++iter;
+ } while (iter != end);
+
+ exec->globalData().exception = createUndefinedVariableError(exec, ident);
+ return JSValue();
+}
+
+ALWAYS_INLINE JSValue opResolveWithThis(ExecState* exec, Identifier& ident, Register& baseSlot)
+{
+ ScopeChainNode* scopeChain = exec->scopeChain();
+
+ ScopeChainIterator iter = scopeChain->begin();
+ ScopeChainIterator end = scopeChain->end();
+
+ // FIXME: add scopeDepthIsZero optimization
+
+ ASSERT(iter != end);
+
+ JSObject* base;
+ do {
+ base = iter->get();
+ ++iter;
+ PropertySlot slot(base);
+ if (base->getPropertySlot(exec, ident, slot)) {
+ JSValue result = slot.getValue(exec, ident);
+ if (exec->globalData().exception)
+ return JSValue();
+
+ // All entries on the scope chain should be EnvironmentRecords (activations etc),
+ // other then 'with' object, which are directly referenced from the scope chain,
+ // and the global object. If we hit either an EnvironmentRecord or a global
+ // object at the end of the scope chain, this is undefined. If we hit a non-
+ // EnvironmentRecord within the scope chain, pass the base as the this value.
+ if (iter == end || base->structure()->typeInfo().isEnvironmentRecord())
+ baseSlot = jsUndefined();
+ else
+ baseSlot = JSValue(base);
+ return result;
+ }
+ } while (iter != end);
+
+ exec->globalData().exception = createUndefinedVariableError(exec, ident);
+ return JSValue();
+}
+
+} } // namespace JSC::CommonSlowPaths
+
+#endif // CommonSlowPaths_h
+
diff --git a/Source/JavaScriptCore/runtime/Executable.cpp b/Source/JavaScriptCore/runtime/Executable.cpp
index ad86463db..a364e84da 100644
--- a/Source/JavaScriptCore/runtime/Executable.cpp
+++ b/Source/JavaScriptCore/runtime/Executable.cpp
@@ -534,7 +534,7 @@ JSObject* FunctionExecutable::compileForCallInternal(ExecState* exec, ScopeChain
newCodeBlock->setAlternative(static_pointer_cast<CodeBlock>(m_codeBlockForCall.release()));
m_codeBlockForCall = newCodeBlock.release();
- m_numParametersForCall = m_codeBlockForCall->m_numParameters;
+ m_numParametersForCall = m_codeBlockForCall->numParameters();
ASSERT(m_numParametersForCall);
m_numCapturedVariables = m_codeBlockForCall->m_numCapturedVars;
m_symbolTable = m_codeBlockForCall->sharedSymbolTable();
@@ -597,7 +597,7 @@ JSObject* FunctionExecutable::compileForConstructInternal(ExecState* exec, Scope
newCodeBlock->setAlternative(static_pointer_cast<CodeBlock>(m_codeBlockForConstruct.release()));
m_codeBlockForConstruct = newCodeBlock.release();
- m_numParametersForConstruct = m_codeBlockForConstruct->m_numParameters;
+ m_numParametersForConstruct = m_codeBlockForConstruct->numParameters();
ASSERT(m_numParametersForConstruct);
m_numCapturedVariables = m_codeBlockForConstruct->m_numCapturedVars;
m_symbolTable = m_codeBlockForConstruct->sharedSymbolTable();
diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp
index da7be8564..b3210083d 100644
--- a/Source/JavaScriptCore/runtime/JSArray.cpp
+++ b/Source/JavaScriptCore/runtime/JSArray.cpp
@@ -27,6 +27,7 @@
#include "CachedCall.h"
#include "Error.h"
#include "Executable.h"
+#include "GetterSetter.h"
#include "PropertyNameArray.h"
#include <wtf/AVLTree.h>
#include <wtf/Assertions.h>
@@ -212,24 +213,94 @@ void JSArray::destroy(JSCell* cell)
jsCast<JSArray*>(cell)->JSArray::~JSArray();
}
-SparseArrayValueMap::iterator SparseArrayValueMap::find(unsigned i)
+inline std::pair<SparseArrayValueMap::iterator, bool> SparseArrayValueMap::add(JSArray* array, unsigned i)
{
- return m_map.find(i);
+ SparseArrayEntry entry;
+ std::pair<iterator, bool> result = m_map.add(i, entry);
+ size_t capacity = m_map.capacity();
+ if (capacity != m_reportedCapacity) {
+ Heap::heap(array)->reportExtraMemoryCost((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>)));
+ m_reportedCapacity = capacity;
+ }
+ return result;
}
-inline void SparseArrayValueMap::put(JSGlobalData& globalData, JSArray* array, unsigned i, JSValue value)
+inline void SparseArrayValueMap::put(ExecState* exec, JSArray* array, unsigned i, JSValue value)
{
- SparseArrayEntry temp;
- pair<Map::iterator, bool> result = m_map.add(i, temp);
- result.first->second.set(globalData, array, value);
- if (!result.second) // pre-existing entry
+ SparseArrayEntry& entry = add(array, i).first->second;
+
+ if (!(entry.attributes & (Getter | Setter))) {
+ if (entry.attributes & ReadOnly) {
+ // FIXME: should throw if being called from strict mode.
+ // throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
+ return;
+ }
+
+ entry.set(exec->globalData(), array, value);
return;
+ }
- size_t capacity = m_map.capacity();
- if (capacity != m_reportedCapacity) {
- Heap::heap(array)->reportExtraMemoryCost((capacity - m_reportedCapacity) * (sizeof(unsigned) + sizeof(WriteBarrier<Unknown>)));
- m_reportedCapacity = capacity;
+ JSValue accessor = entry.Base::get();
+ ASSERT(accessor.isGetterSetter());
+ JSObject* setter = asGetterSetter(accessor)->setter();
+
+ if (!setter) {
+ throwTypeError(exec, "setting a property that has only a getter");
+ return;
}
+
+ CallData callData;
+ CallType callType = setter->methodTable()->getCallData(setter, callData);
+ MarkedArgumentBuffer args;
+ args.append(value);
+ call(exec, setter, callType, callData, array, args);
+}
+
+inline void SparseArrayEntry::get(PropertySlot& slot) const
+{
+ JSValue value = Base::get();
+ ASSERT(value);
+
+ if (LIKELY(!value.isGetterSetter())) {
+ slot.setValue(value);
+ return;
+ }
+
+ JSObject* getter = asGetterSetter(value)->getter();
+ if (!getter) {
+ slot.setUndefined();
+ return;
+ }
+
+ slot.setGetterSlot(getter);
+}
+
+inline void SparseArrayEntry::get(PropertyDescriptor& descriptor) const
+{
+ descriptor.setDescriptor(Base::get(), attributes);
+}
+
+inline JSValue SparseArrayEntry::get(ExecState* exec, JSArray* array) const
+{
+ JSValue result = Base::get();
+ ASSERT(result);
+
+ if (LIKELY(!result.isGetterSetter()))
+ return result;
+
+ JSObject* getter = asGetterSetter(result)->getter();
+ if (!getter)
+ return jsUndefined();
+
+ CallData callData;
+ CallType callType = getter->methodTable()->getCallData(getter, callData);
+ return call(exec, getter, callType, callData, array, exec->emptyList());
+}
+
+inline JSValue SparseArrayEntry::getNonSparseMode() const
+{
+ ASSERT(!attributes);
+ return Base::get();
}
inline void SparseArrayValueMap::visitChildren(SlotVisitor& visitor)
@@ -239,6 +310,315 @@ inline void SparseArrayValueMap::visitChildren(SlotVisitor& visitor)
visitor.append(&it->second);
}
+void JSArray::enterSparseMode(JSGlobalData& globalData)
+{
+ ArrayStorage* storage = m_storage;
+ SparseArrayValueMap* map = storage->m_sparseValueMap;
+
+ if (!map)
+ map = storage->m_sparseValueMap = new SparseArrayValueMap;
+
+ if (map->sparseMode())
+ return;
+
+ map->setSparseMode();
+
+ unsigned usedVectorLength = min(storage->m_length, m_vectorLength);
+ for (unsigned i = 0; i < usedVectorLength; ++i) {
+ JSValue value = storage->m_vector[i].get();
+ // This will always be a new entry in the map, so no need to check we can write,
+ // and attributes are default so no need to set them.
+ if (value)
+ map->add(this, i).first->second.set(globalData, this, value);
+ }
+
+ ArrayStorage* newStorage = static_cast<ArrayStorage*>(fastMalloc(storageSize(0)));
+ memcpy(newStorage, m_storage, storageSize(0));
+ newStorage->m_allocBase = newStorage;
+ fastFree(m_storage);
+ m_storage = newStorage;
+ m_indexBias = 0;
+ m_vectorLength = 0;
+}
+
+void JSArray::putDescriptor(ExecState* exec, SparseArrayEntry* entryInMap, PropertyDescriptor& descriptor, PropertyDescriptor& oldDescriptor)
+{
+ if (descriptor.isDataDescriptor()) {
+ if (descriptor.value())
+ entryInMap->set(exec->globalData(), this, descriptor.value());
+ else if (oldDescriptor.isAccessorDescriptor())
+ entryInMap->set(exec->globalData(), this, jsUndefined());
+ entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor) & ~(Getter | Setter);
+ return;
+ }
+
+ if (descriptor.isAccessorDescriptor()) {
+ JSObject* getter = 0;
+ if (descriptor.getter() && descriptor.getter().isObject())
+ getter = asObject(descriptor.getter());
+ if (!getter && oldDescriptor.isAccessorDescriptor()) {
+ if (oldDescriptor.getter() && oldDescriptor.getter().isObject())
+ getter = asObject(oldDescriptor.getter());
+ }
+ JSObject* setter = 0;
+ if (descriptor.setter() && descriptor.setter().isObject())
+ setter = asObject(descriptor.setter());
+ if (!setter && oldDescriptor.isAccessorDescriptor()) {
+ if (oldDescriptor.setter() && oldDescriptor.setter().isObject())
+ setter = asObject(oldDescriptor.setter());
+ }
+
+ GetterSetter* accessor = GetterSetter::create(exec);
+ if (getter)
+ accessor->setGetter(exec->globalData(), getter);
+ if (setter)
+ accessor->setSetter(exec->globalData(), setter);
+
+ entryInMap->set(exec->globalData(), this, accessor);
+ entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor) & ~DontDelete;
+ return;
+ }
+
+ ASSERT(descriptor.isGenericDescriptor());
+ entryInMap->attributes = descriptor.attributesOverridingCurrent(oldDescriptor);
+}
+
+static bool reject(ExecState* exec, bool throwException, const char* message)
+{
+ if (throwException)
+ throwTypeError(exec, message);
+ return false;
+}
+
+// Defined in ES5.1 8.12.9
+bool JSArray::defineOwnNumericProperty(ExecState* exec, unsigned index, PropertyDescriptor& descriptor, bool throwException)
+{
+ ASSERT(index != 0xFFFFFFFF);
+
+ if (!inSparseMode()) {
+ // Fast case: we're putting a regular property to a regular array
+ // FIXME: this will pessimistically assume that if attributes are missing then they'll default to false
+ // – however if the property currently exists missing attributes will override from their current 'true'
+ // state (i.e. defineOwnProperty could be used to set a value without needing to entering 'SparseMode').
+ if (!descriptor.attributes()) {
+ ASSERT(!descriptor.isAccessorDescriptor());
+ putByIndex(this, exec, index, descriptor.value());
+ return true;
+ }
+
+ enterSparseMode(exec->globalData());
+ }
+
+ SparseArrayValueMap* map = m_storage->m_sparseValueMap;
+ ASSERT(map);
+
+ // 1. Let current be the result of calling the [[GetOwnProperty]] internal method of O with property name P.
+ std::pair<SparseArrayValueMap::iterator, bool> result = map->add(this, index);
+ SparseArrayEntry* entryInMap = &result.first->second;
+
+ // 2. Let extensible be the value of the [[Extensible]] internal property of O.
+ // 3. If current is undefined and extensible is false, then Reject.
+ // 4. If current is undefined and extensible is true, then
+ if (result.second) {
+ if (!isExtensible()) {
+ map->remove(result.first);
+ return reject(exec, throwException, "Attempting to define property on object that is not extensible.");
+ }
+
+ // 4.a. If IsGenericDescriptor(Desc) or IsDataDescriptor(Desc) is true, then create an own data property
+ // named P of object O whose [[Value]], [[Writable]], [[Enumerable]] and [[Configurable]] attribute values
+ // are described by Desc. If the value of an attribute field of Desc is absent, the attribute of the newly
+ // created property is set to its default value.
+ // 4.b. Else, Desc must be an accessor Property Descriptor so, create an own accessor property named P of
+ // object O whose [[Get]], [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by
+ // Desc. If the value of an attribute field of Desc is absent, the attribute of the newly created property
+ // is set to its default value.
+ // 4.c. Return true.
+
+ PropertyDescriptor defaults;
+ entryInMap->setWithoutWriteBarrier(jsUndefined());
+ entryInMap->attributes = DontDelete | DontEnum | ReadOnly;
+ entryInMap->get(defaults);
+
+ putDescriptor(exec, entryInMap, descriptor, defaults);
+ if (index >= m_storage->m_length)
+ m_storage->m_length = index + 1;
+ return true;
+ }
+
+ // 5. Return true, if every field in Desc is absent.
+ // 6. Return true, if every field in Desc also occurs in current and the value of every field in Desc is the same value as the corresponding field in current when compared using the SameValue algorithm (9.12).
+ PropertyDescriptor current;
+ entryInMap->get(current);
+ if (descriptor.isEmpty() || descriptor.equalTo(exec, current))
+ return true;
+
+ // 7. If the [[Configurable]] field of current is false then
+ if (!current.configurable()) {
+ // 7.a. Reject, if the [[Configurable]] field of Desc is true.
+ if (descriptor.configurablePresent() && !descriptor.configurable())
+ return reject(exec, throwException, "Attempting to change configurable attribute of unconfigurable property.");
+ // 7.b. Reject, if the [[Enumerable]] field of Desc is present and the [[Enumerable]] fields of current and Desc are the Boolean negation of each other.
+ if (descriptor.enumerablePresent() && current.enumerable() != descriptor.enumerable())
+ return reject(exec, throwException, "Attempting to change enumerable attribute of unconfigurable property.");
+ }
+
+ // 8. If IsGenericDescriptor(Desc) is true, then no further validation is required.
+ if (!descriptor.isGenericDescriptor()) {
+ // 9. Else, if IsDataDescriptor(current) and IsDataDescriptor(Desc) have different results, then
+ if (current.isDataDescriptor() != descriptor.isDataDescriptor()) {
+ // 9.a. Reject, if the [[Configurable]] field of current is false.
+ if (!current.configurable())
+ return reject(exec, throwException, "Attempting to change access mechanism for an unconfigurable property.");
+ // 9.b. If IsDataDescriptor(current) is true, then convert the property named P of object O from a
+ // data property to an accessor property. Preserve the existing values of the converted property‘s
+ // [[Configurable]] and [[Enumerable]] attributes and set the rest of the property‘s attributes to
+ // their default values.
+ // 9.c. Else, convert the property named P of object O from an accessor property to a data property.
+ // Preserve the existing values of the converted property‘s [[Configurable]] and [[Enumerable]]
+ // attributes and set the rest of the property‘s attributes to their default values.
+ } else if (current.isDataDescriptor() && descriptor.isDataDescriptor()) {
+ // 10. Else, if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true, then
+ // 10.a. If the [[Configurable]] field of current is false, then
+ if (!current.configurable() && !current.writable()) {
+ // 10.a.i. Reject, if the [[Writable]] field of current is false and the [[Writable]] field of Desc is true.
+ if (descriptor.writable())
+ return reject(exec, throwException, "Attempting to change writable attribute of unconfigurable property.");
+ // 10.a.ii. If the [[Writable]] field of current is false, then
+ // 10.a.ii.1. Reject, if the [[Value]] field of Desc is present and SameValue(Desc.[[Value]], current.[[Value]]) is false.
+ if (descriptor.value() && !sameValue(exec, descriptor.value(), current.value()))
+ return reject(exec, throwException, "Attempting to change value of a readonly property.");
+ }
+ // 10.b. else, the [[Configurable]] field of current is true, so any change is acceptable.
+ } else {
+ // 11. Else, IsAccessorDescriptor(current) and IsAccessorDescriptor(Desc) are both true so, if the [[Configurable]] field of current is false, then
+ if (!current.configurable()) {
+ // 11.i. Reject, if the [[Set]] field of Desc is present and SameValue(Desc.[[Set]], current.[[Set]]) is false.
+ if (descriptor.setterPresent() && descriptor.setter() != current.setter())
+ return reject(exec, throwException, "Attempting to change the setter of an unconfigurable property.");
+ // 11.ii. Reject, if the [[Get]] field of Desc is present and SameValue(Desc.[[Get]], current.[[Get]]) is false.
+ if (descriptor.getterPresent() && descriptor.getter() != current.getter())
+ return reject(exec, throwException, "Attempting to change the getter of an unconfigurable property.");
+ }
+ }
+ }
+
+ // 12. For each attribute field of Desc that is present, set the correspondingly named attribute of the property named P of object O to the value of the field.
+ putDescriptor(exec, entryInMap, descriptor, current);
+ // 13. Return true.
+ return true;
+}
+
+void JSArray::setLengthWritable(ExecState* exec, bool writable)
+{
+ ASSERT(isLengthWritable() || !writable);
+ if (!isLengthWritable() || writable)
+ return;
+
+ enterSparseMode(exec->globalData());
+
+ SparseArrayValueMap* map = m_storage->m_sparseValueMap;
+ ASSERT(map);
+ map->setLengthIsReadOnly();
+}
+
+// Defined in ES5.1 15.4.5.1
+bool JSArray::defineOwnProperty(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, bool throwException)
+{
+ JSArray* array = static_cast<JSArray*>(object);
+
+ // 3. If P is "length", then
+ if (propertyName == exec->propertyNames().length) {
+ // All paths through length definition call the default [[DefineOwnProperty]], hence:
+ // from ES5.1 8.12.9 7.a.
+ if (descriptor.configurable())
+ return reject(exec, throwException, "Attempting to change configurable attribute of unconfigurable property.");
+ // from ES5.1 8.12.9 7.b.
+ if (descriptor.enumerable())
+ return reject(exec, throwException, "Attempting to change enumerable attribute of unconfigurable property.");
+
+ // a. If the [[Value]] field of Desc is absent, then
+ // a.i. Return the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", Desc, and Throw as arguments.
+ if (descriptor.isAccessorDescriptor())
+ return reject(exec, throwException, "Attempting to change access mechanism for an unconfigurable property.");
+ // from ES5.1 8.12.9 10.a.
+ if (!array->isLengthWritable() && descriptor.writable())
+ return reject(exec, throwException, "Attempting to change writable attribute of unconfigurable property.");
+ // This descriptor is either just making length read-only, or changing nothing!
+ if (!descriptor.value()) {
+ array->setLengthWritable(exec, descriptor.writable());
+ return true;
+ }
+
+ // b. Let newLenDesc be a copy of Desc.
+ // c. Let newLen be ToUint32(Desc.[[Value]]).
+ unsigned newLen = descriptor.value().toUInt32(exec);
+ // d. If newLen is not equal to ToNumber( Desc.[[Value]]), throw a RangeError exception.
+ if (newLen != descriptor.value().toNumber(exec)) {
+ throwError(exec, createRangeError(exec, "Invalid array length"));
+ return false;
+ }
+
+ // Based on SameValue check in 8.12.9, this is always okay.
+ if (newLen == array->length()) {
+ array->setLengthWritable(exec, descriptor.writable());
+ return true;
+ }
+
+ // e. Set newLenDesc.[[Value] to newLen.
+ // f. If newLen >= oldLen, then
+ // f.i. Return the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", newLenDesc, and Throw as arguments.
+ // g. Reject if oldLenDesc.[[Writable]] is false.
+ if (!array->isLengthWritable())
+ return reject(exec, throwException, "Attempting to change value of a readonly property.");
+
+ // h. If newLenDesc.[[Writable]] is absent or has the value true, let newWritable be true.
+ // i. Else,
+ // i.i. Need to defer setting the [[Writable]] attribute to false in case any elements cannot be deleted.
+ // i.ii. Let newWritable be false.
+ // i.iii. Set newLenDesc.[[Writable] to true.
+ // j. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", newLenDesc, and Throw as arguments.
+ // k. If succeeded is false, return false.
+ // l. While newLen < oldLen repeat,
+ // l.i. Set oldLen to oldLen – 1.
+ // l.ii. Let deleteSucceeded be the result of calling the [[Delete]] internal method of A passing ToString(oldLen) and false as arguments.
+ // l.iii. If deleteSucceeded is false, then
+ if (!array->setLength(exec, newLen, throwException)) {
+ // 1. Set newLenDesc.[[Value] to oldLen+1.
+ // 2. If newWritable is false, set newLenDesc.[[Writable] to false.
+ // 3. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", newLenDesc, and false as arguments.
+ // 4. Reject.
+ array->setLengthWritable(exec, descriptor.writable());
+ return false;
+ }
+
+ // m. If newWritable is false, then
+ // i. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", Property Descriptor{[[Writable]]: false}, and false as arguments. This call will always return true.
+ array->setLengthWritable(exec, descriptor.writable());
+ // n. Return true.
+ return true;
+ }
+
+ // 4. Else if P is an array index (15.4), then
+ bool isArrayIndex;
+ // a. Let index be ToUint32(P).
+ unsigned index = propertyName.toArrayIndex(isArrayIndex);
+ if (isArrayIndex) {
+ // b. Reject if index >= oldLen and oldLenDesc.[[Writable]] is false.
+ if (index >= array->length() && !array->isLengthWritable())
+ return reject(exec, throwException, "Attempting to define numeric property on array with non-writable length property.");
+ // c. Let succeeded be the result of calling the default [[DefineOwnProperty]] internal method (8.12.9) on A passing P, Desc, and false as arguments.
+ // d. Reject if succeeded is false.
+ // e. If index >= oldLen
+ // e.i. Set oldLenDesc.[[Value]] to index + 1.
+ // e.ii. Call the default [[DefineOwnProperty]] internal method (8.12.9) on A passing "length", oldLenDesc, and false as arguments. This call will always return true.
+ // f. Return true.
+ return array->defineOwnNumericProperty(exec, index, descriptor, throwException);
+ }
+
+ return JSObject::defineOwnProperty(object, exec, propertyName, descriptor, throwException);
+}
+
bool JSArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned i, PropertySlot& slot)
{
JSArray* thisObject = jsCast<JSArray*>(cell);
@@ -259,7 +639,7 @@ bool JSArray::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned
} else if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
SparseArrayValueMap::iterator it = map->find(i);
if (it != map->notFound()) {
- slot.setValue(it->second.get());
+ it->second.get(slot);
return true;
}
}
@@ -307,7 +687,7 @@ bool JSArray::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const
} else if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
SparseArrayValueMap::iterator it = map->find(i);
if (it != map->notFound()) {
- descriptor.setDescriptor(it->second.get(), 0);
+ it->second.get(descriptor);
return true;
}
}
@@ -332,7 +712,7 @@ void JSArray::put(JSCell* cell, ExecState* exec, const Identifier& propertyName,
throwError(exec, createRangeError(exec, "Invalid array length"));
return;
}
- thisObject->setLength(newLength);
+ thisObject->setLength(exec, newLength, slot.isStrictMode());
return;
}
@@ -372,12 +752,14 @@ void JSArray::putByIndex(JSCell* cell, ExecState* exec, unsigned i, JSValue valu
}
// For all other cases, call putByIndexBeyondVectorLength.
- thisObject->putByIndexBeyondVectorLength(exec->globalData(), i, value);
+ thisObject->putByIndexBeyondVectorLength(exec, i, value);
thisObject->checkConsistency();
}
-NEVER_INLINE void JSArray::putByIndexBeyondVectorLength(JSGlobalData& globalData, unsigned i, JSValue value)
+NEVER_INLINE void JSArray::putByIndexBeyondVectorLength(ExecState* exec, unsigned i, JSValue value)
{
+ JSGlobalData& globalData = exec->globalData();
+
// i should be a valid array index that is outside of the current vector.
ASSERT(i >= m_vectorLength);
ASSERT(i <= MAX_ARRAY_INDEX);
@@ -385,15 +767,12 @@ NEVER_INLINE void JSArray::putByIndexBeyondVectorLength(JSGlobalData& globalData
ArrayStorage* storage = m_storage;
SparseArrayValueMap* map = storage->m_sparseValueMap;
- // Update m_length if necessary.
- unsigned length = storage->m_length;
- if (i >= length) {
- length = i + 1;
- storage->m_length = length;
- }
-
// First, handle cases where we don't currently have a sparse map.
if (LIKELY(!map)) {
+ // Update m_length if necessary.
+ if (i >= storage->m_length)
+ storage->m_length = i + 1;
+
// Check that it is sensible to still be using a vector, and then try to grow the vector.
if (LIKELY((isDenseEnoughForVector(i, storage->m_numValuesInVector)) && increaseVectorLength(i + 1))) {
// success! - reread m_storage since it has likely been reallocated, and store to the vector.
@@ -405,15 +784,27 @@ NEVER_INLINE void JSArray::putByIndexBeyondVectorLength(JSGlobalData& globalData
// We don't want to, or can't use a vector to hold this property - allocate a sparse map & add the value.
map = new SparseArrayValueMap;
storage->m_sparseValueMap = map;
- map->put(globalData, this, i, value);
+ map->put(exec, this, i, value);
return;
}
+ // Update m_length if necessary.
+ unsigned length = storage->m_length;
+ if (i >= length) {
+ // Prohibit growing the array if length is not writable.
+ if (map->lengthIsReadOnly()) {
+ // FIXME: should throw in strict mode.
+ return;
+ }
+ length = i + 1;
+ storage->m_length = length;
+ }
+
// We are currently using a map - check whether we still want to be doing so.
// We will continue to use a sparse map if SparseMode is set, a vector would be too sparse, or if allocation fails.
unsigned numValuesInArray = storage->m_numValuesInVector + map->size();
if (map->sparseMode() || !isDenseEnoughForVector(length, numValuesInArray) || !increaseVectorLength(length)) {
- map->put(globalData, this, i, value);
+ map->put(exec, this, i, value);
return;
}
@@ -425,7 +816,7 @@ NEVER_INLINE void JSArray::putByIndexBeyondVectorLength(JSGlobalData& globalData
WriteBarrier<Unknown>* vector = storage->m_vector;
SparseArrayValueMap::const_iterator end = map->end();
for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
- vector[it->first].set(globalData, this, it->second.get());
+ vector[it->first].set(globalData, this, it->second.getNonSparseMode());
delete map;
storage->m_sparseValueMap = 0;
@@ -455,35 +846,35 @@ bool JSArray::deletePropertyByIndex(JSCell* cell, ExecState* exec, unsigned i)
JSArray* thisObject = jsCast<JSArray*>(cell);
thisObject->checkConsistency();
+ if (i > MAX_ARRAY_INDEX)
+ return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, i));
+
ArrayStorage* storage = thisObject->m_storage;
if (i < thisObject->m_vectorLength) {
WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];
- if (!valueSlot) {
- thisObject->checkConsistency();
- return false;
+ if (valueSlot) {
+ valueSlot.clear();
+ --storage->m_numValuesInVector;
}
- valueSlot.clear();
- --storage->m_numValuesInVector;
- thisObject->checkConsistency();
- return true;
- }
-
- if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
+ } else if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
SparseArrayValueMap::iterator it = map->find(i);
if (it != map->notFound()) {
+ if (it->second.attributes & DontDelete)
+ return false;
map->remove(it);
- thisObject->checkConsistency();
- return true;
}
}
thisObject->checkConsistency();
+ return true;
+}
- if (i > MAX_ARRAY_INDEX)
- return thisObject->methodTable()->deleteProperty(thisObject, exec, Identifier::from(exec, i));
-
- return false;
+static int compareKeysForQSort(const void* a, const void* b)
+{
+ unsigned da = *static_cast<const unsigned*>(a);
+ unsigned db = *static_cast<const unsigned*>(b);
+ return (da > db) - (da < db);
}
void JSArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
@@ -502,9 +893,18 @@ void JSArray::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNam
}
if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
+ Vector<unsigned> keys;
+ keys.reserveCapacity(map->size());
+
SparseArrayValueMap::const_iterator end = map->end();
- for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
- propertyNames.add(Identifier::from(exec, it->first));
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
+ if (mode == IncludeDontEnumProperties || !(it->second.attributes & DontEnum))
+ keys.append(static_cast<unsigned>(it->first));
+ }
+
+ qsort(keys.begin(), keys.size(), sizeof(unsigned), compareKeysForQSort);
+ for (unsigned i = 0; i < keys.size(); ++i)
+ propertyNames.add(Identifier::from(exec, keys[i]));
}
if (mode == IncludeDontEnumProperties)
@@ -693,15 +1093,61 @@ bool JSArray::unshiftCountSlowCase(unsigned count)
return true;
}
-void JSArray::setLength(unsigned newLength)
+bool JSArray::setLength(ExecState* exec, unsigned newLength, bool throwException)
{
checkConsistency();
ArrayStorage* storage = m_storage;
-
unsigned length = storage->m_length;
+ // If the length is read only then we enter sparse mode, so should enter the following 'if'.
+ ASSERT(isLengthWritable() || storage->m_sparseValueMap);
+
+ if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
+ // Fail if the length is not writable.
+ if (map->lengthIsReadOnly())
+ return reject(exec, throwException, StrictModeReadonlyPropertyWriteError);
+
+ if (newLength < length) {
+ // Copy any keys we might be interested in into a vector.
+ Vector<unsigned> keys;
+ keys.reserveCapacity(min(map->size(), static_cast<size_t>(length - newLength)));
+ SparseArrayValueMap::const_iterator end = map->end();
+ for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
+ unsigned index = static_cast<unsigned>(it->first);
+ if (index < length && index >= newLength)
+ keys.append(index);
+ }
+
+ // Check if the array is in sparse mode. If so there may be non-configurable
+ // properties, so we have to perform deletion with caution, if not we can
+ // delete values in any order.
+ if (map->sparseMode()) {
+ qsort(keys.begin(), keys.size(), sizeof(unsigned), compareKeysForQSort);
+ unsigned i = keys.size();
+ while (i) {
+ unsigned index = keys[--i];
+ SparseArrayValueMap::iterator it = map->find(index);
+ ASSERT(it != map->notFound());
+ if (it->second.attributes & DontDelete) {
+ storage->m_length = index + 1;
+ return reject(exec, throwException, "Unable to delete property.");
+ }
+ map->remove(it);
+ }
+ } else {
+ for (unsigned i = 0; i < keys.size(); ++i)
+ map->remove(keys[i]);
+ if (map->isEmpty()) {
+ delete map;
+ storage->m_sparseValueMap = 0;
+ }
+ }
+ }
+ }
+
if (newLength < length) {
+ // Delete properties from the vector.
unsigned usedVectorLength = min(length, m_vectorLength);
for (unsigned i = newLength; i < usedVectorLength; ++i) {
WriteBarrier<Unknown>& valueSlot = storage->m_vector[i];
@@ -709,35 +1155,26 @@ void JSArray::setLength(unsigned newLength)
valueSlot.clear();
storage->m_numValuesInVector -= hadValue;
}
-
- if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
- SparseArrayValueMap copy = *map;
- SparseArrayValueMap::const_iterator end = copy.end();
- for (SparseArrayValueMap::const_iterator it = copy.begin(); it != end; ++it) {
- if (it->first >= newLength)
- map->remove(it->first);
- }
- if (map->isEmpty() && !map->sparseMode()) {
- delete map;
- storage->m_sparseValueMap = 0;
- }
- }
}
storage->m_length = newLength;
checkConsistency();
+ return true;
}
-JSValue JSArray::pop()
+JSValue JSArray::pop(ExecState* exec)
{
checkConsistency();
ArrayStorage* storage = m_storage;
unsigned length = storage->m_length;
- if (!length)
+ if (!length) {
+ if (!isLengthWritable())
+ throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
return jsUndefined();
+ }
--length;
@@ -755,8 +1192,19 @@ JSValue JSArray::pop()
result = jsUndefined();
if (SparseArrayValueMap* map = storage->m_sparseValueMap) {
SparseArrayValueMap::iterator it = map->find(length);
- if (it != map->end()) {
- result = it->second.get();
+ if (it != map->notFound()) {
+ unsigned attributes = it->second.attributes;
+
+ result = it->second.get(exec, this);
+ if (exec->hadException())
+ return jsUndefined();
+
+ if (attributes & DontDelete) {
+ throwError(exec, createTypeError(exec, "Unable to delete property."));
+ checkConsistency();
+ return result;
+ }
+
map->remove(it);
if (map->isEmpty() && !map->sparseMode()) {
delete map;
@@ -800,7 +1248,7 @@ void JSArray::push(ExecState* exec, JSValue value)
}
// Handled the same as putIndex.
- putByIndexBeyondVectorLength(exec->globalData(), storage->m_length, value);
+ putByIndexBeyondVectorLength(exec, storage->m_length, value);
checkConsistency();
}
@@ -1189,7 +1637,7 @@ void JSArray::sort(ExecState* exec, JSValue compareFunction, CallType callType,
SparseArrayValueMap::const_iterator end = map->end();
for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) {
- tree.abstractor().m_nodes[numDefined].value = it->second.get();
+ tree.abstractor().m_nodes[numDefined].value = it->second.getNonSparseMode();
tree.insert(numDefined);
++numDefined;
}
@@ -1305,7 +1753,7 @@ unsigned JSArray::compactForSorting()
SparseArrayValueMap::const_iterator end = map->end();
for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it)
- storage->m_vector[numDefined++].setWithoutWriteBarrier(it->second.get());
+ storage->m_vector[numDefined++].setWithoutWriteBarrier(it->second.getNonSparseMode());
delete map;
storage->m_sparseValueMap = 0;
diff --git a/Source/JavaScriptCore/runtime/JSArray.h b/Source/JavaScriptCore/runtime/JSArray.h
index 9102c8724..871cfc882 100644
--- a/Source/JavaScriptCore/runtime/JSArray.h
+++ b/Source/JavaScriptCore/runtime/JSArray.h
@@ -30,16 +30,25 @@ namespace JSC {
class JSArray;
struct SparseArrayEntry : public WriteBarrier<Unknown> {
+ typedef WriteBarrier<Unknown> Base;
+
SparseArrayEntry() : attributes(0) {}
+
+ JSValue get(ExecState*, JSArray*) const;
+ void get(PropertySlot&) const;
+ void get(PropertyDescriptor&) const;
+ JSValue getNonSparseMode() const;
+
unsigned attributes;
};
class SparseArrayValueMap {
- typedef HashMap<unsigned, SparseArrayEntry> Map;
+ typedef HashMap<uint64_t, SparseArrayEntry, WTF::IntHash<uint64_t>, WTF::UnsignedWithZeroKeyHashTraits<uint64_t> > Map;
enum Flags {
Normal = 0,
- SparseMode = 1
+ SparseMode = 1,
+ LengthIsReadOnly = 2,
};
public:
@@ -61,12 +70,23 @@ namespace JSC {
void setSparseMode()
{
- m_flags = (Flags)(m_flags | SparseMode);
+ m_flags = static_cast<Flags>(m_flags | SparseMode);
+ }
+
+ bool lengthIsReadOnly()
+ {
+ return m_flags & LengthIsReadOnly;
+ }
+
+ void setLengthIsReadOnly()
+ {
+ m_flags = static_cast<Flags>(m_flags | LengthIsReadOnly);
}
// These methods may mutate the contents of the map
- void put(JSGlobalData&, JSArray*, unsigned, JSValue);
- iterator find(unsigned);
+ void put(ExecState*, JSArray*, unsigned, JSValue);
+ std::pair<iterator, bool> add(JSArray*, unsigned);
+ iterator find(unsigned i) { return m_map.find(i); }
// This should ASSERT the remove is valid (check the result of the find).
void remove(iterator it) { m_map.remove(it); }
void remove(unsigned i) { m_map.remove(i); }
@@ -136,7 +156,9 @@ namespace JSC {
return array->tryFinishCreationUninitialized(globalData, initialLength);
}
- static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier& propertyName, PropertySlot&);
+ static bool defineOwnProperty(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&, bool throwException);
+
+ static bool getOwnPropertySlot(JSCell*, ExecState*, const Identifier&, PropertySlot&);
static bool getOwnPropertySlotByIndex(JSCell*, ExecState*, unsigned propertyName, PropertySlot&);
static bool getOwnPropertyDescriptor(JSObject*, ExecState*, const Identifier&, PropertyDescriptor&);
static void putByIndex(JSCell*, ExecState*, unsigned propertyName, JSValue);
@@ -144,14 +166,15 @@ namespace JSC {
static JS_EXPORTDATA const ClassInfo s_info;
unsigned length() const { return m_storage->m_length; }
- void setLength(unsigned); // OK to use on new arrays, but not if it might be a RegExpMatchArray.
+ // OK to use on new arrays, but not if it might be a RegExpMatchArray.
+ bool setLength(ExecState*, unsigned, bool throwException = false);
void sort(ExecState*);
void sort(ExecState*, JSValue compareFunction, CallType, const CallData&);
void sortNumeric(ExecState*, JSValue compareFunction, CallType, const CallData&);
void push(ExecState*, JSValue);
- JSValue pop();
+ JSValue pop(ExecState*);
void shiftCount(ExecState*, unsigned count);
void unshiftCount(ExecState*, unsigned count);
@@ -245,8 +268,19 @@ namespace JSC {
void setSubclassData(void*);
private:
+ bool isLengthWritable()
+ {
+ SparseArrayValueMap* map = m_storage->m_sparseValueMap;
+ return !map || !map->lengthIsReadOnly();
+ }
+
+ void setLengthWritable(ExecState*, bool writable);
+ void putDescriptor(ExecState*, SparseArrayEntry*, PropertyDescriptor&, PropertyDescriptor& old);
+ bool defineOwnNumericProperty(ExecState*, unsigned, PropertyDescriptor&, bool throwException);
+ void enterSparseMode(JSGlobalData&);
+
bool getOwnPropertySlotSlowCase(ExecState*, unsigned propertyName, PropertySlot&);
- void putByIndexBeyondVectorLength(JSGlobalData&, unsigned propertyName, JSValue);
+ void putByIndexBeyondVectorLength(ExecState*, unsigned propertyName, JSValue);
unsigned getNewVectorLength(unsigned desiredLength);
bool increaseVectorLength(unsigned newLength);
diff --git a/Source/JavaScriptCore/runtime/JSByteArray.cpp b/Source/JavaScriptCore/runtime/JSByteArray.cpp
index 7478a08fb..3df21e6f5 100644
--- a/Source/JavaScriptCore/runtime/JSByteArray.cpp
+++ b/Source/JavaScriptCore/runtime/JSByteArray.cpp
@@ -33,7 +33,7 @@ using namespace WTF;
namespace JSC {
-const ClassInfo JSByteArray::s_info = { "ByteArray", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
+const ClassInfo JSByteArray::s_info = { "Uint8ClampedArray", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
JSByteArray::JSByteArray(ExecState* exec, Structure* structure, ByteArray* storage)
: JSNonFinalObject(exec->globalData(), structure)
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.h b/Source/JavaScriptCore/runtime/JSGlobalData.h
index 1619f9297..a6ad8a747 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.h
@@ -251,6 +251,9 @@ namespace JSC {
#if ENABLE(JIT)
ReturnAddressPtr exceptionLocation;
JSValue hostCallReturnValue;
+ CallFrame* callFrameForThrow;
+ void* targetMachinePCForThrow;
+ Instruction* targetInterpreterPCForThrow;
#if ENABLE(DFG_JIT)
uint32_t osrExitIndex;
void* osrExitJumpDestination;
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index 9cc29617a..a813e8416 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -761,7 +761,7 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, const Identi
if (descriptor.isGenericDescriptor()) {
if (!current.attributesEqual(descriptor)) {
object->methodTable()->deleteProperty(object, exec, propertyName);
- putDescriptor(exec, object, propertyName, descriptor, current.attributesWithOverride(descriptor), current);
+ return putDescriptor(exec, object, propertyName, descriptor, current.attributesWithOverride(descriptor), current);
}
return true;
}
@@ -786,7 +786,7 @@ bool JSObject::defineOwnProperty(JSObject* object, ExecState* exec, const Identi
return false;
}
if (!current.writable()) {
- if (descriptor.value() || !JSValue::strictEqual(exec, current.value(), descriptor.value())) {
+ if (descriptor.value() || !sameValue(exec, current.value(), descriptor.value())) {
if (throwException)
throwError(exec, createTypeError(exec, "Attempting to change value of a readonly property."));
return false;
diff --git a/Source/JavaScriptCore/runtime/JSString.h b/Source/JavaScriptCore/runtime/JSString.h
index 6700e2e41..f40455571 100644
--- a/Source/JavaScriptCore/runtime/JSString.h
+++ b/Source/JavaScriptCore/runtime/JSString.h
@@ -59,7 +59,7 @@ namespace JSC {
JSString* jsStringBuilder(JSGlobalData*);
- class JS_EXPORTCLASS JSString : public JSCell {
+ class JSString : public JSCell {
public:
friend class JIT;
friend class JSGlobalData;
diff --git a/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp b/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp
index 9d62dfc98..c664952a5 100644
--- a/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp
+++ b/Source/JavaScriptCore/runtime/PropertyDescriptor.cpp
@@ -162,16 +162,30 @@ void PropertyDescriptor::setGetter(JSValue getter)
m_attributes &= ~ReadOnly;
}
+// See ES5.1 9.12
+bool sameValue(ExecState* exec, JSValue a, JSValue b)
+{
+ if (!a.isNumber())
+ return JSValue::strictEqual(exec, a, b);
+ if (!b.isNumber())
+ return false;
+ double x = a.asNumber();
+ double y = b.asNumber();
+ if (isnan(x))
+ return isnan(y);
+ return bitwise_cast<uint64_t>(x) == bitwise_cast<uint64_t>(y);
+}
+
bool PropertyDescriptor::equalTo(ExecState* exec, const PropertyDescriptor& other) const
{
if (!other.m_value == m_value ||
!other.m_getter == m_getter ||
!other.m_setter == m_setter)
return false;
- return (!m_value || JSValue::strictEqual(exec, other.m_value, m_value)) &&
- (!m_getter || JSValue::strictEqual(exec, other.m_getter, m_getter)) &&
- (!m_setter || JSValue::strictEqual(exec, other.m_setter, m_setter)) &&
- attributesEqual(other);
+ return (!m_value || sameValue(exec, other.m_value, m_value))
+ && (!m_getter || JSValue::strictEqual(exec, other.m_getter, m_getter))
+ && (!m_setter || JSValue::strictEqual(exec, other.m_setter, m_setter))
+ && attributesEqual(other);
}
bool PropertyDescriptor::attributesEqual(const PropertyDescriptor& other) const
@@ -201,4 +215,18 @@ unsigned PropertyDescriptor::attributesWithOverride(const PropertyDescriptor& ot
return newAttributes;
}
+unsigned PropertyDescriptor::attributesOverridingCurrent(const PropertyDescriptor& current) const
+{
+ unsigned overrideMask = 0;
+ if (writablePresent())
+ overrideMask |= ReadOnly;
+ if (enumerablePresent())
+ overrideMask |= DontEnum;
+ if (configurablePresent())
+ overrideMask |= DontDelete;
+ if (isAccessorDescriptor())
+ overrideMask |= (Getter | Setter);
+ return (m_attributes & overrideMask) | (current.m_attributes & ~overrideMask);
+}
+
}
diff --git a/Source/JavaScriptCore/runtime/PropertyDescriptor.h b/Source/JavaScriptCore/runtime/PropertyDescriptor.h
index bebf5e826..3d481b25e 100644
--- a/Source/JavaScriptCore/runtime/PropertyDescriptor.h
+++ b/Source/JavaScriptCore/runtime/PropertyDescriptor.h
@@ -31,6 +31,9 @@
namespace JSC {
class GetterSetter;
+ // See ES5.1 9.12
+ bool sameValue(ExecState*, JSValue, JSValue);
+
class PropertyDescriptor {
public:
PropertyDescriptor()
@@ -66,6 +69,8 @@ namespace JSC {
bool equalTo(ExecState* exec, const PropertyDescriptor& other) const;
bool attributesEqual(const PropertyDescriptor& other) const;
unsigned attributesWithOverride(const PropertyDescriptor& other) const;
+ unsigned attributesOverridingCurrent(const PropertyDescriptor& current) const;
+
private:
static unsigned defaultAttributes;
bool operator==(const PropertyDescriptor&){ return false; }
diff --git a/Source/JavaScriptCore/wtf/Assertions.cpp b/Source/JavaScriptCore/wtf/Assertions.cpp
index de062ce25..3da67effe 100644
--- a/Source/JavaScriptCore/wtf/Assertions.cpp
+++ b/Source/JavaScriptCore/wtf/Assertions.cpp
@@ -98,7 +98,7 @@ static void vprintf_stderr_common(const char* format, va_list args)
// Fall through to write to stderr in the same manner as other platforms.
#elif PLATFORM(BLACKBERRY)
- BlackBerry::Platform::logV(BlackBerry::Platform::LogLevelInfo, format, args);
+ BlackBerry::Platform::logStreamV(format, args);
#elif HAVE(ISDEBUGGERPRESENT)
if (IsDebuggerPresent()) {
size_t size = 1024;
@@ -133,7 +133,9 @@ static void vprintf_stderr_common(const char* format, va_list args)
} while (size > 1024);
}
#endif
+#if !PLATFORM(BLACKBERRY)
vfprintf(stderr, format, args);
+#endif
}
#if COMPILER(CLANG) || (COMPILER(GCC) && GCC_VERSION_AT_LEAST(4, 6, 0))
@@ -194,8 +196,26 @@ static void printCallSite(const char* file, int line, const char* function)
#endif
}
+#if PLATFORM(BLACKBERRY)
+struct WTFLogLocker {
+ WTFLogLocker(BlackBerry::Platform::MessageLogLevel logLevel)
+ {
+ BlackBerry::Platform::lockLogging(logLevel);
+ }
+
+ ~WTFLogLocker()
+ {
+ BlackBerry::Platform::unlockLogging();
+ }
+};
+#endif
+
void WTFReportAssertionFailure(const char* file, int line, const char* function, const char* assertion)
{
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelCritical);
+#endif
+
if (assertion)
printf_stderr_common("ASSERTION FAILED: %s\n", assertion);
else
@@ -205,6 +225,10 @@ void WTFReportAssertionFailure(const char* file, int line, const char* function,
void WTFReportAssertionFailureWithMessage(const char* file, int line, const char* function, const char* assertion, const char* format, ...)
{
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelCritical);
+#endif
+
va_list args;
va_start(args, format);
vprintf_stderr_with_prefix("ASSERTION FAILED: ", format, args);
@@ -215,6 +239,10 @@ void WTFReportAssertionFailureWithMessage(const char* file, int line, const char
void WTFReportArgumentAssertionFailure(const char* file, int line, const char* function, const char* argName, const char* assertion)
{
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelCritical);
+#endif
+
printf_stderr_common("ARGUMENT BAD: %s, %s\n", argName, assertion);
printCallSite(file, line, function);
}
@@ -275,6 +303,10 @@ void WTFReportBacktrace()
void WTFReportFatalError(const char* file, int line, const char* function, const char* format, ...)
{
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelCritical);
+#endif
+
va_list args;
va_start(args, format);
vprintf_stderr_with_prefix("FATAL ERROR: ", format, args);
@@ -285,6 +317,10 @@ void WTFReportFatalError(const char* file, int line, const char* function, const
void WTFReportError(const char* file, int line, const char* function, const char* format, ...)
{
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelWarn);
+#endif
+
va_list args;
va_start(args, format);
vprintf_stderr_with_prefix("ERROR: ", format, args);
@@ -298,6 +334,10 @@ void WTFLog(WTFLogChannel* channel, const char* format, ...)
if (channel->state != WTFLogChannelOn)
return;
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelInfo);
+#endif
+
va_list args;
va_start(args, format);
vprintf_stderr_with_trailing_newline(format, args);
@@ -309,6 +349,10 @@ void WTFLogVerbose(const char* file, int line, const char* function, WTFLogChann
if (channel->state != WTFLogChannelOn)
return;
+#if PLATFORM(BLACKBERRY)
+ WTFLogLocker locker(BlackBerry::Platform::LogLevelInfo);
+#endif
+
va_list args;
va_start(args, format);
vprintf_stderr_with_trailing_newline(format, args);
diff --git a/Source/JavaScriptCore/wtf/ByteArray.h b/Source/JavaScriptCore/wtf/ByteArray.h
index 009ec5850..6964a33df 100644
--- a/Source/JavaScriptCore/wtf/ByteArray.h
+++ b/Source/JavaScriptCore/wtf/ByteArray.h
@@ -97,7 +97,7 @@ namespace WTF {
// MSVC can't handle correctly unsized array.
// warning C4200: nonstandard extension used : zero-sized array in struct/union
// Cannot generate copy-ctor or copy-assignment operator when UDT contains a zero-sized array
-#if COMPILER(MSVC) && !COMPILER(INTEL)
+#if (COMPILER(MSVC) || COMPILER(SUNCC)) && !COMPILER(INTEL)
unsigned char m_data[INT_MAX];
#else
unsigned char m_data[];
diff --git a/Source/JavaScriptCore/wtf/CMakeLists.txt b/Source/JavaScriptCore/wtf/CMakeLists.txt
index 6d1cee899..52d3e3c4d 100644
--- a/Source/JavaScriptCore/wtf/CMakeLists.txt
+++ b/Source/JavaScriptCore/wtf/CMakeLists.txt
@@ -56,7 +56,6 @@ SET(WTF_HEADERS
OSAllocator.h
OSRandomSource.h
OwnArrayPtr.h
- OwnFastMallocPtr.h
OwnPtr.h
OwnPtrCommon.h
PageAllocation.h
@@ -187,12 +186,12 @@ SET(WTF_INCLUDE_DIRECTORIES
"${JAVASCRIPTCORE_DIR}/wtf/unicode"
"${JAVASCRIPTCORE_DIR}/wtf/dtoa"
"${JavaScriptCore_INCLUDE_DIRECTORIES}"
+ "${THIRDPARTY_DIR}"
)
SET(WTF_LIBRARIES
)
-
IF (ENABLE_FAST_MALLOC)
LIST(APPEND WTF_SOURCES
TCSystemAlloc.cpp
@@ -201,15 +200,8 @@ ELSE ()
ADD_DEFINITIONS(-DUSE_SYSTEM_MALLOC=1)
ENDIF()
-
-SET(WTF_PORT_FLAGS )
INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/wtf/Platform${PORT}.cmake)
-LIST(APPEND WTF_INCLUDE_DIRECTORIES
- "${CMAKE_BINARY_DIR}"
- "${CMAKE_SOURCE_DIR}/Source/ThirdParty"
-)
-
WEBKIT_WRAP_SOURCELIST(${WTF_SOURCES})
INCLUDE_DIRECTORIES(${WTF_INCLUDE_DIRECTORIES})
ADD_DEFINITIONS(-DBUILDING_WTF)
diff --git a/Source/JavaScriptCore/wtf/DateMath.cpp b/Source/JavaScriptCore/wtf/DateMath.cpp
index 86bd99527..dc503ca2a 100644
--- a/Source/JavaScriptCore/wtf/DateMath.cpp
+++ b/Source/JavaScriptCore/wtf/DateMath.cpp
@@ -961,6 +961,7 @@ double parseDateFromNullTerminatedCharacters(const char* dateString, bool& haveT
else
offset = o * 60 * sgn;
} else { // GMT+05:00
+ ++dateString; // skip the ':'
long o2;
if (!parseLong(dateString, &newPosStr, 10, &o2))
return std::numeric_limits<double>::quiet_NaN();
diff --git a/Source/JavaScriptCore/wtf/Functional.h b/Source/JavaScriptCore/wtf/Functional.h
index 86d6203cf..bd0f3e282 100644
--- a/Source/JavaScriptCore/wtf/Functional.h
+++ b/Source/JavaScriptCore/wtf/Functional.h
@@ -136,6 +136,26 @@ private:
R (*m_function)(P1, P2);
};
+template<typename R, typename P1, typename P2, typename P3>
+class FunctionWrapper<R (*)(P1, P2, P3)> {
+public:
+ typedef R ResultType;
+ static const bool shouldRefFirstParameter = false;
+
+ explicit FunctionWrapper(R (*function)(P1, P2, P3))
+ : m_function(function)
+ {
+ }
+
+ R operator()(P1 p1, P2 p2, P3 p3)
+ {
+ return m_function(p1, p2, p3);
+ }
+
+private:
+ R (*m_function)(P1, P2, P3);
+};
+
template<typename R, typename C>
class FunctionWrapper<R (C::*)()> {
public:
diff --git a/Source/JavaScriptCore/wtf/ListHashSet.h b/Source/JavaScriptCore/wtf/ListHashSet.h
index 3b413406d..32bd23832 100644
--- a/Source/JavaScriptCore/wtf/ListHashSet.h
+++ b/Source/JavaScriptCore/wtf/ListHashSet.h
@@ -375,7 +375,7 @@ namespace WTF {
private:
typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
typedef ListHashSetReverseIterator<ValueArg, inlineCapacity, HashArg> reverse_iterator;
- typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_reverse_iterator;
+ typedef ListHashSetConstReverseIterator<ValueArg, inlineCapacity, HashArg> const_reverse_iterator;
typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
typedef ValueType& ReferenceType;
diff --git a/Source/JavaScriptCore/wtf/OwnFastMallocPtr.h b/Source/JavaScriptCore/wtf/OwnFastMallocPtr.h
deleted file mode 100644
index 183bfec8f..000000000
--- a/Source/JavaScriptCore/wtf/OwnFastMallocPtr.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 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 OwnFastMallocPtr_h
-#define OwnFastMallocPtr_h
-
-#include "FastMalloc.h"
-#include <wtf/Noncopyable.h>
-
-namespace WTF {
-
- template<class T> class OwnFastMallocPtr {
- WTF_MAKE_NONCOPYABLE(OwnFastMallocPtr);
- public:
- explicit OwnFastMallocPtr(T* ptr) : m_ptr(ptr)
- {
- }
-
- ~OwnFastMallocPtr()
- {
- fastFree(const_cast<void*>(static_cast<const void*>(const_cast<const T*>(m_ptr))));
- }
-
- T* get() const { return m_ptr; }
- T* release() { T* ptr = m_ptr; m_ptr = 0; return ptr; }
-
- private:
- T* m_ptr;
- };
-
-} // namespace WTF
-
-using WTF::OwnFastMallocPtr;
-
-#endif // OwnFastMallocPtr_h
diff --git a/Source/JavaScriptCore/wtf/TypeTraits.cpp b/Source/JavaScriptCore/wtf/TypeTraits.cpp
index afeaa5e4c..7cea256b7 100644
--- a/Source/JavaScriptCore/wtf/TypeTraits.cpp
+++ b/Source/JavaScriptCore/wtf/TypeTraits.cpp
@@ -139,4 +139,17 @@ COMPILE_ASSERT((!IsSameType<int, RemovePointer<int**>::Type>::value), WTF_Test_R
COMPILE_ASSERT((IsSameType<int, RemoveReference<int>::Type>::value), WTF_Test_RemoveReference_int);
COMPILE_ASSERT((IsSameType<int, RemoveReference<int&>::Type>::value), WTF_Test_RemoveReference_int_reference);
+
+typedef int IntArray[];
+typedef int IntArraySized[4];
+
+COMPILE_ASSERT((IsArray<IntArray>::value), WTF_Test_IsArray_int_array);
+COMPILE_ASSERT((IsArray<IntArraySized>::value), WTF_Test_IsArray_int_sized_array);
+
+COMPILE_ASSERT((IsSameType<int, RemoveExtent<IntArray>::Type>::value), WTF_Test_RemoveExtent_int_array);
+COMPILE_ASSERT((IsSameType<int, RemoveExtent<IntArraySized>::Type>::value), WTF_Test_RemoveReference_int_sized_array);
+
+COMPILE_ASSERT((IsSameType<int*, DecayArray<IntArray>::Type>::value), WTF_Test_DecayArray_int_array);
+COMPILE_ASSERT((IsSameType<int*, DecayArray<IntArraySized>::Type>::value), WTF_Test_DecayArray_int_sized_array);
+
} // namespace WTF
diff --git a/Source/JavaScriptCore/wtf/TypeTraits.h b/Source/JavaScriptCore/wtf/TypeTraits.h
index 6c7466acc..34e8b79a3 100644
--- a/Source/JavaScriptCore/wtf/TypeTraits.h
+++ b/Source/JavaScriptCore/wtf/TypeTraits.h
@@ -35,10 +35,14 @@ namespace WTF {
// The following are provided in this file:
//
+ // Conditional<Predicate, If, Then>::Type
+ //
// IsInteger<T>::value
// IsPod<T>::value, see the definition for a note about its limitations
// IsConvertibleToInteger<T>::value
//
+ // IsArray<T>::value
+ //
// IsSameType<T, U>::value
//
// RemovePointer<T>::Type
@@ -46,9 +50,15 @@ namespace WTF {
// RemoveConst<T>::Type
// RemoveVolatile<T>::Type
// RemoveConstVolatile<T>::Type
+ // RemoveExtent<T>::Type
+ //
+ // DecayArray<T>::Type
//
// COMPILE_ASSERT's in TypeTraits.cpp illustrate their usage and what they do.
+ template <bool Predicate, class If, class Then> struct Conditional { typedef If Type; };
+ template <class If, class Then> struct Conditional<false, If, Then> { typedef Then Type; };
+
template<typename T> struct IsInteger { static const bool value = false; };
template<> struct IsInteger<bool> { static const bool value = true; };
template<> struct IsInteger<char> { static const bool value = true; };
@@ -104,6 +114,20 @@ namespace WTF {
static const bool value = IsInteger<T>::value || IsConvertibleToDouble<!IsInteger<T>::value, T>::value;
};
+
+ template <class T> struct IsArray {
+ static const bool value = false;
+ };
+
+ template <class T> struct IsArray<T[]> {
+ static const bool value = true;
+ };
+
+ template <class T, size_t N> struct IsArray<T[N]> {
+ static const bool value = true;
+ };
+
+
template <typename T, typename U> struct IsSameType {
static const bool value = false;
};
@@ -182,6 +206,28 @@ namespace WTF {
typedef T Type;
};
+ template <typename T> struct RemoveExtent {
+ typedef T Type;
+ };
+
+ template <typename T> struct RemoveExtent<T[]> {
+ typedef T Type;
+ };
+
+ template <typename T, size_t N> struct RemoveExtent<T[N]> {
+ typedef T Type;
+ };
+
+ template <class T> struct DecayArray {
+ typedef typename RemoveReference<T>::Type U;
+ public:
+ typedef typename Conditional<
+ IsArray<U>::value,
+ typename RemoveExtent<U>::Type*,
+ typename RemoveConstVolatile<U>::Type
+ >::Type Type;
+ };
+
#if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600))
// GCC's libstdc++ 20070724 and later supports C++ TR1 type_traits in the std namespace.
diff --git a/Source/JavaScriptCore/wtf/text/StringImpl.h b/Source/JavaScriptCore/wtf/text/StringImpl.h
index a3008e1d3..003c44ce6 100644
--- a/Source/JavaScriptCore/wtf/text/StringImpl.h
+++ b/Source/JavaScriptCore/wtf/text/StringImpl.h
@@ -26,7 +26,6 @@
#include <limits.h>
#include <wtf/ASCIICType.h>
#include <wtf/Forward.h>
-#include <wtf/OwnFastMallocPtr.h>
#include <wtf/StdLibExtras.h>
#include <wtf/StringHasher.h>
#include <wtf/Vector.h>
diff --git a/Source/JavaScriptCore/wtf/wtf.pro b/Source/JavaScriptCore/wtf/wtf.pro
index e59d118e2..234348f2b 100644
--- a/Source/JavaScriptCore/wtf/wtf.pro
+++ b/Source/JavaScriptCore/wtf/wtf.pro
@@ -90,7 +90,6 @@ HEADERS += \
OSAllocator.h \
OSRandomSource.h \
OwnArrayPtr.h \
- OwnFastMallocPtr.h \
OwnPtr.h \
OwnPtrCommon.h \
PackedIntVector.h \
diff --git a/Source/JavaScriptGlue/ChangeLog b/Source/JavaScriptGlue/ChangeLog
index 2d8ec3066..4c5dbd772 100644
--- a/Source/JavaScriptGlue/ChangeLog
+++ b/Source/JavaScriptGlue/ChangeLog
@@ -1,3 +1,12 @@
+2012-01-06 Sam Weinig <sam@webkit.org>
+
+ Remove unused OwnFastMallocPtr class.
+ https://bugs.webkit.org/show_bug.cgi?id=75722
+
+ Reviewed by Geoffrey Garen.
+
+ * ForwardingHeaders/wtf/OwnFastMallocPtr.h: Removed.
+
2012-01-05 Dan Bernstein <mitz@apple.com>
<rdar://problem/10633760> Update copyright strings
diff --git a/Source/JavaScriptGlue/ForwardingHeaders/wtf/OwnFastMallocPtr.h b/Source/JavaScriptGlue/ForwardingHeaders/wtf/OwnFastMallocPtr.h
deleted file mode 100644
index 036d80138..000000000
--- a/Source/JavaScriptGlue/ForwardingHeaders/wtf/OwnFastMallocPtr.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/OwnFastMallocPtr.h>
diff --git a/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj b/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
index 8e80ad78e..a33c5ce1f 100644
--- a/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
+++ b/Source/ThirdParty/ANGLE/ANGLE.xcodeproj/project.pbxproj
@@ -7,6 +7,11 @@
objects = {
/* Begin PBXBuildFile section */
+ 49951C0314B7AAB30060E96E /* length_limits.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0214B7AAB30060E96E /* length_limits.h */; };
+ 49951C0914B7AAD80060E96E /* BuiltInFunctionEmulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */; };
+ 49951C0A14B7AAD80060E96E /* BuiltInFunctionEmulator.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */; };
+ 49951C0B14B7AAD80060E96E /* DetectRecursion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49951C0714B7AAD80060E96E /* DetectRecursion.cpp */; };
+ 49951C0C14B7AAD80060E96E /* DetectRecursion.h in Headers */ = {isa = PBXBuildFile; fileRef = 49951C0814B7AAD80060E96E /* DetectRecursion.h */; };
90D9B10212E11DCB002D4255 /* Compiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90D9B0F912E11DCB002D4255 /* Compiler.cpp */; };
90D9B10312E11DCB002D4255 /* ExtensionBehavior.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D9B0FA12E11DCB002D4255 /* ExtensionBehavior.h */; };
90D9B10412E11DCB002D4255 /* glslang_lex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 90D9B0FB12E11DCB002D4255 /* glslang_lex.cpp */; };
@@ -63,6 +68,11 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ 49951C0214B7AAB30060E96E /* length_limits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = length_limits.h; sourceTree = "<group>"; };
+ 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BuiltInFunctionEmulator.cpp; sourceTree = "<group>"; };
+ 49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BuiltInFunctionEmulator.h; sourceTree = "<group>"; };
+ 49951C0714B7AAD80060E96E /* DetectRecursion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DetectRecursion.cpp; sourceTree = "<group>"; };
+ 49951C0814B7AAD80060E96E /* DetectRecursion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetectRecursion.h; sourceTree = "<group>"; };
5D7C59C51208C68B001C873E /* ANGLE.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ANGLE.xcconfig; sourceTree = "<group>"; };
5D7C59C61208C68B001C873E /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
5D7C59C71208C68B001C873E /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
@@ -372,12 +382,16 @@
A0AABE2B13AFE81000F2EBD1 /* ForLoopUnroll.h */,
FB39D2441200F35A00088E69 /* preprocessor */,
FB39D2211200F35A00088E69 /* BaseTypes.h */,
+ 49951C0514B7AAD70060E96E /* BuiltInFunctionEmulator.cpp */,
+ 49951C0614B7AAD80060E96E /* BuiltInFunctionEmulator.h */,
FB39D2221200F35A00088E69 /* CodeGenGLSL.cpp */,
FB39D2241200F35A00088E69 /* Common.h */,
90D9B0F912E11DCB002D4255 /* Compiler.cpp */,
FB39D2251200F35A00088E69 /* ConstantUnion.h */,
FB39D2261200F35A00088E69 /* debug.cpp */,
FB39D2271200F35A00088E69 /* debug.h */,
+ 49951C0714B7AAD80060E96E /* DetectRecursion.cpp */,
+ 49951C0814B7AAD80060E96E /* DetectRecursion.h */,
90D9B0FA12E11DCB002D4255 /* ExtensionBehavior.h */,
90D9B0FB12E11DCB002D4255 /* glslang_lex.cpp */,
90D9B0FC12E11DCB002D4255 /* glslang_tab.cpp */,
@@ -445,6 +459,7 @@
FB39D2481200F35A00088E69 /* cpp.c */,
FB39D2491200F35A00088E69 /* cpp.h */,
FB39D24A1200F35A00088E69 /* cppstruct.c */,
+ 49951C0214B7AAB30060E96E /* length_limits.h */,
FB39D24B1200F35A00088E69 /* memory.c */,
FB39D24C1200F35A00088E69 /* memory.h */,
FB39D24D1200F35A00088E69 /* parser.h */,
@@ -490,6 +505,9 @@
A0AABE3513AFE84700F2EBD1 /* OutputGLSLBase.h in Headers */,
A0AABE4513AFE94500F2EBD1 /* OutputESSL.h in Headers */,
A0AABE4913AFE96100F2EBD1 /* TranslatorESSL.h in Headers */,
+ 49951C0314B7AAB30060E96E /* length_limits.h in Headers */,
+ 49951C0A14B7AAD80060E96E /* BuiltInFunctionEmulator.h in Headers */,
+ 49951C0C14B7AAD80060E96E /* DetectRecursion.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -584,6 +602,8 @@
A0AABE3413AFE84700F2EBD1 /* OutputGLSLBase.cpp in Sources */,
A0AABE4413AFE94500F2EBD1 /* OutputESSL.cpp in Sources */,
A0AABE4813AFE96100F2EBD1 /* TranslatorESSL.cpp in Sources */,
+ 49951C0914B7AAD80060E96E /* BuiltInFunctionEmulator.cpp in Sources */,
+ 49951C0B14B7AAD80060E96E /* DetectRecursion.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/ThirdParty/ANGLE/ChangeLog b/Source/ThirdParty/ANGLE/ChangeLog
index ec1171579..109efc7c3 100644
--- a/Source/ThirdParty/ANGLE/ChangeLog
+++ b/Source/ThirdParty/ANGLE/ChangeLog
@@ -1,3 +1,577 @@
+2012-01-07 Chris Marrin <cmarrin@apple.com>
+
+ Fixed a warning in GTK build of ANGLE
+
+ Unreviewed.
+
+ * src/compiler/DetectRecursion.cpp:
+ (DetectRecursion::~DetectRecursion):
+
+2012-01-06 Mark Rowe <mrowe@apple.com>
+
+ Regenerate a few files with a more appropriate version of bison.
+
+ Rubber-stamped by Dan Bernstein.
+
+ * src/compiler/glslang.l: Tweak the input so that it generates code that compiles without warnings.
+ * src/compiler/glslang_lex.cpp:
+ * src/compiler/glslang_tab.cpp:
+ * src/compiler/glslang_tab.h:
+
+2012-01-06 Chris Marrin <cmarrin@apple.com>
+
+ Update ANGLE in WebKit tree
+ https://bugs.webkit.org/show_bug.cgi?id=75753
+
+ Reviewed by Simon Fraser.
+
+ Updated ANGLE to r939. Fixed a compiler error (missing case in switch statement)
+ and added 5 new files to xcodeproj. Other than that it is a straight copy of
+ the files from the ANGLE repository.
+
+ * ANGLE.xcodeproj/project.pbxproj:
+ * include/EGL/eglext.h:
+ * include/EGL/eglplatform.h:
+ * include/GLES2/gl2ext.h:
+ * include/GLSLANG/ShaderLang.h:
+ * src/common/debug.cpp:
+ (gl::output):
+ (gl::trace):
+ (gl::perfActive):
+ (gl::ScopedPerfEventHelper::ScopedPerfEventHelper):
+ (gl::ScopedPerfEventHelper::~ScopedPerfEventHelper):
+ * src/common/version.h:
+ * src/compiler/BaseTypes.h:
+ (getBasicString):
+ * src/compiler/BuiltInFunctionEmulator.cpp: Added.
+ (BuiltInFunctionEmulator::BuiltInFunctionEmulator):
+ (BuiltInFunctionEmulator::SetFunctionCalled):
+ (BuiltInFunctionEmulator::OutputEmulatedFunctionDefinition):
+ (BuiltInFunctionEmulator::IdentifyFunction):
+ (BuiltInFunctionEmulator::MarkBuiltInFunctionsForEmulation):
+ (BuiltInFunctionEmulator::Cleanup):
+ (BuiltInFunctionEmulator::GetEmulatedFunctionName):
+ * src/compiler/BuiltInFunctionEmulator.h: Added.
+ * src/compiler/Compiler.cpp:
+ (TCompiler::TCompiler):
+ (TCompiler::compile):
+ (TCompiler::clearResults):
+ (TCompiler::detectRecursion):
+ (TCompiler::getMappedNameMaxLength):
+ (TCompiler::getBuiltInFunctionEmulator):
+ * src/compiler/DetectRecursion.cpp: Added.
+ (DetectRecursion::FunctionNode::FunctionNode):
+ (DetectRecursion::FunctionNode::getName):
+ (DetectRecursion::FunctionNode::addCallee):
+ (DetectRecursion::FunctionNode::detectRecursion):
+ (DetectRecursion::DetectRecursion):
+ (DetectRecursion::~DetectRecursion):
+ (DetectRecursion::visitAggregate):
+ (DetectRecursion::detectRecursion):
+ (DetectRecursion::findFunctionByName):
+ * src/compiler/DetectRecursion.h: Added.
+ * src/compiler/ExtensionBehavior.h:
+ * src/compiler/ForLoopUnroll.cpp:
+ (ForLoopUnroll::MarkForLoopsWithIntegerIndicesForUnrolling):
+ * src/compiler/ForLoopUnroll.h:
+ * src/compiler/Initialize.cpp:
+ (BuiltInFunctionsCommon):
+ (BuiltInFunctionsVertex):
+ (BuiltInFunctionsFragment):
+ (TBuiltIns::initialize):
+ (IdentifyBuiltIns):
+ (InitExtensionBehavior):
+ * src/compiler/MapLongVariableNames.cpp:
+ (MapLongVariableNames::MapLongVariableNames):
+ (MapLongVariableNames::visitSymbol):
+ (MapLongVariableNames::mapVaryingLongName):
+ * src/compiler/MapLongVariableNames.h:
+ * src/compiler/OutputGLSLBase.cpp:
+ (TOutputGLSLBase::visitUnary):
+ (TOutputGLSLBase::visitAggregate):
+ * src/compiler/OutputHLSL.cpp:
+ (sh::OutputHLSL::OutputHLSL):
+ (sh::OutputHLSL::header):
+ (sh::OutputHLSL::visitSymbol):
+ (sh::OutputHLSL::visitAggregate):
+ (sh::OutputHLSL::visitSelection):
+ (sh::OutputHLSL::visitLoop):
+ (sh::OutputHLSL::handleExcessiveLoop):
+ (sh::OutputHLSL::addConstructor):
+ (sh::OutputHLSL::decorate):
+ (sh::OutputHLSL::decorateUniform):
+ * src/compiler/OutputHLSL.h:
+ * src/compiler/ParseHelper.cpp:
+ (TParseContext::recover):
+ (TParseContext::reservedErrorCheck):
+ (TParseContext::constructorErrorCheck):
+ (TParseContext::extensionErrorCheck):
+ (TParseContext::supportsExtension):
+ (TParseContext::enterStructDeclaration):
+ (TParseContext::exitStructDeclaration):
+ (TParseContext::structNestingErrorCheck):
+ * src/compiler/ParseHelper.h:
+ (TParseContext::TParseContext):
+ * src/compiler/PoolAlloc.h:
+ (pool_allocator::pool_allocator):
+ (pool_allocator::operator=):
+ (pool_allocator::setAllocator):
+ (pool_allocator::getAllocator):
+ * src/compiler/ShHandle.h:
+ * src/compiler/ShaderLang.cpp:
+ (checkActiveUniformAndAttribMaxLengths):
+ (checkMappedNameMaxLength):
+ (getVariableInfo):
+ (ShInitBuiltInResources):
+ (ShGetInfo):
+ * src/compiler/SymbolTable.cpp:
+ (TType::computeDeepestStructNesting):
+ * src/compiler/TranslatorESSL.cpp:
+ (TranslatorESSL::translate):
+ (TranslatorESSL::writeExtensionBehavior):
+ * src/compiler/TranslatorGLSL.cpp:
+ (TranslatorGLSL::translate):
+ * src/compiler/Types.h:
+ (TType::TType):
+ (TType::copyType):
+ (TType::setStruct):
+ (TType::getDeepestStructNesting):
+ * src/compiler/UnfoldSelect.cpp:
+ (sh::UnfoldSelect::traverse):
+ (sh::UnfoldSelect::visitSelection):
+ (sh::UnfoldSelect::visitLoop):
+ (sh::UnfoldSelect::getNextTemporaryIndex):
+ * src/compiler/UnfoldSelect.h:
+ * src/compiler/ValidateLimitations.cpp:
+ * src/compiler/ValidateLimitations.h:
+ * src/compiler/VariableInfo.cpp:
+ (getVariableDataType):
+ * src/compiler/generate_glslang_lexer.sh: Removed.
+ * src/compiler/generate_glslang_parser.sh: Removed.
+ * src/compiler/generate_parser.sh: Added.
+ * src/compiler/glslang.l:
+ * src/compiler/glslang.y:
+ * src/compiler/glslang_lex.cpp:
+ (yy_get_previous_state):
+ (yy_try_NUL_trans):
+ * src/compiler/glslang_tab.cpp:
+ * src/compiler/glslang_tab.h:
+ * src/compiler/intermOut.cpp:
+ (TOutputTraverser::visitAggregate):
+ * src/compiler/intermediate.h:
+ (TIntermUnary::TIntermUnary):
+ (TIntermUnary::setUseEmulatedFunction):
+ (TIntermUnary::getUseEmulatedFunction):
+ (TIntermAggregate::TIntermAggregate):
+ (TIntermAggregate::setUseEmulatedFunction):
+ (TIntermAggregate::getUseEmulatedFunction):
+ * src/compiler/osinclude.h:
+ * src/compiler/ossource_posix.cpp:
+ (OS_AllocTLSIndex):
+ (OS_SetTLSValue):
+ (OS_FreeTLSIndex):
+ * src/compiler/preprocessor/atom.c:
+ (GrowAtomTable):
+ * src/compiler/preprocessor/length_limits.h: Added.
+ * src/compiler/preprocessor/scanner.h:
+ * src/libEGL/Display.cpp:
+ (egl::Display::getDisplay):
+ (egl::Display::Display):
+ (egl::Display::~Display):
+ (egl::Display::initialize):
+ (egl::Display::terminate):
+ (egl::Display::startScene):
+ (egl::Display::endScene):
+ (egl::Display::createDevice):
+ (egl::Display::initializeDevice):
+ (egl::Display::resetDevice):
+ (egl::Display::createWindowSurface):
+ (egl::Display::createOffscreenSurface):
+ (egl::Display::createContext):
+ (egl::Display::restoreLostDevice):
+ (egl::Display::notifyDeviceLost):
+ (egl::Display::isDeviceLost):
+ (egl::Display::testDeviceLost):
+ (egl::Display::testDeviceResettable):
+ (egl::Display::getDXT1TextureSupport):
+ (egl::Display::getDXT3TextureSupport):
+ (egl::Display::getDXT5TextureSupport):
+ (egl::Display::getFloat32TextureSupport):
+ (egl::Display::getFloat16TextureSupport):
+ (egl::Display::getTexturePool):
+ (egl::Display::initExtensionString):
+ * src/libEGL/Display.h:
+ * src/libEGL/Surface.cpp:
+ (egl::Surface::Surface):
+ (egl::Surface::initialize):
+ (egl::Surface::resetSwapChain):
+ (egl::Surface::subclassWindow):
+ (egl::Surface::unsubclassWindow):
+ (egl::Surface::swap):
+ (egl::Surface::postSubBuffer):
+ (egl::Surface::isPostSubBufferSupported):
+ * src/libEGL/Surface.h:
+ * src/libEGL/libEGL.cpp:
+ * src/libEGL/libEGL.rc:
+ * src/libEGL/libEGL.vcproj:
+ * src/libGLESv2/Buffer.cpp:
+ (gl::Buffer::bufferSubData):
+ * src/libGLESv2/Context.cpp:
+ (gl::Context::Context):
+ (gl::Context::makeCurrent):
+ (gl::Context::markAllStateDirty):
+ (gl::Context::markContextLost):
+ (gl::Context::isContextLost):
+ (gl::Context::setPackReverseRowOrder):
+ (gl::Context::getPackReverseRowOrder):
+ (gl::Context::deleteProgram):
+ (gl::Context::getDrawFramebuffer):
+ (gl::Context::bindDrawFramebuffer):
+ (gl::Context::useProgram):
+ (gl::Context::setFramebufferZero):
+ (gl::Context::getCurrentProgram):
+ (gl::Context::getBooleanv):
+ (gl::Context::getIntegerv):
+ (gl::Context::getQueryParameterInfo):
+ (gl::Context::applyRenderTarget):
+ (gl::Context::applyState):
+ (gl::Context::applyVertexBuffer):
+ (gl::Context::applyIndexBuffer):
+ (gl::Context::applyShaders):
+ (gl::Context::applyTextures):
+ (gl::Context::readPixels):
+ (gl::Context::clear):
+ (gl::Context::drawArrays):
+ (gl::Context::drawElements):
+ (gl::Context::sync):
+ (gl::Context::drawClosingLine):
+ (gl::Context::getResetStatus):
+ (gl::Context::isResetNotificationEnabled):
+ (gl::Context::supportsDXT1Textures):
+ (gl::Context::supportsDXT3Textures):
+ (gl::Context::supportsDXT5Textures):
+ (gl::Context::supportsFloat32Textures):
+ (gl::Context::supportsFloat32LinearFilter):
+ (gl::Context::supportsFloat32RenderableTextures):
+ (gl::Context::supportsFloat16Textures):
+ (gl::Context::supportsFloat16LinearFilter):
+ (gl::Context::supportsFloat16RenderableTextures):
+ (gl::Context::initExtensionString):
+ (gl::Context::initRendererString):
+ (gl::Context::getRendererString):
+ (gl::Context::blitFramebuffer):
+ (gl::VertexDeclarationCache::applyDeclaration):
+ (gl::VertexDeclarationCache::markStateDirty):
+ * src/libGLESv2/Context.h:
+ * src/libGLESv2/Fence.cpp:
+ (gl::Fence::testFence):
+ (gl::Fence::getFenceiv):
+ * src/libGLESv2/Framebuffer.cpp:
+ (gl::Framebuffer::setColorbuffer):
+ (gl::Framebuffer::setDepthbuffer):
+ (gl::Framebuffer::setStencilbuffer):
+ (gl::Framebuffer::getColorbuffer):
+ (gl::Framebuffer::getDepthbuffer):
+ (gl::Framebuffer::getStencilbuffer):
+ (gl::Framebuffer::hasStencil):
+ (gl::Framebuffer::completeness):
+ (gl::DefaultFramebuffer::DefaultFramebuffer):
+ * src/libGLESv2/Framebuffer.h:
+ * src/libGLESv2/IndexDataManager.cpp:
+ (gl::IndexDataManager::prepareIndexData):
+ (gl::IndexBuffer::IndexBuffer):
+ (gl::IndexBuffer::getSerial):
+ (gl::IndexBuffer::issueSerial):
+ (gl::StreamingIndexBuffer::reserveSpace):
+ (gl::StaticIndexBuffer::reserveSpace):
+ (gl::StaticIndexBuffer::lookupRange):
+ (gl::StaticIndexBuffer::addRange):
+ * src/libGLESv2/IndexDataManager.h:
+ (gl::StaticIndexBuffer::IndexRange::operator<):
+ * src/libGLESv2/Program.cpp:
+ (gl::Uniform::Uniform):
+ (gl::Uniform::isArray):
+ (gl::UniformLocation::UniformLocation):
+ (gl::Program::Program):
+ (gl::Program::detachShader):
+ (gl::Program::getUsedSamplerRange):
+ (gl::Program::getSamplerMapping):
+ (gl::Program::getUniformLocation):
+ (gl::Program::setUniform1fv):
+ (gl::Program::setUniform2fv):
+ (gl::Program::setUniform3fv):
+ (gl::transposeMatrix):
+ (gl::Program::setUniformMatrix2fv):
+ (gl::Program::setUniformMatrix3fv):
+ (gl::Program::setUniformMatrix4fv):
+ (gl::Program::getUniformfv):
+ (gl::Program::getUniformiv):
+ (gl::Program::applyUniforms):
+ (gl::Program::compileToBinary):
+ (gl::Program::linkVaryings):
+ (gl::Program::link):
+ (gl::Program::defineUniform):
+ (gl::Program::createUniform):
+ (gl::Program::decorateAttribute):
+ (gl::Program::undecorateUniform):
+ (gl::Program::applyUniformnbv):
+ (gl::Program::applyUniformnfv):
+ (gl::Program::applyUniform1iv):
+ (gl::Program::applyUniform2iv):
+ (gl::Program::applyUniform3iv):
+ (gl::Program::applyUniform4iv):
+ (gl::Program::applyUniformniv):
+ (gl::Program::appendToInfoLogSanitized):
+ (gl::Program::unlink):
+ (gl::Program::getActiveUniform):
+ (gl::Program::getActiveUniformCount):
+ (gl::Program::getActiveUniformMaxLength):
+ (gl::Program::validateSamplers):
+ (gl::Program::initializeConstantHandles):
+ (gl::Program::getDxCoordLocation):
+ * src/libGLESv2/Program.h:
+ * src/libGLESv2/Renderbuffer.cpp:
+ (gl::RenderbufferInterface::RenderbufferInterface):
+ (gl::RenderbufferInterface::getRedSize):
+ (gl::RenderbufferInterface::getGreenSize):
+ (gl::RenderbufferInterface::getBlueSize):
+ (gl::RenderbufferInterface::getAlphaSize):
+ (gl::RenderbufferInterface::getDepthSize):
+ (gl::RenderbufferInterface::getStencilSize):
+ (gl::RenderbufferTexture::RenderbufferTexture):
+ (gl::RenderbufferTexture::~RenderbufferTexture):
+ (gl::RenderbufferTexture::getRenderTarget):
+ (gl::RenderbufferTexture::getDepthStencil):
+ (gl::RenderbufferTexture::getWidth):
+ (gl::RenderbufferTexture::getHeight):
+ (gl::RenderbufferTexture::getInternalFormat):
+ (gl::RenderbufferTexture::getD3DFormat):
+ (gl::RenderbufferTexture::getSamples):
+ (gl::RenderbufferTexture::getSerial):
+ (gl::Renderbuffer::Renderbuffer):
+ (gl::Renderbuffer::~Renderbuffer):
+ (gl::Renderbuffer::getRenderTarget):
+ (gl::Renderbuffer::getDepthStencil):
+ (gl::Renderbuffer::getWidth):
+ (gl::Renderbuffer::getHeight):
+ (gl::Renderbuffer::getInternalFormat):
+ (gl::Renderbuffer::getD3DFormat):
+ (gl::Renderbuffer::getRedSize):
+ (gl::Renderbuffer::getGreenSize):
+ (gl::Renderbuffer::getBlueSize):
+ (gl::Renderbuffer::getAlphaSize):
+ (gl::Renderbuffer::getDepthSize):
+ (gl::Renderbuffer::getStencilSize):
+ (gl::Renderbuffer::getSamples):
+ (gl::Renderbuffer::getSerial):
+ (gl::Renderbuffer::setStorage):
+ (gl::RenderbufferStorage::getD3DFormat):
+ (gl::RenderbufferStorage::issueCubeSerials):
+ (gl::Colorbuffer::Colorbuffer):
+ (gl::Colorbuffer::getRenderTarget):
+ (gl::Depthbuffer::Depthbuffer):
+ (gl::Stencilbuffer::Stencilbuffer):
+ * src/libGLESv2/Renderbuffer.h:
+ (gl::RenderbufferInterface::~RenderbufferInterface):
+ * src/libGLESv2/Shader.cpp:
+ (gl::Shader::getTranslatedSourceLength):
+ (gl::Shader::getSourceImpl):
+ (gl::Shader::getSource):
+ (gl::Shader::getTranslatedSource):
+ * src/libGLESv2/Shader.h:
+ * src/libGLESv2/Texture.cpp:
+ (gl::ConvertTextureFormatType):
+ (gl::IsTextureFormatRenderable):
+ (gl::Image::Image):
+ (gl::Image::~Image):
+ (gl::Image::redefine):
+ (gl::Image::createSurface):
+ (gl::Image::lock):
+ (gl::Image::unlock):
+ (gl::Image::isRenderableFormat):
+ (gl::Image::getD3DFormat):
+ (gl::Image::getSurface):
+ (gl::Image::setManagedSurface):
+ (gl::Image::updateSurface):
+ (gl::Image::loadData):
+ (gl::Image::loadAlphaData):
+ (gl::Image::loadAlphaFloatData):
+ (gl::Image::loadAlphaHalfFloatData):
+ (gl::Image::loadLuminanceData):
+ (gl::Image::loadLuminanceFloatData):
+ (gl::Image::loadLuminanceHalfFloatData):
+ (gl::Image::loadLuminanceAlphaData):
+ (gl::Image::loadLuminanceAlphaFloatData):
+ (gl::Image::loadLuminanceAlphaHalfFloatData):
+ (gl::Image::loadRGBUByteData):
+ (gl::Image::loadRGB565Data):
+ (gl::Image::loadRGBFloatData):
+ (gl::Image::loadRGBHalfFloatData):
+ (gl::Image::loadRGBAUByteDataSSE2):
+ (gl::Image::loadRGBAUByteData):
+ (gl::Image::loadRGBA4444Data):
+ (gl::Image::loadRGBA5551Data):
+ (gl::Image::loadRGBAFloatData):
+ (gl::Image::loadRGBAHalfFloatData):
+ (gl::Image::loadBGRAData):
+ (gl::Image::loadCompressedData):
+ (gl::FlipCopyDXT1BlockFull):
+ (gl::FlipCopyDXT1BlockHalf):
+ (gl::FlipCopyDXT3BlockFull):
+ (gl::FlipCopyDXT3BlockHalf):
+ (gl::FlipCopyDXT5BlockFull):
+ (gl::FlipCopyDXT5BlockHalf):
+ (gl::Image::loadDXT1Data):
+ (gl::Image::loadDXT3Data):
+ (gl::Image::loadDXT5Data):
+ (gl::Image::copy):
+ (gl::TextureStorage::TextureStorage):
+ (gl::TextureStorage::~TextureStorage):
+ (gl::TextureStorage::isRenderTarget):
+ (gl::TextureStorage::isManaged):
+ (gl::TextureStorage::getPool):
+ (gl::TextureStorage::getTextureSerial):
+ (gl::TextureStorage::issueTextureSerial):
+ (gl::Texture::Texture):
+ (gl::Texture::~Texture):
+ (gl::Texture::setMinFilter):
+ (gl::Texture::setMagFilter):
+ (gl::Texture::setWrapS):
+ (gl::Texture::setWrapT):
+ (gl::Texture::setUsage):
+ (gl::Texture::getMinFilter):
+ (gl::Texture::getMagFilter):
+ (gl::Texture::getWrapS):
+ (gl::Texture::getWrapT):
+ (gl::Texture::getUsage):
+ (gl::Texture::setImage):
+ (gl::Texture::setCompressedImage):
+ (gl::Texture::subImage):
+ (gl::Texture::subImageCompressed):
+ (gl::Texture::getTexture):
+ (gl::Texture::hasDirtyParameters):
+ (gl::Texture::hasDirtyImages):
+ (gl::Texture::resetDirty):
+ (gl::Texture::getTextureSerial):
+ (gl::Texture::getRenderTargetSerial):
+ (gl::Texture::isImmutable):
+ (gl::Texture::creationLevels):
+ (gl::Texture::getBlitter):
+ (gl::Texture::copyToRenderTarget):
+ (gl::TextureStorage2D::TextureStorage2D):
+ (gl::TextureStorage2D::~TextureStorage2D):
+ (gl::TextureStorage2D::getSurfaceLevel):
+ (gl::TextureStorage2D::getBaseTexture):
+ (gl::TextureStorage2D::getRenderTargetSerial):
+ (gl::Texture2D::Texture2D):
+ (gl::Texture2D::~Texture2D):
+ (gl::Texture2D::getWidth):
+ (gl::Texture2D::getHeight):
+ (gl::Texture2D::getInternalFormat):
+ (gl::Texture2D::getType):
+ (gl::Texture2D::redefineImage):
+ (gl::Texture2D::setImage):
+ (gl::Texture2D::bindTexImage):
+ (gl::Texture2D::releaseTexImage):
+ (gl::Texture2D::setCompressedImage):
+ (gl::Texture2D::commitRect):
+ (gl::Texture2D::copyImage):
+ (gl::Texture2D::copySubImage):
+ (gl::Texture2D::storage):
+ (gl::Texture2D::isSamplerComplete):
+ (gl::Texture2D::isMipmapComplete):
+ (gl::Texture2D::getBaseTexture):
+ (gl::Texture2D::createTexture):
+ (gl::Texture2D::updateTexture):
+ (gl::Texture2D::convertToRenderTarget):
+ (gl::Texture2D::generateMipmaps):
+ (gl::Texture2D::getRenderbuffer):
+ (gl::Texture2D::getRenderTarget):
+ (gl::Texture2D::getStorage):
+ (gl::TextureStorageCubeMap::TextureStorageCubeMap):
+ (gl::TextureStorageCubeMap::~TextureStorageCubeMap):
+ (gl::TextureStorageCubeMap::getCubeMapSurface):
+ (gl::TextureStorageCubeMap::getBaseTexture):
+ (gl::TextureStorageCubeMap::getRenderTargetSerial):
+ (gl::TextureCubeMap::TextureCubeMap):
+ (gl::TextureCubeMap::~TextureCubeMap):
+ (gl::TextureCubeMap::getWidth):
+ (gl::TextureCubeMap::getHeight):
+ (gl::TextureCubeMap::getInternalFormat):
+ (gl::TextureCubeMap::getType):
+ (gl::TextureCubeMap::setCompressedImage):
+ (gl::TextureCubeMap::commitRect):
+ (gl::TextureCubeMap::subImage):
+ (gl::TextureCubeMap::subImageCompressed):
+ (gl::TextureCubeMap::isSamplerComplete):
+ (gl::TextureCubeMap::isCubeComplete):
+ (gl::TextureCubeMap::isMipmapCubeComplete):
+ (gl::TextureCubeMap::getBaseTexture):
+ (gl::TextureCubeMap::createTexture):
+ (gl::TextureCubeMap::updateTexture):
+ (gl::TextureCubeMap::convertToRenderTarget):
+ (gl::TextureCubeMap::setImage):
+ (gl::TextureCubeMap::redefineImage):
+ (gl::TextureCubeMap::copyImage):
+ (gl::TextureCubeMap::copySubImage):
+ (gl::TextureCubeMap::storage):
+ (gl::TextureCubeMap::generateMipmaps):
+ (gl::TextureCubeMap::getRenderbuffer):
+ (gl::TextureCubeMap::getRenderTarget):
+ (gl::TextureCubeMap::getStorage):
+ * src/libGLESv2/Texture.h:
+ (gl::Image::markDirty):
+ (gl::Image::markClean):
+ (gl::Image::getWidth):
+ (gl::Image::getHeight):
+ (gl::Image::getFormat):
+ (gl::Image::getType):
+ (gl::Image::isDirty):
+ * src/libGLESv2/VertexDataManager.cpp:
+ (gl::elementsInBuffer):
+ (gl::VertexDataManager::VertexDataManager):
+ (gl::VertexDataManager::writeAttributeData):
+ (gl::VertexDataManager::prepareVertexData):
+ (gl::VertexBuffer::VertexBuffer):
+ (gl::VertexBuffer::getSerial):
+ (gl::VertexBuffer::issueSerial):
+ (gl::StreamingVertexBuffer::reserveRequiredSpace):
+ (gl::StaticVertexBuffer::map):
+ (gl::StaticVertexBuffer::reserveRequiredSpace):
+ (gl::StaticVertexBuffer::lookupAttribute):
+ * src/libGLESv2/VertexDataManager.h:
+ (gl::ArrayVertexBuffer::size):
+ * src/libGLESv2/geometry/IndexDataManager.cpp: Removed.
+ * src/libGLESv2/geometry/IndexDataManager.h: Removed.
+ * src/libGLESv2/geometry/VertexDataManager.cpp: Removed.
+ * src/libGLESv2/geometry/VertexDataManager.h: Removed.
+ * src/libGLESv2/geometry/vertexconversion.h: Removed.
+ * src/libGLESv2/libGLESv2.cpp:
+ (validateSubImageParams):
+ (validReadFormatType):
+ (Extension::glBindTexImage):
+ * src/libGLESv2/libGLESv2.def:
+ * src/libGLESv2/libGLESv2.rc:
+ * src/libGLESv2/libGLESv2.vcproj:
+ * src/libGLESv2/main.cpp:
+ (gl::getNonLostContext):
+ (gl::checkDeviceLost):
+ * src/libGLESv2/main.h:
+ * src/libGLESv2/utilities.cpp:
+ (gl::UniformExternalComponentCount):
+ (gl::UniformInternalComponentCount):
+ (gl::UniformComponentSize):
+ (gl::UniformInternalSize):
+ (gl::UniformExternalSize):
+ (gl::ComputeCompressedSize):
+ (gl::IsCompressed):
+ (gl::ExtractFormat):
+ (gl::ExtractType):
+ (dx2es::IsFloat32Format):
+ (dx2es::IsFloat16Format):
+ * src/libGLESv2/utilities.h:
+ (isDeviceLostError):
+
2011-11-11 Darin Adler <darin@apple.com>
* ANGLE.xcodeproj/project.pbxproj: Let a newer Xcode update this file.
diff --git a/Source/ThirdParty/ANGLE/include/EGL/eglext.h b/Source/ThirdParty/ANGLE/include/EGL/eglext.h
index b650a500c..2d4ab2235 100644
--- a/Source/ThirdParty/ANGLE/include/EGL/eglext.h
+++ b/Source/ThirdParty/ANGLE/include/EGL/eglext.h
@@ -6,7 +6,7 @@ extern "C" {
#endif
/*
-** Copyright (c) 2007-2009 The Khronos Group Inc.
+** Copyright (c) 2007-2010 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@@ -34,8 +34,8 @@ extern "C" {
/* Header file version number */
/* Current version at http://www.khronos.org/registry/egl/ */
-/* $Revision: 10795 $ on $Date: 2010-03-19 17:04:17 -0700 (Fri, 19 Mar 2010) $ */
-#define EGL_EGLEXT_VERSION 5
+/* $Revision: 15052 $ on $Date: 2011-07-06 17:43:46 -0700 (Wed, 06 Jul 2011) $ */
+#define EGL_EGLEXT_VERSION 10
#ifndef EGL_KHR_config_attribs
#define EGL_KHR_config_attribs 1
@@ -120,6 +120,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGL
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
#endif
+#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
#ifndef EGL_KHR_reusable_sync
#define EGL_KHR_reusable_sync 1
@@ -149,6 +150,7 @@ typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSy
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
#endif
+#endif
#ifndef EGL_KHR_image_base
#define EGL_KHR_image_base 1
@@ -169,6 +171,11 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
#endif
+#ifndef EGL_KHR_lock_surface2
+#define EGL_KHR_lock_surface2 1
+#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
+#endif
+
#ifndef EGL_NV_coverage_sample
#define EGL_NV_coverage_sample 1
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
@@ -182,6 +189,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
#endif
+#if KHRONOS_SUPPORT_INT64 /* EGLTimeNV requires 64-bit uint support */
#ifndef EGL_NV_sync
#define EGL_NV_sync 1
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
@@ -198,7 +206,7 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EG
#define EGL_SYNC_FENCE_NV 0x30EF
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
typedef void* EGLSyncNV;
-typedef unsigned long long EGLTimeNV;
+typedef khronos_utime_nanoseconds_t EGLTimeNV;
#ifdef EGL_EGLEXT_PROTOTYPES
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
@@ -214,6 +222,76 @@ typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
#endif
+#endif
+
+#if KHRONOS_SUPPORT_INT64 /* Dependent on EGL_KHR_reusable_sync which requires 64-bit uint support */
+#ifndef EGL_KHR_fence_sync
+#define EGL_KHR_fence_sync 1
+/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
+#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
+#define EGL_SYNC_CONDITION_KHR 0x30F8
+#define EGL_SYNC_FENCE_KHR 0x30F9
+#endif
+#endif
+
+#ifndef EGL_HI_clientpixmap
+#define EGL_HI_clientpixmap 1
+
+/* Surface Attribute */
+#define EGL_CLIENT_PIXMAP_POINTER_HI 0x8F74
+/*
+ * Structure representing a client pixmap
+ * (pixmap's data is in client-space memory).
+ */
+struct EGLClientPixmapHI
+{
+ void* pData;
+ EGLint iWidth;
+ EGLint iHeight;
+ EGLint iStride;
+};
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurfaceHI(EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEHIPROC) (EGLDisplay dpy, EGLConfig config, struct EGLClientPixmapHI* pixmap);
+#endif /* EGL_HI_clientpixmap */
+
+#ifndef EGL_HI_colorformats
+#define EGL_HI_colorformats 1
+/* Config Attribute */
+#define EGL_COLOR_FORMAT_HI 0x8F70
+/* Color Formats */
+#define EGL_COLOR_RGB_HI 0x8F71
+#define EGL_COLOR_RGBA_HI 0x8F72
+#define EGL_COLOR_ARGB_HI 0x8F73
+#endif /* EGL_HI_colorformats */
+
+#ifndef EGL_MESA_drm_image
+#define EGL_MESA_drm_image 1
+#define EGL_DRM_BUFFER_FORMAT_MESA 0x31D0 /* CreateDRMImageMESA attribute */
+#define EGL_DRM_BUFFER_USE_MESA 0x31D1 /* CreateDRMImageMESA attribute */
+#define EGL_DRM_BUFFER_FORMAT_ARGB32_MESA 0x31D2 /* EGL_IMAGE_FORMAT_MESA attribute value */
+#define EGL_DRM_BUFFER_MESA 0x31D3 /* eglCreateImageKHR target */
+#define EGL_DRM_BUFFER_STRIDE_MESA 0x31D4
+#define EGL_DRM_BUFFER_USE_SCANOUT_MESA 0x00000001 /* EGL_DRM_BUFFER_USE_MESA bits */
+#define EGL_DRM_BUFFER_USE_SHARE_MESA 0x00000002 /* EGL_DRM_BUFFER_USE_MESA bits */
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLImageKHR EGLAPIENTRY eglCreateDRMImageMESA (EGLDisplay dpy, const EGLint *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEDRMIMAGEMESAPROC) (EGLDisplay dpy, const EGLint *attrib_list);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDRMIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, EGLint *name, EGLint *handle, EGLint *stride);
+#endif
+
+#ifndef EGL_NV_post_sub_buffer
+#define EGL_NV_post_sub_buffer 1
+#define EGL_POST_SUB_BUFFER_SUPPORTED_NV 0x30BE
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLBoolean EGLAPIENTRY eglPostSubBufferNV (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLPOSTSUBBUFFERNVPROC) (EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height);
+#endif
#ifndef EGL_ANGLE_query_surface_pointer
#define EGL_ANGLE_query_surface_pointer 1
@@ -224,8 +302,43 @@ typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay
#endif
#ifndef EGL_ANGLE_surface_d3d_texture_2d_share_handle
-#define EGL_ANGLE_surface_d3d_texture_2d_share_handle
-#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
+#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
+#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
+#endif
+
+#ifndef EGL_ANGLE_software_display
+#define EGL_ANGLE_software_display 1
+#define EGL_SOFTWARE_DISPLAY_ANGLE ((EGLNativeDisplayType)-1)
+#endif
+
+#ifndef EGL_NV_coverage_sample_resolve
+#define EGL_NV_coverage_sample_resolve 1
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NV 0x3131
+#define EGL_COVERAGE_SAMPLE_RESOLVE_DEFAULT_NV 0x3132
+#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
+#endif
+
+#ifndef EGL_EXT_create_context_robustness
+#define EGL_EXT_create_context_robustness 1
+#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT 0x30BF
+#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT 0x3138
+#define EGL_NO_RESET_NOTIFICATION_EXT 0x31BE
+#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
+#endif
+
+#if KHRONOS_SUPPORT_INT64 /* EGLTimeKHR requires 64-bit uint support */
+#ifndef EGL_NV_system_time
+#define EGL_NV_system_time 1
+
+typedef khronos_utime_nanoseconds_t EGLuint64NV;
+
+#ifdef EGL_EGLEXT_PROTOTYPES
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeFrequencyNV(void);
+EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV(void);
+#endif /* EGL_EGLEXT_PROTOTYPES */
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMEFREQUENCYNVPROC) (void);
+typedef EGLuint64NV (EGLAPIENTRYP PFNEGLGETSYSTEMTIMENVPROC) (void);
+#endif
#endif
#ifdef __cplusplus
diff --git a/Source/ThirdParty/ANGLE/include/EGL/eglplatform.h b/Source/ThirdParty/ANGLE/include/EGL/eglplatform.h
index 22e855f56..34283f2e9 100644
--- a/Source/ThirdParty/ANGLE/include/EGL/eglplatform.h
+++ b/Source/ThirdParty/ANGLE/include/EGL/eglplatform.h
@@ -25,7 +25,7 @@
*/
/* Platform-specific types and definitions for egl.h
- * $Revision: 9724 $ on $Date: 2009-12-02 02:05:33 -0800 (Wed, 02 Dec 2009) $
+ * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
*
* Adopters may modify khrplatform.h and this file to suit their platform.
* You are encouraged to submit all modifications to the Khronos group so that
@@ -60,6 +60,11 @@
* Windows Device Context. They must be defined in platform-specific
* code below. The EGL-prefixed versions of Native*Type are the same
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
+ *
+ * Khronos STRONGLY RECOMMENDS that you use the default definitions
+ * provided below, since these changes affect both binary and source
+ * portability of applications using EGL running on different EGL
+ * implementations.
*/
#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
@@ -78,7 +83,13 @@ typedef int EGLNativeDisplayType;
typedef void *EGLNativeWindowType;
typedef void *EGLNativePixmapType;
-#elif defined(__unix__)
+#elif defined(WL_EGL_PLATFORM)
+
+typedef struct wl_display *EGLNativeDisplayType;
+typedef struct wl_egl_pixmap *EGLNativePixmapType;
+typedef struct wl_egl_window *EGLNativeWindowType;
+
+#elif defined(__unix__) && !defined(ANDROID)
/* X11 (tentative) */
#include <X11/Xlib.h>
@@ -88,6 +99,14 @@ typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
+#elif defined(ANDROID)
+
+struct egl_native_pixmap_t;
+
+typedef struct ANativeWindow* EGLNativeWindowType;
+typedef struct egl_native_pixmap_t* EGLNativePixmapType;
+typedef void* EGLNativeDisplayType;
+
#else
#error "Platform not recognized"
#endif
diff --git a/Source/ThirdParty/ANGLE/include/GLES2/gl2ext.h b/Source/ThirdParty/ANGLE/include/GLES2/gl2ext.h
index 01844de4b..5233f4a16 100644
--- a/Source/ThirdParty/ANGLE/include/GLES2/gl2ext.h
+++ b/Source/ThirdParty/ANGLE/include/GLES2/gl2ext.h
@@ -1,7 +1,7 @@
#ifndef __gl2ext_h_
#define __gl2ext_h_
-/* $Revision: 10798 $ on $Date:: 2010-03-19 17:34:30 -0700 #$ */
+/* $Revision: 15049 $ on $Date:: 2011-07-06 17:28:16 -0700 #$ */
#ifdef __cplusplus
extern "C" {
@@ -57,6 +57,15 @@ extern "C" {
typedef void* GLeglImageOES;
#endif
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+/* GLeglImageOES defined in GL_OES_EGL_image already. */
+#define GL_TEXTURE_EXTERNAL_OES 0x8D65
+#define GL_SAMPLER_EXTERNAL_OES 0x8D66
+#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
+#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
+#endif
+
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_UNSIGNED_INT 0x1405
@@ -180,6 +189,95 @@ typedef void* GLeglImageOES;
#endif
/*------------------------------------------------------------------------*
+ * ANGLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
+#define GL_MAX_SAMPLES_ANGLE 0x8D57
+#endif
+
+/* GL_ANGLE_pack_reverse_row_order */
+#ifndef GL_ANGLE_pack_reverse_row_order
+#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
+#endif
+
+/* GL_ANGLE_texture_compression_dxt3 */
+#ifndef GL_ANGLE_texture_compression_dxt3
+#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
+#endif
+
+/* GL_ANGLE_texture_compression_dxt5 */
+#ifndef GL_ANGLE_texture_compression_dxt5
+#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
+#endif
+
+/* GL_ANGLE_translated_shader_source */
+#ifndef GL_ANGLE_translated_shader_source
+#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
+#endif
+
+/* GL_ANGLE_texture_usage */
+#ifndef GL_ANGLE_texture_usage
+#define GL_TEXTURE_USAGE_ANGLE 0x93A2
+#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_RGB_422_APPLE 0x8A1F
+#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
+#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
+#define GL_MAX_SAMPLES_APPLE 0x8D57
+#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
+#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
+#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
+#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_BGRA_EXT 0x80E1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_MALI_SHADER_BINARY_ARM 0x8F60
+#endif
+
+/* GL_ARM_rgba8 */
+/* No new tokens introduced by this extension. */
+
+/*------------------------------------------------------------------------*
* EXT extension tokens
*------------------------------------------------------------------------*/
@@ -206,6 +304,9 @@ typedef void* GLeglImageOES;
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
#endif
+/* GL_EXT_shader_texture_lod */
+/* No new tokens introduced by this extension. */
+
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
@@ -228,6 +329,58 @@ typedef void* GLeglImageOES;
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#endif
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_UNPACK_ROW_LENGTH 0x0CF2
+#define GL_UNPACK_SKIP_ROWS 0x0CF3
+#define GL_UNPACK_SKIP_PIXELS 0x0CF4
+#endif
+
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
+#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
+#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
+#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
+#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
+#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
+#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
+#define GL_ALPHA8_EXT 0x803C
+#define GL_LUMINANCE8_EXT 0x8040
+#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
+/* OES_texture_float dependent internal formats */
+#define GL_RGBA32F_EXT 0x8814 /* reuse tokens from ARB_texture_float */
+#define GL_RGB32F_EXT 0x8815
+#define GL_ALPHA32F_EXT 0x8816
+#define GL_LUMINANCE32F_EXT 0x8818
+#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
+/* OES_texture_half_float dependent internal formats */
+#define GL_RGBA16F_EXT 0x881A /* reuse tokens from ARB_texture_float */
+#define GL_RGB16F_EXT 0x881B
+#define GL_ALPHA16F_EXT 0x881C
+#define GL_LUMINANCE16F_EXT 0x881E
+#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
+/* EXT_texture_type_2_10_10_10_REV dependent internal formats */
+#define GL_RGB10_A2_EXT 0x8059 /* reuse tokens from EXT_texture */
+#define GL_RGB10_EXT 0x8052
+/* EXT_texture_format_BGRA8888 dependent internal formats */
+#define GL_BGRA8_EXT 0x93A1
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension tokens
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_SHADER_BINARY_DMP 0x9250
+#endif
+
/*------------------------------------------------------------------------*
* IMG extension tokens
*------------------------------------------------------------------------*/
@@ -256,17 +409,18 @@ typedef void* GLeglImageOES;
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
+#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
+#define GL_MAX_SAMPLES_IMG 0x9135
+#define GL_TEXTURE_SAMPLES_IMG 0x9136
+#endif
+
/*------------------------------------------------------------------------*
* NV extension tokens
*------------------------------------------------------------------------*/
-/* GL_NV_fence */
-#ifndef GL_NV_fence
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-#endif
-
/* GL_NV_coverage_sample */
#ifndef GL_NV_coverage_sample
#define GL_COVERAGE_COMPONENT_NV 0x8ED0
@@ -285,10 +439,90 @@ typedef void* GLeglImageOES;
#define GL_DEPTH_COMPONENT16_NONLINEAR_NV 0x8E2C
#endif
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_MAX_DRAW_BUFFERS_NV 0x8824
+#define GL_DRAW_BUFFER0_NV 0x8825
+#define GL_DRAW_BUFFER1_NV 0x8826
+#define GL_DRAW_BUFFER2_NV 0x8827
+#define GL_DRAW_BUFFER3_NV 0x8828
+#define GL_DRAW_BUFFER4_NV 0x8829
+#define GL_DRAW_BUFFER5_NV 0x882A
+#define GL_DRAW_BUFFER6_NV 0x882B
+#define GL_DRAW_BUFFER7_NV 0x882C
+#define GL_DRAW_BUFFER8_NV 0x882D
+#define GL_DRAW_BUFFER9_NV 0x882E
+#define GL_DRAW_BUFFER10_NV 0x882F
+#define GL_DRAW_BUFFER11_NV 0x8830
+#define GL_DRAW_BUFFER12_NV 0x8831
+#define GL_DRAW_BUFFER13_NV 0x8832
+#define GL_DRAW_BUFFER14_NV 0x8833
+#define GL_DRAW_BUFFER15_NV 0x8834
+#define GL_COLOR_ATTACHMENT0_NV 0x8CE0
+#define GL_COLOR_ATTACHMENT1_NV 0x8CE1
+#define GL_COLOR_ATTACHMENT2_NV 0x8CE2
+#define GL_COLOR_ATTACHMENT3_NV 0x8CE3
+#define GL_COLOR_ATTACHMENT4_NV 0x8CE4
+#define GL_COLOR_ATTACHMENT5_NV 0x8CE5
+#define GL_COLOR_ATTACHMENT6_NV 0x8CE6
+#define GL_COLOR_ATTACHMENT7_NV 0x8CE7
+#define GL_COLOR_ATTACHMENT8_NV 0x8CE8
+#define GL_COLOR_ATTACHMENT9_NV 0x8CE9
+#define GL_COLOR_ATTACHMENT10_NV 0x8CEA
+#define GL_COLOR_ATTACHMENT11_NV 0x8CEB
+#define GL_COLOR_ATTACHMENT12_NV 0x8CEC
+#define GL_COLOR_ATTACHMENT13_NV 0x8CED
+#define GL_COLOR_ATTACHMENT14_NV 0x8CEE
+#define GL_COLOR_ATTACHMENT15_NV 0x8CEF
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_MAX_COLOR_ATTACHMENTS_NV 0x8CDF
+/* GL_COLOR_ATTACHMENT{0-15}_NV defined in GL_NV_draw_buffers already. */
+#endif
+
+/* GL_NV_fence */
+#ifndef GL_NV_fence
+#define GL_ALL_COMPLETED_NV 0x84F2
+#define GL_FENCE_STATUS_NV 0x84F3
+#define GL_FENCE_CONDITION_NV 0x84F4
+#endif
+
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_READ_BUFFER_NV 0x0C02
+#endif
+
+/* GL_NV_read_buffer_front */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_depth_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_read_stencil */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_compression_s3tc_update */
+/* No new tokens introduced by this extension. */
+
+/* GL_NV_texture_npot_2D_mipmap */
+/* No new tokens introduced by this extension. */
+
/*------------------------------------------------------------------------*
* QCOM extension tokens
*------------------------------------------------------------------------*/
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_ALPHA_TEST_QCOM 0x0BC0
+#define GL_ALPHA_TEST_FUNC_QCOM 0x0BC1
+#define GL_ALPHA_TEST_REF_QCOM 0x0BC2
+#endif
+
/* GL_QCOM_driver_control */
/* No new tokens introduced by this extension. */
@@ -357,22 +591,12 @@ typedef void* GLeglImageOES;
#endif
/*------------------------------------------------------------------------*
- * ANGLE extension tokens
+ * VIV extension tokens
*------------------------------------------------------------------------*/
-/* GL_ANGLE_framebuffer_blit */
-#ifndef GL_ANGLE_framebuffer_blit
-#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
-#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 // alias GL_FRAMEBUFFER_BINDING
-#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
-#endif
-
-/* GL_ANGLE_framebuffer_multisample */
-#ifndef GL_ANGLE_framebuffer_multisample
-#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
-#define GL_MAX_SAMPLES_ANGLE 0x8D57
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_SHADER_BINARY_VIV 0x8FC4
#endif
/*------------------------------------------------------------------------*
@@ -419,6 +643,12 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target,
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
#endif
+/* GL_OES_EGL_image_external */
+#ifndef GL_OES_EGL_image_external
+#define GL_OES_EGL_image_external 1
+/* glEGLImageTargetTexture2DOES defined in GL_OES_EGL_image already. */
+#endif
+
/* GL_OES_element_index_uint */
#ifndef GL_OES_element_index_uint
#define GL_OES_element_index_uint 1
@@ -601,6 +831,101 @@ typedef void (GL_APIENTRYP PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monito
#endif
/*------------------------------------------------------------------------*
+ * ANGLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ANGLE_framebuffer_blit */
+#ifndef GL_ANGLE_framebuffer_blit
+#define GL_ANGLE_framebuffer_blit 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+#endif
+
+/* GL_ANGLE_framebuffer_multisample */
+#ifndef GL_ANGLE_framebuffer_multisample
+#define GL_ANGLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+/* GL_ANGLE_pack_reverse_row_order */
+#ifndef GL_ANGLE_pack_reverse_row_order
+#define GL_ANGLE_pack_reverse_row_order 1
+#endif
+
+/* GL_ANGLE_texture_compression_dxt3 */
+#ifndef GL_ANGLE_texture_compression_dxt3
+#define GL_ANGLE_texture_compression_dxt3 1
+#endif
+
+/* GL_ANGLE_texture_compression_dxt5 */
+#ifndef GL_ANGLE_texture_compression_dxt5
+#define GL_ANGLE_texture_compression_dxt5 1
+#endif
+
+/* GL_ANGLE_translated_shader_source */
+#ifndef GL_ANGLE_translated_shader_source
+#define GL_ANGLE_translated_shader_source 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glGetTranslatedShaderSourceANGLE (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
+#endif
+typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
+#endif
+
+/* GL_ANGLE_texture_usage */
+#ifndef GL_ANGLE_texture_usage
+#define GL_ANGLE_texture_usage 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * APPLE extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_APPLE_rgb_422 */
+#ifndef GL_APPLE_rgb_422
+#define GL_APPLE_rgb_422 1
+#endif
+
+/* GL_APPLE_framebuffer_multisample */
+#ifndef GL_APPLE_framebuffer_multisample
+#define GL_APPLE_framebuffer_multisample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_APICALL void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
+#endif
+
+/* GL_APPLE_texture_format_BGRA8888 */
+#ifndef GL_APPLE_texture_format_BGRA8888
+#define GL_APPLE_texture_format_BGRA8888 1
+#endif
+
+/* GL_APPLE_texture_max_level */
+#ifndef GL_APPLE_texture_max_level
+#define GL_APPLE_texture_max_level 1
+#endif
+
+/*------------------------------------------------------------------------*
+ * ARM extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_ARM_mali_shader_binary */
+#ifndef GL_ARM_mali_shader_binary
+#define GL_ARM_mali_shader_binary 1
+#endif
+
+/* GL_ARM_rgba8 */
+#ifndef GL_ARM_rgba8
+#define GL_ARM_rgba8 1
+#endif
+
+/*------------------------------------------------------------------------*
* EXT extension functions
*------------------------------------------------------------------------*/
@@ -633,6 +958,11 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_EXT_read_format_bgra 1
#endif
+/* GL_EXT_shader_texture_lod */
+#ifndef GL_EXT_shader_texture_lod
+#define GL_EXT_shader_texture_lod 1
+#endif
+
/* GL_EXT_texture_filter_anisotropic */
#ifndef GL_EXT_texture_filter_anisotropic
#define GL_EXT_texture_filter_anisotropic 1
@@ -653,6 +983,44 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_EXT_texture_compression_dxt1 1
#endif
+/* GL_EXT_unpack_subimage */
+#ifndef GL_EXT_unpack_subimage
+#define GL_EXT_unpack_subimage 1
+#endif
+
+/* GL_EXT_robustness */
+#ifndef GL_EXT_robustness
+#define GL_EXT_robustness 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
+GL_APICALL void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+GL_APICALL void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+GL_APICALL void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
+#endif
+
+/* GL_EXT_texture_storage */
+#ifndef GL_EXT_texture_storage
+#define GL_EXT_texture_storage 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY TexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+#endif /* GL_GLEXT_PROTOTYPES */
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXT) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+#endif
+
+/*------------------------------------------------------------------------*
+ * DMP extension functions
+ *------------------------------------------------------------------------*/
+
+/* GL_DMP_shader_binary */
+#ifndef GL_DMP_shader_binary
+#define GL_DMP_shader_binary 1
+#endif
+
/*------------------------------------------------------------------------*
* IMG extension functions
*------------------------------------------------------------------------*/
@@ -677,10 +1045,51 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL
#define GL_IMG_texture_compression_pvrtc 1
#endif
+/* GL_IMG_multisampled_render_to_texture */
+#ifndef GL_IMG_multisampled_render_to_texture
+#define GL_IMG_multisampled_render_to_texture 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+GL_APICALL void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum, GLenum, GLenum, GLuint, GLint, GLsizei);
+#endif
+typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMG) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
+#endif
+
/*------------------------------------------------------------------------*
* NV extension functions
*------------------------------------------------------------------------*/
+/* GL_NV_coverage_sample */
+#ifndef GL_NV_coverage_sample
+#define GL_NV_coverage_sample 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
+GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+#endif
+typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
+typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+#endif
+
+/* GL_NV_depth_nonlinear */
+#ifndef GL_NV_depth_nonlinear
+#define GL_NV_depth_nonlinear 1
+#endif
+
+/* GL_NV_draw_buffers */
+#ifndef GL_NV_draw_buffers
+#define GL_NV_draw_buffers 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glDrawBuffersNV (GLsizei n, const GLenum *bufs);
+#endif
+typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSNVPROC) (GLsizei n, const GLenum *bufs);
+#endif
+
+/* GL_NV_fbo_color_attachments */
+#ifndef GL_NV_fbo_color_attachments
+#define GL_NV_fbo_color_attachments 1
+#endif
+
/* GL_NV_fence */
#ifndef GL_NV_fence
#define GL_NV_fence 1
@@ -702,26 +1111,58 @@ typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
#endif
-/* GL_NV_coverage_sample */
-#ifndef GL_NV_coverage_sample
-#define GL_NV_coverage_sample 1
+/* GL_NV_read_buffer */
+#ifndef GL_NV_read_buffer
+#define GL_NV_read_buffer 1
#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glCoverageMaskNV (GLboolean mask);
-GL_APICALL void GL_APIENTRY glCoverageOperationNV (GLenum operation);
+GL_APICALL void GL_APIENTRY glReadBufferNV (GLenum mode);
#endif
-typedef void (GL_APIENTRYP PFNGLCOVERAGEMASKNVPROC) (GLboolean mask);
-typedef void (GL_APIENTRYP PFNGLCOVERAGEOPERATIONNVPROC) (GLenum operation);
+typedef void (GL_APIENTRYP PFNGLREADBUFFERNVPROC) (GLenum mode);
#endif
-/* GL_NV_depth_nonlinear */
-#ifndef GL_NV_depth_nonlinear
-#define GL_NV_depth_nonlinear 1
+/* GL_NV_read_buffer_front */
+#ifndef GL_NV_read_buffer_front
+#define GL_NV_read_buffer_front 1
+#endif
+
+/* GL_NV_read_depth */
+#ifndef GL_NV_read_depth
+#define GL_NV_read_depth 1
+#endif
+
+/* GL_NV_read_depth_stencil */
+#ifndef GL_NV_read_depth_stencil
+#define GL_NV_read_depth_stencil 1
+#endif
+
+/* GL_NV_read_stencil */
+#ifndef GL_NV_read_stencil
+#define GL_NV_read_stencil 1
+#endif
+
+/* GL_NV_texture_compression_s3tc_update */
+#ifndef GL_NV_texture_compression_s3tc_update
+#define GL_NV_texture_compression_s3tc_update 1
+#endif
+
+/* GL_NV_texture_npot_2D_mipmap */
+#ifndef GL_NV_texture_npot_2D_mipmap
+#define GL_NV_texture_npot_2D_mipmap 1
#endif
/*------------------------------------------------------------------------*
* QCOM extension functions
*------------------------------------------------------------------------*/
+/* GL_QCOM_alpha_test */
+#ifndef GL_QCOM_alpha_test
+#define GL_QCOM_alpha_test 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glAlphaFuncQCOM (GLenum func, GLclampf ref);
+#endif
+typedef void (GL_APIENTRYP PFNGLALPHAFUNCQCOMPROC) (GLenum func, GLclampf ref);
+#endif
+
/* GL_QCOM_driver_control */
#ifndef GL_QCOM_driver_control
#define GL_QCOM_driver_control 1
@@ -797,31 +1238,12 @@ typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
#endif
/*------------------------------------------------------------------------*
- * ANGLE extension functions
+ * VIV extension tokens
*------------------------------------------------------------------------*/
-/* GL_ANGLE_framebuffer_blit */
-#ifndef GL_ANGLE_framebuffer_blit
-#define GL_ANGLE_framebuffer_blit 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter);
-#endif
-typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
- GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
- GLbitfield mask, GLenum filter);
-#endif
-
-/* GL_ANGLE_framebuffer_multisample */
-#ifndef GL_ANGLE_framebuffer_multisample
-#define GL_ANGLE_framebuffer_multisample 1
-#ifdef GL_GLEXT_PROTOTYPES
-GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat,
- GLsizei width, GLsizei height);
-#endif
-typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat,
- GLsizei width, GLsizei height);
+/* GL_VIV_shader_binary */
+#ifndef GL_VIV_shader_binary
+#define GL_VIV_shader_binary 1
#endif
#ifdef __cplusplus
diff --git a/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h b/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
index 6fe688c75..33dd6a578 100644
--- a/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
+++ b/Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h
@@ -6,6 +6,23 @@
#ifndef _COMPILER_INTERFACE_INCLUDED_
#define _COMPILER_INTERFACE_INCLUDED_
+#if defined(COMPONENT_BUILD)
+#if defined(_WIN32) || defined(_WIN64)
+
+#if defined(COMPILER_IMPLEMENTATION)
+#define COMPILER_EXPORT __declspec(dllexport)
+#else
+#define COMPILER_EXPORT __declspec(dllimport)
+#endif // defined(COMPILER_IMPLEMENTATION)
+
+#else // defined(WIN32)
+#define COMPILER_EXPORT __attribute__((visibility("default")))
+#endif
+
+#else // defined(COMPONENT_BUILD)
+#define COMPILER_EXPORT
+#endif
+
//
// This is the platform independent interface between an OGL driver
// and the shading language compiler.
@@ -59,7 +76,8 @@ typedef enum {
SH_FLOAT_MAT3 = 0x8B5B,
SH_FLOAT_MAT4 = 0x8B5C,
SH_SAMPLER_2D = 0x8B5E,
- SH_SAMPLER_CUBE = 0x8B60
+ SH_SAMPLER_CUBE = 0x8B60,
+ SH_SAMPLER_2D_RECT_ARB = 0x8B63
} ShDataType;
typedef enum {
@@ -81,7 +99,11 @@ typedef enum {
SH_ATTRIBUTES_UNIFORMS = 0x0008,
SH_LINE_DIRECTIVES = 0x0010,
SH_SOURCE_PATH = 0x0020,
- SH_MAP_LONG_VARIABLE_NAMES = 0x0040
+ SH_MAP_LONG_VARIABLE_NAMES = 0x0040,
+ SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX = 0x0080,
+
+ // This is needed only as a workaround for certain OpenGL driver bugs.
+ SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100
} ShCompileOptions;
//
@@ -89,12 +111,12 @@ typedef enum {
// compiler operations.
// If the function succeeds, the return value is nonzero, else zero.
//
-int ShInitialize();
+COMPILER_EXPORT int ShInitialize();
//
// Driver should call this at shutdown.
// If the function succeeds, the return value is nonzero, else zero.
//
-int ShFinalize();
+COMPILER_EXPORT int ShFinalize();
//
// Implementation dependent built-in resources (constants and extensions).
@@ -115,12 +137,14 @@ typedef struct
// Extensions.
// Set to 1 to enable the extension, else 0.
int OES_standard_derivatives;
+ int OES_EGL_image_external;
+ int ARB_texture_rectangle;
} ShBuiltInResources;
//
// Initialize built-in resources with minimum expected values.
//
-void ShInitBuiltInResources(ShBuiltInResources* resources);
+COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources* resources);
//
// ShHandle held by but opaque to the driver. It is allocated,
@@ -143,10 +167,12 @@ typedef void* ShHandle;
// output: Specifies the output code type - SH_ESSL_OUTPUT, SH_GLSL_OUTPUT,
// or SH_HLSL_OUTPUT.
// resources: Specifies the built-in resources.
-ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
- ShShaderOutput output,
- const ShBuiltInResources* resources);
-void ShDestruct(ShHandle handle);
+COMPILER_EXPORT ShHandle ShConstructCompiler(
+ ShShaderType type,
+ ShShaderSpec spec,
+ ShShaderOutput output,
+ const ShBuiltInResources* resources);
+COMPILER_EXPORT void ShDestruct(ShHandle handle);
//
// Compiles the given shader source.
@@ -173,7 +199,7 @@ void ShDestruct(ShHandle handle);
// Can be queried by calling ShGetActiveAttrib() and
// ShGetActiveUniform().
//
-int ShCompile(
+COMPILER_EXPORT int ShCompile(
const ShHandle handle,
const char* const shaderStrings[],
const int numStrings,
@@ -201,7 +227,9 @@ int ShCompile(
// the null termination character.
//
// params: Requested parameter
-void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
+COMPILER_EXPORT void ShGetInfo(const ShHandle handle,
+ ShShaderInfo pname,
+ int* params);
// Returns nul-terminated information log for a compiled shader.
// Parameters:
@@ -211,7 +239,7 @@ void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params);
// to accomodate the information log. The size of the buffer required
// to store the returned information log can be obtained by calling
// ShGetInfo with SH_INFO_LOG_LENGTH.
-void ShGetInfoLog(const ShHandle handle, char* infoLog);
+COMPILER_EXPORT void ShGetInfoLog(const ShHandle handle, char* infoLog);
// Returns null-terminated object code for a compiled shader.
// Parameters:
@@ -221,7 +249,7 @@ void ShGetInfoLog(const ShHandle handle, char* infoLog);
// accomodate the object code. The size of the buffer required to
// store the returned object code can be obtained by calling
// ShGetInfo with SH_OBJECT_CODE_LENGTH.
-void ShGetObjectCode(const ShHandle handle, char* objCode);
+COMPILER_EXPORT void ShGetObjectCode(const ShHandle handle, char* objCode);
// Returns information about an active attribute variable.
// Parameters:
@@ -242,13 +270,13 @@ void ShGetObjectCode(const ShHandle handle, char* objCode);
// memory (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care
// about the mapped name. If the name is not mapped, then name and
// mappedName are the same.
-void ShGetActiveAttrib(const ShHandle handle,
- int index,
- int* length,
- int* size,
- ShDataType* type,
- char* name,
- char* mappedName);
+COMPILER_EXPORT void ShGetActiveAttrib(const ShHandle handle,
+ int index,
+ int* length,
+ int* size,
+ ShDataType* type,
+ char* name,
+ char* mappedName);
// Returns information about an active uniform variable.
// Parameters:
@@ -269,13 +297,13 @@ void ShGetActiveAttrib(const ShHandle handle,
// memory (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care
// about the mapped name. If the name is not mapped, then name and
// mappedName are the same.
-void ShGetActiveUniform(const ShHandle handle,
- int index,
- int* length,
- int* size,
- ShDataType* type,
- char* name,
- char* mappedName);
+COMPILER_EXPORT void ShGetActiveUniform(const ShHandle handle,
+ int index,
+ int* length,
+ int* size,
+ ShDataType* type,
+ char* name,
+ char* mappedName);
#ifdef __cplusplus
}
diff --git a/Source/ThirdParty/ANGLE/src/common/debug.cpp b/Source/ThirdParty/ANGLE/src/common/debug.cpp
index 4dd7327e7..81a183e8f 100644
--- a/Source/ThirdParty/ANGLE/src/common/debug.cpp
+++ b/Source/ThirdParty/ANGLE/src/common/debug.cpp
@@ -1,97 +1,103 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// debug.cpp: Debugging utilities.
-
-#include "common/debug.h"
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <d3d9.h>
-#include <windows.h>
-
-namespace gl
-{
-
-typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);
-
-static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
-{
-#if !defined(ANGLE_DISABLE_PERF)
- if (perfActive())
- {
- char message[4096];
- int len = vsprintf_s(message, format, vararg);
- if (len < 0)
- {
- return;
- }
-
- // There are no ASCII variants of these D3DPERF functions.
- wchar_t wideMessage[4096];
- for (int i = 0; i < len; ++i)
- {
- wideMessage[i] = message[i];
- }
- wideMessage[len] = 0;
-
- perfFunc(0, wideMessage);
- }
-#endif
-
-#if !defined(ANGLE_DISABLE_TRACE)
-#if defined(NDEBUG)
- if (traceFileDebugOnly)
- {
- return;
- }
-#endif
-
- FILE* file = fopen(TRACE_OUTPUT_FILE, "a");
- if (file)
- {
- vfprintf(file, format, vararg);
- fclose(file);
- }
-#endif
-}
-
-void trace(bool traceFileDebugOnly, const char *format, ...)
-{
- va_list vararg;
- va_start(vararg, format);
- output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg);
- va_end(vararg);
-}
-
-bool perfActive()
-{
-#if defined(ANGLE_DISABLE_PERF)
- return false;
-#else
- static bool active = D3DPERF_GetStatus() != 0;
- return active;
-#endif
-}
-
-ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
-{
- va_list vararg;
- va_start(vararg, format);
- output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg);
- va_end(vararg);
-}
-
-ScopedPerfEventHelper::~ScopedPerfEventHelper()
-{
-#if !defined(ANGLE_DISABLE_PERF)
- if (perfActive())
- {
- D3DPERF_EndEvent();
- }
-#endif
-}
-}
+//
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+// debug.cpp: Debugging utilities.
+
+#include "common/debug.h"
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <d3d9.h>
+#include <windows.h>
+
+namespace gl
+{
+
+typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);
+
+static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
+{
+#if !defined(ANGLE_DISABLE_PERF)
+ if (perfActive())
+ {
+ char message[4096];
+ int len = vsprintf_s(message, format, vararg);
+ if (len < 0)
+ {
+ return;
+ }
+
+ // There are no ASCII variants of these D3DPERF functions.
+ wchar_t wideMessage[4096];
+ for (int i = 0; i < len; ++i)
+ {
+ wideMessage[i] = message[i];
+ }
+ wideMessage[len] = 0;
+
+ perfFunc(0, wideMessage);
+ }
+#endif
+
+#if !defined(ANGLE_DISABLE_TRACE)
+#if defined(NDEBUG)
+ if (traceFileDebugOnly)
+ {
+ return;
+ }
+#endif
+
+ FILE* file = fopen(TRACE_OUTPUT_FILE, "a");
+ if (file)
+ {
+ vfprintf(file, format, vararg);
+ fclose(file);
+ }
+#endif
+}
+
+void trace(bool traceFileDebugOnly, const char *format, ...)
+{
+ va_list vararg;
+ va_start(vararg, format);
+#if defined(ANGLE_DISABLE_PERF)
+ output(traceFileDebugOnly, NULL, format, vararg);
+#else
+ output(traceFileDebugOnly, D3DPERF_SetMarker, format, vararg);
+#endif
+ va_end(vararg);
+}
+
+bool perfActive()
+{
+#if defined(ANGLE_DISABLE_PERF)
+ return false;
+#else
+ static bool active = D3DPERF_GetStatus() != 0;
+ return active;
+#endif
+}
+
+ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
+{
+#if !defined(ANGLE_DISABLE_PERF)
+ va_list vararg;
+ va_start(vararg, format);
+ output(true, reinterpret_cast<PerfOutputFunction>(D3DPERF_BeginEvent), format, vararg);
+ va_end(vararg);
+#endif
+}
+
+ScopedPerfEventHelper::~ScopedPerfEventHelper()
+{
+#if !defined(ANGLE_DISABLE_PERF)
+ if (perfActive())
+ {
+ D3DPERF_EndEvent();
+ }
+#endif
+}
+}
diff --git a/Source/ThirdParty/ANGLE/src/common/version.h b/Source/ThirdParty/ANGLE/src/common/version.h
index 4763332e7..0f92c2c2c 100644
--- a/Source/ThirdParty/ANGLE/src/common/version.h
+++ b/Source/ThirdParty/ANGLE/src/common/version.h
@@ -1,7 +1,7 @@
-#define MAJOR_VERSION 0
+#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
-#define BUILD_REVISION 696
+#define BUILD_REVISION 939
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
diff --git a/Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h b/Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h
index 9f4a86020..55b1f9a15 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h
@@ -42,6 +42,8 @@ enum TBasicType
EbtGuardSamplerBegin, // non type: see implementation of IsSampler()
EbtSampler2D,
EbtSamplerCube,
+ EbtSamplerExternalOES, // Only valid if OES_EGL_image_external exists.
+ EbtSampler2DRect, // Only valid if GL_ARB_texture_rectangle exists.
EbtGuardSamplerEnd, // non type: see implementation of IsSampler()
EbtStruct,
EbtAddress, // should be deprecated??
@@ -57,6 +59,8 @@ inline const char* getBasicString(TBasicType t)
case EbtBool: return "bool"; break;
case EbtSampler2D: return "sampler2D"; break;
case EbtSamplerCube: return "samplerCube"; break;
+ case EbtSamplerExternalOES: return "samplerExternalOES"; break;
+ case EbtSampler2DRect: return "sampler2DRect"; break;
case EbtStruct: return "structure"; break;
default: return "unknown type";
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp b/Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp
new file mode 100644
index 000000000..a7950b990
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp
@@ -0,0 +1,435 @@
+//
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/BuiltInFunctionEmulator.h"
+
+#include "compiler/SymbolTable.h"
+
+namespace {
+
+// we use macros here instead of function definitions to work around more GLSL
+// compiler bugs, in particular on NVIDIA hardware on Mac OSX. Macros are
+// problematic because if the argument has side-effects they will be repeatedly
+// evaluated. This is unlikely to show up in real shaders, but is something to
+// consider.
+const char* kFunctionEmulationVertexSource[] = {
+ "#error no emulation for atan(float, float)",
+ "vec2 webgl_atan_emu(vec2 y, vec2 x) { return vec2(atan(y[0], x[0]), atan(y[1], x[1])); }",
+ "vec3 webgl_atan_emu(vec3 y, vec3 x) { return vec3(atan(y[0], x[0]), atan(y[1], x[1]), atan(y[2], x[2])); }",
+ "vec4 webgl_atan_emu(vec4 y, vec4 x) { return vec4(atan(y[0], x[0]), atan(y[1], x[1]), atan(y[2], x[2]), atan(y[3], x[3])); }",
+
+ "#error no emulation for cos(float)",
+ "#error no emulation for cos(vec2)",
+ "#error no emulation for cos(vec3)",
+ "#error no emulation for cos(vec4)",
+
+ "#define webgl_distance_emu(x, y) ((x) >= (y) ? (x) - (y) : (y) - (x))",
+ "#error no emulation for distance(vec2, vec2)",
+ "#error no emulation for distance(vec3, vec3)",
+ "#error no emulation for distance(vec4, vec4)",
+
+ "#define webgl_dot_emu(x, y) ((x) * (y))",
+ "#error no emulation for dot(vec2, vec2)",
+ "#error no emulation for dot(vec3, vec3)",
+ "#error no emulation for dot(vec4, vec4)",
+
+ "#define webgl_length_emu(x) ((x) >= 0.0 ? (x) : -(x))",
+ "#error no emulation for length(vec2)",
+ "#error no emulation for length(vec3)",
+ "#error no emulation for length(vec4)",
+
+ "#error no emulation for mod(float, float)",
+ "vec2 webgl_mod_emu(vec2 x, vec2 y) { return vec2(mod(x[0], y[0]), mod(x[1], y[1])); }",
+ "vec3 webgl_mod_emu(vec3 x, vec3 y) { return vec3(mod(x[0], y[0]), mod(x[1], y[1]), mod(x[2], y[2])); }",
+ "vec4 webgl_mod_emu(vec4 x, vec4 y) { return vec4(mod(x[0], y[0]), mod(x[1], y[1]), mod(x[2], y[2]), mod(x[3], y[3])); }",
+
+ "#define webgl_normalize_emu(x) ((x) == 0.0 ? 0.0 : ((x) > 0.0 ? 1.0 : -1.0))",
+ "#error no emulation for normalize(vec2)",
+ "#error no emulation for normalize(vec3)",
+ "#error no emulation for normalize(vec4)",
+
+ "#define webgl_reflect_emu(I, N) ((I) - 2.0 * (N) * (I) * (N))",
+ "#error no emulation for reflect(vec2, vec2)",
+ "#error no emulation for reflect(vec3, vec3)",
+ "#error no emulation for reflect(vec4, vec4)"
+};
+
+const char* kFunctionEmulationFragmentSource[] = {
+ "#error no emulation for atan(float, float)",
+ "#error no emulation for atan(vec2, vec2)",
+ "#error no emulation for atan(vec3, vec3)",
+ "#error no emulation for atan(vec4, vec4)",
+
+ "webgl_emu_precision float webgl_cos_emu(webgl_emu_precision float a) { return cos(a); }",
+ "webgl_emu_precision vec2 webgl_cos_emu(webgl_emu_precision vec2 a) { return cos(a); }",
+ "webgl_emu_precision vec3 webgl_cos_emu(webgl_emu_precision vec3 a) { return cos(a); }",
+ "webgl_emu_precision vec4 webgl_cos_emu(webgl_emu_precision vec4 a) { return cos(a); }",
+
+ "#error no emulation for distance(float, float)",
+ "#error no emulation for distance(vec2, vec2)",
+ "#error no emulation for distance(vec3, vec3)",
+ "#error no emulation for distance(vec4, vec4)",
+
+ "#error no emulation for dot(float, float)",
+ "#error no emulation for dot(vec2, vec2)",
+ "#error no emulation for dot(vec3, vec3)",
+ "#error no emulation for dot(vec4, vec4)",
+
+ "#error no emulation for length(float)",
+ "#error no emulation for length(vec2)",
+ "#error no emulation for length(vec3)",
+ "#error no emulation for length(vec4)",
+
+ "#error no emulation for mod(float, float)",
+ "#error no emulation for mod(vec2, vec2)",
+ "#error no emulation for mod(vec3, vec3)",
+ "#error no emulation for mod(vec4, vec4)",
+
+ "#error no emulation for normalize(float)",
+ "#error no emulation for normalize(vec2)",
+ "#error no emulation for normalize(vec3)",
+ "#error no emulation for normalize(vec4)",
+
+ "#error no emulation for reflect(float, float)",
+ "#error no emulation for reflect(vec2, vec2)",
+ "#error no emulation for reflect(vec3, vec3)",
+ "#error no emulation for reflect(vec4, vec4)"
+};
+
+const bool kFunctionEmulationVertexMask[] = {
+#if defined(__APPLE__)
+ // Work around ATI driver bugs in Mac.
+ false, // TFunctionAtan1_1
+ false, // TFunctionAtan2_2
+ false, // TFunctionAtan3_3
+ false, // TFunctionAtan4_4
+ false, // TFunctionCos1
+ false, // TFunctionCos2
+ false, // TFunctionCos3
+ false, // TFunctionCos4
+ true, // TFunctionDistance1_1
+ false, // TFunctionDistance2_2
+ false, // TFunctionDistance3_3
+ false, // TFunctionDistance4_4
+ true, // TFunctionDot1_1
+ false, // TFunctionDot2_2
+ false, // TFunctionDot3_3
+ false, // TFunctionDot4_4
+ true, // TFunctionLength1
+ false, // TFunctionLength2
+ false, // TFunctionLength3
+ false, // TFunctionLength4
+ false, // TFunctionMod1_1
+ false, // TFunctionMod2_2
+ false, // TFunctionMod3_3
+ false, // TFunctionMod4_4
+ true, // TFunctionNormalize1
+ false, // TFunctionNormalize2
+ false, // TFunctionNormalize3
+ false, // TFunctionNormalize4
+ true, // TFunctionReflect1_1
+ false, // TFunctionReflect2_2
+ false, // TFunctionReflect3_3
+ false, // TFunctionReflect4_4
+#else
+ // Work around D3D driver bug in Win.
+ false, // TFunctionAtan1_1
+ true, // TFunctionAtan2_2
+ true, // TFunctionAtan3_3
+ true, // TFunctionAtan4_4
+ false, // TFunctionCos1
+ false, // TFunctionCos2
+ false, // TFunctionCos3
+ false, // TFunctionCos4
+ false, // TFunctionDistance1_1
+ false, // TFunctionDistance2_2
+ false, // TFunctionDistance3_3
+ false, // TFunctionDistance4_4
+ false, // TFunctionDot1_1
+ false, // TFunctionDot2_2
+ false, // TFunctionDot3_3
+ false, // TFunctionDot4_4
+ false, // TFunctionLength1
+ false, // TFunctionLength2
+ false, // TFunctionLength3
+ false, // TFunctionLength4
+ false, // TFunctionMod1_1
+ true, // TFunctionMod2_2
+ true, // TFunctionMod3_3
+ true, // TFunctionMod4_4
+ false, // TFunctionNormalize1
+ false, // TFunctionNormalize2
+ false, // TFunctionNormalize3
+ false, // TFunctionNormalize4
+ false, // TFunctionReflect1_1
+ false, // TFunctionReflect2_2
+ false, // TFunctionReflect3_3
+ false, // TFunctionReflect4_4
+#endif
+ false // TFunctionUnknown
+};
+
+const bool kFunctionEmulationFragmentMask[] = {
+ false, // TFunctionAtan1_1
+ false, // TFunctionAtan2_2
+ false, // TFunctionAtan3_3
+ false, // TFunctionAtan4_4
+#if defined(__APPLE__)
+ // Work around a ATI driver bug in Mac that causes crashes.
+ true, // TFunctionCos1
+ true, // TFunctionCos2
+ true, // TFunctionCos3
+ true, // TFunctionCos4
+#else
+ false, // TFunctionCos1
+ false, // TFunctionCos2
+ false, // TFunctionCos3
+ false, // TFunctionCos4
+#endif
+ false, // TFunctionDistance1_1
+ false, // TFunctionDistance2_2
+ false, // TFunctionDistance3_3
+ false, // TFunctionDistance4_4
+ false, // TFunctionDot1_1
+ false, // TFunctionDot2_2
+ false, // TFunctionDot3_3
+ false, // TFunctionDot4_4
+ false, // TFunctionLength1
+ false, // TFunctionLength2
+ false, // TFunctionLength3
+ false, // TFunctionLength4
+ false, // TFunctionMod1_1
+ false, // TFunctionMod2_2
+ false, // TFunctionMod3_3
+ false, // TFunctionMod4_4
+ false, // TFunctionNormalize1
+ false, // TFunctionNormalize2
+ false, // TFunctionNormalize3
+ false, // TFunctionNormalize4
+ false, // TFunctionReflect1_1
+ false, // TFunctionReflect2_2
+ false, // TFunctionReflect3_3
+ false, // TFunctionReflect4_4
+ false // TFunctionUnknown
+};
+
+class BuiltInFunctionEmulationMarker : public TIntermTraverser {
+public:
+ BuiltInFunctionEmulationMarker(BuiltInFunctionEmulator& emulator)
+ : mEmulator(emulator)
+ {
+ }
+
+ virtual bool visitUnary(Visit visit, TIntermUnary* node)
+ {
+ if (visit == PreVisit) {
+ bool needToEmulate = mEmulator.SetFunctionCalled(
+ node->getOp(), node->getOperand()->getType());
+ if (needToEmulate)
+ node->setUseEmulatedFunction();
+ }
+ return true;
+ }
+
+ virtual bool visitAggregate(Visit visit, TIntermAggregate* node)
+ {
+ if (visit == PreVisit) {
+ // Here we handle all the built-in functions instead of the ones we
+ // currently identified as problematic.
+ switch (node->getOp()) {
+ case EOpLessThan:
+ case EOpGreaterThan:
+ case EOpLessThanEqual:
+ case EOpGreaterThanEqual:
+ case EOpVectorEqual:
+ case EOpVectorNotEqual:
+ case EOpMod:
+ case EOpPow:
+ case EOpAtan:
+ case EOpMin:
+ case EOpMax:
+ case EOpClamp:
+ case EOpMix:
+ case EOpStep:
+ case EOpSmoothStep:
+ case EOpDistance:
+ case EOpDot:
+ case EOpCross:
+ case EOpFaceForward:
+ case EOpReflect:
+ case EOpRefract:
+ case EOpMul:
+ break;
+ default:
+ return true;
+ };
+ const TIntermSequence& sequence = node->getSequence();
+ // Right now we only handle built-in functions with two parameters.
+ if (sequence.size() != 2)
+ return true;
+ TIntermTyped* param1 = sequence[0]->getAsTyped();
+ TIntermTyped* param2 = sequence[1]->getAsTyped();
+ if (!param1 || !param2)
+ return true;
+ bool needToEmulate = mEmulator.SetFunctionCalled(
+ node->getOp(), param1->getType(), param2->getType());
+ if (needToEmulate)
+ node->setUseEmulatedFunction();
+ }
+ return true;
+ }
+
+private:
+ BuiltInFunctionEmulator& mEmulator;
+};
+
+} // anonymous namepsace
+
+BuiltInFunctionEmulator::BuiltInFunctionEmulator(ShShaderType shaderType)
+{
+ if (shaderType == SH_FRAGMENT_SHADER) {
+ mFunctionMask = kFunctionEmulationFragmentMask;
+ mFunctionSource = kFunctionEmulationFragmentSource;
+ } else {
+ mFunctionMask = kFunctionEmulationVertexMask;
+ mFunctionSource = kFunctionEmulationVertexSource;
+ }
+}
+
+bool BuiltInFunctionEmulator::SetFunctionCalled(
+ TOperator op, const TType& param)
+{
+ TBuiltInFunction function = IdentifyFunction(op, param);
+ return SetFunctionCalled(function);
+}
+
+bool BuiltInFunctionEmulator::SetFunctionCalled(
+ TOperator op, const TType& param1, const TType& param2)
+{
+ TBuiltInFunction function = IdentifyFunction(op, param1, param2);
+ return SetFunctionCalled(function);
+}
+
+bool BuiltInFunctionEmulator::SetFunctionCalled(
+ BuiltInFunctionEmulator::TBuiltInFunction function) {
+ if (function == TFunctionUnknown || mFunctionMask[function] == false)
+ return false;
+ for (size_t i = 0; i < mFunctions.size(); ++i) {
+ if (mFunctions[i] == function)
+ return true;
+ }
+ mFunctions.push_back(function);
+ return true;
+}
+
+void BuiltInFunctionEmulator::OutputEmulatedFunctionDefinition(
+ TInfoSinkBase& out, bool withPrecision) const
+{
+ if (mFunctions.size() == 0)
+ return;
+ out << "// BEGIN: Generated code for built-in function emulation\n\n";
+ if (withPrecision) {
+ out << "#if defined(GL_FRAGMENT_PRECISION_HIGH)\n"
+ << "#define webgl_emu_precision highp\n"
+ << "#else\n"
+ << "#define webgl_emu_precision mediump\n"
+ << "#endif\n\n";
+ } else {
+ out << "#define webgl_emu_precision\n\n";
+ }
+ for (size_t i = 0; i < mFunctions.size(); ++i) {
+ out << mFunctionSource[mFunctions[i]] << "\n\n";
+ }
+ out << "// END: Generated code for built-in function emulation\n\n";
+}
+
+BuiltInFunctionEmulator::TBuiltInFunction
+BuiltInFunctionEmulator::IdentifyFunction(
+ TOperator op, const TType& param)
+{
+ if (param.getNominalSize() > 4)
+ return TFunctionUnknown;
+ unsigned int function = TFunctionUnknown;
+ switch (op) {
+ case EOpCos:
+ function = TFunctionCos1;
+ break;
+ case EOpLength:
+ function = TFunctionLength1;
+ break;
+ case EOpNormalize:
+ function = TFunctionNormalize1;
+ break;
+ default:
+ break;
+ }
+ if (function == TFunctionUnknown)
+ return TFunctionUnknown;
+ if (param.isVector())
+ function += param.getNominalSize() - 1;
+ return static_cast<TBuiltInFunction>(function);
+}
+
+BuiltInFunctionEmulator::TBuiltInFunction
+BuiltInFunctionEmulator::IdentifyFunction(
+ TOperator op, const TType& param1, const TType& param2)
+{
+ // Right now for all the emulated functions with two parameters, the two
+ // parameters have the same type.
+ if (param1.isVector() != param2.isVector() ||
+ param1.getNominalSize() != param2.getNominalSize() ||
+ param1.getNominalSize() > 4)
+ return TFunctionUnknown;
+
+ unsigned int function = TFunctionUnknown;
+ switch (op) {
+ case EOpAtan:
+ function = TFunctionAtan1_1;
+ break;
+ case EOpDistance:
+ function = TFunctionDistance1_1;
+ break;
+ case EOpDot:
+ function = TFunctionDot1_1;
+ break;
+ case EOpMod:
+ function = TFunctionMod1_1;
+ break;
+ case EOpReflect:
+ function = TFunctionReflect1_1;
+ break;
+ default:
+ break;
+ }
+ if (function == TFunctionUnknown)
+ return TFunctionUnknown;
+ if (param1.isVector())
+ function += param1.getNominalSize() - 1;
+ return static_cast<TBuiltInFunction>(function);
+}
+
+void BuiltInFunctionEmulator::MarkBuiltInFunctionsForEmulation(
+ TIntermNode* root)
+{
+ ASSERT(root);
+
+ BuiltInFunctionEmulationMarker marker(*this);
+ root->traverse(&marker);
+}
+
+void BuiltInFunctionEmulator::Cleanup()
+{
+ mFunctions.clear();
+}
+
+//static
+TString BuiltInFunctionEmulator::GetEmulatedFunctionName(
+ const TString& name)
+{
+ ASSERT(name[name.length() - 1] == '(');
+ return "webgl_" + name.substr(0, name.length() - 1) + "_emu(";
+}
+
diff --git a/Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h b/Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h
new file mode 100644
index 000000000..b37b66535
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h
@@ -0,0 +1,103 @@
+//
+// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILIER_BUILT_IN_FUNCTION_EMULATOR_H_
+#define COMPILIER_BUILT_IN_FUNCTION_EMULATOR_H_
+
+#include "GLSLANG/ShaderLang.h"
+
+#include "compiler/InfoSink.h"
+#include "compiler/intermediate.h"
+
+//
+// This class decides which built-in functions need to be replaced with the
+// emulated ones.
+// It's only a workaround for OpenGL driver bugs, and isn't needed in general.
+//
+class BuiltInFunctionEmulator {
+public:
+ BuiltInFunctionEmulator(ShShaderType shaderType);
+ // Records that a function is called by the shader and might needs to be
+ // emulated. If the function's group is not in mFunctionGroupFilter, this
+ // becomes an no-op.
+ // Returns true if the function call needs to be replaced with an emulated
+ // one.
+ bool SetFunctionCalled(TOperator op, const TType& param);
+ bool SetFunctionCalled(
+ TOperator op, const TType& param1, const TType& param2);
+
+ // Output function emulation definition. This should be before any other
+ // shader source.
+ void OutputEmulatedFunctionDefinition(TInfoSinkBase& out, bool withPrecision) const;
+
+ void MarkBuiltInFunctionsForEmulation(TIntermNode* root);
+
+ void Cleanup();
+
+ // "name(" becomes "webgl_name_emu(".
+ static TString GetEmulatedFunctionName(const TString& name);
+
+private:
+ //
+ // Built-in functions.
+ //
+ enum TBuiltInFunction {
+ TFunctionAtan1_1 = 0, // float atan(float, float);
+ TFunctionAtan2_2, // vec2 atan(vec2, vec2);
+ TFunctionAtan3_3, // vec3 atan(vec3, vec2);
+ TFunctionAtan4_4, // vec4 atan(vec4, vec2);
+
+ TFunctionCos1, // float cos(float);
+ TFunctionCos2, // vec2 cos(vec2);
+ TFunctionCos3, // vec3 cos(vec3);
+ TFunctionCos4, // vec4 cos(vec4);
+
+ TFunctionDistance1_1, // float distance(float, float);
+ TFunctionDistance2_2, // vec2 distance(vec2, vec2);
+ TFunctionDistance3_3, // vec3 distance(vec3, vec3);
+ TFunctionDistance4_4, // vec4 distance(vec4, vec4);
+
+ TFunctionDot1_1, // float dot(float, float);
+ TFunctionDot2_2, // vec2 dot(vec2, vec2);
+ TFunctionDot3_3, // vec3 dot(vec3, vec3);
+ TFunctionDot4_4, // vec4 dot(vec4, vec4);
+
+ TFunctionLength1, // float length(float);
+ TFunctionLength2, // float length(vec2);
+ TFunctionLength3, // float length(vec3);
+ TFunctionLength4, // float length(vec4);
+
+ TFunctionMod1_1, // float mod(float, float);
+ TFunctionMod2_2, // vec2 mod(vec2, vec2);
+ TFunctionMod3_3, // vec3 mod(vec3, vec3);
+ TFunctionMod4_4, // vec4 mod(vec4, vec4);
+
+ TFunctionNormalize1, // float normalize(float);
+ TFunctionNormalize2, // vec2 normalize(vec2);
+ TFunctionNormalize3, // vec3 normalize(vec3);
+ TFunctionNormalize4, // vec4 normalize(vec4);
+
+ TFunctionReflect1_1, // float reflect(float, float);
+ TFunctionReflect2_2, // vec2 reflect(vec2, vec2);
+ TFunctionReflect3_3, // vec3 reflect(vec3, vec3);
+ TFunctionReflect4_4, // vec4 reflect(vec4, vec4);
+
+ TFunctionUnknown
+ };
+
+ TBuiltInFunction IdentifyFunction(TOperator op, const TType& param);
+ TBuiltInFunction IdentifyFunction(
+ TOperator op, const TType& param1, const TType& param2);
+
+ bool SetFunctionCalled(TBuiltInFunction function);
+
+ std::vector<TBuiltInFunction> mFunctions;
+
+ const bool* mFunctionMask; // a boolean flag for each function.
+ const char** mFunctionSource;
+};
+
+#endif // COMPILIER_BUILT_IN_FUNCTION_EMULATOR_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp b/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
index 5d86a3ec0..22764bdcf 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp
@@ -1,9 +1,12 @@
//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
+#include "compiler/BuiltInFunctionEmulator.h"
+#include "compiler/DetectRecursion.h"
+#include "compiler/ForLoopUnroll.h"
#include "compiler/Initialize.h"
#include "compiler/ParseHelper.h"
#include "compiler/ShHandle.h"
@@ -18,6 +21,7 @@ bool InitializeSymbolTable(
{
TIntermediate intermediate(infoSink);
TExtensionBehavior extBehavior;
+ InitExtensionBehavior(resources, extBehavior);
// The builtins deliberately don't specify precisions for the function
// arguments and return types. For that reason we don't try to check them.
TParseContext parseContext(symbolTable, extBehavior, intermediate, type, spec, 0, false, NULL, infoSink);
@@ -84,7 +88,8 @@ TShHandleBase::~TShHandleBase() {
TCompiler::TCompiler(ShShaderType type, ShShaderSpec spec)
: shaderType(type),
- shaderSpec(spec)
+ shaderSpec(spec),
+ builtInFunctionEmulator(type)
{
}
@@ -147,13 +152,24 @@ bool TCompiler::compile(const char* const shaderStrings[],
TIntermNode* root = parseContext.treeRoot;
success = intermediate.postProcess(root);
+ if (success)
+ success = detectRecursion(root);
+
if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING))
success = validateLimitations(root);
+ // Unroll for-loop markup needs to happen after validateLimitations pass.
+ if (success && (compileOptions & SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX))
+ ForLoopUnroll::MarkForLoopsWithIntegerIndicesForUnrolling(root);
+
+ // Built-in function emulation needs to happen after validateLimitations pass.
+ if (success && (compileOptions & SH_EMULATE_BUILT_IN_FUNCTIONS))
+ builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(root);
+
// Call mapLongVariableNames() before collectAttribsUniforms() so in
// collectAttribsUniforms() we already have the mapped symbol names and
// we could composite mapped and original variable names.
- if (compileOptions & SH_MAP_LONG_VARIABLE_NAMES)
+ if (success && (compileOptions & SH_MAP_LONG_VARIABLE_NAMES))
mapLongVariableNames(root);
if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS))
@@ -193,6 +209,27 @@ void TCompiler::clearResults()
attribs.clear();
uniforms.clear();
+
+ builtInFunctionEmulator.Cleanup();
+}
+
+bool TCompiler::detectRecursion(TIntermNode* root)
+{
+ DetectRecursion detect;
+ root->traverse(&detect);
+ switch (detect.detectRecursion()) {
+ case DetectRecursion::kErrorNone:
+ return true;
+ case DetectRecursion::kErrorMissingMain:
+ infoSink.info.message(EPrefixError, "Missing main()");
+ return false;
+ case DetectRecursion::kErrorRecursion:
+ infoSink.info.message(EPrefixError, "Function recursion detected");
+ return false;
+ default:
+ UNREACHABLE();
+ return false;
+ }
}
bool TCompiler::validateLimitations(TIntermNode* root) {
@@ -215,10 +252,15 @@ void TCompiler::mapLongVariableNames(TIntermNode* root)
int TCompiler::getMappedNameMaxLength() const
{
- return MAX_IDENTIFIER_NAME_SIZE + 1;
+ return MAX_SHORTENED_IDENTIFIER_SIZE + 1;
}
const TExtensionBehavior& TCompiler::getExtensionBehavior() const
{
return extensionBehavior;
}
+
+const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
+{
+ return builtInFunctionEmulator;
+}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.cpp b/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.cpp
new file mode 100644
index 000000000..c09780dd9
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.cpp
@@ -0,0 +1,125 @@
+//
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/DetectRecursion.h"
+
+DetectRecursion::FunctionNode::FunctionNode(const TString& fname)
+ : name(fname),
+ visit(PreVisit)
+{
+}
+
+const TString& DetectRecursion::FunctionNode::getName() const
+{
+ return name;
+}
+
+void DetectRecursion::FunctionNode::addCallee(
+ DetectRecursion::FunctionNode* callee)
+{
+ for (size_t i = 0; i < callees.size(); ++i) {
+ if (callees[i] == callee)
+ return;
+ }
+ callees.push_back(callee);
+}
+
+bool DetectRecursion::FunctionNode::detectRecursion()
+{
+ ASSERT(visit == PreVisit);
+ visit = InVisit;
+ for (size_t i = 0; i < callees.size(); ++i) {
+ switch (callees[i]->visit) {
+ case InVisit:
+ // cycle detected, i.e., recursion detected.
+ return true;
+ case PostVisit:
+ break;
+ case PreVisit: {
+ bool recursion = callees[i]->detectRecursion();
+ if (recursion)
+ return true;
+ break;
+ }
+ default:
+ UNREACHABLE();
+ break;
+ }
+ }
+ visit = PostVisit;
+ return false;
+}
+
+DetectRecursion::DetectRecursion()
+ : currentFunction(NULL)
+{
+}
+
+DetectRecursion::~DetectRecursion()
+{
+ for (size_t i = 0; i < functions.size(); ++i)
+ delete functions[i];
+}
+
+bool DetectRecursion::visitAggregate(Visit visit, TIntermAggregate* node)
+{
+ switch (node->getOp())
+ {
+ case EOpPrototype:
+ // Function declaration.
+ // Don't add FunctionNode here because node->getName() is the
+ // unmangled function name.
+ break;
+ case EOpFunction: {
+ // Function definition.
+ if (visit == PreVisit) {
+ currentFunction = findFunctionByName(node->getName());
+ if (currentFunction == NULL) {
+ currentFunction = new FunctionNode(node->getName());
+ functions.push_back(currentFunction);
+ }
+ }
+ break;
+ }
+ case EOpFunctionCall: {
+ // Function call.
+ if (visit == PreVisit) {
+ ASSERT(currentFunction != NULL);
+ FunctionNode* func = findFunctionByName(node->getName());
+ if (func == NULL) {
+ func = new FunctionNode(node->getName());
+ functions.push_back(func);
+ }
+ currentFunction->addCallee(func);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ return true;
+}
+
+DetectRecursion::ErrorCode DetectRecursion::detectRecursion()
+{
+ FunctionNode* main = findFunctionByName("main(");
+ if (main == NULL)
+ return kErrorMissingMain;
+ if (main->detectRecursion())
+ return kErrorRecursion;
+ return kErrorNone;
+}
+
+DetectRecursion::FunctionNode* DetectRecursion::findFunctionByName(
+ const TString& name)
+{
+ for (size_t i = 0; i < functions.size(); ++i) {
+ if (functions[i]->getName() == name)
+ return functions[i];
+ }
+ return NULL;
+}
+
diff --git a/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h b/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h
new file mode 100644
index 000000000..bbac79dc9
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h
@@ -0,0 +1,60 @@
+//
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_DETECT_RECURSION_H_
+#define COMPILER_DETECT_RECURSION_H_
+
+#include "GLSLANG/ShaderLang.h"
+
+#include "compiler/intermediate.h"
+#include "compiler/VariableInfo.h"
+
+// Traverses intermediate tree to detect function recursion.
+class DetectRecursion : public TIntermTraverser {
+public:
+ enum ErrorCode {
+ kErrorMissingMain,
+ kErrorRecursion,
+ kErrorNone
+ };
+
+ DetectRecursion();
+ ~DetectRecursion();
+
+ virtual bool visitAggregate(Visit, TIntermAggregate*);
+
+ ErrorCode detectRecursion();
+
+private:
+ class FunctionNode {
+ public:
+ FunctionNode(const TString& fname);
+
+ const TString& getName() const;
+
+ // If a function is already in the callee list, this becomes a no-op.
+ void addCallee(FunctionNode* callee);
+
+ // Return true if recursive function calls are detected.
+ bool detectRecursion();
+
+ private:
+ // mangled function name is unique.
+ TString name;
+
+ // functions that are directly called by this function.
+ TVector<FunctionNode*> callees;
+
+ Visit visit;
+ };
+
+ FunctionNode* findFunctionByName(const TString& name);
+
+ TVector<FunctionNode*> functions;
+ FunctionNode* currentFunction;
+};
+
+#endif // COMPILER_DETECT_RECURSION_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h b/Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h
index ab5a0a53b..e9bba4b23 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h
@@ -13,7 +13,8 @@ typedef enum {
EBhRequire,
EBhEnable,
EBhWarn,
- EBhDisable
+ EBhDisable,
+ EBhUndefined,
} TBehavior;
inline const char* getBehaviorString(TBehavior b)
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp b/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp
index d631af44f..fdc3f4443 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp
@@ -6,6 +6,39 @@
#include "compiler/ForLoopUnroll.h"
+namespace {
+
+class IntegerForLoopUnrollMarker : public TIntermTraverser {
+public:
+
+ virtual bool visitLoop(Visit, TIntermLoop* node)
+ {
+ // This is called after ValidateLimitations pass, so all the ASSERT
+ // should never fail.
+ // See ValidateLimitations::validateForLoopInit().
+ ASSERT(node);
+ ASSERT(node->getType() == ELoopFor);
+ ASSERT(node->getInit());
+ TIntermAggregate* decl = node->getInit()->getAsAggregate();
+ ASSERT(decl && decl->getOp() == EOpDeclaration);
+ TIntermSequence& declSeq = decl->getSequence();
+ ASSERT(declSeq.size() == 1);
+ TIntermBinary* declInit = declSeq[0]->getAsBinaryNode();
+ ASSERT(declInit && declInit->getOp() == EOpInitialize);
+ ASSERT(declInit->getLeft());
+ TIntermSymbol* symbol = declInit->getLeft()->getAsSymbolNode();
+ ASSERT(symbol);
+ TBasicType type = symbol->getBasicType();
+ ASSERT(type == EbtInt || type == EbtFloat);
+ if (type == EbtInt)
+ node->setUnrollFlag(true);
+ return true;
+ }
+
+};
+
+} // anonymous namepsace
+
void ForLoopUnroll::FillLoopIndexInfo(TIntermLoop* node, TLoopIndexInfo& info)
{
ASSERT(node->getType() == ELoopFor);
@@ -109,6 +142,16 @@ void ForLoopUnroll::Pop()
mLoopIndexStack.pop_back();
}
+// static
+void ForLoopUnroll::MarkForLoopsWithIntegerIndicesForUnrolling(
+ TIntermNode* root)
+{
+ ASSERT(root);
+
+ IntegerForLoopUnrollMarker marker;
+ root->traverse(&marker);
+}
+
int ForLoopUnroll::getLoopIncrement(TIntermLoop* node)
{
TIntermNode* expr = node->getExpression();
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.h b/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.h
index b2b2b58c1..e800e25b1 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.h
@@ -36,6 +36,8 @@ public:
void Push(TLoopIndexInfo& info);
void Pop();
+ static void MarkForLoopsWithIntegerIndicesForUnrolling(TIntermNode* root);
+
private:
int getLoopIncrement(TIntermLoop* node);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp b/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp
index 74a2de36e..f3a19dc13 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/Initialize.cpp
@@ -19,7 +19,7 @@
// Prototypes for built-in functions seen by both vertex and fragment shaders.
//
//============================================================================
-static TString BuiltInFunctionsCommon()
+static TString BuiltInFunctionsCommon(const ShBuiltInResources& resources)
{
TString s;
@@ -311,6 +311,26 @@ static TString BuiltInFunctionsCommon()
s.append(TString("bvec4 not(bvec4 x);"));
//
+ // Texture Functions.
+ //
+ s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);"));
+ s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);"));
+ s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);"));
+ s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);"));
+
+ if (resources.OES_EGL_image_external) {
+ s.append(TString("vec4 texture2D(samplerExternalOES sampler, vec2 coord);"));
+ s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);"));
+ s.append(TString("vec4 texture2DProj(samplerExternalOES sampler, vec4 coord);"));
+ }
+
+ if (resources.ARB_texture_rectangle) {
+ s.append(TString("vec4 texture2DRect(sampler2DRect sampler, vec2 coord);"));
+ s.append(TString("vec4 texture2DRectProj(sampler2DRect sampler, vec3 coord);"));
+ s.append(TString("vec4 texture2DRectProj(sampler2DRect sampler, vec4 coord);"));
+ }
+
+ //
// Noise functions.
//
//s.append(TString("float noise1(float x);"));
@@ -353,11 +373,6 @@ static TString BuiltInFunctionsVertex(const ShBuiltInResources& resources)
//
// Texture Functions.
//
- s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);"));
- s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);"));
-
s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);"));
s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);"));
s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);"));
@@ -378,11 +393,6 @@ static TString BuiltInFunctionsFragment(const ShBuiltInResources& resources)
//
// Texture Functions.
//
- s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);"));
- s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);"));
- s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);"));
-
s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord, float bias);"));
s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord, float bias);"));
s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias);"));
@@ -488,14 +498,14 @@ void TBuiltIns::initialize(ShShaderType type, ShShaderSpec spec,
switch (type) {
case SH_FRAGMENT_SHADER:
builtInStrings.push_back(DefaultPrecisionFragment());
- builtInStrings.push_back(BuiltInFunctionsCommon());
+ builtInStrings.push_back(BuiltInFunctionsCommon(resources));
builtInStrings.push_back(BuiltInFunctionsFragment(resources));
builtInStrings.push_back(StandardUniforms());
break;
case SH_VERTEX_SHADER:
builtInStrings.push_back(DefaultPrecisionVertex());
- builtInStrings.push_back(BuiltInFunctionsCommon());
+ builtInStrings.push_back(BuiltInFunctionsCommon(resources));
builtInStrings.push_back(BuiltInFunctionsVertex(resources));
builtInStrings.push_back(StandardUniforms());
break;
@@ -612,7 +622,7 @@ void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
switch(type) {
case SH_FRAGMENT_SHADER: {
// Set up gl_FragData. The array size.
- TType fragData(EbtFloat, EbpMedium, EvqFragColor, 4, false, true);
+ TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, false, true);
fragData.setArraySize(resources.MaxDrawBuffers);
symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData));
}
@@ -625,5 +635,9 @@ void InitExtensionBehavior(const ShBuiltInResources& resources,
TExtensionBehavior& extBehavior)
{
if (resources.OES_standard_derivatives)
- extBehavior["GL_OES_standard_derivatives"] = EBhDisable;
+ extBehavior["GL_OES_standard_derivatives"] = EBhUndefined;
+ if (resources.OES_EGL_image_external)
+ extBehavior["GL_OES_EGL_image_external"] = EBhUndefined;
+ if (resources.ARB_texture_rectangle)
+ extBehavior["GL_ARB_texture_rectangle"] = EBhUndefined;
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp b/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp
index c9b6a12b2..3c5d356da 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -10,20 +10,20 @@ namespace {
TString mapLongName(int id, const TString& name, bool isVarying)
{
- ASSERT(name.size() > MAX_IDENTIFIER_NAME_SIZE);
+ ASSERT(name.size() > MAX_SHORTENED_IDENTIFIER_SIZE);
TStringStream stream;
stream << "webgl_";
if (isVarying)
stream << "v";
stream << id << "_";
- stream << name.substr(0, MAX_IDENTIFIER_NAME_SIZE - stream.str().size());
+ stream << name.substr(0, MAX_SHORTENED_IDENTIFIER_SIZE - stream.str().size());
return stream.str();
}
} // anonymous namespace
MapLongVariableNames::MapLongVariableNames(
- TMap<TString, TString>& varyingLongNameMap)
+ std::map<std::string, std::string>& varyingLongNameMap)
: mVaryingLongNameMap(varyingLongNameMap)
{
}
@@ -31,12 +31,13 @@ MapLongVariableNames::MapLongVariableNames(
void MapLongVariableNames::visitSymbol(TIntermSymbol* symbol)
{
ASSERT(symbol != NULL);
- if (symbol->getSymbol().size() > MAX_IDENTIFIER_NAME_SIZE) {
+ if (symbol->getSymbol().size() > MAX_SHORTENED_IDENTIFIER_SIZE) {
switch (symbol->getQualifier()) {
case EvqVaryingIn:
case EvqVaryingOut:
case EvqInvariantVaryingIn:
case EvqInvariantVaryingOut:
+ case EvqUniform:
symbol->setSymbol(
mapVaryingLongName(symbol->getSymbol()));
break;
@@ -48,30 +49,6 @@ void MapLongVariableNames::visitSymbol(TIntermSymbol* symbol)
}
}
-void MapLongVariableNames::visitConstantUnion(TIntermConstantUnion*)
-{
-}
-
-bool MapLongVariableNames::visitBinary(Visit, TIntermBinary*)
-{
- return true;
-}
-
-bool MapLongVariableNames::visitUnary(Visit, TIntermUnary*)
-{
- return true;
-}
-
-bool MapLongVariableNames::visitSelection(Visit, TIntermSelection*)
-{
- return true;
-}
-
-bool MapLongVariableNames::visitAggregate(Visit, TIntermAggregate*)
-{
- return true;
-}
-
bool MapLongVariableNames::visitLoop(Visit, TIntermLoop* node)
{
if (node->getInit())
@@ -79,20 +56,15 @@ bool MapLongVariableNames::visitLoop(Visit, TIntermLoop* node)
return true;
}
-bool MapLongVariableNames::visitBranch(Visit, TIntermBranch*)
-{
- return true;
-}
-
TString MapLongVariableNames::mapVaryingLongName(const TString& name)
{
- TMap<TString, TString>::const_iterator it = mVaryingLongNameMap.find(name);
+ std::map<std::string, std::string>::const_iterator it = mVaryingLongNameMap.find(name.c_str());
if (it != mVaryingLongNameMap.end())
- return (*it).second;
+ return (*it).second.c_str();
int id = mVaryingLongNameMap.size();
TString mappedName = mapLongName(id, name, true);
mVaryingLongNameMap.insert(
- TMap<TString, TString>::value_type(name, mappedName));
+ std::map<std::string, std::string>::value_type(name.c_str(), mappedName.c_str()));
return mappedName;
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.h b/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.h
index 540909ea9..086f2b9e8 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/MapLongVariableNames.h
@@ -13,27 +13,21 @@
#include "compiler/VariableInfo.h"
// This size does not include '\0' in the end.
-#define MAX_IDENTIFIER_NAME_SIZE 32
+#define MAX_SHORTENED_IDENTIFIER_SIZE 32
// Traverses intermediate tree to map attributes and uniforms names that are
-// longer than MAX_IDENTIFIER_NAME_SIZE to MAX_IDENTIFIER_NAME_SIZE.
+// longer than MAX_SHORTENED_IDENTIFIER_SIZE to MAX_SHORTENED_IDENTIFIER_SIZE.
class MapLongVariableNames : public TIntermTraverser {
public:
- MapLongVariableNames(TMap<TString, TString>& varyingLongNameMap);
+ MapLongVariableNames(std::map<std::string, std::string>& varyingLongNameMap);
virtual void visitSymbol(TIntermSymbol*);
- virtual void visitConstantUnion(TIntermConstantUnion*);
- virtual bool visitBinary(Visit, TIntermBinary*);
- virtual bool visitUnary(Visit, TIntermUnary*);
- virtual bool visitSelection(Visit, TIntermSelection*);
- virtual bool visitAggregate(Visit, TIntermAggregate*);
virtual bool visitLoop(Visit, TIntermLoop*);
- virtual bool visitBranch(Visit, TIntermBranch*);
private:
TString mapVaryingLongName(const TString& name);
- TMap<TString, TString>& mVaryingLongNameMap;
+ std::map<std::string, std::string>& mVaryingLongNameMap;
};
#endif // COMPILER_MAP_LONG_VARIABLE_NAMES_H_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp b/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
index a0feb07eb..552fa5066 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/OutputGLSLBase.cpp
@@ -305,25 +305,28 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary* node)
bool TOutputGLSLBase::visitUnary(Visit visit, TIntermUnary* node)
{
+ TString preString;
+ TString postString = ")";
+
switch (node->getOp())
{
- case EOpNegative: writeTriplet(visit, "(-", NULL, ")"); break;
- case EOpVectorLogicalNot: writeTriplet(visit, "not(", NULL, ")"); break;
- case EOpLogicalNot: writeTriplet(visit, "(!", NULL, ")"); break;
+ case EOpNegative: preString = "(-"; break;
+ case EOpVectorLogicalNot: preString = "not("; break;
+ case EOpLogicalNot: preString = "(!"; break;
- case EOpPostIncrement: writeTriplet(visit, "(", NULL, "++)"); break;
- case EOpPostDecrement: writeTriplet(visit, "(", NULL, "--)"); break;
- case EOpPreIncrement: writeTriplet(visit, "(++", NULL, ")"); break;
- case EOpPreDecrement: writeTriplet(visit, "(--", NULL, ")"); break;
+ case EOpPostIncrement: preString = "("; postString = "++)"; break;
+ case EOpPostDecrement: preString = "("; postString = "--)"; break;
+ case EOpPreIncrement: preString = "(++"; break;
+ case EOpPreDecrement: preString = "(--"; break;
case EOpConvIntToBool:
case EOpConvFloatToBool:
switch (node->getOperand()->getType().getNominalSize())
{
- case 1: writeTriplet(visit, "bool(", NULL, ")"); break;
- case 2: writeTriplet(visit, "bvec2(", NULL, ")"); break;
- case 3: writeTriplet(visit, "bvec3(", NULL, ")"); break;
- case 4: writeTriplet(visit, "bvec4(", NULL, ")"); break;
+ case 1: preString = "bool("; break;
+ case 2: preString = "bvec2("; break;
+ case 3: preString = "bvec3("; break;
+ case 4: preString = "bvec4("; break;
default: UNREACHABLE();
}
break;
@@ -331,10 +334,10 @@ bool TOutputGLSLBase::visitUnary(Visit visit, TIntermUnary* node)
case EOpConvIntToFloat:
switch (node->getOperand()->getType().getNominalSize())
{
- case 1: writeTriplet(visit, "float(", NULL, ")"); break;
- case 2: writeTriplet(visit, "vec2(", NULL, ")"); break;
- case 3: writeTriplet(visit, "vec3(", NULL, ")"); break;
- case 4: writeTriplet(visit, "vec4(", NULL, ")"); break;
+ case 1: preString = "float("; break;
+ case 2: preString = "vec2("; break;
+ case 3: preString = "vec3("; break;
+ case 4: preString = "vec4("; break;
default: UNREACHABLE();
}
break;
@@ -342,49 +345,53 @@ bool TOutputGLSLBase::visitUnary(Visit visit, TIntermUnary* node)
case EOpConvBoolToInt:
switch (node->getOperand()->getType().getNominalSize())
{
- case 1: writeTriplet(visit, "int(", NULL, ")"); break;
- case 2: writeTriplet(visit, "ivec2(", NULL, ")"); break;
- case 3: writeTriplet(visit, "ivec3(", NULL, ")"); break;
- case 4: writeTriplet(visit, "ivec4(", NULL, ")"); break;
+ case 1: preString = "int("; break;
+ case 2: preString = "ivec2("; break;
+ case 3: preString = "ivec3("; break;
+ case 4: preString = "ivec4("; break;
default: UNREACHABLE();
}
break;
- case EOpRadians: writeTriplet(visit, "radians(", NULL, ")"); break;
- case EOpDegrees: writeTriplet(visit, "degrees(", NULL, ")"); break;
- case EOpSin: writeTriplet(visit, "sin(", NULL, ")"); break;
- case EOpCos: writeTriplet(visit, "cos(", NULL, ")"); break;
- case EOpTan: writeTriplet(visit, "tan(", NULL, ")"); break;
- case EOpAsin: writeTriplet(visit, "asin(", NULL, ")"); break;
- case EOpAcos: writeTriplet(visit, "acos(", NULL, ")"); break;
- case EOpAtan: writeTriplet(visit, "atan(", NULL, ")"); break;
-
- case EOpExp: writeTriplet(visit, "exp(", NULL, ")"); break;
- case EOpLog: writeTriplet(visit, "log(", NULL, ")"); break;
- case EOpExp2: writeTriplet(visit, "exp2(", NULL, ")"); break;
- case EOpLog2: writeTriplet(visit, "log2(", NULL, ")"); break;
- case EOpSqrt: writeTriplet(visit, "sqrt(", NULL, ")"); break;
- case EOpInverseSqrt: writeTriplet(visit, "inversesqrt(", NULL, ")"); break;
-
- case EOpAbs: writeTriplet(visit, "abs(", NULL, ")"); break;
- case EOpSign: writeTriplet(visit, "sign(", NULL, ")"); break;
- case EOpFloor: writeTriplet(visit, "floor(", NULL, ")"); break;
- case EOpCeil: writeTriplet(visit, "ceil(", NULL, ")"); break;
- case EOpFract: writeTriplet(visit, "fract(", NULL, ")"); break;
-
- case EOpLength: writeTriplet(visit, "length(", NULL, ")"); break;
- case EOpNormalize: writeTriplet(visit, "normalize(", NULL, ")"); break;
-
- case EOpDFdx: writeTriplet(visit, "dFdx(", NULL, ")"); break;
- case EOpDFdy: writeTriplet(visit, "dFdy(", NULL, ")"); break;
- case EOpFwidth: writeTriplet(visit, "fwidth(", NULL, ")"); break;
-
- case EOpAny: writeTriplet(visit, "any(", NULL, ")"); break;
- case EOpAll: writeTriplet(visit, "all(", NULL, ")"); break;
+ case EOpRadians: preString = "radians("; break;
+ case EOpDegrees: preString = "degrees("; break;
+ case EOpSin: preString = "sin("; break;
+ case EOpCos: preString = "cos("; break;
+ case EOpTan: preString = "tan("; break;
+ case EOpAsin: preString = "asin("; break;
+ case EOpAcos: preString = "acos("; break;
+ case EOpAtan: preString = "atan("; break;
+
+ case EOpExp: preString = "exp("; break;
+ case EOpLog: preString = "log("; break;
+ case EOpExp2: preString = "exp2("; break;
+ case EOpLog2: preString = "log2("; break;
+ case EOpSqrt: preString = "sqrt("; break;
+ case EOpInverseSqrt: preString = "inversesqrt("; break;
+
+ case EOpAbs: preString = "abs("; break;
+ case EOpSign: preString = "sign("; break;
+ case EOpFloor: preString = "floor("; break;
+ case EOpCeil: preString = "ceil("; break;
+ case EOpFract: preString = "fract("; break;
+
+ case EOpLength: preString = "length("; break;
+ case EOpNormalize: preString = "normalize("; break;
+
+ case EOpDFdx: preString = "dFdx("; break;
+ case EOpDFdy: preString = "dFdy("; break;
+ case EOpFwidth: preString = "fwidth("; break;
+
+ case EOpAny: preString = "any("; break;
+ case EOpAll: preString = "all("; break;
default: UNREACHABLE(); break;
}
+ if (visit == PreVisit && node->getUseEmulatedFunction())
+ preString = BuiltInFunctionEmulator::GetEmulatedFunctionName(preString);
+ writeTriplet(visit, preString.c_str(), NULL, postString.c_str());
+
return true;
}
@@ -429,6 +436,8 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate* node)
{
bool visitChildren = true;
TInfoSinkBase& out = objSink();
+ TString preString;
+ bool delayedWrite = false;
switch (node->getOp())
{
case EOpSequence: {
@@ -457,8 +466,8 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate* node)
case EOpPrototype: {
// Function declaration.
ASSERT(visit == PreVisit);
- TString returnType = getTypeName(node->getType());
- out << returnType << " " << node->getName();
+ writeVariableType(node->getType());
+ out << " " << node->getName();
out << "(";
writeFunctionParameters(node->getSequence());
@@ -575,34 +584,38 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate* node)
}
break;
- case EOpLessThan: writeTriplet(visit, "lessThan(", ", ", ")"); break;
- case EOpGreaterThan: writeTriplet(visit, "greaterThan(", ", ", ")"); break;
- case EOpLessThanEqual: writeTriplet(visit, "lessThanEqual(", ", ", ")"); break;
- case EOpGreaterThanEqual: writeTriplet(visit, "greaterThanEqual(", ", ", ")"); break;
- case EOpVectorEqual: writeTriplet(visit, "equal(", ", ", ")"); break;
- case EOpVectorNotEqual: writeTriplet(visit, "notEqual(", ", ", ")"); break;
+ case EOpLessThan: preString = "lessThan("; delayedWrite = true; break;
+ case EOpGreaterThan: preString = "greaterThan("; delayedWrite = true; break;
+ case EOpLessThanEqual: preString = "lessThanEqual("; delayedWrite = true; break;
+ case EOpGreaterThanEqual: preString = "greaterThanEqual("; delayedWrite = true; break;
+ case EOpVectorEqual: preString = "equal("; delayedWrite = true; break;
+ case EOpVectorNotEqual: preString = "notEqual("; delayedWrite = true; break;
case EOpComma: writeTriplet(visit, NULL, ", ", NULL); break;
- case EOpMod: writeTriplet(visit, "mod(", ", ", ")"); break;
- case EOpPow: writeTriplet(visit, "pow(", ", ", ")"); break;
- case EOpAtan: writeTriplet(visit, "atan(", ", ", ")"); break;
- case EOpMin: writeTriplet(visit, "min(", ", ", ")"); break;
- case EOpMax: writeTriplet(visit, "max(", ", ", ")"); break;
- case EOpClamp: writeTriplet(visit, "clamp(", ", ", ")"); break;
- case EOpMix: writeTriplet(visit, "mix(", ", ", ")"); break;
- case EOpStep: writeTriplet(visit, "step(", ", ", ")"); break;
- case EOpSmoothStep: writeTriplet(visit, "smoothstep(", ", ", ")"); break;
-
- case EOpDistance: writeTriplet(visit, "distance(", ", ", ")"); break;
- case EOpDot: writeTriplet(visit, "dot(", ", ", ")"); break;
- case EOpCross: writeTriplet(visit, "cross(", ", ", ")"); break;
- case EOpFaceForward: writeTriplet(visit, "faceforward(", ", ", ")"); break;
- case EOpReflect: writeTriplet(visit, "reflect(", ", ", ")"); break;
- case EOpRefract: writeTriplet(visit, "refract(", ", ", ")"); break;
- case EOpMul: writeTriplet(visit, "matrixCompMult(", ", ", ")"); break;
+ case EOpMod: preString = "mod("; delayedWrite = true; break;
+ case EOpPow: preString = "pow("; delayedWrite = true; break;
+ case EOpAtan: preString = "atan("; delayedWrite = true; break;
+ case EOpMin: preString = "min("; delayedWrite = true; break;
+ case EOpMax: preString = "max("; delayedWrite = true; break;
+ case EOpClamp: preString = "clamp("; delayedWrite = true; break;
+ case EOpMix: preString = "mix("; delayedWrite = true; break;
+ case EOpStep: preString = "step("; delayedWrite = true; break;
+ case EOpSmoothStep: preString = "smoothstep("; delayedWrite = true; break;
+
+ case EOpDistance: preString = "distance("; delayedWrite = true; break;
+ case EOpDot: preString = "dot("; delayedWrite = true; break;
+ case EOpCross: preString = "cross("; delayedWrite = true; break;
+ case EOpFaceForward: preString = "faceforward("; delayedWrite = true; break;
+ case EOpReflect: preString = "reflect("; delayedWrite = true; break;
+ case EOpRefract: preString = "refract("; delayedWrite = true; break;
+ case EOpMul: preString = "matrixCompMult("; delayedWrite = true; break;
default: UNREACHABLE(); break;
}
+ if (delayedWrite && visit == PreVisit && node->getUseEmulatedFunction())
+ preString = BuiltInFunctionEmulator::GetEmulatedFunctionName(preString);
+ if (delayedWrite)
+ writeTriplet(visit, preString.c_str(), ", ", ")");
return visitChildren;
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp b/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp
index afa8f046b..b3a00d30d 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.cpp
@@ -45,9 +45,12 @@ OutputHLSL::OutputHLSL(TParseContext &context) : TIntermTraverser(true, true, tr
mUsesPointSize = false;
mUsesXor = false;
mUsesMod1 = false;
- mUsesMod2 = false;
- mUsesMod3 = false;
- mUsesMod4 = false;
+ mUsesMod2v = false;
+ mUsesMod2f = false;
+ mUsesMod3v = false;
+ mUsesMod3f = false;
+ mUsesMod4v = false;
+ mUsesMod4f = false;
mUsesFaceforward1 = false;
mUsesFaceforward2 = false;
mUsesFaceforward3 = false;
@@ -136,7 +139,7 @@ void OutputHLSL::header()
{
if (mReferencedUniforms.find(name.c_str()) != mReferencedUniforms.end())
{
- uniforms += "uniform " + typeString(type) + " " + decorate(name) + arrayString(type) + ";\n";
+ uniforms += "uniform " + typeString(type) + " " + decorateUniform(name, type.isArray()) + arrayString(type) + ";\n";
}
}
else if (qualifier == EvqVaryingIn || qualifier == EvqInvariantVaryingIn)
@@ -185,7 +188,7 @@ void OutputHLSL::header()
if (mUsesFragCoord)
{
- out << "uniform float4 dx_Viewport;\n"
+ out << "uniform float4 dx_Coord;\n"
"uniform float2 dx_Depth;\n";
}
@@ -300,7 +303,7 @@ void OutputHLSL::header()
{
if (mReferencedUniforms.find(name.c_str()) != mReferencedUniforms.end())
{
- uniforms += "uniform " + typeString(type) + " " + decorate(name) + arrayString(type) + ";\n";
+ uniforms += "uniform " + typeString(type) + " " + decorateUniform(name, type.isArray()) + arrayString(type) + ";\n";
}
}
else if (qualifier == EvqAttribute)
@@ -479,8 +482,17 @@ void OutputHLSL::header()
"}\n"
"\n";
}
-
- if (mUsesMod2)
+
+ if (mUsesMod2v)
+ {
+ out << "float2 mod(float2 x, float2 y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n";
+ }
+
+ if (mUsesMod2f)
{
out << "float2 mod(float2 x, float y)\n"
"{\n"
@@ -489,7 +501,16 @@ void OutputHLSL::header()
"\n";
}
- if (mUsesMod3)
+ if (mUsesMod3v)
+ {
+ out << "float3 mod(float3 x, float3 y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n";
+ }
+
+ if (mUsesMod3f)
{
out << "float3 mod(float3 x, float y)\n"
"{\n"
@@ -498,7 +519,16 @@ void OutputHLSL::header()
"\n";
}
- if (mUsesMod4)
+ if (mUsesMod4v)
+ {
+ out << "float4 mod(float4 x, float4 y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n";
+ }
+
+ if (mUsesMod4f)
{
out << "float4 mod(float4 x, float y)\n"
"{\n"
@@ -729,17 +759,22 @@ void OutputHLSL::visitSymbol(TIntermSymbol *node)
if (qualifier == EvqUniform)
{
mReferencedUniforms.insert(name.c_str());
+ out << decorateUniform(name, node->isArray());
}
else if (qualifier == EvqAttribute)
{
mReferencedAttributes.insert(name.c_str());
+ out << decorate(name);
}
else if (qualifier == EvqVaryingOut || qualifier == EvqInvariantVaryingOut || qualifier == EvqVaryingIn || qualifier == EvqInvariantVaryingIn)
{
mReferencedVaryings.insert(name.c_str());
+ out << decorate(name);
+ }
+ else
+ {
+ out << decorate(name);
}
-
- out << decorate(name);
}
}
@@ -1442,12 +1477,17 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpVectorNotEqual: outputTriplet(visit, "(", " != ", ")"); break;
case EOpMod:
{
- switch (node->getSequence()[0]->getAsTyped()->getNominalSize()) // Number of components in the first argument
+ // We need to look at the number of components in both arguments
+ switch (node->getSequence()[0]->getAsTyped()->getNominalSize() * 10
+ + node->getSequence()[1]->getAsTyped()->getNominalSize())
{
- case 1: mUsesMod1 = true; break;
- case 2: mUsesMod2 = true; break;
- case 3: mUsesMod3 = true; break;
- case 4: mUsesMod4 = true; break;
+ case 11: mUsesMod1 = true; break;
+ case 22: mUsesMod2v = true; break;
+ case 21: mUsesMod2f = true; break;
+ case 33: mUsesMod3v = true; break;
+ case 31: mUsesMod3f = true; break;
+ case 44: mUsesMod4v = true; break;
+ case 41: mUsesMod4f = true; break;
default: UNREACHABLE();
}
@@ -1498,7 +1538,7 @@ bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
if (node->usesTernaryOperator())
{
- out << "t" << mUnfoldSelect->getTemporaryIndex();
+ out << "s" << mUnfoldSelect->getNextTemporaryIndex();
}
else // if/else statement
{
@@ -1562,21 +1602,6 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
}
else
{
- if (node->getInit())
- {
- mUnfoldSelect->traverse(node->getInit());
- }
-
- if (node->getCondition())
- {
- mUnfoldSelect->traverse(node->getCondition());
- }
-
- if (node->getExpression())
- {
- mUnfoldSelect->traverse(node->getExpression());
- }
-
out << "for(";
if (node->getInit())
@@ -1610,7 +1635,7 @@ bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
}
outputLineDirective(node->getLine());
- out << "}\n";
+ out << ";}\n";
if (node->getType() == ELoopDoWhile)
{
@@ -1844,7 +1869,7 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
}
outputLineDirective(node->getLine());
- out << "}\n";
+ out << ";}\n";
initial += 255 * increment;
iterations -= 255;
@@ -2045,14 +2070,7 @@ void OutputHLSL::addConstructor(const TType &type, const TString &name, const TI
typedef std::vector<TType> ParameterArray;
ParameterArray ctorParameters;
- if (parameters)
- {
- for (TIntermSequence::const_iterator parameter = parameters->begin(); parameter != parameters->end(); parameter++)
- {
- ctorParameters.push_back((*parameter)->getAsTyped()->getType());
- }
- }
- else if (type.getStruct())
+ if (type.getStruct())
{
mStructNames.insert(decorate(name));
@@ -2081,6 +2099,13 @@ void OutputHLSL::addConstructor(const TType &type, const TString &name, const TI
ctorParameters.push_back(*fields[i].type);
}
}
+ else if (parameters)
+ {
+ for (TIntermSequence::const_iterator parameter = parameters->begin(); parameter != parameters->end(); parameter++)
+ {
+ ctorParameters.push_back((*parameter)->getAsTyped()->getType());
+ }
+ }
else UNREACHABLE();
TString constructor;
@@ -2337,13 +2362,21 @@ TString OutputHLSL::structLookup(const TString &typeName)
TString OutputHLSL::decorate(const TString &string)
{
- if (string.substr(0, 3) != "gl_" && string.substr(0, 3) != "dx_")
+ if (string.compare(0, 3, "gl_") != 0 && string.compare(0, 3, "dx_") != 0)
{
return "_" + string;
}
- else
+
+ return string;
+}
+
+TString OutputHLSL::decorateUniform(const TString &string, bool array)
+{
+ if (array)
{
- return string;
+ return "ar_" + string; // Allows identifying arrays of size 1
}
+
+ return decorate(string);
}
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h b/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h
index 805561afb..06ad84986 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/OutputHLSL.h
@@ -31,7 +31,8 @@ class OutputHLSL : public TIntermTraverser
static TString qualifierString(TQualifier qualifier);
static TString arrayString(const TType &type);
static TString initializer(const TType &type);
- static TString decorate(const TString &string); // Prepend an underscore to avoid naming clashes
+ static TString decorate(const TString &string); // Prepends an underscore to avoid naming clashes
+ static TString decorateUniform(const TString &string, bool array);
protected:
void header();
@@ -90,9 +91,12 @@ class OutputHLSL : public TIntermTraverser
bool mUsesPointSize;
bool mUsesXor;
bool mUsesMod1;
- bool mUsesMod2;
- bool mUsesMod3;
- bool mUsesMod4;
+ bool mUsesMod2v;
+ bool mUsesMod2f;
+ bool mUsesMod3v;
+ bool mUsesMod3f;
+ bool mUsesMod4v;
+ bool mUsesMod4f;
bool mUsesFaceforward1;
bool mUsesFaceforward2;
bool mUsesFaceforward3;
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp b/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp
index 3f0836d75..431f8d1ce 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.cpp
@@ -196,7 +196,6 @@ bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TM
//
void TParseContext::recover()
{
- recoveredFromError = true;
}
//
@@ -449,16 +448,16 @@ bool TParseContext::reservedErrorCheck(int line, const TString& identifier)
{
static const char* reservedErrMsg = "reserved built-in name";
if (!symbolTable.atBuiltInLevel()) {
- if (identifier.substr(0, 3) == TString("gl_")) {
+ if (identifier.compare(0, 3, "gl_") == 0) {
error(line, reservedErrMsg, "gl_", "");
return true;
}
if (shaderSpec == SH_WEBGL_SPEC) {
- if (identifier.substr(0, 6) == TString("webgl_")) {
+ if (identifier.compare(0, 6, "webgl_") == 0) {
error(line, reservedErrMsg, "webgl_", "");
return true;
}
- if (identifier.substr(0, 7) == TString("_webgl_")) {
+ if (identifier.compare(0, 7, "_webgl_") == 0) {
error(line, reservedErrMsg, "_webgl_", "");
return true;
}
@@ -554,7 +553,7 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction
return true;
}
- if (!type->isMatrix()) {
+ if (!type->isMatrix() || !matrixInMatrix) {
if ((op != EOpConstructStruct && size != 1 && size < type->getObjectSize()) ||
(op == EOpConstructStruct && size < type->getObjectSize())) {
error(line, "not enough data provided for construction", "constructor", "");
@@ -930,7 +929,8 @@ bool TParseContext::extensionErrorCheck(int line, const TString& extension)
error(line, "extension", extension.c_str(), "is not supported");
return true;
}
- if (iter->second == EBhDisable) {
+ // In GLSL ES, an extension's default behavior is "disable".
+ if (iter->second == EBhDisable || iter->second == EBhUndefined) {
error(line, "extension", extension.c_str(), "is disabled");
return true;
}
@@ -943,6 +943,12 @@ bool TParseContext::extensionErrorCheck(int line, const TString& extension)
return false;
}
+bool TParseContext::supportsExtension(const char* extension)
+{
+ TExtensionBehavior::const_iterator iter = extensionBehavior.find(extension);
+ return (iter != extensionBehavior.end());
+}
+
/////////////////////////////////////////////////////////////////////////////////
//
// Non-Errors.
@@ -1419,6 +1425,53 @@ TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* n
return typedNode;
}
+bool TParseContext::enterStructDeclaration(int line, const TString& identifier)
+{
+ ++structNestingLevel;
+
+ // Embedded structure definitions are not supported per GLSL ES spec.
+ // They aren't allowed in GLSL either, but we need to detect this here
+ // so we don't rely on the GLSL compiler to catch it.
+ if (structNestingLevel > 1) {
+ error(line, "", "Embedded struct definitions are not allowed", "");
+ return true;
+ }
+
+ return false;
+}
+
+void TParseContext::exitStructDeclaration()
+{
+ --structNestingLevel;
+}
+
+namespace {
+
+const int kWebGLMaxStructNesting = 4;
+
+} // namespace
+
+bool TParseContext::structNestingErrorCheck(TSourceLoc line, const TType& fieldType)
+{
+ if (shaderSpec != SH_WEBGL_SPEC) {
+ return false;
+ }
+
+ if (fieldType.getBasicType() != EbtStruct) {
+ return false;
+ }
+
+ // We're already inside a structure definition at this point, so add
+ // one to the field's struct nesting.
+ if (1 + fieldType.getDeepestStructNesting() > kWebGLMaxStructNesting) {
+ error(line, "", "", "Reference of struct type %s exceeds maximum struct nesting of %d",
+ fieldType.getTypeName().c_str(), kWebGLMaxStructNesting);
+ return true;
+ }
+
+ return false;
+}
+
//
// Parse an array of strings using yyparse.
//
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h b/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h
index 8637d890b..3e05763b1 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/ParseHelper.h
@@ -31,9 +31,25 @@ struct TPragma {
//
struct TParseContext {
TParseContext(TSymbolTable& symt, TExtensionBehavior& ext, TIntermediate& interm, ShShaderType type, ShShaderSpec spec, int options, bool checksPrecErrors, const char* sourcePath, TInfoSink& is) :
- intermediate(interm), symbolTable(symt), extensionBehavior(ext), infoSink(is), shaderType(type), shaderSpec(spec), compileOptions(options), checksPrecisionErrors(checksPrecErrors), sourcePath(sourcePath), treeRoot(0),
- recoveredFromError(false), numErrors(0), lexAfterType(false), loopNestingLevel(0),
- inTypeParen(false), scanner(NULL), contextPragma(true, false) { }
+ intermediate(interm),
+ symbolTable(symt),
+ extensionBehavior(ext),
+ infoSink(is),
+ shaderType(type),
+ shaderSpec(spec),
+ compileOptions(options),
+ sourcePath(sourcePath),
+ treeRoot(0),
+ numErrors(0),
+ lexAfterType(false),
+ loopNestingLevel(0),
+ structNestingLevel(0),
+ inTypeParen(false),
+ currentFunctionType(NULL),
+ functionReturnsValue(false),
+ checksPrecisionErrors(checksPrecErrors),
+ contextPragma(true, false),
+ scanner(NULL) { }
TIntermediate& intermediate; // to hold and build a parse tree
TSymbolTable& symbolTable; // symbol table that goes with the language currently being parsed
TExtensionBehavior& extensionBehavior; // mapping between supported extensions and current behavior.
@@ -43,24 +59,29 @@ struct TParseContext {
int compileOptions;
const char* sourcePath; // Path of source file or NULL.
TIntermNode* treeRoot; // root of parse tree being created
- bool recoveredFromError; // true if a parse error has occurred, but we continue to parse
int numErrors;
bool lexAfterType; // true if we've recognized a type, so can only be looking for an identifier
int loopNestingLevel; // 0 if outside all loops
+ int structNestingLevel; // incremented while parsing a struct declaration
bool inTypeParen; // true if in parentheses, looking only for an identifier
const TType* currentFunctionType; // the return type of the function that's currently being parsed
bool functionReturnsValue; // true if a non-void function has a return
bool checksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
+ struct TPragma contextPragma;
+ TString HashErrMsg;
+ bool AfterEOF;
+ void* scanner;
void error(TSourceLoc loc, const char *reason, const char* token,
const char* extraInfoFormat, ...);
void warning(TSourceLoc loc, const char* reason, const char* token,
const char* extraInfoFormat, ...);
- bool reservedErrorCheck(int line, const TString& identifier);
void recover();
bool parseVectorFields(const TString&, int vecSize, TVectorFields&, int line);
bool parseMatrixFields(const TString&, int matSize, TMatrixFields&, int line);
+
+ bool reservedErrorCheck(int line, const TString& identifier);
void assignError(int line, const char* op, TString left, TString right);
void unaryOpError(int line, const char* op, TString operand);
void binaryOpError(int line, const char* op, TString left, TString right);
@@ -80,15 +101,19 @@ struct TParseContext {
bool samplerErrorCheck(int line, const TPublicType& pType, const char* reason);
bool structQualifierErrorCheck(int line, const TPublicType& pType);
bool parameterSamplerErrorCheck(int line, TQualifier qualifier, const TType& type);
- bool containsSampler(TType& type);
bool nonInitConstErrorCheck(int line, TString& identifier, TPublicType& type);
bool nonInitErrorCheck(int line, TString& identifier, TPublicType& type, TVariable*& variable);
bool paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type);
bool extensionErrorCheck(int line, const TString&);
+ bool supportsExtension(const char* extension);
+
+ bool containsSampler(TType& type);
+ bool areAllChildConst(TIntermAggregate* aggrNode);
const TFunction* findFunction(int line, TFunction* pfnCall, bool *builtIn = 0);
bool executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType,
TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0);
- bool areAllChildConst(TIntermAggregate* aggrNode);
+ bool arraySetMaxSize(TIntermSymbol*, TType*, int, bool, TSourceLoc);
+
TIntermTyped* addConstructor(TIntermNode*, const TType*, TOperator, TFunction*, TSourceLoc);
TIntermTyped* foldConstConstructor(TIntermAggregate* aggrNode, const TType& type);
TIntermTyped* constructStruct(TIntermNode*, TType*, int, TSourceLoc, bool subset);
@@ -97,11 +122,14 @@ struct TParseContext {
TIntermTyped* addConstMatrixNode(int , TIntermTyped*, TSourceLoc);
TIntermTyped* addConstArrayNode(int index, TIntermTyped* node, TSourceLoc line);
TIntermTyped* addConstStruct(TString& , TIntermTyped*, TSourceLoc);
- bool arraySetMaxSize(TIntermSymbol*, TType*, int, bool, TSourceLoc);
- void* scanner;
- struct TPragma contextPragma;
- TString HashErrMsg;
- bool AfterEOF;
+
+ // Performs an error check for embedded struct declarations.
+ // Returns true if an error was raised due to the declaration of
+ // this struct.
+ bool enterStructDeclaration(TSourceLoc line, const TString& identifier);
+ void exitStructDeclaration();
+
+ bool structNestingErrorCheck(TSourceLoc line, const TType& fieldType);
};
int PaParseStrings(int count, const char* const string[], const int length[],
diff --git a/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h b/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h
index 55e09dbc4..a8a59c69a 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/PoolAlloc.h
@@ -253,12 +253,18 @@ public:
pointer address(reference x) const { return &x; }
const_pointer address(const_reference x) const { return &x; }
- pool_allocator() : allocator(GlobalPoolAllocator) { }
- pool_allocator(TPoolAllocator& a) : allocator(a) { }
+ pool_allocator() : allocator(&GlobalPoolAllocator) { }
+ pool_allocator(TPoolAllocator& a) : allocator(&a) { }
pool_allocator(const pool_allocator<T>& p) : allocator(p.allocator) { }
+ template <class Other>
+ pool_allocator<T>& operator=(const pool_allocator<Other>& p) {
+ allocator = p.allocator;
+ return *this;
+ }
+
template<class Other>
- pool_allocator(const pool_allocator<Other>& p) : allocator(p.getAllocator()) { }
+ pool_allocator(const pool_allocator<Other>& p) : allocator(&p.getAllocator()) { }
#if defined(__SUNPRO_CC) && !defined(_RWSTD_ALLOCATOR)
// libCStd on some platforms have a different allocate/deallocate interface.
@@ -290,11 +296,11 @@ public:
size_type max_size() const { return static_cast<size_type>(-1) / sizeof(T); }
size_type max_size(int size) const { return static_cast<size_type>(-1) / size; }
- void setAllocator(TPoolAllocator* a) { allocator = *a; }
- TPoolAllocator& getAllocator() const { return allocator; }
+ void setAllocator(TPoolAllocator* a) { allocator = a; }
+ TPoolAllocator& getAllocator() const { return *allocator; }
protected:
- TPoolAllocator& allocator;
+ TPoolAllocator* allocator;
};
#endif // _POOLALLOC_INCLUDED_
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h b/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
index bf61d29e5..8ddf0f152 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/ShHandle.h
@@ -16,6 +16,7 @@
#include "GLSLANG/ShaderLang.h"
+#include "compiler/BuiltInFunctionEmulator.h"
#include "compiler/ExtensionBehavior.h"
#include "compiler/InfoSink.h"
#include "compiler/SymbolTable.h"
@@ -66,6 +67,8 @@ protected:
bool InitBuiltInSymbolTable(const ShBuiltInResources& resources);
// Clears the results from the previous compilation.
void clearResults();
+ // Return true if function recursion is detected.
+ bool detectRecursion(TIntermNode* root);
// Returns true if the given shader does not exceed the minimum
// functionality mandated in GLSL 1.0 spec Appendix A.
bool validateLimitations(TIntermNode* root);
@@ -78,6 +81,8 @@ protected:
// Get built-in extensions with default behavior.
const TExtensionBehavior& getExtensionBehavior() const;
+ const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
+
private:
ShShaderType shaderType;
ShShaderSpec shaderSpec;
@@ -88,13 +93,15 @@ private:
// Built-in extensions with default behavior.
TExtensionBehavior extensionBehavior;
+ BuiltInFunctionEmulator builtInFunctionEmulator;
+
// Results of compilation.
TInfoSink infoSink; // Output sink.
TVariableInfoList attribs; // Active attributes in the compiled shader.
TVariableInfoList uniforms; // Active uniforms in the compiled shader.
// Pair of long varying varibale name <originalName, mappedName>.
- TMap<TString, TString> varyingLongNameMap;
+ std::map<std::string, std::string> varyingLongNameMap;
};
//
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp b/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp
index ab8799c65..13f11b5ca 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/ShaderLang.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -12,6 +12,7 @@
#include "GLSLANG/ShaderLang.h"
#include "compiler/InitializeDll.h"
+#include "compiler/preprocessor/length_limits.h"
#include "compiler/ShHandle.h"
//
@@ -19,16 +20,21 @@
// and the shading language compiler.
//
-static int getVariableMaxLength(const TVariableInfoList& varList)
+static bool checkActiveUniformAndAttribMaxLengths(const ShHandle handle,
+ int expectedValue)
{
- TString::size_type maxLen = 0;
- for (TVariableInfoList::const_iterator i = varList.begin();
- i != varList.end(); ++i)
- {
- maxLen = std::max(maxLen, i->name.size());
- }
- // Add 1 to include null-termination character.
- return static_cast<int>(maxLen) + 1;
+ int activeUniformLimit = 0;
+ ShGetInfo(handle, SH_ACTIVE_UNIFORM_MAX_LENGTH, &activeUniformLimit);
+ int activeAttribLimit = 0;
+ ShGetInfo(handle, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &activeAttribLimit);
+ return (expectedValue == activeUniformLimit && expectedValue == activeAttribLimit);
+}
+
+static bool checkMappedNameMaxLength(const ShHandle handle, int expectedValue)
+{
+ int mappedNameMaxLength = 0;
+ ShGetInfo(handle, SH_MAPPED_NAME_MAX_LENGTH, &mappedNameMaxLength);
+ return (expectedValue == mappedNameMaxLength);
}
static void getVariableInfo(ShShaderInfo varType,
@@ -59,9 +65,20 @@ static void getVariableInfo(ShShaderInfo varType,
if (length) *length = varInfo.name.size();
*size = varInfo.size;
*type = varInfo.type;
- strcpy(name, varInfo.name.c_str());
- if (mappedName)
- strcpy(mappedName, varInfo.mappedName.c_str());
+
+ // This size must match that queried by
+ // SH_ACTIVE_UNIFORM_MAX_LENGTH and SH_ACTIVE_ATTRIBUTE_MAX_LENGTH
+ // in ShGetInfo, below.
+ int activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
+ ASSERT(checkActiveUniformAndAttribMaxLengths(handle, activeUniformAndAttribLength));
+ strncpy(name, varInfo.name.c_str(), activeUniformAndAttribLength);
+ if (mappedName) {
+ // This size must match that queried by
+ // SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
+ int maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
+ ASSERT(checkMappedNameMaxLength(handle, maxMappedNameLength));
+ strncpy(mappedName, varInfo.mappedName.c_str(), maxMappedNameLength);
+ }
}
//
@@ -104,6 +121,8 @@ void ShInitBuiltInResources(ShBuiltInResources* resources)
// Extensions.
resources->OES_standard_derivatives = 0;
+ resources->OES_EGL_image_external = 0;
+ resources->ARB_texture_rectangle = 0;
}
//
@@ -190,16 +209,18 @@ void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params)
*params = compiler->getUniforms().size();
break;
case SH_ACTIVE_UNIFORM_MAX_LENGTH:
- *params = getVariableMaxLength(compiler->getUniforms());
+ *params = 1 + MAX_SYMBOL_NAME_LEN;
break;
case SH_ACTIVE_ATTRIBUTES:
*params = compiler->getAttribs().size();
break;
case SH_ACTIVE_ATTRIBUTE_MAX_LENGTH:
- *params = getVariableMaxLength(compiler->getAttribs());
+ *params = 1 + MAX_SYMBOL_NAME_LEN;
break;
case SH_MAPPED_NAME_MAX_LENGTH:
- *params = compiler->getMappedNameMaxLength();
+ // Use longer length than MAX_SHORTENED_IDENTIFIER_SIZE to
+ // handle array and struct dereferences.
+ *params = 1 + MAX_SYMBOL_NAME_LEN;
break;
default: UNREACHABLE();
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp b/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
index 02817d447..e6695d6b9 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/SymbolTable.cpp
@@ -13,6 +13,8 @@
#include <stdio.h>
+#include <algorithm>
+
//
// TType helper function needs a place to live.
//
@@ -71,6 +73,20 @@ int TType::getStructSize() const
return structureSize;
}
+void TType::computeDeepestStructNesting()
+{
+ if (!getStruct()) {
+ return;
+ }
+
+ int maxNesting = 0;
+ for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); ++tl) {
+ maxNesting = std::max(maxNesting, ((*tl).type)->getDeepestStructNesting());
+ }
+
+ deepestStructNesting = 1 + maxNesting;
+}
+
//
// Dump functions.
//
diff --git a/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp b/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp
index bb201a48c..e3a2c2a80 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/TranslatorESSL.cpp
@@ -18,6 +18,10 @@ void TranslatorESSL::translate(TIntermNode* root) {
// Write built-in extension behaviors.
writeExtensionBehavior();
+ // Write emulated built-in functions if needed.
+ getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
+ sink, getShaderType() == SH_FRAGMENT_SHADER);
+
// Write translated shader.
TOutputESSL outputESSL(sink);
root->traverse(&outputESSL);
@@ -28,7 +32,9 @@ void TranslatorESSL::writeExtensionBehavior() {
const TExtensionBehavior& extensionBehavior = getExtensionBehavior();
for (TExtensionBehavior::const_iterator iter = extensionBehavior.begin();
iter != extensionBehavior.end(); ++iter) {
- sink << "#extension " << iter->first << " : "
- << getBehaviorString(iter->second) << "\n";
+ if (iter->second != EBhUndefined) {
+ sink << "#extension " << iter->first << " : "
+ << getBehaviorString(iter->second) << "\n";
+ }
}
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp b/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp
index 7a63ae1f0..bb07a1eb4 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/TranslatorGLSL.cpp
@@ -31,6 +31,10 @@ void TranslatorGLSL::translate(TIntermNode* root) {
// Write GLSL version.
writeVersion(getShaderType(), root, sink);
+ // Write emulated built-in functions if needed.
+ getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
+ sink, false);
+
// Write translated shader.
TOutputGLSL outputGLSL(sink);
root->traverse(&outputGLSL);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/Types.h b/Source/ThirdParty/ANGLE/src/compiler/Types.h
index d0fcc08b9..e1a18fd63 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/Types.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/Types.h
@@ -85,21 +85,22 @@ public:
TType() {}
TType(TBasicType t, TPrecision p, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) :
type(t), precision(p), qualifier(q), size(s), matrix(m), array(a), arraySize(0),
- maxArraySize(0), arrayInformationType(0), structure(0), structureSize(0), fieldName(0), mangled(0), typeName(0)
+ maxArraySize(0), arrayInformationType(0), structure(0), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0), typeName(0)
{
}
explicit TType(const TPublicType &p) :
type(p.type), precision(p.precision), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(p.arraySize),
- maxArraySize(0), arrayInformationType(0), structure(0), structureSize(0), fieldName(0), mangled(0), typeName(0)
+ maxArraySize(0), arrayInformationType(0), structure(0), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0), typeName(0)
{
if (p.userDef) {
structure = p.userDef->getStruct();
typeName = NewPoolTString(p.userDef->getTypeName().c_str());
+ computeDeepestStructNesting();
}
}
TType(TTypeList* userDef, const TString& n, TPrecision p = EbpUndefined) :
type(EbtStruct), precision(p), qualifier(EvqTemporary), size(1), matrix(false), array(false), arraySize(0),
- maxArraySize(0), arrayInformationType(0), structure(userDef), structureSize(0), fieldName(0), mangled(0)
+ maxArraySize(0), arrayInformationType(0), structure(userDef), structureSize(0), deepestStructNesting(0), fieldName(0), mangled(0)
{
typeName = NewPoolTString(n.c_str());
}
@@ -144,6 +145,7 @@ public:
structureSize = copyOf.structureSize;
maxArraySize = copyOf.maxArraySize;
+ deepestStructNesting = copyOf.deepestStructNesting;
assert(copyOf.arrayInformationType == 0);
arrayInformationType = 0; // arrayInformationType should not be set for builtIn symbol table level
}
@@ -202,7 +204,7 @@ public:
bool isScalar() const { return size == 1 && !matrix && !structure; }
TTypeList* getStruct() const { return structure; }
- void setStruct(TTypeList* s) { structure = s; }
+ void setStruct(TTypeList* s) { structure = s; computeDeepestStructNesting(); }
const TString& getTypeName() const
{
@@ -268,9 +270,24 @@ public:
const char* getQualifierString() const { return ::getQualifierString(qualifier); }
TString getCompleteString() const;
+ // If this type is a struct, returns the deepest struct nesting of
+ // any field in the struct. For example:
+ // struct nesting1 {
+ // vec4 position;
+ // };
+ // struct nesting2 {
+ // nesting1 field1;
+ // vec4 field2;
+ // };
+ // For type "nesting2", this method would return 2 -- the number
+ // of structures through which indirection must occur to reach the
+ // deepest field (nesting2.field1.position).
+ int getDeepestStructNesting() const { return deepestStructNesting; }
+
protected:
void buildMangledName(TString&);
int getStructSize() const;
+ void computeDeepestStructNesting();
TBasicType type : 6;
TPrecision precision;
@@ -284,6 +301,7 @@ protected:
TTypeList* structure; // 0 unless this is a struct
mutable int structureSize;
+ int deepestStructNesting;
TString *fieldName; // for structure field names
TString *mangled;
diff --git a/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp b/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp
index a36c3931e..d3985e68b 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.cpp
@@ -20,8 +20,9 @@ UnfoldSelect::UnfoldSelect(TParseContext &context, OutputHLSL *outputHLSL) : mCo
void UnfoldSelect::traverse(TIntermNode *node)
{
- mTemporaryIndex++;
+ int rewindIndex = mTemporaryIndex;
node->traverse(this);
+ mTemporaryIndex = rewindIndex;
}
bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node)
@@ -30,36 +31,66 @@ bool UnfoldSelect::visitSelection(Visit visit, TIntermSelection *node)
if (node->usesTernaryOperator())
{
- int i = mTemporaryIndex++;
+ int i = mTemporaryIndex;
- out << mOutputHLSL->typeString(node->getType()) << " t" << i << ";\n";
+ out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
+ mTemporaryIndex = i + 1;
node->getCondition()->traverse(this);
out << "if(";
+ mTemporaryIndex = i + 1;
node->getCondition()->traverse(mOutputHLSL);
out << ")\n"
"{\n";
+ mTemporaryIndex = i + 1;
node->getTrueBlock()->traverse(this);
- out << " t" << i << " = ";
+ out << " s" << i << " = ";
+ mTemporaryIndex = i + 1;
node->getTrueBlock()->traverse(mOutputHLSL);
out << ";\n"
"}\n"
"else\n"
"{\n";
+ mTemporaryIndex = i + 1;
node->getFalseBlock()->traverse(this);
- out << " t" << i << " = ";
+ out << " s" << i << " = ";
+ mTemporaryIndex = i + 1;
node->getFalseBlock()->traverse(mOutputHLSL);
out << ";\n"
"}\n";
- mTemporaryIndex--;
+ mTemporaryIndex = i + 1;
}
return false;
}
-int UnfoldSelect::getTemporaryIndex()
+bool UnfoldSelect::visitLoop(Visit visit, TIntermLoop *node)
{
- return mTemporaryIndex;
+ int rewindIndex = mTemporaryIndex;
+
+ if (node->getInit())
+ {
+ node->getInit()->traverse(this);
+ }
+
+ if (node->getCondition())
+ {
+ node->getCondition()->traverse(this);
+ }
+
+ if (node->getExpression())
+ {
+ node->getExpression()->traverse(this);
+ }
+
+ mTemporaryIndex = rewindIndex;
+
+ return false;
+}
+
+int UnfoldSelect::getNextTemporaryIndex()
+{
+ return mTemporaryIndex++;
}
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h b/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h
index de296e442..4a3ba5f86 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/UnfoldSelect.h
@@ -23,8 +23,9 @@ class UnfoldSelect : public TIntermTraverser
void traverse(TIntermNode *node);
bool visitSelection(Visit visit, TIntermSelection *node);
+ bool visitLoop(Visit visit, TIntermLoop *node);
- int getTemporaryIndex();
+ int getNextTemporaryIndex();
protected:
TParseContext &mContext;
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp b/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp
index b46e4b91b..767d0bf38 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.cpp
@@ -53,13 +53,6 @@ public:
IsLoopIndex(symbol, mLoopStack);
}
}
- virtual void visitConstantUnion(TIntermConstantUnion*) {}
- virtual bool visitBinary(Visit, TIntermBinary*) { return true; }
- virtual bool visitUnary(Visit, TIntermUnary*) { return true; }
- virtual bool visitSelection(Visit, TIntermSelection*) { return true; }
- virtual bool visitAggregate(Visit, TIntermAggregate*) { return true; }
- virtual bool visitLoop(Visit, TIntermLoop*) { return true; }
- virtual bool visitBranch(Visit, TIntermBranch*) { return true; }
private:
bool mValid;
@@ -94,13 +87,6 @@ public:
}
}
}
- virtual void visitConstantUnion(TIntermConstantUnion*) {}
- virtual bool visitBinary(Visit, TIntermBinary*) { return true; }
- virtual bool visitUnary(Visit, TIntermUnary*) { return true; }
- virtual bool visitSelection(Visit, TIntermSelection*) { return true; }
- virtual bool visitAggregate(Visit, TIntermAggregate*) { return true; }
- virtual bool visitLoop(Visit, TIntermLoop*) { return true; }
- virtual bool visitBranch(Visit, TIntermBranch*) { return true; }
private:
bool mUsesFloatLoopIndex;
@@ -117,14 +103,6 @@ ValidateLimitations::ValidateLimitations(ShShaderType shaderType,
{
}
-void ValidateLimitations::visitSymbol(TIntermSymbol*)
-{
-}
-
-void ValidateLimitations::visitConstantUnion(TIntermConstantUnion*)
-{
-}
-
bool ValidateLimitations::visitBinary(Visit, TIntermBinary* node)
{
// Check if loop index is modified in the loop body.
@@ -170,11 +148,6 @@ bool ValidateLimitations::visitUnary(Visit, TIntermUnary* node)
return true;
}
-bool ValidateLimitations::visitSelection(Visit, TIntermSelection*)
-{
- return true;
-}
-
bool ValidateLimitations::visitAggregate(Visit, TIntermAggregate* node)
{
switch (node->getOp()) {
@@ -209,11 +182,6 @@ bool ValidateLimitations::visitLoop(Visit, TIntermLoop* node)
return false;
}
-bool ValidateLimitations::visitBranch(Visit, TIntermBranch*)
-{
- return true;
-}
-
void ValidateLimitations::error(TSourceLoc loc,
const char *reason, const char* token)
{
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h b/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h
index dd2e5bf09..a835cb3c2 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/ValidateLimitations.h
@@ -25,14 +25,10 @@ public:
int numErrors() const { return mNumErrors; }
- virtual void visitSymbol(TIntermSymbol*);
- virtual void visitConstantUnion(TIntermConstantUnion*);
virtual bool visitBinary(Visit, TIntermBinary*);
virtual bool visitUnary(Visit, TIntermUnary*);
- virtual bool visitSelection(Visit, TIntermSelection*);
virtual bool visitAggregate(Visit, TIntermAggregate*);
virtual bool visitLoop(Visit, TIntermLoop*);
- virtual bool visitBranch(Visit, TIntermBranch*);
private:
void error(TSourceLoc loc, const char *reason, const char* token);
diff --git a/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp b/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp
index a13a89650..843f1877c 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/VariableInfo.cpp
@@ -63,6 +63,7 @@ static ShDataType getVariableDataType(const TType& type)
}
case EbtSampler2D: return SH_SAMPLER_2D;
case EbtSamplerCube: return SH_SAMPLER_CUBE;
+ case EbtSampler2DRect: return SH_SAMPLER_2D_RECT_ARB;
default: UNREACHABLE();
}
return SH_NONE;
diff --git a/Source/ThirdParty/ANGLE/src/compiler/generate_glslang_lexer.sh b/Source/ThirdParty/ANGLE/src/compiler/generate_glslang_lexer.sh
deleted file mode 100644
index 268479dad..000000000
--- a/Source/ThirdParty/ANGLE/src/compiler/generate_glslang_lexer.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Generates GLSL ES lexer - glslang_lex.cpp
-
-script_dir=$(dirname $0)
-input_file=$script_dir/glslang.l
-output_file=$script_dir/glslang_lex.cpp
-flex --noline --nounistd --outfile=$output_file $input_file
diff --git a/Source/ThirdParty/ANGLE/src/compiler/generate_glslang_parser.sh b/Source/ThirdParty/ANGLE/src/compiler/generate_glslang_parser.sh
deleted file mode 100644
index 889f5c0db..000000000
--- a/Source/ThirdParty/ANGLE/src/compiler/generate_glslang_parser.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Generates GLSL ES parser - glslang_tab.h and glslang_tab.cpp
-
-script_dir=$(dirname $0)
-input_file=$script_dir/glslang.y
-output_header=$script_dir/glslang_tab.h
-output_source=$script_dir/glslang_tab.cpp
-bison --no-lines --skeleton=yacc.c --defines=$output_header --output=$output_source $input_file
diff --git a/Source/ThirdParty/ANGLE/src/compiler/generate_parser.sh b/Source/ThirdParty/ANGLE/src/compiler/generate_parser.sh
new file mode 100755
index 000000000..e4721915e
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/generate_parser.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Generates GLSL ES parser - glslang_lex.cpp, glslang_tab.h, and glslang_tab.cpp
+
+run_flex()
+{
+input_file=$script_dir/$1.l
+output_source=$script_dir/$1_lex.cpp
+flex --noline --nounistd --outfile=$output_source $input_file
+}
+
+run_bison()
+{
+input_file=$script_dir/$1.y
+output_header=$script_dir/$1_tab.h
+output_source=$script_dir/$1_tab.cpp
+bison --no-lines --skeleton=yacc.c --defines=$output_header --output=$output_source $input_file
+}
+
+script_dir=$(dirname $0)
+
+# Generate Parser
+run_flex glslang
+run_bison glslang
diff --git a/Source/ThirdParty/ANGLE/src/compiler/glslang.l b/Source/ThirdParty/ANGLE/src/compiler/glslang.l
index 5a7c5d52a..4cee2f2f5 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/glslang.l
+++ b/Source/ThirdParty/ANGLE/src/compiler/glslang.l
@@ -9,7 +9,7 @@ This file contains the Lex specification for GLSL ES.
Based on ANSI C grammar, Lex specification:
http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_glslang_lexer.sh,
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
*/
@@ -20,7 +20,7 @@ WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
// found in the LICENSE file.
//
-// This file is auto-generated by generate_glslang_lexer.sh. DO NOT EDIT!
+// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
}
%{
@@ -120,6 +120,8 @@ O [0-7]
"sampler2D" { context->lexAfterType = true; return SAMPLER2D; }
"samplerCube" { context->lexAfterType = true; return SAMPLERCUBE; }
+"samplerExternalOES" { context->lexAfterType = true; return SAMPLER_EXTERNAL_OES; }
+"sampler2DRect" { context->lexAfterType = true; return SAMPLER2DRECT; }
"struct" { context->lexAfterType = true; return(STRUCT); }
@@ -480,6 +482,8 @@ void updateExtensionBehavior(const char* extName, const char* behavior)
msg = TString("extension '") + extName + "' is not supported";
context->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno);
break;
+ default:
+ ;
}
return;
} else
diff --git a/Source/ThirdParty/ANGLE/src/compiler/glslang.y b/Source/ThirdParty/ANGLE/src/compiler/glslang.y
index d05f44195..ec1a85cd5 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/glslang.y
+++ b/Source/ThirdParty/ANGLE/src/compiler/glslang.y
@@ -9,7 +9,7 @@ This file contains the Yacc grammar for GLSL ES.
Based on ANSI C Yacc grammar:
http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_glslang_parser.sh,
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
*/
@@ -20,7 +20,7 @@ WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
// found in the LICENSE file.
//
-// This file is auto-generated by generate_glslang_parser.sh. DO NOT EDIT!
+// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
#include "compiler/SymbolTable.h"
#include "compiler/ParseHelper.h"
@@ -98,7 +98,7 @@ extern void yyerror(TParseContext* context, const char* reason);
%token <lex> BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 VEC2 VEC3 VEC4
%token <lex> MATRIX2 MATRIX3 MATRIX4 IN_QUAL OUT_QUAL INOUT_QUAL UNIFORM VARYING
%token <lex> STRUCT VOID_TYPE WHILE
-%token <lex> SAMPLER2D SAMPLERCUBE
+%token <lex> SAMPLER2D SAMPLERCUBE SAMPLER_EXTERNAL_OES SAMPLER2DRECT
%token <lex> IDENTIFIER TYPE_NAME FLOATCONSTANT INTCONSTANT BOOLCONSTANT
%token <lex> FIELD_SELECTION
@@ -1615,6 +1615,24 @@ type_specifier_nonarray
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSamplerCube, qual, $1.line);
}
+ | SAMPLER_EXTERNAL_OES {
+ if (!context->supportsExtension("GL_OES_EGL_image_external")) {
+ context->error($1.line, "unsupported type", "samplerExternalOES", "");
+ context->recover();
+ }
+ FRAG_VERT_ONLY("samplerExternalOES", $1.line);
+ TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
+ $$.setBasic(EbtSamplerExternalOES, qual, $1.line);
+ }
+ | SAMPLER2DRECT {
+ if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
+ context->error($1.line, "unsupported type", "sampler2DRect", "");
+ context->recover();
+ }
+ FRAG_VERT_ONLY("sampler2DRect", $1.line);
+ TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
+ $$.setBasic(EbtSampler2DRect, qual, $1.line);
+ }
| struct_specifier {
FRAG_VERT_ONLY("struct", $1.line);
$$ = $1;
@@ -1633,11 +1651,11 @@ type_specifier_nonarray
;
struct_specifier
- : STRUCT IDENTIFIER LEFT_BRACE struct_declaration_list RIGHT_BRACE {
+ : STRUCT IDENTIFIER LEFT_BRACE { if (context->enterStructDeclaration($2.line, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE {
if (context->reservedErrorCheck($2.line, *$2.string))
context->recover();
- TType* structure = new TType($4, *$2.string);
+ TType* structure = new TType($5, *$2.string);
TVariable* userTypeDef = new TVariable($2.string, *structure, true);
if (! context->symbolTable.insert(*userTypeDef)) {
context->error($2.line, "redefinition", $2.string->c_str(), "struct");
@@ -1645,11 +1663,13 @@ struct_specifier
}
$$.setBasic(EbtStruct, EvqTemporary, $1.line);
$$.userDef = structure;
+ context->exitStructDeclaration();
}
- | STRUCT LEFT_BRACE struct_declaration_list RIGHT_BRACE {
- TType* structure = new TType($3, TString(""));
+ | STRUCT LEFT_BRACE { if (context->enterStructDeclaration($2.line, *$2.string)) context->recover(); } struct_declaration_list RIGHT_BRACE {
+ TType* structure = new TType($4, TString(""));
$$.setBasic(EbtStruct, EvqTemporary, $1.line);
$$.userDef = structure;
+ context->exitStructDeclaration();
}
;
@@ -1699,6 +1719,10 @@ struct_declaration
type->setStruct($1.userDef->getStruct());
type->setTypeName($1.userDef->getTypeName());
}
+
+ if (context->structNestingErrorCheck($1.line, *type)) {
+ context->recover();
+ }
}
}
;
diff --git a/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp b/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp
index fa28d4162..9e0bbb17b 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/glslang_lex.cpp
@@ -1,15 +1,15 @@
-#line 17 "compiler/glslang.l"
+#line 17 "./compiler/glslang.l"
//
// Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// This file is auto-generated by generate_glslang_lexer.sh. DO NOT EDIT!
+// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-#line 13 "compiler/glslang_lex.cpp"
+#line 13 "./compiler/glslang_lex.cpp"
#define YY_INT_ALIGNED short int
@@ -179,6 +179,11 @@ typedef void* yyscan_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
@@ -192,7 +197,7 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
*/
#define YY_LESS_LINENO(n) \
do { \
- int yyl;\
+ yy_size_t yyl;\
for ( yyl = n; yyl < yyleng; ++yyl )\
if ( yytext[yyl] == '\n' )\
--yylineno;\
@@ -214,11 +219,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -236,7 +236,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
- int yy_n_chars;
+ yy_size_t yy_n_chars;
/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
@@ -315,7 +315,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
void *yyalloc (yy_size_t ,yyscan_t yyscanner );
void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
@@ -371,8 +371,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 145
-#define YY_END_OF_BUFFER 146
+#define YY_NUM_RULES 147
+#define YY_END_OF_BUFFER 148
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -380,53 +380,55 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[411] =
+static yyconst flex_int16_t yy_accept[426] =
{ 0,
- 0, 0, 0, 0, 0, 0, 146, 144, 143, 143,
- 128, 134, 139, 123, 124, 132, 131, 120, 129, 127,
- 133, 92, 92, 121, 117, 135, 122, 136, 140, 88,
- 125, 126, 138, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 118, 137, 119, 130, 3, 4, 3,
- 142, 145, 141, 114, 100, 119, 108, 103, 98, 106,
- 96, 107, 97, 95, 2, 1, 99, 94, 90, 91,
- 0, 0, 92, 126, 118, 125, 115, 111, 113, 112,
- 116, 88, 104, 110, 88, 88, 88, 88, 88, 88,
-
- 88, 88, 88, 88, 17, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 20, 22,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 105, 109, 5, 141,
- 0, 1, 94, 0, 0, 93, 89, 101, 102, 48,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 18, 88, 88,
- 88, 88, 88, 88, 88, 88, 26, 88, 88, 88,
- 88, 88, 88, 88, 88, 23, 88, 88, 88, 88,
-
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 0, 95,
- 0, 94, 88, 28, 88, 88, 85, 88, 88, 88,
- 88, 88, 88, 88, 21, 51, 88, 88, 88, 88,
- 88, 56, 70, 88, 88, 88, 88, 88, 88, 88,
- 88, 67, 9, 33, 34, 35, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 54, 29, 88, 88, 88, 88, 88, 88, 36,
- 37, 38, 27, 88, 88, 88, 15, 42, 43, 44,
- 49, 12, 88, 88, 88, 88, 81, 82, 83, 88,
-
- 30, 71, 25, 78, 79, 80, 7, 75, 76, 77,
- 88, 24, 73, 88, 88, 39, 40, 41, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 68, 88, 88,
- 88, 88, 88, 88, 88, 50, 88, 87, 88, 88,
- 19, 88, 88, 88, 88, 69, 64, 59, 88, 88,
- 88, 88, 88, 74, 55, 88, 62, 32, 88, 84,
- 63, 47, 57, 88, 88, 88, 88, 88, 88, 88,
- 88, 58, 31, 88, 88, 88, 8, 88, 88, 88,
- 88, 88, 52, 13, 88, 14, 88, 88, 16, 65,
- 88, 88, 88, 60, 88, 88, 88, 53, 72, 61,
-
- 11, 66, 6, 86, 10, 45, 88, 88, 46, 0
+ 0, 0, 0, 0, 0, 0, 148, 146, 145, 145,
+ 130, 136, 141, 125, 126, 134, 133, 122, 131, 129,
+ 135, 94, 94, 123, 119, 137, 124, 138, 142, 90,
+ 127, 128, 140, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 120, 139, 121, 132, 3, 4, 3,
+ 144, 147, 143, 116, 102, 121, 110, 105, 100, 108,
+ 98, 109, 99, 97, 2, 1, 101, 96, 92, 93,
+ 0, 0, 94, 128, 120, 127, 117, 113, 115, 114,
+ 118, 90, 106, 112, 90, 90, 90, 90, 90, 90,
+
+ 90, 90, 90, 90, 17, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 20, 22,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 107, 111, 5, 143,
+ 0, 1, 96, 0, 0, 95, 91, 103, 104, 50,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 18, 90, 90,
+ 90, 90, 90, 90, 90, 90, 26, 90, 90, 90,
+ 90, 90, 90, 90, 90, 23, 90, 90, 90, 90,
+
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 0, 97,
+ 0, 96, 90, 28, 90, 90, 87, 90, 90, 90,
+ 90, 90, 90, 90, 21, 53, 90, 90, 90, 90,
+ 90, 58, 72, 90, 90, 90, 90, 90, 90, 90,
+ 90, 69, 9, 33, 34, 35, 90, 90, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
+ 90, 56, 29, 90, 90, 90, 90, 90, 90, 36,
+ 37, 38, 27, 90, 90, 90, 15, 42, 43, 44,
+ 51, 12, 90, 90, 90, 90, 83, 84, 85, 90,
+
+ 30, 73, 25, 80, 81, 82, 7, 77, 78, 79,
+ 90, 24, 75, 90, 90, 39, 40, 41, 90, 90,
+ 90, 90, 90, 90, 90, 90, 90, 70, 90, 90,
+ 90, 90, 90, 90, 90, 52, 90, 89, 90, 90,
+ 19, 90, 90, 90, 90, 71, 66, 61, 90, 90,
+ 90, 90, 90, 76, 57, 90, 64, 32, 90, 86,
+ 65, 49, 59, 90, 90, 90, 90, 90, 90, 90,
+ 90, 60, 31, 90, 90, 90, 8, 90, 90, 90,
+ 90, 90, 54, 13, 90, 14, 90, 90, 16, 67,
+ 90, 90, 90, 62, 90, 90, 90, 90, 55, 74,
+
+ 63, 11, 68, 6, 88, 10, 45, 90, 90, 90,
+ 90, 90, 90, 46, 90, 90, 90, 48, 90, 90,
+ 90, 90, 90, 47, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -438,13 +440,13 @@ static yyconst flex_int32_t yy_ec[256] =
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 16, 16, 16, 20, 20, 21, 22, 23,
24, 25, 26, 1, 27, 27, 28, 29, 30, 27,
- 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
- 31, 31, 31, 31, 31, 31, 31, 32, 31, 31,
- 33, 1, 34, 35, 31, 1, 36, 37, 38, 39,
+ 31, 31, 31, 31, 31, 31, 31, 31, 32, 31,
+ 31, 33, 34, 31, 31, 31, 31, 35, 31, 31,
+ 36, 1, 37, 38, 31, 1, 39, 40, 41, 42,
- 40, 41, 42, 43, 44, 31, 45, 46, 47, 48,
- 49, 50, 31, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 1, 1, 1, 1,
+ 43, 44, 45, 46, 47, 31, 48, 49, 50, 51,
+ 52, 53, 31, 54, 55, 56, 57, 58, 59, 60,
+ 61, 62, 63, 64, 65, 66, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -461,195 +463,201 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[64] =
+static yyconst flex_int32_t yy_meta[67] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 3, 3, 3, 3, 3, 3,
1, 1, 1, 1, 1, 1, 3, 3, 3, 3,
- 4, 4, 1, 1, 1, 3, 3, 3, 3, 3,
- 3, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
- 1, 1, 1
+ 4, 4, 4, 4, 4, 1, 1, 1, 3, 3,
+ 3, 3, 3, 3, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 1, 1, 1, 1
} ;
-static yyconst flex_int16_t yy_base[416] =
+static yyconst flex_int16_t yy_base[431] =
{ 0,
- 0, 0, 61, 62, 71, 0, 606, 607, 607, 607,
- 581, 42, 129, 607, 607, 580, 126, 607, 125, 123,
- 137, 149, 157, 578, 607, 175, 578, 44, 607, 0,
- 607, 607, 120, 95, 103, 142, 146, 136, 156, 552,
- 168, 162, 551, 120, 158, 545, 173, 558, 172, 178,
- 111, 186, 554, 607, 159, 607, 607, 607, 607, 582,
- 607, 607, 0, 607, 607, 607, 607, 607, 607, 607,
- 607, 607, 607, 222, 607, 0, 607, 228, 254, 262,
- 281, 0, 290, 607, 607, 607, 571, 607, 607, 607,
- 570, 0, 607, 607, 546, 539, 542, 550, 549, 536,
-
- 551, 538, 544, 532, 529, 542, 529, 526, 526, 532,
- 520, 527, 524, 534, 520, 526, 529, 530, 0, 204,
- 529, 207, 515, 528, 519, 521, 511, 525, 522, 524,
- 507, 512, 509, 498, 183, 512, 508, 510, 499, 502,
- 212, 507, 499, 511, 186, 504, 607, 607, 607, 0,
- 306, 0, 316, 332, 270, 342, 0, 607, 607, 0,
- 496, 500, 509, 506, 490, 490, 161, 505, 502, 502,
- 500, 497, 489, 495, 482, 493, 496, 0, 493, 481,
- 488, 485, 489, 482, 471, 470, 483, 486, 483, 478,
- 469, 294, 474, 477, 468, 465, 469, 475, 466, 457,
-
- 460, 458, 468, 454, 452, 452, 454, 451, 462, 461,
- 278, 456, 451, 440, 320, 458, 460, 449, 348, 354,
- 360, 366, 450, 0, 448, 336, 0, 440, 438, 446,
- 435, 452, 441, 370, 0, 0, 435, 445, 445, 430,
- 373, 0, 0, 432, 376, 433, 427, 426, 427, 426,
- 379, 0, 0, 0, 0, 0, 422, 423, 428, 419,
- 432, 427, 426, 418, 422, 414, 417, 421, 426, 425,
- 416, 0, 0, 422, 411, 411, 416, 415, 412, 0,
- 0, 0, 0, 402, 414, 416, 0, 0, 0, 0,
- 0, 0, 404, 405, 399, 409, 0, 0, 0, 400,
+ 0, 0, 64, 65, 74, 0, 627, 628, 628, 628,
+ 602, 45, 135, 628, 628, 601, 132, 628, 131, 129,
+ 143, 155, 163, 599, 628, 179, 599, 47, 628, 0,
+ 628, 628, 126, 98, 108, 147, 158, 158, 165, 570,
+ 130, 107, 569, 148, 156, 563, 172, 576, 174, 181,
+ 177, 195, 572, 628, 173, 628, 628, 628, 628, 603,
+ 628, 628, 0, 628, 628, 628, 628, 628, 628, 628,
+ 628, 628, 628, 233, 628, 0, 628, 239, 255, 271,
+ 287, 0, 300, 628, 628, 628, 592, 628, 628, 628,
+ 591, 0, 628, 628, 564, 557, 560, 568, 567, 554,
+
+ 569, 556, 562, 550, 547, 560, 547, 544, 544, 550,
+ 538, 545, 542, 552, 538, 544, 547, 548, 0, 187,
+ 547, 241, 533, 546, 537, 539, 529, 543, 540, 542,
+ 525, 530, 527, 516, 192, 530, 526, 528, 517, 520,
+ 274, 525, 517, 529, 114, 522, 628, 628, 628, 0,
+ 316, 0, 322, 338, 344, 351, 0, 628, 628, 0,
+ 514, 518, 527, 524, 508, 508, 205, 523, 520, 520,
+ 518, 515, 507, 513, 500, 511, 514, 0, 511, 499,
+ 506, 503, 507, 500, 489, 488, 501, 504, 501, 496,
+ 487, 247, 492, 495, 486, 483, 487, 493, 484, 475,
+
+ 478, 476, 486, 472, 470, 470, 472, 469, 480, 479,
+ 328, 474, 469, 458, 260, 476, 478, 467, 358, 366,
+ 372, 378, 468, 0, 466, 276, 0, 458, 456, 464,
+ 453, 470, 459, 291, 0, 0, 453, 463, 463, 448,
+ 305, 0, 0, 450, 327, 451, 445, 444, 445, 444,
+ 382, 0, 0, 0, 0, 0, 440, 441, 446, 437,
+ 450, 445, 444, 436, 440, 432, 435, 439, 444, 443,
+ 434, 0, 0, 440, 429, 429, 434, 433, 430, 0,
+ 0, 0, 0, 420, 432, 434, 0, 0, 0, 0,
+ 0, 0, 422, 423, 417, 427, 0, 0, 0, 418,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 407, 0, 0, 405, 401, 0, 0, 0, 397, 393,
- 398, 388, 401, 387, 400, 389, 396, 0, 394, 396,
- 380, 389, 395, 390, 378, 0, 380, 0, 379, 382,
- 0, 371, 370, 370, 383, 0, 385, 0, 384, 383,
- 368, 381, 368, 0, 0, 371, 0, 0, 363, 0,
- 0, 0, 0, 360, 371, 364, 368, 303, 297, 288,
- 300, 0, 0, 283, 290, 269, 0, 277, 274, 255,
- 232, 255, 0, 0, 244, 0, 236, 226, 0, 0,
- 225, 208, 211, 0, 185, 202, 131, 0, 0, 0,
-
- 0, 0, 0, 0, 0, 0, 134, 117, 0, 607,
- 398, 400, 402, 406, 142
+ 425, 0, 0, 423, 419, 0, 0, 0, 415, 411,
+ 416, 406, 419, 405, 418, 407, 414, 0, 412, 414,
+ 398, 407, 413, 408, 396, 0, 398, 0, 397, 400,
+ 0, 389, 388, 388, 401, 0, 403, 0, 402, 401,
+ 386, 399, 386, 0, 0, 389, 0, 0, 381, 0,
+ 0, 0, 0, 378, 389, 382, 388, 385, 380, 372,
+ 382, 0, 0, 365, 371, 360, 0, 369, 366, 356,
+ 385, 364, 0, 0, 364, 0, 362, 361, 0, 0,
+ 360, 323, 308, 0, 298, 318, 270, 265, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 279, 271, 240, 240,
+ 238, 237, 226, 0, 208, 188, 190, 0, 186, 173,
+ 187, 164, 158, 0, 628, 415, 417, 419, 423, 186
} ;
-static yyconst flex_int16_t yy_def[416] =
+static yyconst flex_int16_t yy_def[431] =
{ 0,
- 410, 1, 411, 411, 410, 5, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 412,
- 410, 410, 410, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 413, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 414, 410, 410, 410, 410,
- 410, 415, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 412, 410, 410, 412, 412, 412, 412, 412, 412,
-
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 410, 410, 410, 413,
- 410, 414, 410, 410, 410, 410, 415, 410, 410, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
-
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 410, 410,
- 410, 410, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
-
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 412,
-
- 412, 412, 412, 412, 412, 412, 412, 412, 412, 0,
- 410, 410, 410, 410, 410
+ 425, 1, 426, 426, 425, 5, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 427,
+ 425, 425, 425, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 428, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 429, 425, 425, 425, 425,
+ 425, 430, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 427, 425, 425, 427, 427, 427, 427, 427, 427,
+
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 425, 425, 425, 428,
+ 425, 429, 425, 425, 425, 425, 430, 425, 425, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 425, 425,
+ 425, 425, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 427, 427, 427, 427, 427, 427,
+ 427, 427, 427, 427, 0, 425, 425, 425, 425, 425
} ;
-static yyconst flex_int16_t yy_nxt[671] =
+static yyconst flex_int16_t yy_nxt[695] =
{ 0,
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 23, 23, 23, 23,
24, 25, 26, 27, 28, 29, 30, 30, 30, 30,
- 30, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 30, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 30, 30, 30, 54,
- 55, 56, 57, 59, 59, 65, 66, 90, 91, 60,
- 60, 8, 61, 62, 8, 8, 8, 8, 8, 8,
+ 30, 30, 30, 30, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 30, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 30,
+ 30, 30, 54, 55, 56, 57, 59, 59, 65, 66,
+ 90, 91, 60, 60, 8, 61, 62, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 63, 63, 63,
- 63, 63, 63, 8, 8, 8, 63, 63, 63, 63,
- 63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
+ 63, 63, 63, 63, 63, 63, 63, 63, 63, 8,
+ 8, 8, 63, 63, 63, 63, 63, 63, 63, 63,
63, 63, 63, 63, 63, 63, 63, 63, 63, 63,
- 8, 8, 8, 8, 67, 70, 72, 74, 74, 74,
- 74, 74, 74, 93, 157, 75, 95, 96, 73, 71,
- 76, 97, 68, 98, 94, 123, 409, 99, 141, 124,
- 77, 78, 142, 79, 79, 79, 79, 79, 80, 78,
- 408, 83, 83, 83, 83, 83, 83, 100, 81, 85,
- 82, 107, 147, 108, 407, 103, 81, 101, 81, 104,
- 102, 110, 109, 125, 105, 86, 81, 87, 88, 111,
-
- 106, 112, 119, 116, 113, 82, 126, 132, 128, 120,
- 114, 117, 229, 230, 133, 134, 121, 137, 204, 148,
- 138, 143, 118, 129, 135, 144, 130, 136, 139, 216,
- 406, 217, 405, 205, 145, 140, 74, 74, 74, 74,
- 74, 74, 153, 153, 153, 153, 153, 153, 396, 184,
- 404, 151, 185, 186, 190, 211, 187, 154, 188, 397,
- 403, 151, 191, 212, 402, 401, 78, 154, 79, 79,
- 79, 79, 79, 80, 78, 400, 80, 80, 80, 80,
- 80, 80, 399, 81, 156, 156, 156, 156, 156, 156,
- 155, 81, 155, 81, 398, 156, 156, 156, 156, 156,
-
- 156, 81, 78, 395, 83, 83, 83, 83, 83, 83,
- 254, 255, 256, 394, 393, 219, 392, 219, 275, 81,
- 220, 220, 220, 220, 220, 220, 276, 391, 390, 81,
- 153, 153, 153, 153, 153, 153, 280, 281, 282, 389,
- 388, 221, 387, 221, 386, 154, 222, 222, 222, 222,
- 222, 222, 288, 289, 290, 154, 156, 156, 156, 156,
- 156, 156, 220, 220, 220, 220, 220, 220, 220, 220,
- 220, 220, 220, 220, 222, 222, 222, 222, 222, 222,
- 222, 222, 222, 222, 222, 222, 297, 298, 299, 304,
- 305, 306, 308, 309, 310, 316, 317, 318, 58, 58,
-
- 58, 58, 92, 92, 150, 150, 152, 385, 152, 152,
- 384, 383, 382, 381, 380, 379, 378, 377, 376, 375,
- 374, 373, 372, 371, 370, 369, 368, 367, 366, 365,
- 364, 363, 362, 361, 360, 359, 358, 357, 356, 355,
- 354, 353, 352, 351, 350, 349, 348, 347, 346, 345,
- 344, 343, 342, 341, 340, 339, 338, 337, 336, 335,
- 334, 333, 332, 331, 330, 329, 328, 327, 326, 325,
- 324, 323, 322, 321, 320, 319, 315, 314, 313, 312,
- 311, 307, 303, 302, 301, 300, 296, 295, 294, 293,
- 292, 291, 287, 286, 285, 284, 283, 279, 278, 277,
-
- 274, 273, 272, 271, 270, 269, 268, 267, 266, 265,
- 264, 263, 262, 261, 260, 259, 258, 257, 253, 252,
- 251, 250, 249, 248, 247, 246, 245, 244, 243, 242,
- 241, 240, 239, 238, 237, 236, 235, 234, 233, 232,
- 231, 228, 227, 226, 225, 224, 223, 218, 215, 214,
- 213, 210, 209, 208, 207, 206, 203, 202, 201, 200,
- 199, 198, 197, 196, 195, 194, 193, 192, 189, 183,
- 182, 181, 180, 179, 178, 177, 176, 175, 174, 173,
- 172, 171, 170, 169, 168, 167, 166, 165, 164, 163,
- 162, 161, 160, 159, 158, 149, 146, 131, 127, 122,
-
- 115, 89, 84, 69, 64, 410, 7, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410
+ 63, 63, 63, 63, 63, 63, 8, 8, 8, 8,
+ 67, 70, 72, 74, 74, 74, 74, 74, 74, 93,
+ 119, 75, 95, 96, 73, 71, 76, 120, 68, 97,
+ 216, 98, 217, 94, 121, 99, 77, 78, 116, 79,
+ 79, 79, 79, 79, 80, 78, 117, 83, 83, 83,
+ 83, 83, 83, 85, 81, 100, 123, 118, 157, 82,
+ 124, 424, 81, 423, 125, 101, 147, 81, 102, 86,
+
+ 103, 87, 88, 110, 104, 81, 107, 126, 108, 105,
+ 128, 111, 132, 112, 82, 106, 113, 109, 422, 133,
+ 134, 421, 114, 137, 420, 129, 138, 141, 130, 135,
+ 204, 142, 136, 143, 139, 184, 148, 144, 185, 186,
+ 419, 140, 187, 418, 188, 205, 145, 74, 74, 74,
+ 74, 74, 74, 153, 153, 153, 153, 153, 153, 229,
+ 230, 417, 151, 254, 255, 256, 416, 78, 154, 79,
+ 79, 79, 79, 79, 80, 151, 280, 281, 282, 415,
+ 414, 154, 413, 78, 81, 80, 80, 80, 80, 80,
+ 80, 190, 288, 289, 290, 412, 155, 81, 155, 191,
+
+ 81, 156, 156, 156, 156, 156, 156, 297, 298, 299,
+ 411, 410, 78, 81, 83, 83, 83, 83, 83, 83,
+ 211, 304, 305, 306, 409, 219, 408, 219, 212, 81,
+ 220, 220, 220, 220, 220, 220, 153, 153, 153, 153,
+ 153, 153, 81, 308, 309, 310, 407, 221, 406, 221,
+ 405, 154, 222, 222, 222, 222, 222, 222, 156, 156,
+ 156, 156, 156, 156, 154, 156, 156, 156, 156, 156,
+ 156, 275, 220, 220, 220, 220, 220, 220, 404, 276,
+ 220, 220, 220, 220, 220, 220, 222, 222, 222, 222,
+ 222, 222, 222, 222, 222, 222, 222, 222, 316, 317,
+
+ 318, 396, 403, 402, 401, 400, 399, 395, 394, 393,
+ 392, 391, 397, 390, 398, 58, 58, 58, 58, 92,
+ 92, 150, 150, 152, 389, 152, 152, 388, 387, 386,
+ 385, 384, 383, 382, 381, 380, 379, 378, 377, 376,
+ 375, 374, 373, 372, 371, 370, 369, 368, 367, 366,
+ 365, 364, 363, 362, 361, 360, 359, 358, 357, 356,
+ 355, 354, 353, 352, 351, 350, 349, 348, 347, 346,
+ 345, 344, 343, 342, 341, 340, 339, 338, 337, 336,
+ 335, 334, 333, 332, 331, 330, 329, 328, 327, 326,
+ 325, 324, 323, 322, 321, 320, 319, 315, 314, 313,
+
+ 312, 311, 307, 303, 302, 301, 300, 296, 295, 294,
+ 293, 292, 291, 287, 286, 285, 284, 283, 279, 278,
+ 277, 274, 273, 272, 271, 270, 269, 268, 267, 266,
+ 265, 264, 263, 262, 261, 260, 259, 258, 257, 253,
+ 252, 251, 250, 249, 248, 247, 246, 245, 244, 243,
+ 242, 241, 240, 239, 238, 237, 236, 235, 234, 233,
+ 232, 231, 228, 227, 226, 225, 224, 223, 218, 215,
+ 214, 213, 210, 209, 208, 207, 206, 203, 202, 201,
+ 200, 199, 198, 197, 196, 195, 194, 193, 192, 189,
+ 183, 182, 181, 180, 179, 178, 177, 176, 175, 174,
+
+ 173, 172, 171, 170, 169, 168, 167, 166, 165, 164,
+ 163, 162, 161, 160, 159, 158, 149, 146, 131, 127,
+ 122, 115, 89, 84, 69, 64, 425, 7, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425
+
} ;
-static yyconst flex_int16_t yy_chk[671] =
+static yyconst flex_int16_t yy_chk[695] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -657,77 +665,81 @@ static yyconst flex_int16_t yy_chk[671] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 3, 4, 12, 12, 28, 28, 3,
- 4, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 1, 1, 1, 1, 1, 1, 3, 4, 12, 12,
+ 28, 28, 3, 4, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 13, 17, 19, 20, 20, 20,
- 20, 20, 20, 33, 415, 21, 34, 34, 19, 17,
- 21, 35, 13, 35, 33, 44, 408, 35, 51, 44,
- 21, 22, 51, 22, 22, 22, 22, 22, 22, 23,
- 407, 23, 23, 23, 23, 23, 23, 36, 22, 26,
- 22, 38, 55, 38, 397, 37, 23, 36, 22, 37,
- 36, 39, 38, 45, 37, 26, 23, 26, 26, 39,
-
- 37, 39, 42, 41, 39, 22, 45, 49, 47, 42,
- 39, 41, 167, 167, 49, 49, 42, 50, 135, 55,
- 50, 52, 41, 47, 49, 52, 47, 49, 50, 145,
- 396, 145, 395, 135, 52, 50, 74, 74, 74, 74,
- 74, 74, 78, 78, 78, 78, 78, 78, 381, 120,
- 393, 74, 120, 120, 122, 141, 120, 78, 120, 381,
- 392, 74, 122, 141, 391, 388, 79, 78, 79, 79,
- 79, 79, 79, 79, 80, 387, 80, 80, 80, 80,
- 80, 80, 385, 79, 155, 155, 155, 155, 155, 155,
- 81, 80, 81, 79, 382, 81, 81, 81, 81, 81,
-
- 81, 80, 83, 380, 83, 83, 83, 83, 83, 83,
- 192, 192, 192, 379, 378, 151, 376, 151, 211, 83,
- 151, 151, 151, 151, 151, 151, 211, 375, 374, 83,
- 153, 153, 153, 153, 153, 153, 215, 215, 215, 371,
- 370, 154, 369, 154, 368, 153, 154, 154, 154, 154,
- 154, 154, 226, 226, 226, 153, 156, 156, 156, 156,
- 156, 156, 219, 219, 219, 219, 219, 219, 220, 220,
- 220, 220, 220, 220, 221, 221, 221, 221, 221, 221,
- 222, 222, 222, 222, 222, 222, 234, 234, 234, 241,
- 241, 241, 245, 245, 245, 251, 251, 251, 411, 411,
-
- 411, 411, 412, 412, 413, 413, 414, 367, 414, 414,
- 366, 365, 364, 359, 356, 353, 352, 351, 350, 349,
- 347, 345, 344, 343, 342, 340, 339, 337, 335, 334,
- 333, 332, 331, 330, 329, 327, 326, 325, 324, 323,
- 322, 321, 320, 319, 315, 314, 311, 300, 296, 295,
- 294, 293, 286, 285, 284, 279, 278, 277, 276, 275,
- 274, 271, 270, 269, 268, 267, 266, 265, 264, 263,
- 262, 261, 260, 259, 258, 257, 250, 249, 248, 247,
- 246, 244, 240, 239, 238, 237, 233, 232, 231, 230,
- 229, 228, 225, 223, 218, 217, 216, 214, 213, 212,
-
- 210, 209, 208, 207, 206, 205, 204, 203, 202, 201,
- 200, 199, 198, 197, 196, 195, 194, 193, 191, 190,
- 189, 188, 187, 186, 185, 184, 183, 182, 181, 180,
- 179, 177, 176, 175, 174, 173, 172, 171, 170, 169,
- 168, 166, 165, 164, 163, 162, 161, 146, 144, 143,
- 142, 140, 139, 138, 137, 136, 134, 133, 132, 131,
- 130, 129, 128, 127, 126, 125, 124, 123, 121, 118,
- 117, 116, 115, 114, 113, 112, 111, 110, 109, 108,
- 107, 106, 105, 104, 103, 102, 101, 100, 99, 98,
- 97, 96, 95, 91, 87, 60, 53, 48, 46, 43,
-
- 40, 27, 24, 16, 11, 7, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410,
- 410, 410, 410, 410, 410, 410, 410, 410, 410, 410
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 13, 17, 19, 20, 20, 20, 20, 20, 20, 33,
+ 42, 21, 34, 34, 19, 17, 21, 42, 13, 35,
+ 145, 35, 145, 33, 42, 35, 21, 22, 41, 22,
+ 22, 22, 22, 22, 22, 23, 41, 23, 23, 23,
+ 23, 23, 23, 26, 22, 36, 44, 41, 430, 22,
+ 44, 423, 23, 422, 45, 36, 55, 22, 36, 26,
+
+ 37, 26, 26, 39, 37, 23, 38, 45, 38, 37,
+ 47, 39, 49, 39, 22, 37, 39, 38, 421, 49,
+ 49, 420, 39, 50, 419, 47, 50, 51, 47, 49,
+ 135, 51, 49, 52, 50, 120, 55, 52, 120, 120,
+ 417, 50, 120, 416, 120, 135, 52, 74, 74, 74,
+ 74, 74, 74, 78, 78, 78, 78, 78, 78, 167,
+ 167, 415, 74, 192, 192, 192, 413, 79, 78, 79,
+ 79, 79, 79, 79, 79, 74, 215, 215, 215, 412,
+ 411, 78, 410, 80, 79, 80, 80, 80, 80, 80,
+ 80, 122, 226, 226, 226, 409, 81, 79, 81, 122,
+
+ 80, 81, 81, 81, 81, 81, 81, 234, 234, 234,
+ 408, 407, 83, 80, 83, 83, 83, 83, 83, 83,
+ 141, 241, 241, 241, 398, 151, 397, 151, 141, 83,
+ 151, 151, 151, 151, 151, 151, 153, 153, 153, 153,
+ 153, 153, 83, 245, 245, 245, 396, 154, 395, 154,
+ 393, 153, 154, 154, 154, 154, 154, 154, 155, 155,
+ 155, 155, 155, 155, 153, 156, 156, 156, 156, 156,
+ 156, 211, 219, 219, 219, 219, 219, 219, 392, 211,
+ 220, 220, 220, 220, 220, 220, 221, 221, 221, 221,
+ 221, 221, 222, 222, 222, 222, 222, 222, 251, 251,
+
+ 251, 381, 391, 388, 387, 385, 382, 380, 379, 378,
+ 376, 375, 381, 374, 381, 426, 426, 426, 426, 427,
+ 427, 428, 428, 429, 371, 429, 429, 370, 369, 368,
+ 367, 366, 365, 364, 359, 356, 353, 352, 351, 350,
+ 349, 347, 345, 344, 343, 342, 340, 339, 337, 335,
+ 334, 333, 332, 331, 330, 329, 327, 326, 325, 324,
+ 323, 322, 321, 320, 319, 315, 314, 311, 300, 296,
+ 295, 294, 293, 286, 285, 284, 279, 278, 277, 276,
+ 275, 274, 271, 270, 269, 268, 267, 266, 265, 264,
+ 263, 262, 261, 260, 259, 258, 257, 250, 249, 248,
+
+ 247, 246, 244, 240, 239, 238, 237, 233, 232, 231,
+ 230, 229, 228, 225, 223, 218, 217, 216, 214, 213,
+ 212, 210, 209, 208, 207, 206, 205, 204, 203, 202,
+ 201, 200, 199, 198, 197, 196, 195, 194, 193, 191,
+ 190, 189, 188, 187, 186, 185, 184, 183, 182, 181,
+ 180, 179, 177, 176, 175, 174, 173, 172, 171, 170,
+ 169, 168, 166, 165, 164, 163, 162, 161, 146, 144,
+ 143, 142, 140, 139, 138, 137, 136, 134, 133, 132,
+ 131, 130, 129, 128, 127, 126, 125, 124, 123, 121,
+ 118, 117, 116, 115, 114, 113, 112, 111, 110, 109,
+
+ 108, 107, 106, 105, 104, 103, 102, 101, 100, 99,
+ 98, 97, 96, 95, 91, 87, 60, 53, 48, 46,
+ 43, 40, 27, 24, 16, 11, 7, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425, 425, 425, 425, 425, 425, 425,
+ 425, 425, 425, 425
+
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[146] =
+static yyconst flex_int32_t yy_rule_can_match_eol[148] =
{ 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -736,7 +748,7 @@ static yyconst flex_int32_t yy_rule_can_match_eol[146] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 0, 0, };
+ 0, 0, 0, 0, 0, 1, 0, 0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -756,7 +768,7 @@ This file contains the Lex specification for GLSL ES.
Based on ANSI C grammar, Lex specification:
http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_glslang_lexer.sh,
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
*/
@@ -797,8 +809,8 @@ struct yyguts_t
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
- int yy_n_chars;
- int yyleng_r;
+ yy_size_t yy_n_chars;
+ yy_size_t yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
@@ -851,7 +863,7 @@ FILE *yyget_out (yyscan_t yyscanner );
void yyset_out (FILE * out_str ,yyscan_t yyscanner );
-int yyget_leng (yyscan_t yyscanner );
+yy_size_t yyget_leng (yyscan_t yyscanner );
char *yyget_text (yyscan_t yyscanner );
@@ -859,10 +871,6 @@ int yyget_lineno (yyscan_t yyscanner );
void yyset_lineno (int line_number ,yyscan_t yyscanner );
-int yyget_column (yyscan_t yyscanner );
-
-void yyset_column (int column_no ,yyscan_t yyscanner );
-
YYSTYPE * yyget_lval (yyscan_t yyscanner );
void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
@@ -913,7 +921,7 @@ static int input (yyscan_t yyscanner );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -924,7 +932,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- unsigned n; \
+ yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1066,13 +1074,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 411 )
+ if ( yy_current_state >= 426 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 410 );
+ while ( yy_current_state != 425 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@@ -1083,7 +1091,7 @@ yy_find_action:
if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
{
- int yyl;
+ yy_size_t yyl;
for ( yyl = 0; yyl < yyleng; ++yyl )
if ( yytext[yyl] == '\n' )
@@ -1289,15 +1297,15 @@ YY_RULE_SETUP
YY_BREAK
case 47:
YY_RULE_SETUP
-{ context->lexAfterType = true; return(STRUCT); }
+{ context->lexAfterType = true; return SAMPLER_EXTERNAL_OES; }
YY_BREAK
case 48:
YY_RULE_SETUP
-{ return reserved_word(yyscanner); }
+{ context->lexAfterType = true; return SAMPLER2DRECT; }
YY_BREAK
case 49:
YY_RULE_SETUP
-{ return reserved_word(yyscanner); }
+{ context->lexAfterType = true; return(STRUCT); }
YY_BREAK
case 50:
YY_RULE_SETUP
@@ -1453,220 +1461,228 @@ YY_RULE_SETUP
YY_BREAK
case 88:
YY_RULE_SETUP
+{ return reserved_word(yyscanner); }
+ YY_BREAK
+case 89:
+YY_RULE_SETUP
+{ return reserved_word(yyscanner); }
+ YY_BREAK
+case 90:
+YY_RULE_SETUP
{
yylval->lex.string = NewPoolTString(yytext);
return check_type(yyscanner);
}
YY_BREAK
-case 89:
+case 91:
YY_RULE_SETUP
{ yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
YY_BREAK
-case 90:
+case 92:
YY_RULE_SETUP
{ yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
YY_BREAK
-case 91:
+case 93:
YY_RULE_SETUP
{ context->error(yylineno, "Invalid Octal number.", yytext, "", ""); context->recover(); return 0;}
YY_BREAK
-case 92:
+case 94:
YY_RULE_SETUP
{ yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
YY_BREAK
-case 93:
+case 95:
YY_RULE_SETUP
{ yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
YY_BREAK
-case 94:
+case 96:
YY_RULE_SETUP
{ yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
YY_BREAK
-case 95:
+case 97:
YY_RULE_SETUP
{ yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
YY_BREAK
-case 96:
+case 98:
YY_RULE_SETUP
{ return(ADD_ASSIGN); }
YY_BREAK
-case 97:
+case 99:
YY_RULE_SETUP
{ return(SUB_ASSIGN); }
YY_BREAK
-case 98:
+case 100:
YY_RULE_SETUP
{ return(MUL_ASSIGN); }
YY_BREAK
-case 99:
+case 101:
YY_RULE_SETUP
{ return(DIV_ASSIGN); }
YY_BREAK
-case 100:
+case 102:
YY_RULE_SETUP
{ return(MOD_ASSIGN); }
YY_BREAK
-case 101:
+case 103:
YY_RULE_SETUP
{ return(LEFT_ASSIGN); }
YY_BREAK
-case 102:
+case 104:
YY_RULE_SETUP
{ return(RIGHT_ASSIGN); }
YY_BREAK
-case 103:
+case 105:
YY_RULE_SETUP
{ return(AND_ASSIGN); }
YY_BREAK
-case 104:
+case 106:
YY_RULE_SETUP
{ return(XOR_ASSIGN); }
YY_BREAK
-case 105:
+case 107:
YY_RULE_SETUP
{ return(OR_ASSIGN); }
YY_BREAK
-case 106:
+case 108:
YY_RULE_SETUP
{ return(INC_OP); }
YY_BREAK
-case 107:
+case 109:
YY_RULE_SETUP
{ return(DEC_OP); }
YY_BREAK
-case 108:
+case 110:
YY_RULE_SETUP
{ return(AND_OP); }
YY_BREAK
-case 109:
+case 111:
YY_RULE_SETUP
{ return(OR_OP); }
YY_BREAK
-case 110:
+case 112:
YY_RULE_SETUP
{ return(XOR_OP); }
YY_BREAK
-case 111:
+case 113:
YY_RULE_SETUP
{ return(LE_OP); }
YY_BREAK
-case 112:
+case 114:
YY_RULE_SETUP
{ return(GE_OP); }
YY_BREAK
-case 113:
+case 115:
YY_RULE_SETUP
{ return(EQ_OP); }
YY_BREAK
-case 114:
+case 116:
YY_RULE_SETUP
{ return(NE_OP); }
YY_BREAK
-case 115:
+case 117:
YY_RULE_SETUP
{ return(LEFT_OP); }
YY_BREAK
-case 116:
+case 118:
YY_RULE_SETUP
{ return(RIGHT_OP); }
YY_BREAK
-case 117:
+case 119:
YY_RULE_SETUP
{ context->lexAfterType = false; return(SEMICOLON); }
YY_BREAK
-case 118:
+case 120:
YY_RULE_SETUP
{ context->lexAfterType = false; return(LEFT_BRACE); }
YY_BREAK
-case 119:
+case 121:
YY_RULE_SETUP
{ return(RIGHT_BRACE); }
YY_BREAK
-case 120:
+case 122:
YY_RULE_SETUP
{ if (context->inTypeParen) context->lexAfterType = false; return(COMMA); }
YY_BREAK
-case 121:
+case 123:
YY_RULE_SETUP
{ return(COLON); }
YY_BREAK
-case 122:
+case 124:
YY_RULE_SETUP
{ context->lexAfterType = false; return(EQUAL); }
YY_BREAK
-case 123:
+case 125:
YY_RULE_SETUP
{ context->lexAfterType = false; context->inTypeParen = true; return(LEFT_PAREN); }
YY_BREAK
-case 124:
+case 126:
YY_RULE_SETUP
{ context->inTypeParen = false; return(RIGHT_PAREN); }
YY_BREAK
-case 125:
+case 127:
YY_RULE_SETUP
{ return(LEFT_BRACKET); }
YY_BREAK
-case 126:
+case 128:
YY_RULE_SETUP
{ return(RIGHT_BRACKET); }
YY_BREAK
-case 127:
+case 129:
YY_RULE_SETUP
{ BEGIN(FIELDS); return(DOT); }
YY_BREAK
-case 128:
+case 130:
YY_RULE_SETUP
{ return(BANG); }
YY_BREAK
-case 129:
+case 131:
YY_RULE_SETUP
{ return(DASH); }
YY_BREAK
-case 130:
+case 132:
YY_RULE_SETUP
{ return(TILDE); }
YY_BREAK
-case 131:
+case 133:
YY_RULE_SETUP
{ return(PLUS); }
YY_BREAK
-case 132:
+case 134:
YY_RULE_SETUP
{ return(STAR); }
YY_BREAK
-case 133:
+case 135:
YY_RULE_SETUP
{ return(SLASH); }
YY_BREAK
-case 134:
+case 136:
YY_RULE_SETUP
{ return(PERCENT); }
YY_BREAK
-case 135:
+case 137:
YY_RULE_SETUP
{ return(LEFT_ANGLE); }
YY_BREAK
-case 136:
+case 138:
YY_RULE_SETUP
{ return(RIGHT_ANGLE); }
YY_BREAK
-case 137:
+case 139:
YY_RULE_SETUP
{ return(VERTICAL_BAR); }
YY_BREAK
-case 138:
+case 140:
YY_RULE_SETUP
{ return(CARET); }
YY_BREAK
-case 139:
+case 141:
YY_RULE_SETUP
{ return(AMPERSAND); }
YY_BREAK
-case 140:
+case 142:
YY_RULE_SETUP
{ return(QUESTION); }
YY_BREAK
-case 141:
+case 143:
YY_RULE_SETUP
{
BEGIN(INITIAL);
@@ -1674,12 +1690,12 @@ YY_RULE_SETUP
return FIELD_SELECTION;
}
YY_BREAK
-case 142:
+case 144:
YY_RULE_SETUP
{}
YY_BREAK
-case 143:
-/* rule 143 can match eol */
+case 145:
+/* rule 145 can match eol */
YY_RULE_SETUP
{ }
YY_BREAK
@@ -1688,11 +1704,11 @@ case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(FIELDS):
{ context->AfterEOF = true; yyterminate(); }
YY_BREAK
-case 144:
+case 146:
YY_RULE_SETUP
{ context->warning(yylineno, "Unknown char", yytext, ""); return 0; }
YY_BREAK
-case 145:
+case 147:
YY_RULE_SETUP
ECHO;
YY_BREAK
@@ -1881,7 +1897,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- int num_to_read =
+ yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -1895,7 +1911,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( b->yy_is_our_buffer )
{
- int new_size = b->yy_buf_size * 2;
+ yy_size_t new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -1926,7 +1942,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- yyg->yy_n_chars, (size_t) num_to_read );
+ yyg->yy_n_chars, num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -1988,7 +2004,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 411 )
+ if ( yy_current_state >= 426 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2017,11 +2033,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 411 )
+ if ( yy_current_state >= 426 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 410);
+ yy_is_jam = (yy_current_state == 425);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -2051,7 +2067,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -2075,7 +2091,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
case EOB_ACT_END_OF_FILE:
{
if ( yywrap(yyscanner ) )
- return EOF;
+ return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
@@ -2338,7 +2354,7 @@ void yypop_buffer_state (yyscan_t yyscanner)
*/
static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -2436,12 +2452,11 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
- yy_size_t n;
- int i;
+ yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
@@ -2591,7 +2606,7 @@ FILE *yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int yyget_leng (yyscan_t yyscanner)
+yy_size_t yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -3100,6 +3115,8 @@ void updateExtensionBehavior(const char* extName, const char* behavior)
msg = TString("extension '") + extName + "' is not supported";
context->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno);
break;
+ default:
+ ;
}
return;
} else
diff --git a/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp b/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp
index 47ca2ee61..f696272d5 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.cpp
@@ -106,57 +106,59 @@
WHILE = 295,
SAMPLER2D = 296,
SAMPLERCUBE = 297,
- IDENTIFIER = 298,
- TYPE_NAME = 299,
- FLOATCONSTANT = 300,
- INTCONSTANT = 301,
- BOOLCONSTANT = 302,
- FIELD_SELECTION = 303,
- LEFT_OP = 304,
- RIGHT_OP = 305,
- INC_OP = 306,
- DEC_OP = 307,
- LE_OP = 308,
- GE_OP = 309,
- EQ_OP = 310,
- NE_OP = 311,
- AND_OP = 312,
- OR_OP = 313,
- XOR_OP = 314,
- MUL_ASSIGN = 315,
- DIV_ASSIGN = 316,
- ADD_ASSIGN = 317,
- MOD_ASSIGN = 318,
- LEFT_ASSIGN = 319,
- RIGHT_ASSIGN = 320,
- AND_ASSIGN = 321,
- XOR_ASSIGN = 322,
- OR_ASSIGN = 323,
- SUB_ASSIGN = 324,
- LEFT_PAREN = 325,
- RIGHT_PAREN = 326,
- LEFT_BRACKET = 327,
- RIGHT_BRACKET = 328,
- LEFT_BRACE = 329,
- RIGHT_BRACE = 330,
- DOT = 331,
- COMMA = 332,
- COLON = 333,
- EQUAL = 334,
- SEMICOLON = 335,
- BANG = 336,
- DASH = 337,
- TILDE = 338,
- PLUS = 339,
- STAR = 340,
- SLASH = 341,
- PERCENT = 342,
- LEFT_ANGLE = 343,
- RIGHT_ANGLE = 344,
- VERTICAL_BAR = 345,
- CARET = 346,
- AMPERSAND = 347,
- QUESTION = 348
+ SAMPLER_EXTERNAL_OES = 298,
+ SAMPLER2DRECT = 299,
+ IDENTIFIER = 300,
+ TYPE_NAME = 301,
+ FLOATCONSTANT = 302,
+ INTCONSTANT = 303,
+ BOOLCONSTANT = 304,
+ FIELD_SELECTION = 305,
+ LEFT_OP = 306,
+ RIGHT_OP = 307,
+ INC_OP = 308,
+ DEC_OP = 309,
+ LE_OP = 310,
+ GE_OP = 311,
+ EQ_OP = 312,
+ NE_OP = 313,
+ AND_OP = 314,
+ OR_OP = 315,
+ XOR_OP = 316,
+ MUL_ASSIGN = 317,
+ DIV_ASSIGN = 318,
+ ADD_ASSIGN = 319,
+ MOD_ASSIGN = 320,
+ LEFT_ASSIGN = 321,
+ RIGHT_ASSIGN = 322,
+ AND_ASSIGN = 323,
+ XOR_ASSIGN = 324,
+ OR_ASSIGN = 325,
+ SUB_ASSIGN = 326,
+ LEFT_PAREN = 327,
+ RIGHT_PAREN = 328,
+ LEFT_BRACKET = 329,
+ RIGHT_BRACKET = 330,
+ LEFT_BRACE = 331,
+ RIGHT_BRACE = 332,
+ DOT = 333,
+ COMMA = 334,
+ COLON = 335,
+ EQUAL = 336,
+ SEMICOLON = 337,
+ BANG = 338,
+ DASH = 339,
+ TILDE = 340,
+ PLUS = 341,
+ STAR = 342,
+ SLASH = 343,
+ PERCENT = 344,
+ LEFT_ANGLE = 345,
+ RIGHT_ANGLE = 346,
+ VERTICAL_BAR = 347,
+ CARET = 348,
+ AMPERSAND = 349,
+ QUESTION = 350
};
#endif
/* Tokens. */
@@ -200,57 +202,59 @@
#define WHILE 295
#define SAMPLER2D 296
#define SAMPLERCUBE 297
-#define IDENTIFIER 298
-#define TYPE_NAME 299
-#define FLOATCONSTANT 300
-#define INTCONSTANT 301
-#define BOOLCONSTANT 302
-#define FIELD_SELECTION 303
-#define LEFT_OP 304
-#define RIGHT_OP 305
-#define INC_OP 306
-#define DEC_OP 307
-#define LE_OP 308
-#define GE_OP 309
-#define EQ_OP 310
-#define NE_OP 311
-#define AND_OP 312
-#define OR_OP 313
-#define XOR_OP 314
-#define MUL_ASSIGN 315
-#define DIV_ASSIGN 316
-#define ADD_ASSIGN 317
-#define MOD_ASSIGN 318
-#define LEFT_ASSIGN 319
-#define RIGHT_ASSIGN 320
-#define AND_ASSIGN 321
-#define XOR_ASSIGN 322
-#define OR_ASSIGN 323
-#define SUB_ASSIGN 324
-#define LEFT_PAREN 325
-#define RIGHT_PAREN 326
-#define LEFT_BRACKET 327
-#define RIGHT_BRACKET 328
-#define LEFT_BRACE 329
-#define RIGHT_BRACE 330
-#define DOT 331
-#define COMMA 332
-#define COLON 333
-#define EQUAL 334
-#define SEMICOLON 335
-#define BANG 336
-#define DASH 337
-#define TILDE 338
-#define PLUS 339
-#define STAR 340
-#define SLASH 341
-#define PERCENT 342
-#define LEFT_ANGLE 343
-#define RIGHT_ANGLE 344
-#define VERTICAL_BAR 345
-#define CARET 346
-#define AMPERSAND 347
-#define QUESTION 348
+#define SAMPLER_EXTERNAL_OES 298
+#define SAMPLER2DRECT 299
+#define IDENTIFIER 300
+#define TYPE_NAME 301
+#define FLOATCONSTANT 302
+#define INTCONSTANT 303
+#define BOOLCONSTANT 304
+#define FIELD_SELECTION 305
+#define LEFT_OP 306
+#define RIGHT_OP 307
+#define INC_OP 308
+#define DEC_OP 309
+#define LE_OP 310
+#define GE_OP 311
+#define EQ_OP 312
+#define NE_OP 313
+#define AND_OP 314
+#define OR_OP 315
+#define XOR_OP 316
+#define MUL_ASSIGN 317
+#define DIV_ASSIGN 318
+#define ADD_ASSIGN 319
+#define MOD_ASSIGN 320
+#define LEFT_ASSIGN 321
+#define RIGHT_ASSIGN 322
+#define AND_ASSIGN 323
+#define XOR_ASSIGN 324
+#define OR_ASSIGN 325
+#define SUB_ASSIGN 326
+#define LEFT_PAREN 327
+#define RIGHT_PAREN 328
+#define LEFT_BRACKET 329
+#define RIGHT_BRACKET 330
+#define LEFT_BRACE 331
+#define RIGHT_BRACE 332
+#define DOT 333
+#define COMMA 334
+#define COLON 335
+#define EQUAL 336
+#define SEMICOLON 337
+#define BANG 338
+#define DASH 339
+#define TILDE 340
+#define PLUS 341
+#define STAR 342
+#define SLASH 343
+#define PERCENT 344
+#define LEFT_ANGLE 345
+#define RIGHT_ANGLE 346
+#define VERTICAL_BAR 347
+#define CARET 348
+#define AMPERSAND 349
+#define QUESTION 350
@@ -264,7 +268,7 @@
// found in the LICENSE file.
//
-// This file is auto-generated by generate_glslang_parser.sh. DO NOT EDIT!
+// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
#include "compiler/SymbolTable.h"
#include "compiler/ParseHelper.h"
@@ -578,22 +582,22 @@ union yyalloc
#endif
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 69
+#define YYFINAL 71
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 1362
+#define YYLAST 1370
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 94
+#define YYNTOKENS 96
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 78
+#define YYNNTS 80
/* YYNRULES -- Number of rules. */
-#define YYNRULES 193
+#define YYNRULES 197
/* YYNRULES -- Number of states. */
-#define YYNSTATES 296
+#define YYNSTATES 300
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 348
+#define YYMAXUTOK 350
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -635,7 +639,8 @@ static const yytype_uint8 yytranslate[] =
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95
};
#if YYDEBUG
@@ -656,74 +661,75 @@ static const yytype_uint16 yyprhs[] =
298, 303, 306, 308, 311, 313, 315, 317, 320, 322,
324, 327, 329, 331, 333, 335, 340, 342, 344, 346,
348, 350, 352, 354, 356, 358, 360, 362, 364, 366,
- 368, 370, 372, 374, 376, 378, 380, 386, 391, 393,
- 396, 400, 402, 406, 408, 413, 415, 417, 419, 421,
- 423, 425, 427, 429, 431, 434, 435, 436, 442, 444,
- 446, 449, 453, 455, 458, 460, 463, 469, 473, 475,
- 477, 482, 483, 490, 491, 500, 501, 509, 511, 513,
- 515, 516, 519, 523, 526, 529, 532, 536, 539, 541,
- 544, 546, 548, 549
+ 368, 370, 372, 374, 376, 378, 380, 382, 384, 385,
+ 392, 393, 399, 401, 404, 408, 410, 414, 416, 421,
+ 423, 425, 427, 429, 431, 433, 435, 437, 439, 442,
+ 443, 444, 450, 452, 454, 457, 461, 463, 466, 468,
+ 471, 477, 481, 483, 485, 490, 491, 498, 499, 508,
+ 509, 517, 519, 521, 523, 524, 527, 531, 534, 537,
+ 540, 544, 547, 549, 552, 554, 556, 557
};
/* YYRHS -- A `-1'-separated list of the rules' RHS. */
static const yytype_int16 yyrhs[] =
{
- 168, 0, -1, 43, -1, 95, -1, 46, -1, 45,
- -1, 47, -1, 70, 122, 71, -1, 96, -1, 97,
- 72, 98, 73, -1, 99, -1, 97, 76, 48, -1,
- 97, 51, -1, 97, 52, -1, 122, -1, 100, -1,
- 101, -1, 97, 76, 101, -1, 103, 71, -1, 102,
- 71, -1, 104, 39, -1, 104, -1, 104, 120, -1,
- 103, 77, 120, -1, 105, 70, -1, 140, -1, 43,
- -1, 48, -1, 97, -1, 51, 106, -1, 52, 106,
- -1, 107, 106, -1, 84, -1, 82, -1, 81, -1,
- 106, -1, 108, 85, 106, -1, 108, 86, 106, -1,
- 108, -1, 109, 84, 108, -1, 109, 82, 108, -1,
- 109, -1, 110, -1, 111, 88, 110, -1, 111, 89,
- 110, -1, 111, 53, 110, -1, 111, 54, 110, -1,
- 111, -1, 112, 55, 111, -1, 112, 56, 111, -1,
- 112, -1, 113, -1, 114, -1, 115, -1, 116, 57,
- 115, -1, 116, -1, 117, 59, 116, -1, 117, -1,
- 118, 58, 117, -1, 118, -1, 118, 93, 122, 78,
- 120, -1, 119, -1, 106, 121, 120, -1, 79, -1,
- 60, -1, 61, -1, 62, -1, 69, -1, 120, -1,
- 122, 77, 120, -1, 119, -1, 125, 80, -1, 133,
- 80, -1, 7, 138, 139, 80, -1, 126, 71, -1,
- 128, -1, 127, -1, 128, 130, -1, 127, 77, 130,
- -1, 135, 43, 70, -1, 137, 43, -1, 137, 43,
- 72, 123, 73, -1, 136, 131, 129, -1, 131, 129,
- -1, 136, 131, 132, -1, 131, 132, -1, -1, 33,
- -1, 34, -1, 35, -1, 137, -1, 134, -1, 133,
- 77, 43, -1, 133, 77, 43, 72, 73, -1, 133,
- 77, 43, 72, 123, 73, -1, 133, 77, 43, 79,
- 146, -1, 135, -1, 135, 43, -1, 135, 43, 72,
- 73, -1, 135, 43, 72, 123, 73, -1, 135, 43,
- 79, 146, -1, 3, 43, -1, 137, -1, 136, 137,
+ 172, 0, -1, 45, -1, 97, -1, 48, -1, 47,
+ -1, 49, -1, 72, 124, 73, -1, 98, -1, 99,
+ 74, 100, 75, -1, 101, -1, 99, 78, 50, -1,
+ 99, 53, -1, 99, 54, -1, 124, -1, 102, -1,
+ 103, -1, 99, 78, 103, -1, 105, 73, -1, 104,
+ 73, -1, 106, 39, -1, 106, -1, 106, 122, -1,
+ 105, 79, 122, -1, 107, 72, -1, 142, -1, 45,
+ -1, 50, -1, 99, -1, 53, 108, -1, 54, 108,
+ -1, 109, 108, -1, 86, -1, 84, -1, 83, -1,
+ 108, -1, 110, 87, 108, -1, 110, 88, 108, -1,
+ 110, -1, 111, 86, 110, -1, 111, 84, 110, -1,
+ 111, -1, 112, -1, 113, 90, 112, -1, 113, 91,
+ 112, -1, 113, 55, 112, -1, 113, 56, 112, -1,
+ 113, -1, 114, 57, 113, -1, 114, 58, 113, -1,
+ 114, -1, 115, -1, 116, -1, 117, -1, 118, 59,
+ 117, -1, 118, -1, 119, 61, 118, -1, 119, -1,
+ 120, 60, 119, -1, 120, -1, 120, 95, 124, 80,
+ 122, -1, 121, -1, 108, 123, 122, -1, 81, -1,
+ 62, -1, 63, -1, 64, -1, 71, -1, 122, -1,
+ 124, 79, 122, -1, 121, -1, 127, 82, -1, 135,
+ 82, -1, 7, 140, 141, 82, -1, 128, 73, -1,
+ 130, -1, 129, -1, 130, 132, -1, 129, 79, 132,
+ -1, 137, 45, 72, -1, 139, 45, -1, 139, 45,
+ 74, 125, 75, -1, 138, 133, 131, -1, 133, 131,
+ -1, 138, 133, 134, -1, 133, 134, -1, -1, 33,
+ -1, 34, -1, 35, -1, 139, -1, 136, -1, 135,
+ 79, 45, -1, 135, 79, 45, 74, 75, -1, 135,
+ 79, 45, 74, 125, 75, -1, 135, 79, 45, 81,
+ 150, -1, 137, -1, 137, 45, -1, 137, 45, 74,
+ 75, -1, 137, 45, 74, 125, 75, -1, 137, 45,
+ 81, 150, -1, 3, 45, -1, 139, -1, 138, 139,
-1, 9, -1, 8, -1, 37, -1, 3, 37, -1,
- 36, -1, 139, -1, 138, 139, -1, 4, -1, 5,
- -1, 6, -1, 140, -1, 140, 72, 123, 73, -1,
+ 36, -1, 141, -1, 140, 141, -1, 4, -1, 5,
+ -1, 6, -1, 142, -1, 142, 74, 125, 75, -1,
39, -1, 11, -1, 12, -1, 10, -1, 27, -1,
28, -1, 29, -1, 21, -1, 22, -1, 23, -1,
24, -1, 25, -1, 26, -1, 30, -1, 31, -1,
- 32, -1, 41, -1, 42, -1, 141, -1, 44, -1,
- 38, 43, 74, 142, 75, -1, 38, 74, 142, 75,
- -1, 143, -1, 142, 143, -1, 137, 144, 80, -1,
- 145, -1, 144, 77, 145, -1, 43, -1, 43, 72,
- 123, 73, -1, 120, -1, 124, -1, 150, -1, 149,
- -1, 147, -1, 156, -1, 157, -1, 160, -1, 167,
- -1, 74, 75, -1, -1, -1, 74, 151, 155, 152,
- 75, -1, 154, -1, 149, -1, 74, 75, -1, 74,
- 155, 75, -1, 148, -1, 155, 148, -1, 80, -1,
- 122, 80, -1, 18, 70, 122, 71, 158, -1, 148,
- 16, 148, -1, 148, -1, 122, -1, 135, 43, 79,
- 146, -1, -1, 40, 70, 161, 159, 71, 153, -1,
- -1, 15, 162, 148, 40, 70, 122, 71, 80, -1,
- -1, 17, 70, 163, 164, 166, 71, 153, -1, 156,
- -1, 147, -1, 159, -1, -1, 165, 80, -1, 165,
- 80, 122, -1, 14, 80, -1, 13, 80, -1, 20,
- 80, -1, 20, 122, 80, -1, 19, 80, -1, 169,
- -1, 168, 169, -1, 170, -1, 124, -1, -1, 125,
- 171, 154, -1
+ 32, -1, 41, -1, 42, -1, 43, -1, 44, -1,
+ 143, -1, 46, -1, -1, 38, 45, 76, 144, 146,
+ 77, -1, -1, 38, 76, 145, 146, 77, -1, 147,
+ -1, 146, 147, -1, 139, 148, 82, -1, 149, -1,
+ 148, 79, 149, -1, 45, -1, 45, 74, 125, 75,
+ -1, 122, -1, 126, -1, 154, -1, 153, -1, 151,
+ -1, 160, -1, 161, -1, 164, -1, 171, -1, 76,
+ 77, -1, -1, -1, 76, 155, 159, 156, 77, -1,
+ 158, -1, 153, -1, 76, 77, -1, 76, 159, 77,
+ -1, 152, -1, 159, 152, -1, 82, -1, 124, 82,
+ -1, 18, 72, 124, 73, 162, -1, 152, 16, 152,
+ -1, 152, -1, 124, -1, 137, 45, 81, 150, -1,
+ -1, 40, 72, 165, 163, 73, 157, -1, -1, 15,
+ 166, 152, 40, 72, 124, 73, 82, -1, -1, 17,
+ 72, 167, 168, 170, 73, 157, -1, 160, -1, 151,
+ -1, 163, -1, -1, 169, 82, -1, 169, 82, 124,
+ -1, 14, 82, -1, 13, 82, -1, 20, 82, -1,
+ 20, 124, 82, -1, 19, 82, -1, 173, -1, 172,
+ 173, -1, 174, -1, 126, -1, -1, 127, 175, 158,
+ -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
@@ -742,13 +748,13 @@ static const yytype_uint16 yyrline[] =
1316, 1336, 1412, 1421, 1444, 1447, 1453, 1461, 1469, 1477,
1487, 1494, 1497, 1500, 1506, 1509, 1524, 1528, 1532, 1536,
1545, 1550, 1555, 1560, 1565, 1570, 1575, 1580, 1585, 1590,
- 1596, 1602, 1608, 1613, 1618, 1623, 1636, 1649, 1657, 1660,
- 1675, 1707, 1711, 1717, 1725, 1741, 1745, 1749, 1750, 1756,
- 1757, 1758, 1759, 1760, 1764, 1765, 1765, 1765, 1775, 1776,
- 1781, 1784, 1794, 1797, 1803, 1804, 1808, 1816, 1820, 1830,
- 1835, 1852, 1852, 1857, 1857, 1864, 1864, 1872, 1875, 1881,
- 1884, 1890, 1894, 1901, 1908, 1915, 1922, 1933, 1942, 1946,
- 1953, 1956, 1962, 1962
+ 1596, 1602, 1608, 1613, 1618, 1627, 1636, 1641, 1654, 1654,
+ 1668, 1668, 1677, 1680, 1695, 1731, 1735, 1741, 1749, 1765,
+ 1769, 1773, 1774, 1780, 1781, 1782, 1783, 1784, 1788, 1789,
+ 1789, 1789, 1799, 1800, 1805, 1808, 1818, 1821, 1827, 1828,
+ 1832, 1840, 1844, 1854, 1859, 1876, 1876, 1881, 1881, 1888,
+ 1888, 1896, 1899, 1905, 1908, 1914, 1918, 1925, 1932, 1939,
+ 1946, 1957, 1966, 1970, 1977, 1980, 1986, 1986
};
#endif
@@ -764,16 +770,16 @@ static const char *const yytname[] =
"BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2", "VEC3", "VEC4", "MATRIX2",
"MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
"VARYING", "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
- "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
- "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP", "INC_OP",
- "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP",
- "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN",
- "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN",
- "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
- "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
- "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
- "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
- "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
+ "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "IDENTIFIER", "TYPE_NAME",
+ "FLOATCONSTANT", "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION",
+ "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP",
+ "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN",
+ "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN",
+ "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN",
+ "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT",
+ "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS",
+ "STAR", "SLASH", "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR",
+ "CARET", "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
"primary_expression", "postfix_expression", "integer_expression",
"function_call", "function_call_or_method", "function_call_generic",
"function_call_header_no_parameters",
@@ -792,16 +798,16 @@ static const char *const yytname[] =
"init_declarator_list", "single_declaration", "fully_specified_type",
"type_qualifier", "type_specifier", "precision_qualifier",
"type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
- "struct_declaration_list", "struct_declaration",
+ "@1", "@2", "struct_declaration_list", "struct_declaration",
"struct_declarator_list", "struct_declarator", "initializer",
"declaration_statement", "statement", "simple_statement",
- "compound_statement", "@1", "@2", "statement_no_new_scope",
+ "compound_statement", "@3", "@4", "statement_no_new_scope",
"compound_statement_no_new_scope", "statement_list",
"expression_statement", "selection_statement",
- "selection_rest_statement", "condition", "iteration_statement", "@3",
- "@4", "@5", "for_init_statement", "conditionopt", "for_rest_statement",
+ "selection_rest_statement", "condition", "iteration_statement", "@5",
+ "@6", "@7", "for_init_statement", "conditionopt", "for_rest_statement",
"jump_statement", "translation_unit", "external_declaration",
- "function_definition", "@6", 0
+ "function_definition", "@8", 0
};
#endif
@@ -819,33 +825,33 @@ static const yytype_uint16 yytoknum[] =
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
- 345, 346, 347, 348
+ 345, 346, 347, 348, 349, 350
};
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 94, 95, 96, 96, 96, 96, 96, 97, 97,
- 97, 97, 97, 97, 98, 99, 100, 100, 101, 101,
- 102, 102, 103, 103, 104, 105, 105, 105, 106, 106,
- 106, 106, 107, 107, 107, 108, 108, 108, 109, 109,
- 109, 110, 111, 111, 111, 111, 111, 112, 112, 112,
- 113, 114, 115, 116, 116, 117, 117, 118, 118, 119,
- 119, 120, 120, 121, 121, 121, 121, 121, 122, 122,
- 123, 124, 124, 124, 125, 126, 126, 127, 127, 128,
- 129, 129, 130, 130, 130, 130, 131, 131, 131, 131,
- 132, 133, 133, 133, 133, 133, 134, 134, 134, 134,
- 134, 134, 135, 135, 136, 136, 136, 136, 136, 137,
- 137, 138, 138, 138, 139, 139, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 140, 140, 140, 140,
- 140, 140, 140, 140, 140, 140, 141, 141, 142, 142,
- 143, 144, 144, 145, 145, 146, 147, 148, 148, 149,
- 149, 149, 149, 149, 150, 151, 152, 150, 153, 153,
- 154, 154, 155, 155, 156, 156, 157, 158, 158, 159,
- 159, 161, 160, 162, 160, 163, 160, 164, 164, 165,
- 165, 166, 166, 167, 167, 167, 167, 167, 168, 168,
- 169, 169, 171, 170
+ 0, 96, 97, 98, 98, 98, 98, 98, 99, 99,
+ 99, 99, 99, 99, 100, 101, 102, 102, 103, 103,
+ 104, 104, 105, 105, 106, 107, 107, 107, 108, 108,
+ 108, 108, 109, 109, 109, 110, 110, 110, 111, 111,
+ 111, 112, 113, 113, 113, 113, 113, 114, 114, 114,
+ 115, 116, 117, 118, 118, 119, 119, 120, 120, 121,
+ 121, 122, 122, 123, 123, 123, 123, 123, 124, 124,
+ 125, 126, 126, 126, 127, 128, 128, 129, 129, 130,
+ 131, 131, 132, 132, 132, 132, 133, 133, 133, 133,
+ 134, 135, 135, 135, 135, 135, 136, 136, 136, 136,
+ 136, 136, 137, 137, 138, 138, 138, 138, 138, 139,
+ 139, 140, 140, 140, 141, 141, 142, 142, 142, 142,
+ 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
+ 142, 142, 142, 142, 142, 142, 142, 142, 144, 143,
+ 145, 143, 146, 146, 147, 148, 148, 149, 149, 150,
+ 151, 152, 152, 153, 153, 153, 153, 153, 154, 155,
+ 156, 154, 157, 157, 158, 158, 159, 159, 160, 160,
+ 161, 162, 162, 163, 163, 165, 164, 166, 164, 167,
+ 164, 168, 168, 169, 169, 170, 170, 171, 171, 171,
+ 171, 171, 172, 172, 173, 173, 175, 174
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
@@ -864,13 +870,13 @@ static const yytype_uint8 yyr2[] =
4, 2, 1, 2, 1, 1, 1, 2, 1, 1,
2, 1, 1, 1, 1, 4, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 5, 4, 1, 2,
- 3, 1, 3, 1, 4, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 2, 0, 0, 5, 1, 1,
- 2, 3, 1, 2, 1, 2, 5, 3, 1, 1,
- 4, 0, 6, 0, 8, 0, 7, 1, 1, 1,
- 0, 2, 3, 2, 2, 2, 3, 2, 1, 2,
- 1, 1, 0, 3
+ 1, 1, 1, 1, 1, 1, 1, 1, 0, 6,
+ 0, 5, 1, 2, 3, 1, 3, 1, 4, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 0,
+ 0, 5, 1, 1, 2, 3, 1, 2, 1, 2,
+ 5, 3, 1, 1, 4, 0, 6, 0, 8, 0,
+ 7, 1, 1, 1, 0, 2, 3, 2, 2, 2,
+ 3, 2, 1, 2, 1, 1, 0, 3
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -880,97 +886,97 @@ static const yytype_uint8 yydefact[] =
{
0, 0, 111, 112, 113, 0, 105, 104, 119, 117,
118, 123, 124, 125, 126, 127, 128, 120, 121, 122,
- 129, 130, 131, 108, 106, 0, 116, 132, 133, 135,
- 191, 192, 0, 76, 86, 0, 91, 96, 0, 102,
- 0, 109, 114, 134, 0, 188, 190, 107, 101, 0,
- 0, 0, 71, 0, 74, 86, 0, 87, 88, 89,
- 77, 0, 86, 0, 72, 97, 103, 110, 0, 1,
- 189, 0, 0, 0, 0, 138, 0, 193, 78, 83,
+ 129, 130, 131, 108, 106, 0, 116, 132, 133, 134,
+ 135, 137, 195, 196, 0, 76, 86, 0, 91, 96,
+ 0, 102, 0, 109, 114, 136, 0, 192, 194, 107,
+ 101, 0, 0, 140, 71, 0, 74, 86, 0, 87,
+ 88, 89, 77, 0, 86, 0, 72, 97, 103, 110,
+ 0, 1, 193, 0, 138, 0, 0, 197, 78, 83,
85, 90, 0, 92, 79, 0, 0, 2, 5, 4,
6, 27, 0, 0, 0, 34, 33, 32, 3, 8,
28, 10, 15, 16, 0, 0, 21, 0, 35, 0,
38, 41, 42, 47, 50, 51, 52, 53, 55, 57,
- 59, 70, 0, 25, 73, 0, 143, 0, 141, 137,
- 139, 0, 0, 173, 0, 0, 0, 0, 0, 155,
- 160, 164, 35, 61, 68, 0, 146, 0, 114, 149,
- 162, 148, 147, 0, 150, 151, 152, 153, 80, 82,
- 84, 0, 0, 98, 0, 145, 100, 29, 30, 0,
- 12, 13, 0, 0, 19, 18, 0, 20, 22, 24,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 115, 136, 0, 0, 140,
- 184, 183, 0, 175, 0, 187, 185, 0, 171, 154,
- 0, 64, 65, 66, 67, 63, 0, 0, 165, 161,
- 163, 0, 93, 0, 95, 99, 7, 0, 14, 26,
+ 59, 70, 0, 25, 73, 0, 0, 0, 142, 0,
+ 0, 177, 0, 0, 0, 0, 0, 159, 164, 168,
+ 35, 61, 68, 0, 150, 0, 114, 153, 166, 152,
+ 151, 0, 154, 155, 156, 157, 80, 82, 84, 0,
+ 0, 98, 0, 149, 100, 29, 30, 0, 12, 13,
+ 0, 0, 19, 18, 0, 20, 22, 24, 31, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 115, 0, 147, 0, 145, 141, 143,
+ 188, 187, 0, 179, 0, 191, 189, 0, 175, 158,
+ 0, 64, 65, 66, 67, 63, 0, 0, 169, 165,
+ 167, 0, 93, 0, 95, 99, 7, 0, 14, 26,
11, 17, 23, 36, 37, 40, 39, 45, 46, 43,
- 44, 48, 49, 54, 56, 58, 0, 0, 142, 0,
- 0, 0, 186, 0, 156, 62, 69, 0, 94, 9,
- 0, 144, 0, 178, 177, 180, 0, 169, 0, 0,
- 0, 81, 60, 0, 179, 0, 0, 168, 166, 0,
- 0, 157, 0, 181, 0, 0, 0, 159, 172, 158,
- 0, 182, 176, 167, 170, 174
+ 44, 48, 49, 54, 56, 58, 0, 139, 0, 0,
+ 144, 0, 0, 0, 190, 0, 160, 62, 69, 0,
+ 94, 9, 0, 0, 146, 0, 182, 181, 184, 0,
+ 173, 0, 0, 0, 81, 60, 148, 0, 183, 0,
+ 0, 172, 170, 0, 0, 161, 0, 185, 0, 0,
+ 0, 163, 176, 162, 0, 186, 180, 171, 174, 178
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
-1, 98, 99, 100, 227, 101, 102, 103, 104, 105,
- 106, 107, 142, 109, 110, 111, 112, 113, 114, 115,
- 116, 117, 118, 119, 120, 143, 144, 216, 145, 122,
- 146, 147, 32, 33, 34, 79, 60, 61, 80, 35,
- 36, 37, 38, 39, 40, 41, 123, 43, 74, 75,
- 127, 128, 166, 149, 150, 151, 152, 210, 270, 288,
- 289, 153, 154, 155, 278, 269, 156, 253, 202, 250,
- 265, 275, 276, 157, 44, 45, 46, 53
+ 106, 107, 140, 109, 110, 111, 112, 113, 114, 115,
+ 116, 117, 118, 119, 120, 141, 142, 216, 143, 122,
+ 144, 145, 34, 35, 36, 79, 62, 63, 80, 37,
+ 38, 39, 40, 41, 42, 43, 123, 45, 125, 75,
+ 127, 128, 196, 197, 164, 147, 148, 149, 150, 210,
+ 273, 292, 293, 151, 152, 153, 282, 272, 154, 255,
+ 202, 252, 268, 279, 280, 155, 46, 47, 48, 55
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
-#define YYPACT_NINF -250
+#define YYPACT_NINF -251
static const yytype_int16 yypact[] =
{
- 1218, -13, -250, -250, -250, 137, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, -250, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, -28, -250, -250, -250, -250,
- -250, -55, -38, -4, 33, -20, -250, 44, 1259, -250,
- 1318, -250, 18, -250, 1176, -250, -250, -250, -250, 1318,
- -22, 1259, -250, 29, -250, 85, 73, -250, -250, -250,
- -250, 1259, 113, 70, -250, 13, -250, -250, 949, -250,
- -250, 49, 1259, 90, 1080, -250, 283, -250, -250, -250,
- -250, 101, 1259, -56, -250, 757, 949, 80, -250, -250,
- -250, -250, 949, 949, 949, -250, -250, -250, -250, -250,
- -33, -250, -250, -250, 81, -15, 1013, 92, -250, 949,
- 52, -75, -250, -25, 40, -250, -250, -250, 106, 105,
- -46, -250, 93, -250, -250, 1121, 95, 9, -250, -250,
- -250, 88, 89, -250, 100, 102, 91, 821, 104, 103,
- -250, -250, 66, -250, -250, 20, -250, -55, 79, -250,
- -250, -250, -250, 365, -250, -250, -250, -250, 107, -250,
- -250, 885, 949, -250, 109, -250, -250, -250, -250, -6,
- -250, -250, 949, 1283, -250, -250, 949, 110, -250, -250,
- -250, 949, 949, 949, 949, 949, 949, 949, 949, 949,
- 949, 949, 949, 949, 949, -250, -250, 949, 90, -250,
- -250, -250, 447, -250, 949, -250, -250, 34, -250, -250,
- 447, -250, -250, -250, -250, -250, 949, 949, -250, -250,
- -250, 949, -250, 111, -250, -250, -250, 112, 99, -250,
- 116, -250, -250, -250, -250, 52, 52, -250, -250, -250,
- -250, -25, -25, -250, 106, 105, 77, 114, -250, 125,
- 611, 4, -250, 693, 447, -250, -250, 115, -250, -250,
- 949, -250, 119, -250, -250, 693, 447, 99, 134, 122,
- 108, -250, -250, 949, -250, 117, 123, 174, -250, 120,
- 529, -250, 7, 949, 529, 447, 949, -250, -250, -250,
- 118, 99, -250, -250, -250, -250
+ 1250, -17, -251, -251, -251, 113, -251, -251, -251, -251,
+ -251, -251, -251, -251, -251, -251, -251, -251, -251, -251,
+ -251, -251, -251, -251, -251, -39, -251, -251, -251, -251,
+ -251, -251, -251, -65, -34, -10, 21, -32, -251, 28,
+ 207, -251, 1324, -251, 56, -251, 1206, -251, -251, -251,
+ -251, 1324, 74, -251, -251, 86, -251, 71, 95, -251,
+ -251, -251, -251, 207, 119, 120, -251, -56, -251, -251,
+ 971, -251, -251, 84, -251, 207, 287, -251, -251, -251,
+ -251, 124, 207, -59, -251, 773, 971, 98, -251, -251,
+ -251, -251, 971, 971, 971, -251, -251, -251, -251, -251,
+ 35, -251, -251, -251, 100, -9, 1037, 102, -251, 971,
+ -27, -1, -251, -24, 99, -251, -251, -251, 112, 111,
+ -51, -251, 103, -251, -251, 207, 135, 1106, -251, 101,
+ 104, -251, 109, 115, 106, 839, 117, 107, -251, -251,
+ 39, -251, -251, -11, -251, -65, 54, -251, -251, -251,
+ -251, 371, -251, -251, -251, -251, 116, -251, -251, 905,
+ 971, -251, 118, -251, -251, -251, -251, 8, -251, -251,
+ 971, 1287, -251, -251, 971, 125, -251, -251, -251, 971,
+ 971, 971, 971, 971, 971, 971, 971, 971, 971, 971,
+ 971, 971, 971, -251, 1149, 122, 17, -251, -251, -251,
+ -251, -251, 455, -251, 971, -251, -251, 32, -251, -251,
+ 455, -251, -251, -251, -251, -251, 971, 971, -251, -251,
+ -251, 971, -251, 123, -251, -251, -251, 126, 121, -251,
+ 127, -251, -251, -251, -251, -27, -27, -251, -251, -251,
+ -251, -24, -24, -251, 112, 111, 79, -251, 971, 135,
+ -251, 151, 623, 11, -251, 707, 455, -251, -251, 128,
+ -251, -251, 971, 130, -251, 134, -251, -251, 707, 455,
+ 121, 147, 136, 131, -251, -251, -251, 971, -251, 132,
+ 142, 200, -251, 139, 539, -251, 19, 971, 539, 455,
+ 971, -251, -251, -251, 140, 121, -251, -251, -251, -251
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -250, -250, -250, -250, -250, -250, -250, 22, -250, -250,
- -250, -250, 31, -250, -27, -250, -79, -30, -250, -250,
- -250, 5, 8, 12, -250, -63, -85, -250, -92, -82,
- 10, 11, -250, -250, -250, 121, 149, 144, 126, -250,
- -250, -233, -21, -24, 202, -23, 0, -250, 139, -66,
- -250, 27, -156, -41, -149, -249, -250, -250, -250, -58,
- 176, 17, -19, -250, -250, -35, -250, -250, -250, -250,
- -250, -250, -250, -250, -250, 188, -250, -250
+ -251, -251, -251, -251, -251, -251, -251, 50, -251, -251,
+ -251, -251, -44, -251, -21, -251, -62, -20, -251, -251,
+ -251, 34, 36, 33, -251, -66, -83, -251, -92, -73,
+ 7, 13, -251, -251, -251, 143, 170, 176, 159, -251,
+ -251, -247, -22, -30, 237, -15, 0, -251, -251, -251,
+ 129, -122, -251, -6, -159, -8, -140, -250, -251, -251,
+ -251, -41, 202, 48, 9, -251, -251, -5, -251, -251,
+ -251, -251, -251, -251, -251, -251, -251, 213, -251, -251
};
/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
@@ -980,284 +986,286 @@ static const yytype_int16 yypgoto[] =
#define YYTABLE_NINF -117
static const yytype_int16 yytable[] =
{
- 42, 165, 169, 164, 220, 121, 224, 183, 130, 184,
- 30, 31, 193, 62, 66, 50, 161, 67, 170, 171,
- 268, 178, 121, 162, 47, 52, 71, 73, 185, 186,
- 48, 287, 268, 54, 62, 287, 56, 81, 42, 172,
- 42, 6, 7, 173, 42, 207, 51, 194, 73, 42,
- 73, 42, 72, 249, 30, 31, 175, 63, 81, 130,
- 64, 42, 176, 187, 188, 226, 57, 58, 59, 23,
- 24, 217, 42, 55, 42, 266, 148, 165, 290, 223,
- 228, 217, 42, 84, 217, 85, 198, 65, 56, 199,
- 68, 232, 86, 6, 7, 189, 190, 217, 121, 108,
- 218, 73, 246, 76, -75, 220, 237, 238, 239, 240,
- 47, 217, 251, 83, 252, 247, 108, 277, 57, 58,
- 59, 23, 24, 167, 168, 42, 211, 212, 213, 124,
- 294, 255, 256, 126, 121, 214, 293, 181, 182, 257,
- 180, 2, 3, 4, 158, 215, 57, 58, 59, -25,
- -26, 68, 174, 148, 217, 260, 235, 236, 121, 241,
- 242, 267, 179, 191, 192, 262, 195, 197, 200, 201,
- 203, 205, 204, 267, 208, 272, 217, 279, 209, 221,
- -116, 282, 225, 281, 258, 259, -27, 261, 271, 273,
- 285, 291, 108, 280, 284, 231, 243, 283, 295, 286,
- 244, 165, 148, 159, 78, 245, 82, 49, 160, 263,
- 148, 125, 233, 234, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 248, 292, 254, 108, 77,
- 274, 264, 70, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 148, 0, 108, 148, 148, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 148, 148, 0, 0, 0,
+ 44, 224, 167, 163, 121, 199, 52, 32, 271, 191,
+ 68, 220, 162, 33, 64, 159, 84, 54, 85, 121,
+ 49, 271, 160, 176, 58, 86, 108, 69, 50, 6,
+ 7, 183, 184, 81, 291, 64, 73, 53, 291, 56,
+ 44, 108, 44, 207, 192, 126, 44, 65, 165, 166,
+ 66, 44, 81, 32, 59, 60, 61, 23, 24, 33,
+ 179, 180, 251, 44, 173, 178, 185, 186, 217, 57,
+ 174, 218, 199, 67, 58, 44, 146, 163, 228, 6,
+ 7, 226, 44, 181, 269, 182, 223, 217, 168, 169,
+ 217, 232, 294, 121, -75, 126, 249, 126, 217, 250,
+ 246, 211, 212, 213, 59, 60, 61, 23, 24, 170,
+ 214, 217, 253, 171, 254, 108, 220, 2, 3, 4,
+ 215, 237, 238, 239, 240, 44, -25, 44, 70, 281,
+ 70, 298, 49, 257, 258, 233, 234, 108, 108, 108,
+ 108, 108, 108, 108, 108, 108, 108, 108, 259, 297,
+ 74, 146, 59, 60, 61, 121, 187, 188, 217, 262,
+ 235, 236, 76, 270, 126, 83, 124, 241, 242, 156,
+ -26, 189, 190, 172, 177, 263, 270, 108, 193, 275,
+ 195, 203, 121, 200, 209, 286, 201, 204, 205, 208,
+ 221, 265, 283, 225, 44, 295, 248, -116, 260, -27,
+ 217, 261, 146, 274, 108, 276, 277, 163, 285, 284,
+ 146, 2, 3, 4, 287, 288, 289, 8, 9, 10,
+ 290, 231, 299, 243, 245, 157, 244, 78, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 82, 158, 51, 264, 266, 25, 26, 296, 27, 28,
+ 29, 30, 146, 31, 194, 146, 146, 77, 256, 72,
+ 0, 267, 0, 278, 0, 0, 0, 0, 146, 146,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 148, 0, 0, 0, 148, 148, 1, 2, 3, 4,
- 5, 6, 7, 8, 9, 10, 131, 132, 133, 0,
- 134, 135, 136, 137, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 0, 0, 0, 23,
- 24, 25, 26, 138, 27, 28, 87, 29, 88, 89,
+ 0, 0, 0, 0, 146, 0, 0, 0, 146, 146,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
+ 129, 130, 131, 0, 132, 133, 134, 135, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 0, 0, 0, 23, 24, 25, 26, 136, 27, 28,
+ 29, 30, 87, 31, 88, 89, 90, 91, 0, 0,
+ 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
+ 0, 0, 0, 137, 138, 0, 0, 0, 0, 139,
+ 95, 96, 0, 97, 1, 2, 3, 4, 5, 6,
+ 7, 8, 9, 10, 129, 130, 131, 0, 132, 133,
+ 134, 135, 11, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 0, 0, 0, 23, 24, 25,
+ 26, 136, 27, 28, 29, 30, 87, 31, 88, 89,
90, 91, 0, 0, 92, 93, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 94, 0, 0, 0, 139, 140, 0,
- 0, 0, 0, 141, 95, 96, 0, 97, 1, 2,
- 3, 4, 5, 6, 7, 8, 9, 10, 131, 132,
- 133, 0, 134, 135, 136, 137, 11, 12, 13, 14,
+ 0, 0, 0, 94, 0, 0, 0, 137, 219, 0,
+ 0, 0, 0, 139, 95, 96, 0, 97, 1, 2,
+ 3, 4, 5, 6, 7, 8, 9, 10, 129, 130,
+ 131, 0, 132, 133, 134, 135, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 0, 0,
- 0, 23, 24, 25, 26, 138, 27, 28, 87, 29,
- 88, 89, 90, 91, 0, 0, 92, 93, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 94, 0, 0, 0, 139,
- 219, 0, 0, 0, 0, 141, 95, 96, 0, 97,
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 131, 132, 133, 0, 134, 135, 136, 137, 11, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 0, 0, 0, 23, 24, 25, 26, 138, 27, 28,
- 87, 29, 88, 89, 90, 91, 0, 0, 92, 93,
+ 0, 23, 24, 25, 26, 136, 27, 28, 29, 30,
+ 87, 31, 88, 89, 90, 91, 0, 0, 92, 93,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 94, 0, 0,
- 0, 139, 0, 0, 0, 0, 0, 141, 95, 96,
+ 0, 137, 0, 0, 0, 0, 0, 139, 95, 96,
0, 97, 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 131, 132, 133, 0, 134, 135, 136, 137,
+ 9, 10, 129, 130, 131, 0, 132, 133, 134, 135,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 0, 0, 0, 23, 24, 25, 26, 138,
- 27, 28, 87, 29, 88, 89, 90, 91, 0, 0,
- 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
- 0, 0, 0, 76, 0, 0, 0, 0, 0, 141,
- 95, 96, 0, 97, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 0, 0, 0, 0, 0, 0,
- 0, 0, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 0, 0, 0, 23, 24, 25,
- 26, 0, 27, 28, 87, 29, 88, 89, 90, 91,
+ 21, 22, 0, 0, 0, 23, 24, 25, 26, 136,
+ 27, 28, 29, 30, 87, 31, 88, 89, 90, 91,
0, 0, 92, 93, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 94, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 141, 95, 96, 0, 97, 56, 2, 3, 4,
- 0, 6, 7, 8, 9, 10, 0, 0, 0, 0,
+ 0, 94, 0, 0, 0, 76, 0, 0, 0, 0,
+ 0, 139, 95, 96, 0, 97, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 0, 0, 0, 0,
0, 0, 0, 0, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 0, 0, 0, 23,
- 24, 25, 26, 0, 27, 28, 87, 29, 88, 89,
- 90, 91, 0, 0, 92, 93, 0, 0, 0, 0,
+ 24, 25, 26, 0, 27, 28, 29, 30, 87, 31,
+ 88, 89, 90, 91, 0, 0, 92, 93, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 94, 0, 0, 0, 8, 9, 10,
- 0, 0, 0, 0, 95, 96, 0, 97, 11, 12,
+ 0, 0, 0, 0, 0, 94, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 139, 95, 96, 0, 97,
+ 58, 2, 3, 4, 0, 6, 7, 8, 9, 10,
+ 0, 0, 0, 0, 0, 0, 0, 0, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 0, 0, 0, 0, 0, 25, 26, 0, 27, 28,
- 87, 29, 88, 89, 90, 91, 0, 0, 92, 93,
+ 0, 0, 0, 23, 24, 25, 26, 0, 27, 28,
+ 29, 30, 87, 31, 88, 89, 90, 91, 0, 0,
+ 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
+ 0, 0, 0, 8, 9, 10, 0, 0, 0, 0,
+ 95, 96, 0, 97, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
+ 0, 25, 26, 0, 27, 28, 29, 30, 87, 31,
+ 88, 89, 90, 91, 0, 0, 92, 93, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 94, 0, 0,
- 163, 8, 9, 10, 0, 0, 0, 0, 95, 96,
- 0, 97, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 0, 0, 0, 0, 0, 25,
- 26, 0, 27, 28, 87, 29, 88, 89, 90, 91,
+ 0, 0, 0, 0, 0, 94, 0, 0, 161, 8,
+ 9, 10, 0, 0, 0, 0, 95, 96, 0, 97,
+ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
+ 21, 22, 0, 0, 0, 0, 0, 25, 26, 0,
+ 27, 28, 29, 30, 87, 31, 88, 89, 90, 91,
0, 0, 92, 93, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 94, 0, 0, 0, 8, 9, 10, 0, 0,
0, 206, 95, 96, 0, 97, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 0, 0,
- 0, 0, 0, 25, 26, 0, 27, 28, 87, 29,
- 88, 89, 90, 91, 0, 0, 92, 93, 0, 0,
+ 0, 0, 0, 25, 26, 0, 27, 28, 29, 30,
+ 87, 31, 88, 89, 90, 91, 0, 0, 92, 93,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 94, 0, 0, 222, 8,
- 9, 10, 0, 0, 0, 0, 95, 96, 0, 97,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 0, 0, 0, 0, 0, 25, 26, 0,
- 27, 28, 87, 29, 88, 89, 90, 91, 0, 0,
- 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
- 0, 0, 0, 8, 9, 10, 0, 0, 0, 0,
- 95, 96, 0, 97, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
- 0, 25, 177, 0, 27, 28, 87, 29, 88, 89,
+ 0, 0, 0, 0, 0, 0, 0, 94, 0, 0,
+ 222, 8, 9, 10, 0, 0, 0, 0, 95, 96,
+ 0, 97, 11, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 0, 0, 0, 0, 0, 25,
+ 26, 0, 27, 28, 29, 30, 87, 31, 88, 89,
90, 91, 0, 0, 92, 93, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 94, 2, 3, 4, 0, 0, 0,
- 8, 9, 10, 0, 95, 96, 0, 97, 0, 0,
- 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 0, 0, 0, 0, 0, 25, 26,
- 0, 27, 28, 0, 29, 2, 3, 4, 0, 0,
- 0, 8, 9, 10, 0, 0, 0, 0, 0, 0,
- 0, 0, 11, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 0, 129, 0, 0, 0, 25,
- 26, 0, 27, 28, 0, 29, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 69, 0, 0, 1,
- 2, 3, 4, 5, 6, 7, 8, 9, 10, 0,
- 0, 0, 0, 0, 0, 0, 196, 11, 12, 13,
+ 0, 0, 0, 94, 0, 0, 0, 8, 9, 10,
+ 0, 0, 0, 0, 95, 96, 0, 97, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 0, 0, 0, 0, 0, 25, 175, 0, 27, 28,
+ 29, 30, 87, 31, 88, 89, 90, 91, 0, 0,
+ 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
+ 2, 3, 4, 0, 0, 0, 8, 9, 10, 0,
+ 95, 96, 0, 97, 0, 0, 0, 11, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
- 0, 0, 23, 24, 25, 26, 0, 27, 28, 0,
- 29, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 0, 0, 0, 0, 0, 0, 0, 0, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 0, 0, 0, 23, 24, 25, 26, 0, 27,
- 28, 0, 29, 2, 3, 4, 0, 0, 0, 8,
+ 0, 0, 0, 0, 25, 26, 0, 27, 28, 29,
+ 30, 0, 31, 2, 3, 4, 0, 0, 0, 8,
9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 0, 8, 9, 10, 0, 25, 26, 0,
- 27, 28, 0, 29, 11, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
- 0, 25, 26, 0, 27, 28, 229, 29, 8, 9,
- 10, 230, 0, 0, 0, 0, 0, 0, 0, 11,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 0, 0, 0, 0, 0, 25, 26, 0, 27,
- 28, 0, 29
+ 21, 22, 0, 198, 0, 0, 0, 25, 26, 0,
+ 27, 28, 29, 30, 0, 31, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 71, 0, 0, 1,
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 0,
+ 0, 0, 0, 0, 0, 0, 247, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
+ 0, 0, 23, 24, 25, 26, 0, 27, 28, 29,
+ 30, 0, 31, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 0, 0, 0, 0, 0, 0, 0,
+ 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 0, 0, 0, 23, 24, 25, 26,
+ 0, 27, 28, 29, 30, 0, 31, 8, 9, 10,
+ 0, 0, 0, 0, 0, 0, 0, 0, 11, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 0, 0, 0, 0, 0, 25, 26, 0, 27, 28,
+ 29, 30, 229, 31, 8, 9, 10, 230, 0, 0,
+ 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
+ 0, 0, 25, 26, 0, 27, 28, 29, 30, 0,
+ 31
};
static const yytype_int16 yycheck[] =
{
- 0, 86, 94, 85, 153, 68, 162, 82, 74, 84,
- 0, 0, 58, 34, 38, 43, 72, 40, 51, 52,
- 253, 106, 85, 79, 37, 80, 49, 51, 53, 54,
- 43, 280, 265, 71, 55, 284, 3, 61, 38, 72,
- 40, 8, 9, 76, 44, 137, 74, 93, 72, 49,
- 74, 51, 74, 202, 44, 44, 71, 77, 82, 125,
- 80, 61, 77, 88, 89, 71, 33, 34, 35, 36,
- 37, 77, 72, 77, 74, 71, 76, 162, 71, 161,
- 172, 77, 82, 70, 77, 72, 77, 43, 3, 80,
- 72, 176, 79, 8, 9, 55, 56, 77, 161, 68,
- 80, 125, 194, 74, 71, 254, 185, 186, 187, 188,
- 37, 77, 204, 43, 80, 197, 85, 266, 33, 34,
- 35, 36, 37, 92, 93, 125, 60, 61, 62, 80,
- 286, 216, 217, 43, 197, 69, 285, 85, 86, 221,
- 109, 4, 5, 6, 43, 79, 33, 34, 35, 70,
- 70, 72, 71, 153, 77, 78, 183, 184, 221, 189,
- 190, 253, 70, 57, 59, 40, 73, 72, 80, 80,
- 70, 80, 70, 265, 70, 260, 77, 43, 75, 72,
- 70, 273, 73, 75, 73, 73, 70, 73, 73, 70,
- 16, 283, 161, 71, 71, 173, 191, 80, 80, 79,
- 192, 286, 202, 82, 55, 193, 62, 5, 82, 250,
- 210, 72, 181, 182, 183, 184, 185, 186, 187, 188,
- 189, 190, 191, 192, 193, 198, 284, 210, 197, 53,
- 265, 250, 44, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 250, -1, 221, 253, 254, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 265, 266, -1, -1, -1,
+ 0, 160, 94, 86, 70, 127, 45, 0, 255, 60,
+ 40, 151, 85, 0, 36, 74, 72, 82, 74, 85,
+ 37, 268, 81, 106, 3, 81, 70, 42, 45, 8,
+ 9, 55, 56, 63, 284, 57, 51, 76, 288, 73,
+ 40, 85, 42, 135, 95, 75, 46, 79, 92, 93,
+ 82, 51, 82, 46, 33, 34, 35, 36, 37, 46,
+ 87, 88, 202, 63, 73, 109, 90, 91, 79, 79,
+ 79, 82, 194, 45, 3, 75, 76, 160, 170, 8,
+ 9, 73, 82, 84, 73, 86, 159, 79, 53, 54,
+ 79, 174, 73, 159, 73, 125, 79, 127, 79, 82,
+ 192, 62, 63, 64, 33, 34, 35, 36, 37, 74,
+ 71, 79, 204, 78, 82, 159, 256, 4, 5, 6,
+ 81, 183, 184, 185, 186, 125, 72, 127, 74, 269,
+ 74, 290, 37, 216, 217, 179, 180, 181, 182, 183,
+ 184, 185, 186, 187, 188, 189, 190, 191, 221, 289,
+ 76, 151, 33, 34, 35, 221, 57, 58, 79, 80,
+ 181, 182, 76, 255, 194, 45, 82, 187, 188, 45,
+ 72, 59, 61, 73, 72, 248, 268, 221, 75, 262,
+ 45, 72, 248, 82, 77, 277, 82, 72, 82, 72,
+ 74, 40, 45, 75, 194, 287, 74, 72, 75, 72,
+ 79, 75, 202, 75, 248, 75, 72, 290, 77, 73,
+ 210, 4, 5, 6, 82, 73, 16, 10, 11, 12,
+ 81, 171, 82, 189, 191, 82, 190, 57, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 64, 82, 5, 249, 252, 38, 39, 288, 41, 42,
+ 43, 44, 252, 46, 125, 255, 256, 55, 210, 46,
+ -1, 252, -1, 268, -1, -1, -1, -1, 268, 269,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 280, -1, -1, -1, 284, 285, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, -1, -1, -1, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, -1, -1, 51, 52, -1, -1, -1, -1,
+ -1, -1, -1, -1, 284, -1, -1, -1, 288, 289,
+ 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, -1, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ -1, -1, -1, 36, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
+ 53, 54, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
+ -1, -1, -1, 76, 77, -1, -1, -1, -1, 82,
+ 83, 84, -1, 86, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, -1, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, -1, -1, -1, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, -1, -1, 53, 54, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 70, -1, -1, -1, 74, 75, -1,
- -1, -1, -1, 80, 81, 82, -1, 84, 3, 4,
+ -1, -1, -1, 72, -1, -1, -1, 76, 77, -1,
+ -1, -1, -1, 82, 83, 84, -1, 86, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, -1, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, -1, -1,
-1, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, -1, -1, 51, 52, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 70, -1, -1, -1, 74,
- 75, -1, -1, -1, -1, 80, 81, 82, -1, 84,
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
- 13, 14, 15, -1, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- -1, -1, -1, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, -1, -1, 51, 52,
+ 45, 46, 47, 48, 49, 50, -1, -1, 53, 54,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 70, -1, -1,
- -1, 74, -1, -1, -1, -1, -1, 80, 81, 82,
- -1, 84, 3, 4, 5, 6, 7, 8, 9, 10,
+ -1, -1, -1, -1, -1, -1, -1, 72, -1, -1,
+ -1, 76, -1, -1, -1, -1, -1, 82, 83, 84,
+ -1, 86, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, 14, 15, -1, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
31, 32, -1, -1, -1, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, -1, -1,
- 51, 52, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 70,
- -1, -1, -1, 74, -1, -1, -1, -1, -1, 80,
- 81, 82, -1, 84, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, -1, -1, -1, -1, -1, -1,
- -1, -1, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, -1, -1, -1, 36, 37, 38,
- 39, -1, 41, 42, 43, 44, 45, 46, 47, 48,
- -1, -1, 51, 52, -1, -1, -1, -1, -1, -1,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ -1, -1, 53, 54, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 70, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 80, 81, 82, -1, 84, 3, 4, 5, 6,
- -1, 8, 9, 10, 11, 12, -1, -1, -1, -1,
+ -1, 72, -1, -1, -1, 76, -1, -1, -1, -1,
+ -1, 82, 83, 84, -1, 86, 3, 4, 5, 6,
+ 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
-1, -1, -1, -1, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, -1, -1, -1, 36,
37, 38, 39, -1, 41, 42, 43, 44, 45, 46,
- 47, 48, -1, -1, 51, 52, -1, -1, -1, -1,
+ 47, 48, 49, 50, -1, -1, 53, 54, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 70, -1, -1, -1, 10, 11, 12,
- -1, -1, -1, -1, 81, 82, -1, 84, 21, 22,
+ -1, -1, -1, -1, -1, 72, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 82, 83, 84, -1, 86,
+ 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
+ -1, -1, -1, -1, -1, -1, -1, -1, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- -1, -1, -1, -1, -1, 38, 39, -1, 41, 42,
- 43, 44, 45, 46, 47, 48, -1, -1, 51, 52,
+ -1, -1, -1, 36, 37, 38, 39, -1, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
+ 53, 54, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
+ -1, -1, -1, 10, 11, 12, -1, -1, -1, -1,
+ 83, 84, -1, 86, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, -1, -1, -1, -1,
+ -1, 38, 39, -1, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, -1, -1, 53, 54, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 70, -1, -1,
- 73, 10, 11, 12, -1, -1, -1, -1, 81, 82,
- -1, 84, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, -1, -1, -1, -1, -1, 38,
- 39, -1, 41, 42, 43, 44, 45, 46, 47, 48,
- -1, -1, 51, 52, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 72, -1, -1, 75, 10,
+ 11, 12, -1, -1, -1, -1, 83, 84, -1, 86,
+ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
+ 31, 32, -1, -1, -1, -1, -1, 38, 39, -1,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ -1, -1, 53, 54, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 70, -1, -1, -1, 10, 11, 12, -1, -1,
- -1, 80, 81, 82, -1, 84, 21, 22, 23, 24,
+ -1, 72, -1, -1, -1, 10, 11, 12, -1, -1,
+ -1, 82, 83, 84, -1, 86, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, -1, -1,
-1, -1, -1, 38, 39, -1, 41, 42, 43, 44,
- 45, 46, 47, 48, -1, -1, 51, 52, -1, -1,
+ 45, 46, 47, 48, 49, 50, -1, -1, 53, 54,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 70, -1, -1, 73, 10,
- 11, 12, -1, -1, -1, -1, 81, 82, -1, 84,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, -1, -1, -1, -1, -1, 38, 39, -1,
- 41, 42, 43, 44, 45, 46, 47, 48, -1, -1,
- 51, 52, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 70,
- -1, -1, -1, 10, 11, 12, -1, -1, -1, -1,
- 81, 82, -1, 84, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, -1, -1, -1, -1,
- -1, 38, 39, -1, 41, 42, 43, 44, 45, 46,
- 47, 48, -1, -1, 51, 52, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 72, -1, -1,
+ 75, 10, 11, 12, -1, -1, -1, -1, 83, 84,
+ -1, 86, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, -1, -1, -1, -1, -1, 38,
+ 39, -1, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, -1, -1, 53, 54, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 70, 4, 5, 6, -1, -1, -1,
- 10, 11, 12, -1, 81, 82, -1, 84, -1, -1,
- -1, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, -1, -1, -1, -1, -1, 38, 39,
- -1, 41, 42, -1, 44, 4, 5, 6, -1, -1,
- -1, 10, 11, 12, -1, -1, -1, -1, -1, -1,
- -1, -1, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, -1, 75, -1, -1, -1, 38,
- 39, -1, 41, 42, -1, 44, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, -1, -1, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
- -1, -1, -1, -1, -1, -1, 75, 21, 22, 23,
+ -1, -1, -1, 72, -1, -1, -1, 10, 11, 12,
+ -1, -1, -1, -1, 83, 84, -1, 86, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ -1, -1, -1, -1, -1, 38, 39, -1, 41, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
+ 53, 54, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 72,
+ 4, 5, 6, -1, -1, -1, 10, 11, 12, -1,
+ 83, 84, -1, 86, -1, -1, -1, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
- -1, -1, 36, 37, 38, 39, -1, 41, 42, -1,
- 44, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, -1, -1, -1, -1, -1, -1, -1, -1, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, -1, -1, -1, 36, 37, 38, 39, -1, 41,
- 42, -1, 44, 4, 5, 6, -1, -1, -1, 10,
+ -1, -1, -1, -1, 38, 39, -1, 41, 42, 43,
+ 44, -1, 46, 4, 5, 6, -1, -1, -1, 10,
11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, -1, 10, 11, 12, -1, 38, 39, -1,
- 41, 42, -1, 44, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, -1, -1, -1, -1,
- -1, 38, 39, -1, 41, 42, 43, 44, 10, 11,
- 12, 48, -1, -1, -1, -1, -1, -1, -1, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, -1, -1, -1, -1, -1, 38, 39, -1, 41,
- 42, -1, 44
+ 31, 32, -1, 77, -1, -1, -1, 38, 39, -1,
+ 41, 42, 43, 44, -1, 46, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 0, -1, -1, 3,
+ 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
+ -1, -1, -1, -1, -1, -1, 77, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, -1,
+ -1, -1, 36, 37, 38, 39, -1, 41, 42, 43,
+ 44, -1, 46, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, -1, -1, -1, -1, -1, -1, -1,
+ -1, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, -1, -1, -1, 36, 37, 38, 39,
+ -1, 41, 42, 43, 44, -1, 46, 10, 11, 12,
+ -1, -1, -1, -1, -1, -1, -1, -1, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ -1, -1, -1, -1, -1, 38, 39, -1, 41, 42,
+ 43, 44, 45, 46, 10, 11, 12, 50, -1, -1,
+ -1, -1, -1, -1, -1, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, -1, -1, -1,
+ -1, -1, 38, 39, -1, 41, 42, 43, 44, -1,
+ 46
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1266,34 +1274,34 @@ static const yytype_uint8 yystos[] =
{
0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 21, 22, 23, 24, 25, 26, 27, 28, 29,
- 30, 31, 32, 36, 37, 38, 39, 41, 42, 44,
- 124, 125, 126, 127, 128, 133, 134, 135, 136, 137,
- 138, 139, 140, 141, 168, 169, 170, 37, 43, 138,
- 43, 74, 80, 171, 71, 77, 3, 33, 34, 35,
- 130, 131, 136, 77, 80, 43, 137, 139, 72, 0,
- 169, 139, 74, 137, 142, 143, 74, 154, 130, 129,
- 132, 137, 131, 43, 70, 72, 79, 43, 45, 46,
- 47, 48, 51, 52, 70, 81, 82, 84, 95, 96,
- 97, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 123, 140, 80, 142, 43, 144, 145, 75,
- 143, 13, 14, 15, 17, 18, 19, 20, 40, 74,
- 75, 80, 106, 119, 120, 122, 124, 125, 140, 147,
- 148, 149, 150, 155, 156, 157, 160, 167, 43, 129,
- 132, 72, 79, 73, 123, 120, 146, 106, 106, 122,
- 51, 52, 72, 76, 71, 71, 77, 39, 120, 70,
- 106, 85, 86, 82, 84, 53, 54, 88, 89, 55,
- 56, 57, 59, 58, 93, 73, 75, 72, 77, 80,
- 80, 80, 162, 70, 70, 80, 80, 122, 70, 75,
- 151, 60, 61, 62, 69, 79, 121, 77, 80, 75,
- 148, 72, 73, 123, 146, 73, 71, 98, 122, 43,
- 48, 101, 120, 106, 106, 108, 108, 110, 110, 110,
- 110, 111, 111, 115, 116, 117, 122, 123, 145, 148,
- 163, 122, 80, 161, 155, 120, 120, 123, 73, 73,
- 78, 73, 40, 147, 156, 164, 71, 122, 135, 159,
- 152, 73, 120, 70, 159, 165, 166, 148, 158, 43,
- 71, 75, 122, 80, 71, 16, 79, 149, 153, 154,
- 71, 122, 153, 148, 146, 80
+ 30, 31, 32, 36, 37, 38, 39, 41, 42, 43,
+ 44, 46, 126, 127, 128, 129, 130, 135, 136, 137,
+ 138, 139, 140, 141, 142, 143, 172, 173, 174, 37,
+ 45, 140, 45, 76, 82, 175, 73, 79, 3, 33,
+ 34, 35, 132, 133, 138, 79, 82, 45, 139, 141,
+ 74, 0, 173, 141, 76, 145, 76, 158, 132, 131,
+ 134, 139, 133, 45, 72, 74, 81, 45, 47, 48,
+ 49, 50, 53, 54, 72, 83, 84, 86, 97, 98,
+ 99, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+ 110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
+ 120, 121, 125, 142, 82, 144, 139, 146, 147, 13,
+ 14, 15, 17, 18, 19, 20, 40, 76, 77, 82,
+ 108, 121, 122, 124, 126, 127, 142, 151, 152, 153,
+ 154, 159, 160, 161, 164, 171, 45, 131, 134, 74,
+ 81, 75, 125, 122, 150, 108, 108, 124, 53, 54,
+ 74, 78, 73, 73, 79, 39, 122, 72, 108, 87,
+ 88, 84, 86, 55, 56, 90, 91, 57, 58, 59,
+ 61, 60, 95, 75, 146, 45, 148, 149, 77, 147,
+ 82, 82, 166, 72, 72, 82, 82, 124, 72, 77,
+ 155, 62, 63, 64, 71, 81, 123, 79, 82, 77,
+ 152, 74, 75, 125, 150, 75, 73, 100, 124, 45,
+ 50, 103, 122, 108, 108, 110, 110, 112, 112, 112,
+ 112, 113, 113, 117, 118, 119, 124, 77, 74, 79,
+ 82, 152, 167, 124, 82, 165, 159, 122, 122, 125,
+ 75, 75, 80, 125, 149, 40, 151, 160, 168, 73,
+ 124, 137, 163, 156, 75, 122, 75, 72, 163, 169,
+ 170, 152, 162, 45, 73, 77, 124, 82, 73, 16,
+ 81, 153, 157, 158, 73, 124, 157, 152, 150, 82
};
#define yyerrok (yyerrstatus = 0)
@@ -3884,13 +3892,39 @@ yyreduce:
case 134:
{
+ if (!context->supportsExtension("GL_OES_EGL_image_external")) {
+ context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES", "");
+ context->recover();
+ }
+ FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
+ TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
+ (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
+ ;}
+ break;
+
+ case 135:
+
+ {
+ if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
+ context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect", "");
+ context->recover();
+ }
+ FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
+ TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
+ (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
+ ;}
+ break;
+
+ case 136:
+
+ {
FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
(yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
(yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
;}
break;
- case 135:
+ case 137:
{
//
@@ -3904,40 +3938,52 @@ yyreduce:
;}
break;
- case 136:
+ case 138:
+
+ { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); ;}
+ break;
+
+ case 139:
{
- if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
+ if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
context->recover();
- TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), *(yyvsp[(2) - (5)].lex).string);
- TVariable* userTypeDef = new TVariable((yyvsp[(2) - (5)].lex).string, *structure, true);
+ TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
+ TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
if (! context->symbolTable.insert(*userTypeDef)) {
- context->error((yyvsp[(2) - (5)].lex).line, "redefinition", (yyvsp[(2) - (5)].lex).string->c_str(), "struct");
+ context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
context->recover();
}
- (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
+ (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
(yyval.interm.type).userDef = structure;
+ context->exitStructDeclaration();
;}
break;
- case 137:
+ case 140:
+
+ { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); ;}
+ break;
+
+ case 141:
{
- TType* structure = new TType((yyvsp[(3) - (4)].interm.typeList), TString(""));
- (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (4)].lex).line);
+ TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
+ (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
(yyval.interm.type).userDef = structure;
+ context->exitStructDeclaration();
;}
break;
- case 138:
+ case 142:
{
(yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
;}
break;
- case 139:
+ case 143:
{
(yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
@@ -3953,7 +3999,7 @@ yyreduce:
;}
break;
- case 140:
+ case 144:
{
(yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
@@ -3982,11 +4028,15 @@ yyreduce:
type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
}
+
+ if (context->structNestingErrorCheck((yyvsp[(1) - (3)].interm.type).line, *type)) {
+ context->recover();
+ }
}
;}
break;
- case 141:
+ case 145:
{
(yyval.interm.typeList) = NewPoolTTypeList();
@@ -3994,14 +4044,14 @@ yyreduce:
;}
break;
- case 142:
+ case 146:
{
(yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
;}
break;
- case 143:
+ case 147:
{
if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
@@ -4013,7 +4063,7 @@ yyreduce:
;}
break;
- case 144:
+ case 148:
{
if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
@@ -4030,67 +4080,67 @@ yyreduce:
;}
break;
- case 145:
+ case 149:
{ (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); ;}
break;
- case 146:
+ case 150:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 147:
+ case 151:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); ;}
break;
- case 148:
+ case 152:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 149:
+ case 153:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 150:
+ case 154:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 151:
+ case 155:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 152:
+ case 156:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 153:
+ case 157:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 154:
+ case 158:
{ (yyval.interm.intermAggregate) = 0; ;}
break;
- case 155:
+ case 159:
{ context->symbolTable.push(); ;}
break;
- case 156:
+ case 160:
{ context->symbolTable.pop(); ;}
break;
- case 157:
+ case 161:
{
if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
@@ -4101,24 +4151,24 @@ yyreduce:
;}
break;
- case 158:
+ case 162:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 159:
+ case 163:
{ (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); ;}
break;
- case 160:
+ case 164:
{
(yyval.interm.intermNode) = 0;
;}
break;
- case 161:
+ case 165:
{
if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
@@ -4129,31 +4179,31 @@ yyreduce:
;}
break;
- case 162:
+ case 166:
{
(yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
;}
break;
- case 163:
+ case 167:
{
(yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
;}
break;
- case 164:
+ case 168:
{ (yyval.interm.intermNode) = 0; ;}
break;
- case 165:
+ case 169:
{ (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); ;}
break;
- case 166:
+ case 170:
{
if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
@@ -4162,7 +4212,7 @@ yyreduce:
;}
break;
- case 167:
+ case 171:
{
(yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
@@ -4170,7 +4220,7 @@ yyreduce:
;}
break;
- case 168:
+ case 172:
{
(yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
@@ -4178,7 +4228,7 @@ yyreduce:
;}
break;
- case 169:
+ case 173:
{
(yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
@@ -4187,7 +4237,7 @@ yyreduce:
;}
break;
- case 170:
+ case 174:
{
TIntermNode* intermNode;
@@ -4205,12 +4255,12 @@ yyreduce:
;}
break;
- case 171:
+ case 175:
{ context->symbolTable.push(); ++context->loopNestingLevel; ;}
break;
- case 172:
+ case 176:
{
context->symbolTable.pop();
@@ -4219,12 +4269,12 @@ yyreduce:
;}
break;
- case 173:
+ case 177:
{ ++context->loopNestingLevel; ;}
break;
- case 174:
+ case 178:
{
if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
@@ -4235,12 +4285,12 @@ yyreduce:
;}
break;
- case 175:
+ case 179:
{ context->symbolTable.push(); ++context->loopNestingLevel; ;}
break;
- case 176:
+ case 180:
{
context->symbolTable.pop();
@@ -4249,35 +4299,35 @@ yyreduce:
;}
break;
- case 177:
+ case 181:
{
(yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
;}
break;
- case 178:
+ case 182:
{
(yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
;}
break;
- case 179:
+ case 183:
{
(yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
;}
break;
- case 180:
+ case 184:
{
(yyval.interm.intermTypedNode) = 0;
;}
break;
- case 181:
+ case 185:
{
(yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
@@ -4285,7 +4335,7 @@ yyreduce:
;}
break;
- case 182:
+ case 186:
{
(yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
@@ -4293,7 +4343,7 @@ yyreduce:
;}
break;
- case 183:
+ case 187:
{
if (context->loopNestingLevel <= 0) {
@@ -4304,7 +4354,7 @@ yyreduce:
;}
break;
- case 184:
+ case 188:
{
if (context->loopNestingLevel <= 0) {
@@ -4315,7 +4365,7 @@ yyreduce:
;}
break;
- case 185:
+ case 189:
{
(yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
@@ -4326,7 +4376,7 @@ yyreduce:
;}
break;
- case 186:
+ case 190:
{
(yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
@@ -4341,7 +4391,7 @@ yyreduce:
;}
break;
- case 187:
+ case 191:
{
FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
@@ -4349,7 +4399,7 @@ yyreduce:
;}
break;
- case 188:
+ case 192:
{
(yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
@@ -4357,7 +4407,7 @@ yyreduce:
;}
break;
- case 189:
+ case 193:
{
(yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
@@ -4365,21 +4415,21 @@ yyreduce:
;}
break;
- case 190:
+ case 194:
{
(yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
;}
break;
- case 191:
+ case 195:
{
(yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
;}
break;
- case 192:
+ case 196:
{
TFunction* function = (yyvsp[(1) - (1)].interm).function;
@@ -4464,7 +4514,7 @@ yyreduce:
;}
break;
- case 193:
+ case 197:
{
//?? Check that all paths return a value if return type != void ?
diff --git a/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.h b/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.h
index fa8480d3a..23945b8ac 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/glslang_tab.h
@@ -79,57 +79,59 @@
WHILE = 295,
SAMPLER2D = 296,
SAMPLERCUBE = 297,
- IDENTIFIER = 298,
- TYPE_NAME = 299,
- FLOATCONSTANT = 300,
- INTCONSTANT = 301,
- BOOLCONSTANT = 302,
- FIELD_SELECTION = 303,
- LEFT_OP = 304,
- RIGHT_OP = 305,
- INC_OP = 306,
- DEC_OP = 307,
- LE_OP = 308,
- GE_OP = 309,
- EQ_OP = 310,
- NE_OP = 311,
- AND_OP = 312,
- OR_OP = 313,
- XOR_OP = 314,
- MUL_ASSIGN = 315,
- DIV_ASSIGN = 316,
- ADD_ASSIGN = 317,
- MOD_ASSIGN = 318,
- LEFT_ASSIGN = 319,
- RIGHT_ASSIGN = 320,
- AND_ASSIGN = 321,
- XOR_ASSIGN = 322,
- OR_ASSIGN = 323,
- SUB_ASSIGN = 324,
- LEFT_PAREN = 325,
- RIGHT_PAREN = 326,
- LEFT_BRACKET = 327,
- RIGHT_BRACKET = 328,
- LEFT_BRACE = 329,
- RIGHT_BRACE = 330,
- DOT = 331,
- COMMA = 332,
- COLON = 333,
- EQUAL = 334,
- SEMICOLON = 335,
- BANG = 336,
- DASH = 337,
- TILDE = 338,
- PLUS = 339,
- STAR = 340,
- SLASH = 341,
- PERCENT = 342,
- LEFT_ANGLE = 343,
- RIGHT_ANGLE = 344,
- VERTICAL_BAR = 345,
- CARET = 346,
- AMPERSAND = 347,
- QUESTION = 348
+ SAMPLER_EXTERNAL_OES = 298,
+ SAMPLER2DRECT = 299,
+ IDENTIFIER = 300,
+ TYPE_NAME = 301,
+ FLOATCONSTANT = 302,
+ INTCONSTANT = 303,
+ BOOLCONSTANT = 304,
+ FIELD_SELECTION = 305,
+ LEFT_OP = 306,
+ RIGHT_OP = 307,
+ INC_OP = 308,
+ DEC_OP = 309,
+ LE_OP = 310,
+ GE_OP = 311,
+ EQ_OP = 312,
+ NE_OP = 313,
+ AND_OP = 314,
+ OR_OP = 315,
+ XOR_OP = 316,
+ MUL_ASSIGN = 317,
+ DIV_ASSIGN = 318,
+ ADD_ASSIGN = 319,
+ MOD_ASSIGN = 320,
+ LEFT_ASSIGN = 321,
+ RIGHT_ASSIGN = 322,
+ AND_ASSIGN = 323,
+ XOR_ASSIGN = 324,
+ OR_ASSIGN = 325,
+ SUB_ASSIGN = 326,
+ LEFT_PAREN = 327,
+ RIGHT_PAREN = 328,
+ LEFT_BRACKET = 329,
+ RIGHT_BRACKET = 330,
+ LEFT_BRACE = 331,
+ RIGHT_BRACE = 332,
+ DOT = 333,
+ COMMA = 334,
+ COLON = 335,
+ EQUAL = 336,
+ SEMICOLON = 337,
+ BANG = 338,
+ DASH = 339,
+ TILDE = 340,
+ PLUS = 341,
+ STAR = 342,
+ SLASH = 343,
+ PERCENT = 344,
+ LEFT_ANGLE = 345,
+ RIGHT_ANGLE = 346,
+ VERTICAL_BAR = 347,
+ CARET = 348,
+ AMPERSAND = 349,
+ QUESTION = 350
};
#endif
/* Tokens. */
@@ -173,57 +175,59 @@
#define WHILE 295
#define SAMPLER2D 296
#define SAMPLERCUBE 297
-#define IDENTIFIER 298
-#define TYPE_NAME 299
-#define FLOATCONSTANT 300
-#define INTCONSTANT 301
-#define BOOLCONSTANT 302
-#define FIELD_SELECTION 303
-#define LEFT_OP 304
-#define RIGHT_OP 305
-#define INC_OP 306
-#define DEC_OP 307
-#define LE_OP 308
-#define GE_OP 309
-#define EQ_OP 310
-#define NE_OP 311
-#define AND_OP 312
-#define OR_OP 313
-#define XOR_OP 314
-#define MUL_ASSIGN 315
-#define DIV_ASSIGN 316
-#define ADD_ASSIGN 317
-#define MOD_ASSIGN 318
-#define LEFT_ASSIGN 319
-#define RIGHT_ASSIGN 320
-#define AND_ASSIGN 321
-#define XOR_ASSIGN 322
-#define OR_ASSIGN 323
-#define SUB_ASSIGN 324
-#define LEFT_PAREN 325
-#define RIGHT_PAREN 326
-#define LEFT_BRACKET 327
-#define RIGHT_BRACKET 328
-#define LEFT_BRACE 329
-#define RIGHT_BRACE 330
-#define DOT 331
-#define COMMA 332
-#define COLON 333
-#define EQUAL 334
-#define SEMICOLON 335
-#define BANG 336
-#define DASH 337
-#define TILDE 338
-#define PLUS 339
-#define STAR 340
-#define SLASH 341
-#define PERCENT 342
-#define LEFT_ANGLE 343
-#define RIGHT_ANGLE 344
-#define VERTICAL_BAR 345
-#define CARET 346
-#define AMPERSAND 347
-#define QUESTION 348
+#define SAMPLER_EXTERNAL_OES 298
+#define SAMPLER2DRECT 299
+#define IDENTIFIER 300
+#define TYPE_NAME 301
+#define FLOATCONSTANT 302
+#define INTCONSTANT 303
+#define BOOLCONSTANT 304
+#define FIELD_SELECTION 305
+#define LEFT_OP 306
+#define RIGHT_OP 307
+#define INC_OP 308
+#define DEC_OP 309
+#define LE_OP 310
+#define GE_OP 311
+#define EQ_OP 312
+#define NE_OP 313
+#define AND_OP 314
+#define OR_OP 315
+#define XOR_OP 316
+#define MUL_ASSIGN 317
+#define DIV_ASSIGN 318
+#define ADD_ASSIGN 319
+#define MOD_ASSIGN 320
+#define LEFT_ASSIGN 321
+#define RIGHT_ASSIGN 322
+#define AND_ASSIGN 323
+#define XOR_ASSIGN 324
+#define OR_ASSIGN 325
+#define SUB_ASSIGN 326
+#define LEFT_PAREN 327
+#define RIGHT_PAREN 328
+#define LEFT_BRACKET 329
+#define RIGHT_BRACKET 330
+#define LEFT_BRACE 331
+#define RIGHT_BRACE 332
+#define DOT 333
+#define COMMA 334
+#define COLON 335
+#define EQUAL 336
+#define SEMICOLON 337
+#define BANG 338
+#define DASH 339
+#define TILDE 340
+#define PLUS 341
+#define STAR 342
+#define SLASH 343
+#define PERCENT 344
+#define LEFT_ANGLE 345
+#define RIGHT_ANGLE 346
+#define VERTICAL_BAR 347
+#define CARET 348
+#define AMPERSAND 349
+#define QUESTION 350
diff --git a/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp b/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
index 798a69af7..e83c7b72f 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/intermOut.cpp
@@ -261,6 +261,8 @@ bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate* node)
case EOpRefract: out << "refract"; break;
case EOpMul: out << "component-wise multiply"; break;
+ case EOpDeclaration: out << "Declaration: "; break;
+
default: out.message(EPrefixError, "Bad aggregation op");
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/intermediate.h b/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
index a8af5ab06..5441557ca 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/intermediate.h
@@ -410,8 +410,8 @@ protected:
//
class TIntermUnary : public TIntermOperator {
public:
- TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0) {}
- TIntermUnary(TOperator o) : TIntermOperator(o), operand(0) {}
+ TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0), useEmulatedFunction(false) {}
+ TIntermUnary(TOperator o) : TIntermOperator(o), operand(0), useEmulatedFunction(false) {}
virtual void traverse(TIntermTraverser*);
virtual TIntermUnary* getAsUnaryNode() { return this; }
@@ -420,8 +420,15 @@ public:
TIntermTyped* getOperand() { return operand; }
bool promote(TInfoSink&);
+ void setUseEmulatedFunction() { useEmulatedFunction = true; }
+ bool getUseEmulatedFunction() { return useEmulatedFunction; }
+
protected:
TIntermTyped* operand;
+
+ // If set to true, replace the built-in function call with an emulated one
+ // to work around driver bugs.
+ bool useEmulatedFunction;
};
typedef TVector<TIntermNode*> TIntermSequence;
@@ -432,8 +439,8 @@ typedef TMap<TString, TString> TPragmaTable;
//
class TIntermAggregate : public TIntermOperator {
public:
- TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0), endLine(0) { }
- TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { }
+ TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0), endLine(0), useEmulatedFunction(false) { }
+ TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0), useEmulatedFunction(false) { }
~TIntermAggregate() { delete pragmaTable; }
virtual TIntermAggregate* getAsAggregate() { return this; }
@@ -456,6 +463,9 @@ public:
void setEndLine(TSourceLoc line) { endLine = line; }
TSourceLoc getEndLine() const { return endLine; }
+ void setUseEmulatedFunction() { useEmulatedFunction = true; }
+ bool getUseEmulatedFunction() { return useEmulatedFunction; }
+
protected:
TIntermAggregate(const TIntermAggregate&); // disallow copy constructor
TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator
@@ -467,6 +477,10 @@ protected:
bool debug;
TPragmaTable *pragmaTable;
TSourceLoc endLine;
+
+ // If set to true, replace the built-in function call with an emulated one
+ // to work around driver bugs.
+ bool useEmulatedFunction;
};
//
diff --git a/Source/ThirdParty/ANGLE/src/compiler/osinclude.h b/Source/ThirdParty/ANGLE/src/compiler/osinclude.h
index 1af5064b0..6ce4df94d 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/osinclude.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/osinclude.h
@@ -16,7 +16,7 @@
#define ANGLE_OS_WIN
#elif defined(__APPLE__) || defined(__linux__) || \
defined(__FreeBSD__) || defined(__OpenBSD__) || \
- defined(__sun)
+ defined(__sun) || defined(ANDROID)
#define ANGLE_OS_POSIX
#else
#error Unsupported platform.
diff --git a/Source/ThirdParty/ANGLE/src/compiler/ossource_posix.cpp b/Source/ThirdParty/ANGLE/src/compiler/ossource_posix.cpp
index a21b0c23c..1e1e699ae 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/ossource_posix.cpp
+++ b/Source/ThirdParty/ANGLE/src/compiler/ossource_posix.cpp
@@ -27,7 +27,9 @@ OS_TLSIndex OS_AllocTLSIndex()
assert(0 && "OS_AllocTLSIndex(): Unable to allocate Thread Local Storage");
return false;
}
- return pPoolIndex;
+ else {
+ return pPoolIndex;
+ }
}
@@ -40,7 +42,8 @@ bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue)
if (pthread_setspecific(nIndex, lpvValue) == 0)
return true;
- return false;
+ else
+ return false;
}
@@ -56,5 +59,6 @@ bool OS_FreeTLSIndex(OS_TLSIndex nIndex)
//
if (pthread_key_delete(nIndex) == 0)
return true;
- return false;
+ else
+ return false;
}
diff --git a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
index b4a7761ae..a17c319d2 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
+++ b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
@@ -335,7 +335,7 @@ static int GrowAtomTable(AtomTable *atable, int size)
if (newmap)
atable->amap = newmap;
if (newrev)
- atable->amap = newrev;
+ atable->arev = newrev;
return -1;
}
memset(&newmap[atable->size], 0, (size - atable->size) * sizeof(int));
diff --git a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/length_limits.h b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/length_limits.h
new file mode 100644
index 000000000..4f1f71319
--- /dev/null
+++ b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/length_limits.h
@@ -0,0 +1,21 @@
+//
+// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+//
+// length_limits.h
+//
+
+#if !defined(__LENGTH_LIMITS_H)
+#define __LENGTH_LIMITS_H 1
+
+// These constants are factored out from the rest of the headers to
+// make it easier to reference them from the compiler sources.
+
+// These lengths do not include the NULL terminator.
+#define MAX_SYMBOL_NAME_LEN 256
+#define MAX_STRING_LEN 511
+
+#endif // !(defined(__LENGTH_LIMITS_H)
diff --git a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h
index 33306e523..233d1dc16 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h
+++ b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/scanner.h
@@ -48,10 +48,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#if !defined(__SCANNER_H)
#define __SCANNER_H 1
-// These lengths do not include the NULL terminator.
-#define MAX_SYMBOL_NAME_LEN 256
-#define MAX_STRING_LEN 511
-
+#include "compiler/preprocessor/length_limits.h"
#include "compiler/preprocessor/parser.h"
// Not really atom table stuff but needed first...
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/Display.cpp b/Source/ThirdParty/ANGLE/src/libEGL/Display.cpp
index 1d64f9a10..534431d98 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/Display.cpp
+++ b/Source/ThirdParty/ANGLE/src/libEGL/Display.cpp
@@ -11,6 +11,7 @@
#include "libEGL/Display.h"
#include <algorithm>
+#include <map>
#include <vector>
#include "common/debug.h"
@@ -31,7 +32,41 @@
namespace egl
{
-Display::Display(HDC deviceContext) : mDc(deviceContext)
+namespace
+{
+ typedef std::map<EGLNativeDisplayType, Display*> DisplayMap;
+ DisplayMap displays;
+}
+
+egl::Display *Display::getDisplay(EGLNativeDisplayType displayId)
+{
+ if (displays.find(displayId) != displays.end())
+ {
+ return displays[displayId];
+ }
+
+ egl::Display *display = NULL;
+
+ if (displayId == EGL_DEFAULT_DISPLAY)
+ {
+ display = new egl::Display(displayId, (HDC)NULL, false);
+ }
+ else if (displayId == EGL_SOFTWARE_DISPLAY_ANGLE)
+ {
+ display = new egl::Display(displayId, (HDC)NULL, true);
+ }
+ else
+ {
+ // FIXME: Check if displayId is a valid display device context
+
+ display = new egl::Display(displayId, (HDC)displayId, false);
+ }
+
+ displays[displayId] = display;
+ return display;
+}
+
+Display::Display(EGLNativeDisplayType displayId, HDC deviceContext, bool software) : mDc(deviceContext)
{
mD3d9Module = NULL;
@@ -51,11 +86,21 @@ Display::Display(HDC deviceContext) : mDc(deviceContext)
mMinSwapInterval = 1;
mMaxSwapInterval = 1;
+ mSoftwareDevice = software;
+ mDisplayId = displayId;
+ mDeviceLost = false;
}
Display::~Display()
{
terminate();
+
+ DisplayMap::iterator thisDisplay = displays.find(mDisplayId);
+
+ if (thisDisplay != displays.end())
+ {
+ displays.erase(thisDisplay);
+ }
}
bool Display::initialize()
@@ -65,7 +110,14 @@ bool Display::initialize()
return true;
}
- mD3d9Module = GetModuleHandle(TEXT("d3d9.dll"));
+ if (mSoftwareDevice)
+ {
+ mD3d9Module = GetModuleHandle(TEXT("swiftshader_d3d9.dll"));
+ }
+ else
+ {
+ mD3d9Module = GetModuleHandle(TEXT("d3d9.dll"));
+ }
if (mD3d9Module == NULL)
{
terminate();
@@ -253,7 +305,7 @@ void Display::terminate()
if (mDevice)
{
// If the device is lost, reset it first to prevent leaving the driver in an unstable state
- if (isDeviceLost())
+ if (testDeviceLost())
{
resetDevice();
}
@@ -297,8 +349,11 @@ void Display::startScene()
if (!mSceneStarted)
{
long result = mDevice->BeginScene();
- ASSERT(SUCCEEDED(result));
- mSceneStarted = true;
+ if (SUCCEEDED(result)) {
+ // This is defensive checking against the device being
+ // lost at unexpected times.
+ mSceneStarted = true;
+ }
}
}
@@ -306,8 +361,9 @@ void Display::endScene()
{
if (mSceneStarted)
{
- long result = mDevice->EndScene();
- ASSERT(SUCCEEDED(result));
+ // EndScene can fail if the device was lost, for example due
+ // to a TDR during a draw call.
+ mDevice->EndScene();
mSceneStarted = false;
}
}
@@ -391,33 +447,66 @@ bool Display::createDevice()
ASSERT(SUCCEEDED(result));
}
+ initializeDevice();
+
+ return true;
+}
+
+// do any one-time device initialization
+// NOTE: this is also needed after a device lost/reset
+// to reset the scene status and ensure the default states are reset.
+void Display::initializeDevice()
+{
// Permanent non-default states
mDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_LASTPIXEL, FALSE);
mSceneStarted = false;
-
- return true;
}
bool Display::resetDevice()
{
D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters();
- HRESULT result;
-
- do
+
+ HRESULT result = D3D_OK;
+ bool lost = testDeviceLost();
+ int attempts = 3;
+
+ while (lost && attempts > 0)
{
- Sleep(0); // Give the graphics driver some CPU time
+ if (mDeviceEx)
+ {
+ Sleep(500); // Give the graphics driver some CPU time
+ result = mDeviceEx->ResetEx(&presentParameters, NULL);
+ }
+ else
+ {
+ result = mDevice->TestCooperativeLevel();
+
+ while (result == D3DERR_DEVICELOST)
+ {
+ Sleep(100); // Give the graphics driver some CPU time
+ result = mDevice->TestCooperativeLevel();
+ }
- result = mDevice->Reset(&presentParameters);
+ if (result == D3DERR_DEVICENOTRESET)
+ {
+ result = mDevice->Reset(&presentParameters);
+ }
+ }
+
+ lost = testDeviceLost();
+ attempts --;
}
- while (result == D3DERR_DEVICELOST);
if (FAILED(result))
{
+ ERR("Reset/ResetEx failed multiple times: 0x%08X", result);
return error(EGL_BAD_ALLOC, false);
}
- ASSERT(SUCCEEDED(result));
+ // reset device defaults
+ initializeDevice();
return true;
}
@@ -425,6 +514,7 @@ bool Display::resetDevice()
EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGLint *attribList)
{
const Config *configuration = mConfigSet.get(config);
+ EGLint postSubBufferSupported = EGL_FALSE;
if (attribList)
{
@@ -443,6 +533,9 @@ EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGL
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
}
break;
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ postSubBufferSupported = attribList[1];
+ break;
case EGL_VG_COLORSPACE:
return error(EGL_BAD_MATCH, EGL_NO_SURFACE);
case EGL_VG_ALPHA_FORMAT:
@@ -460,7 +553,13 @@ EGLSurface Display::createWindowSurface(HWND window, EGLConfig config, const EGL
return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);
}
- Surface *surface = new Surface(this, configuration, window);
+ if (testDeviceLost())
+ {
+ if (!restoreLostDevice())
+ return EGL_NO_SURFACE;
+ }
+
+ Surface *surface = new Surface(this, configuration, window, postSubBufferSupported);
if (!surface->initialize())
{
@@ -567,6 +666,12 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle,
return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);
}
+ if (testDeviceLost())
+ {
+ if (!restoreLostDevice())
+ return EGL_NO_SURFACE;
+ }
+
Surface *surface = new Surface(this, configuration, shareHandle, width, height, textureFormat, textureTarget);
if (!surface->initialize())
@@ -580,7 +685,7 @@ EGLSurface Display::createOffscreenSurface(EGLConfig config, HANDLE shareHandle,
return success(surface);
}
-EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *shareContext)
+EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *shareContext, bool notifyResets, bool robustAccess)
{
if (!mDevice)
{
@@ -589,34 +694,50 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha
return NULL;
}
}
- else if (isDeviceLost()) // Lost device
+ else if (testDeviceLost()) // Lost device
{
- // Release surface resources to make the Reset() succeed
- for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
- {
- (*surface)->release();
- }
-
- if (!resetDevice())
- {
+ if (!restoreLostDevice())
return NULL;
- }
-
- // Restore any surfaces that may have been lost
- for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
- {
- (*surface)->resetSwapChain();
- }
}
const egl::Config *config = mConfigSet.get(configHandle);
- gl::Context *context = glCreateContext(config, shareContext);
+ gl::Context *context = glCreateContext(config, shareContext, notifyResets, robustAccess);
mContextSet.insert(context);
+ mDeviceLost = false;
return context;
}
+bool Display::restoreLostDevice()
+{
+ for (ContextSet::iterator ctx = mContextSet.begin(); ctx != mContextSet.end(); ctx++)
+ {
+ if ((*ctx)->isResetNotificationEnabled())
+ return false; // If reset notifications have been requested, application must delete all contexts first
+ }
+
+ // Release surface resources to make the Reset() succeed
+ for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
+ {
+ (*surface)->release();
+ }
+
+ if (!resetDevice())
+ {
+ return false;
+ }
+
+ // Restore any surfaces that may have been lost
+ for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++)
+ {
+ (*surface)->resetSwapChain();
+ }
+
+ return true;
+}
+
+
void Display::destroySurface(egl::Surface *surface)
{
delete surface;
@@ -629,6 +750,21 @@ void Display::destroyContext(gl::Context *context)
mContextSet.erase(context);
}
+void Display::notifyDeviceLost()
+{
+ for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end(); context++)
+ {
+ (*context)->markContextLost();
+ }
+ mDeviceLost = true;
+ error(EGL_CONTEXT_LOST);
+}
+
+bool Display::isDeviceLost()
+{
+ return mDeviceLost;
+}
+
bool Display::isInitialized() const
{
return mD3d9 != NULL && mConfigSet.size() > 0;
@@ -695,16 +831,41 @@ D3DADAPTER_IDENTIFIER9 *Display::getAdapterIdentifier()
return &mAdapterIdentifier;
}
-bool Display::isDeviceLost()
+bool Display::testDeviceLost()
{
if (mDeviceEx)
{
return FAILED(mDeviceEx->CheckDeviceState(NULL));
}
- else
+ else if (mDevice)
{
return FAILED(mDevice->TestCooperativeLevel());
}
+
+ return false; // No device yet, so no reset required
+}
+
+bool Display::testDeviceResettable()
+{
+ HRESULT status = D3D_OK;
+
+ if (mDeviceEx)
+ {
+ status = mDeviceEx->CheckDeviceState(NULL);
+ }
+ else if (mDevice)
+ {
+ status = mDevice->TestCooperativeLevel();
+ }
+
+ switch (status)
+ {
+ case D3DERR_DEVICENOTRESET:
+ case D3DERR_DEVICEHUNG:
+ return true;
+ default:
+ return false;
+ }
}
void Display::getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray)
@@ -718,7 +879,7 @@ void Display::getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray)
}
}
-bool Display::getCompressedTextureSupport()
+bool Display::getDXT1TextureSupport()
{
D3DDISPLAYMODE currentDisplayMode;
mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
@@ -726,7 +887,23 @@ bool Display::getCompressedTextureSupport()
return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT1));
}
-bool Display::getFloatTextureSupport(bool *filtering, bool *renderable)
+bool Display::getDXT3TextureSupport()
+{
+ D3DDISPLAYMODE currentDisplayMode;
+ mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
+
+ return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT3));
+}
+
+bool Display::getDXT5TextureSupport()
+{
+ D3DDISPLAYMODE currentDisplayMode;
+ mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
+
+ return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT5));
+}
+
+bool Display::getFloat32TextureSupport(bool *filtering, bool *renderable)
{
D3DDISPLAYMODE currentDisplayMode;
mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
@@ -754,7 +931,7 @@ bool Display::getFloatTextureSupport(bool *filtering, bool *renderable)
}
}
-bool Display::getHalfFloatTextureSupport(bool *filtering, bool *renderable)
+bool Display::getFloat16TextureSupport(bool *filtering, bool *renderable)
{
D3DDISPLAYMODE currentDisplayMode;
mD3d9->GetAdapterDisplayMode(mAdapter, &currentDisplayMode);
@@ -815,6 +992,23 @@ D3DPOOL Display::getBufferPool(DWORD usage) const
return D3DPOOL_DEFAULT;
}
+D3DPOOL Display::getTexturePool(bool renderable) const
+{
+ if (mD3d9Ex != NULL)
+ {
+ return D3DPOOL_DEFAULT;
+ }
+ else
+ {
+ if (!renderable)
+ {
+ return D3DPOOL_MANAGED;
+ }
+ }
+
+ return D3DPOOL_DEFAULT;
+}
+
bool Display::getEventQuerySupport()
{
IDirect3DQuery9 *query;
@@ -851,13 +1045,34 @@ D3DPRESENT_PARAMETERS Display::getDefaultPresentParameters()
void Display::initExtensionString()
{
+ HMODULE swiftShader = GetModuleHandle(TEXT("swiftshader_d3d9.dll"));
+ bool isd3d9ex = isD3d9ExDevice();
+
+ mExtensionString = "";
+
+ // Multi-vendor (EXT) extensions
+ mExtensionString += "EGL_EXT_create_context_robustness ";
+
+ // ANGLE-specific extensions
+ if (isd3d9ex)
+ {
+ mExtensionString += "EGL_ANGLE_d3d_share_handle_client_buffer ";
+ }
+
mExtensionString += "EGL_ANGLE_query_surface_pointer ";
- if (isD3d9ExDevice()) {
+ if (swiftShader)
+ {
+ mExtensionString += "EGL_ANGLE_software_display ";
+ }
+
+ if (isd3d9ex)
+ {
mExtensionString += "EGL_ANGLE_surface_d3d_texture_2d_share_handle ";
- mExtensionString += "EGL_ANGLE_d3d_share_handle_client_buffer ";
}
+ mExtensionString += "EGL_NV_post_sub_buffer";
+
std::string::size_type end = mExtensionString.find_last_not_of(' ');
if (end != std::string::npos)
{
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/Display.h b/Source/ThirdParty/ANGLE/src/libEGL/Display.h
index 86de5cd4b..d054ee9cc 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/Display.h
+++ b/Source/ThirdParty/ANGLE/src/libEGL/Display.h
@@ -29,8 +29,6 @@ namespace egl
class Display
{
public:
- Display(HDC deviceContext);
-
~Display();
bool initialize();
@@ -39,12 +37,14 @@ class Display
virtual void startScene();
virtual void endScene();
+ static egl::Display *getDisplay(EGLNativeDisplayType displayId);
+
bool getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig);
bool getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value);
EGLSurface createWindowSurface(HWND window, EGLConfig config, const EGLint *attribList);
EGLSurface createOffscreenSurface(EGLConfig config, HANDLE shareHandle, const EGLint *attribList);
- EGLContext createContext(EGLConfig configHandle, const gl::Context *shareContext);
+ EGLContext createContext(EGLConfig configHandle, const gl::Context *shareContext, bool notifyResets, bool robustAccess);
void destroySurface(egl::Surface *surface);
void destroyContext(gl::Context *context);
@@ -61,17 +61,24 @@ class Display
virtual IDirect3DDevice9 *getDevice();
virtual D3DCAPS9 getDeviceCaps();
virtual D3DADAPTER_IDENTIFIER9 *getAdapterIdentifier();
- bool isDeviceLost();
+ virtual bool testDeviceLost();
+ virtual bool testDeviceResettable();
virtual void getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray);
- virtual bool getCompressedTextureSupport();
+ virtual bool getDXT1TextureSupport();
+ virtual bool getDXT3TextureSupport();
+ virtual bool getDXT5TextureSupport();
virtual bool getEventQuerySupport();
- virtual bool getFloatTextureSupport(bool *filtering, bool *renderable);
- virtual bool getHalfFloatTextureSupport(bool *filtering, bool *renderable);
+ virtual bool getFloat32TextureSupport(bool *filtering, bool *renderable);
+ virtual bool getFloat16TextureSupport(bool *filtering, bool *renderable);
virtual bool getLuminanceTextureSupport();
virtual bool getLuminanceAlphaTextureSupport();
virtual bool getVertexTextureSupport() const;
virtual bool getNonPower2TextureSupport() const;
virtual D3DPOOL getBufferPool(DWORD usage) const;
+ virtual D3DPOOL getTexturePool(bool renderable) const;
+
+ virtual void notifyDeviceLost();
+ bool isDeviceLost();
bool isD3d9ExDevice() { return mD3d9Ex != NULL; }
const char *getExtensionString() const;
@@ -79,8 +86,13 @@ class Display
private:
DISALLOW_COPY_AND_ASSIGN(Display);
+ Display(EGLNativeDisplayType displayId, HDC deviceContext, bool software);
+
D3DPRESENT_PARAMETERS getDefaultPresentParameters();
+ bool restoreLostDevice();
+
+ EGLNativeDisplayType mDisplayId;
const HDC mDc;
HMODULE mD3d9Module;
@@ -98,6 +110,7 @@ class Display
bool mSceneStarted;
EGLint mMaxSwapInterval;
EGLint mMinSwapInterval;
+ bool mSoftwareDevice;
typedef std::set<Surface*> SurfaceSet;
SurfaceSet mSurfaceSet;
@@ -106,8 +119,10 @@ class Display
typedef std::set<gl::Context*> ContextSet;
ContextSet mContextSet;
+ bool mDeviceLost;
bool createDevice();
+ void initializeDevice();
bool resetDevice();
void initExtensionString();
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/Surface.cpp b/Source/ThirdParty/ANGLE/src/libEGL/Surface.cpp
index eafe5e2d3..ac2e2d9a5 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/Surface.cpp
+++ b/Source/ThirdParty/ANGLE/src/libEGL/Surface.cpp
@@ -39,8 +39,8 @@ int getComparableOSVersion()
}
}
-Surface::Surface(Display *display, const Config *config, HWND window)
- : mDisplay(display), mConfig(config), mWindow(window)
+Surface::Surface(Display *display, const Config *config, HWND window, EGLint postSubBufferSupported)
+ : mDisplay(display), mConfig(config), mWindow(window), mPostSubBufferSupported(postSubBufferSupported)
{
mSwapChain = NULL;
mDepthStencil = NULL;
@@ -61,7 +61,7 @@ Surface::Surface(Display *display, const Config *config, HWND window)
}
Surface::Surface(Display *display, const Config *config, HANDLE shareHandle, EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureType)
- : mDisplay(display), mWindow(NULL), mConfig(config), mShareHandle(shareHandle), mWidth(width), mHeight(height)
+ : mDisplay(display), mWindow(NULL), mConfig(config), mShareHandle(shareHandle), mWidth(width), mHeight(height), mPostSubBufferSupported(EGL_FALSE)
{
mSwapChain = NULL;
mDepthStencil = NULL;
@@ -106,7 +106,7 @@ bool Surface::initialize()
result = DwmSetPresentParameters(mWindow, &presentParams);
if (FAILED(result))
- ERR("Unable to set present parameters: %081X", result);
+ ERR("Unable to set present parameters: 0x%08X", result);
}
}
@@ -174,6 +174,13 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
return false;
}
+ IDirect3DSurface9* preservedRenderTarget = NULL;
+ if (mPostSubBufferSupported && mRenderTarget)
+ {
+ preservedRenderTarget = mRenderTarget;
+ preservedRenderTarget->AddRef();
+ }
+
// Evict all non-render target textures to system memory and release all resources
// before reallocating them to free up as much video memory as possible.
device->EvictManagedResources();
@@ -191,8 +198,32 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
// the current process, disable use of FlipEx.
DWORD windowPID;
GetWindowThreadProcessId(mWindow, &windowPID);
- if(windowPID != GetCurrentProcessId())
- useFlipEx = false;
+ if (windowPID != GetCurrentProcessId())
+ {
+ useFlipEx = false;
+ }
+
+ // Various hardware does not support D3DSWAPEFFECT_FLIPEX when either the
+ // device format or back buffer format is not 32-bit.
+ HDC deviceContext = GetDC(0);
+ int deviceFormatBits = GetDeviceCaps(deviceContext, BITSPIXEL);
+ ReleaseDC(0, deviceContext);
+ if (mConfig->mBufferSize != 32 || deviceFormatBits != 32)
+ {
+ useFlipEx = false;
+ }
+
+ // D3DSWAPEFFECT_FLIPEX is always VSYNCed
+ if (mSwapInterval == 0)
+ {
+ useFlipEx = false;
+ }
+
+ // D3DSWAPEFFECT_FLIPEX does not preserve the back buffer.
+ if (mPostSubBufferSupported)
+ {
+ useFlipEx = false;
+ }
presentParameters.AutoDepthStencilFormat = mConfig->mDepthStencilFormat;
// We set BackBufferCount = 1 even when we use D3DSWAPEFFECT_FLIPEX.
@@ -212,7 +243,7 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
if(useFlipEx)
presentParameters.SwapEffect = D3DSWAPEFFECT_FLIPEX;
else
- presentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ presentParameters.SwapEffect = mPostSubBufferSupported ? D3DSWAPEFFECT_COPY : D3DSWAPEFFECT_DISCARD;
presentParameters.Windowed = TRUE;
presentParameters.BackBufferWidth = backbufferWidth;
presentParameters.BackBufferHeight = backbufferHeight;
@@ -232,11 +263,65 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
if (FAILED(result))
{
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_INVALIDCALL || result == D3DERR_DEVICELOST);
ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result);
release();
- return error(EGL_BAD_ALLOC, false);
+
+
+ if (preservedRenderTarget)
+ {
+ preservedRenderTarget->Release();
+ preservedRenderTarget = NULL;
+ }
+
+ if(isDeviceLostError(result))
+ {
+ mDisplay->notifyDeviceLost();
+ return false;
+ }
+ else
+ {
+ return error(EGL_BAD_ALLOC, false);
+ }
+ }
+
+ if (mWindow)
+ {
+ mSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &mRenderTarget);
+ if (!preservedRenderTarget)
+ {
+ InvalidateRect(mWindow, NULL, FALSE);
+ }
+ }
+ else
+ {
+ mOffscreenTexture->GetSurfaceLevel(0, &mRenderTarget);
+ }
+
+ if (preservedRenderTarget)
+ {
+ RECT rect =
+ {
+ 0, 0,
+ mWidth, mHeight
+ };
+
+ if (rect.right > static_cast<LONG>(presentParameters.BackBufferWidth))
+ {
+ rect.right = presentParameters.BackBufferWidth;
+ }
+
+ if (rect.bottom > static_cast<LONG>(presentParameters.BackBufferHeight))
+ {
+ rect.bottom = presentParameters.BackBufferHeight;
+ }
+
+ mDisplay->endScene();
+ device->StretchRect(preservedRenderTarget, &rect, mRenderTarget, &rect, D3DTEXF_NONE);
+
+ preservedRenderTarget->Release();
+ preservedRenderTarget = NULL;
}
if (mConfig->mDepthStencilFormat != D3DFMT_UNKNOWN)
@@ -248,20 +333,13 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
if (FAILED(result))
{
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_INVALIDCALL);
- ERR("Could not create depthstencil surface for new swap chain: %08lX", result);
+ ERR("Could not create depthstencil surface for new swap chain: 0x%08X", result);
release();
return error(EGL_BAD_ALLOC, false);
}
- if (mWindow) {
- mSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &mRenderTarget);
- InvalidateRect(mWindow, NULL, FALSE);
- } else {
- mOffscreenTexture->GetSurfaceLevel(0, &mRenderTarget);
- }
-
mWidth = presentParameters.BackBufferWidth;
mHeight = presentParameters.BackBufferHeight;
@@ -307,7 +385,7 @@ void Surface::subclassWindow()
}
SetLastError(0);
- LONG oldWndProc = SetWindowLong(mWindow, GWL_WNDPROC, reinterpret_cast<LONG>(SurfaceWindowProc));
+ LONG_PTR oldWndProc = SetWindowLongPtr(mWindow, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(SurfaceWindowProc));
if(oldWndProc == 0 && GetLastError() != ERROR_SUCCESS)
{
mWindowSubclassed = false;
@@ -327,7 +405,7 @@ void Surface::unsubclassWindow()
}
// un-subclass
- LONG parentWndFunc = reinterpret_cast<LONG>(GetProp(mWindow, kParentWndProc));
+ LONG_PTR parentWndFunc = reinterpret_cast<LONG_PTR>(GetProp(mWindow, kParentWndProc));
// Check the windowproc is still SurfaceWindowProc.
// If this assert fails, then it is likely the application has subclassed the
@@ -336,8 +414,8 @@ void Surface::unsubclassWindow()
// EGL context, or to unsubclass before destroying the EGL context.
if(parentWndFunc)
{
- LONG prevWndFunc = SetWindowLong(mWindow, GWL_WNDPROC, parentWndFunc);
- ASSERT(prevWndFunc == reinterpret_cast<LONG>(SurfaceWindowProc));
+ LONG_PTR prevWndFunc = SetWindowLongPtr(mWindow, GWLP_WNDPROC, parentWndFunc);
+ ASSERT(prevWndFunc == reinterpret_cast<LONG_PTR>(SurfaceWindowProc));
}
RemoveProp(mWindow, kSurfaceProperty);
@@ -395,6 +473,65 @@ bool Surface::swap()
HRESULT result = mSwapChain->Present(NULL, NULL, NULL, NULL, 0);
+ if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
+ {
+ return error(EGL_BAD_ALLOC, false);
+ }
+
+ if (isDeviceLostError(result))
+ {
+ mDisplay->notifyDeviceLost();
+ return false;
+ }
+
+ ASSERT(SUCCEEDED(result));
+
+ checkForOutOfDateSwapChain();
+ }
+
+ return true;
+}
+
+bool Surface::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height)
+{
+ if (x < 0 || y < 0 || width < 0 || height < 0)
+ {
+ return error(EGL_BAD_PARAMETER, false);
+ }
+
+ if (!mPostSubBufferSupported)
+ {
+ // Spec is not clear about how this should be handled.
+ return true;
+ }
+
+ if (mSwapChain)
+ {
+ mDisplay->endScene();
+
+ RECT rect =
+ {
+ x, mHeight - y - height,
+ x + width, mHeight - y
+ };
+
+ if (rect.right > mWidth)
+ {
+ rect.right = mWidth;
+ }
+
+ if (rect.bottom > mHeight)
+ {
+ rect.bottom = mHeight;
+ }
+
+ if (rect.left == rect.right || rect.top == rect.bottom)
+ {
+ return true;
+ }
+
+ HRESULT result = mSwapChain->Present(&rect, &rect, NULL, NULL, 0);
+
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DRIVERINTERNALERROR)
{
return error(EGL_BAD_ALLOC, false);
@@ -423,6 +560,11 @@ EGLint Surface::getHeight() const
return mHeight;
}
+EGLint Surface::isPostSubBufferSupported() const
+{
+ return mPostSubBufferSupported;
+}
+
IDirect3DSurface9 *Surface::getRenderTarget()
{
if (mRenderTarget)
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/Surface.h b/Source/ThirdParty/ANGLE/src/libEGL/Surface.h
index 99c4b6769..35260de56 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/Surface.h
+++ b/Source/ThirdParty/ANGLE/src/libEGL/Surface.h
@@ -30,7 +30,7 @@ class Config;
class Surface
{
public:
- Surface(Display *display, const egl::Config *config, HWND window);
+ Surface(Display *display, const egl::Config *config, HWND window, EGLint postSubBufferSupported);
Surface(Display *display, const egl::Config *config, HANDLE shareHandle, EGLint width, EGLint height, EGLenum textureFormat, EGLenum textureTarget);
~Surface();
@@ -41,10 +41,13 @@ class Surface
HWND getWindowHandle();
bool swap();
+ bool postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height);
virtual EGLint getWidth() const;
virtual EGLint getHeight() const;
+ virtual EGLint isPostSubBufferSupported() const;
+
virtual IDirect3DSurface9 *getRenderTarget();
virtual IDirect3DSurface9 *getDepthStencil();
virtual IDirect3DTexture9 *getOffscreenTexture();
@@ -96,6 +99,8 @@ private:
// EGLenum vgAlphaFormat; // Alpha format for OpenVG
// EGLenum vgColorSpace; // Color space for OpenVG
EGLint mSwapInterval;
+ EGLint mPostSubBufferSupported;
+
DWORD mPresentInterval;
bool mPresentIntervalDirty;
gl::Texture2D *mTexture;
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
index 8689a4ecc..fffda7849 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
+++ b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.cpp
@@ -99,18 +99,7 @@ EGLDisplay __stdcall eglGetDisplay(EGLNativeDisplayType display_id)
try
{
- // FIXME: Return the same EGLDisplay handle when display_id already created a display
-
- if (display_id == EGL_DEFAULT_DISPLAY)
- {
- return new egl::Display((HDC)NULL);
- }
- else
- {
- // FIXME: Check if display_id is a valid display device context
-
- return new egl::Display((HDC)display_id);
- }
+ return egl::Display::getDisplay(display_id);
}
catch(std::bad_alloc&)
{
@@ -499,6 +488,9 @@ EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint
case EGL_WIDTH:
*value = eglSurface->getWidth();
break;
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ *value = eglSurface->isPostSubBufferSupported();
+ break;
default:
return error(EGL_BAD_ATTRIBUTE, EGL_FALSE);
}
@@ -726,7 +718,10 @@ EGLBoolean __stdcall eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint
return error(EGL_BAD_MATCH, EGL_FALSE);
}
- glBindTexImage(eglSurface);
+ if (!glBindTexImage(eglSurface))
+ {
+ return error(EGL_BAD_MATCH, EGL_FALSE);
+ }
return success(EGL_TRUE);
}
@@ -825,16 +820,34 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
{
// Get the requested client version (default is 1) and check it is two.
EGLint client_version = 1;
+ bool reset_notification = false;
+ bool robust_access = false;
+
if (attrib_list)
{
for (const EGLint* attribute = attrib_list; attribute[0] != EGL_NONE; attribute += 2)
{
- if (attribute[0] == EGL_CONTEXT_CLIENT_VERSION)
+ switch (attribute[0])
{
+ case EGL_CONTEXT_CLIENT_VERSION:
client_version = attribute[1];
- }
- else
- {
+ break;
+ case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:
+ if (attribute[1] == EGL_TRUE)
+ {
+ return error(EGL_BAD_CONFIG, EGL_NO_CONTEXT); // Unimplemented
+ robust_access = true;
+ }
+ else if (attribute[1] != EGL_FALSE)
+ return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
+ break;
+ case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:
+ if (attribute[1] == EGL_LOSE_CONTEXT_ON_RESET_EXT)
+ reset_notification = true;
+ else if (attribute[1] != EGL_NO_RESET_NOTIFICATION_EXT)
+ return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
+ break;
+ default:
return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
}
}
@@ -845,6 +858,11 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
return error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
}
+ if (share_context && static_cast<gl::Context*>(share_context)->isResetNotificationEnabled() != reset_notification)
+ {
+ return error(EGL_BAD_MATCH, EGL_NO_CONTEXT);
+ }
+
egl::Display *display = static_cast<egl::Display*>(dpy);
if (!validateConfig(display, config))
@@ -852,9 +870,12 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
return EGL_NO_CONTEXT;
}
- EGLContext context = display->createContext(config, static_cast<gl::Context*>(share_context));
+ EGLContext context = display->createContext(config, static_cast<gl::Context*>(share_context), reset_notification, robust_access);
- return success(context);
+ if (context)
+ return success(context);
+ else
+ return error(EGL_CONTEXT_LOST, EGL_NO_CONTEXT);
}
catch(std::bad_alloc&)
{
@@ -906,7 +927,13 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface
gl::Context *context = static_cast<gl::Context*>(ctx);
IDirect3DDevice9 *device = display->getDevice();
- if (!device || display->isDeviceLost())
+ if (!device || display->testDeviceLost())
+ {
+ display->notifyDeviceLost();
+ return EGL_FALSE;
+ }
+
+ if (display->isDeviceLost())
{
return error(EGL_CONTEXT_LOST, EGL_FALSE);
}
@@ -1088,6 +1115,11 @@ EGLBoolean __stdcall eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
return EGL_FALSE;
}
+ if (display->isDeviceLost())
+ {
+ return error(EGL_CONTEXT_LOST, EGL_FALSE);
+ }
+
if (surface == EGL_NO_SURFACE)
{
return error(EGL_BAD_SURFACE, EGL_FALSE);
@@ -1120,6 +1152,11 @@ EGLBoolean __stdcall eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativ
return EGL_FALSE;
}
+ if (display->isDeviceLost())
+ {
+ return error(EGL_CONTEXT_LOST, EGL_FALSE);
+ }
+
UNIMPLEMENTED(); // FIXME
return success(0);
@@ -1132,6 +1169,43 @@ EGLBoolean __stdcall eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativ
return EGL_FALSE;
}
+EGLBoolean __stdcall eglPostSubBufferNV(EGLDisplay dpy, EGLSurface surface, EGLint x, EGLint y, EGLint width, EGLint height)
+{
+ EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint x = %d, EGLint y = %d, EGLint width = %d, EGLint height = %d)", dpy, surface, x, y, width, height);
+
+ try
+ {
+ egl::Display *display = static_cast<egl::Display*>(dpy);
+ egl::Surface *eglSurface = static_cast<egl::Surface*>(surface);
+
+ if (!validateSurface(display, eglSurface))
+ {
+ return EGL_FALSE;
+ }
+
+ if (display->isDeviceLost())
+ {
+ return error(EGL_CONTEXT_LOST, EGL_FALSE);
+ }
+
+ if (surface == EGL_NO_SURFACE)
+ {
+ return error(EGL_BAD_SURFACE, EGL_FALSE);
+ }
+
+ if (eglSurface->postSubBuffer(x, y, width, height))
+ {
+ return success(EGL_TRUE);
+ }
+ }
+ catch(std::bad_alloc&)
+ {
+ return error(EGL_BAD_ALLOC, EGL_FALSE);
+ }
+
+ return EGL_FALSE;
+}
+
__eglMustCastToProperFunctionPointerType __stdcall eglGetProcAddress(const char *procname)
{
EVENT("(const char *procname = \"%s\")", procname);
@@ -1147,6 +1221,7 @@ __eglMustCastToProperFunctionPointerType __stdcall eglGetProcAddress(const char
static const Extension eglExtensions[] =
{
{"eglQuerySurfacePointerANGLE", (__eglMustCastToProperFunctionPointerType)eglQuerySurfacePointerANGLE},
+ {"eglPostSubBufferNV", (__eglMustCastToProperFunctionPointerType)eglPostSubBufferNV},
{"", NULL},
};
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.rc b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.rc
index 15ed28562..5d1f32f1c 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.rc
+++ b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include <windows.h>
#include "../common/version.h"
/////////////////////////////////////////////////////////////////////////////
diff --git a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj
index 676bc988b..7213f9579 100644
--- a/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj
+++ b/Source/ThirdParty/ANGLE/src/libEGL/libEGL.vcproj
@@ -12,6 +12,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -144,7 +147,7 @@
AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
LinkIncremental="1"
ModuleDefinitionFile="libEGL.def"
- DelayLoadDLLs="dwmapi.lib"
+ DelayLoadDLLs="dwmapi.dll"
GenerateDebugInformation="true"
SubSystem="2"
OptimizeReferences="2"
@@ -176,6 +179,168 @@
CommandLine="@echo on&#x0D;&#x0A;mkdir &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libEGL.dll&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libEGL.lib&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;@echo off&#x0D;&#x0A;"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(ProjectDir)/..; $(ProjectDir)/../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
+ LinkIncremental="2"
+ ModuleDefinitionFile="libEGL.def"
+ DelayLoadDLLs="dwmapi.dll"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="@echo on&#x0D;&#x0A;mkdir &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libEGL.dll&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libEGL.lib&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;@echo off&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="$(ProjectDir)/..; $(ProjectDir)/../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="d3d9.lib dxguid.lib dwmapi.lib"
+ LinkIncremental="1"
+ ModuleDefinitionFile="libEGL.def"
+ DelayLoadDLLs="dwmapi.dll"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="@echo on&#x0D;&#x0A;mkdir &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libEGL.dll&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libEGL.lib&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;@echo off&#x0D;&#x0A;"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Buffer.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Buffer.cpp
index 2cd148e31..dd12e3c07 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Buffer.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Buffer.cpp
@@ -74,6 +74,8 @@ void Buffer::bufferSubData(const void *data, GLsizeiptr size, GLintptr offset)
{
invalidateStaticData();
}
+
+ mUnmodifiedDataUse = 0;
}
StaticVertexBuffer *Buffer::getStaticVertexBuffer()
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Context.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Context.cpp
index 6c973ead2..9b8f729e7 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Context.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Context.cpp
@@ -38,8 +38,13 @@ namespace
namespace gl
{
-Context::Context(const egl::Config *config, const gl::Context *shareContext) : mConfig(config)
+Context::Context(const egl::Config *config, const gl::Context *shareContext, bool notifyResets, bool robustAccess) : mConfig(config)
{
+ ASSERT(robustAccess == false); // Unimplemented
+
+ mDisplay = NULL;
+ mDevice = NULL;
+
mFenceHandleAllocator.setBaseHandle(0);
setClearColor(0.0f, 0.0f, 0.0f, 0.0f);
@@ -142,6 +147,7 @@ Context::Context(const egl::Config *config, const gl::Context *shareContext) : m
mState.packAlignment = 4;
mState.unpackAlignment = 4;
+ mState.packReverseRowOrder = false;
mVertexDataManager = NULL;
mIndexDataManager = NULL;
@@ -155,9 +161,16 @@ Context::Context(const egl::Config *config, const gl::Context *shareContext) : m
mInvalidFramebufferOperation = false;
mHasBeenCurrent = false;
-
- mSupportsCompressedTextures = false;
+ mContextLost = false;
+ mResetStatus = GL_NO_ERROR;
+ mResetStrategy = (notifyResets ? GL_LOSE_CONTEXT_ON_RESET_EXT : GL_NO_RESET_NOTIFICATION_EXT);
+ mRobustAccess = robustAccess;
+
+ mSupportsDXT1Textures = false;
+ mSupportsDXT3Textures = false;
+ mSupportsDXT5Textures = false;
mSupportsEventQueries = false;
+ mNumCompressedTextureFormats = 0;
mMaxSupportedSamples = 0;
mMaskedClearSavedState = NULL;
markAllStateDirty();
@@ -231,19 +244,20 @@ Context::~Context()
void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
{
- IDirect3DDevice9 *device = display->getDevice();
+ mDisplay = display;
+ mDevice = mDisplay->getDevice();
if (!mHasBeenCurrent)
{
- mDeviceCaps = display->getDeviceCaps();
+ mDeviceCaps = mDisplay->getDeviceCaps();
- mVertexDataManager = new VertexDataManager(this, device);
- mIndexDataManager = new IndexDataManager(this, device);
+ mVertexDataManager = new VertexDataManager(this, mDevice);
+ mIndexDataManager = new IndexDataManager(this, mDevice);
mBlit = new Blit(this);
mSupportsShaderModel3 = mDeviceCaps.PixelShaderVersion == D3DPS_VERSION(3, 0);
- mSupportsVertexTexture = display->getVertexTextureSupport();
- mSupportsNonPower2Texture = display->getNonPower2TextureSupport();
+ mSupportsVertexTexture = mDisplay->getVertexTextureSupport();
+ mSupportsNonPower2Texture = mDisplay->getNonPower2TextureSupport();
mMaxTextureDimension = std::min(std::min((int)mDeviceCaps.MaxTextureWidth, (int)mDeviceCaps.MaxTextureHeight),
(int)gl::IMPLEMENTATION_MAX_TEXTURE_SIZE);
@@ -265,7 +279,7 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
for (int i = 0; i < sizeof(renderBufferFormats) / sizeof(D3DFORMAT); ++i)
{
bool *multisampleArray = new bool[D3DMULTISAMPLE_16_SAMPLES + 1];
- display->getMultiSampleSupport(renderBufferFormats[i], multisampleArray);
+ mDisplay->getMultiSampleSupport(renderBufferFormats[i], multisampleArray);
mMultiSampleSupport[renderBufferFormats[i]] = multisampleArray;
for (int j = D3DMULTISAMPLE_16_SAMPLES; j >= 0; --j)
@@ -279,16 +293,33 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
mMaxSupportedSamples = max;
- mSupportsEventQueries = display->getEventQuerySupport();
- mSupportsCompressedTextures = display->getCompressedTextureSupport();
- mSupportsFloatTextures = display->getFloatTextureSupport(&mSupportsFloatLinearFilter, &mSupportsFloatRenderableTextures);
- mSupportsHalfFloatTextures = display->getHalfFloatTextureSupport(&mSupportsHalfFloatLinearFilter, &mSupportsHalfFloatRenderableTextures);
- mSupportsLuminanceTextures = display->getLuminanceTextureSupport();
- mSupportsLuminanceAlphaTextures = display->getLuminanceAlphaTextureSupport();
+ mSupportsEventQueries = mDisplay->getEventQuerySupport();
+ mSupportsDXT1Textures = mDisplay->getDXT1TextureSupport();
+ mSupportsDXT3Textures = mDisplay->getDXT3TextureSupport();
+ mSupportsDXT5Textures = mDisplay->getDXT5TextureSupport();
+ mSupportsFloat32Textures = mDisplay->getFloat32TextureSupport(&mSupportsFloat32LinearFilter, &mSupportsFloat32RenderableTextures);
+ mSupportsFloat16Textures = mDisplay->getFloat16TextureSupport(&mSupportsFloat16LinearFilter, &mSupportsFloat16RenderableTextures);
+ mSupportsLuminanceTextures = mDisplay->getLuminanceTextureSupport();
+ mSupportsLuminanceAlphaTextures = mDisplay->getLuminanceAlphaTextureSupport();
mSupports32bitIndices = mDeviceCaps.MaxVertexIndex >= (1 << 16);
+ mNumCompressedTextureFormats = 0;
+ if (supportsDXT1Textures())
+ {
+ mNumCompressedTextureFormats += 2;
+ }
+ if (supportsDXT3Textures())
+ {
+ mNumCompressedTextureFormats += 1;
+ }
+ if (supportsDXT5Textures())
+ {
+ mNumCompressedTextureFormats += 1;
+ }
+
initExtensionString();
+ initRendererString();
mState.viewportX = 0;
mState.viewportY = 0;
@@ -343,7 +374,12 @@ void Context::markAllStateDirty()
mAppliedRenderTargetSerial = 0;
mAppliedDepthbufferSerial = 0;
mAppliedStencilbufferSerial = 0;
+ mAppliedIBSerial = 0;
mDepthStencilInitialized = false;
+ mViewportInitialized = false;
+ mRenderTargetDescInitialized = false;
+
+ mVertexDeclarationCache.markStateDirty();
mClearStateDirty = true;
mCullStateDirty = true;
@@ -356,6 +392,20 @@ void Context::markAllStateDirty()
mSampleStateDirty = true;
mDitherStateDirty = true;
mFrontFaceDirty = true;
+ mDxUniformsDirty = true;
+ mCachedCurrentProgram = NULL;
+}
+
+void Context::markContextLost()
+{
+ if (mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT)
+ mResetStatus = GL_UNKNOWN_CONTEXT_RESET_EXT;
+ mContextLost = true;
+}
+
+bool Context::isContextLost()
+{
+ return mContextLost;
}
void Context::setClearColor(float red, float green, float blue, float alpha)
@@ -806,6 +856,16 @@ GLint Context::getUnpackAlignment() const
return mState.unpackAlignment;
}
+void Context::setPackReverseRowOrder(bool reverseRowOrder)
+{
+ mState.packReverseRowOrder = reverseRowOrder;
+}
+
+bool Context::getPackReverseRowOrder() const
+{
+ return mState.packReverseRowOrder;
+}
+
GLuint Context::createBuffer()
{
return mResourceManager->createBuffer();
@@ -868,6 +928,7 @@ void Context::deleteShader(GLuint shader)
void Context::deleteProgram(GLuint program)
{
mResourceManager->deleteProgram(program);
+ mCachedCurrentProgram = NULL;
}
void Context::deleteTexture(GLuint texture)
@@ -948,7 +1009,7 @@ Framebuffer *Context::getReadFramebuffer()
Framebuffer *Context::getDrawFramebuffer()
{
- return getFramebuffer(mState.drawFramebuffer);
+ return mBoundDrawFramebuffer;
}
void Context::bindArrayBuffer(unsigned int buffer)
@@ -997,6 +1058,8 @@ void Context::bindDrawFramebuffer(GLuint framebuffer)
}
mState.drawFramebuffer = framebuffer;
+
+ mBoundDrawFramebuffer = getFramebuffer(framebuffer);
}
void Context::bindRenderbuffer(GLuint renderbuffer)
@@ -1015,6 +1078,8 @@ void Context::useProgram(GLuint program)
{
Program *newProgram = mResourceManager->getProgram(program);
Program *oldProgram = mResourceManager->getProgram(priorProgram);
+ mCachedCurrentProgram = NULL;
+ mDxUniformsDirty = true;
if (newProgram)
{
@@ -1032,6 +1097,10 @@ void Context::setFramebufferZero(Framebuffer *buffer)
{
delete mFramebufferMap[0];
mFramebufferMap[0] = buffer;
+ if (mState.drawFramebuffer == 0)
+ {
+ mBoundDrawFramebuffer = buffer;
+ }
}
void Context::setRenderbufferStorage(RenderbufferStorage *renderbuffer)
@@ -1080,7 +1149,11 @@ Buffer *Context::getElementArrayBuffer()
Program *Context::getCurrentProgram()
{
- return mResourceManager->getProgram(mState.currentProgram);
+ if (!mCachedCurrentProgram)
+ {
+ mCachedCurrentProgram = mResourceManager->getProgram(mState.currentProgram);
+ }
+ return mCachedCurrentProgram;
}
Texture2D *Context::getTexture2D()
@@ -1114,24 +1187,25 @@ bool Context::getBooleanv(GLenum pname, GLboolean *params)
{
switch (pname)
{
- case GL_SHADER_COMPILER: *params = GL_TRUE; break;
- case GL_SAMPLE_COVERAGE_INVERT: *params = mState.sampleCoverageInvert; break;
- case GL_DEPTH_WRITEMASK: *params = mState.depthMask; break;
+ case GL_SHADER_COMPILER: *params = GL_TRUE; break;
+ case GL_SAMPLE_COVERAGE_INVERT: *params = mState.sampleCoverageInvert; break;
+ case GL_DEPTH_WRITEMASK: *params = mState.depthMask; break;
case GL_COLOR_WRITEMASK:
params[0] = mState.colorMaskRed;
params[1] = mState.colorMaskGreen;
params[2] = mState.colorMaskBlue;
params[3] = mState.colorMaskAlpha;
break;
- case GL_CULL_FACE: *params = mState.cullFace; break;
- case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFill; break;
- case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverage; break;
- case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverage; break;
- case GL_SCISSOR_TEST: *params = mState.scissorTest; break;
- case GL_STENCIL_TEST: *params = mState.stencilTest; break;
- case GL_DEPTH_TEST: *params = mState.depthTest; break;
- case GL_BLEND: *params = mState.blend; break;
- case GL_DITHER: *params = mState.dither; break;
+ case GL_CULL_FACE: *params = mState.cullFace; break;
+ case GL_POLYGON_OFFSET_FILL: *params = mState.polygonOffsetFill; break;
+ case GL_SAMPLE_ALPHA_TO_COVERAGE: *params = mState.sampleAlphaToCoverage; break;
+ case GL_SAMPLE_COVERAGE: *params = mState.sampleCoverage; break;
+ case GL_SCISSOR_TEST: *params = mState.scissorTest; break;
+ case GL_STENCIL_TEST: *params = mState.stencilTest; break;
+ case GL_DEPTH_TEST: *params = mState.depthTest; break;
+ case GL_BLEND: *params = mState.blend; break;
+ case GL_DITHER: *params = mState.dither; break;
+ case GL_CONTEXT_ROBUST_ACCESS_EXT: *params = mRobustAccess ? GL_TRUE : GL_FALSE; break;
default:
return false;
}
@@ -1210,6 +1284,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
case GL_RENDERBUFFER_BINDING: *params = mState.renderbuffer.id(); break;
case GL_CURRENT_PROGRAM: *params = mState.currentProgram; break;
case GL_PACK_ALIGNMENT: *params = mState.packAlignment; break;
+ case GL_PACK_REVERSE_ROW_ORDER_ANGLE: *params = mState.packReverseRowOrder; break;
case GL_UNPACK_ALIGNMENT: *params = mState.unpackAlignment; break;
case GL_GENERATE_MIPMAP_HINT: *params = mState.generateMipmapHint; break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: *params = mState.fragmentShaderDerivativeHint; break;
@@ -1240,18 +1315,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
case GL_MAX_TEXTURE_SIZE: *params = getMaximumTextureDimension(); break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE: *params = getMaximumCubeTextureDimension(); break;
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
- {
- if (supportsCompressedTextures())
- {
- // at current, only GL_COMPRESSED_RGB_S3TC_DXT1_EXT and
- // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT are supported
- *params = 2;
- }
- else
- {
- *params = 0;
- }
- }
+ params[0] = mNumCompressedTextureFormats;
break;
case GL_MAX_SAMPLES_ANGLE:
{
@@ -1307,10 +1371,18 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
break;
case GL_COMPRESSED_TEXTURE_FORMATS:
{
- if (supportsCompressedTextures())
+ if (supportsDXT1Textures())
{
- params[0] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
- params[1] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ *params++ = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ *params++ = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ }
+ if (supportsDXT3Textures())
+ {
+ *params++ = GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE;
+ }
+ if (supportsDXT5Textures())
+ {
+ *params++ = GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE;
}
}
break;
@@ -1334,7 +1406,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
case GL_ALPHA_BITS:
{
gl::Framebuffer *framebuffer = getDrawFramebuffer();
- gl::Colorbuffer *colorbuffer = framebuffer->getColorbuffer();
+ gl::Renderbuffer *colorbuffer = framebuffer->getColorbuffer();
if (colorbuffer)
{
@@ -1355,7 +1427,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
case GL_DEPTH_BITS:
{
gl::Framebuffer *framebuffer = getDrawFramebuffer();
- gl::DepthStencilbuffer *depthbuffer = framebuffer->getDepthbuffer();
+ gl::Renderbuffer *depthbuffer = framebuffer->getDepthbuffer();
if (depthbuffer)
{
@@ -1370,7 +1442,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
case GL_STENCIL_BITS:
{
gl::Framebuffer *framebuffer = getDrawFramebuffer();
- gl::DepthStencilbuffer *stencilbuffer = framebuffer->getStencilbuffer();
+ gl::Renderbuffer *stencilbuffer = framebuffer->getStencilbuffer();
if (stencilbuffer)
{
@@ -1404,6 +1476,9 @@ bool Context::getIntegerv(GLenum pname, GLint *params)
*params = mState.samplerTexture[TEXTURE_CUBE][mState.activeSampler].id();
}
break;
+ case GL_RESET_NOTIFICATION_STRATEGY_EXT:
+ *params = mResetStrategy;
+ break;
default:
return false;
}
@@ -1422,7 +1497,12 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
// application.
switch (pname)
{
- case GL_COMPRESSED_TEXTURE_FORMATS: /* no compressed texture formats are supported */
+ case GL_COMPRESSED_TEXTURE_FORMATS:
+ {
+ *type = GL_INT;
+ *numParams = mNumCompressedTextureFormats;
+ }
+ break;
case GL_SHADER_BINARY_FORMATS:
{
*type = GL_INT;
@@ -1444,6 +1524,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_RENDERBUFFER_BINDING:
case GL_CURRENT_PROGRAM:
case GL_PACK_ALIGNMENT:
+ case GL_PACK_REVERSE_ROW_ORDER_ANGLE:
case GL_UNPACK_ALIGNMENT:
case GL_GENERATE_MIPMAP_HINT:
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES:
@@ -1488,6 +1569,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
case GL_TEXTURE_BINDING_2D:
case GL_TEXTURE_BINDING_CUBE_MAP:
+ case GL_RESET_NOTIFICATION_STRATEGY_EXT:
{
*type = GL_INT;
*numParams = 1;
@@ -1531,6 +1613,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_DEPTH_TEST:
case GL_BLEND:
case GL_DITHER:
+ case GL_CONTEXT_ROBUST_ACCESS_EXT:
{
*type = GL_BOOL;
*numParams = 1;
@@ -1578,8 +1661,6 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
// scissor rectangle to the Direct3D 9 device
bool Context::applyRenderTarget(bool ignoreViewport)
{
- IDirect3DDevice9 *device = getDevice();
-
Framebuffer *framebufferObject = getDrawFramebuffer();
if (!framebufferObject || framebufferObject->completeness() != GL_FRAMEBUFFER_COMPLETE)
@@ -1587,23 +1668,23 @@ bool Context::applyRenderTarget(bool ignoreViewport)
return error(GL_INVALID_FRAMEBUFFER_OPERATION, false);
}
- IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget();
-
- if (!renderTarget)
- {
- return false; // Context must be lost
- }
-
- IDirect3DSurface9 *depthStencil = NULL;
-
+ bool renderTargetChanged = false;
unsigned int renderTargetSerial = framebufferObject->getRenderTargetSerial();
if (renderTargetSerial != mAppliedRenderTargetSerial)
{
- device->SetRenderTarget(0, renderTarget);
+ IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget();
+ if (!renderTarget)
+ {
+ return false; // Context must be lost
+ }
+ mDevice->SetRenderTarget(0, renderTarget);
mAppliedRenderTargetSerial = renderTargetSerial;
mScissorStateDirty = true; // Scissor area must be clamped to render target's size-- this is different for different render targets.
+ renderTargetChanged = true;
+ renderTarget->Release();
}
+ IDirect3DSurface9 *depthStencil = NULL;
unsigned int depthbufferSerial = 0;
unsigned int stencilbufferSerial = 0;
if (framebufferObject->getDepthbufferType() != GL_NONE)
@@ -1633,15 +1714,25 @@ bool Context::applyRenderTarget(bool ignoreViewport)
stencilbufferSerial != mAppliedStencilbufferSerial ||
!mDepthStencilInitialized)
{
- device->SetDepthStencilSurface(depthStencil);
+ mDevice->SetDepthStencilSurface(depthStencil);
mAppliedDepthbufferSerial = depthbufferSerial;
mAppliedStencilbufferSerial = stencilbufferSerial;
mDepthStencilInitialized = true;
}
+ if (!mRenderTargetDescInitialized || renderTargetChanged)
+ {
+ IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget();
+ if (!renderTarget)
+ {
+ return false; // Context must be lost
+ }
+ renderTarget->GetDesc(&mRenderTargetDesc);
+ mRenderTargetDescInitialized = true;
+ renderTarget->Release();
+ }
+
D3DVIEWPORT9 viewport;
- D3DSURFACE_DESC desc;
- renderTarget->GetDesc(&desc);
float zNear = clamp01(mState.zNear);
float zFar = clamp01(mState.zFar);
@@ -1650,18 +1741,18 @@ bool Context::applyRenderTarget(bool ignoreViewport)
{
viewport.X = 0;
viewport.Y = 0;
- viewport.Width = desc.Width;
- viewport.Height = desc.Height;
+ viewport.Width = mRenderTargetDesc.Width;
+ viewport.Height = mRenderTargetDesc.Height;
viewport.MinZ = 0.0f;
viewport.MaxZ = 1.0f;
}
else
{
- RECT rect = transformPixelRect(mState.viewportX, mState.viewportY, mState.viewportWidth, mState.viewportHeight, desc.Height);
- viewport.X = clamp(rect.left, 0L, static_cast<LONG>(desc.Width));
- viewport.Y = clamp(rect.top, 0L, static_cast<LONG>(desc.Height));
- viewport.Width = clamp(rect.right - rect.left, 0L, static_cast<LONG>(desc.Width) - static_cast<LONG>(viewport.X));
- viewport.Height = clamp(rect.bottom - rect.top, 0L, static_cast<LONG>(desc.Height) - static_cast<LONG>(viewport.Y));
+ RECT rect = transformPixelRect(mState.viewportX, mState.viewportY, mState.viewportWidth, mState.viewportHeight, mRenderTargetDesc.Height);
+ viewport.X = clamp(rect.left, 0L, static_cast<LONG>(mRenderTargetDesc.Width));
+ viewport.Y = clamp(rect.top, 0L, static_cast<LONG>(mRenderTargetDesc.Height));
+ viewport.Width = clamp(rect.right - rect.left, 0L, static_cast<LONG>(mRenderTargetDesc.Width) - static_cast<LONG>(viewport.X));
+ viewport.Height = clamp(rect.bottom - rect.top, 0L, static_cast<LONG>(mRenderTargetDesc.Height) - static_cast<LONG>(viewport.Y));
viewport.MinZ = zNear;
viewport.MaxZ = zFar;
}
@@ -1671,29 +1762,35 @@ bool Context::applyRenderTarget(bool ignoreViewport)
return false; // Nothing to render
}
- device->SetViewport(&viewport);
+ if (renderTargetChanged || !mViewportInitialized || memcmp(&viewport, &mSetViewport, sizeof mSetViewport) != 0)
+ {
+ mDevice->SetViewport(&viewport);
+ mSetViewport = viewport;
+ mViewportInitialized = true;
+ mDxUniformsDirty = true;
+ }
if (mScissorStateDirty)
{
if (mState.scissorTest)
{
- RECT rect = transformPixelRect(mState.scissorX, mState.scissorY, mState.scissorWidth, mState.scissorHeight, desc.Height);
- rect.left = clamp(rect.left, 0L, static_cast<LONG>(desc.Width));
- rect.top = clamp(rect.top, 0L, static_cast<LONG>(desc.Height));
- rect.right = clamp(rect.right, 0L, static_cast<LONG>(desc.Width));
- rect.bottom = clamp(rect.bottom, 0L, static_cast<LONG>(desc.Height));
- device->SetScissorRect(&rect);
- device->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
+ RECT rect = transformPixelRect(mState.scissorX, mState.scissorY, mState.scissorWidth, mState.scissorHeight, mRenderTargetDesc.Height);
+ rect.left = clamp(rect.left, 0L, static_cast<LONG>(mRenderTargetDesc.Width));
+ rect.top = clamp(rect.top, 0L, static_cast<LONG>(mRenderTargetDesc.Height));
+ rect.right = clamp(rect.right, 0L, static_cast<LONG>(mRenderTargetDesc.Width));
+ rect.bottom = clamp(rect.bottom, 0L, static_cast<LONG>(mRenderTargetDesc.Height));
+ mDevice->SetScissorRect(&rect);
+ mDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
}
else
{
- device->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
}
mScissorStateDirty = false;
}
- if (mState.currentProgram)
+ if (mState.currentProgram && mDxUniformsDirty)
{
Program *programObject = getCurrentProgram();
@@ -1701,11 +1798,13 @@ bool Context::applyRenderTarget(bool ignoreViewport)
GLfloat xy[2] = {1.0f / viewport.Width, -1.0f / viewport.Height};
programObject->setUniform2fv(halfPixelSize, 1, xy);
- GLint viewport = programObject->getDxViewportLocation();
- GLfloat whxy[4] = {mState.viewportWidth / 2.0f, mState.viewportHeight / 2.0f,
+ // These values are used for computing gl_FragCoord in Program::linkVaryings(). The approach depends on Shader Model 3.0 support.
+ GLint coord = programObject->getDxCoordLocation();
+ float h = mSupportsShaderModel3 ? mRenderTargetDesc.Height : mState.viewportHeight / 2.0f;
+ GLfloat whxy[4] = {mState.viewportWidth / 2.0f, h,
(float)mState.viewportX + mState.viewportWidth / 2.0f,
(float)mState.viewportY + mState.viewportHeight / 2.0f};
- programObject->setUniform4fv(viewport, 1, whxy);
+ programObject->setUniform4fv(coord, 1, whxy);
GLint depth = programObject->getDxDepthLocation();
GLfloat dz[2] = {(zFar - zNear) / 2.0f, (zNear + zFar) / 2.0f};
@@ -1714,6 +1813,7 @@ bool Context::applyRenderTarget(bool ignoreViewport)
GLint depthRange = programObject->getDxDepthRangeLocation();
GLfloat nearFarDiff[3] = {zNear, zFar, zFar - zNear};
programObject->setUniform3fv(depthRange, 1, nearFarDiff);
+ mDxUniformsDirty = false;
}
return true;
@@ -1722,7 +1822,6 @@ bool Context::applyRenderTarget(bool ignoreViewport)
// Applies the fixed-function state (culling, depth test, alpha blending, stenciling, etc) to the Direct3D 9 device
void Context::applyState(GLenum drawMode)
{
- IDirect3DDevice9 *device = getDevice();
Program *programObject = getCurrentProgram();
Framebuffer *framebufferObject = getDrawFramebuffer();
@@ -1737,8 +1836,7 @@ void Context::applyState(GLenum drawMode)
GLint alwaysFront = !isTriangleMode(drawMode);
programObject->setUniform1iv(pointsOrLines, 1, &alwaysFront);
- egl::Display *display = getDisplay();
- D3DADAPTER_IDENTIFIER9 *identifier = display->getAdapterIdentifier();
+ D3DADAPTER_IDENTIFIER9 *identifier = mDisplay->getAdapterIdentifier();
bool zeroColorMaskAllowed = identifier->VendorId != 0x1002;
// Apparently some ATI cards have a bug where a draw with a zero color
// write mask can cause later draws to have incorrect results. Instead,
@@ -1750,11 +1848,11 @@ void Context::applyState(GLenum drawMode)
{
if (mState.cullFace)
{
- device->SetRenderState(D3DRS_CULLMODE, es2dx::ConvertCullMode(mState.cullMode, adjustedFrontFace));
+ mDevice->SetRenderState(D3DRS_CULLMODE, es2dx::ConvertCullMode(mState.cullMode, adjustedFrontFace));
}
else
{
- device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
+ mDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
}
mCullStateDirty = false;
@@ -1764,12 +1862,12 @@ void Context::applyState(GLenum drawMode)
{
if (mState.depthTest)
{
- device->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
- device->SetRenderState(D3DRS_ZFUNC, es2dx::ConvertComparison(mState.depthFunc));
+ mDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE);
+ mDevice->SetRenderState(D3DRS_ZFUNC, es2dx::ConvertComparison(mState.depthFunc));
}
else
{
- device->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
+ mDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE);
}
mDepthStateDirty = false;
@@ -1785,43 +1883,43 @@ void Context::applyState(GLenum drawMode)
{
if (mState.blend)
{
- device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
if (mState.sourceBlendRGB != GL_CONSTANT_ALPHA && mState.sourceBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA &&
mState.destBlendRGB != GL_CONSTANT_ALPHA && mState.destBlendRGB != GL_ONE_MINUS_CONSTANT_ALPHA)
{
- device->SetRenderState(D3DRS_BLENDFACTOR, es2dx::ConvertColor(mState.blendColor));
+ mDevice->SetRenderState(D3DRS_BLENDFACTOR, es2dx::ConvertColor(mState.blendColor));
}
else
{
- device->SetRenderState(D3DRS_BLENDFACTOR, D3DCOLOR_RGBA(unorm<8>(mState.blendColor.alpha),
+ mDevice->SetRenderState(D3DRS_BLENDFACTOR, D3DCOLOR_RGBA(unorm<8>(mState.blendColor.alpha),
unorm<8>(mState.blendColor.alpha),
unorm<8>(mState.blendColor.alpha),
unorm<8>(mState.blendColor.alpha)));
}
- device->SetRenderState(D3DRS_SRCBLEND, es2dx::ConvertBlendFunc(mState.sourceBlendRGB));
- device->SetRenderState(D3DRS_DESTBLEND, es2dx::ConvertBlendFunc(mState.destBlendRGB));
- device->SetRenderState(D3DRS_BLENDOP, es2dx::ConvertBlendOp(mState.blendEquationRGB));
+ mDevice->SetRenderState(D3DRS_SRCBLEND, es2dx::ConvertBlendFunc(mState.sourceBlendRGB));
+ mDevice->SetRenderState(D3DRS_DESTBLEND, es2dx::ConvertBlendFunc(mState.destBlendRGB));
+ mDevice->SetRenderState(D3DRS_BLENDOP, es2dx::ConvertBlendOp(mState.blendEquationRGB));
if (mState.sourceBlendRGB != mState.sourceBlendAlpha ||
mState.destBlendRGB != mState.destBlendAlpha ||
mState.blendEquationRGB != mState.blendEquationAlpha)
{
- device->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
- device->SetRenderState(D3DRS_SRCBLENDALPHA, es2dx::ConvertBlendFunc(mState.sourceBlendAlpha));
- device->SetRenderState(D3DRS_DESTBLENDALPHA, es2dx::ConvertBlendFunc(mState.destBlendAlpha));
- device->SetRenderState(D3DRS_BLENDOPALPHA, es2dx::ConvertBlendOp(mState.blendEquationAlpha));
+ mDevice->SetRenderState(D3DRS_SRCBLENDALPHA, es2dx::ConvertBlendFunc(mState.sourceBlendAlpha));
+ mDevice->SetRenderState(D3DRS_DESTBLENDALPHA, es2dx::ConvertBlendFunc(mState.destBlendAlpha));
+ mDevice->SetRenderState(D3DRS_BLENDOPALPHA, es2dx::ConvertBlendOp(mState.blendEquationAlpha));
}
else
{
- device->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, FALSE);
}
}
else
{
- device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
}
mBlendStateDirty = false;
@@ -1831,8 +1929,8 @@ void Context::applyState(GLenum drawMode)
{
if (mState.stencilTest && framebufferObject->hasStencil())
{
- device->SetRenderState(D3DRS_STENCILENABLE, TRUE);
- device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, TRUE);
+ mDevice->SetRenderState(D3DRS_STENCILENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, TRUE);
// FIXME: Unsupported by D3D9
const D3DRENDERSTATETYPE D3DRS_CCW_STENCILREF = D3DRS_STENCILREF;
@@ -1847,40 +1945,40 @@ void Context::applyState(GLenum drawMode)
}
// get the maximum size of the stencil ref
- gl::DepthStencilbuffer *stencilbuffer = framebufferObject->getStencilbuffer();
+ gl::Renderbuffer *stencilbuffer = framebufferObject->getStencilbuffer();
GLuint maxStencil = (1 << stencilbuffer->getStencilSize()) - 1;
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilWritemask);
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilWritemask);
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC,
es2dx::ConvertComparison(mState.stencilFunc));
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilRef < (GLint)maxStencil) ? mState.stencilRef : maxStencil);
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilMask);
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilRef < (GLint)maxStencil) ? mState.stencilRef : maxStencil);
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilMask);
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL,
es2dx::ConvertStencilOp(mState.stencilFail));
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL,
es2dx::ConvertStencilOp(mState.stencilPassDepthFail));
- device->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CCW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS,
es2dx::ConvertStencilOp(mState.stencilPassDepthPass));
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilBackWritemask);
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilBackWritemask);
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILFUNC : D3DRS_CCW_STENCILFUNC,
es2dx::ConvertComparison(mState.stencilBackFunc));
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilBackRef < (GLint)maxStencil) ? mState.stencilBackRef : maxStencil);
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilBackMask);
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILREF : D3DRS_CCW_STENCILREF, (mState.stencilBackRef < (GLint)maxStencil) ? mState.stencilBackRef : maxStencil);
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILMASK : D3DRS_CCW_STENCILMASK, mState.stencilBackMask);
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILFAIL : D3DRS_CCW_STENCILFAIL,
es2dx::ConvertStencilOp(mState.stencilBackFail));
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILZFAIL : D3DRS_CCW_STENCILZFAIL,
es2dx::ConvertStencilOp(mState.stencilBackPassDepthFail));
- device->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS,
+ mDevice->SetRenderState(adjustedFrontFace == GL_CW ? D3DRS_STENCILPASS : D3DRS_CCW_STENCILPASS,
es2dx::ConvertStencilOp(mState.stencilBackPassDepthPass));
}
else
{
- device->SetRenderState(D3DRS_STENCILENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
}
mStencilStateDirty = false;
@@ -1894,18 +1992,18 @@ void Context::applyState(GLenum drawMode)
if (colorMask == 0 && !zeroColorMaskAllowed)
{
// Enable green channel, but set blending so nothing will be drawn.
- device->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_GREEN);
- device->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_GREEN);
+ mDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
- device->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
- device->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
- device->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
+ mDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);
+ mDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
+ mDevice->SetRenderState(D3DRS_BLENDOP, D3DBLENDOP_ADD);
}
else
{
- device->SetRenderState(D3DRS_COLORWRITEENABLE, colorMask);
+ mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, colorMask);
}
- device->SetRenderState(D3DRS_ZWRITEENABLE, mState.depthMask ? TRUE : FALSE);
+ mDevice->SetRenderState(D3DRS_ZWRITEENABLE, mState.depthMask ? TRUE : FALSE);
mMaskStateDirty = false;
}
@@ -1914,18 +2012,18 @@ void Context::applyState(GLenum drawMode)
{
if (mState.polygonOffsetFill)
{
- gl::DepthStencilbuffer *depthbuffer = framebufferObject->getDepthbuffer();
+ gl::Renderbuffer *depthbuffer = framebufferObject->getDepthbuffer();
if (depthbuffer)
{
- device->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, *((DWORD*)&mState.polygonOffsetFactor));
+ mDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, *((DWORD*)&mState.polygonOffsetFactor));
float depthBias = ldexp(mState.polygonOffsetUnits, -(int)(depthbuffer->getDepthSize()));
- device->SetRenderState(D3DRS_DEPTHBIAS, *((DWORD*)&depthBias));
+ mDevice->SetRenderState(D3DRS_DEPTHBIAS, *((DWORD*)&depthBias));
}
}
else
{
- device->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, 0);
- device->SetRenderState(D3DRS_DEPTHBIAS, 0);
+ mDevice->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, 0);
+ mDevice->SetRenderState(D3DRS_DEPTHBIAS, 0);
}
mPolygonOffsetStateDirty = false;
@@ -1938,7 +2036,7 @@ void Context::applyState(GLenum drawMode)
FIXME("Sample alpha to coverage is unimplemented.");
}
- device->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
+ mDevice->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE);
if (mState.sampleCoverage)
{
unsigned int mask = 0;
@@ -1963,11 +2061,11 @@ void Context::applyState(GLenum drawMode)
mask = ~mask;
}
- device->SetRenderState(D3DRS_MULTISAMPLEMASK, mask);
+ mDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, mask);
}
else
{
- device->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
+ mDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
}
mSampleStateDirty = false;
@@ -1975,7 +2073,7 @@ void Context::applyState(GLenum drawMode)
if (mDitherStateDirty)
{
- device->SetRenderState(D3DRS_DITHERENABLE, mState.dither ? TRUE : FALSE);
+ mDevice->SetRenderState(D3DRS_DITHERENABLE, mState.dither ? TRUE : FALSE);
mDitherStateDirty = false;
}
@@ -1991,18 +2089,21 @@ GLenum Context::applyVertexBuffer(GLint first, GLsizei count)
return err;
}
- return mVertexDeclarationCache.applyDeclaration(attributes, getCurrentProgram());
+ return mVertexDeclarationCache.applyDeclaration(mDevice, attributes, getCurrentProgram());
}
// Applies the indices and element array bindings to the Direct3D 9 device
GLenum Context::applyIndexBuffer(const void *indices, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo)
{
- IDirect3DDevice9 *device = getDevice();
GLenum err = mIndexDataManager->prepareIndexData(type, count, mState.elementArrayBuffer.get(), indices, indexInfo);
if (err == GL_NO_ERROR)
{
- device->SetIndices(indexInfo->indexBuffer);
+ if (indexInfo->serial != mAppliedIBSerial)
+ {
+ mDevice->SetIndices(indexInfo->indexBuffer);
+ mAppliedIBSerial = indexInfo->serial;
+ }
}
return err;
@@ -2011,16 +2112,14 @@ GLenum Context::applyIndexBuffer(const void *indices, GLsizei count, GLenum mode
// Applies the shaders and shader constants to the Direct3D 9 device
void Context::applyShaders()
{
- IDirect3DDevice9 *device = getDevice();
Program *programObject = getCurrentProgram();
- IDirect3DVertexShader9 *vertexShader = programObject->getVertexShader();
- IDirect3DPixelShader9 *pixelShader = programObject->getPixelShader();
-
- device->SetVertexShader(vertexShader);
- device->SetPixelShader(pixelShader);
-
if (programObject->getSerial() != mAppliedProgramSerial)
{
+ IDirect3DVertexShader9 *vertexShader = programObject->getVertexShader();
+ IDirect3DPixelShader9 *pixelShader = programObject->getPixelShader();
+
+ mDevice->SetPixelShader(pixelShader);
+ mDevice->SetVertexShader(vertexShader);
programObject->dirtyAllUniforms();
mAppliedProgramSerial = programObject->getSerial();
}
@@ -2044,16 +2143,17 @@ void Context::applyTextures()
// and sets the texture and its addressing/filtering state (or NULL when inactive).
void Context::applyTextures(SamplerType type)
{
- IDirect3DDevice9 *device = getDevice();
Program *programObject = getCurrentProgram();
int samplerCount = (type == SAMPLER_PIXEL) ? MAX_TEXTURE_IMAGE_UNITS : MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF; // Range of Direct3D 9 samplers of given sampler type
+ unsigned int *appliedTextureSerial = (type == SAMPLER_PIXEL) ? mAppliedTextureSerialPS : mAppliedTextureSerialVS;
+ int d3dSamplerOffset = (type == SAMPLER_PIXEL) ? 0 : D3DVERTEXTEXTURESAMPLER0;
+ int samplerRange = programObject->getUsedSamplerRange(type);
- for (int samplerIndex = 0; samplerIndex < samplerCount; samplerIndex++)
+ for (int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
{
int textureUnit = programObject->getSamplerMapping(type, samplerIndex); // OpenGL texture image unit index
- int d3dSampler = (type == SAMPLER_PIXEL) ? samplerIndex : D3DVERTEXTEXTURESAMPLER0 + samplerIndex;
- unsigned int *appliedTextureSerial = (type == SAMPLER_PIXEL) ? mAppliedTextureSerialPS : mAppliedTextureSerialVS;
+ int d3dSampler = samplerIndex + d3dSamplerOffset;
if (textureUnit != -1)
{
@@ -2061,40 +2161,40 @@ void Context::applyTextures(SamplerType type)
Texture *texture = getSamplerTexture(textureUnit, textureType);
- if (appliedTextureSerial[samplerIndex] != texture->getSerial() || texture->isDirtyParameter() || texture->isDirtyImage())
+ if (appliedTextureSerial[samplerIndex] != texture->getTextureSerial() || texture->hasDirtyParameters() || texture->hasDirtyImages())
{
IDirect3DBaseTexture9 *d3dTexture = texture->getTexture();
if (d3dTexture)
{
- if (appliedTextureSerial[samplerIndex] != texture->getSerial() || texture->isDirtyParameter())
+ if (appliedTextureSerial[samplerIndex] != texture->getTextureSerial() || texture->hasDirtyParameters())
{
GLenum wrapS = texture->getWrapS();
GLenum wrapT = texture->getWrapT();
GLenum minFilter = texture->getMinFilter();
GLenum magFilter = texture->getMagFilter();
- device->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSU, es2dx::ConvertTextureWrap(wrapS));
- device->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSV, es2dx::ConvertTextureWrap(wrapT));
+ mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSU, es2dx::ConvertTextureWrap(wrapS));
+ mDevice->SetSamplerState(d3dSampler, D3DSAMP_ADDRESSV, es2dx::ConvertTextureWrap(wrapT));
- device->SetSamplerState(d3dSampler, D3DSAMP_MAGFILTER, es2dx::ConvertMagFilter(magFilter));
+ mDevice->SetSamplerState(d3dSampler, D3DSAMP_MAGFILTER, es2dx::ConvertMagFilter(magFilter));
D3DTEXTUREFILTERTYPE d3dMinFilter, d3dMipFilter;
es2dx::ConvertMinFilter(minFilter, &d3dMinFilter, &d3dMipFilter);
- device->SetSamplerState(d3dSampler, D3DSAMP_MINFILTER, d3dMinFilter);
- device->SetSamplerState(d3dSampler, D3DSAMP_MIPFILTER, d3dMipFilter);
+ mDevice->SetSamplerState(d3dSampler, D3DSAMP_MINFILTER, d3dMinFilter);
+ mDevice->SetSamplerState(d3dSampler, D3DSAMP_MIPFILTER, d3dMipFilter);
}
- if (appliedTextureSerial[samplerIndex] != texture->getSerial() || texture->isDirtyImage())
+ if (appliedTextureSerial[samplerIndex] != texture->getTextureSerial() || texture->hasDirtyImages())
{
- device->SetTexture(d3dSampler, d3dTexture);
+ mDevice->SetTexture(d3dSampler, d3dTexture);
}
}
else
{
- device->SetTexture(d3dSampler, getIncompleteTexture(textureType)->getTexture());
+ mDevice->SetTexture(d3dSampler, getIncompleteTexture(textureType)->getTexture());
}
- appliedTextureSerial[samplerIndex] = texture->getSerial();
+ appliedTextureSerial[samplerIndex] = texture->getTextureSerial();
texture->resetDirty();
}
}
@@ -2102,14 +2202,24 @@ void Context::applyTextures(SamplerType type)
{
if (appliedTextureSerial[samplerIndex] != 0)
{
- device->SetTexture(d3dSampler, NULL);
+ mDevice->SetTexture(d3dSampler, NULL);
appliedTextureSerial[samplerIndex] = 0;
}
}
}
+
+ for (int samplerIndex = samplerRange; samplerIndex < samplerCount; samplerIndex++)
+ {
+ if (appliedTextureSerial[samplerIndex] != 0)
+ {
+ mDevice->SetTexture(samplerIndex + d3dSamplerOffset, NULL);
+ appliedTextureSerial[samplerIndex] = 0;
+ }
+ }
}
-void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
+void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLsizei *bufSize, void* pixels)
{
Framebuffer *framebuffer = getReadFramebuffer();
@@ -2123,48 +2233,85 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
return error(GL_INVALID_OPERATION);
}
- IDirect3DSurface9 *renderTarget = framebuffer->getRenderTarget();
+ GLsizei outputPitch = ComputePitch(width, format, type, mState.packAlignment);
+ // sized query sanity check
+ if (bufSize)
+ {
+ int requiredSize = outputPitch * height;
+ if (requiredSize > *bufSize)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ }
+ IDirect3DSurface9 *renderTarget = framebuffer->getRenderTarget();
if (!renderTarget)
{
return; // Context must be lost, return silently
}
- IDirect3DDevice9 *device = getDevice();
-
D3DSURFACE_DESC desc;
renderTarget->GetDesc(&desc);
- IDirect3DSurface9 *systemSurface;
- HRESULT result = device->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &systemSurface, NULL);
-
- if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
+ if (desc.MultiSampleType != D3DMULTISAMPLE_NONE)
{
+ UNIMPLEMENTED(); // FIXME: Requires resolve using StretchRect into non-multisampled render target
+ renderTarget->Release();
return error(GL_OUT_OF_MEMORY);
}
- ASSERT(SUCCEEDED(result));
+ HRESULT result;
+ IDirect3DSurface9 *systemSurface = NULL;
+ bool directToPixels = getPackReverseRowOrder() && getPackAlignment() <= 4 && mDisplay->isD3d9ExDevice() &&
+ x == 0 && y == 0 && width == desc.Width && height == desc.Height &&
+ desc.Format == D3DFMT_A8R8G8B8 && format == GL_BGRA_EXT && type == GL_UNSIGNED_BYTE;
+ if (directToPixels)
+ {
+ // Use the pixels ptr as a shared handle to write directly into client's memory
+ result = mDevice->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format,
+ D3DPOOL_SYSTEMMEM, &systemSurface, &pixels);
+ if (FAILED(result))
+ {
+ // Try again without the shared handle
+ directToPixels = false;
+ }
+ }
- if (desc.MultiSampleType != D3DMULTISAMPLE_NONE)
+ if (!directToPixels)
{
- UNIMPLEMENTED(); // FIXME: Requires resolve using StretchRect into non-multisampled render target
+ result = mDevice->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format,
+ D3DPOOL_SYSTEMMEM, &systemSurface, NULL);
+ if (FAILED(result))
+ {
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ return error(GL_OUT_OF_MEMORY);
+ }
}
- result = device->GetRenderTargetData(renderTarget, systemSurface);
+ result = mDevice->GetRenderTargetData(renderTarget, systemSurface);
+ renderTarget->Release();
+ renderTarget = NULL;
if (FAILED(result))
{
systemSurface->Release();
- switch (result)
- {
- case D3DERR_DRIVERINTERNALERROR:
- case D3DERR_DEVICELOST:
+ // It turns out that D3D will sometimes produce more error
+ // codes than those documented.
+ if (checkDeviceLost(result))
return error(GL_OUT_OF_MEMORY);
- default:
+ else
+ {
UNREACHABLE();
- return; // No sensible error to generate
+ return;
}
+
+ }
+
+ if (directToPixels)
+ {
+ systemSurface->Release();
+ return;
}
D3DLOCKED_RECT lock;
@@ -2184,11 +2331,21 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum
return; // No sensible error to generate
}
- unsigned char *source = ((unsigned char*)lock.pBits) + lock.Pitch * (rect.bottom - rect.top - 1);
unsigned char *dest = (unsigned char*)pixels;
unsigned short *dest16 = (unsigned short*)pixels;
- int inputPitch = -lock.Pitch;
- GLsizei outputPitch = ComputePitch(width, format, type, mState.packAlignment);
+
+ unsigned char *source;
+ int inputPitch;
+ if (getPackReverseRowOrder())
+ {
+ source = (unsigned char*)lock.pBits;
+ inputPitch = lock.Pitch;
+ }
+ else
+ {
+ source = ((unsigned char*)lock.pBits) + lock.Pitch * (rect.bottom - rect.top - 1);
+ inputPitch = -lock.Pitch;
+ }
for (int j = 0; j < rect.bottom - rect.top; j++)
{
@@ -2376,8 +2533,6 @@ void Context::clear(GLbitfield mask)
return error(GL_INVALID_FRAMEBUFFER_OPERATION);
}
- egl::Display *display = getDisplay();
- IDirect3DDevice9 *device = getDevice();
DWORD flags = 0;
if (mask & GL_COLOR_BUFFER_BIT)
@@ -2443,17 +2598,7 @@ void Context::clear(GLbitfield mask)
float depth = clamp01(mState.depthClearValue);
int stencil = mState.stencilClearValue & 0x000000FF;
- IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget();
-
- if (!renderTarget)
- {
- return; // Context must be lost, return silently
- }
-
- D3DSURFACE_DESC desc;
- renderTarget->GetDesc(&desc);
-
- bool alphaUnmasked = (dx2es::GetAlphaSize(desc.Format) == 0) || mState.colorMaskAlpha;
+ bool alphaUnmasked = (dx2es::GetAlphaSize(mRenderTargetDesc.Format) == 0) || mState.colorMaskAlpha;
const bool needMaskedStencilClear = (flags & D3DCLEAR_STENCIL) &&
(mState.stencilWritemask & stencilUnmasked) != stencilUnmasked;
@@ -2469,31 +2614,32 @@ void Context::clear(GLbitfield mask)
HRESULT hr;
if (mMaskedClearSavedState == NULL)
{
- hr = device->BeginStateBlock();
+ hr = mDevice->BeginStateBlock();
ASSERT(SUCCEEDED(hr) || hr == D3DERR_OUTOFVIDEOMEMORY || hr == E_OUTOFMEMORY);
- device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
- device->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
- device->SetRenderState(D3DRS_ZENABLE, FALSE);
- device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
- device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- device->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
- device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
- device->SetRenderState(D3DRS_CLIPPLANEENABLE, 0);
- device->SetRenderState(D3DRS_COLORWRITEENABLE, 0);
- device->SetRenderState(D3DRS_STENCILENABLE, FALSE);
- device->SetPixelShader(NULL);
- device->SetVertexShader(NULL);
- device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
- device->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
- device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
- device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TFACTOR);
- device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
- device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
- device->SetRenderState(D3DRS_TEXTUREFACTOR, color);
- device->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
-
- hr = device->EndStateBlock(&mMaskedClearSavedState);
+ mDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
+ mDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
+ mDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
+ mDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, 0);
+ mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0);
+ mDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
+ mDevice->SetPixelShader(NULL);
+ mDevice->SetVertexShader(NULL);
+ mDevice->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE);
+ mDevice->SetStreamSource(0, NULL, 0, 0);
+ mDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
+ mDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
+ mDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TFACTOR);
+ mDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
+ mDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
+ mDevice->SetRenderState(D3DRS_TEXTUREFACTOR, color);
+ mDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
+
+ hr = mDevice->EndStateBlock(&mMaskedClearSavedState);
ASSERT(SUCCEEDED(hr) || hr == D3DERR_OUTOFVIDEOMEMORY || hr == E_OUTOFMEMORY);
}
@@ -2505,60 +2651,60 @@ void Context::clear(GLbitfield mask)
ASSERT(SUCCEEDED(hr));
}
- device->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
- device->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
- device->SetRenderState(D3DRS_ZENABLE, FALSE);
- device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
- device->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- device->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
- device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
- device->SetRenderState(D3DRS_CLIPPLANEENABLE, 0);
+ mDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
+ mDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
+ mDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
+ mDevice->SetRenderState(D3DRS_ALPHATESTENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_CLIPPLANEENABLE, 0);
if (flags & D3DCLEAR_TARGET)
{
- device->SetRenderState(D3DRS_COLORWRITEENABLE, es2dx::ConvertColorMask(mState.colorMaskRed, mState.colorMaskGreen, mState.colorMaskBlue, mState.colorMaskAlpha));
+ mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, es2dx::ConvertColorMask(mState.colorMaskRed, mState.colorMaskGreen, mState.colorMaskBlue, mState.colorMaskAlpha));
}
else
{
- device->SetRenderState(D3DRS_COLORWRITEENABLE, 0);
+ mDevice->SetRenderState(D3DRS_COLORWRITEENABLE, 0);
}
if (stencilUnmasked != 0x0 && (flags & D3DCLEAR_STENCIL))
{
- device->SetRenderState(D3DRS_STENCILENABLE, TRUE);
- device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, FALSE);
- device->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS);
- device->SetRenderState(D3DRS_STENCILREF, stencil);
- device->SetRenderState(D3DRS_STENCILWRITEMASK, mState.stencilWritemask);
- device->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE);
- device->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE);
- device->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE);
+ mDevice->SetRenderState(D3DRS_STENCILENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, FALSE);
+ mDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_ALWAYS);
+ mDevice->SetRenderState(D3DRS_STENCILREF, stencil);
+ mDevice->SetRenderState(D3DRS_STENCILWRITEMASK, mState.stencilWritemask);
+ mDevice->SetRenderState(D3DRS_STENCILFAIL, D3DSTENCILOP_REPLACE);
+ mDevice->SetRenderState(D3DRS_STENCILZFAIL, D3DSTENCILOP_REPLACE);
+ mDevice->SetRenderState(D3DRS_STENCILPASS, D3DSTENCILOP_REPLACE);
mStencilStateDirty = true;
}
else
{
- device->SetRenderState(D3DRS_STENCILENABLE, FALSE);
+ mDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE);
}
- device->SetPixelShader(NULL);
- device->SetVertexShader(NULL);
- device->SetFVF(D3DFVF_XYZRHW);
- device->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
- device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
- device->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TFACTOR);
- device->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
- device->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
- device->SetRenderState(D3DRS_TEXTUREFACTOR, color);
- device->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
+ mDevice->SetPixelShader(NULL);
+ mDevice->SetVertexShader(NULL);
+ mDevice->SetFVF(D3DFVF_XYZRHW);
+ mDevice->SetRenderState(D3DRS_SEPARATEALPHABLENDENABLE, TRUE);
+ mDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
+ mDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TFACTOR);
+ mDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1);
+ mDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
+ mDevice->SetRenderState(D3DRS_TEXTUREFACTOR, color);
+ mDevice->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF);
float quad[4][4]; // A quadrilateral covering the target, aligned to match the edges
quad[0][0] = -0.5f;
- quad[0][1] = desc.Height - 0.5f;
+ quad[0][1] = mRenderTargetDesc.Height - 0.5f;
quad[0][2] = 0.0f;
quad[0][3] = 1.0f;
- quad[1][0] = desc.Width - 0.5f;
- quad[1][1] = desc.Height - 0.5f;
+ quad[1][0] = mRenderTargetDesc.Width - 0.5f;
+ quad[1][1] = mRenderTargetDesc.Height - 0.5f;
quad[1][2] = 0.0f;
quad[1][3] = 1.0f;
@@ -2567,19 +2713,19 @@ void Context::clear(GLbitfield mask)
quad[2][2] = 0.0f;
quad[2][3] = 1.0f;
- quad[3][0] = desc.Width - 0.5f;
+ quad[3][0] = mRenderTargetDesc.Width - 0.5f;
quad[3][1] = -0.5f;
quad[3][2] = 0.0f;
quad[3][3] = 1.0f;
- display->startScene();
- device->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float[4]));
+ mDisplay->startScene();
+ mDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float[4]));
if (flags & D3DCLEAR_ZBUFFER)
{
- device->SetRenderState(D3DRS_ZENABLE, TRUE);
- device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
- device->Clear(0, NULL, D3DCLEAR_ZBUFFER, color, depth, stencil);
+ mDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
+ mDevice->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
+ mDevice->Clear(0, NULL, D3DCLEAR_ZBUFFER, color, depth, stencil);
}
if (mMaskedClearSavedState != NULL)
@@ -2589,7 +2735,7 @@ void Context::clear(GLbitfield mask)
}
else if (flags)
{
- device->Clear(0, NULL, flags, color, depth, stencil);
+ mDevice->Clear(0, NULL, flags, color, depth, stencil);
}
}
@@ -2600,8 +2746,6 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
return error(GL_INVALID_OPERATION);
}
- egl::Display *display = getDisplay();
- IDirect3DDevice9 *device = getDevice();
D3DPRIMITIVETYPE primitiveType;
int primitiveCount;
@@ -2636,13 +2780,13 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
if (!cullSkipsDraw(mode))
{
- display->startScene();
+ mDisplay->startScene();
- device->DrawPrimitive(primitiveType, 0, primitiveCount);
+ mDevice->DrawPrimitive(primitiveType, 0, primitiveCount);
if (mode == GL_LINE_LOOP) // Draw the last segment separately
{
- drawClosingLine(first, first + count - 1);
+ drawClosingLine(0, count - 1, 0);
}
}
}
@@ -2659,8 +2803,6 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *
return error(GL_INVALID_OPERATION);
}
- egl::Display *display = getDisplay();
- IDirect3DDevice9 *device = getDevice();
D3DPRIMITIVETYPE primitiveType;
int primitiveCount;
@@ -2703,25 +2845,25 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *
if (!cullSkipsDraw(mode))
{
- display->startScene();
+ mDisplay->startScene();
- device->DrawIndexedPrimitive(primitiveType, -(INT)indexInfo.minIndex, indexInfo.minIndex, vertexCount, indexInfo.startIndex, primitiveCount);
+ mDevice->DrawIndexedPrimitive(primitiveType, -(INT)indexInfo.minIndex, indexInfo.minIndex, vertexCount, indexInfo.startIndex, primitiveCount);
if (mode == GL_LINE_LOOP) // Draw the last segment separately
{
- drawClosingLine(count, type, indices);
+ drawClosingLine(count, type, indices, indexInfo.minIndex);
}
}
}
-void Context::finish()
+// Implements glFlush when block is false, glFinish when block is true
+void Context::sync(bool block)
{
egl::Display *display = getDisplay();
- IDirect3DDevice9 *device = getDevice();
- IDirect3DQuery9 *occlusionQuery = NULL;
+ IDirect3DQuery9 *eventQuery = NULL;
HRESULT result;
- result = device->CreateQuery(D3DQUERYTYPE_OCCLUSION, &occlusionQuery);
+ result = mDevice->CreateQuery(D3DQUERYTYPE_EVENT, &eventQuery);
if (FAILED(result))
{
ERR("CreateQuery failed hr=%x\n", result);
@@ -2733,105 +2875,44 @@ void Context::finish()
return;
}
- IDirect3DStateBlock9 *savedState = NULL;
- result = device->CreateStateBlock(D3DSBT_ALL, &savedState);
- if (FAILED(result))
- {
- ERR("CreateStateBlock failed hr=%x\n", result);
- occlusionQuery->Release();
-
- if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
- {
- return error(GL_OUT_OF_MEMORY);
- }
- ASSERT(false);
- return;
- }
-
- result = occlusionQuery->Issue(D3DISSUE_BEGIN);
- if (FAILED(result))
- {
- ERR("occlusionQuery->Issue(BEGIN) failed hr=%x\n", result);
- occlusionQuery->Release();
- savedState->Release();
- ASSERT(false);
- return;
- }
-
- // Render something outside the render target
- device->SetPixelShader(NULL);
- device->SetVertexShader(NULL);
- device->SetFVF(D3DFVF_XYZRHW);
- float data[4] = {-1.0f, -1.0f, -1.0f, 1.0f};
- display->startScene();
- device->DrawPrimitiveUP(D3DPT_POINTLIST, 1, data, sizeof(data));
-
- result = occlusionQuery->Issue(D3DISSUE_END);
+ result = eventQuery->Issue(D3DISSUE_END);
if (FAILED(result))
{
- ERR("occlusionQuery->Issue(END) failed hr=%x\n", result);
- occlusionQuery->Release();
- savedState->Apply();
- savedState->Release();
+ ERR("eventQuery->Issue(END) failed hr=%x\n", result);
ASSERT(false);
+ eventQuery->Release();
return;
}
- while ((result = occlusionQuery->GetData(NULL, 0, D3DGETDATA_FLUSH)) == S_FALSE)
+ do
{
- // Keep polling, but allow other threads to do something useful first
- Sleep(0);
- }
-
- occlusionQuery->Release();
- savedState->Apply();
- savedState->Release();
+ result = eventQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
- if (result == D3DERR_DEVICELOST)
- {
- error(GL_OUT_OF_MEMORY);
- }
-}
-
-void Context::flush()
-{
- IDirect3DDevice9 *device = getDevice();
- IDirect3DQuery9 *eventQuery = NULL;
- HRESULT result;
-
- result = device->CreateQuery(D3DQUERYTYPE_EVENT, &eventQuery);
- if (FAILED(result))
- {
- ERR("CreateQuery failed hr=%x\n", result);
- if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
+ if(block && result == S_FALSE)
{
- return error(GL_OUT_OF_MEMORY);
+ // Keep polling, but allow other threads to do something useful first
+ Sleep(0);
+ // explicitly check for device loss
+ // some drivers seem to return S_FALSE even if the device is lost
+ // instead of D3DERR_DEVICELOST like they should
+ if (display->testDeviceLost())
+ {
+ result = D3DERR_DEVICELOST;
+ }
}
- ASSERT(false);
- return;
}
+ while(block && result == S_FALSE);
- result = eventQuery->Issue(D3DISSUE_END);
- if (FAILED(result))
- {
- ERR("eventQuery->Issue(END) failed hr=%x\n", result);
- ASSERT(false);
- eventQuery->Release();
- return;
- }
-
- result = eventQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
eventQuery->Release();
- if (result == D3DERR_DEVICELOST)
+ if (checkDeviceLost(result))
{
error(GL_OUT_OF_MEMORY);
}
}
-void Context::drawClosingLine(unsigned int first, unsigned int last)
+void Context::drawClosingLine(unsigned int first, unsigned int last, int minIndex)
{
- IDirect3DDevice9 *device = getDevice();
IDirect3DIndexBuffer9 *indexBuffer = NULL;
bool succeeded = false;
UINT offset;
@@ -2842,7 +2923,7 @@ void Context::drawClosingLine(unsigned int first, unsigned int last)
if (!mClosingIB)
{
- mClosingIB = new StreamingIndexBuffer(device, CLOSING_INDEX_BUFFER_SIZE, D3DFMT_INDEX32);
+ mClosingIB = new StreamingIndexBuffer(mDevice, CLOSING_INDEX_BUFFER_SIZE, D3DFMT_INDEX32);
}
mClosingIB->reserveSpace(spaceNeeded, GL_UNSIGNED_INT);
@@ -2863,7 +2944,7 @@ void Context::drawClosingLine(unsigned int first, unsigned int last)
if (!mClosingIB)
{
- mClosingIB = new StreamingIndexBuffer(device, CLOSING_INDEX_BUFFER_SIZE, D3DFMT_INDEX16);
+ mClosingIB = new StreamingIndexBuffer(mDevice, CLOSING_INDEX_BUFFER_SIZE, D3DFMT_INDEX16);
}
mClosingIB->reserveSpace(spaceNeeded, GL_UNSIGNED_SHORT);
@@ -2881,9 +2962,10 @@ void Context::drawClosingLine(unsigned int first, unsigned int last)
if (succeeded)
{
- device->SetIndices(mClosingIB->getBuffer());
+ mDevice->SetIndices(mClosingIB->getBuffer());
+ mAppliedIBSerial = mClosingIB->getSerial();
- device->DrawIndexedPrimitive(D3DPT_LINELIST, 0, 0, last, offset, 1);
+ mDevice->DrawIndexedPrimitive(D3DPT_LINELIST, -minIndex, minIndex, last, offset, 1);
}
else
{
@@ -2892,7 +2974,7 @@ void Context::drawClosingLine(unsigned int first, unsigned int last)
}
}
-void Context::drawClosingLine(GLsizei count, GLenum type, const void *indices)
+void Context::drawClosingLine(GLsizei count, GLenum type, const void *indices, int minIndex)
{
unsigned int first = 0;
unsigned int last = 0;
@@ -2921,7 +3003,7 @@ void Context::drawClosingLine(GLsizei count, GLenum type, const void *indices)
default: UNREACHABLE();
}
- drawClosingLine(first, last);
+ drawClosingLine(first, last, minIndex);
}
void Context::recordInvalidEnum()
@@ -2991,6 +3073,36 @@ GLenum Context::getError()
return GL_NO_ERROR;
}
+GLenum Context::getResetStatus()
+{
+ if (mResetStatus == GL_NO_ERROR)
+ {
+ bool lost = mDisplay->testDeviceLost();
+
+ if (lost)
+ {
+ mDisplay->notifyDeviceLost(); // Sets mResetStatus
+ }
+ }
+
+ GLenum status = mResetStatus;
+
+ if (mResetStatus != GL_NO_ERROR)
+ {
+ if (mDisplay->testDeviceResettable())
+ {
+ mResetStatus = GL_NO_ERROR;
+ }
+ }
+
+ return status;
+}
+
+bool Context::isResetNotificationEnabled()
+{
+ return (mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT);
+}
+
bool Context::supportsShaderModel3() const
{
return mSupportsShaderModel3;
@@ -3050,39 +3162,49 @@ bool Context::supportsEventQueries() const
return mSupportsEventQueries;
}
-bool Context::supportsCompressedTextures() const
+bool Context::supportsDXT1Textures() const
+{
+ return mSupportsDXT1Textures;
+}
+
+bool Context::supportsDXT3Textures() const
{
- return mSupportsCompressedTextures;
+ return mSupportsDXT3Textures;
}
-bool Context::supportsFloatTextures() const
+bool Context::supportsDXT5Textures() const
{
- return mSupportsFloatTextures;
+ return mSupportsDXT5Textures;
}
-bool Context::supportsFloatLinearFilter() const
+bool Context::supportsFloat32Textures() const
{
- return mSupportsFloatLinearFilter;
+ return mSupportsFloat32Textures;
}
-bool Context::supportsFloatRenderableTextures() const
+bool Context::supportsFloat32LinearFilter() const
{
- return mSupportsFloatRenderableTextures;
+ return mSupportsFloat32LinearFilter;
}
-bool Context::supportsHalfFloatTextures() const
+bool Context::supportsFloat32RenderableTextures() const
{
- return mSupportsHalfFloatTextures;
+ return mSupportsFloat32RenderableTextures;
}
-bool Context::supportsHalfFloatLinearFilter() const
+bool Context::supportsFloat16Textures() const
{
- return mSupportsHalfFloatLinearFilter;
+ return mSupportsFloat16Textures;
}
-bool Context::supportsHalfFloatRenderableTextures() const
+bool Context::supportsFloat16LinearFilter() const
{
- return mSupportsHalfFloatRenderableTextures;
+ return mSupportsFloat16LinearFilter;
+}
+
+bool Context::supportsFloat16RenderableTextures() const
+{
+ return mSupportsFloat16RenderableTextures;
}
int Context::getMaximumRenderbufferDimension() const
@@ -3313,58 +3435,83 @@ void Context::setVertexAttrib(GLuint index, const GLfloat *values)
mVertexDataManager->dirtyCurrentValue(index);
}
+// keep list sorted in following order
+// OES extensions
+// EXT extensions
+// Vendor extensions
void Context::initExtensionString()
{
+ mExtensionString = "";
+
+ // OES extensions
+ if (supports32bitIndices())
+ {
+ mExtensionString += "GL_OES_element_index_uint ";
+ }
+
mExtensionString += "GL_OES_packed_depth_stencil ";
- mExtensionString += "GL_EXT_texture_format_BGRA8888 ";
- mExtensionString += "GL_EXT_read_format_bgra ";
- mExtensionString += "GL_ANGLE_framebuffer_blit ";
mExtensionString += "GL_OES_rgb8_rgba8 ";
mExtensionString += "GL_OES_standard_derivatives ";
- if (supportsEventQueries())
+ if (supportsFloat16Textures())
{
- mExtensionString += "GL_NV_fence ";
+ mExtensionString += "GL_OES_texture_half_float ";
}
-
- if (supportsCompressedTextures())
+ if (supportsFloat16LinearFilter())
{
- mExtensionString += "GL_EXT_texture_compression_dxt1 ";
+ mExtensionString += "GL_OES_texture_half_float_linear ";
}
-
- if (supportsFloatTextures())
+ if (supportsFloat32Textures())
{
mExtensionString += "GL_OES_texture_float ";
}
-
- if (supportsHalfFloatTextures())
+ if (supportsFloat32LinearFilter())
{
- mExtensionString += "GL_OES_texture_half_float ";
+ mExtensionString += "GL_OES_texture_float_linear ";
}
- if (supportsFloatLinearFilter())
+ if (supportsNonPower2Texture())
{
- mExtensionString += "GL_OES_texture_float_linear ";
+ mExtensionString += "GL_OES_texture_npot ";
}
- if (supportsHalfFloatLinearFilter())
+ // Multi-vendor (EXT) extensions
+ mExtensionString += "GL_EXT_read_format_bgra ";
+ mExtensionString += "GL_EXT_robustness ";
+
+ if (supportsDXT1Textures())
{
- mExtensionString += "GL_OES_texture_half_float_linear ";
+ mExtensionString += "GL_EXT_texture_compression_dxt1 ";
}
+ mExtensionString += "GL_EXT_texture_format_BGRA8888 ";
+ mExtensionString += "GL_EXT_texture_storage ";
+
+ // ANGLE-specific extensions
+ mExtensionString += "GL_ANGLE_framebuffer_blit ";
if (getMaxSupportedSamples() != 0)
{
mExtensionString += "GL_ANGLE_framebuffer_multisample ";
}
- if (supports32bitIndices())
+ mExtensionString += "GL_ANGLE_pack_reverse_row_order ";
+
+ if (supportsDXT3Textures())
{
- mExtensionString += "GL_OES_element_index_uint ";
+ mExtensionString += "GL_ANGLE_texture_compression_dxt3 ";
+ }
+ if (supportsDXT5Textures())
+ {
+ mExtensionString += "GL_ANGLE_texture_compression_dxt5 ";
}
- if (supportsNonPower2Texture())
+ mExtensionString += "GL_ANGLE_texture_usage ";
+ mExtensionString += "GL_ANGLE_translated_shader_source ";
+
+ // Other vendor-specific extensions
+ if (supportsEventQueries())
{
- mExtensionString += "GL_OES_texture_npot ";
+ mExtensionString += "GL_NV_fence ";
}
std::string::size_type end = mExtensionString.find_last_not_of(' ');
@@ -3379,12 +3526,24 @@ const char *Context::getExtensionString() const
return mExtensionString.c_str();
}
+void Context::initRendererString()
+{
+ D3DADAPTER_IDENTIFIER9 *identifier = mDisplay->getAdapterIdentifier();
+
+ mRendererString = "ANGLE (";
+ mRendererString += identifier->Description;
+ mRendererString += ")";
+}
+
+const char *Context::getRendererString() const
+{
+ return mRendererString.c_str();
+}
+
void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask)
{
- IDirect3DDevice9 *device = getDevice();
-
Framebuffer *readFramebuffer = getReadFramebuffer();
Framebuffer *drawFramebuffer = getDrawFramebuffer();
@@ -3572,8 +3731,8 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
if (mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT))
{
- DepthStencilbuffer *readDSBuffer = NULL;
- DepthStencilbuffer *drawDSBuffer = NULL;
+ Renderbuffer *readDSBuffer = NULL;
+ Renderbuffer *drawDSBuffer = NULL;
// We support OES_packed_depth_stencil, and do not support a separately attached depth and stencil buffer, so if we have
// both a depth and stencil buffer, it will be the same buffer.
@@ -3625,13 +3784,18 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
if (blitRenderTarget || blitDepthStencil)
{
- egl::Display *display = getDisplay();
- display->endScene();
+ mDisplay->endScene();
if (blitRenderTarget)
{
- HRESULT result = device->StretchRect(readFramebuffer->getRenderTarget(), &sourceTrimmedRect,
- drawFramebuffer->getRenderTarget(), &destTrimmedRect, D3DTEXF_NONE);
+ IDirect3DSurface9* readRenderTarget = readFramebuffer->getRenderTarget();
+ IDirect3DSurface9* drawRenderTarget = drawFramebuffer->getRenderTarget();
+
+ HRESULT result = mDevice->StretchRect(readRenderTarget, &sourceTrimmedRect,
+ drawRenderTarget, &destTrimmedRect, D3DTEXF_NONE);
+
+ readRenderTarget->Release();
+ drawRenderTarget->Release();
if (FAILED(result))
{
@@ -3642,7 +3806,7 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
if (blitDepthStencil)
{
- HRESULT result = device->StretchRect(readFramebuffer->getDepthStencil(), NULL, drawFramebuffer->getDepthStencil(), NULL, D3DTEXF_NONE);
+ HRESULT result = mDevice->StretchRect(readFramebuffer->getDepthStencil(), NULL, drawFramebuffer->getDepthStencil(), NULL, D3DTEXF_NONE);
if (FAILED(result))
{
@@ -3673,10 +3837,8 @@ VertexDeclarationCache::~VertexDeclarationCache()
}
}
-GLenum VertexDeclarationCache::applyDeclaration(TranslatedAttribute attributes[], Program *program)
+GLenum VertexDeclarationCache::applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], Program *program)
{
- IDirect3DDevice9 *device = getDevice();
-
D3DVERTEXELEMENT9 elements[MAX_VERTEX_ATTRIBS + 1];
D3DVERTEXELEMENT9 *element = &elements[0];
@@ -3684,7 +3846,15 @@ GLenum VertexDeclarationCache::applyDeclaration(TranslatedAttribute attributes[]
{
if (attributes[i].active)
{
- device->SetStreamSource(i, attributes[i].vertexBuffer, attributes[i].offset, attributes[i].stride);
+ if (mAppliedVBs[i].serial != attributes[i].serial ||
+ mAppliedVBs[i].stride != attributes[i].stride ||
+ mAppliedVBs[i].offset != attributes[i].offset)
+ {
+ device->SetStreamSource(i, attributes[i].vertexBuffer, attributes[i].offset, attributes[i].stride);
+ mAppliedVBs[i].serial = attributes[i].serial;
+ mAppliedVBs[i].stride = attributes[i].stride;
+ mAppliedVBs[i].offset = attributes[i].offset;
+ }
element->Stream = i;
element->Offset = 0;
@@ -3705,8 +3875,12 @@ GLenum VertexDeclarationCache::applyDeclaration(TranslatedAttribute attributes[]
if (memcmp(entry->cachedElements, elements, (element - elements) * sizeof(D3DVERTEXELEMENT9)) == 0 && entry->vertexDeclaration)
{
entry->lruCount = ++mMaxLru;
- device->SetVertexDeclaration(entry->vertexDeclaration);
-
+ if(entry->vertexDeclaration != mLastSetVDecl)
+ {
+ device->SetVertexDeclaration(entry->vertexDeclaration);
+ mLastSetVDecl = entry->vertexDeclaration;
+ }
+
return GL_NO_ERROR;
}
}
@@ -3725,23 +3899,36 @@ GLenum VertexDeclarationCache::applyDeclaration(TranslatedAttribute attributes[]
{
lastCache->vertexDeclaration->Release();
lastCache->vertexDeclaration = NULL;
+ // mLastSetVDecl is set to the replacement, so we don't have to worry
+ // about it.
}
memcpy(lastCache->cachedElements, elements, (element - elements) * sizeof(D3DVERTEXELEMENT9));
device->CreateVertexDeclaration(elements, &lastCache->vertexDeclaration);
device->SetVertexDeclaration(lastCache->vertexDeclaration);
+ mLastSetVDecl = lastCache->vertexDeclaration;
lastCache->lruCount = ++mMaxLru;
return GL_NO_ERROR;
}
+void VertexDeclarationCache::markStateDirty()
+{
+ for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
+ {
+ mAppliedVBs[i].serial = 0;
+ }
+
+ mLastSetVDecl = NULL;
+}
+
}
extern "C"
{
-gl::Context *glCreateContext(const egl::Config *config, const gl::Context *shareContext)
+gl::Context *glCreateContext(const egl::Config *config, const gl::Context *shareContext, bool notifyResets, bool robustAccess)
{
- return new gl::Context(config, shareContext);
+ return new gl::Context(config, shareContext, notifyResets, robustAccess);
}
void glDestroyContext(gl::Context *context)
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Context.h b/Source/ThirdParty/ANGLE/src/libGLESv2/Context.h
index 30026544c..e436724d6 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Context.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Context.h
@@ -65,7 +65,7 @@ enum
MAX_TEXTURE_IMAGE_UNITS = 16,
MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF = 4, // For devices supporting vertex texture fetch
MAX_COMBINED_TEXTURE_IMAGE_UNITS_VTF = MAX_TEXTURE_IMAGE_UNITS + MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF,
- MAX_FRAGMENT_UNIFORM_VECTORS_SM2 = 32 - 3, // Reserve space for dx_Viewport, dx_Depth, and dx_DepthRange. dx_PointOrLines and dx_FrontCCW use separate bool registers.
+ MAX_FRAGMENT_UNIFORM_VECTORS_SM2 = 32 - 3, // Reserve space for dx_Coord, dx_Depth, and dx_DepthRange. dx_PointOrLines and dx_FrontCCW use separate bool registers.
MAX_FRAGMENT_UNIFORM_VECTORS_SM3 = 224 - 3,
MAX_DRAW_BUFFERS = 1,
@@ -219,6 +219,7 @@ struct State
GLint unpackAlignment;
GLint packAlignment;
+ bool packReverseRowOrder;
};
// Helper class to construct and cache vertex declarations
@@ -228,13 +229,25 @@ class VertexDeclarationCache
VertexDeclarationCache();
~VertexDeclarationCache();
- GLenum applyDeclaration(TranslatedAttribute attributes[], Program *program);
+ GLenum applyDeclaration(IDirect3DDevice9 *device, TranslatedAttribute attributes[], Program *program);
+
+ void markStateDirty();
private:
UINT mMaxLru;
enum { NUM_VERTEX_DECL_CACHE_ENTRIES = 16 };
+ struct VBData
+ {
+ unsigned int serial;
+ unsigned int stride;
+ unsigned int offset;
+ };
+
+ VBData mAppliedVBs[MAX_VERTEX_ATTRIBS];
+ IDirect3DVertexDeclaration9 *mLastSetVDecl;
+
struct VertexDeclCacheEntry
{
D3DVERTEXELEMENT9 cachedElements[MAX_VERTEX_ATTRIBS + 1];
@@ -246,7 +259,7 @@ class VertexDeclarationCache
class Context
{
public:
- Context(const egl::Config *config, const gl::Context *shareContext);
+ Context(const egl::Config *config, const gl::Context *shareContext, bool notifyResets, bool robustAccess);
~Context();
@@ -254,6 +267,9 @@ class Context
void markAllStateDirty();
+ virtual void markContextLost();
+ bool isContextLost();
+
// State manipulation
void setClearColor(float red, float green, float blue, float alpha);
@@ -345,6 +361,9 @@ class Context
void setPackAlignment(GLint alignment);
GLint getPackAlignment() const;
+ void setPackReverseRowOrder(bool reverseRowOrder);
+ bool getPackReverseRowOrder() const;
+
// These create and destroy methods are merely pass-throughs to
// ResourceManager, which owns these object types
GLuint createBuffer();
@@ -405,16 +424,15 @@ class Context
bool getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams);
- void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei *bufSize, void* pixels);
void clear(GLbitfield mask);
void drawArrays(GLenum mode, GLint first, GLsizei count);
void drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices);
- void finish();
- void flush();
+ void sync(bool block); // flush/finish
// Draw the last segment of a line loop
- void drawClosingLine(unsigned int first, unsigned int last);
- void drawClosingLine(GLsizei count, GLenum type, const void *indices);
+ void drawClosingLine(unsigned int first, unsigned int last, int minIndex);
+ void drawClosingLine(GLsizei count, GLenum type, const void *indices, int minIndex);
void recordInvalidEnum();
void recordInvalidValue();
@@ -423,6 +441,8 @@ class Context
void recordInvalidFramebufferOperation();
GLenum getError();
+ GLenum getResetStatus();
+ virtual bool isResetNotificationEnabled();
bool supportsShaderModel3() const;
int getMaximumVaryingVectors() const;
@@ -436,14 +456,17 @@ class Context
GLsizei getMaxSupportedSamples() const;
int getNearestSupportedSamples(D3DFORMAT format, int requested) const;
const char *getExtensionString() const;
+ const char *getRendererString() const;
bool supportsEventQueries() const;
- bool supportsCompressedTextures() const;
- bool supportsFloatTextures() const;
- bool supportsFloatLinearFilter() const;
- bool supportsFloatRenderableTextures() const;
- bool supportsHalfFloatTextures() const;
- bool supportsHalfFloatLinearFilter() const;
- bool supportsHalfFloatRenderableTextures() const;
+ bool supportsDXT1Textures() const;
+ bool supportsDXT3Textures() const;
+ bool supportsDXT5Textures() const;
+ bool supportsFloat32Textures() const;
+ bool supportsFloat32LinearFilter() const;
+ bool supportsFloat32RenderableTextures() const;
+ bool supportsFloat16Textures() const;
+ bool supportsFloat16LinearFilter() const;
+ bool supportsFloat16RenderableTextures() const;
bool supportsLuminanceTextures() const;
bool supportsLuminanceAlphaTextures() const;
bool supports32bitIndices() const;
@@ -478,7 +501,12 @@ class Context
bool cullSkipsDraw(GLenum drawMode);
bool isTriangleMode(GLenum drawMode);
+ void initExtensionString();
+ void initRendererString();
+
const egl::Config *const mConfig;
+ egl::Display *mDisplay;
+ IDirect3DDevice9 *mDevice;
State mState;
@@ -493,8 +521,8 @@ class Context
FenceMap mFenceMap;
HandleAllocator mFenceHandleAllocator;
- void initExtensionString();
std::string mExtensionString;
+ std::string mRendererString;
VertexDataManager *mVertexDataManager;
IndexDataManager *mIndexDataManager;
@@ -512,7 +540,12 @@ class Context
bool mOutOfMemory;
bool mInvalidFramebufferOperation;
+ // Current/lost context flags
bool mHasBeenCurrent;
+ bool mContextLost;
+ GLenum mResetStatus;
+ GLenum mResetStrategy;
+ bool mRobustAccess;
unsigned int mAppliedTextureSerialPS[MAX_TEXTURE_IMAGE_UNITS];
unsigned int mAppliedTextureSerialVS[MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF];
@@ -520,7 +553,15 @@ class Context
unsigned int mAppliedRenderTargetSerial;
unsigned int mAppliedDepthbufferSerial;
unsigned int mAppliedStencilbufferSerial;
+ unsigned int mAppliedIBSerial;
bool mDepthStencilInitialized;
+ bool mViewportInitialized;
+ D3DVIEWPORT9 mSetViewport;
+ bool mRenderTargetDescInitialized;
+ D3DSURFACE_DESC mRenderTargetDesc;
+ bool mDxUniformsDirty;
+ Program *mCachedCurrentProgram;
+ Framebuffer *mBoundDrawFramebuffer;
bool mSupportsShaderModel3;
bool mSupportsVertexTexture;
@@ -532,16 +573,19 @@ class Context
std::map<D3DFORMAT, bool *> mMultiSampleSupport;
GLsizei mMaxSupportedSamples;
bool mSupportsEventQueries;
- bool mSupportsCompressedTextures;
- bool mSupportsFloatTextures;
- bool mSupportsFloatLinearFilter;
- bool mSupportsFloatRenderableTextures;
- bool mSupportsHalfFloatTextures;
- bool mSupportsHalfFloatLinearFilter;
- bool mSupportsHalfFloatRenderableTextures;
+ bool mSupportsDXT1Textures;
+ bool mSupportsDXT3Textures;
+ bool mSupportsDXT5Textures;
+ bool mSupportsFloat32Textures;
+ bool mSupportsFloat32LinearFilter;
+ bool mSupportsFloat32RenderableTextures;
+ bool mSupportsFloat16Textures;
+ bool mSupportsFloat16LinearFilter;
+ bool mSupportsFloat16RenderableTextures;
bool mSupportsLuminanceTextures;
bool mSupportsLuminanceAlphaTextures;
bool mSupports32bitIndices;
+ int mNumCompressedTextureFormats;
// state caching flags
bool mClearStateDirty;
@@ -570,12 +614,12 @@ class Context
extern "C"
{
// Exported functions for use by EGL
-gl::Context *glCreateContext(const egl::Config *config, const gl::Context *shareContext);
+gl::Context *glCreateContext(const egl::Config *config, const gl::Context *shareContext, bool notifyResets, bool robustAccess);
void glDestroyContext(gl::Context *context);
void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface);
gl::Context *glGetCurrentContext();
__eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *procname);
-void __stdcall glBindTexImage(egl::Surface *surface);
+bool __stdcall glBindTexImage(egl::Surface *surface);
}
#endif // INCLUDE_CONTEXT_H_
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Fence.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Fence.cpp
index 7fbcb6ad3..96a3cc9f5 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Fence.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Fence.cpp
@@ -65,7 +65,7 @@ GLboolean Fence::testFence()
HRESULT result = mQuery->GetData(NULL, 0, D3DGETDATA_FLUSH);
- if (result == D3DERR_DEVICELOST)
+ if (checkDeviceLost(result))
{
return error(GL_OUT_OF_MEMORY, GL_TRUE);
}
@@ -110,7 +110,7 @@ void Fence::getFenceiv(GLenum pname, GLint *params)
HRESULT result = mQuery->GetData(NULL, 0, 0);
- if (result == D3DERR_DEVICELOST)
+ if (checkDeviceLost(result))
{
params[0] = GL_TRUE;
return error(GL_OUT_OF_MEMORY);
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.cpp
index 0f7ec20f8..00f7f98ce 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.cpp
@@ -58,19 +58,19 @@ Renderbuffer *Framebuffer::lookupRenderbuffer(GLenum type, GLuint handle) const
void Framebuffer::setColorbuffer(GLenum type, GLuint colorbuffer)
{
- mColorbufferType = type;
+ mColorbufferType = (colorbuffer != 0) ? type : GL_NONE;
mColorbufferPointer.set(lookupRenderbuffer(type, colorbuffer));
}
void Framebuffer::setDepthbuffer(GLenum type, GLuint depthbuffer)
{
- mDepthbufferType = type;
+ mDepthbufferType = (depthbuffer != 0) ? type : GL_NONE;
mDepthbufferPointer.set(lookupRenderbuffer(type, depthbuffer));
}
void Framebuffer::setStencilbuffer(GLenum type, GLuint stencilbuffer)
{
- mStencilbufferType = type;
+ mStencilbufferType = (stencilbuffer != 0) ? type : GL_NONE;
mStencilbufferPointer.set(lookupRenderbuffer(type, stencilbuffer));
}
@@ -181,46 +181,19 @@ unsigned int Framebuffer::getStencilbufferSerial()
return 0;
}
-Colorbuffer *Framebuffer::getColorbuffer()
+Renderbuffer *Framebuffer::getColorbuffer()
{
- Renderbuffer *rb = mColorbufferPointer.get();
-
- if (rb != NULL && rb->isColorbuffer())
- {
- return static_cast<Colorbuffer*>(rb->getStorage());
- }
- else
- {
- return NULL;
- }
+ return mColorbufferPointer.get();
}
-DepthStencilbuffer *Framebuffer::getDepthbuffer()
+Renderbuffer *Framebuffer::getDepthbuffer()
{
- Renderbuffer *rb = mDepthbufferPointer.get();
-
- if (rb != NULL && rb->isDepthbuffer())
- {
- return static_cast<DepthStencilbuffer*>(rb->getStorage());
- }
- else
- {
- return NULL;
- }
+ return mDepthbufferPointer.get();
}
-DepthStencilbuffer *Framebuffer::getStencilbuffer()
+Renderbuffer *Framebuffer::getStencilbuffer()
{
- Renderbuffer *rb = mStencilbufferPointer.get();
-
- if (rb != NULL && rb->isStencilbuffer())
- {
- return static_cast<DepthStencilbuffer*>(rb->getStorage());
- }
- else
- {
- return NULL;
- }
+ return mStencilbufferPointer.get();
}
GLenum Framebuffer::getColorbufferType()
@@ -257,7 +230,7 @@ bool Framebuffer::hasStencil()
{
if (mStencilbufferType != GL_NONE)
{
- DepthStencilbuffer *stencilbufferObject = getStencilbuffer();
+ Renderbuffer *stencilbufferObject = getStencilbuffer();
if (stencilbufferObject)
{
@@ -276,7 +249,7 @@ GLenum Framebuffer::completeness()
if (mColorbufferType != GL_NONE)
{
- Colorbuffer *colorbuffer = getColorbuffer();
+ Renderbuffer *colorbuffer = getColorbuffer();
if (!colorbuffer)
{
@@ -302,8 +275,8 @@ GLenum Framebuffer::completeness()
return GL_FRAMEBUFFER_UNSUPPORTED;
}
- if ((colorbuffer->getType() == GL_FLOAT && !getContext()->supportsFloatRenderableTextures()) ||
- (colorbuffer->getType() == GL_HALF_FLOAT_OES && !getContext()->supportsHalfFloatRenderableTextures()))
+ if ((dx2es::IsFloat32Format(colorbuffer->getD3DFormat()) && !getContext()->supportsFloat32RenderableTextures()) ||
+ (dx2es::IsFloat16Format(colorbuffer->getD3DFormat()) && !getContext()->supportsFloat16RenderableTextures()))
{
return GL_FRAMEBUFFER_UNSUPPORTED;
}
@@ -324,8 +297,8 @@ GLenum Framebuffer::completeness()
return GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT;
}
- DepthStencilbuffer *depthbuffer = NULL;
- DepthStencilbuffer *stencilbuffer = NULL;
+ Renderbuffer *depthbuffer = NULL;
+ Renderbuffer *stencilbuffer = NULL;
if (mDepthbufferType != GL_NONE)
{
@@ -418,17 +391,17 @@ GLenum Framebuffer::completeness()
return GL_FRAMEBUFFER_COMPLETE;
}
-DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *color, DepthStencilbuffer *depthStencil)
+DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil)
{
- mColorbufferType = GL_RENDERBUFFER;
- mDepthbufferType = (depthStencil->getDepthSize() != 0) ? GL_RENDERBUFFER : GL_NONE;
- mStencilbufferType = (depthStencil->getStencilSize() != 0) ? GL_RENDERBUFFER : GL_NONE;
-
- mColorbufferPointer.set(new Renderbuffer(0, color));
+ mColorbufferPointer.set(new Renderbuffer(0, colorbuffer));
Renderbuffer *depthStencilRenderbuffer = new Renderbuffer(0, depthStencil);
mDepthbufferPointer.set(depthStencilRenderbuffer);
mStencilbufferPointer.set(depthStencilRenderbuffer);
+
+ mColorbufferType = GL_RENDERBUFFER;
+ mDepthbufferType = (depthStencilRenderbuffer->getDepthSize() != 0) ? GL_RENDERBUFFER : GL_NONE;
+ mStencilbufferType = (depthStencilRenderbuffer->getStencilSize() != 0) ? GL_RENDERBUFFER : GL_NONE;
}
int Framebuffer::getSamples()
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.h b/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.h
index cf51658dd..874cf94cb 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Framebuffer.h
@@ -46,9 +46,9 @@ class Framebuffer
unsigned int getDepthbufferSerial();
unsigned int getStencilbufferSerial();
- Colorbuffer *getColorbuffer();
- DepthStencilbuffer *getDepthbuffer();
- DepthStencilbuffer *getStencilbuffer();
+ Renderbuffer *getColorbuffer();
+ Renderbuffer *getDepthbuffer();
+ Renderbuffer *getStencilbuffer();
GLenum getColorbufferType();
GLenum getDepthbufferType();
@@ -82,7 +82,7 @@ class Framebuffer
class DefaultFramebuffer : public Framebuffer
{
public:
- DefaultFramebuffer(Colorbuffer *color, DepthStencilbuffer *depthStencil);
+ DefaultFramebuffer(Colorbuffer *colorbuffer, DepthStencilbuffer *depthStencil);
virtual GLenum completeness();
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.cpp
index 5b939b8a9..dee49069c 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.cpp
@@ -22,6 +22,7 @@ namespace
namespace gl
{
+unsigned int IndexBuffer::mCurrentSerial = 1;
IndexDataManager::IndexDataManager(Context *context, IDirect3DDevice9 *device) : mDevice(device)
{
@@ -200,6 +201,7 @@ GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, Buffer *bu
}
translated->indexBuffer = indexBuffer->getBuffer();
+ translated->serial = indexBuffer->getSerial();
translated->startIndex = streamOffset / indexSize(format);
if (buffer)
@@ -232,6 +234,7 @@ IndexBuffer::IndexBuffer(IDirect3DDevice9 *device, UINT size, D3DFORMAT format)
{
D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
HRESULT result = device->CreateIndexBuffer(size, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, format, pool, &mIndexBuffer, NULL);
+ mSerial = issueSerial();
if (FAILED(result))
{
@@ -253,6 +256,16 @@ IDirect3DIndexBuffer9 *IndexBuffer::getBuffer() const
return mIndexBuffer;
}
+unsigned int IndexBuffer::getSerial() const
+{
+ return mSerial;
+}
+
+unsigned int IndexBuffer::issueSerial()
+{
+ return mCurrentSerial++;
+}
+
void IndexBuffer::unmap()
{
if (mIndexBuffer)
@@ -305,6 +318,7 @@ void StreamingIndexBuffer::reserveSpace(UINT requiredSpace, GLenum type)
D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
HRESULT result = mDevice->CreateIndexBuffer(mBufferSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, type == GL_UNSIGNED_INT ? D3DFMT_INDEX32 : D3DFMT_INDEX16, pool, &mIndexBuffer, NULL);
+ mSerial = issueSerial();
if (FAILED(result))
{
@@ -358,6 +372,7 @@ void StaticIndexBuffer::reserveSpace(UINT requiredSpace, GLenum type)
{
D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_WRITEONLY);
HRESULT result = mDevice->CreateIndexBuffer(requiredSpace, D3DUSAGE_WRITEONLY, type == GL_UNSIGNED_INT ? D3DFMT_INDEX32 : D3DFMT_INDEX16, pool, &mIndexBuffer, NULL);
+ mSerial = issueSerial();
if (FAILED(result))
{
@@ -381,24 +396,25 @@ bool StaticIndexBuffer::lookupType(GLenum type)
UINT StaticIndexBuffer::lookupRange(intptr_t offset, GLsizei count, UINT *minIndex, UINT *maxIndex)
{
- for (unsigned int range = 0; range < mCache.size(); range++)
- {
- if (mCache[range].offset == offset && mCache[range].count == count)
- {
- *minIndex = mCache[range].minIndex;
- *maxIndex = mCache[range].maxIndex;
+ IndexRange range = {offset, count};
- return mCache[range].streamOffset;
- }
+ std::map<IndexRange, IndexResult>::iterator res = mCache.find(range);
+
+ if (res == mCache.end())
+ {
+ return -1;
}
- return -1;
+ *minIndex = res->second.minIndex;
+ *maxIndex = res->second.maxIndex;
+ return res->second.streamOffset;
}
void StaticIndexBuffer::addRange(intptr_t offset, GLsizei count, UINT minIndex, UINT maxIndex, UINT streamOffset)
{
- IndexRange indexRange = {offset, count, minIndex, maxIndex, streamOffset};
- mCache.push_back(indexRange);
+ IndexRange indexRange = {offset, count};
+ IndexResult indexResult = {minIndex, maxIndex, streamOffset};
+ mCache[indexRange] = indexResult;
}
}
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.h b/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.h
index 814f41040..04db4be62 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/IndexDataManager.h
@@ -28,6 +28,7 @@ struct TranslatedIndexData
UINT startIndex;
IDirect3DIndexBuffer9 *indexBuffer;
+ unsigned int serial;
};
class IndexBuffer
@@ -42,6 +43,7 @@ class IndexBuffer
virtual void reserveSpace(UINT requiredSpace, GLenum type) = 0;
IDirect3DIndexBuffer9 *getBuffer() const;
+ unsigned int getSerial() const;
protected:
IDirect3DDevice9 *const mDevice;
@@ -49,6 +51,10 @@ class IndexBuffer
IDirect3DIndexBuffer9 *mIndexBuffer;
UINT mBufferSize;
+ unsigned int mSerial;
+ static unsigned int issueSerial();
+ static unsigned int mCurrentSerial;
+
private:
DISALLOW_COPY_AND_ASSIGN(IndexBuffer);
};
@@ -87,12 +93,28 @@ class StaticIndexBuffer : public IndexBuffer
intptr_t offset;
GLsizei count;
+ bool operator<(const IndexRange& rhs) const
+ {
+ if (offset != rhs.offset)
+ {
+ return offset < rhs.offset;
+ }
+ if (count != rhs.count)
+ {
+ return count < rhs.count;
+ }
+ return false;
+ }
+ };
+
+ struct IndexResult
+ {
UINT minIndex;
UINT maxIndex;
UINT streamOffset;
};
- std::vector<IndexRange> mCache;
+ std::map<IndexRange, IndexResult> mCache;
};
class IndexDataManager
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp
index 0a25bc2af..986593f9f 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Program.cpp
@@ -24,6 +24,7 @@
namespace gl
{
unsigned int Program::mCurrentSerial = 1;
+const char *fakepath = "C:\\fakepath";
std::string str(int i)
{
@@ -32,13 +33,13 @@ std::string str(int i)
return buffer;
}
-Uniform::Uniform(GLenum type, const std::string &name, unsigned int arraySize) : type(type), name(name), arraySize(arraySize)
+Uniform::Uniform(GLenum type, const std::string &_name, unsigned int arraySize)
+ : type(type), _name(_name), name(Program::undecorateUniform(_name)), arraySize(arraySize)
{
- int bytes = UniformTypeSize(type) * arraySize;
+ int bytes = UniformInternalSize(type) * arraySize;
data = new unsigned char[bytes];
memset(data, 0, bytes);
dirty = true;
- handlesSet = false;
}
Uniform::~Uniform()
@@ -46,13 +47,19 @@ Uniform::~Uniform()
delete[] data;
}
-UniformLocation::UniformLocation(const std::string &name, unsigned int element, unsigned int index)
- : name(name), element(element), index(index)
+bool Uniform::isArray()
+{
+ return _name.compare(0, 3, "ar_") == 0;
+}
+
+UniformLocation::UniformLocation(const std::string &_name, unsigned int element, unsigned int index)
+ : name(Program::undecorateUniform(_name)), element(element), index(index)
{
}
Program::Program(ResourceManager *manager, GLuint handle) : mResourceManager(manager), mHandle(handle), mSerial(issueSerial())
{
+ mDevice = getDevice();
mFragmentShader = NULL;
mVertexShader = NULL;
@@ -137,8 +144,6 @@ bool Program::detachShader(Shader *shader)
}
else UNREACHABLE();
- unlink();
-
return true;
}
@@ -193,11 +198,26 @@ int Program::getSemanticIndex(int attributeIndex)
return mSemanticIndex[attributeIndex];
}
+// Returns one more than the highest sampler index used.
+GLint Program::getUsedSamplerRange(SamplerType type)
+{
+ switch (type)
+ {
+ case SAMPLER_PIXEL:
+ return mUsedPixelSamplerRange;
+ case SAMPLER_VERTEX:
+ return mUsedVertexSamplerRange;
+ default:
+ UNREACHABLE();
+ return 0;
+ }
+}
+
// Returns the index of the texture image unit (0-19) corresponding to a Direct3D 9 sampler
// index (0-15 for the pixel shader and 0-3 for the vertex shader).
GLint Program::getSamplerMapping(SamplerType type, unsigned int samplerIndex)
{
- GLuint logicalTextureUnit = -1;
+ GLint logicalTextureUnit = -1;
switch (type)
{
@@ -220,7 +240,7 @@ GLint Program::getSamplerMapping(SamplerType type, unsigned int samplerIndex)
default: UNREACHABLE();
}
- if (logicalTextureUnit >= 0 && logicalTextureUnit < getContext()->getMaximumCombinedTextureImageUnits())
+ if (logicalTextureUnit >= 0 && logicalTextureUnit < (GLint)getContext()->getMaximumCombinedTextureImageUnits())
{
return logicalTextureUnit;
}
@@ -248,24 +268,23 @@ TextureType Program::getSamplerTextureType(SamplerType type, unsigned int sample
return TEXTURE_2D;
}
-GLint Program::getUniformLocation(const char *name, bool decorated)
+GLint Program::getUniformLocation(std::string name)
{
- std::string _name = decorated ? name : decorate(name);
int subscript = 0;
// Strip any trailing array operator and retrieve the subscript
- size_t open = _name.find_last_of('[');
- size_t close = _name.find_last_of(']');
- if (open != std::string::npos && close == _name.length() - 1)
+ size_t open = name.find_last_of('[');
+ size_t close = name.find_last_of(']');
+ if (open != std::string::npos && close == name.length() - 1)
{
- subscript = atoi(_name.substr(open + 1).c_str());
- _name.erase(open);
+ subscript = atoi(name.substr(open + 1).c_str());
+ name.erase(open);
}
unsigned int numUniforms = mUniformIndex.size();
for (unsigned int location = 0; location < numUniforms; location++)
{
- if (mUniformIndex[location].name == _name &&
+ if (mUniformIndex[location].name == name &&
mUniformIndex[location].element == subscript)
{
return location;
@@ -294,8 +313,17 @@ bool Program::setUniform1fv(GLint location, GLsizei count, const GLfloat* v)
count = std::min(arraySize - (int)mUniformIndex[location].element, count);
- memcpy(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat),
- v, sizeof(GLfloat) * count);
+ GLfloat *target = (GLfloat*)targetUniform->data + mUniformIndex[location].element * 4;
+
+ for (int i = 0; i < count; i++)
+ {
+ target[0] = v[0];
+ target[1] = 0;
+ target[2] = 0;
+ target[3] = 0;
+ target += 4;
+ v += 1;
+ }
}
else if (targetUniform->type == GL_BOOL)
{
@@ -351,8 +379,17 @@ bool Program::setUniform2fv(GLint location, GLsizei count, const GLfloat *v)
count = std::min(arraySize - (int)mUniformIndex[location].element, count);
- memcpy(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat) * 2,
- v, 2 * sizeof(GLfloat) * count);
+ GLfloat *target = (GLfloat*)targetUniform->data + mUniformIndex[location].element * 4;
+
+ for (int i = 0; i < count; i++)
+ {
+ target[0] = v[0];
+ target[1] = v[1];
+ target[2] = 0;
+ target[3] = 0;
+ target += 4;
+ v += 2;
+ }
}
else if (targetUniform->type == GL_BOOL_VEC2)
{
@@ -409,8 +446,17 @@ bool Program::setUniform3fv(GLint location, GLsizei count, const GLfloat *v)
count = std::min(arraySize - (int)mUniformIndex[location].element, count);
- memcpy(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat) * 3,
- v, 3 * sizeof(GLfloat) * count);
+ GLfloat *target = (GLfloat*)targetUniform->data + mUniformIndex[location].element * 4;
+
+ for (int i = 0; i < count; i++)
+ {
+ target[0] = v[0];
+ target[1] = v[1];
+ target[2] = v[2];
+ target[3] = 0;
+ target += 4;
+ v += 3;
+ }
}
else if (targetUniform->type == GL_BOOL_VEC3)
{
@@ -504,6 +550,37 @@ bool Program::setUniform4fv(GLint location, GLsizei count, const GLfloat *v)
return true;
}
+template<typename T, int targetWidth, int targetHeight, int srcWidth, int srcHeight>
+void transposeMatrix(T *target, const GLfloat *value)
+{
+ int copyWidth = std::min(targetWidth, srcWidth);
+ int copyHeight = std::min(targetHeight, srcHeight);
+
+ for (int x = 0; x < copyWidth; x++)
+ {
+ for (int y = 0; y < copyHeight; y++)
+ {
+ target[x * targetWidth + y] = (T)value[y * srcWidth + x];
+ }
+ }
+ // clear unfilled right side
+ for (int y = 0; y < copyHeight; y++)
+ {
+ for (int x = srcWidth; x < targetWidth; x++)
+ {
+ target[y * targetWidth + x] = (T)0;
+ }
+ }
+ // clear unfilled bottom.
+ for (int y = srcHeight; y < targetHeight; y++)
+ {
+ for (int x = 0; x < targetWidth; x++)
+ {
+ target[y * targetWidth + x] = (T)0;
+ }
+ }
+}
+
bool Program::setUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value)
{
if (location < 0 || location >= (int)mUniformIndex.size())
@@ -526,8 +603,13 @@ bool Program::setUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *
count = std::min(arraySize - (int)mUniformIndex[location].element, count);
- memcpy(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat) * 4,
- value, 4 * sizeof(GLfloat) * count);
+ GLfloat *target = (GLfloat*)targetUniform->data + mUniformIndex[location].element * 8;
+ for (int i = 0; i < count; i++)
+ {
+ transposeMatrix<GLfloat,4,2,2,2>(target, value);
+ target += 8;
+ value += 4;
+ }
return true;
}
@@ -554,12 +636,18 @@ bool Program::setUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *
count = std::min(arraySize - (int)mUniformIndex[location].element, count);
- memcpy(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat) * 9,
- value, 9 * sizeof(GLfloat) * count);
+ GLfloat *target = (GLfloat*)targetUniform->data + mUniformIndex[location].element * 12;
+ for (int i = 0; i < count; i++)
+ {
+ transposeMatrix<GLfloat,4,3,3,3>(target, value);
+ target += 12;
+ value += 9;
+ }
return true;
}
+
bool Program::setUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value)
{
if (location < 0 || location >= (int)mUniformIndex.size())
@@ -582,8 +670,13 @@ bool Program::setUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *
count = std::min(arraySize - (int)mUniformIndex[location].element, count);
- memcpy(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat) * 16,
- value, 16 * sizeof(GLfloat) * count);
+ GLfloat *target = (GLfloat*)(targetUniform->data + mUniformIndex[location].element * sizeof(GLfloat) * 16);
+ for (int i = 0; i < count; i++)
+ {
+ transposeMatrix<GLfloat,4,4,4,4>(target, value);
+ target += 16;
+ value += 16;
+ }
return true;
}
@@ -818,7 +911,7 @@ bool Program::setUniform4iv(GLint location, GLsizei count, const GLint *v)
return true;
}
-bool Program::getUniformfv(GLint location, GLfloat *params)
+bool Program::getUniformfv(GLint location, GLsizei *bufSize, GLfloat *params)
{
if (location < 0 || location >= (int)mUniformIndex.size())
{
@@ -827,41 +920,67 @@ bool Program::getUniformfv(GLint location, GLfloat *params)
Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
- unsigned int count = UniformComponentCount(targetUniform->type);
-
- switch (UniformComponentType(targetUniform->type))
+ // sized queries -- ensure the provided buffer is large enough
+ if (bufSize)
{
- case GL_BOOL:
+ int requiredBytes = UniformExternalSize(targetUniform->type);
+ if (*bufSize < requiredBytes)
{
- GLboolean *boolParams = (GLboolean*)targetUniform->data + mUniformIndex[location].element * count;
-
- for (unsigned int i = 0; i < count; ++i)
- {
- params[i] = (boolParams[i] == GL_FALSE) ? 0.0f : 1.0f;
- }
+ return false;
}
+ }
+
+ switch (targetUniform->type)
+ {
+ case GL_FLOAT_MAT2:
+ transposeMatrix<GLfloat,2,2,4,2>(params, (GLfloat*)targetUniform->data + mUniformIndex[location].element * 8);
break;
- case GL_FLOAT:
- memcpy(params, targetUniform->data + mUniformIndex[location].element * count * sizeof(GLfloat),
- count * sizeof(GLfloat));
+ case GL_FLOAT_MAT3:
+ transposeMatrix<GLfloat,3,3,4,3>(params, (GLfloat*)targetUniform->data + mUniformIndex[location].element * 12);
break;
- case GL_INT:
+ case GL_FLOAT_MAT4:
+ transposeMatrix<GLfloat,4,4,4,4>(params, (GLfloat*)targetUniform->data + mUniformIndex[location].element * 16);
+ break;
+ default:
{
- GLint *intParams = (GLint*)targetUniform->data + mUniformIndex[location].element * count;
+ unsigned int count = UniformExternalComponentCount(targetUniform->type);
+ unsigned int internalCount = UniformInternalComponentCount(targetUniform->type);
- for (unsigned int i = 0; i < count; ++i)
+ switch (UniformComponentType(targetUniform->type))
{
- params[i] = (float)intParams[i];
+ case GL_BOOL:
+ {
+ GLboolean *boolParams = (GLboolean*)targetUniform->data + mUniformIndex[location].element * internalCount;
+
+ for (unsigned int i = 0; i < count; ++i)
+ {
+ params[i] = (boolParams[i] == GL_FALSE) ? 0.0f : 1.0f;
+ }
+ }
+ break;
+ case GL_FLOAT:
+ memcpy(params, targetUniform->data + mUniformIndex[location].element * internalCount * sizeof(GLfloat),
+ count * sizeof(GLfloat));
+ break;
+ case GL_INT:
+ {
+ GLint *intParams = (GLint*)targetUniform->data + mUniformIndex[location].element * internalCount;
+
+ for (unsigned int i = 0; i < count; ++i)
+ {
+ params[i] = (float)intParams[i];
+ }
+ }
+ break;
+ default: UNREACHABLE();
}
}
- break;
- default: UNREACHABLE();
}
return true;
}
-bool Program::getUniformiv(GLint location, GLint *params)
+bool Program::getUniformiv(GLint location, GLsizei *bufSize, GLint *params)
{
if (location < 0 || location >= (int)mUniformIndex.size())
{
@@ -870,35 +989,67 @@ bool Program::getUniformiv(GLint location, GLint *params)
Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
- unsigned int count = UniformComponentCount(targetUniform->type);
-
- switch (UniformComponentType(targetUniform->type))
+ // sized queries -- ensure the provided buffer is large enough
+ if (bufSize)
{
- case GL_BOOL:
+ int requiredBytes = UniformExternalSize(targetUniform->type);
+ if (*bufSize < requiredBytes)
{
- GLboolean *boolParams = targetUniform->data + mUniformIndex[location].element * count;
+ return false;
+ }
+ }
- for (unsigned int i = 0; i < count; ++i)
- {
- params[i] = (GLint)boolParams[i];
- }
+ switch (targetUniform->type)
+ {
+ case GL_FLOAT_MAT2:
+ {
+ transposeMatrix<GLint,2,2,4,2>(params, (GLfloat*)targetUniform->data + mUniformIndex[location].element * 8);
+ }
+ break;
+ case GL_FLOAT_MAT3:
+ {
+ transposeMatrix<GLint,3,3,4,3>(params, (GLfloat*)targetUniform->data + mUniformIndex[location].element * 12);
+ }
+ break;
+ case GL_FLOAT_MAT4:
+ {
+ transposeMatrix<GLint,4,4,4,4>(params, (GLfloat*)targetUniform->data + mUniformIndex[location].element * 16);
}
break;
- case GL_FLOAT:
+ default:
{
- GLfloat *floatParams = (GLfloat*)targetUniform->data + mUniformIndex[location].element * count;
+ unsigned int count = UniformExternalComponentCount(targetUniform->type);
+ unsigned int internalCount = UniformInternalComponentCount(targetUniform->type);
- for (unsigned int i = 0; i < count; ++i)
+ switch (UniformComponentType(targetUniform->type))
{
- params[i] = (GLint)floatParams[i];
+ case GL_BOOL:
+ {
+ GLboolean *boolParams = targetUniform->data + mUniformIndex[location].element * internalCount;
+
+ for (unsigned int i = 0; i < count; ++i)
+ {
+ params[i] = (GLint)boolParams[i];
+ }
+ }
+ break;
+ case GL_FLOAT:
+ {
+ GLfloat *floatParams = (GLfloat*)targetUniform->data + mUniformIndex[location].element * internalCount;
+
+ for (unsigned int i = 0; i < count; ++i)
+ {
+ params[i] = (GLint)floatParams[i];
+ }
+ }
+ break;
+ case GL_INT:
+ memcpy(params, targetUniform->data + mUniformIndex[location].element * internalCount * sizeof(GLint),
+ count * sizeof(GLint));
+ break;
+ default: UNREACHABLE();
}
}
- break;
- case GL_INT:
- memcpy(params, targetUniform->data + mUniformIndex[location].element * count * sizeof(GLint),
- count * sizeof(GLint));
- break;
- default: UNREACHABLE();
}
return true;
@@ -916,15 +1067,8 @@ void Program::dirtyAllUniforms()
// Applies all the uniforms set for this program object to the Direct3D 9 device
void Program::applyUniforms()
{
- unsigned int numUniforms = mUniformIndex.size();
- for (unsigned int location = 0; location < numUniforms; location++)
- {
- if (mUniformIndex[location].element != 0)
- {
- continue;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
+ for (std::vector<Uniform*>::iterator ub = mUniforms.begin(), ue = mUniforms.end(); ub != ue; ++ub) {
+ Uniform *targetUniform = *ub;
if (targetUniform->dirty)
{
@@ -935,23 +1079,23 @@ void Program::applyUniforms()
switch (targetUniform->type)
{
- case GL_BOOL: applyUniform1bv(location, arraySize, b); break;
- case GL_BOOL_VEC2: applyUniform2bv(location, arraySize, b); break;
- case GL_BOOL_VEC3: applyUniform3bv(location, arraySize, b); break;
- case GL_BOOL_VEC4: applyUniform4bv(location, arraySize, b); break;
- case GL_FLOAT: applyUniform1fv(location, arraySize, f); break;
- case GL_FLOAT_VEC2: applyUniform2fv(location, arraySize, f); break;
- case GL_FLOAT_VEC3: applyUniform3fv(location, arraySize, f); break;
- case GL_FLOAT_VEC4: applyUniform4fv(location, arraySize, f); break;
- case GL_FLOAT_MAT2: applyUniformMatrix2fv(location, arraySize, f); break;
- case GL_FLOAT_MAT3: applyUniformMatrix3fv(location, arraySize, f); break;
- case GL_FLOAT_MAT4: applyUniformMatrix4fv(location, arraySize, f); break;
+ case GL_BOOL: applyUniformnbv(targetUniform, arraySize, 1, b); break;
+ case GL_BOOL_VEC2: applyUniformnbv(targetUniform, arraySize, 2, b); break;
+ case GL_BOOL_VEC3: applyUniformnbv(targetUniform, arraySize, 3, b); break;
+ case GL_BOOL_VEC4: applyUniformnbv(targetUniform, arraySize, 4, b); break;
+ case GL_FLOAT:
+ case GL_FLOAT_VEC2:
+ case GL_FLOAT_VEC3:
+ case GL_FLOAT_VEC4:
+ case GL_FLOAT_MAT2:
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT4: applyUniformnfv(targetUniform, f); break;
case GL_SAMPLER_2D:
case GL_SAMPLER_CUBE:
- case GL_INT: applyUniform1iv(location, arraySize, i); break;
- case GL_INT_VEC2: applyUniform2iv(location, arraySize, i); break;
- case GL_INT_VEC3: applyUniform3iv(location, arraySize, i); break;
- case GL_INT_VEC4: applyUniform4iv(location, arraySize, i); break;
+ case GL_INT: applyUniform1iv(targetUniform, arraySize, i); break;
+ case GL_INT_VEC2: applyUniform2iv(targetUniform, arraySize, i); break;
+ case GL_INT_VEC3: applyUniform3iv(targetUniform, arraySize, i); break;
+ case GL_INT_VEC4: applyUniform4iv(targetUniform, arraySize, i); break;
default:
UNREACHABLE();
}
@@ -993,7 +1137,7 @@ ID3D10Blob *Program::compileToBinary(const char *hlsl, const char *profile, ID3D
ID3D10Blob *binary = NULL;
ID3D10Blob *errorMessage = NULL;
- result = D3DCompile(hlsl, strlen(hlsl), NULL, NULL, NULL, "main", profile, flags, 0, &binary, &errorMessage);
+ result = D3DCompile(hlsl, strlen(hlsl), fakepath, NULL, NULL, "main", profile, flags, 0, &binary, &errorMessage);
if (errorMessage)
{
@@ -1007,7 +1151,6 @@ ID3D10Blob *Program::compileToBinary(const char *hlsl, const char *profile, ID3D
errorMessage = NULL;
}
-
if (FAILED(result))
{
if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY)
@@ -1277,7 +1420,7 @@ bool Program::linkVaryings()
default: UNREACHABLE();
}
- mVertexHLSL += decorate(attribute->name) + " : TEXCOORD" + str(semanticIndex) + ";\n";
+ mVertexHLSL += decorateAttribute(attribute->name) + " : TEXCOORD" + str(semanticIndex) + ";\n";
semanticIndex += VariableRowCount(attribute->type);
}
@@ -1312,14 +1455,14 @@ bool Program::linkVaryings()
for (AttributeArray::iterator attribute = mVertexShader->mAttributes.begin(); attribute != mVertexShader->mAttributes.end(); attribute++)
{
- mVertexHLSL += " " + decorate(attribute->name) + " = ";
+ mVertexHLSL += " " + decorateAttribute(attribute->name) + " = ";
if (VariableRowCount(attribute->type) > 1) // Matrix
{
mVertexHLSL += "transpose";
}
- mVertexHLSL += "(input." + decorate(attribute->name) + ");\n";
+ mVertexHLSL += "(input." + decorateAttribute(attribute->name) + ");\n";
}
mVertexHLSL += "\n"
@@ -1457,13 +1600,20 @@ bool Program::linkVaryings()
if (mFragmentShader->mUsesFragCoord)
{
mPixelHLSL += " float rhw = 1.0 / input.gl_FragCoord.w;\n";
- if (sm3) {
+
+ if (sm3)
+ {
+ // dx_Coord.y contains the render target height. See Context::applyRenderTarget()
mPixelHLSL += " gl_FragCoord.x = input.dx_VPos.x + 0.5;\n"
- " gl_FragCoord.y = 2.0 * dx_Viewport.y - input.dx_VPos.y - 0.5;\n";
- } else {
- mPixelHLSL += " gl_FragCoord.x = (input.gl_FragCoord.x * rhw) * dx_Viewport.x + dx_Viewport.z;\n"
- " gl_FragCoord.y = -(input.gl_FragCoord.y * rhw) * dx_Viewport.y + dx_Viewport.w;\n";
+ " gl_FragCoord.y = dx_Coord.y - input.dx_VPos.y - 0.5;\n";
+ }
+ else
+ {
+ // dx_Coord contains the viewport width/2, height/2, center.x and center.y. See Context::applyRenderTarget()
+ mPixelHLSL += " gl_FragCoord.x = (input.gl_FragCoord.x * rhw) * dx_Coord.x + dx_Coord.z;\n"
+ " gl_FragCoord.y = -(input.gl_FragCoord.y * rhw) * dx_Coord.y + dx_Coord.w;\n";
}
+
mPixelHLSL += " gl_FragCoord.z = (input.gl_FragCoord.z * rhw) * dx_Depth.x + dx_Depth.y;\n"
" gl_FragCoord.w = rhw;\n";
}
@@ -1553,9 +1703,8 @@ void Program::link()
if (vertexBinary && pixelBinary)
{
- IDirect3DDevice9 *device = getDevice();
- HRESULT vertexResult = device->CreateVertexShader((DWORD*)vertexBinary->GetBufferPointer(), &mVertexExecutable);
- HRESULT pixelResult = device->CreatePixelShader((DWORD*)pixelBinary->GetBufferPointer(), &mPixelExecutable);
+ HRESULT vertexResult = mDevice->CreateVertexShader((DWORD*)vertexBinary->GetBufferPointer(), &mVertexExecutable);
+ HRESULT pixelResult = mDevice->CreatePixelShader((DWORD*)pixelBinary->GetBufferPointer(), &mPixelExecutable);
if (vertexResult == D3DERR_OUTOFVIDEOMEMORY || vertexResult == E_OUTOFMEMORY || pixelResult == D3DERR_OUTOFVIDEOMEMORY || pixelResult == E_OUTOFMEMORY)
{
@@ -1588,12 +1737,12 @@ void Program::link()
// these uniforms are searched as already-decorated because gl_ and dx_
// are reserved prefixes, and do not receive additional decoration
- mDxDepthRangeLocation = getUniformLocation("dx_DepthRange", true);
- mDxDepthLocation = getUniformLocation("dx_Depth", true);
- mDxViewportLocation = getUniformLocation("dx_Viewport", true);
- mDxHalfPixelSizeLocation = getUniformLocation("dx_HalfPixelSize", true);
- mDxFrontCCWLocation = getUniformLocation("dx_FrontCCW", true);
- mDxPointsOrLinesLocation = getUniformLocation("dx_PointsOrLines", true);
+ mDxDepthRangeLocation = getUniformLocation("dx_DepthRange");
+ mDxDepthLocation = getUniformLocation("dx_Depth");
+ mDxCoordLocation = getUniformLocation("dx_Coord");
+ mDxHalfPixelSizeLocation = getUniformLocation("dx_HalfPixelSize");
+ mDxFrontCCWLocation = getUniformLocation("dx_FrontCCW");
+ mDxPointsOrLinesLocation = getUniformLocation("dx_PointsOrLines");
mLinked = true; // Success
}
@@ -1712,15 +1861,21 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
{
if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
{
- for (unsigned int samplerIndex = constantDescription.RegisterIndex; samplerIndex < constantDescription.RegisterIndex + constantDescription.RegisterCount; samplerIndex++)
+ for (unsigned int i = 0; i < constantDescription.RegisterCount; i++)
{
- if (mConstantTablePS->GetConstantByName(NULL, constantDescription.Name) != NULL)
+ D3DXHANDLE psConstant = mConstantTablePS->GetConstantByName(NULL, constantDescription.Name);
+ D3DXHANDLE vsConstant = mConstantTableVS->GetConstantByName(NULL, constantDescription.Name);
+
+ if (psConstant)
{
+ unsigned int samplerIndex = mConstantTablePS->GetSamplerIndex(psConstant) + i;
+
if (samplerIndex < MAX_TEXTURE_IMAGE_UNITS)
{
mSamplersPS[samplerIndex].active = true;
mSamplersPS[samplerIndex].textureType = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? TEXTURE_CUBE : TEXTURE_2D;
mSamplersPS[samplerIndex].logicalTextureUnit = 0;
+ mUsedPixelSamplerRange = std::max(samplerIndex + 1, mUsedPixelSamplerRange);
}
else
{
@@ -1729,13 +1884,16 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
}
}
- if (mConstantTableVS->GetConstantByName(NULL, constantDescription.Name) != NULL)
+ if (vsConstant)
{
+ unsigned int samplerIndex = mConstantTableVS->GetSamplerIndex(vsConstant) + i;
+
if (samplerIndex < getContext()->getMaximumVertexTextureImageUnits())
{
mSamplersVS[samplerIndex].active = true;
mSamplersVS[samplerIndex].textureType = (constantDescription.Type == D3DXPT_SAMPLERCUBE) ? TEXTURE_CUBE : TEXTURE_2D;
mSamplersVS[samplerIndex].logicalTextureUnit = 0;
+ mUsedVertexSamplerRange = std::max(samplerIndex + 1, mUsedVertexSamplerRange);
}
else
{
@@ -1784,9 +1942,9 @@ bool Program::defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT
}
}
-bool Program::defineUniform(const D3DXCONSTANT_DESC &constantDescription, std::string &name)
+bool Program::defineUniform(const D3DXCONSTANT_DESC &constantDescription, std::string &_name)
{
- Uniform *uniform = createUniform(constantDescription, name);
+ Uniform *uniform = createUniform(constantDescription, _name);
if(!uniform)
{
@@ -1794,7 +1952,7 @@ bool Program::defineUniform(const D3DXCONSTANT_DESC &constantDescription, std::s
}
// Check if already defined
- GLint location = getUniformLocation(name.c_str(), true);
+ GLint location = getUniformLocation(uniform->name);
GLenum type = uniform->type;
if (location >= 0)
@@ -1811,18 +1969,21 @@ bool Program::defineUniform(const D3DXCONSTANT_DESC &constantDescription, std::s
}
}
+ initializeConstantHandles(uniform, &uniform->ps, mConstantTablePS);
+ initializeConstantHandles(uniform, &uniform->vs, mConstantTableVS);
+
mUniforms.push_back(uniform);
unsigned int uniformIndex = mUniforms.size() - 1;
for (unsigned int i = 0; i < uniform->arraySize; ++i)
{
- mUniformIndex.push_back(UniformLocation(name, i, uniformIndex));
+ mUniformIndex.push_back(UniformLocation(_name, i, uniformIndex));
}
return true;
}
-Uniform *Program::createUniform(const D3DXCONSTANT_DESC &constantDescription, std::string &name)
+Uniform *Program::createUniform(const D3DXCONSTANT_DESC &constantDescription, std::string &_name)
{
if (constantDescription.Rows == 1) // Vectors and scalars
{
@@ -1831,44 +1992,44 @@ Uniform *Program::createUniform(const D3DXCONSTANT_DESC &constantDescription, st
case D3DXPT_SAMPLER2D:
switch (constantDescription.Columns)
{
- case 1: return new Uniform(GL_SAMPLER_2D, name, constantDescription.Elements);
+ case 1: return new Uniform(GL_SAMPLER_2D, _name, constantDescription.Elements);
default: UNREACHABLE();
}
break;
case D3DXPT_SAMPLERCUBE:
switch (constantDescription.Columns)
{
- case 1: return new Uniform(GL_SAMPLER_CUBE, name, constantDescription.Elements);
+ case 1: return new Uniform(GL_SAMPLER_CUBE, _name, constantDescription.Elements);
default: UNREACHABLE();
}
break;
case D3DXPT_BOOL:
switch (constantDescription.Columns)
{
- case 1: return new Uniform(GL_BOOL, name, constantDescription.Elements);
- case 2: return new Uniform(GL_BOOL_VEC2, name, constantDescription.Elements);
- case 3: return new Uniform(GL_BOOL_VEC3, name, constantDescription.Elements);
- case 4: return new Uniform(GL_BOOL_VEC4, name, constantDescription.Elements);
+ case 1: return new Uniform(GL_BOOL, _name, constantDescription.Elements);
+ case 2: return new Uniform(GL_BOOL_VEC2, _name, constantDescription.Elements);
+ case 3: return new Uniform(GL_BOOL_VEC3, _name, constantDescription.Elements);
+ case 4: return new Uniform(GL_BOOL_VEC4, _name, constantDescription.Elements);
default: UNREACHABLE();
}
break;
case D3DXPT_INT:
switch (constantDescription.Columns)
{
- case 1: return new Uniform(GL_INT, name, constantDescription.Elements);
- case 2: return new Uniform(GL_INT_VEC2, name, constantDescription.Elements);
- case 3: return new Uniform(GL_INT_VEC3, name, constantDescription.Elements);
- case 4: return new Uniform(GL_INT_VEC4, name, constantDescription.Elements);
+ case 1: return new Uniform(GL_INT, _name, constantDescription.Elements);
+ case 2: return new Uniform(GL_INT_VEC2, _name, constantDescription.Elements);
+ case 3: return new Uniform(GL_INT_VEC3, _name, constantDescription.Elements);
+ case 4: return new Uniform(GL_INT_VEC4, _name, constantDescription.Elements);
default: UNREACHABLE();
}
break;
case D3DXPT_FLOAT:
switch (constantDescription.Columns)
{
- case 1: return new Uniform(GL_FLOAT, name, constantDescription.Elements);
- case 2: return new Uniform(GL_FLOAT_VEC2, name, constantDescription.Elements);
- case 3: return new Uniform(GL_FLOAT_VEC3, name, constantDescription.Elements);
- case 4: return new Uniform(GL_FLOAT_VEC4, name, constantDescription.Elements);
+ case 1: return new Uniform(GL_FLOAT, _name, constantDescription.Elements);
+ case 2: return new Uniform(GL_FLOAT_VEC2, _name, constantDescription.Elements);
+ case 3: return new Uniform(GL_FLOAT_VEC3, _name, constantDescription.Elements);
+ case 4: return new Uniform(GL_FLOAT_VEC4, _name, constantDescription.Elements);
default: UNREACHABLE();
}
break;
@@ -1883,9 +2044,9 @@ Uniform *Program::createUniform(const D3DXCONSTANT_DESC &constantDescription, st
case D3DXPT_FLOAT:
switch (constantDescription.Rows)
{
- case 2: return new Uniform(GL_FLOAT_MAT2, name, constantDescription.Elements);
- case 3: return new Uniform(GL_FLOAT_MAT3, name, constantDescription.Elements);
- case 4: return new Uniform(GL_FLOAT_MAT4, name, constantDescription.Elements);
+ case 2: return new Uniform(GL_FLOAT_MAT2, _name, constantDescription.Elements);
+ case 3: return new Uniform(GL_FLOAT_MAT3, _name, constantDescription.Elements);
+ case 4: return new Uniform(GL_FLOAT_MAT4, _name, constantDescription.Elements);
default: UNREACHABLE();
}
break;
@@ -1898,406 +2059,125 @@ Uniform *Program::createUniform(const D3DXCONSTANT_DESC &constantDescription, st
}
// This method needs to match OutputHLSL::decorate
-std::string Program::decorate(const std::string &string)
+std::string Program::decorateAttribute(const std::string &name)
{
- if (string.substr(0, 3) != "gl_" && string.substr(0, 3) != "dx_")
- {
- return "_" + string;
- }
- else
- {
- return string;
- }
-}
-
-std::string Program::undecorate(const std::string &string)
-{
- if (string.substr(0, 1) == "_")
- {
- return string.substr(1);
- }
- else
- {
- return string;
- }
-}
-
-bool Program::applyUniform1bv(GLint location, GLsizei count, const GLboolean *v)
-{
- BOOL *vector = new BOOL[count];
- for (int i = 0; i < count; i++)
- {
- if (v[i] == GL_FALSE)
- vector[i] = 0;
- else
- vector[i] = 1;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
-
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
+ if (name.compare(0, 3, "gl_") != 0 && name.compare(0, 3, "dx_") != 0)
{
- mConstantTablePS->SetBoolArray(device, constantPS, vector, count);
+ return "_" + name;
}
-
- if (constantVS)
- {
- mConstantTableVS->SetBoolArray(device, constantVS, vector, count);
- }
-
- delete [] vector;
-
- return true;
+
+ return name;
}
-bool Program::applyUniform2bv(GLint location, GLsizei count, const GLboolean *v)
+std::string Program::undecorateUniform(const std::string &_name)
{
- D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
-
- for (int i = 0; i < count; i++)
- {
- vector[i] = D3DXVECTOR4((v[0] == GL_FALSE ? 0.0f : 1.0f),
- (v[1] == GL_FALSE ? 0.0f : 1.0f), 0, 0);
-
- v += 2;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
+ if (_name[0] == '_')
{
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
+ return _name.substr(1);
}
-
- if (constantVS)
+ else if (_name.compare(0, 3, "ar_") == 0)
{
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
+ return _name.substr(3);
}
-
- delete[] vector;
-
- return true;
+
+ return _name;
}
-bool Program::applyUniform3bv(GLint location, GLsizei count, const GLboolean *v)
+void Program::applyUniformnbv(Uniform *targetUniform, GLsizei count, int width, const GLboolean *v)
{
- D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
+ float *vector = NULL;
+ BOOL *boolVector = NULL;
- for (int i = 0; i < count; i++)
+ if (targetUniform->ps.registerCount && targetUniform->ps.registerSet == D3DXRS_FLOAT4 ||
+ targetUniform->vs.registerCount && targetUniform->vs.registerSet == D3DXRS_FLOAT4)
{
- vector[i] = D3DXVECTOR4((v[0] == GL_FALSE ? 0.0f : 1.0f),
- (v[1] == GL_FALSE ? 0.0f : 1.0f),
- (v[2] == GL_FALSE ? 0.0f : 1.0f), 0);
-
- v += 3;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
+ vector = new float[4 * count];
- if (constantPS)
- {
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
+ for (int i = 0; i < count; i++)
+ {
+ for (int j = 0; j < 4; j++)
+ {
+ if (j < width)
+ {
+ vector[i * 4 + j] = (v[i * width + j] == GL_FALSE) ? 0.0f : 1.0f;
+ }
+ else
+ {
+ vector[i * 4 + j] = 0.0f;
+ }
+ }
+ }
}
- delete[] vector;
-
- return true;
-}
-
-bool Program::applyUniform4bv(GLint location, GLsizei count, const GLboolean *v)
-{
- D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
-
- for (int i = 0; i < count; i++)
+ if (targetUniform->ps.registerCount && targetUniform->ps.registerSet == D3DXRS_BOOL ||
+ targetUniform->vs.registerCount && targetUniform->vs.registerSet == D3DXRS_BOOL)
{
- vector[i] = D3DXVECTOR4((v[0] == GL_FALSE ? 0.0f : 1.0f),
- (v[1] == GL_FALSE ? 0.0f : 1.0f),
- (v[2] == GL_FALSE ? 0.0f : 1.0f),
- (v[3] == GL_FALSE ? 0.0f : 1.0f));
-
- v += 3;
+ boolVector = new BOOL[count * width];
+ for (int i = 0; i < count * width; i++)
+ {
+ boolVector[i] = v[i] != GL_FALSE;
+ }
}
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
+ if (targetUniform->ps.registerCount)
{
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
+ if (targetUniform->ps.registerSet == D3DXRS_FLOAT4)
+ {
+ mDevice->SetPixelShaderConstantF(targetUniform->ps.registerIndex, vector, targetUniform->ps.registerCount);
+ }
+ else if (targetUniform->ps.registerSet == D3DXRS_BOOL)
+ {
+ mDevice->SetPixelShaderConstantB(targetUniform->ps.registerIndex, boolVector, targetUniform->ps.registerCount);
+ }
+ else UNREACHABLE();
}
- if (constantVS)
+ if (targetUniform->vs.registerCount)
{
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
+ if (targetUniform->vs.registerSet == D3DXRS_FLOAT4)
+ {
+ mDevice->SetVertexShaderConstantF(targetUniform->vs.registerIndex, vector, targetUniform->vs.registerCount);
+ }
+ else if (targetUniform->vs.registerSet == D3DXRS_BOOL)
+ {
+ mDevice->SetVertexShaderConstantB(targetUniform->vs.registerIndex, boolVector, targetUniform->vs.registerCount);
+ }
+ else UNREACHABLE();
}
delete [] vector;
-
- return true;
+ delete [] boolVector;
}
-bool Program::applyUniform1fv(GLint location, GLsizei count, const GLfloat *v)
+bool Program::applyUniformnfv(Uniform *targetUniform, const GLfloat *v)
{
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetFloatArray(device, constantPS, v, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetFloatArray(device, constantVS, v, count);
- }
-
- return true;
-}
-
-bool Program::applyUniform2fv(GLint location, GLsizei count, const GLfloat *v)
-{
- D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
-
- for (int i = 0; i < count; i++)
- {
- vector[i] = D3DXVECTOR4(v[0], v[1], 0, 0);
-
- v += 2;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
+ if (targetUniform->ps.registerCount)
{
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
+ mDevice->SetPixelShaderConstantF(targetUniform->ps.registerIndex, v, targetUniform->ps.registerCount);
}
- if (constantVS)
+ if (targetUniform->vs.registerCount)
{
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
+ mDevice->SetVertexShaderConstantF(targetUniform->vs.registerIndex, v, targetUniform->vs.registerCount);
}
- delete[] vector;
-
return true;
}
-bool Program::applyUniform3fv(GLint location, GLsizei count, const GLfloat *v)
+bool Program::applyUniform1iv(Uniform *targetUniform, GLsizei count, const GLint *v)
{
D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
for (int i = 0; i < count; i++)
{
- vector[i] = D3DXVECTOR4(v[0], v[1], v[2], 0);
-
- v += 3;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
- }
-
- delete[] vector;
-
- return true;
-}
-
-bool Program::applyUniform4fv(GLint location, GLsizei count, const GLfloat *v)
-{
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetVectorArray(device, constantPS, (D3DXVECTOR4*)v, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetVectorArray(device, constantVS, (D3DXVECTOR4*)v, count);
- }
-
- return true;
-}
-
-bool Program::applyUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value)
-{
- D3DXMATRIX *matrix = new D3DXMATRIX[count];
-
- for (int i = 0; i < count; i++)
- {
- matrix[i] = D3DXMATRIX(value[0], value[2], 0, 0,
- value[1], value[3], 0, 0,
- 0, 0, 1, 0,
- 0, 0, 0, 1);
-
- value += 4;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetMatrixTransposeArray(device, constantPS, matrix, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetMatrixTransposeArray(device, constantVS, matrix, count);
- }
-
- delete[] matrix;
-
- return true;
-}
-
-bool Program::applyUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *value)
-{
- D3DXMATRIX *matrix = new D3DXMATRIX[count];
-
- for (int i = 0; i < count; i++)
- {
- matrix[i] = D3DXMATRIX(value[0], value[3], value[6], 0,
- value[1], value[4], value[7], 0,
- value[2], value[5], value[8], 0,
- 0, 0, 0, 1);
-
- value += 9;
- }
-
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetMatrixTransposeArray(device, constantPS, matrix, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetMatrixTransposeArray(device, constantVS, matrix, count);
- }
-
- delete[] matrix;
-
- return true;
-}
-
-bool Program::applyUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value)
-{
- D3DXMATRIX *matrix = new D3DXMATRIX[count];
-
- for (int i = 0; i < count; i++)
- {
- matrix[i] = D3DXMATRIX(value[0], value[4], value[8], value[12],
- value[1], value[5], value[9], value[13],
- value[2], value[6], value[10], value[14],
- value[3], value[7], value[11], value[15]);
-
- value += 16;
+ vector[i] = D3DXVECTOR4((float)v[i], 0, 0, 0);
}
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetMatrixTransposeArray(device, constantPS, matrix, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetMatrixTransposeArray(device, constantVS, matrix, count);
- }
-
- delete[] matrix;
-
- return true;
-}
-
-bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
-{
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
+ if (targetUniform->ps.registerCount)
{
- D3DXCONSTANT_DESC constantDescription;
- UINT descriptionCount = 1;
- HRESULT result = mConstantTablePS->GetConstantDesc(constantPS, &constantDescription, &descriptionCount);
- ASSERT(SUCCEEDED(result));
-
- if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
+ if (targetUniform->ps.registerSet == D3DXRS_SAMPLER)
{
- unsigned int firstIndex = mConstantTablePS->GetSamplerIndex(constantPS);
+ unsigned int firstIndex = targetUniform->ps.registerIndex;
for (int i = 0; i < count; i++)
{
@@ -2312,20 +2192,16 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
}
else
{
- mConstantTablePS->SetIntArray(device, constantPS, v, count);
+ ASSERT(targetUniform->ps.registerSet == D3DXRS_FLOAT4);
+ mDevice->SetPixelShaderConstantF(targetUniform->ps.registerIndex, (const float*)vector, targetUniform->ps.registerCount);
}
}
- if (constantVS)
+ if (targetUniform->vs.registerCount)
{
- D3DXCONSTANT_DESC constantDescription;
- UINT descriptionCount = 1;
- HRESULT result = mConstantTableVS->GetConstantDesc(constantVS, &constantDescription, &descriptionCount);
- ASSERT(SUCCEEDED(result));
-
- if (constantDescription.RegisterSet == D3DXRS_SAMPLER)
+ if (targetUniform->vs.registerSet == D3DXRS_SAMPLER)
{
- unsigned int firstIndex = mConstantTableVS->GetSamplerIndex(constantVS);
+ unsigned int firstIndex = targetUniform->vs.registerIndex;
for (int i = 0; i < count; i++)
{
@@ -2340,14 +2216,17 @@ bool Program::applyUniform1iv(GLint location, GLsizei count, const GLint *v)
}
else
{
- mConstantTableVS->SetIntArray(device, constantVS, v, count);
+ ASSERT(targetUniform->vs.registerSet == D3DXRS_FLOAT4);
+ mDevice->SetVertexShaderConstantF(targetUniform->vs.registerIndex, (const float *)vector, targetUniform->vs.registerCount);
}
}
+ delete [] vector;
+
return true;
}
-bool Program::applyUniform2iv(GLint location, GLsizei count, const GLint *v)
+bool Program::applyUniform2iv(Uniform *targetUniform, GLsizei count, const GLint *v)
{
D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
@@ -2358,29 +2237,14 @@ bool Program::applyUniform2iv(GLint location, GLsizei count, const GLint *v)
v += 2;
}
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
- }
+ applyUniformniv(targetUniform, count, vector);
delete[] vector;
return true;
}
-bool Program::applyUniform3iv(GLint location, GLsizei count, const GLint *v)
+bool Program::applyUniform3iv(Uniform *targetUniform, GLsizei count, const GLint *v)
{
D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
@@ -2391,29 +2255,14 @@ bool Program::applyUniform3iv(GLint location, GLsizei count, const GLint *v)
v += 3;
}
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
-
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
-
- if (constantPS)
- {
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
- }
-
- if (constantVS)
- {
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
- }
+ applyUniformniv(targetUniform, count, vector);
delete[] vector;
return true;
}
-bool Program::applyUniform4iv(GLint location, GLsizei count, const GLint *v)
+bool Program::applyUniform4iv(Uniform *targetUniform, GLsizei count, const GLint *v)
{
D3DXVECTOR4 *vector = new D3DXVECTOR4[count];
@@ -2424,53 +2273,45 @@ bool Program::applyUniform4iv(GLint location, GLsizei count, const GLint *v)
v += 4;
}
- Uniform *targetUniform = mUniforms[mUniformIndex[location].index];
+ applyUniformniv(targetUniform, count, vector);
- D3DXHANDLE constantPS;
- D3DXHANDLE constantVS;
- getConstantHandles(targetUniform, &constantPS, &constantVS);
- IDirect3DDevice9 *device = getDevice();
+ delete [] vector;
+
+ return true;
+}
- if (constantPS)
+void Program::applyUniformniv(Uniform *targetUniform, GLsizei count, const D3DXVECTOR4 *vector)
+{
+ if (targetUniform->ps.registerCount)
{
- mConstantTablePS->SetVectorArray(device, constantPS, vector, count);
+ ASSERT(targetUniform->ps.registerSet == D3DXRS_FLOAT4);
+ mDevice->SetPixelShaderConstantF(targetUniform->ps.registerIndex, (const float *)vector, targetUniform->ps.registerCount);
}
- if (constantVS)
+ if (targetUniform->vs.registerCount)
{
- mConstantTableVS->SetVectorArray(device, constantVS, vector, count);
+ ASSERT(targetUniform->vs.registerSet == D3DXRS_FLOAT4);
+ mDevice->SetVertexShaderConstantF(targetUniform->vs.registerIndex, (const float *)vector, targetUniform->vs.registerCount);
}
-
- delete [] vector;
-
- return true;
}
-
// append a santized message to the program info log.
-// The D3D compiler includes the current working directory
-// in some of the warning or error messages, so lets remove
-// any occurrances of those that we find in the log.
+// The D3D compiler includes a fake file path in some of the warning or error
+// messages, so lets remove all occurrences of this fake file path from the log.
void Program::appendToInfoLogSanitized(const char *message)
{
std::string msg(message);
- CHAR path[MAX_PATH] = "";
- size_t len;
- len = GetCurrentDirectoryA(MAX_PATH, path);
- if (len > 0 && len < MAX_PATH)
+ size_t found;
+ do
{
- size_t found;
- do {
- found = msg.find(path);
- if (found != std::string::npos)
- {
- // the +1 here is intentional so that we remove
- // the trailing '\' that occurs after the path
- msg.erase(found, len+1);
- }
- } while (found != std::string::npos);
+ found = msg.find(fakepath);
+ if (found != std::string::npos)
+ {
+ msg.erase(found, strlen(fakepath));
+ }
}
+ while (found != std::string::npos);
appendToInfoLog("%s\n", msg.c_str());
}
@@ -2517,7 +2358,7 @@ void Program::resetInfoLog()
}
}
-// Returns the program object to an unlinked state, after detaching a shader, before re-linking, or at destruction
+// Returns the program object to an unlinked state, before re-linking, or at destruction
void Program::unlink(bool destroy)
{
if (destroy) // Object being destructed
@@ -2575,6 +2416,9 @@ void Program::unlink(bool destroy)
mSamplersVS[index].active = false;
}
+ mUsedVertexSamplerRange = 0;
+ mUsedPixelSamplerRange = 0;
+
while (!mUniforms.empty())
{
delete mUniforms.back();
@@ -2583,7 +2427,7 @@ void Program::unlink(bool destroy)
mDxDepthRangeLocation = -1;
mDxDepthLocation = -1;
- mDxViewportLocation = -1;
+ mDxCoordLocation = -1;
mDxHalfPixelSizeLocation = -1;
mDxFrontCCWLocation = -1;
mDxPointsOrLinesLocation = -1;
@@ -2780,7 +2624,7 @@ void Program::getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, G
unsigned int uniform;
for (uniform = 0; uniform < mUniforms.size(); uniform++)
{
- if (mUniforms[uniform]->name.substr(0, 3) == "dx_")
+ if (mUniforms[uniform]->name.compare(0, 3, "dx_") == 0)
{
continue;
}
@@ -2797,9 +2641,9 @@ void Program::getActiveUniform(GLuint index, GLsizei bufsize, GLsizei *length, G
if (bufsize > 0)
{
- std::string string = undecorate(mUniforms[uniform]->name);
+ std::string string = mUniforms[uniform]->name;
- if (mUniforms[uniform]->arraySize != 1)
+ if (mUniforms[uniform]->isArray())
{
string += "[0]";
}
@@ -2825,7 +2669,7 @@ GLint Program::getActiveUniformCount()
unsigned int numUniforms = mUniforms.size();
for (unsigned int uniformIndex = 0; uniformIndex < numUniforms; uniformIndex++)
{
- if (mUniforms[uniformIndex]->name.substr(0, 3) != "dx_")
+ if (mUniforms[uniformIndex]->name.compare(0, 3, "dx_") != 0)
{
count++;
}
@@ -2841,10 +2685,10 @@ GLint Program::getActiveUniformMaxLength()
unsigned int numUniforms = mUniforms.size();
for (unsigned int uniformIndex = 0; uniformIndex < numUniforms; uniformIndex++)
{
- if (!mUniforms[uniformIndex]->name.empty() && mUniforms[uniformIndex]->name.substr(0, 3) != "dx_")
+ if (!mUniforms[uniformIndex]->name.empty() && mUniforms[uniformIndex]->name.compare(0, 3, "dx_") != 0)
{
- int length = (int)(undecorate(mUniforms[uniformIndex]->name).length() + 1);
- if (mUniforms[uniformIndex]->arraySize != 1)
+ int length = (int)(mUniforms[uniformIndex]->name.length() + 1);
+ if (mUniforms[uniformIndex]->isArray())
{
length += 3; // Counting in "[0]".
}
@@ -2902,7 +2746,7 @@ bool Program::validateSamplers(bool logErrors)
textureUnitType[i] = TEXTURE_UNKNOWN;
}
- for (unsigned int i = 0; i < MAX_TEXTURE_IMAGE_UNITS; ++i)
+ for (unsigned int i = 0; i < mUsedPixelSamplerRange; ++i)
{
if (mSamplersPS[i].active)
{
@@ -2937,7 +2781,7 @@ bool Program::validateSamplers(bool logErrors)
}
}
- for (unsigned int i = 0; i < MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF; ++i)
+ for (unsigned int i = 0; i < mUsedVertexSamplerRange; ++i)
{
if (mSamplersVS[i].active)
{
@@ -2975,17 +2819,23 @@ bool Program::validateSamplers(bool logErrors)
return true;
}
-void Program::getConstantHandles(Uniform *targetUniform, D3DXHANDLE *constantPS, D3DXHANDLE *constantVS)
+void Program::initializeConstantHandles(Uniform *targetUniform, Uniform::RegisterInfo *ri, ID3DXConstantTable *constantTable)
{
- if (!targetUniform->handlesSet)
+ D3DXHANDLE handle = constantTable->GetConstantByName(0, targetUniform->_name.c_str());
+ if (handle)
+ {
+ UINT descriptionCount = 1;
+ D3DXCONSTANT_DESC constantDescription;
+ HRESULT result = constantTable->GetConstantDesc(handle, &constantDescription, &descriptionCount);
+ ASSERT(SUCCEEDED(result));
+ ri->registerIndex = constantDescription.RegisterIndex;
+ ri->registerCount = constantDescription.RegisterCount;
+ ri->registerSet = constantDescription.RegisterSet;
+ }
+ else
{
- targetUniform->psHandle = mConstantTablePS->GetConstantByName(0, targetUniform->name.c_str());
- targetUniform->vsHandle = mConstantTableVS->GetConstantByName(0, targetUniform->name.c_str());
- targetUniform->handlesSet = true;
+ ri->registerCount = 0;
}
-
- *constantPS = targetUniform->psHandle;
- *constantVS = targetUniform->vsHandle;
}
GLint Program::getDxDepthRangeLocation() const
@@ -2998,9 +2848,9 @@ GLint Program::getDxDepthLocation() const
return mDxDepthLocation;
}
-GLint Program::getDxViewportLocation() const
+GLint Program::getDxCoordLocation() const
{
- return mDxViewportLocation;
+ return mDxCoordLocation;
}
GLint Program::getDxHalfPixelSizeLocation() const
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Program.h b/Source/ThirdParty/ANGLE/src/libGLESv2/Program.h
index 8085522eb..77ffd24c4 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Program.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Program.h
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -28,26 +28,35 @@ class VertexShader;
// Helper struct representing a single shader uniform
struct Uniform
{
- Uniform(GLenum type, const std::string &name, unsigned int arraySize);
+ Uniform(GLenum type, const std::string &_name, unsigned int arraySize);
~Uniform();
+ bool isArray();
+
const GLenum type;
- const std::string name;
+ const std::string _name; // Decorated name
+ const std::string name; // Undecorated name
const unsigned int arraySize;
unsigned char *data;
bool dirty;
- D3DXHANDLE vsHandle;
- D3DXHANDLE psHandle;
- bool handlesSet;
+ struct RegisterInfo
+ {
+ int registerSet;
+ int registerIndex;
+ int registerCount;
+ };
+
+ RegisterInfo ps;
+ RegisterInfo vs;
};
// Struct used for correlating uniforms/elements of uniform arrays to handles
struct UniformLocation
{
- UniformLocation(const std::string &name, unsigned int element, unsigned int index);
+ UniformLocation(const std::string &_name, unsigned int element, unsigned int index);
std::string name;
unsigned int element;
@@ -74,8 +83,9 @@ class Program
GLint getSamplerMapping(SamplerType type, unsigned int samplerIndex);
TextureType getSamplerTextureType(SamplerType type, unsigned int samplerIndex);
+ GLint getUsedSamplerRange(SamplerType type);
- GLint getUniformLocation(const char *name, bool decorated);
+ GLint getUniformLocation(std::string name);
bool setUniform1fv(GLint location, GLsizei count, const GLfloat *v);
bool setUniform2fv(GLint location, GLsizei count, const GLfloat *v);
bool setUniform3fv(GLint location, GLsizei count, const GLfloat *v);
@@ -88,12 +98,12 @@ class Program
bool setUniform3iv(GLint location, GLsizei count, const GLint *v);
bool setUniform4iv(GLint location, GLsizei count, const GLint *v);
- bool getUniformfv(GLint location, GLfloat *params);
- bool getUniformiv(GLint location, GLint *params);
+ bool getUniformfv(GLint location, GLsizei *bufSize, GLfloat *params);
+ bool getUniformiv(GLint location, GLsizei *bufSize, GLint *params);
GLint getDxDepthRangeLocation() const;
GLint getDxDepthLocation() const;
- GLint getDxViewportLocation() const;
+ GLint getDxCoordLocation() const;
GLint getDxHalfPixelSizeLocation() const;
GLint getDxFrontCCWLocation() const;
GLint getDxPointsOrLinesLocation() const;
@@ -127,6 +137,9 @@ class Program
unsigned int getSerial() const;
+ static std::string decorateAttribute(const std::string &name); // Prepend an underscore
+ static std::string undecorateUniform(const std::string &_name); // Remove leading underscore
+
private:
DISALLOW_COPY_AND_ASSIGN(Program);
@@ -143,33 +156,23 @@ class Program
bool defineUniform(const D3DXHANDLE &constantHandle, const D3DXCONSTANT_DESC &constantDescription, std::string name = "");
bool defineUniform(const D3DXCONSTANT_DESC &constantDescription, std::string &name);
Uniform *createUniform(const D3DXCONSTANT_DESC &constantDescription, std::string &name);
- bool applyUniform1bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform2bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform3bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform4bv(GLint location, GLsizei count, const GLboolean *v);
- bool applyUniform1fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniform2fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniform3fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniform4fv(GLint location, GLsizei count, const GLfloat *v);
- bool applyUniformMatrix2fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix3fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniformMatrix4fv(GLint location, GLsizei count, const GLfloat *value);
- bool applyUniform1iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform2iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform3iv(GLint location, GLsizei count, const GLint *v);
- bool applyUniform4iv(GLint location, GLsizei count, const GLint *v);
-
- void getConstantHandles(Uniform *targetUniform, D3DXHANDLE *constantPS, D3DXHANDLE *constantVS);
+ bool applyUniformnfv(Uniform *targetUniform, const GLfloat *v);
+ bool applyUniform1iv(Uniform *targetUniform, GLsizei count, const GLint *v);
+ bool applyUniform2iv(Uniform *targetUniform, GLsizei count, const GLint *v);
+ bool applyUniform3iv(Uniform *targetUniform, GLsizei count, const GLint *v);
+ bool applyUniform4iv(Uniform *targetUniform, GLsizei count, const GLint *v);
+ void applyUniformniv(Uniform *targetUniform, GLsizei count, const D3DXVECTOR4 *vector);
+ void applyUniformnbv(Uniform *targetUniform, GLsizei count, int width, const GLboolean *v);
+
+ void initializeConstantHandles(Uniform *targetUniform, Uniform::RegisterInfo *rs, ID3DXConstantTable *constantTable);
void appendToInfoLogSanitized(const char *message);
void appendToInfoLog(const char *info, ...);
void resetInfoLog();
- static std::string decorate(const std::string &string); // Prepend an underscore
- static std::string undecorate(const std::string &string); // Remove leading underscore
-
static unsigned int issueSerial();
+ IDirect3DDevice9 *mDevice;
FragmentShader *mFragmentShader;
VertexShader *mVertexShader;
@@ -194,6 +197,8 @@ class Program
Sampler mSamplersPS[MAX_TEXTURE_IMAGE_UNITS];
Sampler mSamplersVS[MAX_VERTEX_TEXTURE_IMAGE_UNITS_VTF];
+ GLuint mUsedVertexSamplerRange;
+ GLuint mUsedPixelSamplerRange;
typedef std::vector<Uniform*> UniformArray;
UniformArray mUniforms;
@@ -202,7 +207,7 @@ class Program
GLint mDxDepthRangeLocation;
GLint mDxDepthLocation;
- GLint mDxViewportLocation;
+ GLint mDxCoordLocation;
GLint mDxHalfPixelSizeLocation;
GLint mDxFrontCCWLocation;
GLint mDxPointsOrLinesLocation;
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.cpp
index ace8d7b90..6851a375a 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.cpp
@@ -18,103 +18,175 @@ namespace gl
{
unsigned int RenderbufferStorage::mCurrentSerial = 1;
-Renderbuffer::Renderbuffer(GLuint id, RenderbufferStorage *storage) : RefCountObject(id)
+RenderbufferInterface::RenderbufferInterface()
{
- ASSERT(storage != NULL);
- mStorage = storage;
}
-Renderbuffer::~Renderbuffer()
+GLuint RenderbufferInterface::getRedSize() const
+{
+ return dx2es::GetRedSize(getD3DFormat());
+}
+
+GLuint RenderbufferInterface::getGreenSize() const
+{
+ return dx2es::GetGreenSize(getD3DFormat());
+}
+
+GLuint RenderbufferInterface::getBlueSize() const
+{
+ return dx2es::GetBlueSize(getD3DFormat());
+}
+
+GLuint RenderbufferInterface::getAlphaSize() const
+{
+ return dx2es::GetAlphaSize(getD3DFormat());
+}
+
+GLuint RenderbufferInterface::getDepthSize() const
+{
+ return dx2es::GetDepthSize(getD3DFormat());
+}
+
+GLuint RenderbufferInterface::getStencilSize() const
+{
+ return dx2es::GetStencilSize(getD3DFormat());
+}
+
+RenderbufferTexture::RenderbufferTexture(Texture *texture, GLenum target) : mTexture(texture), mTarget(target)
+{
+}
+
+RenderbufferTexture::~RenderbufferTexture()
+{
+}
+
+IDirect3DSurface9 *RenderbufferTexture::getRenderTarget()
{
- delete mStorage;
+ return mTexture->getRenderTarget(mTarget);
+}
+
+IDirect3DSurface9 *RenderbufferTexture::getDepthStencil()
+{
+ return NULL;
}
-bool Renderbuffer::isColorbuffer() const
+GLsizei RenderbufferTexture::getWidth() const
{
- return mStorage->isColorbuffer();
+ return mTexture->getWidth(0);
+}
+
+GLsizei RenderbufferTexture::getHeight() const
+{
+ return mTexture->getHeight(0);
+}
+
+GLenum RenderbufferTexture::getInternalFormat() const
+{
+ return mTexture->getInternalFormat();
}
-bool Renderbuffer::isDepthbuffer() const
+D3DFORMAT RenderbufferTexture::getD3DFormat() const
{
- return mStorage->isDepthbuffer();
+ return mTexture->getD3DFormat();
}
-bool Renderbuffer::isStencilbuffer() const
+GLsizei RenderbufferTexture::getSamples() const
{
- return mStorage->isStencilbuffer();
+ return 0;
+}
+
+unsigned int RenderbufferTexture::getSerial() const
+{
+ return mTexture->getRenderTargetSerial(mTarget);
+}
+
+Renderbuffer::Renderbuffer(GLuint id, RenderbufferInterface *instance) : RefCountObject(id)
+{
+ ASSERT(instance != NULL);
+ mInstance = instance;
+}
+
+Renderbuffer::~Renderbuffer()
+{
+ delete mInstance;
}
IDirect3DSurface9 *Renderbuffer::getRenderTarget()
{
- return mStorage->getRenderTarget();
+ return mInstance->getRenderTarget();
}
IDirect3DSurface9 *Renderbuffer::getDepthStencil()
{
- return mStorage->getDepthStencil();
+ return mInstance->getDepthStencil();
}
GLsizei Renderbuffer::getWidth() const
{
- return mStorage->getWidth();
+ return mInstance->getWidth();
}
GLsizei Renderbuffer::getHeight() const
{
- return mStorage->getHeight();
+ return mInstance->getHeight();
}
GLenum Renderbuffer::getInternalFormat() const
{
- return mStorage->getInternalFormat();
+ return mInstance->getInternalFormat();
+}
+
+D3DFORMAT Renderbuffer::getD3DFormat() const
+{
+ return mInstance->getD3DFormat();
}
GLuint Renderbuffer::getRedSize() const
{
- return mStorage->getRedSize();
+ return mInstance->getRedSize();
}
GLuint Renderbuffer::getGreenSize() const
{
- return mStorage->getGreenSize();
+ return mInstance->getGreenSize();
}
GLuint Renderbuffer::getBlueSize() const
{
- return mStorage->getBlueSize();
+ return mInstance->getBlueSize();
}
GLuint Renderbuffer::getAlphaSize() const
{
- return mStorage->getAlphaSize();
+ return mInstance->getAlphaSize();
}
GLuint Renderbuffer::getDepthSize() const
{
- return mStorage->getDepthSize();
+ return mInstance->getDepthSize();
}
GLuint Renderbuffer::getStencilSize() const
{
- return mStorage->getStencilSize();
+ return mInstance->getStencilSize();
}
GLsizei Renderbuffer::getSamples() const
{
- return mStorage->getSamples();
+ return mInstance->getSamples();
}
unsigned int Renderbuffer::getSerial() const
{
- return mStorage->getSerial();
+ return mInstance->getSerial();
}
void Renderbuffer::setStorage(RenderbufferStorage *newStorage)
{
ASSERT(newStorage != NULL);
- delete mStorage;
- mStorage = newStorage;
+ delete mInstance;
+ mInstance = newStorage;
}
RenderbufferStorage::RenderbufferStorage() : mSerial(issueSerial())
@@ -130,21 +202,6 @@ RenderbufferStorage::~RenderbufferStorage()
{
}
-bool RenderbufferStorage::isColorbuffer() const
-{
- return false;
-}
-
-bool RenderbufferStorage::isDepthbuffer() const
-{
- return false;
-}
-
-bool RenderbufferStorage::isStencilbuffer() const
-{
- return false;
-}
-
IDirect3DSurface9 *RenderbufferStorage::getRenderTarget()
{
return NULL;
@@ -170,34 +227,9 @@ GLenum RenderbufferStorage::getInternalFormat() const
return mInternalFormat;
}
-GLuint RenderbufferStorage::getRedSize() const
-{
- return dx2es::GetRedSize(getD3DFormat());
-}
-
-GLuint RenderbufferStorage::getGreenSize() const
-{
- return dx2es::GetGreenSize(getD3DFormat());
-}
-
-GLuint RenderbufferStorage::getBlueSize() const
-{
- return dx2es::GetBlueSize(getD3DFormat());
-}
-
-GLuint RenderbufferStorage::getAlphaSize() const
-{
- return dx2es::GetAlphaSize(getD3DFormat());
-}
-
-GLuint RenderbufferStorage::getDepthSize() const
-{
- return dx2es::GetDepthSize(getD3DFormat());
-}
-
-GLuint RenderbufferStorage::getStencilSize() const
+D3DFORMAT RenderbufferStorage::getD3DFormat() const
{
- return dx2es::GetStencilSize(getD3DFormat());
+ return mD3DFormat;
}
GLsizei RenderbufferStorage::getSamples() const
@@ -205,11 +237,6 @@ GLsizei RenderbufferStorage::getSamples() const
return mSamples;
}
-D3DFORMAT RenderbufferStorage::getD3DFormat() const
-{
- return mD3DFormat;
-}
-
unsigned int RenderbufferStorage::getSerial() const
{
return mSerial;
@@ -220,7 +247,14 @@ unsigned int RenderbufferStorage::issueSerial()
return mCurrentSerial++;
}
-Colorbuffer::Colorbuffer(IDirect3DSurface9 *renderTarget) : mRenderTarget(renderTarget), mTexture(NULL)
+unsigned int RenderbufferStorage::issueCubeSerials()
+{
+ unsigned int firstSerial = mCurrentSerial;
+ mCurrentSerial += 6;
+ return firstSerial;
+}
+
+Colorbuffer::Colorbuffer(IDirect3DSurface9 *renderTarget) : mRenderTarget(renderTarget)
{
if (renderTarget)
{
@@ -237,21 +271,7 @@ Colorbuffer::Colorbuffer(IDirect3DSurface9 *renderTarget) : mRenderTarget(render
}
}
-Colorbuffer::Colorbuffer(Texture *texture, GLenum target) : mRenderTarget(NULL), mTexture(texture), mTarget(target)
-{
- if (texture)
- {
- mWidth = texture->getWidth();
- mHeight = texture->getHeight();
- mInternalFormat = texture->getInternalFormat();
- mD3DFormat = texture->getD3DFormat();
- mSamples = 0;
-
- mRenderTarget = texture->getRenderTarget(target);
- }
-}
-
-Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) : mRenderTarget(NULL), mTexture(NULL)
+Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) : mRenderTarget(NULL)
{
IDirect3DDevice9 *device = getDevice();
@@ -295,71 +315,11 @@ Colorbuffer::~Colorbuffer()
}
}
-GLsizei Colorbuffer::getWidth() const
-{
- if (mTexture)
- {
- return mTexture->getWidth();
- }
-
- return mWidth;
-}
-
-GLsizei Colorbuffer::getHeight() const
-{
- if (mTexture)
- {
- return mTexture->getHeight();
- }
-
- return mHeight;
-}
-
-GLenum Colorbuffer::getInternalFormat() const
-{
- if (mTexture)
- {
- return mTexture->getInternalFormat();
- }
-
- return mInternalFormat;
-}
-
-GLenum Colorbuffer::getType() const
-{
- if (mTexture)
- {
- return mTexture->getType();
- }
-
- return GL_UNSIGNED_BYTE;
-}
-
-D3DFORMAT Colorbuffer::getD3DFormat() const
-{
- if (mTexture)
- {
- return mTexture->getD3DFormat();
- }
-
- return mD3DFormat;
-}
-
-bool Colorbuffer::isColorbuffer() const
-{
- return true;
-}
-
IDirect3DSurface9 *Colorbuffer::getRenderTarget()
{
- if (mTexture)
+ if (mRenderTarget)
{
- if (mRenderTarget)
- {
- mRenderTarget->Release();
- }
-
- mRenderTarget = mTexture->getRenderTarget(mTarget);
+ mRenderTarget->AddRef();
}
return mRenderTarget;
@@ -427,16 +387,6 @@ DepthStencilbuffer::~DepthStencilbuffer()
}
}
-bool DepthStencilbuffer::isDepthbuffer() const
-{
- return true;
-}
-
-bool DepthStencilbuffer::isStencilbuffer() const
-{
- return true;
-}
-
IDirect3DSurface9 *DepthStencilbuffer::getDepthStencil()
{
return mDepthStencil;
@@ -454,7 +404,7 @@ Depthbuffer::Depthbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuffer(d
Depthbuffer::Depthbuffer(int width, int height, GLsizei samples) : DepthStencilbuffer(width, height, samples)
{
- if (getDepthStencil())
+ if (mDepthStencil)
{
mInternalFormat = GL_DEPTH_COMPONENT16; // If the renderbuffer parameters are queried, the calling function
// will expect one of the valid renderbuffer formats for use in
@@ -466,16 +416,6 @@ Depthbuffer::~Depthbuffer()
{
}
-bool Depthbuffer::isDepthbuffer() const
-{
- return true;
-}
-
-bool Depthbuffer::isStencilbuffer() const
-{
- return false;
-}
-
Stencilbuffer::Stencilbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuffer(depthStencil)
{
if (depthStencil)
@@ -488,7 +428,7 @@ Stencilbuffer::Stencilbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuff
Stencilbuffer::Stencilbuffer(int width, int height, GLsizei samples) : DepthStencilbuffer(width, height, samples)
{
- if (getDepthStencil())
+ if (mDepthStencil)
{
mInternalFormat = GL_STENCIL_INDEX8; // If the renderbuffer parameters are queried, the calling function
// will expect one of the valid renderbuffer formats for use in
@@ -500,13 +440,4 @@ Stencilbuffer::~Stencilbuffer()
{
}
-bool Stencilbuffer::isDepthbuffer() const
-{
- return false;
-}
-
-bool Stencilbuffer::isStencilbuffer() const
-{
- return true;
-}
}
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.h b/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.h
index 5cf829c70..e854775d9 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Renderbuffer.h
@@ -22,38 +22,86 @@
namespace gl
{
class Texture;
+class Colorbuffer;
+class DepthStencilbuffer;
+
+class RenderbufferInterface
+{
+ public:
+ RenderbufferInterface();
+
+ virtual ~RenderbufferInterface() {};
+
+ virtual IDirect3DSurface9 *getRenderTarget() = 0;
+ virtual IDirect3DSurface9 *getDepthStencil() = 0;
+
+ virtual GLsizei getWidth() const = 0;
+ virtual GLsizei getHeight() const = 0;
+ virtual GLenum getInternalFormat() const = 0;
+ virtual D3DFORMAT getD3DFormat() const = 0;
+ virtual GLsizei getSamples() const = 0;
+
+ GLuint getRedSize() const;
+ GLuint getGreenSize() const;
+ GLuint getBlueSize() const;
+ GLuint getAlphaSize() const;
+ GLuint getDepthSize() const;
+ GLuint getStencilSize() const;
+
+ virtual unsigned int getSerial() const = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RenderbufferInterface);
+};
+
+class RenderbufferTexture : public RenderbufferInterface
+{
+ public:
+ RenderbufferTexture(Texture *texture, GLenum target);
+
+ virtual ~RenderbufferTexture();
+
+ IDirect3DSurface9 *getRenderTarget();
+ IDirect3DSurface9 *getDepthStencil();
+
+ virtual GLsizei getWidth() const;
+ virtual GLsizei getHeight() const;
+ virtual GLenum getInternalFormat() const;
+ virtual D3DFORMAT getD3DFormat() const;
+ virtual GLsizei getSamples() const;
+
+ virtual unsigned int getSerial() const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(RenderbufferTexture);
+
+ Texture *mTexture;
+ GLenum mTarget;
+};
// A class derived from RenderbufferStorage is created whenever glRenderbufferStorage
// is called. The specific concrete type depends on whether the internal format is
// colour depth, stencil or packed depth/stencil.
-class RenderbufferStorage
+class RenderbufferStorage : public RenderbufferInterface
{
public:
RenderbufferStorage();
virtual ~RenderbufferStorage() = 0;
- virtual bool isColorbuffer() const;
- virtual bool isDepthbuffer() const;
- virtual bool isStencilbuffer() const;
-
virtual IDirect3DSurface9 *getRenderTarget();
virtual IDirect3DSurface9 *getDepthStencil();
virtual GLsizei getWidth() const;
virtual GLsizei getHeight() const;
virtual GLenum getInternalFormat() const;
- GLuint getRedSize() const;
- GLuint getGreenSize() const;
- GLuint getBlueSize() const;
- GLuint getAlphaSize() const;
- GLuint getDepthSize() const;
- GLuint getStencilSize() const;
+ virtual D3DFORMAT getD3DFormat() const;
virtual GLsizei getSamples() const;
- virtual D3DFORMAT getD3DFormat() const;
+ virtual unsigned int getSerial() const;
- unsigned int getSerial() const;
+ static unsigned int issueSerial();
+ static unsigned int issueCubeSerials();
protected:
GLsizei mWidth;
@@ -65,26 +113,20 @@ class RenderbufferStorage
private:
DISALLOW_COPY_AND_ASSIGN(RenderbufferStorage);
- static unsigned int issueSerial();
-
const unsigned int mSerial;
static unsigned int mCurrentSerial;
};
// Renderbuffer implements the GL renderbuffer object.
-// It's only a proxy for a RenderbufferStorage instance; the internal object
+// It's only a proxy for a RenderbufferInterface instance; the internal object
// can change whenever glRenderbufferStorage is called.
class Renderbuffer : public RefCountObject
{
public:
- Renderbuffer(GLuint id, RenderbufferStorage *storage);
-
- ~Renderbuffer();
+ Renderbuffer(GLuint id, RenderbufferInterface *storage);
- bool isColorbuffer() const;
- bool isDepthbuffer() const;
- bool isStencilbuffer() const;
+ virtual ~Renderbuffer();
IDirect3DSurface9 *getRenderTarget();
IDirect3DSurface9 *getDepthStencil();
@@ -104,40 +146,27 @@ class Renderbuffer : public RefCountObject
unsigned int getSerial() const;
void setStorage(RenderbufferStorage *newStorage);
- RenderbufferStorage *getStorage() { return mStorage; }
private:
DISALLOW_COPY_AND_ASSIGN(Renderbuffer);
- RenderbufferStorage *mStorage;
+ RenderbufferInterface *mInstance;
};
class Colorbuffer : public RenderbufferStorage
{
public:
explicit Colorbuffer(IDirect3DSurface9 *renderTarget);
- Colorbuffer(Texture *texture, GLenum target);
Colorbuffer(GLsizei width, GLsizei height, GLenum format, GLsizei samples);
virtual ~Colorbuffer();
- virtual bool isColorbuffer() const;
-
virtual IDirect3DSurface9 *getRenderTarget();
- virtual GLsizei getWidth() const;
- virtual GLsizei getHeight() const;
- virtual GLenum getInternalFormat() const;
- virtual GLenum getType() const;
-
- virtual D3DFORMAT getD3DFormat() const;
-
private:
DISALLOW_COPY_AND_ASSIGN(Colorbuffer);
IDirect3DSurface9 *mRenderTarget;
- Texture *mTexture;
- GLenum mTarget;
};
class DepthStencilbuffer : public RenderbufferStorage
@@ -148,14 +177,13 @@ class DepthStencilbuffer : public RenderbufferStorage
~DepthStencilbuffer();
- virtual bool isDepthbuffer() const;
- virtual bool isStencilbuffer() const;
-
virtual IDirect3DSurface9 *getDepthStencil();
+ protected:
+ IDirect3DSurface9 *mDepthStencil;
+
private:
DISALLOW_COPY_AND_ASSIGN(DepthStencilbuffer);
- IDirect3DSurface9 *mDepthStencil;
};
class Depthbuffer : public DepthStencilbuffer
@@ -166,9 +194,6 @@ class Depthbuffer : public DepthStencilbuffer
virtual ~Depthbuffer();
- virtual bool isDepthbuffer() const;
- virtual bool isStencilbuffer() const;
-
private:
DISALLOW_COPY_AND_ASSIGN(Depthbuffer);
};
@@ -181,9 +206,6 @@ class Stencilbuffer : public DepthStencilbuffer
virtual ~Stencilbuffer();
- virtual bool isDepthbuffer() const;
- virtual bool isStencilbuffer() const;
-
private:
DISALLOW_COPY_AND_ASSIGN(Stencilbuffer);
};
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.cpp
index f66b2c52a..58eed0784 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.cpp
@@ -157,22 +157,34 @@ int Shader::getSourceLength() const
}
}
-void Shader::getSource(GLsizei bufSize, GLsizei *length, char *source)
+int Shader::getTranslatedSourceLength() const
+{
+ if (!mHlsl)
+ {
+ return 0;
+ }
+ else
+ {
+ return strlen(mHlsl) + 1;
+ }
+}
+
+void Shader::getSourceImpl(char *source, GLsizei bufSize, GLsizei *length, char *buffer)
{
int index = 0;
- if (mSource)
+ if (source)
{
- while (index < bufSize - 1 && index < (int)strlen(mSource))
+ while (index < bufSize - 1 && index < (int)strlen(source))
{
- source[index] = mSource[index];
+ buffer[index] = source[index];
index++;
}
}
if (bufSize)
{
- source[index] = '\0';
+ buffer[index] = '\0';
}
if (length)
@@ -181,6 +193,16 @@ void Shader::getSource(GLsizei bufSize, GLsizei *length, char *source)
}
}
+void Shader::getSource(GLsizei bufSize, GLsizei *length, char *buffer)
+{
+ getSourceImpl(mSource, bufSize, length, buffer);
+}
+
+void Shader::getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer)
+{
+ getSourceImpl(mHlsl, bufSize, length, buffer);
+}
+
bool Shader::isCompiled()
{
return mHlsl != NULL;
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.h b/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.h
index 535b42d8c..22fc6376c 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Shader.h
@@ -57,7 +57,9 @@ class Shader
int getInfoLogLength() const;
void getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog);
int getSourceLength() const;
- void getSource(GLsizei bufSize, GLsizei *length, char *source);
+ void getSource(GLsizei bufSize, GLsizei *length, char *buffer);
+ int getTranslatedSourceLength() const;
+ void getTranslatedSource(GLsizei bufSize, GLsizei *length, char *buffer);
virtual void compile() = 0;
bool isCompiled();
@@ -78,6 +80,8 @@ class Shader
void compileToHLSL(void *compiler);
+ void getSourceImpl(char *source, GLsizei bufSize, GLsizei *length, char *buffer);
+
static GLenum parseType(const std::string &type);
static bool compareVarying(const Varying &x, const Varying &y);
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.cpp
index bb4c4b8f5..b83651e3f 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.cpp
@@ -27,47 +27,22 @@
namespace gl
{
-unsigned int Texture::mCurrentSerial = 1;
+unsigned int TextureStorage::mCurrentTextureSerial = 1;
-Texture::Image::Image()
- : width(0), height(0), dirty(false), surface(NULL), format(GL_NONE), type(GL_UNSIGNED_BYTE)
+static D3DFORMAT ConvertTextureFormatType(GLenum format, GLenum type)
{
-}
-
-Texture::Image::~Image()
-{
- if (surface)
+ if (format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
+ format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
{
- surface->Release();
+ return D3DFMT_DXT1;
}
-}
-
-bool Texture::Image::isRenderable() const
-{
- switch(getD3DFormat())
+ else if (format == GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE)
{
- case D3DFMT_L8:
- case D3DFMT_A8L8:
- case D3DFMT_DXT1:
- return false;
- case D3DFMT_A8R8G8B8:
- case D3DFMT_X8R8G8B8:
- case D3DFMT_A16B16G16R16F:
- case D3DFMT_A32B32G32R32F:
- return true;
- default:
- UNREACHABLE();
+ return D3DFMT_DXT3;
}
-
- return false;
-}
-
-D3DFORMAT Texture::Image::getD3DFormat() const
-{
- if (format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
- format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
+ else if (format == GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE)
{
- return D3DFMT_DXT1;
+ return D3DFMT_DXT5;
}
else if (type == GL_FLOAT)
{
@@ -98,243 +73,324 @@ D3DFORMAT Texture::Image::getD3DFormat() const
return D3DFMT_A8R8G8B8;
}
-Texture::Texture(GLuint id) : RefCountObject(id), mSerial(issueSerial())
+static bool IsTextureFormatRenderable(D3DFORMAT format)
{
- mMinFilter = GL_NEAREST_MIPMAP_LINEAR;
- mMagFilter = GL_LINEAR;
- mWrapS = GL_REPEAT;
- mWrapT = GL_REPEAT;
- mDirtyParameter = true;
-
- mDirtyImage = true;
-
- mIsRenderable = false;
+ switch(format)
+ {
+ case D3DFMT_L8:
+ case D3DFMT_A8L8:
+ case D3DFMT_DXT1:
+ case D3DFMT_DXT3:
+ case D3DFMT_DXT5:
+ return false;
+ case D3DFMT_A8R8G8B8:
+ case D3DFMT_X8R8G8B8:
+ case D3DFMT_A16B16G16R16F:
+ case D3DFMT_A32B32G32R32F:
+ return true;
+ default:
+ UNREACHABLE();
+ }
+
+ return false;
}
-Texture::~Texture()
+Image::Image()
{
+ mWidth = 0;
+ mHeight = 0;
+ mFormat = GL_NONE;
+ mType = GL_UNSIGNED_BYTE;
+
+ mSurface = NULL;
+
+ mDirty = false;
+
+ mD3DPool = D3DPOOL_SYSTEMMEM;
+ mD3DFormat = D3DFMT_UNKNOWN;
}
-Blit *Texture::getBlitter()
+Image::~Image()
{
- Context *context = getContext();
- return context->getBlitter();
+ if (mSurface)
+ {
+ mSurface->Release();
+ }
}
-// Returns true on successful filter state update (valid enum parameter)
-bool Texture::setMinFilter(GLenum filter)
+bool Image::redefine(GLenum format, GLsizei width, GLsizei height, GLenum type, bool forceRelease)
{
- switch (filter)
+ if (mWidth != width ||
+ mHeight != height ||
+ mFormat != format ||
+ mType != type ||
+ forceRelease)
{
- case GL_NEAREST:
- case GL_LINEAR:
- case GL_NEAREST_MIPMAP_NEAREST:
- case GL_LINEAR_MIPMAP_NEAREST:
- case GL_NEAREST_MIPMAP_LINEAR:
- case GL_LINEAR_MIPMAP_LINEAR:
+ mWidth = width;
+ mHeight = height;
+ mFormat = format;
+ mType = type;
+ // compute the d3d format that will be used
+ mD3DFormat = ConvertTextureFormatType(mFormat, mType);
+
+ if (mSurface)
{
- if (mMinFilter != filter)
- {
- mMinFilter = filter;
- mDirtyParameter = true;
- }
- return true;
+ mSurface->Release();
+ mSurface = NULL;
}
- default:
- return false;
+
+ return true;
}
+
+ return false;
}
-// Returns true on successful filter state update (valid enum parameter)
-bool Texture::setMagFilter(GLenum filter)
+void Image::createSurface()
{
- switch (filter)
+ if(mSurface)
{
- case GL_NEAREST:
- case GL_LINEAR:
+ return;
+ }
+
+ IDirect3DTexture9 *newTexture = NULL;
+ IDirect3DSurface9 *newSurface = NULL;
+ const D3DPOOL poolToUse = D3DPOOL_SYSTEMMEM;
+
+ if (mWidth != 0 && mHeight != 0)
+ {
+ int levelToFetch = 0;
+ GLsizei requestWidth = mWidth;
+ GLsizei requestHeight = mHeight;
+ if (IsCompressed(mFormat) && (mWidth % 4 != 0 || mHeight % 4 != 0))
{
- if (mMagFilter != filter)
+ bool isMult4 = false;
+ int upsampleCount = 0;
+ while (!isMult4)
{
- mMagFilter = filter;
- mDirtyParameter = true;
+ requestWidth <<= 1;
+ requestHeight <<= 1;
+ upsampleCount++;
+ if (requestWidth % 4 == 0 && requestHeight % 4 == 0)
+ {
+ isMult4 = true;
+ }
}
- return true;
+ levelToFetch = upsampleCount;
}
- default:
- return false;
+
+ HRESULT result = getDevice()->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, NULL, getD3DFormat(),
+ poolToUse, &newTexture, NULL);
+
+ if (FAILED(result))
+ {
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ ERR("Creating image surface failed.");
+ return error(GL_OUT_OF_MEMORY);
+ }
+
+ newTexture->GetSurfaceLevel(levelToFetch, &newSurface);
+ newTexture->Release();
}
+
+ mSurface = newSurface;
+ mDirty = false;
+ mD3DPool = poolToUse;
}
-// Returns true on successful wrap state update (valid enum parameter)
-bool Texture::setWrapS(GLenum wrap)
+HRESULT Image::lock(D3DLOCKED_RECT *lockedRect, const RECT *rect)
{
- switch (wrap)
+ createSurface();
+
+ HRESULT result = D3DERR_INVALIDCALL;
+
+ if (mSurface)
{
- case GL_REPEAT:
- case GL_CLAMP_TO_EDGE:
- case GL_MIRRORED_REPEAT:
- {
- if (mWrapS != wrap)
- {
- mWrapS = wrap;
- mDirtyParameter = true;
- }
- return true;
- }
- default:
- return false;
+ result = mSurface->LockRect(lockedRect, rect, 0);
+ ASSERT(SUCCEEDED(result));
+
+ mDirty = true;
}
+
+ return result;
}
-// Returns true on successful wrap state update (valid enum parameter)
-bool Texture::setWrapT(GLenum wrap)
+void Image::unlock()
{
- switch (wrap)
+ if (mSurface)
{
- case GL_REPEAT:
- case GL_CLAMP_TO_EDGE:
- case GL_MIRRORED_REPEAT:
- {
- if (mWrapT != wrap)
- {
- mWrapT = wrap;
- mDirtyParameter = true;
- }
- return true;
- }
- default:
- return false;
+ HRESULT result = mSurface->UnlockRect();
+ ASSERT(SUCCEEDED(result));
}
}
-GLenum Texture::getMinFilter() const
+bool Image::isRenderableFormat() const
+{
+ return IsTextureFormatRenderable(getD3DFormat());
+}
+
+D3DFORMAT Image::getD3DFormat() const
{
- return mMinFilter;
+ // this should only happen if the image hasn't been redefined first
+ // which would be a bug by the caller
+ ASSERT(mD3DFormat != D3DFMT_UNKNOWN);
+
+ return mD3DFormat;
}
-GLenum Texture::getMagFilter() const
+IDirect3DSurface9 *Image::getSurface()
{
- return mMagFilter;
+ createSurface();
+
+ return mSurface;
}
-GLenum Texture::getWrapS() const
+void Image::setManagedSurface(IDirect3DSurface9 *surface)
{
- return mWrapS;
+ if (mSurface)
+ {
+ D3DXLoadSurfaceFromSurface(surface, NULL, NULL, mSurface, NULL, NULL, D3DX_FILTER_BOX, 0);
+ mSurface->Release();
+ }
+
+ D3DSURFACE_DESC desc;
+ surface->GetDesc(&desc);
+ ASSERT(desc.Pool == D3DPOOL_MANAGED);
+
+ mSurface = surface;
+ mD3DPool = desc.Pool;
}
-GLenum Texture::getWrapT() const
+void Image::updateSurface(IDirect3DSurface9 *destSurface, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
{
- return mWrapT;
+ IDirect3DSurface9 *sourceSurface = getSurface();
+
+ if (sourceSurface != destSurface)
+ {
+ RECT rect = transformPixelRect(xoffset, yoffset, width, height, mHeight);
+
+ if (mD3DPool == D3DPOOL_MANAGED)
+ {
+ HRESULT result = D3DXLoadSurfaceFromSurface(destSurface, NULL, &rect, sourceSurface, NULL, &rect, D3DX_FILTER_BOX, 0);
+ ASSERT(SUCCEEDED(result));
+ }
+ else
+ {
+ // UpdateSurface: source must be SYSTEMMEM, dest must be DEFAULT pools
+ POINT point = {rect.left, rect.top};
+ HRESULT result = getDevice()->UpdateSurface(sourceSurface, &rect, destSurface, &point);
+ ASSERT(SUCCEEDED(result));
+ }
+ }
}
// Store the pixel rectangle designated by xoffset,yoffset,width,height with pixels stored as format/type at input
// into the target pixel rectangle at output with outputPitch bytes in between each line.
-void Texture::loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLint unpackAlignment, const void *input, size_t outputPitch, void *output, D3DSURFACE_DESC *description) const
+void Image::loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum type,
+ GLint unpackAlignment, const void *input, size_t outputPitch, void *output) const
{
- GLsizei inputPitch = -ComputePitch(width, format, type, unpackAlignment);
+ GLsizei inputPitch = -ComputePitch(width, mFormat, type, unpackAlignment);
input = ((char*)input) - inputPitch * (height - 1);
switch (type)
{
case GL_UNSIGNED_BYTE:
- switch (format)
+ switch (mFormat)
{
case GL_ALPHA:
- loadAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadAlphaData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_LUMINANCE:
- loadLuminanceImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, description->Format == D3DFMT_L8);
+ loadLuminanceData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, getD3DFormat() == D3DFMT_L8);
break;
case GL_LUMINANCE_ALPHA:
- loadLuminanceAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, description->Format == D3DFMT_A8L8);
+ loadLuminanceAlphaData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, getD3DFormat() == D3DFMT_A8L8);
break;
case GL_RGB:
- loadRGBUByteImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBUByteData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_RGBA:
if (supportsSSE2())
{
- loadRGBAUByteImageDataSSE2(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBAUByteDataSSE2(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
}
else
{
- loadRGBAUByteImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBAUByteData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
}
break;
case GL_BGRA_EXT:
- loadBGRAImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadBGRAData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
default: UNREACHABLE();
}
break;
case GL_UNSIGNED_SHORT_5_6_5:
- switch (format)
+ switch (mFormat)
{
case GL_RGB:
- loadRGB565ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGB565Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
default: UNREACHABLE();
}
break;
case GL_UNSIGNED_SHORT_4_4_4_4:
- switch (format)
+ switch (mFormat)
{
case GL_RGBA:
- loadRGBA4444ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBA4444Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
default: UNREACHABLE();
}
break;
case GL_UNSIGNED_SHORT_5_5_5_1:
- switch (format)
+ switch (mFormat)
{
case GL_RGBA:
- loadRGBA5551ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBA5551Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
default: UNREACHABLE();
}
break;
case GL_FLOAT:
- switch (format)
+ switch (mFormat)
{
// float textures are converted to RGBA, not BGRA, as they're stored that way in D3D
case GL_ALPHA:
- loadAlphaFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadAlphaFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_LUMINANCE:
- loadLuminanceFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadLuminanceFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_LUMINANCE_ALPHA:
- loadLuminanceAlphaFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadLuminanceAlphaFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_RGB:
- loadRGBFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_RGBA:
- loadRGBAFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBAFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
default: UNREACHABLE();
}
break;
case GL_HALF_FLOAT_OES:
- switch (format)
+ switch (mFormat)
{
// float textures are converted to RGBA, not BGRA, as they're stored that way in D3D
case GL_ALPHA:
- loadAlphaHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadAlphaHalfFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_LUMINANCE:
- loadLuminanceHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadLuminanceHalfFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_LUMINANCE_ALPHA:
- loadLuminanceAlphaHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadLuminanceAlphaHalfFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_RGB:
- loadRGBHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBHalfFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
case GL_RGBA:
- loadRGBAHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ loadRGBAHalfFloatData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
break;
default: UNREACHABLE();
}
@@ -343,8 +399,8 @@ void Texture::loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei
}
}
-void Texture::loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadAlphaData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned char *source = NULL;
unsigned char *dest = NULL;
@@ -363,8 +419,8 @@ void Texture::loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GL
}
}
-void Texture::loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadAlphaFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const float *source = NULL;
float *dest = NULL;
@@ -383,8 +439,8 @@ void Texture::loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei widt
}
}
-void Texture::loadAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadAlphaHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned short *dest = NULL;
@@ -403,8 +459,8 @@ void Texture::loadAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei
}
}
-void Texture::loadLuminanceImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const
+void Image::loadLuminanceData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const
{
const int destBytesPerPixel = native? 1: 4;
const unsigned char *source = NULL;
@@ -432,8 +488,8 @@ void Texture::loadLuminanceImageData(GLint xoffset, GLint yoffset, GLsizei width
}
}
-void Texture::loadLuminanceFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadLuminanceFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const float *source = NULL;
float *dest = NULL;
@@ -452,8 +508,8 @@ void Texture::loadLuminanceFloatImageData(GLint xoffset, GLint yoffset, GLsizei
}
}
-void Texture::loadLuminanceHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadLuminanceHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned short *dest = NULL;
@@ -472,8 +528,8 @@ void Texture::loadLuminanceHalfFloatImageData(GLint xoffset, GLint yoffset, GLsi
}
}
-void Texture::loadLuminanceAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const
+void Image::loadLuminanceAlphaData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const
{
const int destBytesPerPixel = native? 2: 4;
const unsigned char *source = NULL;
@@ -501,8 +557,8 @@ void Texture::loadLuminanceAlphaImageData(GLint xoffset, GLint yoffset, GLsizei
}
}
-void Texture::loadLuminanceAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadLuminanceAlphaFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const float *source = NULL;
float *dest = NULL;
@@ -521,8 +577,8 @@ void Texture::loadLuminanceAlphaFloatImageData(GLint xoffset, GLint yoffset, GLs
}
}
-void Texture::loadLuminanceAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadLuminanceAlphaHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned short *dest = NULL;
@@ -541,8 +597,8 @@ void Texture::loadLuminanceAlphaHalfFloatImageData(GLint xoffset, GLint yoffset,
}
}
-void Texture::loadRGBUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBUByteData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned char *source = NULL;
unsigned char *dest = NULL;
@@ -561,8 +617,8 @@ void Texture::loadRGBUByteImageData(GLint xoffset, GLint yoffset, GLsizei width,
}
}
-void Texture::loadRGB565ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGB565Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned char *dest = NULL;
@@ -582,8 +638,8 @@ void Texture::loadRGB565ImageData(GLint xoffset, GLint yoffset, GLsizei width, G
}
}
-void Texture::loadRGBFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const float *source = NULL;
float *dest = NULL;
@@ -602,8 +658,8 @@ void Texture::loadRGBFloatImageData(GLint xoffset, GLint yoffset, GLsizei width,
}
}
-void Texture::loadRGBHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned short *dest = NULL;
@@ -622,8 +678,8 @@ void Texture::loadRGBHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei wi
}
}
-void Texture::loadRGBAUByteImageDataSSE2(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBAUByteDataSSE2(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned int *source = NULL;
unsigned int *dest = NULL;
@@ -664,8 +720,8 @@ void Texture::loadRGBAUByteImageDataSSE2(GLint xoffset, GLint yoffset, GLsizei w
}
}
-void Texture::loadRGBAUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBAUByteData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned int *source = NULL;
unsigned int *dest = NULL;
@@ -682,8 +738,8 @@ void Texture::loadRGBAUByteImageData(GLint xoffset, GLint yoffset, GLsizei width
}
}
-void Texture::loadRGBA4444ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBA4444Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned char *dest = NULL;
@@ -703,8 +759,8 @@ void Texture::loadRGBA4444ImageData(GLint xoffset, GLint yoffset, GLsizei width,
}
}
-void Texture::loadRGBA5551ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBA5551Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned short *source = NULL;
unsigned char *dest = NULL;
@@ -724,8 +780,8 @@ void Texture::loadRGBA5551ImageData(GLint xoffset, GLint yoffset, GLsizei width,
}
}
-void Texture::loadRGBAFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBAFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const float *source = NULL;
float *dest = NULL;
@@ -738,8 +794,8 @@ void Texture::loadRGBAFloatImageData(GLint xoffset, GLint yoffset, GLsizei width
}
}
-void Texture::loadRGBAHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadRGBAHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned char *source = NULL;
unsigned char *dest = NULL;
@@ -752,8 +808,8 @@ void Texture::loadRGBAHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei w
}
}
-void Texture::loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadBGRAData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
const unsigned char *source = NULL;
unsigned char *dest = NULL;
@@ -766,8 +822,134 @@ void Texture::loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLs
}
}
-void Texture::loadCompressedImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const
+void Image::loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const {
+ switch (getD3DFormat())
+ {
+ case D3DFMT_DXT1:
+ loadDXT1Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ break;
+ case D3DFMT_DXT3:
+ loadDXT3Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ break;
+ case D3DFMT_DXT5:
+ loadDXT5Data(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
+ break;
+ }
+}
+
+static void FlipCopyDXT1BlockFull(const unsigned int* source, unsigned int* dest) {
+ // A DXT1 block layout is:
+ // [0-1] color0.
+ // [2-3] color1.
+ // [4-7] color bitmap, 2 bits per pixel.
+ // So each of the 4-7 bytes represents one line, flipping a block is just
+ // flipping those bytes.
+
+ // First 32-bits is two RGB565 colors shared by tile and does not need to be modified.
+ dest[0] = source[0];
+
+ // Second 32-bits contains 4 rows of 4 2-bit interpolants between the colors. All rows should be flipped.
+ dest[1] = (source[1] >> 24) |
+ ((source[1] << 8) & 0x00FF0000) |
+ ((source[1] >> 8) & 0x0000FF00) |
+ (source[1] << 24);
+}
+
+// Flips the first 2 lines of a DXT1 block in the y direction.
+static void FlipCopyDXT1BlockHalf(const unsigned int* source, unsigned int* dest) {
+ // See layout above.
+ dest[0] = source[0];
+ dest[1] = ((source[1] << 8) & 0x0000FF00) |
+ ((source[1] >> 8) & 0x000000FF);
+}
+
+// Flips a full DXT3 block in the y direction.
+static void FlipCopyDXT3BlockFull(const unsigned int* source, unsigned int* dest) {
+ // A DXT3 block layout is:
+ // [0-7] alpha bitmap, 4 bits per pixel.
+ // [8-15] a DXT1 block.
+
+ // First and Second 32 bits are 4bit per pixel alpha and need to be flipped.
+ dest[0] = (source[1] >> 16) | (source[1] << 16);
+ dest[1] = (source[0] >> 16) | (source[0] << 16);
+
+ // And flip the DXT1 block using the above function.
+ FlipCopyDXT1BlockFull(source + 2, dest + 2);
+}
+
+// Flips the first 2 lines of a DXT3 block in the y direction.
+static void FlipCopyDXT3BlockHalf(const unsigned int* source, unsigned int* dest) {
+ // See layout above.
+ dest[0] = (source[1] >> 16) | (source[1] << 16);
+ FlipCopyDXT1BlockHalf(source + 2, dest + 2);
+}
+
+// Flips a full DXT5 block in the y direction.
+static void FlipCopyDXT5BlockFull(const unsigned int* source, unsigned int* dest) {
+ // A DXT5 block layout is:
+ // [0] alpha0.
+ // [1] alpha1.
+ // [2-7] alpha bitmap, 3 bits per pixel.
+ // [8-15] a DXT1 block.
+
+ // The alpha bitmap doesn't easily map lines to bytes, so we have to
+ // interpret it correctly. Extracted from
+ // http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt :
+ //
+ // The 6 "bits" bytes of the block are decoded into one 48-bit integer:
+ //
+ // bits = bits_0 + 256 * (bits_1 + 256 * (bits_2 + 256 * (bits_3 +
+ // 256 * (bits_4 + 256 * bits_5))))
+ //
+ // bits is a 48-bit unsigned integer, from which a three-bit control code
+ // is extracted for a texel at location (x,y) in the block using:
+ //
+ // code(x,y) = bits[3*(4*y+x)+1..3*(4*y+x)+0]
+ //
+ // where bit 47 is the most significant and bit 0 is the least
+ // significant bit.
+ const unsigned char* sourceBytes = static_cast<const unsigned char*>(static_cast<const void*>(source));
+ unsigned char* destBytes = static_cast<unsigned char*>(static_cast<void*>(dest));
+ unsigned int line_0_1 = sourceBytes[2] + 256 * (sourceBytes[3] + 256 * sourceBytes[4]);
+ unsigned int line_2_3 = sourceBytes[5] + 256 * (sourceBytes[6] + 256 * sourceBytes[7]);
+ // swap lines 0 and 1 in line_0_1.
+ unsigned int line_1_0 = ((line_0_1 & 0x000fff) << 12) |
+ ((line_0_1 & 0xfff000) >> 12);
+ // swap lines 2 and 3 in line_2_3.
+ unsigned int line_3_2 = ((line_2_3 & 0x000fff) << 12) |
+ ((line_2_3 & 0xfff000) >> 12);
+ destBytes[0] = sourceBytes[0];
+ destBytes[1] = sourceBytes[1];
+ destBytes[2] = line_3_2 & 0xff;
+ destBytes[3] = (line_3_2 & 0xff00) >> 8;
+ destBytes[4] = (line_3_2 & 0xff0000) >> 16;
+ destBytes[5] = line_1_0 & 0xff;
+ destBytes[6] = (line_1_0 & 0xff00) >> 8;
+ destBytes[7] = (line_1_0 & 0xff0000) >> 16;
+
+ // And flip the DXT1 block using the above function.
+ FlipCopyDXT1BlockFull(source + 2, dest + 2);
+}
+
+// Flips the first 2 lines of a DXT5 block in the y direction.
+static void FlipCopyDXT5BlockHalf(const unsigned int* source, unsigned int* dest) {
+ // See layout above.
+ const unsigned char* sourceBytes = static_cast<const unsigned char*>(static_cast<const void*>(source));
+ unsigned char* destBytes = static_cast<unsigned char*>(static_cast<void*>(dest));
+ unsigned int line_0_1 = sourceBytes[2] + 256 * (sourceBytes[3] + 256 * sourceBytes[4]);
+ unsigned int line_1_0 = ((line_0_1 & 0x000fff) << 12) |
+ ((line_0_1 & 0xfff000) >> 12);
+ destBytes[0] = sourceBytes[0];
+ destBytes[1] = sourceBytes[1];
+ destBytes[2] = line_1_0 & 0xff;
+ destBytes[3] = (line_1_0 & 0xff00) >> 8;
+ destBytes[4] = (line_1_0 & 0xff0000) >> 16;
+ FlipCopyDXT1BlockHalf(source + 2, dest + 2);
+}
+
+void Image::loadDXT1Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
ASSERT(xoffset % 4 == 0);
ASSERT(yoffset % 4 == 0);
@@ -778,29 +960,24 @@ void Texture::loadCompressedImageData(GLint xoffset, GLint yoffset, GLsizei widt
const unsigned int *source = reinterpret_cast<const unsigned int*>(input);
unsigned int *dest = reinterpret_cast<unsigned int*>(output);
+ // Round width up in case it is less than 4.
+ int blocksAcross = (width + 3) / 4;
+ int intsAcross = blocksAcross * 2;
+
switch (height)
{
case 1:
- // Round width up in case it is 1.
- for (int x = 0; x < (width + 1) / 2; x += 2)
+ for (int x = 0; x < intsAcross; x += 2)
{
- // First 32-bits is two RGB565 colors shared by tile and does not need to be modified.
+ // just copy the block
dest[x] = source[x];
-
- // Second 32-bits contains 4 rows of 4 2-bit interpolants between the colors, the last 3 rows being unused. No flipping should occur.
dest[x + 1] = source[x + 1];
}
break;
case 2:
- // Round width up in case it is 1.
- for (int x = 0; x < (width + 1) / 2; x += 2)
+ for (int x = 0; x < intsAcross; x += 2)
{
- // First 32-bits is two RGB565 colors shared by tile and does not need to be modified.
- dest[x] = source[x];
-
- // Second 32-bits contains 4 rows of 4 2-bit interpolants between the colors, the last 2 rows being unused. Only the top 2 rows should be flipped.
- dest[x + 1] = ((source[x + 1] << 8) & 0x0000FF00) |
- ((source[x + 1] >> 8) & 0x000000FF);
+ FlipCopyDXT1BlockHalf(source + x, dest + x);
}
break;
default:
@@ -810,229 +987,118 @@ void Texture::loadCompressedImageData(GLint xoffset, GLint yoffset, GLsizei widt
const unsigned int *source = reinterpret_cast<const unsigned int*>(static_cast<const unsigned char*>(input) + y * inputPitch);
unsigned int *dest = reinterpret_cast<unsigned int*>(static_cast<unsigned char*>(output) + (y + yoffset) * outputPitch + xoffset * 8);
- // Round width up in case it is 1.
- for (int x = 0; x < (width + 1) / 2; x += 2)
+ for (int x = 0; x < intsAcross; x += 2)
{
- // First 32-bits is two RGB565 colors shared by tile and does not need to be modified.
- dest[x] = source[x];
-
- // Second 32-bits contains 4 rows of 4 2-bit interpolants between the colors. All rows should be flipped.
- dest[x + 1] = (source[x + 1] >> 24) |
- ((source[x + 1] << 8) & 0x00FF0000) |
- ((source[x + 1] >> 8) & 0x0000FF00) |
- (source[x + 1] << 24);
+ FlipCopyDXT1BlockFull(source + x, dest + x);
}
}
break;
}
}
-void Texture::createSurface(Image *image)
+void Image::loadDXT3Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
- IDirect3DTexture9 *newTexture = NULL;
- IDirect3DSurface9 *newSurface = NULL;
+ ASSERT(xoffset % 4 == 0);
+ ASSERT(yoffset % 4 == 0);
+ ASSERT(width % 4 == 0 || width == 2 || width == 1);
+ ASSERT(inputPitch % 16 == 0);
+ ASSERT(outputPitch % 16 == 0);
+
+ const unsigned int *source = reinterpret_cast<const unsigned int*>(input);
+ unsigned int *dest = reinterpret_cast<unsigned int*>(output);
+
+ // Round width up in case it is less than 4.
+ int blocksAcross = (width + 3) / 4;
+ int intsAcross = blocksAcross * 4;
- if (image->width != 0 && image->height != 0)
+ switch (height)
{
- int levelToFetch = 0;
- GLsizei requestWidth = image->width;
- GLsizei requestHeight = image->height;
- if (IsCompressed(image->format) && (image->width % 4 != 0 || image->height % 4 != 0))
- {
- bool isMult4 = false;
- int upsampleCount = 0;
- while (!isMult4)
+ case 1:
+ for (int x = 0; x < intsAcross; x += 4)
{
- requestWidth <<= 1;
- requestHeight <<= 1;
- upsampleCount++;
- if (requestWidth % 4 == 0 && requestHeight % 4 == 0)
+ // just copy the block
+ dest[x] = source[x];
+ dest[x + 1] = source[x + 1];
+ dest[x + 2] = source[x + 2];
+ dest[x + 3] = source[x + 3];
+ }
+ break;
+ case 2:
+ for (int x = 0; x < intsAcross; x += 4)
+ {
+ FlipCopyDXT3BlockHalf(source + x, dest + x);
+ }
+ break;
+ default:
+ ASSERT(height % 4 == 0);
+ for (int y = 0; y < height / 4; ++y)
+ {
+ const unsigned int *source = reinterpret_cast<const unsigned int*>(static_cast<const unsigned char*>(input) + y * inputPitch);
+ unsigned int *dest = reinterpret_cast<unsigned int*>(static_cast<unsigned char*>(output) + (y + yoffset) * outputPitch + xoffset * 16);
+
+ for (int x = 0; x < intsAcross; x += 4)
{
- isMult4 = true;
+ FlipCopyDXT3BlockFull(source + x, dest + x);
}
}
- levelToFetch = upsampleCount;
- }
-
- HRESULT result = getDevice()->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, NULL, image->getD3DFormat(),
- D3DPOOL_SYSTEMMEM, &newTexture, NULL);
-
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
- return error(GL_OUT_OF_MEMORY);
- }
-
- newTexture->GetSurfaceLevel(levelToFetch, &newSurface);
- newTexture->Release();
- }
-
- if (image->surface)
- {
- image->surface->Release();
- }
-
- image->surface = newSurface;
-}
-
-void Texture::setImage(GLint unpackAlignment, const void *pixels, Image *image)
-{
- createSurface(image);
-
- if (pixels != NULL && image->surface != NULL)
- {
- D3DSURFACE_DESC description;
- image->surface->GetDesc(&description);
-
- D3DLOCKED_RECT locked;
- HRESULT result = image->surface->LockRect(&locked, NULL, 0);
-
- ASSERT(SUCCEEDED(result));
-
- if (SUCCEEDED(result))
- {
- loadImageData(0, 0, image->width, image->height, image->format, image->type, unpackAlignment, pixels, locked.Pitch, locked.pBits, &description);
- image->surface->UnlockRect();
- }
-
- image->dirty = true;
- mDirtyImage = true;
- }
-}
-
-void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *image)
-{
- createSurface(image);
-
- if (pixels != NULL && image->surface != NULL)
- {
- D3DLOCKED_RECT locked;
- HRESULT result = image->surface->LockRect(&locked, NULL, 0);
-
- ASSERT(SUCCEEDED(result));
-
- if (SUCCEEDED(result))
- {
- int inputPitch = ComputeCompressedPitch(image->width, image->format);
- int inputSize = ComputeCompressedSize(image->width, image->height, image->format);
- loadCompressedImageData(0, 0, image->width, image->height, -inputPitch, static_cast<const char*>(pixels) + inputSize - inputPitch, locked.Pitch, locked.pBits);
- image->surface->UnlockRect();
- }
-
- image->dirty = true;
- mDirtyImage = true;
- }
-}
-
-bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image)
-{
- if (width + xoffset > image->width || height + yoffset > image->height)
- {
- error(GL_INVALID_VALUE);
- return false;
- }
-
- if (IsCompressed(image->format))
- {
- error(GL_INVALID_OPERATION);
- return false;
- }
-
- if (format != image->format)
- {
- error(GL_INVALID_OPERATION);
- return false;
- }
-
- if (!image->surface)
- {
- createSurface(image);
- }
-
- if (pixels != NULL && image->surface != NULL)
- {
- D3DSURFACE_DESC description;
- image->surface->GetDesc(&description);
-
- D3DLOCKED_RECT locked;
- HRESULT result = image->surface->LockRect(&locked, NULL, 0);
-
- ASSERT(SUCCEEDED(result));
-
- if (SUCCEEDED(result))
- {
- loadImageData(xoffset, transformPixelYOffset(yoffset, height, image->height), width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits, &description);
- image->surface->UnlockRect();
- }
-
- image->dirty = true;
- mDirtyImage = true;
+ break;
}
-
- return true;
}
-bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image)
+void Image::loadDXT5Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const
{
- if (width + xoffset > image->width || height + yoffset > image->height)
- {
- error(GL_INVALID_VALUE);
- return false;
- }
+ ASSERT(xoffset % 4 == 0);
+ ASSERT(yoffset % 4 == 0);
+ ASSERT(width % 4 == 0 || width == 2 || width == 1);
+ ASSERT(inputPitch % 16 == 0);
+ ASSERT(outputPitch % 16 == 0);
- if (format != getInternalFormat())
- {
- error(GL_INVALID_OPERATION);
- return false;
- }
+ const unsigned int *source = reinterpret_cast<const unsigned int*>(input);
+ unsigned int *dest = reinterpret_cast<unsigned int*>(output);
- if (!image->surface)
- {
- createSurface(image);
- }
+ // Round width up in case it is less than 4.
+ int blocksAcross = (width + 3) / 4;
+ int intsAcross = blocksAcross * 4;
- if (pixels != NULL && image->surface != NULL)
+ switch (height)
{
- RECT updateRegion;
- updateRegion.left = xoffset;
- updateRegion.right = xoffset + width;
- updateRegion.bottom = yoffset + height;
- updateRegion.top = yoffset;
-
- D3DLOCKED_RECT locked;
- HRESULT result = image->surface->LockRect(&locked, &updateRegion, 0);
-
- ASSERT(SUCCEEDED(result));
-
- if (SUCCEEDED(result))
- {
- int inputPitch = ComputeCompressedPitch(width, format);
- int inputSize = ComputeCompressedSize(width, height, format);
- loadCompressedImageData(xoffset, transformPixelYOffset(yoffset, height, image->height), width, height, -inputPitch, static_cast<const char*>(pixels) + inputSize - inputPitch, locked.Pitch, locked.pBits);
- image->surface->UnlockRect();
- }
+ case 1:
+ for (int x = 0; x < intsAcross; x += 4)
+ {
+ // just copy the block
+ dest[x] = source[x];
+ dest[x + 1] = source[x + 1];
+ dest[x + 2] = source[x + 2];
+ dest[x + 3] = source[x + 3];
+ }
+ break;
+ case 2:
+ for (int x = 0; x < intsAcross; x += 4)
+ {
+ FlipCopyDXT5BlockHalf(source + x, dest + x);
+ }
+ break;
+ default:
+ ASSERT(height % 4 == 0);
+ for (int y = 0; y < height / 4; ++y)
+ {
+ const unsigned int *source = reinterpret_cast<const unsigned int*>(static_cast<const unsigned char*>(input) + y * inputPitch);
+ unsigned int *dest = reinterpret_cast<unsigned int*>(static_cast<unsigned char*>(output) + (y + yoffset) * outputPitch + xoffset * 16);
- image->dirty = true;
- mDirtyImage = true;
+ for (int x = 0; x < intsAcross; x += 4)
+ {
+ FlipCopyDXT5BlockFull(source + x, dest + x);
+ }
+ }
+ break;
}
-
- return true;
}
// This implements glCopyTex[Sub]Image2D for non-renderable internal texture formats and incomplete textures
-void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget)
+void Image::copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget)
{
- if (!image->surface)
- {
- createSurface(image);
-
- if (!image->surface)
- {
- ERR("Failed to create an image surface.");
- return error(GL_OUT_OF_MEMORY);
- }
- }
-
IDirect3DDevice9 *device = getDevice();
IDirect3DSurface9 *renderTargetData = NULL;
D3DSURFACE_DESC description;
@@ -1056,12 +1122,12 @@ void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, G
}
RECT sourceRect = transformPixelRect(x, y, width, height, description.Height);
- int destYOffset = transformPixelYOffset(yoffset, height, image->height);
+ int destYOffset = transformPixelYOffset(yoffset, height, mHeight);
RECT destRect = {xoffset, destYOffset, xoffset + width, destYOffset + height};
- if (image->isRenderable())
+ if (isRenderableFormat())
{
- result = D3DXLoadSurfaceFromSurface(image->surface, NULL, &destRect, renderTargetData, NULL, &sourceRect, D3DX_FILTER_BOX, 0);
+ result = D3DXLoadSurfaceFromSurface(getSurface(), NULL, &destRect, renderTargetData, NULL, &sourceRect, D3DX_FILTER_BOX, 0);
if (FAILED(result))
{
@@ -1083,7 +1149,7 @@ void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, G
}
D3DLOCKED_RECT destLock = {0};
- result = image->surface->LockRect(&destLock, &destRect, 0);
+ result = lock(&destLock, &destRect);
if (FAILED(result))
{
@@ -1102,7 +1168,7 @@ void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, G
{
case D3DFMT_X8R8G8B8:
case D3DFMT_A8R8G8B8:
- switch(image->getD3DFormat())
+ switch(getD3DFormat())
{
case D3DFMT_L8:
for(int y = 0; y < height; y++)
@@ -1134,7 +1200,7 @@ void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, G
}
break;
case D3DFMT_R5G6B5:
- switch(image->getD3DFormat())
+ switch(getD3DFormat())
{
case D3DFMT_L8:
for(int y = 0; y < height; y++)
@@ -1154,7 +1220,7 @@ void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, G
}
break;
case D3DFMT_A1R5G5B5:
- switch(image->getD3DFormat())
+ switch(getD3DFormat())
{
case D3DFMT_L8:
for(int y = 0; y < height; y++)
@@ -1192,26 +1258,317 @@ void Texture::copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, G
}
}
- image->surface->UnlockRect();
+ unlock();
renderTargetData->UnlockRect();
}
renderTargetData->Release();
- image->dirty = true;
- mDirtyImage = true;
+ mDirty = true;
+}
+
+TextureStorage::TextureStorage(bool renderTarget)
+ : mRenderTarget(renderTarget),
+ mD3DPool(getDisplay()->getTexturePool(mRenderTarget)),
+ mTextureSerial(issueTextureSerial())
+{
+}
+
+TextureStorage::~TextureStorage()
+{
+}
+
+bool TextureStorage::isRenderTarget() const
+{
+ return mRenderTarget;
+}
+
+bool TextureStorage::isManaged() const
+{
+ return (mD3DPool == D3DPOOL_MANAGED);
+}
+
+D3DPOOL TextureStorage::getPool() const
+{
+ return mD3DPool;
+}
+
+unsigned int TextureStorage::getTextureSerial() const
+{
+ return mTextureSerial;
+}
+
+unsigned int TextureStorage::issueTextureSerial()
+{
+ return mCurrentTextureSerial++;
+}
+
+Texture::Texture(GLuint id) : RefCountObject(id)
+{
+ mMinFilter = GL_NEAREST_MIPMAP_LINEAR;
+ mMagFilter = GL_LINEAR;
+ mWrapS = GL_REPEAT;
+ mWrapT = GL_REPEAT;
+ mDirtyParameters = true;
+ mUsage = GL_NONE;
+
+ mDirtyImages = true;
+
+ mImmutable = false;
+}
+
+Texture::~Texture()
+{
+}
+
+// Returns true on successful filter state update (valid enum parameter)
+bool Texture::setMinFilter(GLenum filter)
+{
+ switch (filter)
+ {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ case GL_NEAREST_MIPMAP_NEAREST:
+ case GL_LINEAR_MIPMAP_NEAREST:
+ case GL_NEAREST_MIPMAP_LINEAR:
+ case GL_LINEAR_MIPMAP_LINEAR:
+ {
+ if (mMinFilter != filter)
+ {
+ mMinFilter = filter;
+ mDirtyParameters = true;
+ }
+ return true;
+ }
+ default:
+ return false;
+ }
+}
+
+// Returns true on successful filter state update (valid enum parameter)
+bool Texture::setMagFilter(GLenum filter)
+{
+ switch (filter)
+ {
+ case GL_NEAREST:
+ case GL_LINEAR:
+ {
+ if (mMagFilter != filter)
+ {
+ mMagFilter = filter;
+ mDirtyParameters = true;
+ }
+ return true;
+ }
+ default:
+ return false;
+ }
+}
+
+// Returns true on successful wrap state update (valid enum parameter)
+bool Texture::setWrapS(GLenum wrap)
+{
+ switch (wrap)
+ {
+ case GL_REPEAT:
+ case GL_CLAMP_TO_EDGE:
+ case GL_MIRRORED_REPEAT:
+ {
+ if (mWrapS != wrap)
+ {
+ mWrapS = wrap;
+ mDirtyParameters = true;
+ }
+ return true;
+ }
+ default:
+ return false;
+ }
+}
+
+// Returns true on successful wrap state update (valid enum parameter)
+bool Texture::setWrapT(GLenum wrap)
+{
+ switch (wrap)
+ {
+ case GL_REPEAT:
+ case GL_CLAMP_TO_EDGE:
+ case GL_MIRRORED_REPEAT:
+ {
+ if (mWrapT != wrap)
+ {
+ mWrapT = wrap;
+ mDirtyParameters = true;
+ }
+ return true;
+ }
+ default:
+ return false;
+ }
+}
+
+// Returns true on successful usage state update (valid enum parameter)
+bool Texture::setUsage(GLenum usage)
+{
+ switch (usage)
+ {
+ case GL_NONE:
+ case GL_FRAMEBUFFER_ATTACHMENT_ANGLE:
+ mUsage = usage;
+ return true;
+ default:
+ return false;
+ }
+}
+
+GLenum Texture::getMinFilter() const
+{
+ return mMinFilter;
+}
+
+GLenum Texture::getMagFilter() const
+{
+ return mMagFilter;
+}
+
+GLenum Texture::getWrapS() const
+{
+ return mWrapS;
+}
+
+GLenum Texture::getWrapT() const
+{
+ return mWrapT;
+}
+
+GLenum Texture::getUsage() const
+{
+ return mUsage;
+}
+
+void Texture::setImage(GLint unpackAlignment, const void *pixels, Image *image)
+{
+ if (pixels != NULL)
+ {
+ D3DLOCKED_RECT locked;
+ HRESULT result = image->lock(&locked, NULL);
+
+ if (SUCCEEDED(result))
+ {
+ image->loadData(0, 0, image->getWidth(), image->getHeight(), image->getType(), unpackAlignment, pixels, locked.Pitch, locked.pBits);
+ image->unlock();
+ }
+
+ mDirtyImages = true;
+ }
+}
+
+void Texture::setCompressedImage(GLsizei imageSize, const void *pixels, Image *image)
+{
+ if (pixels != NULL)
+ {
+ D3DLOCKED_RECT locked;
+ HRESULT result = image->lock(&locked, NULL);
+
+ if (SUCCEEDED(result))
+ {
+ int inputPitch = ComputeCompressedPitch(image->getWidth(), image->getFormat());
+ int inputSize = ComputeCompressedSize(image->getWidth(), image->getHeight(), image->getFormat());
+ image->loadCompressedData(0, 0, image->getWidth(), image->getHeight(), -inputPitch, static_cast<const char*>(pixels) + inputSize - inputPitch, locked.Pitch, locked.pBits);
+ image->unlock();
+ }
+
+ mDirtyImages = true;
+ }
+}
+
+bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image)
+{
+ if (width + xoffset > image->getWidth() || height + yoffset > image->getHeight())
+ {
+ error(GL_INVALID_VALUE);
+ return false;
+ }
+
+ if (IsCompressed(image->getFormat()))
+ {
+ error(GL_INVALID_OPERATION);
+ return false;
+ }
+
+ if (format != image->getFormat())
+ {
+ error(GL_INVALID_OPERATION);
+ return false;
+ }
+
+ if (pixels != NULL)
+ {
+ D3DLOCKED_RECT locked;
+ HRESULT result = image->lock(&locked, NULL);
+
+ if (SUCCEEDED(result))
+ {
+ image->loadData(xoffset, transformPixelYOffset(yoffset, height, image->getHeight()), width, height, type, unpackAlignment, pixels, locked.Pitch, locked.pBits);
+ image->unlock();
+ }
+
+ mDirtyImages = true;
+ }
+
+ return true;
+}
+
+bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image)
+{
+ if (width + xoffset > image->getWidth() || height + yoffset > image->getHeight())
+ {
+ error(GL_INVALID_VALUE);
+ return false;
+ }
+
+ if (format != getInternalFormat())
+ {
+ error(GL_INVALID_OPERATION);
+ return false;
+ }
+
+ if (pixels != NULL)
+ {
+ RECT updateRegion;
+ updateRegion.left = xoffset;
+ updateRegion.right = xoffset + width;
+ updateRegion.bottom = yoffset + height;
+ updateRegion.top = yoffset;
+
+ D3DLOCKED_RECT locked;
+ HRESULT result = image->lock(&locked, &updateRegion);
+
+ if (SUCCEEDED(result))
+ {
+ int inputPitch = ComputeCompressedPitch(width, format);
+ int inputSize = ComputeCompressedSize(width, height, format);
+ image->loadCompressedData(xoffset, transformPixelYOffset(yoffset, height, image->getHeight()), width, height, -inputPitch, static_cast<const char*>(pixels) + inputSize - inputPitch, locked.Pitch, locked.pBits);
+ image->unlock();
+ }
+
+ mDirtyImages = true;
+ }
+
+ return true;
}
IDirect3DBaseTexture9 *Texture::getTexture()
{
- if (!isComplete())
+ if (!isSamplerComplete())
{
return NULL;
}
- if (!getBaseTexture())
+ // ensure the underlying texture is created
+ if (getStorage(false) == NULL)
{
- createTexture();
+ return NULL;
}
updateTexture();
@@ -1219,32 +1576,44 @@ IDirect3DBaseTexture9 *Texture::getTexture()
return getBaseTexture();
}
-bool Texture::isDirtyParameter() const
+bool Texture::hasDirtyParameters() const
{
- return mDirtyParameter;
+ return mDirtyParameters;
}
-bool Texture::isDirtyImage() const
+bool Texture::hasDirtyImages() const
{
- return mDirtyImage;
+ return mDirtyImages;
}
void Texture::resetDirty()
{
- mDirtyParameter = false;
- mDirtyImage = false;
+ mDirtyParameters = false;
+ mDirtyImages = false;
+}
+
+unsigned int Texture::getTextureSerial()
+{
+ TextureStorage *texture = getStorage(false);
+ return texture ? texture->getTextureSerial() : 0;
}
-unsigned int Texture::getSerial() const
+unsigned int Texture::getRenderTargetSerial(GLenum target)
{
- return mSerial;
+ TextureStorage *texture = getStorage(true);
+ return texture ? texture->getRenderTargetSerial(target) : 0;
}
-GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const
+bool Texture::isImmutable() const
+{
+ return mImmutable;
+}
+
+GLint Texture::creationLevels(GLsizei width, GLsizei height) const
{
if ((isPow2(width) && isPow2(height)) || getContext()->supportsNonPower2Texture())
{
- return maxlevel;
+ return 0; // Maximum number of levels
}
else
{
@@ -1253,9 +1622,9 @@ GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) con
}
}
-GLint Texture::creationLevels(GLsizei size, GLint maxlevel) const
+GLint Texture::creationLevels(GLsizei size) const
{
- return creationLevels(size, size, maxlevel);
+ return creationLevels(size, size);
}
int Texture::levelCount() const
@@ -1263,27 +1632,105 @@ int Texture::levelCount() const
return getBaseTexture() ? getBaseTexture()->GetLevelCount() : 0;
}
-unsigned int Texture::issueSerial()
+Blit *Texture::getBlitter()
{
- return mCurrentSerial++;
+ Context *context = getContext();
+ return context->getBlitter();
}
-Texture2D::Texture2D(GLuint id) : Texture(id)
+bool Texture::copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *source, bool fromManaged)
{
- mTexture = NULL;
- mSurface = NULL;
+ if (source && dest)
+ {
+ HRESULT result;
+
+ if (fromManaged)
+ {
+ result = D3DXLoadSurfaceFromSurface(dest, NULL, NULL, source, NULL, NULL, D3DX_FILTER_BOX, 0);
+ }
+ else
+ {
+ egl::Display *display = getDisplay();
+ IDirect3DDevice9 *device = display->getDevice();
+
+ display->endScene();
+ result = device->StretchRect(source, NULL, dest, NULL, D3DTEXF_NONE);
+ }
+
+ if (FAILED(result))
+ {
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ return false;
+ }
+ }
+
+ return true;
}
-Texture2D::~Texture2D()
+TextureStorage2D::TextureStorage2D(IDirect3DTexture9 *surfaceTexture) : TextureStorage(true), mRenderTargetSerial(RenderbufferStorage::issueSerial())
{
- mColorbufferProxy.set(NULL);
+ mTexture = surfaceTexture;
+}
+
+TextureStorage2D::TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderTarget)
+ : TextureStorage(renderTarget), mRenderTargetSerial(RenderbufferStorage::issueSerial())
+{
+ IDirect3DDevice9 *device = getDevice();
+
+ mTexture = NULL;
+ HRESULT result = device->CreateTexture(width, height, levels, isRenderTarget() ? D3DUSAGE_RENDERTARGET : 0, format, getPool(), &mTexture, NULL);
+ if (FAILED(result))
+ {
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ error(GL_OUT_OF_MEMORY);
+ }
+}
+
+TextureStorage2D::~TextureStorage2D()
+{
if (mTexture)
{
mTexture->Release();
- mTexture = NULL;
}
+}
+
+IDirect3DSurface9 *TextureStorage2D::getSurfaceLevel(int level)
+{
+ IDirect3DSurface9 *surface = NULL;
+
+ if (mTexture)
+ {
+ HRESULT result = mTexture->GetSurfaceLevel(level, &surface);
+ ASSERT(SUCCEEDED(result));
+ }
+
+ return surface;
+}
+
+IDirect3DBaseTexture9 *TextureStorage2D::getBaseTexture() const
+{
+ return mTexture;
+}
+
+unsigned int TextureStorage2D::getRenderTargetSerial(GLenum target) const
+{
+ return mRenderTargetSerial;
+}
+
+Texture2D::Texture2D(GLuint id) : Texture(id)
+{
+ mTexStorage = NULL;
+ mSurface = NULL;
+}
+
+Texture2D::~Texture2D()
+{
+ mColorbufferProxy.set(NULL);
+ delete mTexStorage;
+ mTexStorage = NULL;
+
if (mSurface)
{
mSurface->setBoundTexture(NULL);
@@ -1296,24 +1743,30 @@ GLenum Texture2D::getTarget() const
return GL_TEXTURE_2D;
}
-GLsizei Texture2D::getWidth() const
+GLsizei Texture2D::getWidth(GLint level) const
{
- return mImageArray[0].width;
+ if (level < IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ return mImageArray[level].getWidth();
+ else
+ return 0;
}
-GLsizei Texture2D::getHeight() const
+GLsizei Texture2D::getHeight(GLint level) const
{
- return mImageArray[0].height;
+ if (level < IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ return mImageArray[level].getHeight();
+ else
+ return 0;
}
GLenum Texture2D::getInternalFormat() const
{
- return mImageArray[0].format;
+ return mImageArray[0].getFormat();
}
GLenum Texture2D::getType() const
{
- return mImageArray[0].type;
+ return mImageArray[0].getType();
}
D3DFORMAT Texture2D::getD3DFormat() const
@@ -1321,66 +1774,36 @@ D3DFORMAT Texture2D::getD3DFormat() const
return mImageArray[0].getD3DFormat();
}
-void Texture2D::redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type, bool forceRedefine)
+void Texture2D::redefineImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type)
{
- GLsizei textureWidth = mImageArray[0].width;
- GLsizei textureHeight = mImageArray[0].height;
- GLenum textureFormat = mImageArray[0].format;
- GLenum textureType = mImageArray[0].type;
+ releaseTexImage();
- mImageArray[level].width = width;
- mImageArray[level].height = height;
- mImageArray[level].format = format;
- mImageArray[level].type = type;
+ bool redefined = mImageArray[level].redefine(format, width, height, type, false);
- if (!mTexture)
- {
- return;
- }
-
- bool widthOkay = (textureWidth >> level == width) || (textureWidth >> level == 0 && width == 1);
- bool heightOkay = (textureHeight >> level == height) || (textureHeight >> level == 0 && height == 1);
- bool textureOkay = (widthOkay && heightOkay && textureFormat == format && textureType == type);
-
- if (!textureOkay || forceRedefine || mSurface) // Purge all the levels and the texture.
+ if (mTexStorage && redefined)
{
for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
{
- if (mImageArray[i].surface != NULL)
- {
- mImageArray[i].surface->Release();
- mImageArray[i].surface = NULL;
- mImageArray[i].dirty = true;
- }
- }
-
- if (mTexture != NULL)
- {
- mTexture->Release();
- mTexture = NULL;
- mDirtyImage = true;
- mIsRenderable = false;
- }
-
- if (mSurface)
- {
- mSurface->setBoundTexture(NULL);
- mSurface = NULL;
+ mImageArray[i].markDirty();
}
- mColorbufferProxy.set(NULL);
+ delete mTexStorage;
+ mTexStorage = NULL;
+ mDirtyImages = true;
}
}
void Texture2D::setImage(GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{
- redefineTexture(level, format, width, height, type, false);
+ redefineImage(level, format, width, height, type);
Texture::setImage(unpackAlignment, pixels, &mImageArray[level]);
}
void Texture2D::bindTexImage(egl::Surface *surface)
{
+ releaseTexImage();
+
GLenum format;
switch(surface->getFormat())
@@ -1396,56 +1819,58 @@ void Texture2D::bindTexImage(egl::Surface *surface)
return;
}
- redefineTexture(0, format, surface->getWidth(), surface->getHeight(), GL_UNSIGNED_BYTE, true);
+ mImageArray[0].redefine(format, surface->getWidth(), surface->getHeight(), GL_UNSIGNED_BYTE, true);
- IDirect3DTexture9 *texture = surface->getOffscreenTexture();
+ delete mTexStorage;
+ mTexStorage = new TextureStorage2D(surface->getOffscreenTexture());
- mTexture = texture;
- mDirtyImage = true;
- mIsRenderable = true;
+ mDirtyImages = true;
mSurface = surface;
mSurface->setBoundTexture(this);
}
void Texture2D::releaseTexImage()
{
- redefineTexture(0, GL_RGB, 0, 0, GL_UNSIGNED_BYTE, true);
+ if (mSurface)
+ {
+ mSurface->setBoundTexture(NULL);
+ mSurface = NULL;
+
+ if (mTexStorage)
+ {
+ delete mTexStorage;
+ mTexStorage = NULL;
+ }
+
+ for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
+ {
+ mImageArray[i].redefine(GL_RGBA, 0, 0, GL_UNSIGNED_BYTE, true);
+ }
+ }
}
void Texture2D::setCompressedImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
{
- redefineTexture(level, format, width, height, GL_UNSIGNED_BYTE, false);
+ redefineImage(level, format, width, height, GL_UNSIGNED_BYTE);
Texture::setCompressedImage(imageSize, pixels, &mImageArray[level]);
}
void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
{
- ASSERT(mImageArray[level].surface != NULL);
+ ASSERT(mImageArray[level].getSurface() != NULL);
if (level < levelCount())
{
- IDirect3DSurface9 *destLevel = NULL;
- HRESULT result = mTexture->GetSurfaceLevel(level, &destLevel);
+ IDirect3DSurface9 *destLevel = mTexStorage->getSurfaceLevel(level);
- ASSERT(SUCCEEDED(result));
-
- if (SUCCEEDED(result))
+ if (destLevel)
{
Image *image = &mImageArray[level];
-
- RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, image->height);;
-
- POINT destPoint;
- destPoint.x = sourceRect.left;
- destPoint.y = sourceRect.top;
-
- result = getDevice()->UpdateSurface(image->surface, &sourceRect, destLevel, &destPoint);
- ASSERT(SUCCEEDED(result));
+ image->updateSurface(destLevel, xoffset, yoffset, width, height);
destLevel->Release();
-
- image->dirty = false;
+ image->markClean();
}
}
}
@@ -1476,20 +1901,21 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
return error(GL_OUT_OF_MEMORY);
}
- redefineTexture(level, format, width, height, GL_UNSIGNED_BYTE, false);
+ redefineImage(level, format, width, height, GL_UNSIGNED_BYTE);
- if (!mImageArray[level].isRenderable())
+ if (!mImageArray[level].isRenderableFormat())
{
- copyToImage(&mImageArray[level], 0, 0, x, y, width, height, renderTarget);
+ mImageArray[level].copy(0, 0, x, y, width, height, renderTarget);
+ mDirtyImages = true;
}
else
{
- if (!mTexture || !mIsRenderable)
+ if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
- updateTexture();
+ mImageArray[level].markClean();
if (width != 0 && height != 0 && level < levelCount())
{
@@ -1499,20 +1925,24 @@ void Texture2D::copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei
sourceRect.right = clamp(sourceRect.right, 0, source->getColorbuffer()->getWidth());
sourceRect.bottom = clamp(sourceRect.bottom, 0, source->getColorbuffer()->getHeight());
- GLint destYOffset = transformPixelYOffset(0, height, mImageArray[level].height);
+ GLint destYOffset = transformPixelYOffset(0, height, mImageArray[level].getHeight());
- IDirect3DSurface9 *dest;
- HRESULT hr = mTexture->GetSurfaceLevel(level, &dest);
+ IDirect3DSurface9 *dest = mTexStorage->getSurfaceLevel(level);
- getBlitter()->copy(source->getRenderTarget(), sourceRect, format, 0, destYOffset, dest);
- dest->Release();
+ if (dest)
+ {
+ getBlitter()->copy(renderTarget, sourceRect, format, 0, destYOffset, dest);
+ dest->Release();
+ }
}
}
+
+ renderTarget->Release();
}
void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
{
- if (xoffset + width > mImageArray[level].width || yoffset + height > mImageArray[level].height)
+ if (xoffset + width > mImageArray[level].getWidth() || yoffset + height > mImageArray[level].getHeight())
{
return error(GL_INVALID_VALUE);
}
@@ -1525,15 +1955,14 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
return error(GL_OUT_OF_MEMORY);
}
- redefineTexture(level, mImageArray[level].format, mImageArray[level].width, mImageArray[level].height, GL_UNSIGNED_BYTE, false);
-
- if (!mImageArray[level].isRenderable() || (!mTexture && !isComplete()))
+ if (!mImageArray[level].isRenderableFormat() || (!mTexStorage && !isSamplerComplete()))
{
- copyToImage(&mImageArray[level], xoffset, yoffset, x, y, width, height, renderTarget);
+ mImageArray[level].copy(xoffset, yoffset, x, y, width, height, renderTarget);
+ mDirtyImages = true;
}
else
{
- if (!mTexture || !mIsRenderable)
+ if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
@@ -1548,22 +1977,61 @@ void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yo
sourceRect.right = clamp(sourceRect.right, 0, source->getColorbuffer()->getWidth());
sourceRect.bottom = clamp(sourceRect.bottom, 0, source->getColorbuffer()->getHeight());
- GLint destYOffset = transformPixelYOffset(yoffset, height, mImageArray[level].height);
+ GLint destYOffset = transformPixelYOffset(yoffset, height, mImageArray[level].getHeight());
+
+ IDirect3DSurface9 *dest = mTexStorage->getSurfaceLevel(level);
+
+ if (dest)
+ {
+ getBlitter()->copy(renderTarget, sourceRect, mImageArray[0].getFormat(), xoffset, destYOffset, dest);
+ dest->Release();
+ }
+ }
+ }
+
+ renderTarget->Release();
+}
- IDirect3DSurface9 *dest;
- HRESULT hr = mTexture->GetSurfaceLevel(level, &dest);
+void Texture2D::storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ GLenum format = gl::ExtractFormat(internalformat);
+ GLenum type = gl::ExtractType(internalformat);
+ D3DFORMAT d3dfmt = ConvertTextureFormatType(format, type);
+ const bool renderTarget = IsTextureFormatRenderable(d3dfmt) && (mUsage == GL_FRAMEBUFFER_ATTACHMENT_ANGLE);
- getBlitter()->copy(source->getRenderTarget(), sourceRect, mImageArray[0].format, xoffset, destYOffset, dest);
- dest->Release();
+ delete mTexStorage;
+ mTexStorage = new TextureStorage2D(levels, d3dfmt, width, height, renderTarget);
+ mImmutable = true;
+
+ for (int level = 0; level < levels; level++)
+ {
+ mImageArray[level].redefine(format, width, height, type, true);
+ width = std::max(1, width >> 1);
+ height = std::max(1, height >> 1);
+ }
+
+ for (int level = levels; level < IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
+ {
+ mImageArray[level].redefine(GL_NONE, 0, 0, GL_UNSIGNED_BYTE, true);
+ }
+
+ if (mTexStorage->isManaged())
+ {
+ int levels = levelCount();
+
+ for (int level = 0; level < levels; level++)
+ {
+ IDirect3DSurface9 *surface = mTexStorage->getSurfaceLevel(level);
+ mImageArray[level].setManagedSurface(surface);
}
}
}
-// Tests for GL texture object completeness. [OpenGL ES 2.0.24] section 3.7.10 page 81.
-bool Texture2D::isComplete() const
+// Tests for 2D texture sampling completeness. [OpenGL ES 2.0.24] section 3.8.2 page 85.
+bool Texture2D::isSamplerComplete() const
{
- GLsizei width = mImageArray[0].width;
- GLsizei height = mImageArray[0].height;
+ GLsizei width = mImageArray[0].getWidth();
+ GLsizei height = mImageArray[0].getHeight();
if (width <= 0 || height <= 0)
{
@@ -1584,11 +2052,11 @@ bool Texture2D::isComplete() const
case GL_LINEAR_MIPMAP_LINEAR:
mipmapping = true;
break;
- default: UNREACHABLE();
+ default: UNREACHABLE();
}
- if ((getInternalFormat() == GL_FLOAT && !getContext()->supportsFloatLinearFilter()) ||
- (getInternalFormat() == GL_HALF_FLOAT_OES && !getContext()->supportsHalfFloatLinearFilter()))
+ if ((getInternalFormat() == GL_FLOAT && !getContext()->supportsFloat32LinearFilter()) ||
+ (getInternalFormat() == GL_HALF_FLOAT_OES && !getContext()->supportsFloat16LinearFilter()))
{
if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST))
{
@@ -1596,9 +2064,9 @@ bool Texture2D::isComplete() const
}
}
- bool npot = getContext()->supportsNonPower2Texture();
+ bool npotSupport = getContext()->supportsNonPower2Texture();
- if (!npot)
+ if (!npotSupport)
{
if ((getWrapS() != GL_CLAMP_TO_EDGE && !isPow2(width)) ||
(getWrapT() != GL_CLAMP_TO_EDGE && !isPow2(height)))
@@ -1609,7 +2077,7 @@ bool Texture2D::isComplete() const
if (mipmapping)
{
- if (!npot)
+ if (!npotSupport)
{
if (!isPow2(width) || !isPow2(height))
{
@@ -1617,29 +2085,53 @@ bool Texture2D::isComplete() const
}
}
- int q = log2(std::max(width, height));
+ if (!isMipmapComplete())
+ {
+ return false;
+ }
+ }
- for (int level = 1; level <= q; level++)
+ return true;
+}
+
+// Tests for 2D texture (mipmap) completeness. [OpenGL ES 2.0.24] section 3.7.10 page 81.
+bool Texture2D::isMipmapComplete() const
+{
+ if (isImmutable())
+ {
+ return true;
+ }
+
+ GLsizei width = mImageArray[0].getWidth();
+ GLsizei height = mImageArray[0].getHeight();
+
+ if (width <= 0 || height <= 0)
+ {
+ return false;
+ }
+
+ int q = log2(std::max(width, height));
+
+ for (int level = 1; level <= q; level++)
+ {
+ if (mImageArray[level].getFormat() != mImageArray[0].getFormat())
{
- if (mImageArray[level].format != mImageArray[0].format)
- {
- return false;
- }
+ return false;
+ }
- if (mImageArray[level].type != mImageArray[0].type)
- {
- return false;
- }
+ if (mImageArray[level].getType() != mImageArray[0].getType())
+ {
+ return false;
+ }
- if (mImageArray[level].width != std::max(1, width >> level))
- {
- return false;
- }
+ if (mImageArray[level].getWidth() != std::max(1, width >> level))
+ {
+ return false;
+ }
- if (mImageArray[level].height != std::max(1, height >> level))
- {
- return false;
- }
+ if (mImageArray[level].getHeight() != std::max(1, height >> level))
+ {
+ return false;
}
}
@@ -1653,183 +2145,117 @@ bool Texture2D::isCompressed() const
IDirect3DBaseTexture9 *Texture2D::getBaseTexture() const
{
- return mTexture;
+ return mTexStorage ? mTexStorage->getBaseTexture() : NULL;
}
// Constructs a Direct3D 9 texture resource from the texture images
void Texture2D::createTexture()
{
- IDirect3DDevice9 *device = getDevice();
+ GLsizei width = mImageArray[0].getWidth();
+ GLsizei height = mImageArray[0].getHeight();
+ GLint levels = creationLevels(width, height);
D3DFORMAT format = mImageArray[0].getD3DFormat();
- GLint levels = creationLevels(mImageArray[0].width, mImageArray[0].height, 0);
+ const bool renderTarget = IsTextureFormatRenderable(format) && (mUsage == GL_FRAMEBUFFER_ATTACHMENT_ANGLE);
- IDirect3DTexture9 *texture = NULL;
- HRESULT result = device->CreateTexture(mImageArray[0].width, mImageArray[0].height, levels, 0, format, D3DPOOL_DEFAULT, &texture, NULL);
-
- if (FAILED(result))
+ delete mTexStorage;
+ mTexStorage = new TextureStorage2D(levels, format, width, height, renderTarget);
+
+ if (mTexStorage->isManaged())
{
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
- return error(GL_OUT_OF_MEMORY);
- }
+ int levels = levelCount();
- if (mTexture)
- {
- mTexture->Release();
+ for (int level = 0; level < levels; level++)
+ {
+ IDirect3DSurface9 *surface = mTexStorage->getSurfaceLevel(level);
+ mImageArray[level].setManagedSurface(surface);
+ }
}
- mTexture = texture;
- mDirtyImage = true;
- mIsRenderable = false;
+ mDirtyImages = true;
}
void Texture2D::updateTexture()
{
- IDirect3DDevice9 *device = getDevice();
-
int levels = levelCount();
for (int level = 0; level < levels; level++)
{
- if (mImageArray[level].surface && mImageArray[level].dirty)
- {
- IDirect3DSurface9 *levelSurface = NULL;
- HRESULT result = mTexture->GetSurfaceLevel(level, &levelSurface);
-
- ASSERT(SUCCEEDED(result));
-
- if (SUCCEEDED(result))
- {
- result = device->UpdateSurface(mImageArray[level].surface, NULL, levelSurface, NULL);
- ASSERT(SUCCEEDED(result));
-
- levelSurface->Release();
+ Image *image = &mImageArray[level];
- mImageArray[level].dirty = false;
- }
+ if (image->isDirty())
+ {
+ commitRect(level, 0, 0, mImageArray[level].getWidth(), mImageArray[level].getHeight());
}
}
}
void Texture2D::convertToRenderTarget()
{
- IDirect3DTexture9 *texture = NULL;
+ TextureStorage2D *newTexStorage = NULL;
- if (mImageArray[0].width != 0 && mImageArray[0].height != 0)
+ if (mImageArray[0].getWidth() != 0 && mImageArray[0].getHeight() != 0)
{
- egl::Display *display = getDisplay();
- IDirect3DDevice9 *device = getDevice();
+ GLsizei width = mImageArray[0].getWidth();
+ GLsizei height = mImageArray[0].getHeight();
+ GLint levels = creationLevels(width, height);
D3DFORMAT format = mImageArray[0].getD3DFormat();
- GLint levels = creationLevels(mImageArray[0].width, mImageArray[0].height, 0);
- HRESULT result = device->CreateTexture(mImageArray[0].width, mImageArray[0].height, levels, D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL);
+ newTexStorage = new TextureStorage2D(levels, format, width, height, true);
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
- return error(GL_OUT_OF_MEMORY);
- }
-
- if (mTexture != NULL)
+ if (mTexStorage != NULL)
{
int levels = levelCount();
for (int i = 0; i < levels; i++)
{
- IDirect3DSurface9 *source;
- result = mTexture->GetSurfaceLevel(i, &source);
-
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
-
- texture->Release();
-
- return error(GL_OUT_OF_MEMORY);
- }
-
- IDirect3DSurface9 *dest;
- result = texture->GetSurfaceLevel(i, &dest);
-
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
-
- texture->Release();
- source->Release();
-
- return error(GL_OUT_OF_MEMORY);
+ IDirect3DSurface9 *source = mTexStorage->getSurfaceLevel(i);
+ IDirect3DSurface9 *dest = newTexStorage->getSurfaceLevel(i);
+
+ if (!copyToRenderTarget(dest, source, mTexStorage->isManaged()))
+ {
+ delete newTexStorage;
+ source->Release();
+ dest->Release();
+ return error(GL_OUT_OF_MEMORY);
}
- display->endScene();
- result = device->StretchRect(source, NULL, dest, NULL, D3DTEXF_NONE);
-
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
-
- texture->Release();
- source->Release();
- dest->Release();
-
- return error(GL_OUT_OF_MEMORY);
- }
-
- source->Release();
- dest->Release();
+ if (source) source->Release();
+ if (dest) dest->Release();
}
}
}
- if (mTexture != NULL)
- {
- mTexture->Release();
- }
+ delete mTexStorage;
+ mTexStorage = newTexStorage;
- mTexture = texture;
- mDirtyImage = true;
- mIsRenderable = true;
+ mDirtyImages = true;
}
void Texture2D::generateMipmaps()
{
if (!getContext()->supportsNonPower2Texture())
{
- if (!isPow2(mImageArray[0].width) || !isPow2(mImageArray[0].height))
+ if (!isPow2(mImageArray[0].getWidth()) || !isPow2(mImageArray[0].getHeight()))
{
return error(GL_INVALID_OPERATION);
}
}
// Purge array levels 1 through q and reset them to represent the generated mipmap levels.
- unsigned int q = log2(std::max(mImageArray[0].width, mImageArray[0].height));
+ unsigned int q = log2(std::max(mImageArray[0].getWidth(), mImageArray[0].getHeight()));
for (unsigned int i = 1; i <= q; i++)
{
- if (mImageArray[i].surface != NULL)
- {
- mImageArray[i].surface->Release();
- mImageArray[i].surface = NULL;
- }
-
- mImageArray[i].width = std::max(mImageArray[0].width >> i, 1);
- mImageArray[i].height = std::max(mImageArray[0].height >> i, 1);
- mImageArray[i].format = mImageArray[0].format;
- mImageArray[i].type = mImageArray[0].type;
+ redefineImage(i, mImageArray[0].getFormat(),
+ std::max(mImageArray[0].getWidth() >> i, 1),
+ std::max(mImageArray[0].getHeight() >> i, 1),
+ mImageArray[0].getType());
}
- if (mIsRenderable)
+ if (mTexStorage && mTexStorage->isRenderTarget())
{
- if (mTexture == NULL)
- {
- ERR(" failed because mTexture was null.");
- return;
- }
-
for (unsigned int i = 1; i <= q; i++)
{
- IDirect3DSurface9 *upper = NULL;
- IDirect3DSurface9 *lower = NULL;
-
- mTexture->GetSurfaceLevel(i-1, &upper);
- mTexture->GetSurfaceLevel(i, &lower);
+ IDirect3DSurface9 *upper = mTexStorage->getSurfaceLevel(i - 1);
+ IDirect3DSurface9 *lower = mTexStorage->getSurfaceLevel(i);
if (upper != NULL && lower != NULL)
{
@@ -1839,26 +2265,24 @@ void Texture2D::generateMipmaps()
if (upper != NULL) upper->Release();
if (lower != NULL) lower->Release();
- mImageArray[i].dirty = false;
+ mImageArray[i].markClean();
}
}
else
{
for (unsigned int i = 1; i <= q; i++)
{
- createSurface(&mImageArray[i]);
-
- if (mImageArray[i].surface == NULL)
+ if (mImageArray[i].getSurface() == NULL)
{
return error(GL_OUT_OF_MEMORY);
}
- if (FAILED(D3DXLoadSurfaceFromSurface(mImageArray[i].surface, NULL, NULL, mImageArray[i - 1].surface, NULL, NULL, D3DX_FILTER_BOX, 0)))
+ if (FAILED(D3DXLoadSurfaceFromSurface(mImageArray[i].getSurface(), NULL, NULL, mImageArray[i - 1].getSurface(), NULL, NULL, D3DX_FILTER_BOX, 0)))
{
ERR(" failed to load filter %d to %d.", i - 1, i);
}
- mImageArray[i].dirty = true;
+ mImageArray[i].markDirty();
}
}
}
@@ -1872,7 +2296,7 @@ Renderbuffer *Texture2D::getRenderbuffer(GLenum target)
if (mColorbufferProxy.get() == NULL)
{
- mColorbufferProxy.set(new Renderbuffer(id(), new Colorbuffer(this, target)));
+ mColorbufferProxy.set(new Renderbuffer(id(), new RenderbufferTexture(this, target)));
}
return mColorbufferProxy.get();
@@ -1882,41 +2306,94 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target)
{
ASSERT(target == GL_TEXTURE_2D);
- if (!mIsRenderable)
- {
- convertToRenderTarget();
- }
-
- if (mTexture == NULL)
+ // ensure the underlying texture is created
+ if (getStorage(true) == NULL)
{
return NULL;
}
updateTexture();
- IDirect3DSurface9 *renderTarget = NULL;
- mTexture->GetSurfaceLevel(0, &renderTarget);
+ return mTexStorage->getSurfaceLevel(0);
+}
- return renderTarget;
+TextureStorage *Texture2D::getStorage(bool renderTarget)
+{
+ if (!mTexStorage || (renderTarget && !mTexStorage->isRenderTarget()))
+ {
+ if (renderTarget)
+ {
+ convertToRenderTarget();
+ }
+ else
+ {
+ createTexture();
+ }
+ }
+
+ return mTexStorage;
}
-TextureCubeMap::TextureCubeMap(GLuint id) : Texture(id)
+TextureStorageCubeMap::TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderTarget)
+ : TextureStorage(renderTarget), mFirstRenderTargetSerial(RenderbufferStorage::issueCubeSerials())
{
+ IDirect3DDevice9 *device = getDevice();
+
mTexture = NULL;
+ HRESULT result = device->CreateCubeTexture(size, levels, isRenderTarget() ? D3DUSAGE_RENDERTARGET : 0, format, getPool(), &mTexture, NULL);
+
+ if (FAILED(result))
+ {
+ ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
+ error(GL_OUT_OF_MEMORY);
+ }
}
-TextureCubeMap::~TextureCubeMap()
+TextureStorageCubeMap::~TextureStorageCubeMap()
{
- for (int i = 0; i < 6; i++)
+ if (mTexture)
{
- mFaceProxies[i].set(NULL);
+ mTexture->Release();
}
+}
+
+IDirect3DSurface9 *TextureStorageCubeMap::getCubeMapSurface(GLenum faceTarget, int level)
+{
+ IDirect3DSurface9 *surface = NULL;
if (mTexture)
{
- mTexture->Release();
- mTexture = NULL;
+ HRESULT result = mTexture->GetCubeMapSurface(es2dx::ConvertCubeFace(faceTarget), level, &surface);
+ ASSERT(SUCCEEDED(result));
+ }
+
+ return surface;
+}
+
+IDirect3DBaseTexture9 *TextureStorageCubeMap::getBaseTexture() const
+{
+ return mTexture;
+}
+
+unsigned int TextureStorageCubeMap::getRenderTargetSerial(GLenum target) const
+{
+ return mFirstRenderTargetSerial + TextureCubeMap::faceIndex(target);
+}
+
+TextureCubeMap::TextureCubeMap(GLuint id) : Texture(id)
+{
+ mTexStorage = NULL;
+}
+
+TextureCubeMap::~TextureCubeMap()
+{
+ for (int i = 0; i < 6; i++)
+ {
+ mFaceProxies[i].set(NULL);
}
+
+ delete mTexStorage;
+ mTexStorage = NULL;
}
GLenum TextureCubeMap::getTarget() const
@@ -1924,24 +2401,30 @@ GLenum TextureCubeMap::getTarget() const
return GL_TEXTURE_CUBE_MAP;
}
-GLsizei TextureCubeMap::getWidth() const
+GLsizei TextureCubeMap::getWidth(GLint level) const
{
- return mImageArray[0][0].width;
+ if (level < IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ return mImageArray[0][level].getWidth();
+ else
+ return 0;
}
-GLsizei TextureCubeMap::getHeight() const
+GLsizei TextureCubeMap::getHeight(GLint level) const
{
- return mImageArray[0][0].height;
+ if (level < IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ return mImageArray[0][level].getHeight();
+ else
+ return 0;
}
GLenum TextureCubeMap::getInternalFormat() const
{
- return mImageArray[0][0].format;
+ return mImageArray[0][0].getFormat();
}
GLenum TextureCubeMap::getType() const
{
- return mImageArray[0][0].type;
+ return mImageArray[0][0].getType();
}
D3DFORMAT TextureCubeMap::getD3DFormat() const
@@ -1981,37 +2464,27 @@ void TextureCubeMap::setImageNegZ(GLint level, GLsizei width, GLsizei height, GL
void TextureCubeMap::setCompressedImage(GLenum face, GLint level, GLenum format, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
{
- redefineTexture(faceIndex(face), level, format, width, height, GL_UNSIGNED_BYTE);
+ redefineImage(faceIndex(face), level, format, width, height, GL_UNSIGNED_BYTE);
Texture::setCompressedImage(imageSize, pixels, &mImageArray[faceIndex(face)][level]);
}
-void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
+void TextureCubeMap::commitRect(int face, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
{
- int face = faceIndex(faceTarget);
- ASSERT(mImageArray[face][level].surface != NULL);
+ ASSERT(mImageArray[face][level].getSurface() != NULL);
if (level < levelCount())
{
- IDirect3DSurface9 *destLevel = getCubeMapSurface(faceTarget, level);
+ IDirect3DSurface9 *destLevel = mTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level);
ASSERT(destLevel != NULL);
if (destLevel != NULL)
{
Image *image = &mImageArray[face][level];
-
- RECT sourceRect = transformPixelRect(xoffset, yoffset, width, height, image->height);;
-
- POINT destPoint;
- destPoint.x = sourceRect.left;
- destPoint.y = sourceRect.top;
-
- HRESULT result = getDevice()->UpdateSurface(image->surface, &sourceRect, destLevel, &destPoint);
- ASSERT(SUCCEEDED(result));
+ image->updateSurface(destLevel, xoffset, yoffset, width, height);
destLevel->Release();
-
- image->dirty = false;
+ image->markClean();
}
}
}
@@ -2020,7 +2493,7 @@ void TextureCubeMap::subImage(GLenum target, GLint level, GLint xoffset, GLint y
{
if (Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, &mImageArray[faceIndex(target)][level]))
{
- commitRect(target, level, xoffset, yoffset, width, height);
+ commitRect(faceIndex(target), level, xoffset, yoffset, width, height);
}
}
@@ -2028,19 +2501,14 @@ void TextureCubeMap::subImageCompressed(GLenum target, GLint level, GLint xoffse
{
if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[faceIndex(target)][level]))
{
- commitRect(target, level, xoffset, yoffset, width, height);
+ commitRect(faceIndex(target), level, xoffset, yoffset, width, height);
}
}
-// Tests for GL texture object completeness. [OpenGL ES 2.0.24] section 3.7.10 page 81.
-bool TextureCubeMap::isComplete() const
+// Tests for cube map sampling completeness. [OpenGL ES 2.0.24] section 3.8.2 page 86.
+bool TextureCubeMap::isSamplerComplete() const
{
- int size = mImageArray[0][0].width;
-
- if (size <= 0)
- {
- return false;
- }
+ int size = mImageArray[0][0].getWidth();
bool mipmapping;
@@ -2059,65 +2527,96 @@ bool TextureCubeMap::isComplete() const
default: UNREACHABLE();
}
- for (int face = 0; face < 6; face++)
+ if ((getInternalFormat() == GL_FLOAT && !getContext()->supportsFloat32LinearFilter()) ||
+ (getInternalFormat() == GL_HALF_FLOAT_OES && !getContext()->supportsFloat16LinearFilter()))
{
- if (mImageArray[face][0].width != size || mImageArray[face][0].height != size)
+ if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST))
{
return false;
}
}
- if ((getInternalFormat() == GL_FLOAT && !getContext()->supportsFloatLinearFilter()) ||
- (getInternalFormat() == GL_HALF_FLOAT_OES && !getContext()->supportsHalfFloatLinearFilter()))
+ if (!isPow2(size) && !getContext()->supportsNonPower2Texture())
{
- if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST))
+ if (getWrapS() != GL_CLAMP_TO_EDGE || getWrapT() != GL_CLAMP_TO_EDGE || mipmapping)
{
return false;
}
}
- bool npot = getContext()->supportsNonPower2Texture();
-
- if (!npot)
+ if (!mipmapping)
+ {
+ if (!isCubeComplete())
+ {
+ return false;
+ }
+ }
+ else
{
- if ((getWrapS() != GL_CLAMP_TO_EDGE || getWrapT() != GL_CLAMP_TO_EDGE) && !isPow2(size))
+ if (!isMipmapCubeComplete()) // Also tests for isCubeComplete()
{
return false;
}
}
- if (mipmapping)
+ return true;
+}
+
+// Tests for cube texture completeness. [OpenGL ES 2.0.24] section 3.7.10 page 81.
+bool TextureCubeMap::isCubeComplete() const
+{
+ if (mImageArray[0][0].getWidth() <= 0 || mImageArray[0][0].getHeight() != mImageArray[0][0].getWidth())
+ {
+ return false;
+ }
+
+ for (unsigned int face = 1; face < 6; face++)
{
- if (!npot)
+ if (mImageArray[face][0].getWidth() != mImageArray[0][0].getWidth() ||
+ mImageArray[face][0].getWidth() != mImageArray[0][0].getHeight() ||
+ mImageArray[face][0].getFormat() != mImageArray[0][0].getFormat() ||
+ mImageArray[face][0].getType() != mImageArray[0][0].getType())
{
- if (!isPow2(size))
- {
- return false;
- }
+ return false;
}
+ }
- int q = log2(size);
+ return true;
+}
- for (int face = 0; face < 6; face++)
+bool TextureCubeMap::isMipmapCubeComplete() const
+{
+ if (isImmutable())
+ {
+ return true;
+ }
+
+ if (!isCubeComplete())
+ {
+ return false;
+ }
+
+ GLsizei size = mImageArray[0][0].getWidth();
+
+ int q = log2(size);
+
+ for (int face = 0; face < 6; face++)
+ {
+ for (int level = 1; level <= q; level++)
{
- for (int level = 1; level <= q; level++)
+ if (mImageArray[face][level].getFormat() != mImageArray[0][0].getFormat())
{
- if (mImageArray[face][level].format != mImageArray[0][0].format)
- {
- return false;
- }
-
- if (mImageArray[face][level].type != mImageArray[0][0].type)
- {
- return false;
- }
+ return false;
+ }
- if (mImageArray[face][level].width != std::max(1, size >> level))
- {
- return false;
- }
+ if (mImageArray[face][level].getType() != mImageArray[0][0].getType())
+ {
+ return false;
+ }
- ASSERT(mImageArray[face][level].height == mImageArray[face][level].width);
+ if (mImageArray[face][level].getWidth() != std::max(1, size >> level))
+ {
+ return false;
}
}
}
@@ -2132,39 +2631,39 @@ bool TextureCubeMap::isCompressed() const
IDirect3DBaseTexture9 *TextureCubeMap::getBaseTexture() const
{
- return mTexture;
+ return mTexStorage ? mTexStorage->getBaseTexture() : NULL;
}
// Constructs a Direct3D 9 texture resource from the texture images, or returns an existing one
void TextureCubeMap::createTexture()
{
- IDirect3DDevice9 *device = getDevice();
+ GLsizei size = mImageArray[0][0].getWidth();
+ GLint levels = creationLevels(size, 0);
D3DFORMAT format = mImageArray[0][0].getD3DFormat();
- GLint levels = creationLevels(mImageArray[0][0].width, 0);
+ const bool renderTarget = IsTextureFormatRenderable(format) && (mUsage == GL_FRAMEBUFFER_ATTACHMENT_ANGLE);
- IDirect3DCubeTexture9 *texture = NULL;
- HRESULT result = device->CreateCubeTexture(mImageArray[0][0].width, levels, 0, format, D3DPOOL_DEFAULT, &texture, NULL);
+ delete mTexStorage;
+ mTexStorage = new TextureStorageCubeMap(levels, format, size, renderTarget);
- if (FAILED(result))
+ if (mTexStorage->isManaged())
{
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
- return error(GL_OUT_OF_MEMORY);
- }
+ int levels = levelCount();
- if (mTexture)
- {
- mTexture->Release();
+ for (int face = 0; face < 6; face++)
+ {
+ for (int level = 0; level < levels; level++)
+ {
+ IDirect3DSurface9 *surface = mTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level);
+ mImageArray[face][level].setManagedSurface(surface);
+ }
+ }
}
- mTexture = texture;
- mDirtyImage = true;
- mIsRenderable = false;
+ mDirtyImages = true;
}
void TextureCubeMap::updateTexture()
{
- IDirect3DDevice9 *device = getDevice();
-
for (int face = 0; face < 6; face++)
{
int levels = levelCount();
@@ -2172,20 +2671,9 @@ void TextureCubeMap::updateTexture()
{
Image *image = &mImageArray[face][level];
- if (image->surface && image->dirty)
+ if (image->isDirty())
{
- IDirect3DSurface9 *levelSurface = getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level);
- ASSERT(levelSurface != NULL);
-
- if (levelSurface != NULL)
- {
- HRESULT result = device->UpdateSurface(image->surface, NULL, levelSurface, NULL);
- ASSERT(SUCCEEDED(result));
-
- levelSurface->Release();
-
- image->dirty = false;
- }
+ commitRect(face, level, 0, 0, image->getWidth(), image->getHeight());
}
}
}
@@ -2193,86 +2681,53 @@ void TextureCubeMap::updateTexture()
void TextureCubeMap::convertToRenderTarget()
{
- IDirect3DCubeTexture9 *texture = NULL;
+ TextureStorageCubeMap *newTexStorage = NULL;
- if (mImageArray[0][0].width != 0)
+ if (mImageArray[0][0].getWidth() != 0)
{
- egl::Display *display = getDisplay();
- IDirect3DDevice9 *device = getDevice();
+ GLsizei size = mImageArray[0][0].getWidth();
+ GLint levels = creationLevels(size, 0);
D3DFORMAT format = mImageArray[0][0].getD3DFormat();
- GLint levels = creationLevels(mImageArray[0][0].width, 0);
- HRESULT result = device->CreateCubeTexture(mImageArray[0][0].width, levels, D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL);
+ newTexStorage = new TextureStorageCubeMap(levels, format, size, true);
- if (FAILED(result))
+ if (mTexStorage != NULL)
{
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
- return error(GL_OUT_OF_MEMORY);
- }
+ egl::Display *display = getDisplay();
+ IDirect3DDevice9 *device = display->getDevice();
- if (mTexture != NULL)
- {
int levels = levelCount();
for (int f = 0; f < 6; f++)
{
for (int i = 0; i < levels; i++)
{
- IDirect3DSurface9 *source;
- result = mTexture->GetCubeMapSurface(static_cast<D3DCUBEMAP_FACES>(f), i, &source);
-
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
-
- texture->Release();
+ IDirect3DSurface9 *source = mTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i);
+ IDirect3DSurface9 *dest = newTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i);
- return error(GL_OUT_OF_MEMORY);
- }
-
- IDirect3DSurface9 *dest;
- result = texture->GetCubeMapSurface(static_cast<D3DCUBEMAP_FACES>(f), i, &dest);
-
- if (FAILED(result))
+ if (!copyToRenderTarget(dest, source, mTexStorage->isManaged()))
{
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
-
- texture->Release();
- source->Release();
-
- return error(GL_OUT_OF_MEMORY);
+ delete newTexStorage;
+ source->Release();
+ dest->Release();
+ return error(GL_OUT_OF_MEMORY);
}
- display->endScene();
- result = device->StretchRect(source, NULL, dest, NULL, D3DTEXF_NONE);
-
- if (FAILED(result))
- {
- ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY);
-
- texture->Release();
- source->Release();
- dest->Release();
-
- return error(GL_OUT_OF_MEMORY);
- }
+ if (source) source->Release();
+ if (dest) dest->Release();
}
}
}
}
- if (mTexture != NULL)
- {
- mTexture->Release();
- }
+ delete mTexStorage;
+ mTexStorage = newTexStorage;
- mTexture = texture;
- mDirtyImage = true;
- mIsRenderable = true;
+ mDirtyImages = true;
}
void TextureCubeMap::setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
{
- redefineTexture(faceIndex, level, format, width, height, type);
+ redefineImage(faceIndex, level, format, width, height, type);
Texture::setImage(unpackAlignment, pixels, &mImageArray[faceIndex][level]);
}
@@ -2288,48 +2743,24 @@ unsigned int TextureCubeMap::faceIndex(GLenum face)
return face - GL_TEXTURE_CUBE_MAP_POSITIVE_X;
}
-void TextureCubeMap::redefineTexture(int face, GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type)
+void TextureCubeMap::redefineImage(int face, GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type)
{
- GLsizei textureWidth = mImageArray[0][0].width;
- GLsizei textureHeight = mImageArray[0][0].height;
- GLenum textureFormat = mImageArray[0][0].format;
- GLenum textureType = mImageArray[0][0].type;
+ bool redefined = mImageArray[face][level].redefine(format, width, height, type, false);
- mImageArray[face][level].width = width;
- mImageArray[face][level].height = height;
- mImageArray[face][level].format = format;
- mImageArray[face][level].type = type;
-
- if (!mTexture)
- {
- return;
- }
-
- bool sizeOkay = (textureWidth >> level == width);
- bool textureOkay = (sizeOkay && textureFormat == format && textureType == type);
-
- if (!textureOkay) // Purge all the levels and the texture.
+ if (mTexStorage && redefined)
{
for (int i = 0; i < IMPLEMENTATION_MAX_TEXTURE_LEVELS; i++)
{
for (int f = 0; f < 6; f++)
{
- if (mImageArray[f][i].surface != NULL)
- {
- mImageArray[f][i].surface->Release();
- mImageArray[f][i].surface = NULL;
- mImageArray[f][i].dirty = true;
- }
+ mImageArray[f][i].markDirty();
}
}
- if (mTexture != NULL)
- {
- mTexture->Release();
- mTexture = NULL;
- mDirtyImage = true;
- mIsRenderable = false;
- }
+ delete mTexStorage;
+ mTexStorage = NULL;
+
+ mDirtyImages = true;
}
}
@@ -2344,20 +2775,21 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
}
unsigned int faceindex = faceIndex(target);
- redefineTexture(faceindex, level, format, width, height, GL_UNSIGNED_BYTE);
+ redefineImage(faceindex, level, format, width, height, GL_UNSIGNED_BYTE);
- if (!mImageArray[faceindex][level].isRenderable())
+ if (!mImageArray[faceindex][level].isRenderableFormat())
{
- copyToImage(&mImageArray[faceindex][level], 0, 0, x, y, width, height, renderTarget);
+ mImageArray[faceindex][level].copy(0, 0, x, y, width, height, renderTarget);
+ mDirtyImages = true;
}
else
{
- if (!mTexture || !mIsRenderable)
+ if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
- updateTexture();
+ mImageArray[faceindex][level].markClean();
ASSERT(width == height);
@@ -2369,34 +2801,24 @@ void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum format, GLint
sourceRect.right = clamp(sourceRect.right, 0, source->getColorbuffer()->getWidth());
sourceRect.bottom = clamp(sourceRect.bottom, 0, source->getColorbuffer()->getHeight());
- GLint destYOffset = transformPixelYOffset(0, height, mImageArray[faceindex][level].width);
+ GLint destYOffset = transformPixelYOffset(0, height, mImageArray[faceindex][level].getWidth());
- IDirect3DSurface9 *dest = getCubeMapSurface(target, level);
+ IDirect3DSurface9 *dest = mTexStorage->getCubeMapSurface(target, level);
- getBlitter()->copy(source->getRenderTarget(), sourceRect, format, 0, destYOffset, dest);
- dest->Release();
+ if (dest)
+ {
+ getBlitter()->copy(renderTarget, sourceRect, format, 0, destYOffset, dest);
+ dest->Release();
+ }
}
}
-}
-
-IDirect3DSurface9 *TextureCubeMap::getCubeMapSurface(GLenum face, unsigned int level)
-{
- if (mTexture == NULL)
- {
- UNREACHABLE();
- return NULL;
- }
-
- IDirect3DSurface9 *surface = NULL;
- HRESULT hr = mTexture->GetCubeMapSurface(es2dx::ConvertCubeFace(face), level, &surface);
-
- return (SUCCEEDED(hr)) ? surface : NULL;
+ renderTarget->Release();
}
void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source)
{
- GLsizei size = mImageArray[faceIndex(target)][level].width;
+ GLsizei size = mImageArray[faceIndex(target)][level].getWidth();
if (xoffset + width > size || yoffset + height > size)
{
@@ -2412,15 +2834,15 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
}
unsigned int faceindex = faceIndex(target);
- redefineTexture(faceindex, level, mImageArray[faceindex][level].format, mImageArray[faceindex][level].width, mImageArray[faceindex][level].height, GL_UNSIGNED_BYTE);
-
- if (!mImageArray[faceindex][level].isRenderable() || (!mTexture && !isComplete()))
+
+ if (!mImageArray[faceindex][level].isRenderableFormat() || (!mTexStorage && !isSamplerComplete()))
{
- copyToImage(&mImageArray[faceindex][level], 0, 0, x, y, width, height, renderTarget);
+ mImageArray[faceindex][level].copy(0, 0, x, y, width, height, renderTarget);
+ mDirtyImages = true;
}
else
{
- if (!mTexture || !mIsRenderable)
+ if (!mTexStorage || !mTexStorage->isRenderTarget())
{
convertToRenderTarget();
}
@@ -2435,33 +2857,62 @@ void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLi
sourceRect.right = clamp(sourceRect.right, 0, source->getColorbuffer()->getWidth());
sourceRect.bottom = clamp(sourceRect.bottom, 0, source->getColorbuffer()->getHeight());
- GLint destYOffset = transformPixelYOffset(yoffset, height, mImageArray[faceindex][level].width);
+ GLint destYOffset = transformPixelYOffset(yoffset, height, mImageArray[faceindex][level].getWidth());
- IDirect3DSurface9 *dest = getCubeMapSurface(target, level);
+ IDirect3DSurface9 *dest = mTexStorage->getCubeMapSurface(target, level);
- getBlitter()->copy(source->getRenderTarget(), sourceRect, mImageArray[0][0].format, xoffset, destYOffset, dest);
- dest->Release();
+ if (dest)
+ {
+ getBlitter()->copy(renderTarget, sourceRect, mImageArray[0][0].getFormat(), xoffset, destYOffset, dest);
+ dest->Release();
+ }
}
}
+
+ renderTarget->Release();
}
-bool TextureCubeMap::isCubeComplete() const
+void TextureCubeMap::storage(GLsizei levels, GLenum internalformat, GLsizei size)
{
- if (mImageArray[0][0].width == 0)
+ GLenum format = gl::ExtractFormat(internalformat);
+ GLenum type = gl::ExtractType(internalformat);
+ D3DFORMAT d3dfmt = ConvertTextureFormatType(format, type);
+ const bool renderTarget = IsTextureFormatRenderable(d3dfmt) && (mUsage == GL_FRAMEBUFFER_ATTACHMENT_ANGLE);
+
+ delete mTexStorage;
+ mTexStorage = new TextureStorageCubeMap(levels, d3dfmt, size, renderTarget);
+ mImmutable = true;
+
+ for (int level = 0; level < levels; level++)
{
- return false;
+ for (int face = 0; face < 6; face++)
+ {
+ mImageArray[face][level].redefine(format, size, size, type, true);
+ size = std::max(1, size >> 1);
+ }
}
- for (unsigned int f = 1; f < 6; f++)
+ for (int level = levels; level < IMPLEMENTATION_MAX_TEXTURE_LEVELS; level++)
{
- if (mImageArray[f][0].width != mImageArray[0][0].width
- || mImageArray[f][0].format != mImageArray[0][0].format)
+ for (int face = 0; face < 6; face++)
{
- return false;
+ mImageArray[face][level].redefine(GL_NONE, 0, 0, GL_UNSIGNED_BYTE, true);
}
}
- return true;
+ if (mTexStorage->isManaged())
+ {
+ int levels = levelCount();
+
+ for (int face = 0; face < 6; face++)
+ {
+ for (int level = 0; level < levels; level++)
+ {
+ IDirect3DSurface9 *surface = mTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, level);
+ mImageArray[face][level].setManagedSurface(surface);
+ }
+ }
+ }
}
void TextureCubeMap::generateMipmaps()
@@ -2473,44 +2924,33 @@ void TextureCubeMap::generateMipmaps()
if (!getContext()->supportsNonPower2Texture())
{
- if (!isPow2(mImageArray[0][0].width))
+ if (!isPow2(mImageArray[0][0].getWidth()))
{
return error(GL_INVALID_OPERATION);
}
}
// Purge array levels 1 through q and reset them to represent the generated mipmap levels.
- unsigned int q = log2(mImageArray[0][0].width);
+ unsigned int q = log2(mImageArray[0][0].getWidth());
for (unsigned int f = 0; f < 6; f++)
{
for (unsigned int i = 1; i <= q; i++)
{
- if (mImageArray[f][i].surface != NULL)
- {
- mImageArray[f][i].surface->Release();
- mImageArray[f][i].surface = NULL;
- }
-
- mImageArray[f][i].width = std::max(mImageArray[f][0].width >> i, 1);
- mImageArray[f][i].height = mImageArray[f][i].width;
- mImageArray[f][i].format = mImageArray[f][0].format;
- mImageArray[f][i].type = mImageArray[f][0].type;
+ redefineImage(f, i, mImageArray[f][0].getFormat(),
+ std::max(mImageArray[f][0].getWidth() >> i, 1),
+ std::max(mImageArray[f][0].getWidth() >> i, 1),
+ mImageArray[f][0].getType());
}
}
- if (mIsRenderable)
+ if (mTexStorage && mTexStorage->isRenderTarget())
{
- if (mTexture == NULL)
- {
- return;
- }
-
for (unsigned int f = 0; f < 6; f++)
{
for (unsigned int i = 1; i <= q; i++)
{
- IDirect3DSurface9 *upper = getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i-1);
- IDirect3DSurface9 *lower = getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i);
+ IDirect3DSurface9 *upper = mTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i-1);
+ IDirect3DSurface9 *lower = mTexStorage->getCubeMapSurface(GL_TEXTURE_CUBE_MAP_POSITIVE_X + f, i);
if (upper != NULL && lower != NULL)
{
@@ -2520,7 +2960,7 @@ void TextureCubeMap::generateMipmaps()
if (upper != NULL) upper->Release();
if (lower != NULL) lower->Release();
- mImageArray[f][i].dirty = false;
+ mImageArray[f][i].markClean();
}
}
}
@@ -2530,18 +2970,17 @@ void TextureCubeMap::generateMipmaps()
{
for (unsigned int i = 1; i <= q; i++)
{
- createSurface(&mImageArray[f][i]);
- if (mImageArray[f][i].surface == NULL)
+ if (mImageArray[f][i].getSurface() == NULL)
{
return error(GL_OUT_OF_MEMORY);
}
- if (FAILED(D3DXLoadSurfaceFromSurface(mImageArray[f][i].surface, NULL, NULL, mImageArray[f][i - 1].surface, NULL, NULL, D3DX_FILTER_BOX, 0)))
+ if (FAILED(D3DXLoadSurfaceFromSurface(mImageArray[f][i].getSurface(), NULL, NULL, mImageArray[f][i - 1].getSurface(), NULL, NULL, D3DX_FILTER_BOX, 0)))
{
ERR(" failed to load filter %d to %d.", i - 1, i);
}
- mImageArray[f][i].dirty = true;
+ mImageArray[f][i].markDirty();
}
}
}
@@ -2558,7 +2997,7 @@ Renderbuffer *TextureCubeMap::getRenderbuffer(GLenum target)
if (mFaceProxies[face].get() == NULL)
{
- mFaceProxies[face].set(new Renderbuffer(id(), new Colorbuffer(this, target)));
+ mFaceProxies[face].set(new Renderbuffer(id(), new RenderbufferTexture(this, target)));
}
return mFaceProxies[face].get();
@@ -2568,22 +3007,32 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target)
{
ASSERT(IsCubemapTextureTarget(target));
- if (!mIsRenderable)
- {
- convertToRenderTarget();
- }
-
- if (mTexture == NULL)
+ // ensure the underlying texture is created
+ if (getStorage(true) == NULL)
{
return NULL;
}
updateTexture();
- IDirect3DSurface9 *renderTarget = NULL;
- mTexture->GetCubeMapSurface(es2dx::ConvertCubeFace(target), 0, &renderTarget);
-
- return renderTarget;
+ return mTexStorage->getCubeMapSurface(target, 0);
}
+TextureStorage *TextureCubeMap::getStorage(bool renderTarget)
+{
+ if (!mTexStorage || (renderTarget && !mTexStorage->isRenderTarget()))
+ {
+ if (renderTarget)
+ {
+ convertToRenderTarget();
+ }
+ else
+ {
+ createTexture();
+ }
+ }
+
+ return mTexStorage;
}
+
+} \ No newline at end of file
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.h b/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.h
index 5bdb2fb0f..c2dd719f7 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/Texture.h
@@ -43,6 +43,129 @@ enum
IMPLEMENTATION_MAX_TEXTURE_LEVELS = 15 // 1+log2 of MAX_TEXTURE_SIZE
};
+class Image
+{
+ public:
+ Image();
+ ~Image();
+
+ bool redefine(GLenum format, GLsizei width, GLsizei height, GLenum type, bool forceRelease);
+ void markDirty() {mDirty = true;}
+ void markClean() {mDirty = false;}
+
+ HRESULT lock(D3DLOCKED_RECT *lockedRect, const RECT *rect);
+ void unlock();
+
+ bool isRenderableFormat() const;
+ D3DFORMAT getD3DFormat() const;
+
+ GLsizei getWidth() const {return mWidth;}
+ GLsizei getHeight() const {return mHeight;}
+ GLenum getFormat() const {return mFormat;}
+ GLenum getType() const {return mType;}
+ bool isDirty() const {return mSurface && mDirty;}
+ IDirect3DSurface9 *getSurface();
+
+ void setManagedSurface(IDirect3DSurface9 *surface);
+ void updateSurface(IDirect3DSurface9 *dest, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
+
+ void loadData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum type,
+ GLint unpackAlignment, const void *input, std::size_t outputPitch, void *output) const;
+
+ void loadAlphaData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadAlphaFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadAlphaHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadLuminanceData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const;
+ void loadLuminanceFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadLuminanceHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadLuminanceAlphaData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const;
+ void loadLuminanceAlphaFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadLuminanceAlphaHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBUByteData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGB565Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBAUByteDataSSE2(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBAUByteData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBA4444Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBA5551Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBAFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadRGBAHalfFloatData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadBGRAData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadCompressedData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadDXT1Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadDXT3Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+ void loadDXT5Data(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
+ int inputPitch, const void *input, size_t outputPitch, void *output) const;
+
+ void copy(GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Image);
+
+ void createSurface();
+
+ GLsizei mWidth;
+ GLsizei mHeight;
+ GLenum mFormat;
+ GLenum mType;
+
+ bool mDirty;
+
+ D3DPOOL mD3DPool; // can only be D3DPOOL_SYSTEMMEM or D3DPOOL_MANAGED since it needs to be lockable.
+ D3DFORMAT mD3DFormat;
+
+ IDirect3DSurface9 *mSurface;
+};
+
+class TextureStorage
+{
+ public:
+ explicit TextureStorage(bool renderTarget);
+
+ virtual ~TextureStorage();
+
+ bool isRenderTarget() const;
+ bool isManaged() const;
+ D3DPOOL getPool() const;
+ unsigned int getTextureSerial() const;
+ virtual unsigned int getRenderTargetSerial(GLenum target) const = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TextureStorage);
+
+ const bool mRenderTarget;
+ const D3DPOOL mD3DPool;
+
+ const unsigned int mTextureSerial;
+ static unsigned int issueTextureSerial();
+
+ static unsigned int mCurrentTextureSerial;
+};
+
class Texture : public RefCountObject
{
public:
@@ -56,19 +179,21 @@ class Texture : public RefCountObject
bool setMagFilter(GLenum filter);
bool setWrapS(GLenum wrap);
bool setWrapT(GLenum wrap);
+ bool setUsage(GLenum usage);
GLenum getMinFilter() const;
GLenum getMagFilter() const;
GLenum getWrapS() const;
GLenum getWrapT() const;
+ GLenum getUsage() const;
- virtual GLsizei getWidth() const = 0;
- virtual GLsizei getHeight() const = 0;
+ virtual GLsizei getWidth(GLint level) const = 0;
+ virtual GLsizei getHeight(GLint level) const = 0;
virtual GLenum getInternalFormat() const = 0;
virtual GLenum getType() const = 0;
virtual D3DFORMAT getD3DFormat() const = 0;
- virtual bool isComplete() const = 0;
+ virtual bool isSamplerComplete() const = 0;
virtual bool isCompressed() const = 0;
IDirect3DBaseTexture9 *getTexture();
@@ -77,43 +202,26 @@ class Texture : public RefCountObject
virtual void generateMipmaps() = 0;
virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source) = 0;
- bool isDirtyParameter() const;
- bool isDirtyImage() const;
+ bool hasDirtyParameters() const;
+ bool hasDirtyImages() const;
void resetDirty();
- unsigned int getSerial() const;
+ unsigned int getTextureSerial();
+ unsigned int getRenderTargetSerial(GLenum target);
+
+ bool isImmutable() const;
static const GLuint INCOMPLETE_TEXTURE_ID = static_cast<GLuint>(-1); // Every texture takes an id at creation time. The value is arbitrary because it is never registered with the resource manager.
protected:
- friend class Colorbuffer;
-
- // Helper structure representing a single image layer
- struct Image
- {
- Image();
- ~Image();
-
- bool isRenderable() const;
- D3DFORMAT getD3DFormat() const;
-
- GLsizei width;
- GLsizei height;
- GLenum format;
- GLenum type;
-
- bool dirty;
-
- IDirect3DSurface9 *surface;
- };
+ friend class RenderbufferTexture;
void setImage(GLint unpackAlignment, const void *pixels, Image *image);
bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *image);
void setCompressedImage(GLsizei imageSize, const void *pixels, Image *image);
bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *image);
- void copyToImage(Image *image, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget);
- GLint creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const;
- GLint creationLevels(GLsizei size, GLint maxlevel) const;
+ GLint creationLevels(GLsizei width, GLsizei height) const;
+ GLint creationLevels(GLsizei size) const;
virtual IDirect3DBaseTexture9 *getBaseTexture() const = 0;
virtual void createTexture() = 0;
@@ -121,76 +229,46 @@ class Texture : public RefCountObject
virtual void convertToRenderTarget() = 0;
virtual IDirect3DSurface9 *getRenderTarget(GLenum target) = 0;
- void createSurface(Image *image);
-
- Blit *getBlitter();
-
int levelCount() const;
+ static Blit *getBlitter();
+ static bool copyToRenderTarget(IDirect3DSurface9 *dest, IDirect3DSurface9 *source, bool fromManaged);
+
GLenum mMinFilter;
GLenum mMagFilter;
GLenum mWrapS;
GLenum mWrapT;
- bool mDirtyParameter;
+ bool mDirtyParameters;
+ GLenum mUsage;
- bool mDirtyImage;
+ bool mDirtyImages;
- bool mIsRenderable;
+ bool mImmutable;
private:
DISALLOW_COPY_AND_ASSIGN(Texture);
- void loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
- GLint unpackAlignment, const void *input, std::size_t outputPitch, void *output, D3DSURFACE_DESC *description) const;
+ virtual TextureStorage *getStorage(bool renderTarget) = 0;
+};
- void loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadLuminanceImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const;
- void loadLuminanceFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadLuminanceHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadLuminanceAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output, bool native) const;
- void loadLuminanceAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadLuminanceAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGB565ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBAUByteImageDataSSE2(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBAUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBA4444ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBA5551ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBAFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadRGBAHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
- void loadCompressedImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
- int inputPitch, const void *input, size_t outputPitch, void *output) const;
+class TextureStorage2D : public TextureStorage
+{
+ public:
+ explicit TextureStorage2D(IDirect3DTexture9 *surfaceTexture);
+ TextureStorage2D(int levels, D3DFORMAT format, int width, int height, bool renderTarget);
+
+ virtual ~TextureStorage2D();
- static unsigned int issueSerial();
+ IDirect3DSurface9 *getSurfaceLevel(int level);
+ IDirect3DBaseTexture9 *getBaseTexture() const;
- const unsigned int mSerial;
+ virtual unsigned int getRenderTargetSerial(GLenum target) const;
- static unsigned int mCurrentSerial;
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TextureStorage2D);
+
+ IDirect3DTexture9 *mTexture;
+ const unsigned int mRenderTargetSerial;
};
class Texture2D : public Texture
@@ -202,8 +280,8 @@ class Texture2D : public Texture
virtual GLenum getTarget() const;
- virtual GLsizei getWidth() const;
- virtual GLsizei getHeight() const;
+ virtual GLsizei getWidth(GLint level) const;
+ virtual GLsizei getHeight(GLint level) const;
virtual GLenum getInternalFormat() const;
virtual GLenum getType() const;
virtual D3DFORMAT getD3DFormat() const;
@@ -213,9 +291,10 @@ class Texture2D : public Texture
void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
- void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
+ virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
+ void storage(GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
- virtual bool isComplete() const;
+ virtual bool isSamplerComplete() const;
virtual bool isCompressed() const;
virtual void bindTexImage(egl::Surface *surface);
virtual void releaseTexImage();
@@ -232,18 +311,40 @@ class Texture2D : public Texture
virtual void updateTexture();
virtual void convertToRenderTarget();
virtual IDirect3DSurface9 *getRenderTarget(GLenum target);
+ virtual TextureStorage *getStorage(bool renderTarget);
+
+ bool isMipmapComplete() const;
- void redefineTexture(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type, bool force);
+ void redefineImage(GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
Image mImageArray[IMPLEMENTATION_MAX_TEXTURE_LEVELS];
- IDirect3DTexture9 *mTexture;
+ TextureStorage2D *mTexStorage;
egl::Surface *mSurface;
BindingPointer<Renderbuffer> mColorbufferProxy;
};
+class TextureStorageCubeMap : public TextureStorage
+{
+ public:
+ TextureStorageCubeMap(int levels, D3DFORMAT format, int size, bool renderTarget);
+
+ virtual ~TextureStorageCubeMap();
+
+ IDirect3DSurface9 *getCubeMapSurface(GLenum faceTarget, int level);
+ IDirect3DBaseTexture9 *getBaseTexture() const;
+
+ virtual unsigned int getRenderTargetSerial(GLenum target) const;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(TextureStorageCubeMap);
+
+ IDirect3DCubeTexture9 *mTexture;
+ const unsigned int mFirstRenderTargetSerial;
+};
+
class TextureCubeMap : public Texture
{
public:
@@ -253,8 +354,8 @@ class TextureCubeMap : public Texture
virtual GLenum getTarget() const;
- virtual GLsizei getWidth() const;
- virtual GLsizei getHeight() const;
+ virtual GLsizei getWidth(GLint level) const;
+ virtual GLsizei getHeight(GLint level) const;
virtual GLenum getInternalFormat() const;
virtual GLenum getType() const;
virtual D3DFORMAT getD3DFormat() const;
@@ -272,14 +373,17 @@ class TextureCubeMap : public Texture
void subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels);
void copyImage(GLenum target, GLint level, GLenum format, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
virtual void copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, Framebuffer *source);
+ void storage(GLsizei levels, GLenum internalformat, GLsizei size);
- virtual bool isComplete() const;
+ virtual bool isSamplerComplete() const;
virtual bool isCompressed() const;
virtual void generateMipmaps();
virtual Renderbuffer *getRenderbuffer(GLenum target);
+ static unsigned int faceIndex(GLenum face);
+
private:
DISALLOW_COPY_AND_ASSIGN(TextureCubeMap);
@@ -288,25 +392,21 @@ class TextureCubeMap : public Texture
virtual void updateTexture();
virtual void convertToRenderTarget();
virtual IDirect3DSurface9 *getRenderTarget(GLenum target);
-
- // face is one of the GL_TEXTURE_CUBE_MAP_* enumerants.
- // Returns NULL if the call underlying Direct3D call fails.
- IDirect3DSurface9 *getCubeMapSurface(GLenum face, unsigned int level);
-
- static unsigned int faceIndex(GLenum face);
+ virtual TextureStorage *getStorage(bool renderTarget);
bool isCubeComplete() const;
+ bool isMipmapCubeComplete() const;
void setImage(int faceIndex, GLint level, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels);
- void commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
- void redefineTexture(int faceIndex, GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
+ void commitRect(int faceIndex, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height);
+ void redefineImage(int faceIndex, GLint level, GLenum format, GLsizei width, GLsizei height, GLenum type);
Image mImageArray[6][IMPLEMENTATION_MAX_TEXTURE_LEVELS];
- IDirect3DCubeTexture9 *mTexture;
+ TextureStorageCubeMap *mTexStorage;
BindingPointer<Renderbuffer> mFaceProxies[6];
};
}
-#endif // LIBGLESV2_TEXTURE_H_
+#endif // LIBGLESV2_TEXTURE_H_ \ No newline at end of file
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.cpp
index a7716cee0..698d8b9bd 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.cpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -21,10 +21,19 @@
namespace
{
enum { INITIAL_STREAM_BUFFER_SIZE = 1024*1024 };
+ // This has to be at least 4k or else it fails on ATI cards.
+ enum { CONSTANT_VERTEX_BUFFER_SIZE = 4096 };
}
namespace gl
{
+unsigned int VertexBuffer::mCurrentSerial = 1;
+
+int elementsInBuffer(const VertexAttribute &attribute, int size)
+{
+ int stride = attribute.stride();
+ return (size - attribute.mOffset % stride + (stride - attribute.typeSize())) / stride;
+}
VertexDataManager::VertexDataManager(Context *context, IDirect3DDevice9 *device) : mContext(context), mDevice(device)
{
@@ -32,6 +41,7 @@ VertexDataManager::VertexDataManager(Context *context, IDirect3DDevice9 *device)
{
mDirtyCurrentValue[i] = true;
mCurrentValueBuffer[i] = NULL;
+ mCurrentValueOffsets[i] = 0;
}
const D3DCAPS9 &caps = context->getDeviceCaps();
@@ -55,14 +65,14 @@ VertexDataManager::~VertexDataManager()
}
}
-UINT VertexDataManager::writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute)
+std::size_t VertexDataManager::writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute)
{
Buffer *buffer = attribute.mBoundBuffer.get();
int inputStride = attribute.stride();
int elementSize = attribute.typeSize();
const FormatConverter &converter = formatConverter(attribute);
- UINT streamOffset = 0;
+ std::size_t streamOffset = 0;
void *output = NULL;
@@ -133,16 +143,30 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
{
if (staticBuffer->size() == 0)
{
- int totalCount = buffer->size() / attribs[i].stride();
+ int totalCount = elementsInBuffer(attribs[i], buffer->size());
staticBuffer->addRequiredSpace(spaceRequired(attribs[i], totalCount));
}
else if (staticBuffer->lookupAttribute(attribs[i]) == -1)
{
// This static buffer doesn't have matching attributes, so fall back to using the streaming buffer
- mStreamingBuffer->addRequiredSpaceFor(staticBuffer);
- buffer->invalidateStaticData();
+ // Add the space of all previous attributes belonging to the invalidated static buffer to the streaming buffer
+ for (int previous = 0; previous < i; previous++)
+ {
+ if (translated[previous].active && attribs[previous].mArrayEnabled)
+ {
+ Buffer *previousBuffer = attribs[previous].mBoundBuffer.get();
+ StaticVertexBuffer *previousStaticBuffer = previousBuffer ? previousBuffer->getStaticVertexBuffer() : NULL;
+
+ if (staticBuffer == previousStaticBuffer)
+ {
+ mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[previous], count));
+ }
+ }
+ }
mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[i], count));
+
+ buffer->invalidateStaticData();
}
}
else
@@ -189,7 +213,7 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
StaticVertexBuffer *staticBuffer = buffer ? buffer->getStaticVertexBuffer() : NULL;
ArrayVertexBuffer *vertexBuffer = staticBuffer ? staticBuffer : static_cast<ArrayVertexBuffer*>(mStreamingBuffer);
- UINT streamOffset = -1;
+ std::size_t streamOffset = -1;
if (staticBuffer)
{
@@ -198,7 +222,7 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
if (streamOffset == -1)
{
// Convert the entire buffer
- int totalCount = buffer->size() / attribs[i].stride();
+ int totalCount = elementsInBuffer(attribs[i], buffer->size());
int startIndex = attribs[i].mOffset / attribs[i].stride();
streamOffset = writeAttributeData(staticBuffer, -startIndex, totalCount, attribs[i]);
@@ -220,24 +244,43 @@ GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, Translat
}
translated[i].vertexBuffer = vertexBuffer->getBuffer();
+ translated[i].serial = vertexBuffer->getSerial();
translated[i].type = converter.d3dDeclType;
translated[i].stride = converter.outputElementSize;
translated[i].offset = streamOffset;
}
else
{
+ if (!mCurrentValueBuffer[i])
+ {
+ mCurrentValueBuffer[i] = new StreamingVertexBuffer(mDevice, CONSTANT_VERTEX_BUFFER_SIZE);
+ }
+
+ StreamingVertexBuffer *buffer = mCurrentValueBuffer[i];
+
if (mDirtyCurrentValue[i])
{
- delete mCurrentValueBuffer[i];
- mCurrentValueBuffer[i] = new ConstantVertexBuffer(mDevice, attribs[i].mCurrentValue[0], attribs[i].mCurrentValue[1], attribs[i].mCurrentValue[2], attribs[i].mCurrentValue[3]);
- mDirtyCurrentValue[i] = false;
+ const int requiredSpace = 4 * sizeof(float);
+ buffer->addRequiredSpace(requiredSpace);
+ buffer->reserveRequiredSpace();
+ float *data = static_cast<float*>(buffer->map(VertexAttribute(), requiredSpace, &mCurrentValueOffsets[i]));
+ if (data)
+ {
+ data[0] = attribs[i].mCurrentValue[0];
+ data[1] = attribs[i].mCurrentValue[1];
+ data[2] = attribs[i].mCurrentValue[2];
+ data[3] = attribs[i].mCurrentValue[3];
+ buffer->unmap();
+ mDirtyCurrentValue[i] = false;
+ }
}
translated[i].vertexBuffer = mCurrentValueBuffer[i]->getBuffer();
+ translated[i].serial = mCurrentValueBuffer[i]->getSerial();
translated[i].type = D3DDECLTYPE_FLOAT4;
translated[i].stride = 0;
- translated[i].offset = 0;
+ translated[i].offset = mCurrentValueOffsets[i];
}
}
}
@@ -507,6 +550,7 @@ VertexBuffer::VertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usa
{
D3DPOOL pool = getDisplay()->getBufferPool(usageFlags);
HRESULT result = device->CreateVertexBuffer(size, usageFlags, 0, pool, &mVertexBuffer, NULL);
+ mSerial = issueSerial();
if (FAILED(result))
{
@@ -536,35 +580,14 @@ IDirect3DVertexBuffer9 *VertexBuffer::getBuffer() const
return mVertexBuffer;
}
-ConstantVertexBuffer::ConstantVertexBuffer(IDirect3DDevice9 *device, float x, float y, float z, float w) : VertexBuffer(device, 4 * sizeof(float), D3DUSAGE_WRITEONLY)
+unsigned int VertexBuffer::getSerial() const
{
- void *buffer = NULL;
-
- if (mVertexBuffer)
- {
- HRESULT result = mVertexBuffer->Lock(0, 0, &buffer, 0);
-
- if (FAILED(result))
- {
- ERR("Lock failed with error 0x%08x", result);
- }
- }
-
- if (buffer)
- {
- float *vector = (float*)buffer;
-
- vector[0] = x;
- vector[1] = y;
- vector[2] = z;
- vector[3] = w;
-
- mVertexBuffer->Unlock();
- }
+ return mSerial;
}
-ConstantVertexBuffer::~ConstantVertexBuffer()
+unsigned int VertexBuffer::issueSerial()
{
+ return mCurrentSerial++;
}
ArrayVertexBuffer::ArrayVertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags) : VertexBuffer(device, size, usageFlags)
@@ -583,11 +606,6 @@ void ArrayVertexBuffer::addRequiredSpace(UINT requiredSpace)
mRequiredSpace += requiredSpace;
}
-void ArrayVertexBuffer::addRequiredSpaceFor(ArrayVertexBuffer *buffer)
-{
- mRequiredSpace += buffer->mRequiredSpace;
-}
-
StreamingVertexBuffer::StreamingVertexBuffer(IDirect3DDevice9 *device, std::size_t initialSize) : ArrayVertexBuffer(device, initialSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY)
{
}
@@ -631,6 +649,7 @@ void StreamingVertexBuffer::reserveRequiredSpace()
D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
HRESULT result = mDevice->CreateVertexBuffer(mBufferSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, 0, pool, &mVertexBuffer, NULL);
+ mSerial = issueSerial();
if (FAILED(result))
{
@@ -662,7 +681,7 @@ StaticVertexBuffer::~StaticVertexBuffer()
{
}
-void *StaticVertexBuffer::map(const VertexAttribute &attribute, std::size_t requiredSpace, UINT *streamOffset)
+void *StaticVertexBuffer::map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset)
{
void *mapPtr = NULL;
@@ -677,7 +696,7 @@ void *StaticVertexBuffer::map(const VertexAttribute &attribute, std::size_t requ
}
int attributeOffset = attribute.mOffset % attribute.stride();
- VertexElement element = {attribute.mType, attribute.mSize, attribute.mNormalized, attributeOffset, mWritePosition};
+ VertexElement element = {attribute.mType, attribute.mSize, attribute.stride(), attribute.mNormalized, attributeOffset, mWritePosition};
mCache.push_back(element);
*streamOffset = mWritePosition;
@@ -693,7 +712,8 @@ void StaticVertexBuffer::reserveRequiredSpace()
{
D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_WRITEONLY);
HRESULT result = mDevice->CreateVertexBuffer(mRequiredSpace, D3DUSAGE_WRITEONLY, 0, pool, &mVertexBuffer, NULL);
-
+ mSerial = issueSerial();
+
if (FAILED(result))
{
ERR("Out of memory allocating a vertex buffer of size %lu.", mRequiredSpace);
@@ -710,11 +730,14 @@ void StaticVertexBuffer::reserveRequiredSpace()
mRequiredSpace = 0;
}
-UINT StaticVertexBuffer::lookupAttribute(const VertexAttribute &attribute)
+std::size_t StaticVertexBuffer::lookupAttribute(const VertexAttribute &attribute)
{
for (unsigned int element = 0; element < mCache.size(); element++)
{
- if (mCache[element].type == attribute.mType && mCache[element].size == attribute.mSize && mCache[element].normalized == attribute.mNormalized)
+ if (mCache[element].type == attribute.mType &&
+ mCache[element].size == attribute.mSize &&
+ mCache[element].stride == attribute.stride() &&
+ mCache[element].normalized == attribute.mNormalized)
{
if (mCache[element].attributeOffset == attribute.mOffset % attribute.stride())
{
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.h b/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.h
index 1bd8351d8..9edfe65f3 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/VertexDataManager.h
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -30,58 +30,56 @@ struct TranslatedAttribute
UINT stride; // 0 means not to advance the read pointer at all
IDirect3DVertexBuffer9 *vertexBuffer;
+ unsigned int serial;
};
class VertexBuffer
{
public:
- VertexBuffer(IDirect3DDevice9 *device, UINT size, DWORD usageFlags);
+ VertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags);
virtual ~VertexBuffer();
void unmap();
IDirect3DVertexBuffer9 *getBuffer() const;
+ unsigned int getSerial() const;
protected:
IDirect3DDevice9 *const mDevice;
IDirect3DVertexBuffer9 *mVertexBuffer;
+ unsigned int mSerial;
+ static unsigned int issueSerial();
+ static unsigned int mCurrentSerial;
+
private:
DISALLOW_COPY_AND_ASSIGN(VertexBuffer);
};
-class ConstantVertexBuffer : public VertexBuffer
-{
- public:
- ConstantVertexBuffer(IDirect3DDevice9 *device, float x, float y, float z, float w);
- ~ConstantVertexBuffer();
-};
-
class ArrayVertexBuffer : public VertexBuffer
{
public:
- ArrayVertexBuffer(IDirect3DDevice9 *device, UINT size, DWORD usageFlags);
+ ArrayVertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags);
~ArrayVertexBuffer();
- UINT size() const { return mBufferSize; }
- virtual void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset) = 0;
+ std::size_t size() const { return mBufferSize; }
+ virtual void *map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset) = 0;
virtual void reserveRequiredSpace() = 0;
void addRequiredSpace(UINT requiredSpace);
- void addRequiredSpaceFor(ArrayVertexBuffer *buffer);
protected:
- UINT mBufferSize;
- UINT mWritePosition;
- UINT mRequiredSpace;
+ std::size_t mBufferSize;
+ std::size_t mWritePosition;
+ std::size_t mRequiredSpace;
};
class StreamingVertexBuffer : public ArrayVertexBuffer
{
public:
- StreamingVertexBuffer(IDirect3DDevice9 *device, UINT initialSize);
+ StreamingVertexBuffer(IDirect3DDevice9 *device, std::size_t initialSize);
~StreamingVertexBuffer();
- void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset);
+ void *map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset);
void reserveRequiredSpace();
};
@@ -91,20 +89,21 @@ class StaticVertexBuffer : public ArrayVertexBuffer
explicit StaticVertexBuffer(IDirect3DDevice9 *device);
~StaticVertexBuffer();
- void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset);
+ void *map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *streamOffset);
void reserveRequiredSpace();
- UINT lookupAttribute(const VertexAttribute &attribute); // Returns the offset into the vertex buffer, or -1 if not found
+ std::size_t lookupAttribute(const VertexAttribute &attribute); // Returns the offset into the vertex buffer, or -1 if not found
private:
struct VertexElement
{
GLenum type;
GLint size;
+ GLsizei stride;
bool normalized;
int attributeOffset;
- UINT streamOffset;
+ std::size_t streamOffset;
};
std::vector<VertexElement> mCache;
@@ -123,8 +122,8 @@ class VertexDataManager
private:
DISALLOW_COPY_AND_ASSIGN(VertexDataManager);
- UINT spaceRequired(const VertexAttribute &attrib, std::size_t count) const;
- UINT writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute);
+ std::size_t spaceRequired(const VertexAttribute &attrib, std::size_t count) const;
+ std::size_t writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute);
Context *const mContext;
IDirect3DDevice9 *const mDevice;
@@ -132,7 +131,8 @@ class VertexDataManager
StreamingVertexBuffer *mStreamingBuffer;
bool mDirtyCurrentValue[MAX_VERTEX_ATTRIBS];
- ConstantVertexBuffer *mCurrentValueBuffer[MAX_VERTEX_ATTRIBS];
+ StreamingVertexBuffer *mCurrentValueBuffer[MAX_VERTEX_ATTRIBS];
+ std::size_t mCurrentValueOffsets[MAX_VERTEX_ATTRIBS];
// Attribute format conversion
struct FormatConverter
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.cpp
deleted file mode 100644
index f79d60677..000000000
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.cpp
+++ /dev/null
@@ -1,382 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// geometry/IndexDataManager.cpp: Defines the IndexDataManager, a class that
-// runs the Buffer translation process for index buffers.
-
-#include "libGLESv2/geometry/IndexDataManager.h"
-
-#include "common/debug.h"
-
-#include "libGLESv2/Buffer.h"
-#include "libGLESv2/mathutil.h"
-#include "libGLESv2/main.h"
-
-namespace
-{
- enum { INITIAL_INDEX_BUFFER_SIZE = 4096 * sizeof(GLuint) };
-}
-
-namespace gl
-{
-
-IndexDataManager::IndexDataManager(Context *context, IDirect3DDevice9 *device) : mDevice(device)
-{
- mStreamingBufferShort = new StreamingIndexBuffer(mDevice, INITIAL_INDEX_BUFFER_SIZE, D3DFMT_INDEX16);
-
- if (context->supports32bitIndices())
- {
- mStreamingBufferInt = new StreamingIndexBuffer(mDevice, INITIAL_INDEX_BUFFER_SIZE, D3DFMT_INDEX32);
- }
- else
- {
- mStreamingBufferInt = NULL;
- }
-}
-
-IndexDataManager::~IndexDataManager()
-{
- delete mStreamingBufferShort;
- delete mStreamingBufferInt;
-}
-
-void convertIndices(GLenum type, const void *input, GLsizei count, void *output)
-{
- if (type == GL_UNSIGNED_BYTE)
- {
- const GLubyte *in = static_cast<const GLubyte*>(input);
- GLushort *out = static_cast<GLushort*>(output);
-
- for (GLsizei i = 0; i < count; i++)
- {
- out[i] = in[i];
- }
- }
- else if (type == GL_UNSIGNED_INT)
- {
- memcpy(output, input, count * sizeof(GLuint));
- }
- else if (type == GL_UNSIGNED_SHORT)
- {
- memcpy(output, input, count * sizeof(GLushort));
- }
- else UNREACHABLE();
-}
-
-template <class IndexType>
-void computeRange(const IndexType *indices, GLsizei count, GLuint *minIndex, GLuint *maxIndex)
-{
- *minIndex = indices[0];
- *maxIndex = indices[0];
-
- for (GLsizei i = 0; i < count; i++)
- {
- if (*minIndex > indices[i]) *minIndex = indices[i];
- if (*maxIndex < indices[i]) *maxIndex = indices[i];
- }
-}
-
-void computeRange(GLenum type, const void *indices, GLsizei count, GLuint *minIndex, GLuint *maxIndex)
-{
- if (type == GL_UNSIGNED_BYTE)
- {
- computeRange(static_cast<const GLubyte*>(indices), count, minIndex, maxIndex);
- }
- else if (type == GL_UNSIGNED_INT)
- {
- computeRange(static_cast<const GLuint*>(indices), count, minIndex, maxIndex);
- }
- else if (type == GL_UNSIGNED_SHORT)
- {
- computeRange(static_cast<const GLushort*>(indices), count, minIndex, maxIndex);
- }
- else UNREACHABLE();
-}
-
-GLenum IndexDataManager::prepareIndexData(GLenum type, GLsizei count, Buffer *buffer, const void *indices, TranslatedIndexData *translated)
-{
- D3DFORMAT format = (type == GL_UNSIGNED_INT) ? D3DFMT_INDEX32 : D3DFMT_INDEX16;
- intptr_t offset = reinterpret_cast<intptr_t>(indices);
- bool alignedOffset = false;
-
- if (buffer != NULL)
- {
- switch (type)
- {
- case GL_UNSIGNED_BYTE: alignedOffset = (offset % sizeof(GLubyte) == 0); break;
- case GL_UNSIGNED_SHORT: alignedOffset = (offset % sizeof(GLushort) == 0); break;
- case GL_UNSIGNED_INT: alignedOffset = (offset % sizeof(GLuint) == 0); break;
- default: UNREACHABLE(); alignedOffset = false;
- }
-
- if (typeSize(type) * count + offset > static_cast<std::size_t>(buffer->size()))
- {
- return GL_INVALID_OPERATION;
- }
-
- indices = static_cast<const GLubyte*>(buffer->data()) + offset;
- }
-
- StreamingIndexBuffer *streamingBuffer = (type == GL_UNSIGNED_INT) ? mStreamingBufferInt : mStreamingBufferShort;
-
- StaticIndexBuffer *staticBuffer = buffer ? buffer->getIndexBuffer() : NULL;
- IndexBuffer *indexBuffer = streamingBuffer;
- UINT streamOffset = 0;
-
- if (staticBuffer && staticBuffer->lookupType(type) && alignedOffset)
- {
- indexBuffer = staticBuffer;
- streamOffset = staticBuffer->lookupRange(offset, count, &translated->minIndex, &translated->maxIndex);
-
- if (streamOffset == -1)
- {
- streamOffset = (offset / typeSize(type)) * indexSize(format);
- computeRange(type, indices, count, &translated->minIndex, &translated->maxIndex);
- staticBuffer->addRange(offset, count, translated->minIndex, translated->maxIndex, streamOffset);
- }
- }
- else
- {
- int convertCount = count;
-
- if (staticBuffer)
- {
- if (staticBuffer->size() == 0 && alignedOffset)
- {
- indexBuffer = staticBuffer;
- convertCount = buffer->size() / typeSize(type);
- }
- else
- {
- buffer->invalidateStaticData();
- staticBuffer = NULL;
- }
- }
-
- void *output = NULL;
-
- if (indexBuffer)
- {
- indexBuffer->reserveSpace(convertCount * indexSize(format), type);
- output = indexBuffer->map(indexSize(format) * convertCount, &streamOffset);
- }
-
- if (output == NULL)
- {
- ERR("Failed to map index buffer.");
- return GL_OUT_OF_MEMORY;
- }
-
- convertIndices(type, staticBuffer ? buffer->data() : indices, convertCount, output);
- indexBuffer->unmap();
-
- computeRange(type, indices, count, &translated->minIndex, &translated->maxIndex);
-
- if (staticBuffer)
- {
- streamOffset = (offset / typeSize(type)) * indexSize(format);
- staticBuffer->addRange(offset, count, translated->minIndex, translated->maxIndex, streamOffset);
- }
- }
-
- translated->indexBuffer = indexBuffer->getBuffer();
- translated->startIndex = streamOffset / indexSize(format);
-
- return GL_NO_ERROR;
-}
-
-std::size_t IndexDataManager::indexSize(D3DFORMAT format) const
-{
- return (format == D3DFMT_INDEX32) ? sizeof(unsigned int) : sizeof(unsigned short);
-}
-
-std::size_t IndexDataManager::typeSize(GLenum type) const
-{
- switch (type)
- {
- case GL_UNSIGNED_INT: return sizeof(GLuint);
- case GL_UNSIGNED_SHORT: return sizeof(GLushort);
- case GL_UNSIGNED_BYTE: return sizeof(GLubyte);
- default: UNREACHABLE(); return sizeof(GLushort);
- }
-}
-
-IndexBuffer::IndexBuffer(IDirect3DDevice9 *device, UINT size, D3DFORMAT format) : mDevice(device), mBufferSize(size), mIndexBuffer(NULL)
-{
- if (size > 0)
- {
- D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
- HRESULT result = device->CreateIndexBuffer(size, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, format, pool, &mIndexBuffer, NULL);
-
- if (FAILED(result))
- {
- ERR("Out of memory allocating an index buffer of size %lu.", size);
- }
- }
-}
-
-IndexBuffer::~IndexBuffer()
-{
- if (mIndexBuffer)
- {
- mIndexBuffer->Release();
- }
-}
-
-IDirect3DIndexBuffer9 *IndexBuffer::getBuffer() const
-{
- return mIndexBuffer;
-}
-
-void IndexBuffer::unmap()
-{
- if (mIndexBuffer)
- {
- mIndexBuffer->Unlock();
- }
-}
-
-StreamingIndexBuffer::StreamingIndexBuffer(IDirect3DDevice9 *device, UINT initialSize, D3DFORMAT format) : IndexBuffer(device, initialSize, format)
-{
- mWritePosition = 0;
-}
-
-StreamingIndexBuffer::~StreamingIndexBuffer()
-{
-}
-
-void *StreamingIndexBuffer::map(UINT requiredSpace, UINT *offset)
-{
- void *mapPtr = NULL;
-
- if (mIndexBuffer)
- {
- HRESULT result = mIndexBuffer->Lock(mWritePosition, requiredSpace, &mapPtr, D3DLOCK_NOOVERWRITE);
-
- if (FAILED(result))
- {
- ERR(" Lock failed with error 0x%08x", result);
- return NULL;
- }
-
- *offset = mWritePosition;
- mWritePosition += requiredSpace;
- }
-
- return mapPtr;
-}
-
-void StreamingIndexBuffer::reserveSpace(UINT requiredSpace, GLenum type)
-{
- if (requiredSpace > mBufferSize)
- {
- if (mIndexBuffer)
- {
- mIndexBuffer->Release();
- mIndexBuffer = NULL;
- }
-
- mBufferSize = std::max(requiredSpace, 2 * mBufferSize);
-
- D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
- HRESULT result = mDevice->CreateIndexBuffer(mBufferSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, type == GL_UNSIGNED_INT ? D3DFMT_INDEX32 : D3DFMT_INDEX16, pool, &mIndexBuffer, NULL);
-
- if (FAILED(result))
- {
- ERR("Out of memory allocating a vertex buffer of size %lu.", mBufferSize);
- }
-
- mWritePosition = 0;
- }
- else if (mWritePosition + requiredSpace > mBufferSize) // Recycle
- {
- void *dummy;
- mIndexBuffer->Lock(0, 1, &dummy, D3DLOCK_DISCARD);
- mIndexBuffer->Unlock();
-
- mWritePosition = 0;
- }
-}
-
-StaticIndexBuffer::StaticIndexBuffer(IDirect3DDevice9 *device) : IndexBuffer(device, 0, D3DFMT_UNKNOWN)
-{
- mCacheType = GL_NONE;
-}
-
-StaticIndexBuffer::~StaticIndexBuffer()
-{
-}
-
-void *StaticIndexBuffer::map(UINT requiredSpace, UINT *offset)
-{
- void *mapPtr = NULL;
-
- if (mIndexBuffer)
- {
- HRESULT result = mIndexBuffer->Lock(0, requiredSpace, &mapPtr, 0);
-
- if (FAILED(result))
- {
- ERR(" Lock failed with error 0x%08x", result);
- return NULL;
- }
-
- *offset = 0;
- }
-
- return mapPtr;
-}
-
-void StaticIndexBuffer::reserveSpace(UINT requiredSpace, GLenum type)
-{
- if (!mIndexBuffer && mBufferSize == 0)
- {
- D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_WRITEONLY);
- HRESULT result = mDevice->CreateIndexBuffer(requiredSpace, D3DUSAGE_WRITEONLY, type == GL_UNSIGNED_INT ? D3DFMT_INDEX32 : D3DFMT_INDEX16, pool, &mIndexBuffer, NULL);
-
- if (FAILED(result))
- {
- ERR("Out of memory allocating a vertex buffer of size %lu.", mBufferSize);
- }
-
- mBufferSize = requiredSpace;
- mCacheType = type;
- }
- else if (mIndexBuffer && mBufferSize >= requiredSpace && mCacheType == type)
- {
- // Already allocated
- }
- else UNREACHABLE(); // Static index buffers can't be resized
-}
-
-bool StaticIndexBuffer::lookupType(GLenum type)
-{
- return mCacheType == type;
-}
-
-UINT StaticIndexBuffer::lookupRange(intptr_t offset, GLsizei count, UINT *minIndex, UINT *maxIndex)
-{
- for (unsigned int range = 0; range < mCache.size(); range++)
- {
- if (mCache[range].offset == offset && mCache[range].count == count)
- {
- *minIndex = mCache[range].minIndex;
- *maxIndex = mCache[range].maxIndex;
-
- return mCache[range].streamOffset;
- }
- }
-
- return -1;
-}
-
-void StaticIndexBuffer::addRange(intptr_t offset, GLsizei count, UINT minIndex, UINT maxIndex, UINT streamOffset)
-{
- IndexRange indexRange = {offset, count, minIndex, maxIndex, streamOffset};
- mCache.push_back(indexRange);
-}
-
-}
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.h b/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.h
deleted file mode 100644
index d48249c79..000000000
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/IndexDataManager.h
+++ /dev/null
@@ -1,120 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// geometry/IndexDataManager.h: Defines the IndexDataManager, a class that
-// runs the Buffer translation process for index buffers.
-
-#ifndef LIBGLESV2_GEOMETRY_INDEXDATAMANAGER_H_
-#define LIBGLESV2_GEOMETRY_INDEXDATAMANAGER_H_
-
-#include <vector>
-#include <cstddef>
-
-#define GL_APICALL
-#include <GLES2/gl2.h>
-
-#include "libGLESv2/Context.h"
-
-namespace gl
-{
-
-struct TranslatedIndexData
-{
- UINT minIndex;
- UINT maxIndex;
- UINT startIndex;
-
- IDirect3DIndexBuffer9 *indexBuffer;
-};
-
-class IndexBuffer
-{
- public:
- IndexBuffer(IDirect3DDevice9 *device, UINT size, D3DFORMAT format);
- virtual ~IndexBuffer();
-
- UINT size() const { return mBufferSize; }
- virtual void *map(UINT requiredSpace, UINT *offset) = 0;
- void unmap();
- virtual void reserveSpace(UINT requiredSpace, GLenum type) = 0;
-
- IDirect3DIndexBuffer9 *getBuffer() const;
-
- protected:
- IDirect3DDevice9 *const mDevice;
-
- IDirect3DIndexBuffer9 *mIndexBuffer;
- UINT mBufferSize;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(IndexBuffer);
-};
-
-class StreamingIndexBuffer : public IndexBuffer
-{
- public:
- StreamingIndexBuffer(IDirect3DDevice9 *device, UINT initialSize, D3DFORMAT format);
- ~StreamingIndexBuffer();
-
- void *map(UINT requiredSpace, UINT *offset);
- void reserveSpace(UINT requiredSpace, GLenum type);
-
- private:
- UINT mWritePosition;
-};
-
-class StaticIndexBuffer : public IndexBuffer
-{
- public:
- explicit StaticIndexBuffer(IDirect3DDevice9 *device);
- ~StaticIndexBuffer();
-
- void *map(UINT requiredSpace, UINT *offset);
- void reserveSpace(UINT requiredSpace, GLenum type);
-
- bool lookupType(GLenum type);
- UINT lookupRange(intptr_t offset, GLsizei count, UINT *minIndex, UINT *maxIndex); // Returns the offset into the index buffer, or -1 if not found
- void addRange(intptr_t offset, GLsizei count, UINT minIndex, UINT maxIndex, UINT streamOffset);
-
- private:
- GLenum mCacheType;
-
- struct IndexRange
- {
- intptr_t offset;
- GLsizei count;
-
- UINT minIndex;
- UINT maxIndex;
- UINT streamOffset;
- };
-
- std::vector<IndexRange> mCache;
-};
-
-class IndexDataManager
-{
- public:
- IndexDataManager(Context *context, IDirect3DDevice9 *evice);
- virtual ~IndexDataManager();
-
- GLenum prepareIndexData(GLenum type, GLsizei count, Buffer *arrayElementBuffer, const void *indices, TranslatedIndexData *translated);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(IndexDataManager);
-
- std::size_t typeSize(GLenum type) const;
- std::size_t indexSize(D3DFORMAT format) const;
-
- IDirect3DDevice9 *const mDevice;
-
- StreamingIndexBuffer *mStreamingBufferShort;
- StreamingIndexBuffer *mStreamingBufferInt;
-};
-
-}
-
-#endif // LIBGLESV2_GEOMETRY_INDEXDATAMANAGER_H_
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.cpp
deleted file mode 100644
index 99ece1775..000000000
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.cpp
+++ /dev/null
@@ -1,769 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// geometry/VertexDataManager.h: Defines the VertexDataManager, a class that
-// runs the Buffer translation process.
-
-#include "libGLESv2/geometry/VertexDataManager.h"
-
-#include "common/debug.h"
-
-#include "libGLESv2/Buffer.h"
-#include "libGLESv2/Program.h"
-#include "libGLESv2/main.h"
-
-#include "libGLESv2/geometry/vertexconversion.h"
-#include "libGLESv2/geometry/IndexDataManager.h"
-
-namespace
-{
- enum { INITIAL_STREAM_BUFFER_SIZE = 1024*1024 };
-}
-
-namespace gl
-{
-
-VertexDataManager::VertexDataManager(Context *context, IDirect3DDevice9 *device) : mContext(context), mDevice(device)
-{
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- mDirtyCurrentValue[i] = true;
- mCurrentValueBuffer[i] = NULL;
- }
-
- const D3DCAPS9 &caps = context->getDeviceCaps();
- checkVertexCaps(caps.DeclTypes);
-
- mStreamingBuffer = new StreamingVertexBuffer(mDevice, INITIAL_STREAM_BUFFER_SIZE);
-}
-
-VertexDataManager::~VertexDataManager()
-{
- delete mStreamingBuffer;
-
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- delete mCurrentValueBuffer[i];
- }
-}
-
-UINT VertexDataManager::writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute)
-{
- Buffer *buffer = attribute.mBoundBuffer.get();
-
- int inputStride = attribute.stride();
- int elementSize = attribute.typeSize();
- const FormatConverter &converter = formatConverter(attribute);
- UINT streamOffset = 0;
-
- void *output = NULL;
-
- if (vertexBuffer)
- {
- output = vertexBuffer->map(attribute, spaceRequired(attribute, count), &streamOffset);
- }
-
- if (output == NULL)
- {
- ERR("Failed to map vertex buffer.");
- return -1;
- }
-
- const char *input = NULL;
-
- if (buffer)
- {
- int offset = attribute.mOffset;
-
- input = static_cast<const char*>(buffer->data()) + offset;
- }
- else
- {
- input = static_cast<const char*>(attribute.mPointer);
- }
-
- input += inputStride * start;
-
- if (converter.identity && inputStride == elementSize)
- {
- memcpy(output, input, count * inputStride);
- }
- else
- {
- converter.convertArray(input, inputStride, count, output);
- }
-
- vertexBuffer->unmap();
-
- return streamOffset;
-}
-
-GLenum VertexDataManager::prepareVertexData(GLint start, GLsizei count, TranslatedAttribute *translated)
-{
- GLenum error = GL_NO_ERROR;
- const VertexAttributeArray &attribs = mContext->getVertexAttributes();
- Program *program = mContext->getCurrentProgram();
-
- for (int attributeIndex = 0; attributeIndex < MAX_VERTEX_ATTRIBS; attributeIndex++)
- {
- translated[attributeIndex].active = (program->getSemanticIndex(attributeIndex) != -1);
- }
-
- // Determine the required storage size per used buffer
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- Buffer *buffer = attribs[i].mBoundBuffer.get();
-
- if (translated[i].active && attribs[i].mArrayEnabled && (buffer || attribs[i].mPointer))
- {
- StaticVertexBuffer *staticBuffer = buffer ? buffer->getVertexBuffer() : NULL;
-
- if (staticBuffer && staticBuffer->size() == 0)
- {
- int totalCount = buffer->size() / attribs[i].stride();
- staticBuffer->addRequiredSpace(spaceRequired(attribs[i], totalCount));
- }
- else if (!staticBuffer || staticBuffer->lookupAttribute(attribs[i]) == -1)
- {
- if (mStreamingBuffer)
- {
- mStreamingBuffer->addRequiredSpace(spaceRequired(attribs[i], count));
- }
- }
- }
- }
-
- // Invalidate static buffers if the attribute formats no longer match
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- Buffer *buffer = attribs[i].mBoundBuffer.get();
-
- if (translated[i].active && attribs[i].mArrayEnabled && buffer)
- {
- StaticVertexBuffer *staticBuffer = buffer->getVertexBuffer();
-
- if (staticBuffer && staticBuffer->size() != 0)
- {
- bool matchingAttributes = true;
-
- for (int j = 0; j < MAX_VERTEX_ATTRIBS; j++)
- {
- if (translated[j].active && attribs[j].mArrayEnabled && attribs[j].mBoundBuffer.get() == buffer)
- {
- if (staticBuffer->lookupAttribute(attribs[j]) == -1)
- {
- matchingAttributes = false;
- break;
- }
- }
- }
-
- if (!matchingAttributes && mStreamingBuffer)
- {
- mStreamingBuffer->addRequiredSpaceFor(staticBuffer);
- buffer->invalidateStaticData();
- }
- }
- }
- }
-
- // Reserve the required space per used buffer
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- Buffer *buffer = attribs[i].mBoundBuffer.get();
-
- if (translated[i].active && attribs[i].mArrayEnabled && (buffer || attribs[i].mPointer))
- {
- ArrayVertexBuffer *staticBuffer = buffer ? buffer->getVertexBuffer() : NULL;
- ArrayVertexBuffer *vertexBuffer = staticBuffer ? staticBuffer : mStreamingBuffer;
-
- if (vertexBuffer)
- {
- vertexBuffer->reserveRequiredSpace();
- }
- }
- }
-
- // Perform the vertex data translations
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- if (translated[i].active)
- {
- Buffer *buffer = attribs[i].mBoundBuffer.get();
-
- if (attribs[i].mArrayEnabled)
- {
- if (!buffer && attribs[i].mPointer == NULL)
- {
- // This is an application error that would normally result in a crash, but we catch it and return an error
- ERR("An enabled vertex array has no buffer and no pointer.");
- return GL_INVALID_OPERATION;
- }
-
- const FormatConverter &converter = formatConverter(attribs[i]);
-
- StaticVertexBuffer *staticBuffer = buffer ? buffer->getVertexBuffer() : NULL;
- ArrayVertexBuffer *vertexBuffer = staticBuffer ? staticBuffer : static_cast<ArrayVertexBuffer*>(mStreamingBuffer);
-
- UINT streamOffset = -1;
-
- if (staticBuffer)
- {
- streamOffset = staticBuffer->lookupAttribute(attribs[i]);
-
- if (streamOffset == -1)
- {
- // Convert the entire buffer
- int totalCount = buffer->size() / attribs[i].stride();
- int startIndex = attribs[i].mOffset / attribs[i].stride();
-
- streamOffset = writeAttributeData(staticBuffer, -startIndex, totalCount, attribs[i]);
- }
-
- if (streamOffset != -1)
- {
- streamOffset += (start + attribs[i].mOffset / attribs[i].stride()) * converter.outputElementSize;
- }
- }
- else
- {
- streamOffset = writeAttributeData(mStreamingBuffer, start, count, attribs[i]);
- }
-
- if (streamOffset == -1)
- {
- return GL_OUT_OF_MEMORY;
- }
-
- translated[i].vertexBuffer = vertexBuffer->getBuffer();
- translated[i].type = converter.d3dDeclType;
- translated[i].stride = converter.outputElementSize;
- translated[i].offset = streamOffset;
- }
- else
- {
- if (mDirtyCurrentValue[i])
- {
- delete mCurrentValueBuffer[i];
- mCurrentValueBuffer[i] = new ConstantVertexBuffer(mDevice, attribs[i].mCurrentValue[0], attribs[i].mCurrentValue[1], attribs[i].mCurrentValue[2], attribs[i].mCurrentValue[3]);
- mDirtyCurrentValue[i] = false;
- }
-
- translated[i].vertexBuffer = mCurrentValueBuffer[i]->getBuffer();
-
- translated[i].type = D3DDECLTYPE_FLOAT4;
- translated[i].stride = 0;
- translated[i].offset = 0;
- }
- }
- }
-
- return GL_NO_ERROR;
-}
-
-std::size_t VertexDataManager::spaceRequired(const VertexAttribute &attrib, std::size_t count) const
-{
- return formatConverter(attrib).outputElementSize * count;
-}
-
-// Mapping from OpenGL-ES vertex attrib type to D3D decl type:
-//
-// BYTE SHORT (Cast)
-// BYTE-norm FLOAT (Normalize) (can't be exactly represented as SHORT-norm)
-// UNSIGNED_BYTE UBYTE4 (Identity) or SHORT (Cast)
-// UNSIGNED_BYTE-norm UBYTE4N (Identity) or FLOAT (Normalize)
-// SHORT SHORT (Identity)
-// SHORT-norm SHORT-norm (Identity) or FLOAT (Normalize)
-// UNSIGNED_SHORT FLOAT (Cast)
-// UNSIGNED_SHORT-norm USHORT-norm (Identity) or FLOAT (Normalize)
-// FIXED (not in WebGL) FLOAT (FixedToFloat)
-// FLOAT FLOAT (Identity)
-
-// GLToCType maps from GL type (as GLenum) to the C typedef.
-template <GLenum GLType> struct GLToCType { };
-
-template <> struct GLToCType<GL_BYTE> { typedef GLbyte type; };
-template <> struct GLToCType<GL_UNSIGNED_BYTE> { typedef GLubyte type; };
-template <> struct GLToCType<GL_SHORT> { typedef GLshort type; };
-template <> struct GLToCType<GL_UNSIGNED_SHORT> { typedef GLushort type; };
-template <> struct GLToCType<GL_FIXED> { typedef GLuint type; };
-template <> struct GLToCType<GL_FLOAT> { typedef GLfloat type; };
-
-// This differs from D3DDECLTYPE in that it is unsized. (Size expansion is applied last.)
-enum D3DVertexType
-{
- D3DVT_FLOAT,
- D3DVT_SHORT,
- D3DVT_SHORT_NORM,
- D3DVT_UBYTE,
- D3DVT_UBYTE_NORM,
- D3DVT_USHORT_NORM
-};
-
-// D3DToCType maps from D3D vertex type (as enum D3DVertexType) to the corresponding C type.
-template <unsigned int D3DType> struct D3DToCType { };
-
-template <> struct D3DToCType<D3DVT_FLOAT> { typedef float type; };
-template <> struct D3DToCType<D3DVT_SHORT> { typedef short type; };
-template <> struct D3DToCType<D3DVT_SHORT_NORM> { typedef short type; };
-template <> struct D3DToCType<D3DVT_UBYTE> { typedef unsigned char type; };
-template <> struct D3DToCType<D3DVT_UBYTE_NORM> { typedef unsigned char type; };
-template <> struct D3DToCType<D3DVT_USHORT_NORM> { typedef unsigned short type; };
-
-// Encode the type/size combinations that D3D permits. For each type/size it expands to a widener that will provide the appropriate final size.
-template <unsigned int type, int size>
-struct WidenRule
-{
-};
-
-template <int size> struct WidenRule<D3DVT_FLOAT, size> : gl::NoWiden<size> { };
-template <int size> struct WidenRule<D3DVT_SHORT, size> : gl::WidenToEven<size> { };
-template <int size> struct WidenRule<D3DVT_SHORT_NORM, size> : gl::WidenToEven<size> { };
-template <int size> struct WidenRule<D3DVT_UBYTE, size> : gl::WidenToFour<size> { };
-template <int size> struct WidenRule<D3DVT_UBYTE_NORM, size> : gl::WidenToFour<size> { };
-template <int size> struct WidenRule<D3DVT_USHORT_NORM, size> : gl::WidenToEven<size> { };
-
-// VertexTypeFlags encodes the D3DCAPS9::DeclType flag and vertex declaration flag for each D3D vertex type & size combination.
-template <unsigned int d3dtype, int size>
-struct VertexTypeFlags
-{
-};
-
-template <unsigned int capflag, unsigned int declflag>
-struct VertexTypeFlagsHelper
-{
- enum { capflag = capflag };
- enum { declflag = declflag };
-};
-
-template <> struct VertexTypeFlags<D3DVT_FLOAT, 1> : VertexTypeFlagsHelper<0, D3DDECLTYPE_FLOAT1> { };
-template <> struct VertexTypeFlags<D3DVT_FLOAT, 2> : VertexTypeFlagsHelper<0, D3DDECLTYPE_FLOAT2> { };
-template <> struct VertexTypeFlags<D3DVT_FLOAT, 3> : VertexTypeFlagsHelper<0, D3DDECLTYPE_FLOAT3> { };
-template <> struct VertexTypeFlags<D3DVT_FLOAT, 4> : VertexTypeFlagsHelper<0, D3DDECLTYPE_FLOAT4> { };
-template <> struct VertexTypeFlags<D3DVT_SHORT, 2> : VertexTypeFlagsHelper<0, D3DDECLTYPE_SHORT2> { };
-template <> struct VertexTypeFlags<D3DVT_SHORT, 4> : VertexTypeFlagsHelper<0, D3DDECLTYPE_SHORT4> { };
-template <> struct VertexTypeFlags<D3DVT_SHORT_NORM, 2> : VertexTypeFlagsHelper<D3DDTCAPS_SHORT2N, D3DDECLTYPE_SHORT2N> { };
-template <> struct VertexTypeFlags<D3DVT_SHORT_NORM, 4> : VertexTypeFlagsHelper<D3DDTCAPS_SHORT4N, D3DDECLTYPE_SHORT4N> { };
-template <> struct VertexTypeFlags<D3DVT_UBYTE, 4> : VertexTypeFlagsHelper<D3DDTCAPS_UBYTE4, D3DDECLTYPE_UBYTE4> { };
-template <> struct VertexTypeFlags<D3DVT_UBYTE_NORM, 4> : VertexTypeFlagsHelper<D3DDTCAPS_UBYTE4N, D3DDECLTYPE_UBYTE4N> { };
-template <> struct VertexTypeFlags<D3DVT_USHORT_NORM, 2> : VertexTypeFlagsHelper<D3DDTCAPS_USHORT2N, D3DDECLTYPE_USHORT2N> { };
-template <> struct VertexTypeFlags<D3DVT_USHORT_NORM, 4> : VertexTypeFlagsHelper<D3DDTCAPS_USHORT4N, D3DDECLTYPE_USHORT4N> { };
-
-
-// VertexTypeMapping maps GL type & normalized flag to preferred and fallback D3D vertex types (as D3DVertexType enums).
-template <GLenum GLtype, bool normalized>
-struct VertexTypeMapping
-{
-};
-
-template <D3DVertexType Preferred, D3DVertexType Fallback = Preferred>
-struct VertexTypeMappingBase
-{
- enum { preferred = Preferred };
- enum { fallback = Fallback };
-};
-
-template <> struct VertexTypeMapping<GL_BYTE, false> : VertexTypeMappingBase<D3DVT_SHORT> { }; // Cast
-template <> struct VertexTypeMapping<GL_BYTE, true> : VertexTypeMappingBase<D3DVT_FLOAT> { }; // Normalize
-template <> struct VertexTypeMapping<GL_UNSIGNED_BYTE, false> : VertexTypeMappingBase<D3DVT_UBYTE, D3DVT_FLOAT> { }; // Identity, Cast
-template <> struct VertexTypeMapping<GL_UNSIGNED_BYTE, true> : VertexTypeMappingBase<D3DVT_UBYTE_NORM, D3DVT_FLOAT> { }; // Identity, Normalize
-template <> struct VertexTypeMapping<GL_SHORT, false> : VertexTypeMappingBase<D3DVT_SHORT> { }; // Identity
-template <> struct VertexTypeMapping<GL_SHORT, true> : VertexTypeMappingBase<D3DVT_SHORT_NORM, D3DVT_FLOAT> { }; // Cast, Normalize
-template <> struct VertexTypeMapping<GL_UNSIGNED_SHORT, false> : VertexTypeMappingBase<D3DVT_FLOAT> { }; // Cast
-template <> struct VertexTypeMapping<GL_UNSIGNED_SHORT, true> : VertexTypeMappingBase<D3DVT_USHORT_NORM, D3DVT_FLOAT> { }; // Cast, Normalize
-template <bool normalized> struct VertexTypeMapping<GL_FIXED, normalized> : VertexTypeMappingBase<D3DVT_FLOAT> { }; // FixedToFloat
-template <bool normalized> struct VertexTypeMapping<GL_FLOAT, normalized> : VertexTypeMappingBase<D3DVT_FLOAT> { }; // Identity
-
-
-// Given a GL type & norm flag and a D3D type, ConversionRule provides the type conversion rule (Cast, Normalize, Identity, FixedToFloat).
-// The conversion rules themselves are defined in vertexconversion.h.
-
-// Almost all cases are covered by Cast (including those that are actually Identity since Cast<T,T> knows it's an identity mapping).
-template <GLenum fromType, bool normalized, unsigned int toType>
-struct ConversionRule : gl::Cast<typename GLToCType<fromType>::type, typename D3DToCType<toType>::type>
-{
-};
-
-// All conversions from normalized types to float use the Normalize operator.
-template <GLenum fromType> struct ConversionRule<fromType, true, D3DVT_FLOAT> : gl::Normalize<typename GLToCType<fromType>::type> { };
-
-// Use a full specialisation for this so that it preferentially matches ahead of the generic normalize-to-float rules.
-template <> struct ConversionRule<GL_FIXED, true, D3DVT_FLOAT> : gl::FixedToFloat<GLuint, 16> { };
-template <> struct ConversionRule<GL_FIXED, false, D3DVT_FLOAT> : gl::FixedToFloat<GLuint, 16> { };
-
-// A 2-stage construction is used for DefaultVertexValues because float must use SimpleDefaultValues (i.e. 0/1)
-// whether it is normalized or not.
-template <class T, bool normalized>
-struct DefaultVertexValuesStage2
-{
-};
-
-template <class T> struct DefaultVertexValuesStage2<T, true> : gl::NormalizedDefaultValues<T> { };
-template <class T> struct DefaultVertexValuesStage2<T, false> : gl::SimpleDefaultValues<T> { };
-
-// Work out the default value rule for a D3D type (expressed as the C type) and
-template <class T, bool normalized>
-struct DefaultVertexValues : DefaultVertexValuesStage2<T, normalized>
-{
-};
-
-template <bool normalized> struct DefaultVertexValues<float, normalized> : gl::SimpleDefaultValues<float> { };
-
-// Policy rules for use with Converter, to choose whether to use the preferred or fallback conversion.
-// The fallback conversion produces an output that all D3D9 devices must support.
-template <class T> struct UsePreferred { enum { type = T::preferred }; };
-template <class T> struct UseFallback { enum { type = T::fallback }; };
-
-// Converter ties it all together. Given an OpenGL type/norm/size and choice of preferred/fallback conversion,
-// it provides all the members of the appropriate VertexDataConverter, the D3DCAPS9::DeclTypes flag in cap flag
-// and the D3DDECLTYPE member needed for the vertex declaration in declflag.
-template <GLenum fromType, bool normalized, int size, template <class T> class PreferenceRule>
-struct Converter
- : gl::VertexDataConverter<typename GLToCType<fromType>::type,
- WidenRule<PreferenceRule< VertexTypeMapping<fromType, normalized> >::type, size>,
- ConversionRule<fromType,
- normalized,
- PreferenceRule< VertexTypeMapping<fromType, normalized> >::type>,
- DefaultVertexValues<typename D3DToCType<PreferenceRule< VertexTypeMapping<fromType, normalized> >::type>::type, normalized > >
-{
-private:
- enum { d3dtype = PreferenceRule< VertexTypeMapping<fromType, normalized> >::type };
- enum { d3dsize = WidenRule<d3dtype, size>::finalWidth };
-
-public:
- enum { capflag = VertexTypeFlags<d3dtype, d3dsize>::capflag };
- enum { declflag = VertexTypeFlags<d3dtype, d3dsize>::declflag };
-};
-
-// Initialise a TranslationInfo
-#define TRANSLATION(type, norm, size, preferred) \
- { \
- Converter<type, norm, size, preferred>::identity, \
- Converter<type, norm, size, preferred>::finalSize, \
- Converter<type, norm, size, preferred>::convertArray, \
- static_cast<D3DDECLTYPE>(Converter<type, norm, size, preferred>::declflag) \
- }
-
-#define TRANSLATION_FOR_TYPE_NORM_SIZE(type, norm, size) \
- { \
- Converter<type, norm, size, UsePreferred>::capflag, \
- TRANSLATION(type, norm, size, UsePreferred), \
- TRANSLATION(type, norm, size, UseFallback) \
- }
-
-#define TRANSLATIONS_FOR_TYPE(type) \
- { \
- { TRANSLATION_FOR_TYPE_NORM_SIZE(type, false, 1), TRANSLATION_FOR_TYPE_NORM_SIZE(type, false, 2), TRANSLATION_FOR_TYPE_NORM_SIZE(type, false, 3), TRANSLATION_FOR_TYPE_NORM_SIZE(type, false, 4) }, \
- { TRANSLATION_FOR_TYPE_NORM_SIZE(type, true, 1), TRANSLATION_FOR_TYPE_NORM_SIZE(type, true, 2), TRANSLATION_FOR_TYPE_NORM_SIZE(type, true, 3), TRANSLATION_FOR_TYPE_NORM_SIZE(type, true, 4) }, \
- }
-
-const VertexDataManager::TranslationDescription VertexDataManager::mPossibleTranslations[NUM_GL_VERTEX_ATTRIB_TYPES][2][4] = // [GL types as enumerated by typeIndex()][normalized][size-1]
-{
- TRANSLATIONS_FOR_TYPE(GL_BYTE),
- TRANSLATIONS_FOR_TYPE(GL_UNSIGNED_BYTE),
- TRANSLATIONS_FOR_TYPE(GL_SHORT),
- TRANSLATIONS_FOR_TYPE(GL_UNSIGNED_SHORT),
- TRANSLATIONS_FOR_TYPE(GL_FIXED),
- TRANSLATIONS_FOR_TYPE(GL_FLOAT)
-};
-
-void VertexDataManager::checkVertexCaps(DWORD declTypes)
-{
- for (unsigned int i = 0; i < NUM_GL_VERTEX_ATTRIB_TYPES; i++)
- {
- for (unsigned int j = 0; j < 2; j++)
- {
- for (unsigned int k = 0; k < 4; k++)
- {
- if (mPossibleTranslations[i][j][k].capsFlag == 0 || (declTypes & mPossibleTranslations[i][j][k].capsFlag) != 0)
- {
- mAttributeTypes[i][j][k] = mPossibleTranslations[i][j][k].preferredConversion;
- }
- else
- {
- mAttributeTypes[i][j][k] = mPossibleTranslations[i][j][k].fallbackConversion;
- }
- }
- }
- }
-}
-
-// This is used to index mAttributeTypes and mPossibleTranslations.
-unsigned int VertexDataManager::typeIndex(GLenum type) const
-{
- switch (type)
- {
- case GL_BYTE: return 0;
- case GL_UNSIGNED_BYTE: return 1;
- case GL_SHORT: return 2;
- case GL_UNSIGNED_SHORT: return 3;
- case GL_FIXED: return 4;
- case GL_FLOAT: return 5;
-
- default: UNREACHABLE(); return 5;
- }
-}
-
-void VertexDataManager::setupAttributes(const TranslatedAttribute *attributes)
-{
- D3DVERTEXELEMENT9 elements[MAX_VERTEX_ATTRIBS];
- D3DVERTEXELEMENT9 *element = &elements[0];
-
- for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++)
- {
- if (attributes[i].active)
- {
- mDevice->SetStreamSource(i, attributes[i].vertexBuffer, attributes[i].offset, attributes[i].stride);
-
- element->Stream = i;
- element->Offset = 0;
- element->Type = attributes[i].type;
- element->Method = D3DDECLMETHOD_DEFAULT;
- element->Usage = D3DDECLUSAGE_TEXCOORD;
- element->UsageIndex = attributes[i].semanticIndex;
- element++;
- }
- }
-
- static const D3DVERTEXELEMENT9 end = D3DDECL_END();
- *element = end;
-
- IDirect3DVertexDeclaration9 *vertexDeclaration;
- mDevice->CreateVertexDeclaration(elements, &vertexDeclaration);
- mDevice->SetVertexDeclaration(vertexDeclaration);
- vertexDeclaration->Release();
-}
-
-VertexBuffer::VertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags) : mDevice(device), mVertexBuffer(NULL)
-{
- if (size > 0)
- {
- D3DPOOL pool = getDisplay()->getBufferPool(usageFlags);
- HRESULT result = device->CreateVertexBuffer(size, usageFlags, 0, pool, &mVertexBuffer, NULL);
-
- if (FAILED(result))
- {
- ERR("Out of memory allocating a vertex buffer of size %lu.", size);
- }
- }
-}
-
-VertexBuffer::~VertexBuffer()
-{
- if (mVertexBuffer)
- {
- mVertexBuffer->Release();
- }
-}
-
-void VertexBuffer::unmap()
-{
- if (mVertexBuffer)
- {
- mVertexBuffer->Unlock();
- }
-}
-
-IDirect3DVertexBuffer9 *VertexBuffer::getBuffer() const
-{
- return mVertexBuffer;
-}
-
-ConstantVertexBuffer::ConstantVertexBuffer(IDirect3DDevice9 *device, float x, float y, float z, float w) : VertexBuffer(device, 4 * sizeof(float), D3DUSAGE_WRITEONLY)
-{
- void *buffer = NULL;
-
- if (mVertexBuffer)
- {
- HRESULT result = mVertexBuffer->Lock(0, 0, &buffer, 0);
-
- if (FAILED(result))
- {
- ERR("Lock failed with error 0x%08x", result);
- }
- }
-
- if (buffer)
- {
- float *vector = (float*)buffer;
-
- vector[0] = x;
- vector[1] = y;
- vector[2] = z;
- vector[3] = w;
-
- mVertexBuffer->Unlock();
- }
-}
-
-ConstantVertexBuffer::~ConstantVertexBuffer()
-{
-}
-
-ArrayVertexBuffer::ArrayVertexBuffer(IDirect3DDevice9 *device, std::size_t size, DWORD usageFlags) : VertexBuffer(device, size, usageFlags)
-{
- mBufferSize = size;
- mWritePosition = 0;
- mRequiredSpace = 0;
-}
-
-ArrayVertexBuffer::~ArrayVertexBuffer()
-{
-}
-
-void ArrayVertexBuffer::addRequiredSpace(UINT requiredSpace)
-{
- mRequiredSpace += requiredSpace;
-}
-
-void ArrayVertexBuffer::addRequiredSpaceFor(ArrayVertexBuffer *buffer)
-{
- mRequiredSpace += buffer->mRequiredSpace;
-}
-
-StreamingVertexBuffer::StreamingVertexBuffer(IDirect3DDevice9 *device, std::size_t initialSize) : ArrayVertexBuffer(device, initialSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY)
-{
-}
-
-StreamingVertexBuffer::~StreamingVertexBuffer()
-{
-}
-
-void *StreamingVertexBuffer::map(const VertexAttribute &attribute, std::size_t requiredSpace, std::size_t *offset)
-{
- void *mapPtr = NULL;
-
- if (mVertexBuffer)
- {
- HRESULT result = mVertexBuffer->Lock(mWritePosition, requiredSpace, &mapPtr, D3DLOCK_NOOVERWRITE);
-
- if (FAILED(result))
- {
- ERR("Lock failed with error 0x%08x", result);
- return NULL;
- }
-
- *offset = mWritePosition;
- mWritePosition += requiredSpace;
- }
-
- return mapPtr;
-}
-
-void StreamingVertexBuffer::reserveRequiredSpace()
-{
- if (mRequiredSpace > mBufferSize)
- {
- if (mVertexBuffer)
- {
- mVertexBuffer->Release();
- mVertexBuffer = NULL;
- }
-
- mBufferSize = std::max(mRequiredSpace, 3 * mBufferSize / 2); // 1.5 x mBufferSize is arbitrary and should be checked to see we don't have too many reallocations.
-
- D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY);
- HRESULT result = mDevice->CreateVertexBuffer(mBufferSize, D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY, 0, pool, &mVertexBuffer, NULL);
-
- if (FAILED(result))
- {
- ERR("Out of memory allocating a vertex buffer of size %lu.", mBufferSize);
- }
-
- mWritePosition = 0;
- }
- else if (mWritePosition + mRequiredSpace > mBufferSize) // Recycle
- {
- if (mVertexBuffer)
- {
- void *dummy;
- mVertexBuffer->Lock(0, 1, &dummy, D3DLOCK_DISCARD);
- mVertexBuffer->Unlock();
- }
-
- mWritePosition = 0;
- }
-
- mRequiredSpace = 0;
-}
-
-StaticVertexBuffer::StaticVertexBuffer(IDirect3DDevice9 *device) : ArrayVertexBuffer(device, 0, D3DUSAGE_WRITEONLY)
-{
-}
-
-StaticVertexBuffer::~StaticVertexBuffer()
-{
-}
-
-void *StaticVertexBuffer::map(const VertexAttribute &attribute, std::size_t requiredSpace, UINT *streamOffset)
-{
- void *mapPtr = NULL;
-
- if (mVertexBuffer)
- {
- HRESULT result = mVertexBuffer->Lock(mWritePosition, requiredSpace, &mapPtr, 0);
-
- if (FAILED(result))
- {
- ERR("Lock failed with error 0x%08x", result);
- return NULL;
- }
-
- int attributeOffset = attribute.mOffset % attribute.stride();
- VertexElement element = {attribute.mType, attribute.mSize, attribute.mNormalized, attributeOffset, mWritePosition};
- mCache.push_back(element);
-
- *streamOffset = mWritePosition;
- mWritePosition += requiredSpace;
- }
-
- return mapPtr;
-}
-
-void StaticVertexBuffer::reserveRequiredSpace()
-{
- if (!mVertexBuffer && mBufferSize == 0)
- {
- D3DPOOL pool = getDisplay()->getBufferPool(D3DUSAGE_WRITEONLY);
- HRESULT result = mDevice->CreateVertexBuffer(mRequiredSpace, D3DUSAGE_WRITEONLY, 0, pool, &mVertexBuffer, NULL);
-
- if (FAILED(result))
- {
- ERR("Out of memory allocating a vertex buffer of size %lu.", mRequiredSpace);
- }
-
- mBufferSize = mRequiredSpace;
- }
- else if (mVertexBuffer && mBufferSize >= mRequiredSpace)
- {
- // Already allocated
- }
- else UNREACHABLE(); // Static vertex buffers can't be resized
-
- mRequiredSpace = 0;
-}
-
-UINT StaticVertexBuffer::lookupAttribute(const VertexAttribute &attribute)
-{
- for (unsigned int element = 0; element < mCache.size(); element++)
- {
- if (mCache[element].type == attribute.mType && mCache[element].size == attribute.mSize && mCache[element].normalized == attribute.mNormalized)
- {
- if (mCache[element].attributeOffset == attribute.mOffset % attribute.stride())
- {
- return mCache[element].streamOffset;
- }
- }
- }
-
- return -1;
-}
-
-const VertexDataManager::FormatConverter &VertexDataManager::formatConverter(const VertexAttribute &attribute) const
-{
- return mAttributeTypes[typeIndex(attribute.mType)][attribute.mNormalized][attribute.mSize - 1];
-}
-}
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.h b/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.h
deleted file mode 100644
index 257f2c309..000000000
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/VertexDataManager.h
+++ /dev/null
@@ -1,170 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// geometry/VertexDataManager.h: Defines the VertexDataManager, a class that
-// runs the Buffer translation process.
-
-#ifndef LIBGLESV2_GEOMETRY_VERTEXDATAMANAGER_H_
-#define LIBGLESV2_GEOMETRY_VERTEXDATAMANAGER_H_
-
-#include <vector>
-#include <cstddef>
-
-#define GL_APICALL
-#include <GLES2/gl2.h>
-
-#include "libGLESv2/Context.h"
-
-namespace gl
-{
-
-struct TranslatedAttribute
-{
- bool active;
-
- D3DDECLTYPE type;
- UINT offset;
- UINT stride; // 0 means not to advance the read pointer at all
- UINT semanticIndex;
-
- IDirect3DVertexBuffer9 *vertexBuffer;
-};
-
-class VertexBuffer
-{
- public:
- VertexBuffer(IDirect3DDevice9 *device, UINT size, DWORD usageFlags);
- virtual ~VertexBuffer();
-
- void unmap();
-
- IDirect3DVertexBuffer9 *getBuffer() const;
-
- protected:
- IDirect3DDevice9 *const mDevice;
- IDirect3DVertexBuffer9 *mVertexBuffer;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VertexBuffer);
-};
-
-class ConstantVertexBuffer : public VertexBuffer
-{
- public:
- ConstantVertexBuffer(IDirect3DDevice9 *device, float x, float y, float z, float w);
- ~ConstantVertexBuffer();
-};
-
-class ArrayVertexBuffer : public VertexBuffer
-{
- public:
- ArrayVertexBuffer(IDirect3DDevice9 *device, UINT size, DWORD usageFlags);
- ~ArrayVertexBuffer();
-
- UINT size() const { return mBufferSize; }
- virtual void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset) = 0;
- virtual void reserveRequiredSpace() = 0;
- void addRequiredSpace(UINT requiredSpace);
- void addRequiredSpaceFor(ArrayVertexBuffer *buffer);
-
- protected:
- UINT mBufferSize;
- UINT mWritePosition;
- UINT mRequiredSpace;
-};
-
-class StreamingVertexBuffer : public ArrayVertexBuffer
-{
- public:
- StreamingVertexBuffer(IDirect3DDevice9 *device, UINT initialSize);
- ~StreamingVertexBuffer();
-
- void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset);
- void reserveRequiredSpace();
-};
-
-class StaticVertexBuffer : public ArrayVertexBuffer
-{
- public:
- explicit StaticVertexBuffer(IDirect3DDevice9 *device);
- ~StaticVertexBuffer();
-
- void *map(const VertexAttribute &attribute, UINT requiredSpace, UINT *streamOffset);
- void reserveRequiredSpace();
-
- UINT lookupAttribute(const VertexAttribute &attribute); // Returns the offset into the vertex buffer, or -1 if not found
-
- private:
- struct VertexElement
- {
- GLenum type;
- GLint size;
- bool normalized;
- int attributeOffset;
-
- UINT streamOffset;
- };
-
- std::vector<VertexElement> mCache;
-};
-
-class VertexDataManager
-{
- public:
- VertexDataManager(Context *context, IDirect3DDevice9 *backend);
- virtual ~VertexDataManager();
-
- void dirtyCurrentValue(int index) { mDirtyCurrentValue[index] = true; }
-
- void setupAttributes(const TranslatedAttribute *attributes);
- GLenum prepareVertexData(GLint start, GLsizei count, TranslatedAttribute *outAttribs);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(VertexDataManager);
-
- UINT spaceRequired(const VertexAttribute &attrib, std::size_t count) const;
- UINT writeAttributeData(ArrayVertexBuffer *vertexBuffer, GLint start, GLsizei count, const VertexAttribute &attribute);
-
- Context *const mContext;
- IDirect3DDevice9 *const mDevice;
-
- StreamingVertexBuffer *mStreamingBuffer;
-
- bool mDirtyCurrentValue[MAX_VERTEX_ATTRIBS];
- ConstantVertexBuffer *mCurrentValueBuffer[MAX_VERTEX_ATTRIBS];
-
- // Attribute format conversion
- struct FormatConverter
- {
- bool identity;
- std::size_t outputElementSize;
- void (*convertArray)(const void *in, std::size_t stride, std::size_t n, void *out);
- D3DDECLTYPE d3dDeclType;
- };
-
- enum { NUM_GL_VERTEX_ATTRIB_TYPES = 6 };
-
- FormatConverter mAttributeTypes[NUM_GL_VERTEX_ATTRIB_TYPES][2][4]; // [GL types as enumerated by typeIndex()][normalized][size - 1]
-
- struct TranslationDescription
- {
- DWORD capsFlag;
- FormatConverter preferredConversion;
- FormatConverter fallbackConversion;
- };
-
- // This table is used to generate mAttributeTypes.
- static const TranslationDescription mPossibleTranslations[NUM_GL_VERTEX_ATTRIB_TYPES][2][4]; // [GL types as enumerated by typeIndex()][normalized][size - 1]
-
- void checkVertexCaps(DWORD declTypes);
-
- unsigned int typeIndex(GLenum type) const;
- const FormatConverter &formatConverter(const VertexAttribute &attribute) const;
-};
-
-}
-
-#endif // LIBGLESV2_GEOMETRY_VERTEXDATAMANAGER_H_
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/vertexconversion.h b/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/vertexconversion.h
deleted file mode 100644
index e55dc72ce..000000000
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/geometry/vertexconversion.h
+++ /dev/null
@@ -1,208 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// geometry/vertexconversion.h: A library of vertex conversion classes that can be used to build
-// the FormatConverter objects used by the buffer conversion system.
-
-#ifndef LIBGLESV2_GEOMETRY_VERTEXCONVERSION_H_
-#define LIBGLESV2_GEOMETRY_VERTEXCONVERSION_H_
-
-#include <cstddef>
-#include <limits>
-
-#include "libGLESv2/Context.h" // Defines Index
-
-namespace gl
-{
-
-// Conversion types:
-// static const bool identity: true if this is an identity transform, false otherwise
-// static U convert(T): convert a single element from the input type to the output type
-// typedef ... OutputType: the type produced by this conversion
-
-template <class T>
-struct Identity
-{
- static const bool identity = true;
-
- typedef T OutputType;
-
- static T convert(T x)
- {
- return x;
- }
-};
-
-template <class FromT, class ToT>
-struct Cast
-{
- static const bool identity = false;
-
- typedef ToT OutputType;
-
- static ToT convert(FromT x)
- {
- return static_cast<ToT>(x);
- }
-};
-
-template <class T>
-struct Cast<T, T>
-{
- static const bool identity = true;
-
- typedef T OutputType;
-
- static T convert(T x)
- {
- return static_cast<T>(x);
- }
-};
-
-template <class T>
-struct Normalize
-{
- static const bool identity = false;
-
- typedef float OutputType;
-
- static float convert(T x)
- {
- typedef std::numeric_limits<T> NL;
- float f = static_cast<float>(x);
-
- if (NL::is_signed)
- {
- // const float => VC2008 computes it at compile time
- // static const float => VC2008 computes it the first time we get here, stores it to memory with static guard and all that.
- const float divisor = 1.0f/(2*static_cast<float>(NL::max())+1);
- return (2*f+1)*divisor;
- }
- else
- {
- return f/NL::max();
- }
- }
-};
-
-template <class FromType, std::size_t ScaleBits>
-struct FixedToFloat
-{
- static const bool identity = false;
-
- typedef float OutputType;
-
- static float convert(FromType x)
- {
- const float divisor = 1.0f / static_cast<float>(static_cast<FromType>(1) << ScaleBits);
- return static_cast<float>(x) * divisor;
- }
-};
-
-// Widen types:
-// static const unsigned int initialWidth: number of components before conversion
-// static const unsigned int finalWidth: number of components after conversion
-
-// Float is supported at any size.
-template <std::size_t N>
-struct NoWiden
-{
- static const std::size_t initialWidth = N;
- static const std::size_t finalWidth = N;
-};
-
-// SHORT, norm-SHORT, norm-UNSIGNED_SHORT are supported but only with 2 or 4 components
-template <std::size_t N>
-struct WidenToEven
-{
- static const std::size_t initialWidth = N;
- static const std::size_t finalWidth = N+(N&1);
-};
-
-template <std::size_t N>
-struct WidenToFour
-{
- static const std::size_t initialWidth = N;
- static const std::size_t finalWidth = 4;
-};
-
-// Most types have 0 and 1 that are just that.
-template <class T>
-struct SimpleDefaultValues
-{
- static T zero() { return static_cast<T>(0); }
- static T one() { return static_cast<T>(1); }
-};
-
-// But normalised types only store [0,1] or [-1,1] so 1.0 is represented by the max value.
-template <class T>
-struct NormalizedDefaultValues
-{
- static T zero() { return static_cast<T>(0); }
- static T one() { return std::numeric_limits<T>::max(); }
-};
-
-// Converter:
-// static const bool identity: true if this is an identity transform (with no widening)
-// static const std::size_t finalSize: number of bytes per output vertex
-// static void convertArray(const void *in, std::size_t stride, std::size_t n, void *out): convert an array of vertices. Input may be strided, but output will be unstrided.
-
-template <class InT, class WidenRule, class Converter, class DefaultValueRule = SimpleDefaultValues<InT> >
-struct VertexDataConverter
-{
- typedef typename Converter::OutputType OutputType;
- typedef InT InputType;
-
- static const bool identity = (WidenRule::initialWidth == WidenRule::finalWidth) && Converter::identity;
- static const std::size_t finalSize = WidenRule::finalWidth * sizeof(OutputType);
-
- static void convertArray(const InputType *in, std::size_t stride, std::size_t n, OutputType *out)
- {
- for (std::size_t i = 0; i < n; i++)
- {
- const InputType *ein = pointerAddBytes(in, i * stride);
-
- copyComponent(out, ein, 0, static_cast<OutputType>(DefaultValueRule::zero()));
- copyComponent(out, ein, 1, static_cast<OutputType>(DefaultValueRule::zero()));
- copyComponent(out, ein, 2, static_cast<OutputType>(DefaultValueRule::zero()));
- copyComponent(out, ein, 3, static_cast<OutputType>(DefaultValueRule::one()));
-
- out += WidenRule::finalWidth;
- }
- }
-
- static void convertArray(const void *in, std::size_t stride, std::size_t n, void *out)
- {
- return convertArray(static_cast<const InputType*>(in), stride, n, static_cast<OutputType*>(out));
- }
-
- private:
- // Advance the given pointer by a number of bytes (not pointed-to elements).
- template <class T>
- static T *pointerAddBytes(T *basePtr, std::size_t numBytes)
- {
- return reinterpret_cast<T *>(reinterpret_cast<uintptr_t>(basePtr) + numBytes);
- }
-
- static void copyComponent(OutputType *out, const InputType *in, std::size_t elementindex, OutputType defaultvalue)
- {
- if (WidenRule::finalWidth > elementindex)
- {
- if (WidenRule::initialWidth > elementindex)
- {
- out[elementindex] = Converter::convert(in[elementindex]);
- }
- else
- {
- out[elementindex] = defaultvalue;
- }
- }
- }
-};
-
-}
-
-#endif // LIBGLESV2_GEOMETRY_VERTEXCONVERSION_H_
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
index 23957fe6d..30055bb83 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.cpp
@@ -53,6 +53,81 @@ bool validImageSize(GLint level, GLsizei width, GLsizei height)
return false;
}
+bool validateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLint level, GLenum format, gl::Texture *texture)
+{
+ if (!texture)
+ {
+ return error(GL_INVALID_OPERATION, false);
+ }
+
+ if (compressed != texture->isCompressed())
+ {
+ return error(GL_INVALID_OPERATION, false);
+ }
+
+ if (format != GL_NONE && format != texture->getInternalFormat())
+ {
+ return error(GL_INVALID_OPERATION, false);
+ }
+
+ if (compressed)
+ {
+ if ((width % 4 != 0 && width != texture->getWidth(0)) ||
+ (height % 4 != 0 && height != texture->getHeight(0)))
+ {
+ return error(GL_INVALID_OPERATION, false);
+ }
+ }
+
+ if (xoffset + width > texture->getWidth(level) ||
+ yoffset + height > texture->getHeight(level))
+ {
+ return error(GL_INVALID_VALUE, false);
+ }
+
+ return true;
+}
+
+// check for combinations of format and type that are valid for ReadPixels
+bool validReadFormatType(GLenum format, GLenum type)
+{
+ switch (format)
+ {
+ case GL_RGBA:
+ switch (type)
+ {
+ case GL_UNSIGNED_BYTE:
+ break;
+ default:
+ return false;
+ }
+ break;
+ case GL_BGRA_EXT:
+ switch (type)
+ {
+ case GL_UNSIGNED_BYTE:
+ case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
+ case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
+ break;
+ default:
+ return false;
+ }
+ break;
+ case gl::IMPLEMENTATION_COLOR_READ_FORMAT:
+ switch (type)
+ {
+ case gl::IMPLEMENTATION_COLOR_READ_TYPE:
+ break;
+ default:
+ return false;
+ }
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
extern "C"
{
@@ -62,7 +137,7 @@ void __stdcall glActiveTexture(GLenum texture)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -86,7 +161,7 @@ void __stdcall glAttachShader(GLuint program, GLuint shader)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -140,7 +215,7 @@ void __stdcall glBindAttribLocation(GLuint program, GLuint index, const GLchar*
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -178,7 +253,7 @@ void __stdcall glBindBuffer(GLenum target, GLuint buffer)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -212,7 +287,7 @@ void __stdcall glBindFramebuffer(GLenum target, GLuint framebuffer)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -244,7 +319,7 @@ void __stdcall glBindRenderbuffer(GLenum target, GLuint renderbuffer)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -263,7 +338,7 @@ void __stdcall glBindTexture(GLenum target, GLuint texture)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -300,7 +375,7 @@ void __stdcall glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclamp
try
{
- gl::Context* context = gl::getContext();
+ gl::Context* context = gl::getNonLostContext();
if (context)
{
@@ -344,7 +419,7 @@ void __stdcall glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -467,7 +542,7 @@ void __stdcall glBlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -502,7 +577,7 @@ void __stdcall glBufferData(GLenum target, GLsizeiptr size, const GLvoid* data,
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -551,7 +626,7 @@ void __stdcall glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size,
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -599,7 +674,7 @@ GLenum __stdcall glCheckFramebufferStatus(GLenum target)
return error(GL_INVALID_ENUM, 0);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -630,7 +705,7 @@ void __stdcall glClear(GLbitfield mask)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -650,7 +725,7 @@ void __stdcall glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclamp
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -669,7 +744,7 @@ void __stdcall glClearDepthf(GLclampf depth)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -688,7 +763,7 @@ void __stdcall glClearStencil(GLint s)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -708,7 +783,7 @@ void __stdcall glColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboo
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -727,7 +802,7 @@ void __stdcall glCompileShader(GLuint shader)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -772,6 +847,8 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna
{
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
break;
default:
return error(GL_INVALID_ENUM);
@@ -782,7 +859,7 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -821,9 +898,27 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna
return error(GL_INVALID_ENUM);
}
- if (!context->supportsCompressedTextures())
- {
- return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ switch (internalformat) {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ if (!context->supportsDXT1Textures())
+ {
+ return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ if (!context->supportsDXT3Textures())
+ {
+ return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
+ if (!context->supportsDXT5Textures())
+ {
+ return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ }
+ break;
+ default: UNREACHABLE();
}
if (imageSize != gl::ComputeCompressedSize(width, height, internalformat))
@@ -840,6 +935,11 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna
return error(GL_INVALID_OPERATION);
}
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
texture->setCompressedImage(level, internalformat, width, height, imageSize, data);
}
else
@@ -851,6 +951,11 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna
return error(GL_INVALID_OPERATION);
}
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
switch (target)
{
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
@@ -897,6 +1002,8 @@ void __stdcall glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffs
{
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
break;
default:
return error(GL_INVALID_ENUM);
@@ -907,7 +1014,7 @@ void __stdcall glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffs
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -916,9 +1023,27 @@ void __stdcall glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffs
return error(GL_INVALID_VALUE);
}
- if (!context->supportsCompressedTextures())
- {
- return error(GL_INVALID_ENUM); // in this case, it's as though the format switch has failed.
+ switch (format) {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ if (!context->supportsDXT1Textures())
+ {
+ return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ if (!context->supportsDXT3Textures())
+ {
+ return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
+ if (!context->supportsDXT5Textures())
+ {
+ return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed
+ }
+ break;
+ default: UNREACHABLE();
}
if (imageSize != gl::ComputeCompressedSize(width, height, format))
@@ -929,52 +1054,24 @@ void __stdcall glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffs
if (xoffset % 4 != 0 || yoffset % 4 != 0)
{
return error(GL_INVALID_OPERATION); // we wait to check the offsets until this point, because the multiple-of-four restriction
- // does not exist unless DXT1 textures are supported.
+ // does not exist unless DXT textures are supported.
}
if (target == GL_TEXTURE_2D)
{
gl::Texture2D *texture = context->getTexture2D();
-
- if (!texture)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- if (!texture->isCompressed())
+ if (validateSubImageParams(true, width, height, xoffset, yoffset, level, GL_NONE, texture))
{
- return error(GL_INVALID_OPERATION);
+ texture->subImageCompressed(level, xoffset, yoffset, width, height, format, imageSize, data);
}
-
- if ((width % 4 != 0 && width != texture->getWidth()) ||
- (height % 4 != 0 && height != texture->getHeight()))
- {
- return error(GL_INVALID_OPERATION);
- }
-
- texture->subImageCompressed(level, xoffset, yoffset, width, height, format, imageSize, data);
}
else if (gl::IsCubemapTextureTarget(target))
{
gl::TextureCubeMap *texture = context->getTextureCubeMap();
-
- if (!texture)
- {
- return error(GL_INVALID_OPERATION);
- }
-
- if (!texture->isCompressed())
- {
- return error(GL_INVALID_OPERATION);
- }
-
- if ((width % 4 != 0 && width != texture->getWidth()) ||
- (height % 4 != 0 && height != texture->getHeight()))
+ if (validateSubImageParams(true, width, height, xoffset, yoffset, level, GL_NONE, texture))
{
- return error(GL_INVALID_OPERATION);
+ texture->subImageCompressed(target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
-
- texture->subImageCompressed(target, level, xoffset, yoffset, width, height, format, imageSize, data);
}
else
{
@@ -1006,10 +1103,15 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
+ if (level > context->getMaximumTextureLevel())
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
switch (target)
{
case GL_TEXTURE_2D:
@@ -1052,7 +1154,7 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
return error(GL_INVALID_OPERATION);
}
- gl::Colorbuffer *source = framebuffer->getColorbuffer();
+ gl::Renderbuffer *source = framebuffer->getColorbuffer();
GLenum colorbufferFormat = source->getInternalFormat();
// [OpenGL ES 2.0.24] table 3.9
@@ -1093,7 +1195,27 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
break;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
- if (context->supportsCompressedTextures())
+ if (context->supportsDXT1Textures())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ else
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ if (context->supportsDXT3Textures())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ else
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
+ if (context->supportsDXT5Textures())
{
return error(GL_INVALID_OPERATION);
}
@@ -1115,6 +1237,11 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
return error(GL_INVALID_OPERATION);
}
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
texture->copyImage(level, internalformat, x, y, width, height, framebuffer);
}
else if (gl::IsCubemapTextureTarget(target))
@@ -1126,6 +1253,11 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma
return error(GL_INVALID_OPERATION);
}
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
texture->copyImage(target, level, internalformat, x, y, width, height, framebuffer);
}
else UNREACHABLE();
@@ -1165,7 +1297,7 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1186,7 +1318,7 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL
return error(GL_INVALID_OPERATION);
}
- gl::Colorbuffer *source = framebuffer->getColorbuffer();
+ gl::Renderbuffer *source = framebuffer->getColorbuffer();
GLenum colorbufferFormat = source->getInternalFormat();
gl::Texture *texture = NULL;
@@ -1200,9 +1332,9 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL
}
else UNREACHABLE();
- if (!texture)
+ if (!validateSubImageParams(false, width, height, xoffset, yoffset, level, GL_NONE, texture))
{
- return error(GL_INVALID_OPERATION);
+ return; // error already registered by validateSubImageParams
}
GLenum textureFormat = texture->getInternalFormat();
@@ -1245,6 +1377,8 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL
break;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
return error(GL_INVALID_OPERATION);
default:
return error(GL_INVALID_OPERATION);
@@ -1266,7 +1400,7 @@ GLuint __stdcall glCreateProgram(void)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1287,7 +1421,7 @@ GLuint __stdcall glCreateShader(GLenum type)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1321,7 +1455,7 @@ void __stdcall glCullFace(GLenum mode)
case GL_BACK:
case GL_FRONT_AND_BACK:
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1350,7 +1484,7 @@ void __stdcall glDeleteBuffers(GLsizei n, const GLuint* buffers)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1377,7 +1511,7 @@ void __stdcall glDeleteFencesNV(GLsizei n, const GLuint* fences)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1404,7 +1538,7 @@ void __stdcall glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1434,7 +1568,7 @@ void __stdcall glDeleteProgram(GLuint program)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1470,7 +1604,7 @@ void __stdcall glDeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1497,7 +1631,7 @@ void __stdcall glDeleteShader(GLuint shader)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1533,7 +1667,7 @@ void __stdcall glDeleteTextures(GLsizei n, const GLuint* textures)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1573,7 +1707,7 @@ void __stdcall glDepthFunc(GLenum func)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1592,7 +1726,7 @@ void __stdcall glDepthMask(GLboolean flag)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1611,7 +1745,7 @@ void __stdcall glDepthRangef(GLclampf zNear, GLclampf zFar)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1630,7 +1764,7 @@ void __stdcall glDetachShader(GLuint program, GLuint shader)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1683,7 +1817,7 @@ void __stdcall glDisable(GLenum cap)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1720,7 +1854,7 @@ void __stdcall glDisableVertexAttribArray(GLuint index)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1744,7 +1878,7 @@ void __stdcall glDrawArrays(GLenum mode, GLint first, GLsizei count)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1769,7 +1903,7 @@ void __stdcall glDrawElements(GLenum mode, GLsizei count, GLenum type, const GLv
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1803,7 +1937,7 @@ void __stdcall glEnable(GLenum cap)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1840,7 +1974,7 @@ void __stdcall glEnableVertexAttribArray(GLuint index)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1859,7 +1993,7 @@ void __stdcall glFinishFenceNV(GLuint fence)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1885,11 +2019,11 @@ void __stdcall glFinish(void)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
- context->finish();
+ context->sync(true);
}
}
catch(std::bad_alloc&)
@@ -1904,11 +2038,11 @@ void __stdcall glFlush(void)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
- context->flush();
+ context->sync(false);
}
}
catch(std::bad_alloc&)
@@ -1925,12 +2059,12 @@ void __stdcall glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenu
try
{
if ((target != GL_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER_ANGLE && target != GL_READ_FRAMEBUFFER_ANGLE)
- || renderbuffertarget != GL_RENDERBUFFER)
+ || (renderbuffertarget != GL_RENDERBUFFER && renderbuffer != 0))
{
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -1941,13 +2075,13 @@ void __stdcall glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenu
framebuffer = context->getReadFramebuffer();
framebufferHandle = context->getReadFramebufferHandle();
}
- else
+ else
{
framebuffer = context->getDrawFramebuffer();
framebufferHandle = context->getDrawFramebufferHandle();
}
- if (framebufferHandle == 0 || !framebuffer)
+ if (!framebuffer || (framebufferHandle == 0 && renderbuffer != 0))
{
return error(GL_INVALID_OPERATION);
}
@@ -1996,7 +2130,7 @@ void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum t
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2092,7 +2226,7 @@ void __stdcall glFrontFace(GLenum mode)
case GL_CW:
case GL_CCW:
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2121,7 +2255,7 @@ void __stdcall glGenBuffers(GLsizei n, GLuint* buffers)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2143,7 +2277,7 @@ void __stdcall glGenerateMipmap(GLenum target)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2188,7 +2322,7 @@ void __stdcall glGenFencesNV(GLsizei n, GLuint* fences)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2215,7 +2349,7 @@ void __stdcall glGenFramebuffers(GLsizei n, GLuint* framebuffers)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2242,7 +2376,7 @@ void __stdcall glGenRenderbuffers(GLsizei n, GLuint* renderbuffers)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2269,7 +2403,7 @@ void __stdcall glGenTextures(GLsizei n, GLuint* textures)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2298,7 +2432,7 @@ void __stdcall glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize,
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2343,7 +2477,7 @@ void __stdcall glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize,
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2387,7 +2521,7 @@ void __stdcall glGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* c
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2420,7 +2554,7 @@ int __stdcall glGetAttribLocation(GLuint program, const GLchar* name)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2461,7 +2595,7 @@ void __stdcall glGetBooleanv(GLenum pname, GLboolean* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2524,7 +2658,7 @@ void __stdcall glGetBufferParameteriv(GLenum target, GLenum pname, GLint* params
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2586,7 +2720,7 @@ void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2612,7 +2746,7 @@ void __stdcall glGetFloatv(GLenum pname, GLfloat* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2673,7 +2807,7 @@ void __stdcall glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attac
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2785,13 +2919,34 @@ void __stdcall glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attac
}
}
+GLenum __stdcall glGetGraphicsResetStatusEXT(void)
+{
+ EVENT("()");
+
+ try
+ {
+ gl::Context *context = gl::getContext();
+
+ if (context)
+ {
+ return context->getResetStatus();
+ }
+
+ return GL_NO_ERROR;
+ }
+ catch(std::bad_alloc&)
+ {
+ return GL_OUT_OF_MEMORY;
+ }
+}
+
void __stdcall glGetIntegerv(GLenum pname, GLint* params)
{
EVENT("(GLenum pname = 0x%X, GLint* params = 0x%0.8p)", pname, params);
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2856,7 +3011,7 @@ void __stdcall glGetProgramiv(GLuint program, GLenum pname, GLint* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2919,7 +3074,7 @@ void __stdcall glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* len
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2945,7 +3100,7 @@ void __stdcall glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint*
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -2999,7 +3154,7 @@ void __stdcall glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3027,6 +3182,9 @@ void __stdcall glGetShaderiv(GLuint shader, GLenum pname, GLint* params)
case GL_SHADER_SOURCE_LENGTH:
*params = shaderObject->getSourceLength();
return;
+ case GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE:
+ *params = shaderObject->getTranslatedSourceLength();
+ return;
default:
return error(GL_INVALID_ENUM);
}
@@ -3050,7 +3208,7 @@ void __stdcall glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* lengt
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3127,7 +3285,7 @@ void __stdcall glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3147,20 +3305,52 @@ void __stdcall glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length
}
}
+void __stdcall glGetTranslatedShaderSourceANGLE(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
+{
+ EVENT("(GLuint shader = %d, GLsizei bufsize = %d, GLsizei* length = 0x%0.8p, GLchar* source = 0x%0.8p)",
+ shader, bufsize, length, source);
+
+ try
+ {
+ if (bufsize < 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Context *context = gl::getNonLostContext();
+
+ if (context)
+ {
+ gl::Shader *shaderObject = context->getShader(shader);
+
+ if (!shaderObject)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ shaderObject->getTranslatedSource(bufsize, length, source);
+ }
+ }
+ catch(std::bad_alloc&)
+ {
+ return error(GL_OUT_OF_MEMORY);
+ }
+}
+
const GLubyte* __stdcall glGetString(GLenum name)
{
EVENT("(GLenum name = 0x%X)", name);
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
switch (name)
{
case GL_VENDOR:
return (GLubyte*)"Google Inc.";
case GL_RENDERER:
- return (GLubyte*)"ANGLE";
+ return (GLubyte*)((context != NULL) ? context->getRendererString() : "ANGLE");
case GL_VERSION:
return (GLubyte*)"OpenGL ES 2.0 (ANGLE "VERSION_STRING")";
case GL_SHADING_LANGUAGE_VERSION:
@@ -3185,7 +3375,7 @@ void __stdcall glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3217,6 +3407,12 @@ void __stdcall glGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
case GL_TEXTURE_WRAP_T:
*params = (GLfloat)texture->getWrapT();
break;
+ case GL_TEXTURE_IMMUTABLE_FORMAT_EXT:
+ *params = (GLfloat)(texture->isImmutable() ? GL_TRUE : GL_FALSE);
+ break;
+ case GL_TEXTURE_USAGE_ANGLE:
+ *params = (GLfloat)texture->getUsage();
+ break;
default:
return error(GL_INVALID_ENUM);
}
@@ -3234,7 +3430,7 @@ void __stdcall glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3266,6 +3462,12 @@ void __stdcall glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
case GL_TEXTURE_WRAP_T:
*params = texture->getWrapT();
break;
+ case GL_TEXTURE_IMMUTABLE_FORMAT_EXT:
+ *params = texture->isImmutable() ? GL_TRUE : GL_FALSE;
+ break;
+ case GL_TEXTURE_USAGE_ANGLE:
+ *params = texture->getUsage();
+ break;
default:
return error(GL_INVALID_ENUM);
}
@@ -3277,13 +3479,53 @@ void __stdcall glGetTexParameteriv(GLenum target, GLenum pname, GLint* params)
}
}
+void __stdcall glGetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSize, GLfloat* params)
+{
+ EVENT("(GLuint program = %d, GLint location = %d, GLsizei bufSize = %d, GLfloat* params = 0x%0.8p)",
+ program, location, bufSize, params);
+
+ try
+ {
+ if (bufSize < 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Context *context = gl::getNonLostContext();
+
+ if (context)
+ {
+ if (program == 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Program *programObject = context->getProgram(program);
+
+ if (!programObject || !programObject->isLinked())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (!programObject->getUniformfv(location, &bufSize, params))
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ }
+ }
+ catch(std::bad_alloc&)
+ {
+ return error(GL_OUT_OF_MEMORY);
+ }
+}
+
void __stdcall glGetUniformfv(GLuint program, GLint location, GLfloat* params)
{
EVENT("(GLuint program = %d, GLint location = %d, GLfloat* params = 0x%0.8p)", program, location, params);
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3299,7 +3541,52 @@ void __stdcall glGetUniformfv(GLuint program, GLint location, GLfloat* params)
return error(GL_INVALID_OPERATION);
}
- if (!programObject->getUniformfv(location, params))
+ if (!programObject->getUniformfv(location, NULL, params))
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ }
+ }
+ catch(std::bad_alloc&)
+ {
+ return error(GL_OUT_OF_MEMORY);
+ }
+}
+
+void __stdcall glGetnUniformivEXT(GLuint program, GLint location, GLsizei bufSize, GLint* params)
+{
+ EVENT("(GLuint program = %d, GLint location = %d, GLsizei bufSize = %d, GLint* params = 0x%0.8p)",
+ program, location, bufSize, params);
+
+ try
+ {
+ if (bufSize < 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Context *context = gl::getNonLostContext();
+
+ if (context)
+ {
+ if (program == 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ gl::Program *programObject = context->getProgram(program);
+
+ if (!programObject || !programObject->isLinked())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (!programObject)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (!programObject->getUniformiv(location, &bufSize, params))
{
return error(GL_INVALID_OPERATION);
}
@@ -3317,7 +3604,7 @@ void __stdcall glGetUniformiv(GLuint program, GLint location, GLint* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3338,7 +3625,7 @@ void __stdcall glGetUniformiv(GLuint program, GLint location, GLint* params)
return error(GL_INVALID_OPERATION);
}
- if (!programObject->getUniformiv(location, params))
+ if (!programObject->getUniformiv(location, NULL, params))
{
return error(GL_INVALID_OPERATION);
}
@@ -3356,7 +3643,7 @@ int __stdcall glGetUniformLocation(GLuint program, const GLchar* name)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (strstr(name, "gl_") == name)
{
@@ -3384,7 +3671,7 @@ int __stdcall glGetUniformLocation(GLuint program, const GLchar* name)
return error(GL_INVALID_OPERATION, -1);
}
- return programObject->getUniformLocation(name, false);
+ return programObject->getUniformLocation(name);
}
}
catch(std::bad_alloc&)
@@ -3401,7 +3688,7 @@ void __stdcall glGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3454,7 +3741,7 @@ void __stdcall glGetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3508,7 +3795,7 @@ void __stdcall glGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** po
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3547,7 +3834,7 @@ void __stdcall glHint(GLenum target, GLenum mode)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
switch (target)
{
case GL_GENERATE_MIPMAP_HINT:
@@ -3572,7 +3859,7 @@ GLboolean __stdcall glIsBuffer(GLuint buffer)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context && buffer)
{
@@ -3598,7 +3885,7 @@ GLboolean __stdcall glIsEnabled(GLenum cap)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3632,7 +3919,7 @@ GLboolean __stdcall glIsFenceNV(GLuint fence)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3660,7 +3947,7 @@ GLboolean __stdcall glIsFramebuffer(GLuint framebuffer)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context && framebuffer)
{
@@ -3686,7 +3973,7 @@ GLboolean __stdcall glIsProgram(GLuint program)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context && program)
{
@@ -3712,7 +3999,7 @@ GLboolean __stdcall glIsRenderbuffer(GLuint renderbuffer)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context && renderbuffer)
{
@@ -3738,7 +4025,7 @@ GLboolean __stdcall glIsShader(GLuint shader)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context && shader)
{
@@ -3764,7 +4051,7 @@ GLboolean __stdcall glIsTexture(GLuint texture)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context && texture)
{
@@ -3795,7 +4082,7 @@ void __stdcall glLineWidth(GLfloat width)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3814,7 +4101,7 @@ void __stdcall glLinkProgram(GLuint program)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3847,7 +4134,7 @@ void __stdcall glPixelStorei(GLenum pname, GLint param)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3871,6 +4158,10 @@ void __stdcall glPixelStorei(GLenum pname, GLint param)
context->setPackAlignment(param);
break;
+ case GL_PACK_REVERSE_ROW_ORDER_ANGLE:
+ context->setPackReverseRowOrder(param != 0);
+ break;
+
default:
return error(GL_INVALID_ENUM);
}
@@ -3888,7 +4179,7 @@ void __stdcall glPolygonOffset(GLfloat factor, GLfloat units)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -3901,7 +4192,41 @@ void __stdcall glPolygonOffset(GLfloat factor, GLfloat units)
}
}
-void __stdcall glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels)
+void __stdcall glReadnPixelsEXT(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLsizei bufSize,
+ GLvoid *data)
+{
+ EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, "
+ "GLenum format = 0x%X, GLenum type = 0x%X, GLsizei bufSize = 0x%d, GLvoid *data = 0x%0.8p)",
+ x, y, width, height, format, type, bufSize, data);
+
+ try
+ {
+ if (width < 0 || height < 0 || bufSize < 0)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ if (!validReadFormatType(format, type))
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ gl::Context *context = gl::getNonLostContext();
+
+ if (context)
+ {
+ context->readPixels(x, y, width, height, format, type, &bufSize, data);
+ }
+ }
+ catch(std::bad_alloc&)
+ {
+ return error(GL_OUT_OF_MEMORY);
+ }
+}
+
+void __stdcall glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, GLvoid* pixels)
{
EVENT("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, "
"GLenum format = 0x%X, GLenum type = 0x%X, GLvoid* pixels = 0x%0.8p)",
@@ -3914,46 +4239,16 @@ void __stdcall glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLe
return error(GL_INVALID_VALUE);
}
- switch (format)
+ if (!validReadFormatType(format, type))
{
- case GL_RGBA:
- switch (type)
- {
- case GL_UNSIGNED_BYTE:
- break;
- default:
- return error(GL_INVALID_OPERATION);
- }
- break;
- case GL_BGRA_EXT:
- switch (type)
- {
- case GL_UNSIGNED_BYTE:
- case GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT:
- case GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT:
- break;
- default:
- return error(GL_INVALID_OPERATION);
- }
- break;
- case gl::IMPLEMENTATION_COLOR_READ_FORMAT:
- switch (type)
- {
- case gl::IMPLEMENTATION_COLOR_READ_TYPE:
- break;
- default:
- return error(GL_INVALID_OPERATION);
- }
- break;
- default:
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
- context->readPixels(x, y, width, height, format, type, pixels);
+ context->readPixels(x, y, width, height, format, type, NULL, pixels);
}
}
catch(std::bad_alloc&)
@@ -4001,7 +4296,7 @@ void __stdcall glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samp
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4058,7 +4353,7 @@ void __stdcall glSampleCoverage(GLclampf value, GLboolean invert)
try
{
- gl::Context* context = gl::getContext();
+ gl::Context* context = gl::getNonLostContext();
if (context)
{
@@ -4082,7 +4377,7 @@ void __stdcall glSetFenceNV(GLuint fence, GLenum condition)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4113,7 +4408,7 @@ void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height)
return error(GL_INVALID_VALUE);
}
- gl::Context* context = gl::getContext();
+ gl::Context* context = gl::getNonLostContext();
if (context)
{
@@ -4155,7 +4450,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar** strin
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4218,7 +4513,7 @@ void __stdcall glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4260,7 +4555,7 @@ void __stdcall glStencilMaskSeparate(GLenum face, GLuint mask)
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4348,7 +4643,7 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4375,7 +4670,7 @@ GLboolean __stdcall glTestFenceNV(GLuint fence)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4467,6 +4762,8 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
break;
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: // error cases for compressed textures are handled below
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
break;
default:
return error(GL_INVALID_VALUE);
@@ -4477,10 +4774,15 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
+ if (level > context->getMaximumTextureLevel())
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
switch (target)
{
case GL_TEXTURE_2D:
@@ -4511,10 +4813,20 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_ENUM);
}
- if (format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
- format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
- {
- if (context->supportsCompressedTextures())
+ switch (format) {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ if (context->supportsDXT1Textures())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ else
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ if (context->supportsDXT3Textures())
{
return error(GL_INVALID_OPERATION);
}
@@ -4522,18 +4834,31 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
{
return error(GL_INVALID_ENUM);
}
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
+ if (context->supportsDXT5Textures())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ else
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ default:
+ break;
}
if (type == GL_FLOAT)
{
- if (!context->supportsFloatTextures())
+ if (!context->supportsFloat32Textures())
{
return error(GL_INVALID_ENUM);
}
}
else if (type == GL_HALF_FLOAT_OES)
{
- if (!context->supportsHalfFloatTextures())
+ if (!context->supportsFloat16Textures())
{
return error(GL_INVALID_ENUM);
}
@@ -4548,6 +4873,11 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_OPERATION);
}
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
texture->setImage(level, width, height, format, type, context->getUnpackAlignment(), pixels);
}
else
@@ -4559,6 +4889,11 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL
return error(GL_INVALID_OPERATION);
}
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
switch (target)
{
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
@@ -4606,7 +4941,7 @@ void __stdcall glTexParameteri(GLenum target, GLenum pname, GLint param)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4650,6 +4985,12 @@ void __stdcall glTexParameteri(GLenum target, GLenum pname, GLint param)
return error(GL_INVALID_ENUM);
}
break;
+ case GL_TEXTURE_USAGE_ANGLE:
+ if (!texture->setUsage((GLenum)param))
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
default:
return error(GL_INVALID_ENUM);
}
@@ -4666,6 +5007,157 @@ void __stdcall glTexParameteriv(GLenum target, GLenum pname, const GLint* params
glTexParameteri(target, pname, *params);
}
+void __stdcall glTexStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+ EVENT("(GLenum target = 0x%X, GLsizei levels = %d, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)",
+ target, levels, internalformat, width, height);
+
+ try
+ {
+ if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP)
+ {
+ return error(GL_INVALID_ENUM);
+ }
+
+ if (width < 1 || height < 1 || levels < 1)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ if (target == GL_TEXTURE_CUBE_MAP && width != height)
+ {
+ return error(GL_INVALID_VALUE);
+ }
+
+ if (levels != 1 && levels != gl::log2(std::max(width, height)) + 1)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ GLenum format = gl::ExtractFormat(internalformat);
+ GLenum type = gl::ExtractType(internalformat);
+
+ if (format == GL_NONE || type == GL_NONE)
+ {
+ return error(GL_INVALID_ENUM);
+ }
+
+ gl::Context *context = gl::getNonLostContext();
+
+ if (context)
+ {
+ switch (target)
+ {
+ case GL_TEXTURE_2D:
+ if (width > context->getMaximumTextureDimension() ||
+ height > context->getMaximumTextureDimension())
+ {
+ return error(GL_INVALID_VALUE);
+ }
+ break;
+ case GL_TEXTURE_CUBE_MAP:
+ if (width > context->getMaximumCubeTextureDimension() ||
+ height > context->getMaximumCubeTextureDimension())
+ {
+ return error(GL_INVALID_VALUE);
+ }
+ break;
+ default:
+ return error(GL_INVALID_ENUM);
+ }
+
+ if (levels != 1 && !context->supportsNonPower2Texture())
+ {
+ if (!gl::isPow2(width) || !gl::isPow2(height))
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+ }
+
+ switch (internalformat)
+ {
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ if (!context->supportsDXT1Textures())
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ if (!context->supportsDXT3Textures())
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
+ if (!context->supportsDXT5Textures())
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_RGBA32F_EXT:
+ case GL_RGB32F_EXT:
+ case GL_ALPHA32F_EXT:
+ case GL_LUMINANCE32F_EXT:
+ case GL_LUMINANCE_ALPHA32F_EXT:
+ if (!context->supportsFloat32Textures())
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ case GL_RGBA16F_EXT:
+ case GL_RGB16F_EXT:
+ case GL_ALPHA16F_EXT:
+ case GL_LUMINANCE16F_EXT:
+ case GL_LUMINANCE_ALPHA16F_EXT:
+ if (!context->supportsFloat16Textures())
+ {
+ return error(GL_INVALID_ENUM);
+ }
+ break;
+ }
+
+ if (target == GL_TEXTURE_2D)
+ {
+ gl::Texture2D *texture = context->getTexture2D();
+
+ if (!texture || texture->id() == 0)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ texture->storage(levels, internalformat, width, height);
+ }
+ else if (target == GL_TEXTURE_CUBE_MAP)
+ {
+ gl::TextureCubeMap *texture = context->getTextureCubeMap();
+
+ if (!texture || texture->id() == 0)
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ if (texture->isImmutable())
+ {
+ return error(GL_INVALID_OPERATION);
+ }
+
+ texture->storage(levels, internalformat, width);
+ }
+ else UNREACHABLE();
+ }
+ }
+ catch(std::bad_alloc&)
+ {
+ return error(GL_OUT_OF_MEMORY);
+ }
+}
+
void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
GLenum format, GLenum type, const GLvoid* pixels)
{
@@ -4701,7 +5193,7 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4712,14 +5204,14 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
if (format == GL_FLOAT)
{
- if (!context->supportsFloatTextures())
+ if (!context->supportsFloat32Textures())
{
return error(GL_INVALID_ENUM);
}
}
else if (format == GL_HALF_FLOAT_OES)
{
- if (!context->supportsHalfFloatTextures())
+ if (!context->supportsFloat16Textures())
{
return error(GL_INVALID_ENUM);
}
@@ -4728,34 +5220,18 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint
if (target == GL_TEXTURE_2D)
{
gl::Texture2D *texture = context->getTexture2D();
-
- if (!texture)
+ if (validateSubImageParams(false, width, height, xoffset, yoffset, level, format, texture))
{
- return error(GL_INVALID_OPERATION);
- }
-
- if (texture->isCompressed())
- {
- return error(GL_INVALID_OPERATION);
- }
-
- if (format != texture->getInternalFormat())
- {
- return error(GL_INVALID_OPERATION);
+ texture->subImage(level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
}
-
- texture->subImage(level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
}
else if (gl::IsCubemapTextureTarget(target))
{
gl::TextureCubeMap *texture = context->getTextureCubeMap();
-
- if (!texture)
+ if (validateSubImageParams(false, width, height, xoffset, yoffset, level, format, texture))
{
- return error(GL_INVALID_OPERATION);
+ texture->subImage(target, level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
}
-
- texture->subImage(target, level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
}
else
{
@@ -4790,7 +5266,7 @@ void __stdcall glUniform1fv(GLint location, GLsizei count, const GLfloat* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4834,7 +5310,7 @@ void __stdcall glUniform1iv(GLint location, GLsizei count, const GLint* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4880,7 +5356,7 @@ void __stdcall glUniform2fv(GLint location, GLsizei count, const GLfloat* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4926,7 +5402,7 @@ void __stdcall glUniform2iv(GLint location, GLsizei count, const GLint* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -4972,7 +5448,7 @@ void __stdcall glUniform3fv(GLint location, GLsizei count, const GLfloat* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5018,7 +5494,7 @@ void __stdcall glUniform3iv(GLint location, GLsizei count, const GLint* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5064,7 +5540,7 @@ void __stdcall glUniform4fv(GLint location, GLsizei count, const GLfloat* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5110,7 +5586,7 @@ void __stdcall glUniform4iv(GLint location, GLsizei count, const GLint* v)
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5150,7 +5626,7 @@ void __stdcall glUniformMatrix2fv(GLint location, GLsizei count, GLboolean trans
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5190,7 +5666,7 @@ void __stdcall glUniformMatrix3fv(GLint location, GLsizei count, GLboolean trans
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5230,7 +5706,7 @@ void __stdcall glUniformMatrix4fv(GLint location, GLsizei count, GLboolean trans
return;
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5259,7 +5735,7 @@ void __stdcall glUseProgram(GLuint program)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5297,7 +5773,7 @@ void __stdcall glValidateProgram(GLuint program)
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5335,7 +5811,7 @@ void __stdcall glVertexAttrib1f(GLuint index, GLfloat x)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5360,7 +5836,7 @@ void __stdcall glVertexAttrib1fv(GLuint index, const GLfloat* values)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5385,7 +5861,7 @@ void __stdcall glVertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5410,7 +5886,7 @@ void __stdcall glVertexAttrib2fv(GLuint index, const GLfloat* values)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5435,7 +5911,7 @@ void __stdcall glVertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5460,7 +5936,7 @@ void __stdcall glVertexAttrib3fv(GLuint index, const GLfloat* values)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5485,7 +5961,7 @@ void __stdcall glVertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, G
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5510,7 +5986,7 @@ void __stdcall glVertexAttrib4fv(GLuint index, const GLfloat* values)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5559,7 +6035,7 @@ void __stdcall glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLbo
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5583,7 +6059,7 @@ void __stdcall glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5625,7 +6101,7 @@ void __stdcall glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
@@ -5682,6 +6158,12 @@ __eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *
{"glGetFenceivNV", (__eglMustCastToProperFunctionPointerType)glGetFenceivNV},
{"glFinishFenceNV", (__eglMustCastToProperFunctionPointerType)glFinishFenceNV},
{"glSetFenceNV", (__eglMustCastToProperFunctionPointerType)glSetFenceNV},
+ {"glGetTranslatedShaderSourceANGLE", (__eglMustCastToProperFunctionPointerType)glGetTranslatedShaderSourceANGLE},
+ {"glTexStorage2DEXT", (__eglMustCastToProperFunctionPointerType)glTexStorage2DEXT},
+ {"glGetGraphicsResetStatusEXT", (__eglMustCastToProperFunctionPointerType)glGetGraphicsResetStatusEXT},
+ {"glReadnPixelsEXT", (__eglMustCastToProperFunctionPointerType)glReadnPixelsEXT},
+ {"glGetnUniformfvEXT", (__eglMustCastToProperFunctionPointerType)glGetnUniformfvEXT},
+ {"glGetnUniformivEXT", (__eglMustCastToProperFunctionPointerType)glGetnUniformivEXT},
};
for (int ext = 0; ext < sizeof(glExtensions) / sizeof(Extension); ext++)
@@ -5695,19 +6177,26 @@ __eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char *
return NULL;
}
-void __stdcall glBindTexImage(egl::Surface *surface)
+// Non-public functions used by EGL
+
+bool __stdcall glBindTexImage(egl::Surface *surface)
{
EVENT("(egl::Surface* surface = 0x%0.8p)",
surface);
try
{
- gl::Context *context = gl::getContext();
+ gl::Context *context = gl::getNonLostContext();
if (context)
{
gl::Texture2D *textureObject = context->getTexture2D();
+ if (textureObject->isImmutable())
+ {
+ return false;
+ }
+
if (textureObject)
{
textureObject->bindTexImage(surface);
@@ -5716,8 +6205,10 @@ void __stdcall glBindTexImage(egl::Surface *surface)
}
catch(std::bad_alloc&)
{
- return error(GL_OUT_OF_MEMORY);
+ return error(GL_OUT_OF_MEMORY, false);
}
+
+ return true;
}
}
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.def b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.def
index b91217199..2173f74fb 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.def
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.def
@@ -154,6 +154,12 @@ EXPORTS
glIsFenceNV @155
glSetFenceNV @156
glTestFenceNV @157
+ glGetTranslatedShaderSourceANGLE @159
+ glTexStorage2DEXT @160
+ glGetGraphicsResetStatusEXT @161
+ glReadnPixelsEXT @162
+ glGetnUniformfvEXT @163
+ glGetnUniformivEXT @164
; EGL dependencies
glCreateContext @144 NONAME
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.rc b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.rc
index 4e733bdaf..0ad21e440 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.rc
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "afxres.h"
+#include <windows.h>
#include "../common/version.h"
/////////////////////////////////////////////////////////////////////////////
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
index 5bb2e68a9..80f15a14e 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/libGLESv2.vcproj
@@ -12,6 +12,9 @@
<Platform
Name="Win32"
/>
+ <Platform
+ Name="x64"
+ />
</Platforms>
<ToolFiles>
</ToolFiles>
@@ -175,6 +178,167 @@
CommandLine="@echo on&#x0D;&#x0A;mkdir &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libGLESv2.dll&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libGLESv2.lib&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;@echo off&#x0D;&#x0A;"
/>
</Configuration>
+ <Configuration
+ Name="Debug|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(ProjectDir)/..; $(ProjectDir)/../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBGLESV2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="d3d9.lib D3dx9.lib d3dcompiler.lib"
+ LinkIncremental="2"
+ ModuleDefinitionFile="libGLESv2.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="@echo on&#x0D;&#x0A;mkdir &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libGLESv2.dll&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libGLESv2.lib&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;@echo off&#x0D;&#x0A;"
+ />
+ </Configuration>
+ <Configuration
+ Name="Release|x64"
+ OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
+ IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+ ConfigurationType="2"
+ CharacterSet="1"
+ WholeProgramOptimization="1"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ TargetEnvironment="3"
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="2"
+ AdditionalIncludeDirectories="$(ProjectDir)/..; $(ProjectDir)/../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBGLESV2_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="false"
+ DebugInformationFormat="3"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="d3d9.lib D3dx9.lib d3dcompiler.lib"
+ LinkIncremental="1"
+ IgnoreAllDefaultLibraries="false"
+ ModuleDefinitionFile="libGLESv2.def"
+ GenerateDebugInformation="true"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ RandomizedBaseAddress="1"
+ DataExecutionPrevention="0"
+ TargetMachine="17"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="@echo on&#x0D;&#x0A;mkdir &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libGLESv2.dll&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;copy &quot;$(OutDir)\libGLESv2.lib&quot; &quot;$(ProjectDir)..\..\lib\$(ConfigurationName)\&quot;&#x0D;&#x0A;@echo off&#x0D;&#x0A;"
+ />
+ </Configuration>
</Configurations>
<References>
</References>
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/main.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/main.cpp
index ad1156309..154d277c2 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/main.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/main.cpp
@@ -7,6 +7,7 @@
// main.cpp: DLL entry point and management of thread-local data.
#include "libGLESv2/main.h"
+#include "libGLESv2/utilities.h"
#include "common/debug.h"
#include "libEGL/Surface.h"
@@ -93,6 +94,25 @@ Context *getContext()
return current->context;
}
+Context *getNonLostContext()
+{
+ Context *context = getContext();
+
+ if (context)
+ {
+ if (context->isContextLost())
+ {
+ error(GL_OUT_OF_MEMORY);
+ return NULL;
+ }
+ else
+ {
+ return context;
+ }
+ }
+ return NULL;
+}
+
egl::Display *getDisplay()
{
Current *current = (Current*)TlsGetValue(currentTLS);
@@ -106,6 +126,19 @@ IDirect3DDevice9 *getDevice()
return display->getDevice();
}
+
+bool checkDeviceLost(HRESULT errorCode)
+{
+ egl::Display *display = NULL;
+
+ if (isDeviceLostError(errorCode))
+ {
+ display = gl::getDisplay();
+ display->notifyDeviceLost();
+ return true;
+ }
+ return false;
+}
}
// Records an error code
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/main.h b/Source/ThirdParty/ANGLE/src/libGLESv2/main.h
index 7f9c8807b..504848aa6 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/main.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/main.h
@@ -29,9 +29,12 @@ struct Current
void makeCurrent(Context *context, egl::Display *display, egl::Surface *surface);
Context *getContext();
+Context *getNonLostContext();
egl::Display *getDisplay();
IDirect3DDevice9 *getDevice();
+
+bool checkDeviceLost(HRESULT errorCode);
}
void error(GLenum errorCode);
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.cpp b/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.cpp
index ba23fd365..6dc419c7a 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.cpp
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.cpp
@@ -20,7 +20,8 @@
namespace gl
{
-int UniformComponentCount(GLenum type)
+// This is how much data the application expects for a uniform
+int UniformExternalComponentCount(GLenum type)
{
switch (type)
{
@@ -54,6 +55,42 @@ int UniformComponentCount(GLenum type)
return 0;
}
+// This is how much data we actually store for a uniform
+int UniformInternalComponentCount(GLenum type)
+{
+ switch (type)
+ {
+ case GL_BOOL:
+ case GL_INT:
+ case GL_SAMPLER_2D:
+ case GL_SAMPLER_CUBE:
+ return 1;
+ case GL_BOOL_VEC2:
+ case GL_INT_VEC2:
+ return 2;
+ case GL_INT_VEC3:
+ case GL_BOOL_VEC3:
+ return 3;
+ case GL_FLOAT:
+ case GL_FLOAT_VEC2:
+ case GL_FLOAT_VEC3:
+ case GL_BOOL_VEC4:
+ case GL_FLOAT_VEC4:
+ case GL_INT_VEC4:
+ return 4;
+ case GL_FLOAT_MAT2:
+ return 8;
+ case GL_FLOAT_MAT3:
+ return 12;
+ case GL_FLOAT_MAT4:
+ return 16;
+ default:
+ UNREACHABLE();
+ }
+
+ return 0;
+}
+
GLenum UniformComponentType(GLenum type)
{
switch(type)
@@ -85,16 +122,27 @@ GLenum UniformComponentType(GLenum type)
return GL_NONE;
}
-size_t UniformTypeSize(GLenum type)
+size_t UniformComponentSize(GLenum type)
{
switch(type)
{
- case GL_BOOL: return sizeof(GLboolean);
+ case GL_BOOL: return sizeof(GLint);
case GL_FLOAT: return sizeof(GLfloat);
case GL_INT: return sizeof(GLint);
+ default: UNREACHABLE();
}
- return UniformTypeSize(UniformComponentType(type)) * UniformComponentCount(type);
+ return 0;
+}
+
+size_t UniformInternalSize(GLenum type)
+{
+ return UniformComponentSize(UniformComponentType(type)) * UniformInternalComponentCount(type);
+}
+
+size_t UniformExternalSize(GLenum type)
+{
+ return UniformComponentSize(UniformComponentType(type)) * UniformExternalComponentCount(type);
}
int VariableRowCount(GLenum type)
@@ -200,18 +248,23 @@ GLsizei ComputeCompressedSize(GLsizei width, GLsizei height, GLenum format)
{
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
+ return 8 * (GLsizei)ceil((float)width / 4.0f) * (GLsizei)ceil((float)height / 4.0f);
break;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
+ return 16 * (GLsizei)ceil((float)width / 4.0f) * (GLsizei)ceil((float)height / 4.0f);
default:
return 0;
}
- return 8 * (GLsizei)ceil((float)width / 4.0f) * (GLsizei)ceil((float)height / 4.0f);
}
bool IsCompressed(GLenum format)
{
if(format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
- format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT)
+ format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
+ format == GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE ||
+ format == GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE)
{
return true;
}
@@ -327,6 +380,68 @@ bool CheckTextureFormatType(GLenum format, GLenum type)
}
}
+GLenum ExtractFormat(GLenum internalformat)
+{
+ switch (internalformat)
+ {
+ case GL_RGB565: return GL_RGB;
+ case GL_RGBA4: return GL_RGBA;
+ case GL_RGB5_A1: return GL_RGBA;
+ case GL_RGB8_OES: return GL_RGB;
+ case GL_RGBA8_OES: return GL_RGBA;
+ case GL_LUMINANCE8_ALPHA8_EXT: return GL_LUMINANCE_ALPHA;
+ case GL_LUMINANCE8_EXT: return GL_LUMINANCE;
+ case GL_ALPHA8_EXT: return GL_ALPHA;
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: return GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: return GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE;
+ case GL_RGBA32F_EXT: return GL_RGBA;
+ case GL_RGB32F_EXT: return GL_RGB;
+ case GL_ALPHA32F_EXT: return GL_ALPHA;
+ case GL_LUMINANCE32F_EXT: return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA32F_EXT: return GL_LUMINANCE_ALPHA;
+ case GL_RGBA16F_EXT: return GL_RGBA;
+ case GL_RGB16F_EXT: return GL_RGB;
+ case GL_ALPHA16F_EXT: return GL_ALPHA;
+ case GL_LUMINANCE16F_EXT: return GL_LUMINANCE;
+ case GL_LUMINANCE_ALPHA16F_EXT: return GL_LUMINANCE_ALPHA;
+ case GL_BGRA8_EXT: return GL_BGRA_EXT;
+ default: return GL_NONE; // Unsupported
+ }
+}
+
+GLenum ExtractType(GLenum internalformat)
+{
+ switch (internalformat)
+ {
+ case GL_RGB565: return GL_UNSIGNED_SHORT_5_6_5;
+ case GL_RGBA4: return GL_UNSIGNED_SHORT_4_4_4_4;
+ case GL_RGB5_A1: return GL_UNSIGNED_SHORT_5_5_5_1;
+ case GL_RGB8_OES: return GL_UNSIGNED_BYTE;
+ case GL_RGBA8_OES: return GL_UNSIGNED_BYTE;
+ case GL_LUMINANCE8_ALPHA8_EXT: return GL_UNSIGNED_BYTE;
+ case GL_LUMINANCE8_EXT: return GL_UNSIGNED_BYTE;
+ case GL_ALPHA8_EXT: return GL_UNSIGNED_BYTE;
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return GL_UNSIGNED_BYTE;
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return GL_UNSIGNED_BYTE;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: return GL_UNSIGNED_BYTE;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: return GL_UNSIGNED_BYTE;
+ case GL_RGBA32F_EXT: return GL_FLOAT;
+ case GL_RGB32F_EXT: return GL_FLOAT;
+ case GL_ALPHA32F_EXT: return GL_FLOAT;
+ case GL_LUMINANCE32F_EXT: return GL_FLOAT;
+ case GL_LUMINANCE_ALPHA32F_EXT: return GL_FLOAT;
+ case GL_RGBA16F_EXT: return GL_HALF_FLOAT_OES;
+ case GL_RGB16F_EXT: return GL_HALF_FLOAT_OES;
+ case GL_ALPHA16F_EXT: return GL_HALF_FLOAT_OES;
+ case GL_LUMINANCE16F_EXT: return GL_HALF_FLOAT_OES;
+ case GL_LUMINANCE_ALPHA16F_EXT: return GL_HALF_FLOAT_OES;
+ case GL_BGRA8_EXT: return GL_UNSIGNED_BYTE;
+ default: return GL_NONE; // Unsupported
+ }
+}
+
bool IsColorRenderable(GLenum internalformat)
{
switch (internalformat)
@@ -806,6 +921,50 @@ unsigned int GetDepthSize(D3DFORMAT depthFormat)
}
}
+bool IsFloat32Format(D3DFORMAT surfaceFormat)
+{
+ switch(surfaceFormat)
+ {
+ case D3DFMT_R16F:
+ case D3DFMT_G16R16F:
+ case D3DFMT_A16B16G16R16F:
+ return false;
+ case D3DFMT_R32F:
+ case D3DFMT_G32R32F:
+ case D3DFMT_A32B32G32R32F:
+ return true;
+ case D3DFMT_A8R8G8B8:
+ case D3DFMT_X8R8G8B8:
+ case D3DFMT_A1R5G5B5:
+ case D3DFMT_R5G6B5:
+ return false;
+ default: UNREACHABLE();
+ }
+ return false;
+}
+
+bool IsFloat16Format(D3DFORMAT surfaceFormat)
+{
+ switch(surfaceFormat)
+ {
+ case D3DFMT_R16F:
+ case D3DFMT_G16R16F:
+ case D3DFMT_A16B16G16R16F:
+ return true;
+ case D3DFMT_R32F:
+ case D3DFMT_G32R32F:
+ case D3DFMT_A32B32G32R32F:
+ return false;
+ case D3DFMT_A8R8G8B8:
+ case D3DFMT_X8R8G8B8:
+ case D3DFMT_A1R5G5B5:
+ case D3DFMT_R5G6B5:
+ return false;
+ default: UNREACHABLE();
+ }
+ return false;
+}
+
GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type)
{
if (type == D3DMULTISAMPLE_NONMASKABLE)
diff --git a/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.h b/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.h
index bf7f4f934..735fa503d 100644
--- a/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.h
+++ b/Source/ThirdParty/ANGLE/src/libGLESv2/utilities.h
@@ -21,9 +21,11 @@ namespace gl
struct Color;
-int UniformComponentCount(GLenum type);
+int UniformExternalComponentCount(GLenum type);
+int UniformInternalComponentCount(GLenum type);
GLenum UniformComponentType(GLenum type);
-size_t UniformTypeSize(GLenum type);
+size_t UniformInternalSize(GLenum type);
+size_t UniformExternalSize(GLenum type);
int VariableRowCount(GLenum type);
int VariableColumnCount(GLenum type);
@@ -37,6 +39,8 @@ bool IsCompressed(GLenum format);
bool IsCubemapTextureTarget(GLenum target);
bool IsTextureTarget(GLenum target);
bool CheckTextureFormatType(GLenum format, GLenum type);
+GLenum ExtractFormat(GLenum internalformat);
+GLenum ExtractType(GLenum internalformat);
bool IsColorRenderable(GLenum internalformat);
bool IsDepthRenderable(GLenum internalformat);
@@ -73,6 +77,8 @@ GLuint GetGreenSize(D3DFORMAT colorFormat);
GLuint GetBlueSize(D3DFORMAT colorFormat);
GLuint GetDepthSize(D3DFORMAT depthFormat);
GLuint GetStencilSize(D3DFORMAT stencilFormat);
+bool IsFloat32Format(D3DFORMAT surfaceFormat);
+bool IsFloat16Format(D3DFORMAT surfaceFormat);
GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type);
@@ -84,4 +90,18 @@ GLenum ConvertDepthStencilFormat(D3DFORMAT format);
std::string getTempPath();
void writeFile(const char* path, const void* data, size_t size);
+inline bool isDeviceLostError(HRESULT errorCode)
+{
+ switch (errorCode)
+ {
+ case D3DERR_DRIVERINTERNALERROR:
+ case D3DERR_DEVICELOST:
+ case D3DERR_DEVICEHUNG:
+ case D3DERR_DEVICEREMOVED:
+ return true;
+ default:
+ return false;
+ }
+};
+
#endif // LIBGLESV2_UTILITIES_H
diff --git a/Source/ThirdParty/ChangeLog b/Source/ThirdParty/ChangeLog
index db565076d..c958581e1 100644
--- a/Source/ThirdParty/ChangeLog
+++ b/Source/ThirdParty/ChangeLog
@@ -1,3 +1,12 @@
+2012-01-06 Anders Carlsson <andersca@apple.com>
+
+ Make JavaScriptCore.framework a reference and put it in a Frameworks group
+ https://bugs.webkit.org/show_bug.cgi?id=75740
+
+ Reviewed by Mark Rowe.
+
+ * gtest/xcode/gtest.xcodeproj/project.pbxproj:
+
2012-01-05 Dan Bernstein <mitz@apple.com>
Made Debug/Release builds of gtest build only for the active architecture.
diff --git a/Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj b/Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj
index 5f641e9ed..d2e848add 100644
--- a/Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj
+++ b/Source/ThirdParty/gtest/xcode/gtest.xcodeproj/project.pbxproj
@@ -37,6 +37,7 @@
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
+ 1A0A4C4514B7A3B500895135 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A0A4C4414B7A3B500895135 /* JavaScriptCore.framework */; };
224A12A30E9EADCC00BD17FD /* gtest-test-part.h in Headers */ = {isa = PBXBuildFile; fileRef = 224A12A20E9EADCC00BD17FD /* gtest-test-part.h */; settings = {ATTRIBUTES = (Public, ); }; };
3BF6F2A00E79B5AD000F2EEE /* gtest-type-util.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 3BF6F29F0E79B5AD000F2EEE /* gtest-type-util.h */; };
3BF6F2A50E79B616000F2EEE /* gtest-typed-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 3BF6F2A40E79B616000F2EEE /* gtest-typed-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -74,7 +75,6 @@
40C84993101A36A60083642A /* libgtest_main.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 40C8490B101A217E0083642A /* libgtest_main.a */; };
40C849A2101A37050083642A /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4539C8FF0EC27F6400A70F4C /* gtest.framework */; };
40C849A4101A37150083642A /* gtest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4539C8FF0EC27F6400A70F4C /* gtest.framework */; };
- 444D117514A262FB009FEC3F /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 444D117414A262FB009FEC3F /* JavaScriptCore.framework */; };
4539C9340EC280AE00A70F4C /* gtest-param-test.h in Headers */ = {isa = PBXBuildFile; fileRef = 4539C9330EC280AE00A70F4C /* gtest-param-test.h */; settings = {ATTRIBUTES = (Public, ); }; };
4539C9380EC280E200A70F4C /* gtest-linked_ptr.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9350EC280E200A70F4C /* gtest-linked_ptr.h */; };
4539C9390EC280E200A70F4C /* gtest-param-util-generated.h in Copy Headers Internal */ = {isa = PBXBuildFile; fileRef = 4539C9360EC280E200A70F4C /* gtest-param-util-generated.h */; };
@@ -199,6 +199,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
+ 1A0A4C4414B7A3B500895135 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
224A12A10E9EADA700BD17FD /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = "gtest-all.cc"; sourceTree = "<group>"; };
224A12A20E9EADCC00BD17FD /* gtest-test-part.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = "gtest-test-part.h"; sourceTree = "<group>"; };
3B238C120E7FE13C00846E11 /* gtest_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gtest_unittest.cc; sourceTree = "<group>"; };
@@ -238,7 +239,6 @@
40D4CDF30E30E07400294801 /* General.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = General.xcconfig; sourceTree = "<group>"; };
40D4CDF40E30E07400294801 /* ReleaseProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ReleaseProject.xcconfig; sourceTree = "<group>"; };
40D4CF510E30F5E200294801 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
- 444D117414A262FB009FEC3F /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
44C48DFF14A4098F00A2D9C7 /* ProductionProject.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = ProductionProject.xcconfig; sourceTree = "<group>"; };
4539C8FF0EC27F6400A70F4C /* gtest.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = gtest.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4539C9330EC280AE00A70F4C /* gtest-param-test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "gtest-param-test.h"; sourceTree = "<group>"; };
@@ -288,7 +288,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 444D117514A262FB009FEC3F /* JavaScriptCore.framework in Frameworks */,
+ 1A0A4C4514B7A3B500895135 /* JavaScriptCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -312,11 +312,11 @@
0867D691FE84028FC02AAC07 /* gtest */ = {
isa = PBXGroup;
children = (
- 444D117414A262FB009FEC3F /* JavaScriptCore.framework */,
40D4CDF00E30E07400294801 /* Config */,
08FB77ACFE841707C02AAC07 /* Source */,
40D4CF4E0E30F5E200294801 /* Resources */,
403EE37B0E377822004BD1E2 /* Scripts */,
+ 1A0A4C4614B7A3BC00895135 /* Frameworks */,
034768DDFF38A45A11DB9C8B /* Products */,
);
name = gtest;
@@ -337,6 +337,14 @@
name = Source;
sourceTree = "<group>";
};
+ 1A0A4C4614B7A3BC00895135 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 1A0A4C4414B7A3B500895135 /* JavaScriptCore.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
3B238BF00E7FE13B00846E11 /* test */ = {
isa = PBXGroup;
children = (
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index a360c8a0a..436f8f213 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,12 @@
+2012-01-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [Mac] Sort the resources of WTF.xcodeproj
+ https://bugs.webkit.org/show_bug.cgi?id=75639
+
+ Reviewed by Andreas Kling.
+
+ * WTF.xcodeproj/project.pbxproj:
+
2012-01-06 Eric Seidel <eric@webkit.org> and Gustavo Noronha Silva <gustavo.noronha@collabora.com>
Make the new WTF module build on Gtk
diff --git a/Source/WTF/WTF.xcodeproj/project.pbxproj b/Source/WTF/WTF.xcodeproj/project.pbxproj
index 4d0fb157d..8be73df6a 100644
--- a/Source/WTF/WTF.xcodeproj/project.pbxproj
+++ b/Source/WTF/WTF.xcodeproj/project.pbxproj
@@ -36,9 +36,9 @@
5D247B5714689B8600E78B76 = {
isa = PBXGroup;
children = (
- 5D247B7614689D7600E78B76 /* Source */,
5D247B6D14689C4700E78B76 /* Configurations */,
5D247B6314689B8600E78B76 /* Products */,
+ 5D247B7614689D7600E78B76 /* Source */,
);
sourceTree = "<group>";
};
@@ -78,8 +78,8 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
- 5D247B7A14689D8900E78B76 /* Stub.h in Headers */,
5D247EB21468B01500E78B76 /* HeaderDetection.h in Headers */,
+ 5D247B7A14689D8900E78B76 /* Stub.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt
index 1f65f1e3c..717a7d869 100644
--- a/Source/WebCore/CMakeLists.txt
+++ b/Source/WebCore/CMakeLists.txt
@@ -610,6 +610,7 @@ SET(WebCore_SOURCES
dom/TransformSourceLibxslt.cpp
dom/Traversal.cpp
dom/TreeScope.cpp
+ dom/TreeScopeAdopter.cpp
dom/TreeWalker.cpp
dom/UIEvent.cpp
dom/UIEventWithKeyState.cpp
@@ -869,6 +870,7 @@ SET(WebCore_SOURCES
inspector/ConsoleMessage.cpp
inspector/ContentSearchUtils.cpp
+ inspector/DOMEditor.cpp
inspector/DOMNodeHighlighter.cpp
inspector/IdentifiersFactory.cpp
inspector/InjectedScript.cpp
@@ -989,12 +991,14 @@ SET(WebCore_SOURCES
page/DOMSelection.cpp
page/DOMTimer.cpp
page/DOMWindow.cpp
+ page/DOMWindowProperty.cpp
page/DragController.cpp
page/EventHandler.cpp
page/EventSource.cpp
page/FocusController.cpp
page/Frame.cpp
page/FrameActionScheduler.cpp
+ page/FrameDestructionObserver.cpp
page/FrameTree.cpp
page/FrameView.cpp
page/Geolocation.cpp
@@ -1345,6 +1349,7 @@ SET(WebCore_SOURCES
storage/AbstractDatabase.cpp
storage/ChangeVersionWrapper.cpp
+ storage/DOMWindowSQLDatabase.cpp
storage/Database.cpp
storage/DatabaseAuthorizer.cpp
storage/DatabaseSync.cpp
@@ -1464,6 +1469,7 @@ ENDIF ()
IF (ENABLE_SQL_DATABASE)
LIST(APPEND WebCore_IDL_FILES
+ storage/DOMWindowSQLDatabase.idl
storage/Database.idl
storage/DatabaseCallback.idl
storage/DatabaseSync.idl
@@ -2327,7 +2333,10 @@ ADD_SOURCE_WEBCORE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp tokeniz
# Replace ";" with "space" in order to recognize feature definition in css files.
SET(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "")
FOREACH(_feature ${FEATURE_DEFINES})
- SET(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR} ${_feature}")
+ # filter out color input since we have our own solution
+ IF (NOT CMAKE_SYSTEM_NAME MATCHES "QNX" OR NOT _feature MATCHES "ENABLE_INPUT_COLOR")
+ SET(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR} ${_feature}")
+ ENDIF()
ENDFOREACH()
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 5b5e4bc47..d8d28c26b 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,3408 @@
+2012-01-11 Dan Bernstein <mitz@apple.com>
+
+ <rdar://problem/10674686> Implement the font-kerning CSS property
+ https://bugs.webkit.org/show_bug.cgi?id=76033
+
+ Reviewed by Darin Adler.
+
+ Tests: fast/text/font-kerning-expected.html
+ fast/text/font-kerning.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added code to handle
+ font-kerning.
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue): Ditto.
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added mapping from FontDescription::Kerning.
+ (WebCore::CSSPrimitiveValue::operator FontDescription::Kerning): Added mapping to
+ FontDescription::Kerning.
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty): Added font-kerning to the set of inherited
+ properties.
+ * css/CSSPropertyNames.in: Added -webkit-font-kerning.
+ * css/CSSStyleApplyProperty.cpp:
+ (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): Added a handler for font-kerning.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyDeclaration): Updated for the number of properties that
+ affect the font.
+ * platform/graphics/Font.h:
+ (WebCore::Font::typesettingFeatures): Changed to enable kerning if font-kerning is set to
+ normal, disable it if font-kerning is set to none, and leave it to the default (determined
+ by the text-rendering property) if font-kerning is set to auto.
+ * platform/graphics/FontDescription.h:
+ (WebCore::FontDescription::FontDescription): Added a Kerning enum.
+ (WebCore::FontDescription::kerning): Added this getter.
+ (WebCore::FontDescription::setKerning): Added this setter.
+ (WebCore::FontDescription::operator==): Updated to compare the m_kerning member.
+
+2012-01-10 Ryosuke Niwa <rniwa@webkit.org>
+
+ Build fix. Forgot to revert Node.h.
+
+ * dom/Node.h:
+
+2012-01-10 Ryosuke Niwa <rniwa@webkit.org>
+
+ Revert r104210. It turned out that this patch makes improving the node list caches harder.
+
+ * dom/Attr.cpp:
+ (WebCore::Attr::setValue):
+ (WebCore::Attr::childrenChanged):
+ * dom/DynamicNodeList.cpp:
+ (WebCore::DynamicSubtreeNodeList::DynamicSubtreeNodeList):
+ (WebCore::DynamicSubtreeNodeList::length):
+ (WebCore::DynamicSubtreeNodeList::itemForwardsFromCurrent):
+ (WebCore::DynamicSubtreeNodeList::itemBackwardsFromCurrent):
+ (WebCore::DynamicSubtreeNodeList::item):
+ (WebCore::DynamicSubtreeNodeList::invalidateCache):
+ (WebCore::DynamicSubtreeNodeList::Caches::create):
+ (WebCore::DynamicSubtreeNodeList::Caches::reset):
+ * dom/DynamicNodeList.h:
+ * dom/Element.cpp:
+ (WebCore::Element::updateAfterAttributeChanged):
+ * dom/Node.cpp:
+ (WebCore::Node::invalidateNodeListsCacheAfterAttributeChanged):
+ (WebCore::Node::invalidateNodeListsCacheAfterChildrenChanged):
+ (WebCore::Node::notifyLocalNodeListsLabelChanged):
+ (WebCore::Node::itemTypeAttributeChanged):
+ (WebCore::NodeListsNodeData::invalidateCaches):
+ (WebCore::NodeListsNodeData::invalidateCachesThatDependOnAttributes):
+ * dom/NodeRareData.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::parseMappedAttribute):
+ * html/HTMLLabelElement.cpp:
+ (WebCore::HTMLLabelElement::parseMappedAttribute):
+ * html/HTMLLabelElement.h:
+
+2012-01-10 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104263 and r104381.
+ http://trac.webkit.org/changeset/104263
+ http://trac.webkit.org/changeset/104381
+ https://bugs.webkit.org/show_bug.cgi?id=76029
+
+ Preparation to rollout r104210 (Requested by rniwa on
+ #webkit).
+
+ * dom/DynamicNodeList.cpp:
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::setLengthCache):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::setItemCache):
+ (WebCore::DynamicSubtreeNodeList::length):
+ (WebCore::DynamicSubtreeNodeList::item):
+ * dom/DynamicNodeList.h:
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::isLengthCacheValid):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::isItemCacheValid):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::domVersionIsConsistent):
+
+2012-01-10 David Kilzer <ddkilzer@apple.com>
+
+ Add TestWebKitAPI tests for KURL
+ <http://webkit.org/b/75774>
+
+ Reviewed by Adam Barth.
+
+ * WebCore.exp.in: Export additional KURL methods used in
+ testing.
+
+2012-01-10 Jer Noble <jer.noble@apple.com>
+
+ Crash in HTMLMediaElement::shouldDisableSleep()
+ https://bugs.webkit.org/show_bug.cgi?id=76025
+
+ Reviewed by Dan Bernstein.
+
+ Check nullity of m_player before dereferencing.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::shouldDisableSleep):
+
+2012-01-04 Kent Tamura <tkent@chromium.org>
+
+ A radio button not in a document should not join a radio button group
+ https://bugs.webkit.org/show_bug.cgi?id=45719
+
+ Reviewed by Darin Adler.
+
+ As per the standard and other browser behaviors, we should not add a
+ radio button not in a document to a radio button group.
+
+ So, CheckedRadioButton member functions should be called in
+ insertedIntoDocument() and removedFromDocument(), and they should do
+ nothing if the specified radio button is not in a document.
+
+ This change also fixes a bug that form owner change by 'form' attribute
+ didn't update radio button groups correctly.
+
+ Test: fast/forms/radio/radio-group.html
+
+ * dom/CheckedRadioButtons.cpp:
+ (WebCore::shouldMakeRadioGroup): A helper function to check <input> state.
+ (WebCore::CheckedRadioButtons::addButton):
+ - Change the argument type: HTMLFormControlElement* -> HTMLInputElement*.
+ - Use shouldMakeRadioGroup().
+ (WebCore::CheckedRadioButtons::removeButton): ditto.
+ * dom/CheckedRadioButtons.h:
+ Change the argument types of addButton() and removeButton():
+ HTMLFormControlElement* -> HTMLInputElement*.
+ * html/FormAssociatedElement.cpp:
+ Do not update m_form except in setForm() and formWillBeDestroyed().
+ This helps us to call registerFormElement() and removeFromElement()
+ correctly, and call willChangeForm()/didChangeForm() hooks correctly.
+ (WebCore::FormAssociatedElement::FormAssociatedElement):
+ (WebCore::FormAssociatedElement::~FormAssociatedElement):
+ (WebCore::FormAssociatedElement::insertedIntoTree):
+ (WebCore::FormAssociatedElement::removedFromTree):
+ (WebCore::FormAssociatedElement::setForm):
+ (WebCore::FormAssociatedElement::willChangeForm):
+ This virtual function is called before the owner form is updated.
+ (WebCore::FormAssociatedElement::didChangeForm):
+ This virtual function is called after the owner form was updated.
+ (WebCore::FormAssociatedElement::formWillBeDestroyed):
+ - Renamaed from formDestroyed()
+ - Add calls to willChangeForm() and didChangeForm().
+ (WebCore::FormAssociatedElement::resetFormOwner): Use setForm().
+ (WebCore::FormAssociatedElement::formAttributeChanged): ditto.
+ * html/FormAssociatedElement.h:
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::HTMLFormControlElement): Use setForm().
+ (WebCore::HTMLFormControlElement::~HTMLFormControlElement):
+ removeFormElement() is not needed. ~FormAssociatedElement() treats it.
+ (WebCore::HTMLFormControlElement::parseMappedAttribute):
+ No need to handle CheckedRadioButtons here. It is handled by HTMLInputElement.
+ (WebCore::HTMLFormControlElement::insertedIntoTree): ditto.
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::~HTMLFormElement):
+ Rename formDestroyed() with willDestroyForm().
+ (WebCore::HTMLFormElement::registerFormElement):
+ We don't need to handle radio button groups here.
+ (WebCore::HTMLFormElement::removeFormElement): ditto.
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::~HTMLInputElement):
+ Calls setForm(0) so that it calls correct virtual functions of
+ HTMLInputElement.
+ (WebCore::HTMLInputElement::updateCheckedRadioButtons):
+ Checking attached() was wrong.
+ (WebCore::HTMLInputElement::willChangeForm):
+ Remove this radio button from a radio button group for the old form.
+ (WebCore::HTMLInputElement::didChangeForm):
+ Add this radio button to a radio button group for the new form.
+ (WebCore::HTMLInputElement::insertedIntoDocument):
+ Add CheckedRadioButtons::addButton() call.
+ (WebCore::HTMLInputElement::removedFromDocument):
+ Add CheckedRadioButtons::removeButton() call.
+ (WebCore::HTMLInputElement::didMoveToNewDocument):
+ We don't need to handle CheckedRadioButton() here because
+ removedFromDocument() handles it.
+ * html/HTMLInputElement.h:
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::HTMLObjectElement): Use setForm().
+ (WebCore::HTMLObjectElement::~HTMLObjectElement):
+ removeFormElement() is not needed. ~FormAssociatedElement() treats it.
+
+2012-01-10 Kentaro Hara <haraken@chromium.org>
+
+ Remove redundant code from DOMWindowSQLDatabase.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=76010
+
+ Reviewed by Adam Barth.
+
+ This patch removes redundant code from DOMWindowSQLDatabase.cpp.
+
+ - Remove window->frame() check, since window->frame() is always true when
+ window->isCurrentlyDisplayedInFrame() is true.
+ - window->frame()->document() can just be window->document()
+
+ Tests: storage/open-database-creation-callback-isolated-world.html
+ storage/open-database-creation-callback.html
+ storage/open-database-empty-version.html
+ storage/open-database-over-quota.html
+ storage/open-database-set-empty-version.html
+ storage/open-database-while-transaction-in-progress.html
+
+ * storage/DOMWindowSQLDatabase.cpp:
+ (WebCore::DOMWindowSQLDatabase::openDatabase):
+
+2012-01-10 Dale Curtis <dalecurtis@chromium.org>
+
+ Repaint video controls when buffering during pause.
+ https://bugs.webkit.org/show_bug.cgi?id=73957
+
+ Pipes support for a new bufferingProgressed() method on MediaControls
+ elements. Allows controls to be repainted as data buffers when paused.
+
+ Reviewed by Hajime Morita.
+
+ Test: http/tests/media/video-buffering-repaints-controls.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setNetworkState):
+ (WebCore::HTMLMediaElement::progressEventTimerFired):
+ * html/shadow/MediaControlRootElement.cpp:
+ (WebCore::MediaControlRootElement::bufferingProgressed):
+ * html/shadow/MediaControlRootElement.h:
+ * html/shadow/MediaControlRootElementChromium.cpp:
+ (WebCore::MediaControlRootElementChromium::bufferingProgressed):
+ * html/shadow/MediaControlRootElementChromium.h:
+ * html/shadow/MediaControls.h:
+
+2012-01-10 Daniel Cheng <dcheng@chromium.org>
+
+ [chromium] Pasteboard::documentFragment should fall back to text if there's no HTML text
+ https://bugs.webkit.org/show_bug.cgi?id=75923
+
+ Reviewed by Tony Chang.
+
+ Test: editing/pasteboard/pasting-empty-html-falls-back-to-text.html
+
+ * platform/chromium/PasteboardChromium.cpp:
+ (WebCore::Pasteboard::documentFragment):
+
+2012-01-10 Kentaro Hara <haraken@chromium.org>
+
+ Use the [Supplemental] IDL in SQLDatabase
+ https://bugs.webkit.org/show_bug.cgi?id=76004
+
+ Reviewed by Adam Barth.
+
+ We've been working on WebKit modularization. By using the [Supplemental] IDL,
+ we can move SQLDatabase related code from WebCore/page/DOMWindow.{h,cpp,idl}
+ to WebCore/storage/DOMWindowSQLDatabase.{h,cpp,idl}.
+
+ Tests: storage/open-database-creation-callback-isolated-world.html
+ storage/open-database-creation-callback.html
+ storage/open-database-empty-version.html
+ storage/open-database-over-quota.html
+ storage/open-database-set-empty-version.html
+ storage/open-database-while-transaction-in-progress.html
+
+ * CMakeLists.txt: Added DOMWindowSQLDatabase.{idl,h,cpp} to the build script.
+ * DerivedSources.make: Ditto.
+ * DerivedSources.pri: Ditto.
+ * GNUmakefile.list.am: Ditto.
+ * Target.pri: Ditto.
+ * WebCore.gypi: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+
+ * page/DOMWindow.cpp: Removed SQLDatabase related code.
+ * page/DOMWindow.idl: Ditto.
+ * page/DOMWindow.h: Ditto. Moved isCurrentlyDisplayedInFrame() from private: to public:
+ so that DOMWindowSQLDatabase::openDatabase() can access it.
+
+ * storage/DOMWindowSQLDatabase.cpp: Added. Moved openDatabase() from DOMWindow.cpp to here.
+ (WebCore::DOMWindowSQLDatabase::openDatabase):
+ * storage/DOMWindowSQLDatabase.h: Added. Moved openDatabase() from DOMWindow.h to here.
+ * storage/DOMWindowSQLDatabase.idl: Added. Using the [Supplemental] IDL, moved openDatabase()
+ and SQLException from DOMWindow.idl to here.
+
+2012-01-10 Chris Marrin <cmarrin@apple.com>
+
+ CIFilter version of Sepia Tone filter doesn't match software
+ https://bugs.webkit.org/show_bug.cgi?id=75129
+
+ Reviewed by Simon Fraser.
+
+ Changed sepia tone filter to use a CIColorMatrix filter with
+ values that match sw filter.
+
+ * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+ (interp):
+ (PlatformCALayer::setFilters):
+
+2012-01-10 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ [Qt][WK2]REGRESSION(r102435): It made tst_QQuickWebView::show() crash
+ https://bugs.webkit.org/show_bug.cgi?id=74176
+
+ Reviewed by Noam Rosenthal.
+
+ Replaces static global GL resource holder with holder shared between
+ TextureMapperGL instances created on the same GL context. Also adds
+ deallocation of GL resources when last TextureMapperGL instance on the
+ current GL context gets deleted.
+
+ Tested by multipleWebViewWindows and multipleWebViews Qt WK2 API tests.
+
+ * platform/graphics/opengl/TextureMapperGL.cpp:
+ (WebCore::TextureMapperGLData::SharedGLData::getCurrentGLContext):
+ (WebCore::TextureMapperGLData::SharedGLData::glContextDataMap):
+ (WebCore::TextureMapperGLData::SharedGLData::currentSharedGLData):
+ (WebCore::TextureMapperGLData::SharedGLData::ProgramInfo::ProgramInfo):
+ (WebCore::TextureMapperGLData::SharedGLData::createShaderProgram):
+ (WebCore::TextureMapperGLData::SharedGLData::deleteShaderProgram):
+ (WebCore::TextureMapperGLData::SharedGLData::SharedGLData):
+ (WebCore::TextureMapperGLData::SharedGLData::~SharedGLData):
+ (WebCore::TextureMapperGLData::sharedGLData):
+ (WebCore::TextureMapperGLData::TextureMapperGLData):
+ (WebCore::TextureMapperGLData::SharedGLData::initializeShaders):
+ (WebCore::TextureMapperGL::beginPainting):
+ (WebCore::TextureMapperGL::drawTexture):
+ (WebCore::BitmapTextureGL::bind):
+ (WebCore::TextureMapperGL::bindSurface):
+ (WebCore::TextureMapperGL::beginClip):
+ (WebCore::TextureMapperGL::endClip):
+ * platform/graphics/opengl/TextureMapperGL.h:
+
+2012-01-10 Simon Fraser <simon.fraser@apple.com>
+
+ Disabled mock scrollbars should draw differently
+ https://bugs.webkit.org/show_bug.cgi?id=75995
+
+ Reviewed by James Robinson.
+
+ When the scrollbar is disabled, paint the entire track of
+ mock scrollbars with a lighter gray, and hide the thumb.
+
+ No tests, since mock scrollbars aren't enabled by default on Mac yet.
+
+ * platform/mock/ScrollbarThemeMock.cpp:
+ (WebCore::ScrollbarThemeMock::paintTrackBackground):
+ (WebCore::ScrollbarThemeMock::paintThumb):
+
+2012-01-10 Tony Chang <tony@chromium.org>
+
+ Need to handle absolutely positioned elements inside flexboxes
+ https://bugs.webkit.org/show_bug.cgi?id=70793
+
+ Reviewed by David Hyatt.
+
+ Tests: css3/flexbox/insert-text-crash.html
+ css3/flexbox/position-absolute-child.html
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::computePreferredMainAxisExtent): Skip the size of positioned elements.
+ (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithm): Add placeholders for positioned elements.
+ (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout): Positions the layer for the positioned child.
+ (WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Handle positioned elements.
+ (WebCore::RenderFlexibleBox::layoutColumnReverse): Adjust the main axis offset of the layer for positioned elements.
+ * rendering/RenderFlexibleBox.h:
+
+2012-01-10 Nat Duca <nduca@chromium.org>
+
+ [chromium] Reuse old timebase when activating CCDelayBasedTimeSource
+ https://bugs.webkit.org/show_bug.cgi?id=75938
+
+ Reviewed by James Robinson.
+
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp:
+ (WebCore::CCDelayBasedTimeSource::CCDelayBasedTimeSource):
+ (WebCore::CCDelayBasedTimeSource::setActive):
+ (WebCore::CCDelayBasedTimeSource::onTimerFired):
+ (WebCore::CCDelayBasedTimeSource::postNextTickTask):
+ * platform/graphics/chromium/cc/CCDelayBasedTimeSource.h:
+
+2012-01-10 Kentaro Hara <haraken@chromium.org>
+
+ Support the [Supplemental] IDL on methods
+ https://bugs.webkit.org/show_bug.cgi?id=75944
+
+ Reviewed by Adam Barth.
+
+ The spec for the [Supplemental] IDL:
+ http://dev.w3.org/2006/webapi/WebIDL/#dfn-supplemental-interface
+
+ Currently the [Supplemental] IDL is supported on attributes but not supported
+ on methods. This patch makes a change to support it.
+
+ Specifically, assume the following IDL:
+
+ interface [Supplemental=X] Y {
+ void func();
+ }
+
+ Then the code generator generates the following V8X.cpp.
+
+ void funcCallback(Arguments& args) {
+ X* imp = V8X::toNative(args.Holder());
+ Y::func(imp);
+ }
+
+ Similar code is also generated for JS, ObjC, GObject and CPP bindings.
+
+ Test: bindings/scripts/test/TestSupplemental.idl
+
+ * bindings/scripts/CodeGeneratorCPP.pm: Modified as described above.
+ (GenerateImplementation):
+ * bindings/scripts/CodeGeneratorGObject.pm: Ditto.
+ (GenerateFunction):
+ * bindings/scripts/CodeGeneratorJS.pm: Ditto.
+ (GenerateParametersCheck):
+ * bindings/scripts/CodeGeneratorObjC.pm: Ditto.
+ (GenerateImplementation):
+ * bindings/scripts/CodeGeneratorV8.pm: Ditto.
+ (GenerateFunctionCallString):
+ * bindings/scripts/generate-bindings.pl: Ditto.
+
+ * bindings/scripts/test/TestSupplemental.idl: Added test cases for [Supplemental] methods.
+
+ * bindings/scripts/test/CPP/WebDOMTestInterface.cpp: Updated the test result.
+ (WebDOMTestInterface::supplementalMethod1):
+ (WebDOMTestInterface::supplementalMethod2):
+ * bindings/scripts/test/CPP/WebDOMTestInterface.h: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp: Ditto.
+ (webkit_dom_test_interface_supplemental_method1):
+ (webkit_dom_test_interface_supplemental_method2):
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.h: Ditto.
+ * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
+ (WebCore::JSTestInterfacePrototype::getOwnPropertySlot):
+ (WebCore::JSTestInterfacePrototype::getOwnPropertyDescriptor):
+ (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
+ (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
+ * bindings/scripts/test/JS/JSTestInterface.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestInterface.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
+ (-[DOMTestInterface supplementalMethod1]):
+ (-[DOMTestInterface supplementalMethod2:objArg:]):
+ * bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
+ (WebCore::TestInterfaceInternal::supplementalMethod1Callback):
+ (WebCore::TestInterfaceInternal::supplementalMethod2Callback):
+ (WebCore::ConfigureV8TestInterfaceTemplate):
+
+2012-01-10 Kentaro Hara <haraken@chromium.org>
+
+ [Refactoring] Rename attributes in TestSupplemental.idl to clarify
+ that they are supplemental attributes
+ https://bugs.webkit.org/show_bug.cgi?id=75942
+
+ Reviewed by Adam Barth.
+
+ This patch just renames attributes in TestSupplemental.idl
+ to make it easy to find in {JS,V8,WebKitDOM,DOM,WebDOM}TestInterface.cpp
+ which attributes originate from TestSupplemental.idl.
+
+ * bindings/scripts/test/TestSupplemental.idl: Just renamed three attributes.
+
+ * bindings/scripts/test/CPP/WebDOMTestInterface.cpp: Updated the test result.
+ (WebDOMTestInterface::supplementalStr1):
+ (WebDOMTestInterface::supplementalStr2):
+ (WebDOMTestInterface::setSupplementalStr2):
+ * bindings/scripts/test/CPP/WebDOMTestInterface.h: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp: Ditto.
+ (webkit_dom_test_interface_get_supplemental_str1):
+ (webkit_dom_test_interface_get_supplemental_str2):
+ (webkit_dom_test_interface_set_supplemental_str2):
+ (webkit_dom_test_interface_set_property):
+ (webkit_dom_test_interface_get_property):
+ (webkit_dom_test_interface_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.h: Ditto.
+ * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
+ (WebCore::jsTestInterfaceSupplementalStr1):
+ (WebCore::jsTestInterfaceSupplementalStr2):
+ (WebCore::jsTestInterface):
+ (WebCore::setJSTestInterfaceSupplementalStr2):
+ (WebCore::setJSTestInterface):
+ * bindings/scripts/test/JS/JSTestInterface.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestInterface.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
+ (-[DOMTestInterface supplementalStr1]):
+ (-[DOMTestInterface supplementalStr2]):
+ (-[DOMTestInterface setSupplementalStr2:]):
+ (-[DOMTestInterface ]):
+ (-[DOMTestInterface set:]):
+ * bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
+ (WebCore::TestInterfaceInternal::supplementalStr1AttrGetter):
+ (WebCore::TestInterfaceInternal::supplementalStr2AttrGetter):
+ (WebCore::TestInterfaceInternal::supplementalStr2AttrSetter):
+
+2012-01-10 John Bauman <jbauman@chromium.org>
+
+ [chromium] Correctly recreate DrawingBuffer on lost device
+ https://bugs.webkit.org/show_bug.cgi?id=75912
+
+ Reviewed by Kenneth Russell.
+
+ Create new drawing buffer on new context, not old lost context. Also,
+ make sure to bind new drawing buffer.
+
+ No new tests.
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::maybeRestoreContext):
+
+2012-01-10 Stephen White <senorblanco@chromium.org>
+
+ [Chromium] Partial revert of r104566, since it breaks the shared
+ library build on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=75994
+
+ Reviewed by Dmitry Titov.
+
+ Covered by SVG feColorMatrix tests (see LayoutTests/ChangeLog).
+
+ * WebCore.gypi:
+ * platform/graphics/filters/FEColorMatrix.h:
+
+2012-01-10 Simon Fraser <simon.fraser@apple.com>
+
+ Clean up RenderLayerBacking code that looks for the body
+ https://bugs.webkit.org/show_bug.cgi?id=39502
+
+ Reviewed by Dave Hyatt.
+
+ Consolidate code that propagates the <body> background to the
+ root, adding a utility method on RenderObject that is called
+ by RenderBox and RenderLayerBacking.
+
+ Removed an unused method in RenderLayerBacking.
+
+ The compositiong changes are not testable, since rendererBackgroundColor()
+ is only used by fullscreen at present.
+
+ Tests: fast/backgrounds/root-background-propagation.html
+ fast/backgrounds/root-background-propagation2.html
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::paintRootBoxFillLayers):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::rendererBackgroundColor):
+ * rendering/RenderLayerBacking.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::rendererForRootBackground):
+ * rendering/RenderObject.h:
+
+2012-01-10 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Create iterators for the RenderSurface-Layer tree
+ https://bugs.webkit.org/show_bug.cgi?id=74203
+
+ Reviewed by James Robinson.
+
+ New unit tests: CCLayerIteratorTest.cpp
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/RenderSurfaceChromium.h:
+ * platform/graphics/chromium/cc/CCLayerIterator.cpp: Added.
+ (WebCore::CCLayerIteratorActions::BackToFront::begin):
+ (WebCore::CCLayerIteratorActions::BackToFront::end):
+ (WebCore::CCLayerIteratorActions::BackToFront::next):
+ (WebCore::CCLayerIteratorActions::FrontToBack::begin):
+ (WebCore::CCLayerIteratorActions::FrontToBack::end):
+ (WebCore::CCLayerIteratorActions::FrontToBack::next):
+ (WebCore::CCLayerIteratorActions::FrontToBack::goToHighestInSubtree):
+ * platform/graphics/chromium/cc/CCLayerIterator.h: Added.
+ (WebCore::CCLayerIterator::CCLayerIterator):
+ (WebCore::CCLayerIterator::begin):
+ (WebCore::CCLayerIterator::end):
+ (WebCore::CCLayerIterator::operator++):
+ (WebCore::CCLayerIterator::operator==):
+ (WebCore::CCLayerIterator::operator!=):
+ (WebCore::CCLayerIterator::operator->):
+ (WebCore::CCLayerIterator::operator*):
+ (WebCore::CCLayerIterator::representsTargetRenderSurface):
+ (WebCore::CCLayerIterator::representsContributingRenderSurface):
+ (WebCore::CCLayerIterator::representsItself):
+ (WebCore::CCLayerIterator::targetRenderSurfaceLayer):
+ * platform/graphics/chromium/cc/CCLayerIteratorPosition.h: Added.
+ (WebCore::CCLayerIteratorPosition::CCLayerIteratorPosition):
+ (WebCore::CCLayerIteratorPosition::currentLayer):
+ (WebCore::CCLayerIteratorPosition::currentLayerRepresentsContributingRenderSurface):
+ (WebCore::CCLayerIteratorPosition::currentLayerRepresentsTargetRenderSurface):
+ (WebCore::CCLayerIteratorPosition::targetRenderSurfaceLayer):
+ (WebCore::CCLayerIteratorPosition::targetRenderSurface):
+ (WebCore::CCLayerIteratorPosition::targetRenderSurfaceChildren):
+ (WebCore::CCLayerIteratorPosition::operator==):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::paintLayerContents):
+ (WebCore::CCLayerTreeHost::updateCompositorResources):
+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+ (WebCore::walkLayersAndCalculateVisibleLayerRects):
+ * platform/graphics/chromium/cc/CCRenderSurface.h:
+
+2012-01-10 Ojan Vafai <ojan@chromium.org>
+
+ Rename flex-align to flex-item-align.
+ https://bugs.webkit.org/show_bug.cgi?id=75929
+
+ Reviewed by Darin Adler.
+
+ The spec has changed and now flex-align will be set on
+ the flexbox itself.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ (WebCore::CSSPrimitiveValue::operator EFlexAlign):
+ * css/CSSProperty.cpp:
+ (WebCore::CSSProperty::isInheritedProperty):
+ * css/CSSPropertyNames.in:
+ * css/CSSStyleApplyProperty.cpp:
+ (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::sizesToIntrinsicLogicalWidth):
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
+ (WebCore::RenderFlexibleBox::alignChildren):
+ * rendering/style/RenderStyle.h:
+ (WebCore::RenderStyleBitfields::flexItemAlign):
+ (WebCore::RenderStyleBitfields::setFlexItemAlign):
+ (WebCore::RenderStyleBitfields::initialFlexItemAlign):
+ * rendering/style/RenderStyleConstants.h:
+ * rendering/style/StyleFlexibleBoxData.cpp:
+ (WebCore::StyleFlexibleBoxData::StyleFlexibleBoxData):
+ (WebCore::StyleFlexibleBoxData::operator==):
+ * rendering/style/StyleFlexibleBoxData.h:
+
+2012-01-10 Eric Carlson <eric.carlson@apple.com>
+
+ Replace TextTrackCue "getCueAsSource" method with "text" attribute
+ https://bugs.webkit.org/show_bug.cgi?id=75646
+
+ Reviewed by Darin Adler.
+
+ Test: media/track/track-cue-mutable-text.html
+
+ * html/HTMLMediaElement.h: getCueAsSource() -> text().
+
+ * html/TextTrackCue.cpp:
+ (WebCore::TextTrackCue::setText): New. Set cue text and clear the document fragment.
+ (WebCore::TextTrackCue::getCueAsHTML): Allocate the document fragment if it doesn't exist.
+ * html/TextTrackCue.h:
+ (WebCore::TextTrackCue::text):
+ * html/TextTrackCue.idl: getCueAsSource() -> text().
+
+ * html/shadow/MediaControlRootElement.cpp:
+ (WebCore::MediaControlRootElement::updateTextTrackDisplay): getCueAsSource() -> text().
+ * html/shadow/MediaControlRootElementChromium.cpp:
+ (WebCore::MediaControlRootElementChromium::updateTextTrackDisplay): getCueAsSource() -> text().
+
+ * html/track/WebVTTParser.cpp:
+ (WebCore::WebVTTParser::collectCueText): processCueText is dead, long live createNewCue.
+ (WebCore::WebVTTParser::createDocumentFragmentFromCueText): New, split out of processCueText.
+ Create a document fragment from the String argument.
+ (WebCore::WebVTTParser::createNewCue): Split out of processCueText.
+ (WebCore::WebVTTParser::constructTreeFromToken): Add a comment pointing to the spec section
+ with the rules for DOM construction.
+ * html/track/WebVTTParser.h:
+
+2012-01-10 Jer Noble <jer.noble@apple.com>
+
+ REGRESSION (r102024): Having the Bing homepage open prevents idle sleep
+ https://bugs.webkit.org/show_bug.cgi?id=75972
+
+ Reviewed by Oliver Hunt.
+
+ No new tests; no testing infrastructure exists to test display sleep assertions.
+
+ Only disable idle and display sleep when a video element is not paused, not looping, and
+ has both a video and audio track.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::mediaPlayerRateChanged): Factor into updateDisableSleep() and
+ shouldDisplaySleep().
+ (WebCore::HTMLMediaElement::setLoop): Ditto.
+ (WebCore::HTMLMediaElement::attributeChanged): Ditto.
+ (WebCore::HTMLMediaElement::updateDisableSleep):
+ (WebCore::HTMLMediaElement::shouldDisableSleep):
+ * html/HTMLMediaElement.h:
+
+2012-01-09 Matthew Delaney <mdelaney@apple.com>
+
+ [Mac] Accelerate canvas layers with the same logic as accelerating the canvas itself
+ https://bugs.webkit.org/show_bug.cgi?id=75921
+
+ Reviewed by Simon Fraser.
+
+ No new tests. Does not affect detectable behavior.
+
+ * rendering/RenderLayerCompositor.cpp: Use canvas's shouldAccelerate to avoid asking
+ uninitialized canvas's if they're accelerated or not.
+ (WebCore::RenderLayerCompositor::updateBacking):
+
+2012-01-10 Daniel Sievers <sievers@chromium.org>
+
+ [Chromium] Do not recreate texture updater for image layer if one exists.
+ https://bugs.webkit.org/show_bug.cgi?id=75589
+
+ Reviewed by James Robinson.
+
+ Test: platform/chromium/compositing/img-layer-grow.html
+
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ (WebCore::ImageLayerChromium::createTextureUpdater):
+
+2012-01-10 Mike Reed <reed@google.com>
+
+ [skia] not all convex paths are convex, so recompute convexity for the problematic ones
+ https://bugs.webkit.org/show_bug.cgi?id=75960
+
+ Reviewed by Stephen White.
+
+ No new tests.
+ See related chrome issue
+ http://code.google.com/p/chromium/issues/detail?id=108605
+
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::setPathFromConvexPoints):
+
+2012-01-10 Gavin Barraclough <barraclough@apple.com>
+
+ Do not allow Array length to be set if it is non-configurable
+ https://bugs.webkit.org/show_bug.cgi?id=75935
+
+ Reviewed by Sam Weinig.
+
+ * bindings/js/SerializedScriptValue.cpp:
+ (WebCore::CloneDeserializer::deserialize):
+ - remove unnecessary call to JSArray::setLength.
+
+2012-01-10 Adrienne Walker <enne@google.com>
+
+ [chromium] Draw debug tile borders on composited layers
+ https://bugs.webkit.org/show_bug.cgi?id=75680
+
+ Reviewed by James Robinson.
+
+ On tiled layers, draw debug borders on the tiles themselves. By
+ default, these are one pixel wide and transparent, so should be
+ unobtrusive but informative. They are triggered when the layer itself
+ would have a debug border via the existing flags.
+
+ Also, fix the drawDebugBorderQuad function to handle arbitrarily
+ positioned quads, not just full layer quads. Also, fix alpha issue
+ with debug borders.
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::drawDebugBorderQuad):
+ * platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp:
+ (WebCore::CCDebugBorderDrawQuad::CCDebugBorderDrawQuad):
+ * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+ (WebCore::CCLayerImpl::appendDebugBorderQuad):
+ (WebCore::CCLayerImpl::quadTransform):
+ (WebCore::CCLayerImpl::hasDebugBorders):
+ * platform/graphics/chromium/cc/CCLayerImpl.h:
+ * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
+ (WebCore::CCTiledLayerImpl::appendQuads):
+
+2012-01-10 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Missing Implementation of Public InspectorDOMAgent Function
+ https://bugs.webkit.org/show_bug.cgi?id=75759
+
+ Follow-up: Remove the unused method. Keep the setter private.
+
+ Reviewed by Pavel Feldman.
+
+ * inspector/InspectorDOMAgent.cpp:
+ * inspector/InspectorDOMAgent.h:
+
+2012-01-10 Pavel Feldman <pfeldman@google.com>
+
+ Not reviewed, follow up to r104586: fix assertion within the loop.
+
+ * inspector/DOMEditor.cpp:
+ (WebCore::DOMEditor::patchChildren):
+
+2012-01-10 Brady Eidson <beidson@apple.com>
+
+ <rdar://problem/9328684> and https://bugs.webkit.org/show_bug.cgi?id=62764
+ Frequent crashes due to null frame below ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache
+
+ Reviewed by Maciej Stachowiak.
+
+ This is a non-reproducible high volume crash, so no test :(.
+
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::stopLoading): Don't re-run actual "stop loading" logic if the document loader is already
+ stopping loading. Also add an ASSERT that might catch cases where new loads may have been started while old loads
+ were being stopped.
+ (WebCore::DocumentLoader::detachFromFrame): Be conservative and stop loading when we detach a document loader from a frame.
+
+2012-01-10 Pavel Feldman <pfeldman@google.com>
+
+ Not reviewed: fixing the Mac build.
+
+ * inspector/DOMEditor.cpp:
+ (WebCore::DOMEditor::patchChildren):
+
+2012-01-09 Jer Noble <jer.noble@apple.com>
+
+ Elements can appear over fullscreen video
+ https://bugs.webkit.org/show_bug.cgi?id=75913
+
+ Reviewed by Simon Fraser.
+
+ No new tests; updated fullscreen/full-screen-zIndex.html to trigger error condition.
+
+ RenderFullScreenPlaceholder inherits the pre-fullscreen element's style, causing a stacking
+ context to be created. Instead of making the placeholder the parent of the RenderFullScreen
+ object, make the two renderers siblings. Then the stacking context created by the placeholder
+ will not affect the z-ordering of the RenderFullScreen.
+
+ * rendering/RenderFullScreen.cpp:
+ (RenderFullScreen::wrapRenderer):
+ (RenderFullScreen::unwrapRenderer):
+ (RenderFullScreen::createPlaceholder):
+
+2012-01-10 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: add "free flow DOM editing" experiment.
+ https://bugs.webkit.org/show_bug.cgi?id=75955
+
+ This change enables HTML editing from Resources panel experiment.
+
+ Reviewed by Yury Semikhatsky.
+
+ * CMakeLists.txt:
+ * English.lproj/localizedStrings.js:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/DOMEditor.cpp: Added.
+ (WebCore::DOMEditor::DOMEditor):
+ (WebCore::DOMEditor::~DOMEditor):
+ (WebCore::DOMEditor::patch):
+ (WebCore::DOMEditor::NodeDigest::NodeDigest):
+ (WebCore::DOMEditor::patchElement):
+ (WebCore::DOMEditor::patchNode):
+ (WebCore::DOMEditor::patchChildren):
+ (WebCore::addStringToSHA1):
+ (WebCore::DOMEditor::createNodeDigest):
+ * inspector/DOMEditor.h: Added.
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::setOuterHTML):
+ * inspector/front-end/DOMAgent.js:
+ (WebInspector.DOMAgent):
+ (WebInspector.DOMModelResourceBinding):
+ (WebInspector.DOMModelResourceBinding.prototype.setContent):
+ (WebInspector.DOMModelResourceBinding.prototype.canSetContent):
+ * inspector/front-end/Settings.js:
+ (WebInspector.ExperimentsSettings):
+
+2012-01-10 Stephen Chenney <schenney@chromium.org>
+
+ [Chromium] Shift PathSkia to use Skia's new RawIter
+ https://bugs.webkit.org/show_bug.cgi?id=75703
+
+ Reviewed by Nikolas Zimmermann.
+
+ No new tests required - covered by existing tests.
+
+ * platform/graphics/Path.h: Added comments ont he return values from iteration.
+ * platform/graphics/skia/PathSkia.cpp:
+ (WebCore::Path::apply): Switched to SkPath::RawIter
+
+2012-01-10 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Use SkFontHost::GetUnitsPerEm instead of advanced type
+ metrics for Android in FontPlatformData
+ https://bugs.webkit.org/show_bug.cgi?id=75702
+
+ Reviewed by Stephen White.
+
+ Since Skia for Android doesn't implement advanced type metric routines,
+ use an alternative method to calculate the number of font units for an
+ em size. This will be exercized by existing layout tests, as it's being
+ used by the ComplexTextController.
+
+ * platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp:
+ (WebCore::FontPlatformData::emSizeInFontUnits):
+
+2012-01-10 Vsevolod Vlasov <vsevik@chromium.org>
+
+ Unreviewed, inspector style fix.
+
+ Web Inspector: elements tree is shifted 12px to the right.
+ https://bugs.webkit.org/show_bug.cgi?id=75609
+
+ * inspector/front-end/elementsPanel.css:
+ (#elements-content):
+
+2012-01-10 Zoltan Herczeg <zherczeg@webkit.org>
+
+ Fix style errors in CSSParser.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=75854
+
+ Reviewed by Nikolas Zimmermann.
+
+ Minor style fixes.
+
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ (WebCore::CSSParser::parseShadow):
+ (WebCore::isBorderImageRepeatKeyword):
+ (WebCore::BorderImageSliceParseContext::commitBorderImageSlice):
+ (WebCore::BorderImageQuadParseContext::commitBorderImageQuad):
+ (WebCore::filterInfoForName):
+
+2012-01-10 Julien Chaffraix <jchaffraix@webkit.org>
+
+ REGRESSION (r93614): Safari Reader doesn't repaint correctly when scrolling
+ https://bugs.webkit.org/show_bug.cgi?id=67100
+
+ Reviewed by Dan Bernstein.
+
+ Tests: fast/layers/scroll-with-transform-composited-layer.html
+ fast/layers/scroll-with-transform-layer.html
+
+ The regression came from a previous optimization that was wrongly kept after r93614.
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
+ Remove the early return for transformed layer. This change worked as we used
+ to call updateLayerPositions from scrollTo which would call updateLayerPosition on
+ all our descendants. After r93614, this is no longer the case and we explicitely need
+ to call updateLayerPosition on our descendants from updateLayerPositionsAfterScroll.
+
+2012-01-10 Stephen White <senorblanco@chromium.org>
+
+ Fix Chrome/Mac build.
+
+ Build fix; unreviewed.
+
+ * platform/graphics/filters/skia/FEColorMatrixSkia.cpp:
+ (WebCore::luminanceToAlphaMatrix):
+
+2012-01-06 Stephen White <senorblanco@chromium.org>
+
+ [Skia] Switch FEColorMatrix to use a skia-based implementation when
+ compiling with USE(SKIA). This change will also switch the software
+ implementation of FEGaussianBlur to the skia implementation (ie.,
+ it removes the acceleration check).
+ https://bugs.webkit.org/show_bug.cgi?id=75582
+
+ Reviewed by Dirk Schulze.
+
+ Covered by svg/W3C-SVG-1.1/filters-color-01-b.svg and friends (will
+ need a rebaseline).
+
+ * WebCore.gypi:
+ Add FEColorMatrixSkia.cpp to the build.
+ * platform/graphics/filters/FEColorMatrix.h:
+ Add platformApplySkia().
+ * platform/graphics/filters/FEGaussianBlur.cpp:
+ (WebCore::FEGaussianBlur::platformApplySoftware):
+ Remove skia-specific code from FEGaussianBlur::platformApplySoftware().
+ * platform/graphics/filters/FEGaussianBlur.h:
+ Make platformApplySkia() virtual, and put it behind #if USE(SKIA).
+ * platform/graphics/filters/FilterEffect.cpp:
+ (WebCore::FilterEffect::apply):
+ Call out to platformApplySkia(), or fall back to
+ platformApplySoftware().
+ * platform/graphics/filters/FilterEffect.h:
+ Add platformApplySkia().
+ * platform/graphics/filters/skia/FEColorMatrixSkia.cpp: Added.
+ (WebCore::saturateMatrix):
+ (WebCore::hueRotateMatrix):
+ (WebCore::luminanceToAlphaMatrix):
+ (WebCore::FEColorMatrix::platformApplySkia):
+ Process color matrix effect, by calling out to generic matrix
+ version of SkColorMatrixFilter.
+ * platform/graphics/filters/skia/FEGaussianBlurSkia.cpp:
+ (WebCore::FEGaussianBlur::platformApplySkia):
+ Change the signature of FEGaussianBlur::platformApplySkia to be an
+ override of the new FilterEffect base class version.
+
+2012-01-10 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: fix DebuggerPresentationModel::uiSourceCodes - do not iterate
+ over same raw source code multiple times.
+ https://bugs.webkit.org/show_bug.cgi?id=75953
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/front-end/DebuggerPresentationModel.js:
+ (WebInspector.DebuggerPresentationModel):
+ (WebInspector.DebuggerPresentationModel.prototype._bindScriptToRawSourceCode):
+ (WebInspector.DebuggerPresentationModel.prototype.uiSourceCodes):
+ (WebInspector.DebuggerPresentationModel.prototype.setFormatSource):
+ (WebInspector.DebuggerPresentationModel.prototype._consoleCleared):
+ (WebInspector.DebuggerPresentationModel.prototype._debuggerReset):
+
+2012-01-10 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Enable CSS_FILTERS in Qt build
+ https://bugs.webkit.org/show_bug.cgi?id=75777
+
+ Enable CSS_FILTERS and unskip the tests.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Filter tests are now unskipped for Qt.
+
+ * Target.pri: add missing files to build.
+
+2012-01-10 Pavel Feldman <pfeldman@google.com>
+
+ Web Inspector: typo: NetworkAgent.canClearBrowserCache -> NetworkAgent.canClearBrowserCookies.
+ https://bugs.webkit.org/show_bug.cgi?id=75949
+
+ Reviewed by Andreas Kling.
+
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkLogView):
+
+2012-01-10 pfeldman@chomium.org <pavel.feldman@gmail.com>
+
+ Web Inspector: restore front-end compilation
+ https://bugs.webkit.org/show_bug.cgi?id=75625
+
+ Reviewed by Yury Semikhatsky.
+
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel.SingleFileEditorContainer.prototype.replaceSourceFrames):
+ * inspector/front-end/TabbedPane.js:
+ * inspector/front-end/externs.js:
+ (WebInspector.isCompactMode):
+ * inspector/front-end/treeoutline.js:
+
+2012-01-10 Grzegorz Czajkowski <g.czajkowski@samsung.com>
+
+ Add NULL checks to setting access obtained on frame and document.
+ https://bugs.webkit.org/show_bug.cgi?id=72002
+
+ Reviewed by Andreas Kling.
+
+ Adds NULL checks to setting object where it's required.
+ Generally WebCore checks NULL which may be returned from setting object obtained
+ on frame or document but in some cases these are skipped. These checks are not
+ needed to setting's access on page object.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::shouldAccelerate):
+ * loader/DocumentLoader.cpp:
+ (WebCore::DocumentLoader::scheduleArchiveLoad):
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::requestPlugin):
+ * loader/appcache/ApplicationCacheGroup.cpp:
+ (WebCore::ApplicationCacheGroup::selectCache):
+ (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
+ * page/DragController.cpp:
+ (WebCore::DragController::draggableNode):
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::handleMouseReleaseEvent):
+ * page/FocusController.cpp:
+ (WebCore::FocusController::advanceFocusInDocumentOrder):
+ * rendering/RenderFrameSet.cpp:
+ (WebCore::RenderFrameSet::flattenFrameSet):
+ * rendering/RenderIFrame.cpp:
+ (WebCore::RenderIFrame::flattenFrame):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateBacking):
+ * rendering/RenderText.cpp:
+ (WebCore::SecureTextTimer::restartWithNewText):
+
+2012-01-10 Andreas Kling <awesomekling@apple.com>
+
+ Matched declaration cache should support mapped attribute declarations.
+ <http://webkit.org/b/75948>
+
+ Reviewed by Antti Koivisto.
+
+ Support caching of matches that include mapped attribute declarations.
+ To make this possible, let the cache hold references to the matched style declarations.
+ Otherwise, declarations are assumed to survive until ~CSSStyleSelector, which may not
+ be the case for CSSMappedAttributeDeclaration.
+
+ To avoid hoarding of stale CSSMappedAttributeDeclarations in the cache, do a sweep for
+ every 100 additions and garbage collect any entries containing a declaration that is
+ only referenced by the cache.
+
+ This increases cache hit rate by up to ~10% on the Alexa top sites.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::CSSStyleSelector):
+ (WebCore::CSSStyleSelector::sweepMatchedDeclarationCache):
+ (WebCore::CSSStyleSelector::matchAllRules):
+ (WebCore::CSSStyleSelector::applyDeclarations):
+ (WebCore::CSSStyleSelector::addToMatchedDeclarationCache):
+ * css/CSSStyleSelector.h:
+
+2012-01-10 Kenichi Ishibashi <bashi@chromium.org>
+
+ Complex path should be used when UVS exists in text run
+ https://bugs.webkit.org/show_bug.cgi?id=75289
+
+ Uses complex path when a text run contains UVS. The range from U+180B to U+180D already uses complex path.
+ Removes unnecessary functions that were added by r102915.
+
+ Reviewed by Dan Bernstein.
+
+ No new tests. fast/text/unicode-variation-selector.html should take care of this change.
+
+ * platform/graphics/Font.cpp:
+ (WebCore::Font::codePath): Use Complex path when the text run contains UVS.
+ * platform/graphics/SimpleFontData.h: Removed updateGlyphWithVariationSelector().
+ * platform/graphics/SurrogatePairAwareTextIterator.cpp: Removed unnecessary static functions.
+ * platform/graphics/SurrogatePairAwareTextIterator.h: Removed hasTrailingVariationSelector().
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance): Removed UVS detection code.
+ * platform/graphics/chromium/SimpleFontDataChromiumWin.cpp: Removed updateGlyphWithVariationSelector().
+ * platform/graphics/freetype/SimpleFontDataFreeType.cpp: Ditto.
+ * platform/graphics/harfbuzz/SimpleFontDataSkia.cpp: Ditto.
+ * platform/graphics/mac/SimpleFontDataMac.mm: Ditto.
+ * platform/graphics/pango/SimpleFontDataPango.cpp: Ditto.
+ * platform/graphics/qt/SimpleFontDataQt.cpp: Ditto.
+ * platform/graphics/win/SimpleFontDataWin.cpp: Ditto.
+ * platform/graphics/wince/SimpleFontDataWinCE.cpp: Ditto.
+ * platform/graphics/wx/SimpleFontDataWx.cpp: Ditto.
+
+2012-01-10 Kenichi Ishibashi <bashi@chromium.org>
+
+ WebFonts are re-fetched from the server upon Document::styleSelectorChanged call.
+ https://bugs.webkit.org/show_bug.cgi?id=73419
+
+ Holds the CachedFont handle in CSSFontFaceSrcValue so that avoiding re-validation during style recalculation.
+
+ Reviewed by Dan Bernstein.
+
+ Test: http/tests/css/font-face-src-loading.html
+
+ * css/CSSFontFaceSrcValue.cpp:
+ (WebCore::CSSFontFaceSrcValue::cachedFont): Added.
+ * css/CSSFontFaceSrcValue.h:
+ * css/CSSFontSelector.cpp:
+ (WebCore::CSSFontSelector::addFontFaceRule): Gets the CachedFont from CSSFontFaceSrcValue object. The object will request the resource if it doesn't exist.
+
+2012-01-10 pfeldman@chomium.org <pavel.feldman@gmail.com>
+
+ Web Inspector: introduce experimental setting that makes source files always editable
+ https://bugs.webkit.org/show_bug.cgi?id=75626
+
+ Reviewed by Timothy Hatcher.
+
+ * English.lproj/localizedStrings.js:
+ * inspector/front-end/JavaScriptSourceFrame.js:
+ (WebInspector.JavaScriptSourceFrame):
+ (WebInspector.JavaScriptSourceFrame.prototype.setReadOnly):
+ * inspector/front-end/NetworkPanel.js:
+ (WebInspector.NetworkLogView):
+ * inspector/front-end/ScriptsNavigator.js:
+ (WebInspector.NavigatorScriptTreeElement.prototype.onselect):
+ * inspector/front-end/Settings.js:
+ (WebInspector.ExperimentsSettings):
+ * inspector/front-end/SourceFrame.js:
+ (WebInspector.SourceFrame):
+ (WebInspector.SourceFrame.prototype.get statusBarItems):
+ (WebInspector.SourceFrame.prototype.setReadOnly):
+ * inspector/front-end/inspector.js:
+ (WebInspector.loaded):
+
+2012-01-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104507.
+ http://trac.webkit.org/changeset/104507
+ https://bugs.webkit.org/show_bug.cgi?id=75936
+
+ Broke webkit_unit_tests (Requested by dimich on #webkit).
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/RenderSurfaceChromium.h:
+ * platform/graphics/chromium/cc/CCLayerIterator.cpp: Removed.
+ * platform/graphics/chromium/cc/CCLayerIterator.h: Removed.
+ * platform/graphics/chromium/cc/CCLayerIteratorPosition.h: Removed.
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::paintLayerContents):
+ (WebCore::CCLayerTreeHost::updateCompositorResources):
+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+ (WebCore::walkLayersAndCalculateVisibleLayerRects):
+ * platform/graphics/chromium/cc/CCRenderSurface.h:
+
+2012-01-09 Rob Buis <rbuis@rim.com>
+
+ Upstream change to disable input[color] css rules for BlackBerry port
+ https://bugs.webkit.org/show_bug.cgi?id=75719
+
+ Reviewed by Antonio Gomes.
+
+ Do not enable default css color rules for input["color"] for BlackBerry port.
+
+ * CMakeLists.txt:
+
+2012-01-09 Greg Billock <gbillock@google.com>
+
+ Implement navigator.startActivity; add IntentRequest object for managing web intents callbacks.
+ Web content will invoke navigator.startActivity to launch a new Web
+ Intents call. Each such call will map to an IntentRequest broker
+ object which is used by client code to correlate any return data to
+ the (optional) callbacks supplied by web content calls.
+ https://bugs.webkit.org/show_bug.cgi?id=75756
+
+ Reviewed by Adam Barth.
+
+ Test: webintents/web-intents-api.html
+
+ * Modules/intents/Intent.cpp: Added.
+ (WebCore::Intent::identifier):
+ (WebCore::Intent::setIdentifier):
+ * Modules/intents/Intent.h: Added.
+ * Modules/intents/Intent.idl: Added.
+ * Modules/intents/IntentResultCallback.h: Added.
+ (WebCore::IntentResultCallback::~IntentResultCallback):
+ * Modules/intents/IntentResultCallback.idl: Added.
+ * Modules/intents/IntentsRequest.cpp: Added.
+ * Modules/intents/IntentsRequest.h: Added.
+ * WebCore.gyp/WebCore.gyp:
+ * WebCore.gypi:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GetNativeTypeForCallbacks):
+ * loader/FrameLoaderClient.h:
+ (WebCore::FrameLoaderClient::dispatchIntent):
+
+2012-01-09 Dan Bernstein <mitz@apple.com>
+
+ -[DOMRange renderedImageForcingBlackText:] fails with non-user-selectable text
+ https://bugs.webkit.org/show_bug.cgi?id=75920
+
+ Reviewed by Darin Adler.
+
+ Test: added to TestWebKitAPI/Tests/mac/RenderedImageFromDOMRange.mm
+
+ * page/mac/FrameMac.mm:
+ (WebCore::Frame::rangeImage): Removed the requirement that the start and end positions used
+ for setting the selection in the render tree be candidates.
+
+2012-01-06 Hajime Morrita <morrita@chromium.org>
+
+ [Refactoring] Moving between TreeScopes should be done by its own class.
+ https://bugs.webkit.org/show_bug.cgi?id=75290
+
+ Reviewed by Ryosuke Niwa.
+
+ This change extracted Node::setTreeScopeRecursively(),
+ setDocumentRecursively() and a part of setDocument() into a new
+ class called TreeScopeAdopter. By doing this, the idea of
+ moving a node from scope to scope, that was originally hidden
+ behind the forest of Node APIs, has become clearer.
+
+ Note that this change is a preparation for Bug 59816.
+
+ No new tests. No behavioral change.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/ContainerNode.cpp: Followed the renaming.
+ (WebCore::ContainerNode::takeAllChildrenFrom):
+ (WebCore::ContainerNode::insertBefore):
+ (WebCore::ContainerNode::replaceChild):
+ (WebCore::ContainerNode::removeBetween):
+ (WebCore::ContainerNode::removeChildren):
+ (WebCore::ContainerNode::appendChild):
+ (WebCore::ContainerNode::parserAddChild):
+ * dom/DOMAllInOne.cpp:
+ * dom/Document.cpp: Followed te renaming.
+ (WebCore::Document::setDocType):
+ (WebCore::Document::adoptNode):
+ * dom/Element.cpp: Followed te renaming.
+ (WebCore::Element::removeShadowRoot):
+ * dom/Node.cpp:
+ (WebCore::Node::setDocument):
+ (WebCore::Node::setTreeScope):
+ (WebCore::Node::didMoveToNewDocument):
+ * dom/Node.h:
+ * dom/TreeScope.h:
+ * dom/TreeScope.cpp:
+ (WebCore::TreeScope::adoptIfNeeded): moved from setTreeScopeRecursively()
+ * dom/TreeScopeAdopter.cpp: Added.
+ (WebCore::TreeScopeAdopter::TreeScopeAdopter):
+ (WebCore::TreeScopeAdopter::moveTreeToNewScope):
+ (WebCore::TreeScopeAdopter::moveTreeToNewDocument):
+ (WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
+ (WebCore::TreeScopeAdopter::moveNodeToNewDocument):
+ * dom/TreeScopeAdopter.h: Added.
+ (WebCore::TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled):
+ (WebCore::TreeScopeAdopter::execute):
+ (WebCore::TreeScopeAdopter::needsScopeChange()):
+ (WebCore::TreeScopeAdopter::shadowRootFor):
+
+2012-01-09 Adam Barth <abarth@webkit.org>
+
+ run-bindings-tests should exercise all the IDL attributes we use
+ https://bugs.webkit.org/show_bug.cgi?id=75900
+
+ Reviewed by Eric Seidel.
+
+ I just grepped through the code generator script for IDL attributes and
+ wrote tests for them.
+
+ * bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.cpp: Added.
+ * bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.h: Added.
+ * bindings/scripts/test/CPP/WebDOMTestEventTarget.cpp: Added.
+ * bindings/scripts/test/CPP/WebDOMTestEventTarget.h: Added.
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.cpp: Added.
+ * bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.cpp: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h: Added.
+ * bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetterPrivate.h: Added.
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Added.
+ * bindings/scripts/test/JS/JSTestActiveDOMObject.h: Added.
+ * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
+ * bindings/scripts/test/JS/JSTestEventTarget.cpp: Added.
+ * bindings/scripts/test/JS/JSTestEventTarget.h: Added.
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestInterface.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp: Added.
+ * bindings/scripts/test/JS/JSTestOverridingNameGetter.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestEventTarget.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestEventTarget.mm: Added.
+ * bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.h: Added.
+ * bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.mm: Added.
+ * bindings/scripts/test/ObjC/DOMTestOverridingNameGetterInternal.h: Added.
+ * bindings/scripts/test/TestDomainSecurity.idl: Added.
+ * bindings/scripts/test/TestEventConstructor.idl:
+ * bindings/scripts/test/TestEventTarget.idl: Added.
+ * bindings/scripts/test/TestInterface.idl:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/TestOverridingNameGetter.idl: Added.
+ * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp: Added.
+ * bindings/scripts/test/V8/V8TestActiveDOMObject.h: Added.
+ * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
+ * bindings/scripts/test/V8/V8TestEventTarget.cpp: Added.
+ * bindings/scripts/test/V8/V8TestEventTarget.h: Added.
+ * bindings/scripts/test/V8/V8TestInterface.h:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ * bindings/scripts/test/V8/V8TestOverridingNameGetter.cpp: Added.
+ * bindings/scripts/test/V8/V8TestOverridingNameGetter.h: Added.
+
+2012-01-09 Nat Duca <nduca@chromium.org>
+
+ [chromium] Add documentation to updater classes
+ https://bugs.webkit.org/show_bug.cgi?id=75866
+
+ Reviewed by James Robinson.
+
+ * platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h:
+ * platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h:
+ * platform/graphics/chromium/CanvasLayerTextureUpdater.h:
+ * platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h:
+ * platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h:
+
+2012-01-09 Adam Barth <abarth@webkit.org>
+
+ Remove unused variable from CodeGeneratorV8
+ https://bugs.webkit.org/show_bug.cgi?id=75895
+
+ Reviewed by Eric Seidel.
+
+ Unused variables aren't worth keeping around.
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateHeader):
+ (GenerateImplementation):
+
+2012-01-09 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Create iterators for the RenderSurface-Layer tree
+ https://bugs.webkit.org/show_bug.cgi?id=74203
+
+ Reviewed by James Robinson.
+
+ New unit tests: CCLayerIteratorTest.cpp
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/RenderSurfaceChromium.h:
+ * platform/graphics/chromium/cc/CCLayerIterator.cpp: Added.
+ (WebCore::CCLayerIteratorActions::BackToFront::begin):
+ (WebCore::CCLayerIteratorActions::BackToFront::end):
+ (WebCore::CCLayerIteratorActions::BackToFront::next):
+ (WebCore::CCLayerIteratorActions::FrontToBack::begin):
+ (WebCore::CCLayerIteratorActions::FrontToBack::end):
+ (WebCore::CCLayerIteratorActions::FrontToBack::next):
+ (WebCore::CCLayerIteratorActions::FrontToBack::goToHighestInSubtree):
+ * platform/graphics/chromium/cc/CCLayerIterator.h: Added.
+ (WebCore::CCLayerIterator::CCLayerIterator):
+ (WebCore::CCLayerIterator::begin):
+ (WebCore::CCLayerIterator::end):
+ (WebCore::CCLayerIterator::operator++):
+ (WebCore::CCLayerIterator::operator==):
+ (WebCore::CCLayerIterator::operator!=):
+ (WebCore::CCLayerIterator::operator->):
+ (WebCore::CCLayerIterator::operator*):
+ (WebCore::CCLayerIterator::representsTargetRenderSurface):
+ (WebCore::CCLayerIterator::representsContributingRenderSurface):
+ (WebCore::CCLayerIterator::representsItself):
+ (WebCore::CCLayerIterator::targetRenderSurfaceLayer):
+ * platform/graphics/chromium/cc/CCLayerIteratorPosition.h: Added.
+ (WebCore::CCLayerIteratorPosition::CCLayerIteratorPosition):
+ (WebCore::CCLayerIteratorPosition::currentLayer):
+ (WebCore::CCLayerIteratorPosition::currentLayerRepresentsContributingRenderSurface):
+ (WebCore::CCLayerIteratorPosition::currentLayerRepresentsTargetRenderSurface):
+ (WebCore::CCLayerIteratorPosition::targetRenderSurfaceLayer):
+ (WebCore::CCLayerIteratorPosition::targetRenderSurface):
+ (WebCore::CCLayerIteratorPosition::targetRenderSurfaceChildren):
+ (WebCore::CCLayerIteratorPosition::operator==):
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::paintLayerContents):
+ (WebCore::CCLayerTreeHost::updateCompositorResources):
+ * platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp:
+ (WebCore::walkLayersAndCalculateVisibleLayerRects):
+ * platform/graphics/chromium/cc/CCRenderSurface.h:
+
+2012-01-09 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Throw exception if IDBCursor.continue() called with lower key than current
+ https://bugs.webkit.org/show_bug.cgi?id=74213
+
+ Reviewed by Tony Chang.
+
+ * storage/IDBCursorBackendImpl.cpp:
+ (WebCore::IDBCursorBackendImpl::continueFunction):
+
+2012-01-09 Justin Novosad <junov@chromium.org>
+
+ [chromium win] Creating lots of temporary canvas contexts will crash.
+ https://bugs.webkit.org/show_bug.cgi?id=68420
+
+ When using the skia port, the allocation of 2d canvas backing stores
+ no longer needs to be done through a platform API (GDI/CG) because
+ canvases now use skia for drawing text. Removing the allocation through
+ GDI on windows prevents resource exhaustion due to unreferenced canvases
+ that are awaiting garbage collection.
+
+ Reviewed by Stephen White.
+
+ No new tests: Relying on existing canvas layout tests.
+
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::createImageBuffer):
+ * platform/graphics/ImageBuffer.h:
+ * platform/graphics/skia/ImageBufferSkia.cpp:
+ (WebCore::createNonPlatformCanvas):
+ (WebCore::ImageBuffer::ImageBuffer):
+
+2012-01-09 Avi Drissman <avi@chromium.org>
+
+ https://bugs.webkit.org/show_bug.cgi?id=75860
+ [Chromium Mac] no background is drawn for input elements
+
+ Reviewed by Dimitri Glazkov.
+
+ Reverts r104240 for Chromium. Unfortunately the code that uses Cocoa
+ API misbehaves when built with the 10.5 SDK, so we use SPI. For now.
+
+ * rendering/RenderThemeChromiumMac.h:
+ * rendering/RenderThemeChromiumMac.mm:
+ (WebCore::RenderThemeChromiumMac::paintTextField):
+
+2012-01-09 Pablo Flouret <pablof@motorola.com>
+
+ Compilation error on build-webkit --debug --no-3d-canvas on mac.
+ https://bugs.webkit.org/show_bug.cgi?id=75878
+
+ Reviewed by Alexey Proskuryakov.
+
+ * html/canvas/WebGLContextEvent.cpp:
+
+2012-01-09 Tom Sepez <tsepez@chromium.org>
+
+ Treat code="" attribute in embed tags similarly to applet tags.
+ https://bugs.webkit.org/show_bug.cgi?id=75871
+
+ Reviewed by Daniel Bates.
+
+ Tests: http/tests/security/xssAuditor/embed-tag-code-attribute-2.html
+ http/tests/security/xssAuditor/embed-tag-code-attribute.html
+
+ * html/parser/XSSAuditor.cpp:
+ (WebCore::XSSAuditor::filterEmbedToken):
+
+2012-01-09 Justin Novosad <junov@chromium.org>
+
+ [Chromium] remove all references to the legacy accelerated 2d Canvas
+ implementation
+ https://bugs.webkit.org/show_bug.cgi?id=75108
+
+ Purging an old settings flag that is no longer referenced
+
+ Reviewed by Darin Fisher.
+
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+ * page/Settings.h:
+
+2012-01-09 Eric Carlson <eric.carlson@apple.com>
+
+ REGRESSION(r104327?): media/track/track-cues-cuechange.html and track-cues-enter-exit.html
+ intermittently time out, media/track/track-cues-seeking and fails
+ https://bugs.webkit.org/show_bug.cgi?id=75817
+
+ Unreviewed, fix a problem introduced in r104327.
+
+ No new tests, covered by existing tests.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_ignoreTrackDisplayUpdate.
+
+2012-01-09 Raymond Toy <rtoy@google.com>
+
+ Add normalize attribute to ConvolverNode to disable normalization.
+ https://bugs.webkit.org/show_bug.cgi?id=75126
+
+ Reviewed by Kenneth Russell.
+
+ Tests added in convolution-mono-mono.html.
+
+ * platform/audio/Reverb.cpp:
+ (WebCore::Reverb::Reverb): Add extra arg to indicate whether
+ normalization is enabled or not, and do it.
+ * platform/audio/Reverb.h: Update declaration.
+ * webaudio/ConvolverNode.cpp:
+ (WebCore::ConvolverNode::ConvolverNode): Initialize attribute (to
+ true).
+ (WebCore::ConvolverNode::setBuffer): Call Reverb with
+ normalization argument.
+ * webaudio/ConvolverNode.h:
+ (WebCore::ConvolverNode::normalize): New method to return
+ normalization.
+ (WebCore::ConvolverNode::setNormalize): New method to set
+ normalization.
+ * webaudio/ConvolverNode.idl: Add normalize attribute.
+ * LayoutTests/webaudio/convolution-mono-mono.html:
+ * LayoutTests/webaudio/convolution-mono-mono-expected.txt:
+ * LayoutTests/webaudio/resources/convolution-testing.js:
+ Test for convolution. Tests only work when normalization is
+ disabled.
+
+2012-01-09 Judy Hao <judy.liqiong-hao@nokia.com>
+
+ [GStreamer] webkitwebsrc: pad template is leaked
+ https://bugs.webkit.org/show_bug.cgi?id=74224
+
+ Reviewed by Philippe Normand.
+
+ Use a GstPadTemplate smart pointer in webkit_web_src_init to
+ avoid a memory leak.
+
+ Fixing memory leaks. So, no new test case is introduced.
+
+ * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
+ (webkit_web_src_init):
+
+2012-01-09 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ Avoid unnecessary TextureManager::reduceMemoryToLimit().
+ https://bugs.webkit.org/show_bug.cgi?id=75632
+
+ Unnecessary TextureManager::reduceMemoryToLimit() will cause some tile
+ textures that are required soon to be unnecessarily removed/replaced,
+ and degrade performance, sometimes significantly.
+
+ For example, CCLayerTreeHost::setViewport will be called during
+ scrolling. The original code would call TextureManager::reduceMemoryToLimit(),
+ causing some textures unnecessarily discarded and then recreated
+ repeatedly during scrolling.
+
+ It's also unnecessary to call TextureManager::reduceMemoryToLimit()
+ from TextureManager::setPreferredMemoryLimitBytes() because the limit
+ is not a hard limit. The callers should call reduceMemoryToLimit()
+ explicitly if it wants it when setting the preferred memory limit.
+
+ Reviewed by James Robinson.
+
+ Tests: webkit_unit_tests --gtest_filter=TextureManagerTest.*:CCLayerTreeHostTestSetViewportSize.*
+
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::finishDrawingFrame): Call reduceMemoryToLimit() explicitly
+ * platform/graphics/chromium/TextureManager.cpp:
+ (WebCore::TextureManager::setPreferredMemoryLimitBytes): Removed call to reduceMemoryToLimit().
+ * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+ (WebCore::CCLayerTreeHost::finishCommitOnImplThread):
+ (WebCore::CCLayerTreeHost::setViewportSize): Changed name from setViewport(). Check change of viewportSize.
+ * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::setViewportSize): Changed name from setViewport()
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+
+2012-01-09 Sami Kyostila <skyostil@chromium.org>
+
+ [Chromium] JPEG RGB swizzling order should match platform pixel format
+ https://bugs.webkit.org/show_bug.cgi?id=75861
+
+ Choose between JCS_EXT_BGRX and JCS_EXT_RGBX channel swizzling
+ based on the configured Skia 32-bit pixel format.
+
+ Reviewed by Kenneth Russell.
+
+ * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+ (rgbOutputColorSpace):
+
+2012-01-09 Alexis Menard <alexis.menard@openbossa.org>
+
+ getComputedStyle for border-radius is not implemented.
+ https://bugs.webkit.org/show_bug.cgi?id=75630
+
+ Reviewed by Tony Chang.
+
+ Implement getComputedStyle for border-radius shorthand property.
+
+ Test: fast/css/getComputedStyle/getComputedStyle-border-radius-shorthand.html
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::getBorderRadiusCornerValues):
+ (WebCore::getBorderRadiusCornerValue):
+ (WebCore::getBorderRadiusShorthandValue):
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+
+2012-01-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104418.
+ http://trac.webkit.org/changeset/104418
+ https://bugs.webkit.org/show_bug.cgi?id=75855
+
+ we still need to build against CG on Mac sometimes (Requested
+ by epoger on #webkit).
+
+ * WebCore.gyp/WebCore.gyp:
+
+2012-01-09 Martin Robinson <mrobinson@igalia.com>
+
+ [GTK] [AC] Simplify accelerated compositing build options
+ https://bugs.webkit.org/show_bug.cgi?id=75518
+
+ Reviewed by Gustavo Noronha Silva.
+
+ * GNUmakefile.am: Automatically enable 3D rendering when AC is available.
+ * GNUmakefile.list.am: Clean up a comment.
+
+2012-01-09 Antti Koivisto <antti@apple.com>
+
+ possible regression: r104060 maybe causing crashes
+ https://bugs.webkit.org/show_bug.cgi?id=75676
+
+ Reviewed by Andreas Kling.
+
+ Based on the stacks, CSSStyleSelector may be getting deleted from under the
+ CSSStyleSelector::appendAuthorStylesheets call. Protect by temporarily detaching
+ from the document. Also add assertions to catch the case.
+
+ No test, there is no known repro and the fix is speculative.
+
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::setDocType):
+ (WebCore::Document::childrenChanged):
+ (WebCore::Document::clearStyleSelector):
+ (WebCore::Document::updateActiveStylesheets):
+ * dom/Document.h:
+
+2012-01-09 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
+
+ Use Vector<OwnPtr> for m_viewportDependentMediaQueryResults in CSSStyleSelector
+ https://bugs.webkit.org/show_bug.cgi?id=75723
+
+ Reviewed by Andreas Kling.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::~CSSStyleSelector):
+ (WebCore::CSSStyleSelector::addViewportDependentMediaQueryResult):
+ * css/CSSStyleSelector.h:
+
+2012-01-09 Alexis Menard <alexis.menard@openbossa.org>
+
+ Extend CSSValueList to allow slash separated lists.
+ https://bugs.webkit.org/show_bug.cgi?id=75841
+
+ Reviewed by Andreas Kling.
+
+ Multiple CSS properties are using slash to separate
+ various parts (e.g. border-radius) so having this
+ feature available in CSSValueList will make it easier
+ in the future to support these properties.
+
+ No new tests : existing ones should cover the refactor.
+
+ * css/CSSInitialValue.h:
+ (WebCore::CSSInitialValue::isImplicit):
+ (WebCore::CSSInitialValue::CSSInitialValue):
+ * css/CSSValue.cpp:
+ (WebCore::CSSValue::isImplicitInitialValue):
+ * css/CSSValue.h:
+ In order for CSSValue to not grow I moved m_isImplicitInitialValue
+ back to CSSInitialValue as this object is used only in CSSValuePool
+ and is allocated only twice.
+ (WebCore::CSSValue::CSSValue):
+ * css/CSSValueList.cpp:
+ (WebCore::CSSValueList::CSSValueList):
+ (WebCore::CSSValueList::copy):
+ Fix also usage of PassRefPtr.
+ (WebCore::CSSValueList::customCssText):
+ Refactor to use StringBuilder.
+ * css/CSSValueList.h:
+ (WebCore::CSSValueList::createCommaSeparated):
+ (WebCore::CSSValueList::createSpaceSeparated):
+ (WebCore::CSSValueList::createSlashSeparated):
+ * css/WebKitCSSFilterValue.cpp:
+ (WebCore::WebKitCSSFilterValue::WebKitCSSFilterValue):
+ * css/WebKitCSSTransformValue.cpp:
+ (WebCore::WebKitCSSTransformValue::WebKitCSSTransformValue):
+
+2012-01-09 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Texmap] Move surface management from TextureMapperNode to TextureMapper
+ https://bugs.webkit.org/show_bug.cgi?id=75779
+
+ Instead of a TextureMapperSurfaceManager class inside of TextureMapperNode.cpp, we now
+ maintain that surface pool inside of the TextureMapper class. This will later allow us to
+ allocate intermediate surface from within TextureMapperGL, a functionality we need for
+ filters.
+
+ Also, surfaces are not automatically created with the viewport size, but rather with the
+ size passed as a parameter. The surface from the pool is the smallest texture that is
+ larger than the required size, or any texture if such texture is not yet allocated.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Tests in LayoutTests/compositing already cover this.
+
+ * GNUmakefile.list.am: Added TextureMapper.cpp to the build.
+ * Target.pri: Added TextureMapper.cpp to the build.
+ * WebCore.gypi: Added TextureMapper.cpp to the build.
+ * platform/graphics/texmap/TextureMapper.cpp: Added.
+ * platform/graphics/texmap/TextureMapper.h:
+ * platform/graphics/texmap/TextureMapperNode.cpp:
+ (WebCore::TextureMapperNode::paint):
+ (WebCore::TextureMapperNode::paintReflection):
+ (WebCore::TextureMapperNode::paintRecursive):
+ * platform/graphics/texmap/TextureMapperNode.h:
+ (WebCore::TextureMapperNode::TextureMapperNode):
+
+2012-01-09 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [Gtk] Regression: text-inserted events lack text inserted and current line
+ https://bugs.webkit.org/show_bug.cgi?id=72830
+
+ Reviewed by Martin Robinson.
+
+ Fix issue getting the exposed text for an accessibility object at,
+ before of after a given offset, after changing it at least once.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (webkit_accessible_class_init): Don't initialize
+ gailTextUtilQuark, it won't be used anymore.
+ (getGailTextUtilForAtk): Don't cache the GailTextUtil as object
+ data, but create a new one each time this function is called.
+ (webkit_accessible_text_get_caret_offset): Simplified code by
+ using the new focusedObjectAndCaretOffsetUnignored function,
+ instead of the old objectAndOffsetUnignored function.
+ (focusedObjectAndCaretOffsetUnignored): Rewrite of the old
+ objectAndOffsetUnignored function so it now needs less
+ parameters than before and takes care of carefully selecting the
+ start and end visible positions to calculate the position of the
+ caret from the point of view of the accessibility object of
+ reference passed as the only input parameter now. Updated callers.
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.h:
+
+ * editing/gtk/FrameSelectionGtk.cpp:
+ (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
+ Simplified code by calling to focusedObjectAndCaretOffsetUnignored
+ function, instead of the old objectAndOffsetUnignored function.
+
+2012-01-09 Antti Koivisto <antti@apple.com>
+
+ Subtree invalidation on stylesheet change
+ https://bugs.webkit.org/show_bug.cgi?id=75834
+
+ Reviewed by Andreas Kling.
+
+ Currently if we add a stylesheet with scoped selectors and matching scope elements exist,
+ we recalculate the entire document style. It is sufficient to invalidate the subtrees
+ matching the scope only.
+
+ This allows us to do less full style recalcs on many popular web sites (nytimes.com for example).
+ Subtree recalcs are typically much cheaper.
+
+ Test: fast/css/id-or-class-before-stylesheet.html
+
+ * dom/Document.cpp:
+ (WebCore::Document::testAddedStylesheetRequiresStyleRecalc):
+ (WebCore::Document::analyzeStylesheetChange):
+ (WebCore::Document::updateActiveStylesheets):
+ * dom/Document.h:
+
+2012-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ Unreviewed. Fix make distcheck issues.
+
+ * GNUmakefile.list.am: Add missing header.
+
+2012-01-09 Kentaro Hara <haraken@chromium.org>
+
+ [Refactoring] Use join(", ", @arguments) to build a method argument string
+ in CodeGeneratorJS.pm
+ https://bugs.webkit.org/show_bug.cgi?id=75830
+
+ Reviewed by Adam Barth.
+
+ The code in CodeGeneratorJS.pm to build a method argument string is dirty
+ and error-prone. It is concatenating arguments one by one judging whether
+ ", " is necessary or not. This patch refactors the code so that it pushes
+ all arguments into @arguments and then builds a method string by
+ join(", ", @arguments).
+
+ Test: bindings/scripts/test/*
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateParametersCheck):
+ (GenerateImplementationFunctionCall):
+
+2012-01-09 Andreas Kling <awesomekling@apple.com>
+
+ CSSMutableStyleDeclaration: Remove propertiesEqual().
+ <http://webkit.org/b/75829>
+
+ Reviewed by Antti Koivisto.
+
+ Remove propertiesEqual() since it was wrong (it only compared CSSValue pointers,
+ not the actual values.)
+
+ Skip comparing the style declarations in NamedNodeMap::mappedMapsEquivalent()
+ and just compare pointers instead. This is possible because the declarations
+ all come from the mapped attribute/declaration table.
+
+ * css/CSSMutableStyleDeclaration.h:
+ * dom/NamedNodeMap.cpp:
+ (WebCore::NamedNodeMap::mappedMapsEquivalent):
+
+2012-01-09 Adam Barth <abarth@webkit.org>
+
+ insertAdjacentHTML doesn't play nice with DocumentFragment
+ https://bugs.webkit.org/show_bug.cgi?id=75826
+
+ Reviewed by Eric Seidel.
+
+ Test: fast/dom/insertAdjacentHTML-DocumentFragment-crash.html
+
+ Document nodes aren't the only non-Element ContainerNodes.
+
+ * html/HTMLElement.cpp:
+ (WebCore::contextElementForInsertion):
+
+2012-01-09 Andreas Kling <awesomekling@apple.com>
+
+ CSSStyleSelector: Any attribute with a decl() can be assumed to be mapped.
+ <http://webkit.org/b/75832>
+
+ Reviewed by Antti Koivisto.
+
+ Replace isMappedAttribute() check with an assertion. Only a mapped attribute
+ will have an associated style declaration.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::matchAllRules):
+
+2012-01-09 Kentaro Hara <haraken@chromium.org>
+
+ [Refactoring] Use join(", ", @arguments) to build a method argument
+ string in CodeGeneratorV8.pm
+ https://bugs.webkit.org/show_bug.cgi?id=75828
+
+ Reviewed by Darin Adler.
+
+ The code in CodeGeneratorV8.pm to build a method argument string is dirty
+ and error-prone. It is concatenating arguments one by one judging whether
+ ", " is necessary or not. This patch refactors the code so that it pushes
+ all arguments into @arguments and then builds a method string by
+ join(", ", @arguments).
+
+ Test: bindings/scripts/test/*
+
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateFunctionCallString):
+
+2012-01-08 Benjamin Poulain <benjamin@webkit.org>
+
+ Build fix: ScrollAnimatorMac has missing initializer in systemUptime()
+ https://bugs.webkit.org/show_bug.cgi?id=75827
+
+ Reviewed by Darin Adler.
+
+ Explicitly initialize the struct timeval to avoid compiler warnings.
+
+ * platform/mac/ScrollAnimatorMac.mm:
+ (systemUptime):
+
+2012-01-08 ChangSeok Oh <shivamidow@gmail.com>
+
+ Memory allocation mismatch by using adoptArrayPtr in GraphicsContext3DOpenGL.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=75820
+
+ Reviewed by Darin Adler.
+
+ Dbates submitted a patch to release fastMalloc allocation
+ in GraphicsContext3DOpenGL.cpp properly.
+ See http://trac.webkit.org/browser/trunk/Source/WebCore/ChangeLog?rev=104395
+ But one thing similar to the above still remains mismatched.
+
+ No new tests required.
+
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+ (WebCore::GraphicsContext3D::getShaderInfoLog):
+
+2012-01-08 Leo Yang <leo.yang@torchmobile.com.cn>
+
+ [BlackBerry] Use the concrete FrameNetworkingContextBlackBerry to access Frame
+ https://bugs.webkit.org/show_bug.cgi?id=75611
+
+ Reviewed by Antonio Gomes.
+
+ In platform/network/blackberry/ResourceHandleBlackBerry.cpp, we were using
+ NetworkingContext::wrappedFrame() to access the frame associated with the
+ networking context. NetworkingContext::wrappedFrame() was added as a virtual
+ function by the BlackBerry porting internally. It's unnecessary because
+ FrameNetworkingContextBlackBerry inherits from FrameNetworkingContext which
+ has a protected frame() member which is exported as public in
+ FrameNetworkingContextBlackBerry. We don't want to upstream wrappedFrame()
+ as a specific change of the BlackBerry porting in
+ platform/network/NetworkingContext.h, so use the concrete networking context
+ FrameNetworkingContextBlackBerry to access the associated frame.
+
+ No functionalities changed, no new tests.
+
+ * platform/network/blackberry/ResourceHandleBlackBerry.cpp:
+ (WebCore::ResourceHandle::start):
+ (WebCore::ResourceHandle::loadResourceSynchronously):
+
+2012-01-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104421.
+ http://trac.webkit.org/changeset/104421
+ https://bugs.webkit.org/show_bug.cgi?id=75816
+
+ Need to rebaseline some tests on Linux (Requested by noamr on
+ #webkit).
+
+ * Target.pri:
+
+2012-01-08 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Enable CSS_FILTERS in Qt build
+ https://bugs.webkit.org/show_bug.cgi?id=75777
+
+ Enable CSS_FILTERS and unskip the tests.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Filter tests are now unskipped for Qt.
+
+ * Target.pri: add missing files to build.
+
+2012-01-08 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Remove use_skia option from GYP
+ https://bugs.webkit.org/show_bug.cgi?id=75811
+
+ Reviewed by Ryosuke Niwa.
+
+ The CG configuration of Chromium Mac is no longer supported.
+
+ * WebCore.gyp/WebCore.gyp:
+
+2012-01-08 Benjamin Poulain <benjamin@webkit.org>
+
+ Valid canonical URLs should have a lowercase hostname
+ https://bugs.webkit.org/show_bug.cgi?id=75771
+
+ Reviewed by Adam Barth.
+
+ According to the RFC 3986 (and other browsers implementation), the hostname
+ of valid canonical URLs should be lowercase.
+
+ This patch lowercase the hostname in KURL::parse() similarily to what we
+ do for the scheme.
+
+ Tests: fast/url/host-lowercase-per-scheme.html
+ fast/url/safari-extension.html
+
+ * platform/KURL.cpp:
+ (WebCore::isCanonicalHostnameLowercaseForScheme):
+ (WebCore::KURL::parse):
+
+2012-01-08 Adam Barth <abarth@webkit.org>
+
+ Rename checkNodeSecurity and allowsAccessFromFrame to have sensible names
+ https://bugs.webkit.org/show_bug.cgi?id=75796
+
+ Reviewed by Sam Weinig.
+
+ This patch contains only renames and FIXME comments. No behavior change.
+
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::allowAccessToNode):
+ (WebCore::allowAccessToFrame):
+ * bindings/js/JSDOMBinding.h:
+ * bindings/js/JSHTMLFrameElementCustom.cpp:
+ (WebCore::allowSettingJavascriptURL):
+ * bindings/js/JSHistoryCustom.cpp:
+ (WebCore::JSHistory::getOwnPropertySlotDelegate):
+ (WebCore::JSHistory::getOwnPropertyDescriptorDelegate):
+ (WebCore::JSHistory::putDelegate):
+ (WebCore::JSHistory::deleteProperty):
+ (WebCore::JSHistory::getOwnPropertyNames):
+ * bindings/js/JSLocationCustom.cpp:
+ (WebCore::JSLocation::getOwnPropertySlotDelegate):
+ (WebCore::JSLocation::getOwnPropertyDescriptorDelegate):
+ (WebCore::JSLocation::putDelegate):
+ (WebCore::JSLocation::deleteProperty):
+ (WebCore::JSLocation::getOwnPropertyNames):
+ (WebCore::JSLocation::toStringFunction):
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::canAccessFromCurrentOrigin):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateGetOwnPropertyDescriptorBody):
+ (GenerateImplementation):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateNormalAttrGetter):
+ (GenerateFunctionCallback):
+
+2012-01-08 Adam Barth <abarth@webkit.org>
+
+ Remove deprecated toDynamicFrame and unused [CallWith=DynamicFrame]
+ https://bugs.webkit.org/show_bug.cgi?id=75795
+
+ Reviewed by Eric Seidel.
+
+ We've succeeded in removing all the callers fo this function, including
+ all the uses of CallWith=DynamicFrame in IDL files.
+
+ * bindings/js/JSDOMBinding.cpp:
+ * bindings/js/JSDOMBinding.h:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateParametersCheck):
+ * bindings/scripts/CodeGeneratorV8.pm:
+ (GenerateFunctionCallString):
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+
+2012-01-08 Adam Barth <abarth@webkit.org>
+
+ NeedsUserGestureCheck IDL attribute is no longer used
+ https://bugs.webkit.org/show_bug.cgi?id=75794
+
+ Reviewed by Eric Seidel.
+
+ This IDL attribute is no longer used because we use static state to
+ keep track of the user gesture state. We can delete the code that
+ supports it.
+
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/TestObj.idl:
+
+2012-01-08 Adam Barth <abarth@webkit.org>
+
+ Remove unused security functions from V8 bindings
+ https://bugs.webkit.org/show_bug.cgi?id=75797
+
+ Reviewed by Eric Seidel.
+
+ This functions have no callers. They can be removed.
+
+ * bindings/v8/ScriptController.cpp:
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/specialization/V8BindingState.cpp:
+ * bindings/v8/specialization/V8BindingState.h:
+
+2012-01-08 Pratik Solanki <psolanki@apple.com>
+
+ Assertion failure under SharedBuffer::append() when NETWORK_CFDATA_ARRAY_CALLBACK is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=75656
+
+ Reviewed by Darin Adler.
+
+ Update the implementation of SubresourceLoader::didReceiveDataArray() to conform to the
+ refactoring done as part of bug 71149 in r100311.
+
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::didReceiveData):
+ (WebCore::SubresourceLoader::errorLoadingResource):
+ * loader/SubresourceLoader.h:
+ * loader/cf/SubresourceLoaderCF.cpp:
+ (WebCore::SubresourceLoader::didReceiveDataArray):
+
+2012-01-08 Steve Block <steveblock@google.com>
+
+ Remove V8-specific Java Bridge code
+ https://bugs.webkit.org/show_bug.cgi?id=75801
+
+ Reviewed by Darin Adler.
+
+ Also remove superfluous JSC and V8 guards, as the code is now used only
+ with JSC.
+
+ No new tests, removing dead code only.
+
+ * WebCore.gypi:
+ * bridge/jni/JNIUtility.cpp:
+ (JSC::Bindings::javaTypeFromClassName):
+ (JSC::Bindings::signatureFromJavaType):
+ (JSC::Bindings::getJNIField):
+ (JSC::Bindings::callJNIMethod):
+ * bridge/jni/JavaType.h:
+ * bridge/jni/jsc/JavaMethodJSC.cpp:
+ (appendClassName):
+ (JavaMethod::signature):
+ * bridge/jni/v8/JNIUtilityPrivate.cpp: Removed.
+ * bridge/jni/v8/JNIUtilityPrivate.h: Removed.
+ * bridge/jni/v8/JavaClassV8.h: Removed.
+ * bridge/jni/v8/JavaFieldV8.h: Removed.
+ * bridge/jni/v8/JavaInstanceV8.h: Removed.
+ * bridge/jni/v8/JavaMethodV8.h: Removed.
+ * bridge/jni/v8/JavaNPObjectV8.cpp: Removed.
+ * bridge/jni/v8/JavaNPObjectV8.h: Removed.
+ * bridge/jni/v8/JavaValueV8.h: Removed.
+ * bridge/jsc/BridgeJSC.h:
+
+2012-01-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104403.
+ http://trac.webkit.org/changeset/104403
+ https://bugs.webkit.org/show_bug.cgi?id=75803
+
+ It broke all tests on Qt5 (Requested by Ossy_weekend on
+ #webkit).
+
+ * Target.pri:
+
+2012-01-08 Antti Koivisto <antti@apple.com>
+
+ Don't create style selector in Element::recalcStyleIfNeededAfterAttributeChanged if it doesn't exist
+ https://bugs.webkit.org/show_bug.cgi?id=75802
+
+ Rubber-stamped by Andreas Kling.
+
+ Element::recalcStyleIfNeededAfterAttributeChanged shouldn't create style selector for attribute
+ check if it doesn't already exist. We are going to need a full style recalc anyway in that case
+ and the constructed style selector may get throw out again.
+
+ * dom/Element.cpp:
+ (WebCore::Element::recalcStyleIfNeededAfterAttributeChanged):
+
+2012-01-08 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Enable CSS_FILTERS in Qt build
+ https://bugs.webkit.org/show_bug.cgi?id=75777
+
+ Enable CSS_FILTERS and unskip the tests.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Filter tests are now unskipped for Qt.
+
+ * Target.pri: add missing files to build.
+
+2012-01-07 Antti Koivisto <antti@apple.com>
+
+ REGRESSION (r104060): Layout Test fast/media/viewport-media-query.html is occasionally failing
+ https://bugs.webkit.org/show_bug.cgi?id=75633
+
+ Reviewed by Andreas Kling.
+
+ If something triggers CSSStyleSelector construction very early, before documentElement is known,
+ it won't be able to resolve viewport-related media queries. In the included test case
+ the attribute on <html> element triggers the style selector creation. I can't repro
+ the fast/media/viewport-media-query.html failure but I suspect it is the same issue with
+ a different mechanism for early CSSStyleSelector construction.
+
+ - Reset style selector on documentElement change.
+ - Remove the code for lazy documentElement initialization. It is not an useful optimization,
+ the children of Document rarely change.
+
+ Test: fast/media/viewport-media-query-synchronous.html
+
+ * WebCore.exp.in:
+ * dom/Document.cpp:
+ (WebCore::Document::childrenChanged):
+ * dom/Document.h:
+ (WebCore::Document::documentElement):
+
+2012-01-07 Andreas Kling <awesomekling@apple.com>
+
+ Attempt to regenerate bindings on the Windows bot.
+
+ * html/HTMLCollection.h:
+
+2012-01-07 Daniel Bates <dbates@webkit.org>
+
+ Memory allocator mismatch; Use operator new[] with OwnArrayPtr instead of fastMalloc()
+
+ Rubber-stamped by Adam Barth.
+
+ Currently getProgramInfoLog() in GraphicsContext3DOpenGL.cpp assumes that operator new[]
+ and fastMalloc() are equivalent when it adopts a fastMalloc() allocated buffer. Notice,
+ OwnArrayPtr ultimately calls delete[] on destruction. When GLOBAL_FASTMALLOC_NEW is disabled,
+ it isn't true that operator new[], operator delete[] are equivalent to fastMalloc(), fastFree(),
+ respectively. Hence, there may be a mismatch between the allocation and deallocation
+ routines. Therefore, we should allocate the array to be adopted by OwnArrayPtr using
+ operator new[].
+
+ * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+ (WebCore::GraphicsContext3D::getProgramInfoLog):
+
+2012-01-07 Chris Marrin <cmarrin@apple.com>
+
+ Fixed ANGLE build for GNU and QT broken in https://trac.webkit.org/changeset/104363
+
+ Unreviewed.
+
+ * GNUmakefile.list.am:
+ * Target.pri:
+
+2012-01-07 Andreas Kling <awesomekling@apple.com>
+
+ Unreviewed C++ bindings build fix after r104383.
+
+ Use WTF::getPtr() to grab at impl pointer since they could be either RefPtr or raw.
+
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ (GenerateImplementation):
+ * bindings/scripts/test/CPP/WebDOMTestCallback.cpp:
+ (WebDOMTestCallback::impl):
+ * bindings/scripts/test/CPP/WebDOMTestEventConstructor.cpp:
+ (WebDOMTestEventConstructor::impl):
+ * bindings/scripts/test/CPP/WebDOMTestInterface.cpp:
+ (WebDOMTestInterface::impl):
+ * bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp:
+ (WebDOMTestMediaQueryListListener::impl):
+ * bindings/scripts/test/CPP/WebDOMTestNamedConstructor.cpp:
+ (WebDOMTestNamedConstructor::impl):
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ (WebDOMTestObj::impl):
+ * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp:
+ (WebDOMTestSerializedScriptValueInterface::impl):
+
+2012-01-07 Andreas Kling <awesomekling@apple.com>
+
+ Simplify HTMLCollection ownership model.
+ <http://webkit.org/b/75437>
+
+ Reviewed by Sam Weinig.
+
+ Remove HTMLCollection's inheritance from RefCounted and use OwnPtr to store it.
+ Added ref()/deref() methods that forward to the collection's base node, these
+ are only ever used by DOM wrappers.
+
+ This is a behavior change, HTMLCollection wrappers now keep the base node alive.
+
+ Test: fast/dom/htmlcollection-protects-base.html
+
+ * html/HTMLCollection.h:
+ (WebCore::HTMLCollection::ref):
+ (WebCore::HTMLCollection::deref):
+
+ Removed inheritance from RefCounted. Added ref/deref that forward the refs
+ to the collection's base Node.
+
+ * dom/Element.cpp:
+ (WebCore::Element::~Element):
+ * dom/Document.h:
+ * dom/Document.cpp:
+ (WebCore::Document::~Document):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::~HTMLFormElement):
+ * html/HTMLSelectElement.h:
+ * html/HTMLSelectElement.cpp:
+
+ Remove HTMLCollection::detachFromNode() and call sites.
+
+ * html/HTMLAllCollection.cpp:
+ (WebCore::HTMLAllCollection::namedItemWithIndex):
+ * html/HTMLCollection.cpp:
+ (WebCore::HTMLCollection::HTMLCollection):
+ (WebCore::HTMLCollection::invalidateCacheIfNeeded):
+ (WebCore::HTMLCollection::itemAfter):
+ (WebCore::HTMLCollection::calcLength):
+ (WebCore::HTMLCollection::length):
+ (WebCore::HTMLCollection::item):
+ (WebCore::HTMLCollection::nextItem):
+ (WebCore::HTMLCollection::namedItem):
+ (WebCore::HTMLCollection::updateNameCache):
+ (WebCore::HTMLCollection::hasNamedItem):
+ (WebCore::HTMLCollection::namedItems):
+ (WebCore::HTMLCollection::tags):
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::calcLength):
+ (WebCore::HTMLFormCollection::item):
+ (WebCore::HTMLFormCollection::getNamedItem):
+ (WebCore::HTMLFormCollection::namedItem):
+ (WebCore::HTMLFormCollection::updateNameCache):
+ * html/HTMLNameCollection.cpp:
+ (WebCore::HTMLNameCollection::itemAfter):
+ * html/HTMLOptionsCollection.cpp:
+ (WebCore::HTMLOptionsCollection::add):
+ (WebCore::HTMLOptionsCollection::remove):
+ (WebCore::HTMLOptionsCollection::selectedIndex):
+ (WebCore::HTMLOptionsCollection::setSelectedIndex):
+ (WebCore::HTMLOptionsCollection::setLength):
+ * html/HTMLPropertiesCollection.cpp:
+ (WebCore::HTMLPropertiesCollection::length):
+ (WebCore::HTMLPropertiesCollection::item):
+ (WebCore::HTMLPropertiesCollection::names):
+
+ Removed base node null-checks and assertions. Added one assertion to
+ the HTMLCollection constructor (that m_base is non-null.)
+
+ * dom/Document.h:
+ * dom/Document.cpp:
+ (WebCore::Document::openSearchDescriptionURL):
+ (WebCore::Document::cachedCollection):
+ (WebCore::Document::images):
+ (WebCore::Document::applets):
+ (WebCore::Document::embeds):
+ (WebCore::Document::plugins):
+ (WebCore::Document::objects):
+ (WebCore::Document::scripts):
+ (WebCore::Document::links):
+ (WebCore::Document::forms):
+ (WebCore::Document::anchors):
+ (WebCore::Document::all):
+ (WebCore::Document::windowNamedItems):
+ (WebCore::Document::documentNamedItems):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::namedItemGetter):
+ * bindings/js/JSHTMLDocumentCustom.cpp:
+ (WebCore::JSHTMLDocument::nameGetter):
+ (WebCore::JSHTMLDocument::all):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ * dom/ElementRareData.h:
+ (WebCore::ElementRareData::ensureCachedHTMLCollection):
+ * dom/NodeRareData.h:
+ (WebCore::NodeRareData::properties):
+ * html/HTMLAllCollection.h:
+ * html/HTMLAllCollection.cpp:
+ (WebCore::HTMLAllCollection::create):
+ * html/HTMLCollection.h:
+ * html/HTMLCollection.cpp:
+ (WebCore::HTMLCollection::create):
+ (WebCore::HTMLCollection::HTMLCollection):
+ * html/HTMLDataListElement.cpp:
+ (WebCore::HTMLDataListElement::options):
+ * html/HTMLDataListElement.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::children):
+ * html/HTMLElement.h:
+ * html/HTMLSelectElement.h:
+ (WebCore::HTMLSelectElement::options):
+ * html/HTMLFormCollection.h:
+ * html/HTMLFormElement.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::elements):
+ * html/HTMLNameCollection.h:
+ (WebCore::HTMLNameCollection::create):
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::create):
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::imageElement):
+ (WebCore::HTMLMapElement::areas):
+ * html/HTMLMapElement.h:
+ * html/HTMLPropertiesCollection.h:
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::rows):
+ (WebCore::HTMLTableElement::tBodies):
+ * html/HTMLTableElement.h:
+ * html/HTMLTableRowElement.cpp:
+ (WebCore::HTMLTableRowElement::insertCell):
+ (WebCore::HTMLTableRowElement::deleteCell):
+ (WebCore::HTMLTableRowElement::cells):
+ * html/HTMLTableRowElement.h:
+ * html/HTMLTableRowsCollection.cpp:
+ (WebCore::HTMLTableRowsCollection::create):
+ (WebCore::HTMLTableRowsCollection::itemAfter):
+ * html/HTMLTableRowsCollection.h:
+ * html/HTMLTableSectionElement.h:
+ * html/HTMLTableSectionElement.cpp:
+ (WebCore::HTMLTableSectionElement::insertRow):
+ (WebCore::HTMLTableSectionElement::deleteRow):
+ (WebCore::HTMLTableSectionElement::rows):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::selectedOption):
+ * html/HTMLOptionsCollection.h:
+ * html/HTMLOptionsCollection.cpp:
+ (WebCore::HTMLOptionsCollection::create):
+ * html/HTMLPropertiesCollection.cpp:
+ (WebCore::HTMLPropertiesCollection::create):
+ * Source/WebCore/accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::getDocumentLinks):
+
+ Store cached HTMLCollections in OwnPtrs. Methods that used to return
+ PassRefPtr<HTMLCollection> now simply return HTMLCollection*.
+ Updated call sites as appropriate.
+
+2012-01-07 Adam Barth <abarth@webkit.org>
+
+ Attempt to fix Qt build.
+
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::Geolocation):
+
+2012-01-06 Ryosuke Niwa <rniwa@webkit.org>
+
+ REGRESSION(r104210): Crash inside DynamicSubtreeNodeList::length
+ https://bugs.webkit.org/show_bug.cgi?id=75731
+
+ Reviewed by Andreas Kling.
+
+ The crash was caused by DynamicSubtreeNodeList::SubtreeCaches::domVersionIsConsistent
+ using m_cachedItem as a way to access the document. Changed SubtreeCaches to use
+ DynamicSubtreeNodeList's m_node instead.
+
+ Test: fast/dom/node-list-length-after-removing-node.html
+
+ * dom/DynamicNodeList.cpp:
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::setLengthCache):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::setItemCache):
+ (WebCore::DynamicSubtreeNodeList::length):
+ (WebCore::DynamicSubtreeNodeList::item):
+ * dom/DynamicNodeList.h:
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::isLengthCacheValid):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::isItemCacheValid):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::cachedItem):
+ (WebCore::DynamicSubtreeNodeList::SubtreeCaches::domVersionIsConsistent):
+
+2012-01-07 Adam Barth <abarth@webkit.org>
+
+ Disconnecting DOMWindow properties is fragile and overly complicated
+ https://bugs.webkit.org/show_bug.cgi?id=75699
+
+ Reviewed by Alexey Proskuryakov.
+
+ Previously, we had to carefully check every object tree hanging off of
+ DOMWindow to make sure that every property correctly disconnected
+ itself and all its subobjects from the Frame when the DOMWindow
+ disconnected from the Frame.
+
+ This patch introduces DOMWindowProperty, which is a base class that
+ handles this work automagically, ensuring that we won't have any
+ dangling Frame pointers and removing a bunch of boilerplate code.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * css/StyleMedia.cpp:
+ (WebCore::StyleMedia::StyleMedia):
+ * css/StyleMedia.h:
+ (WebCore::StyleMedia::create):
+ * loader/appcache/DOMApplicationCache.cpp:
+ (WebCore::DOMApplicationCache::DOMApplicationCache):
+ (WebCore::DOMApplicationCache::disconnectFrame):
+ * loader/appcache/DOMApplicationCache.h:
+ * page/BarInfo.cpp:
+ (WebCore::BarInfo::BarInfo):
+ * page/BarInfo.h:
+ * page/Console.cpp:
+ (WebCore::Console::Console):
+ (WebCore::Console::memory):
+ * page/Console.h:
+ * page/DOMSelection.cpp:
+ (WebCore::DOMSelection::DOMSelection):
+ * page/DOMSelection.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::registerProperty):
+ (WebCore::DOMWindow::unregisterProperty):
+ (WebCore::DOMWindow::clear):
+ * page/DOMWindow.h:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::Geolocation):
+ (WebCore::Geolocation::disconnectFrame):
+ * page/Geolocation.h:
+ * page/History.cpp:
+ (WebCore::History::History):
+ * page/History.h:
+ * page/Location.cpp:
+ (WebCore::Location::Location):
+ * page/Location.h:
+ * page/Navigator.cpp:
+ (WebCore::Navigator::Navigator):
+ (WebCore::Navigator::~Navigator):
+ * page/Navigator.h:
+ * page/Performance.cpp:
+ (WebCore::Performance::Performance):
+ (WebCore::Performance::memory):
+ * page/Performance.h:
+ * page/PerformanceNavigation.cpp:
+ (WebCore::PerformanceNavigation::PerformanceNavigation):
+ * page/PerformanceNavigation.h:
+ * page/PerformanceTiming.cpp:
+ (WebCore::PerformanceTiming::PerformanceTiming):
+ * page/PerformanceTiming.h:
+ * page/Screen.cpp:
+ (WebCore::Screen::Screen):
+ * page/Screen.h:
+ * plugins/DOMMimeTypeArray.cpp:
+ (WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
+ * plugins/DOMMimeTypeArray.h:
+ * plugins/DOMPluginArray.cpp:
+ (WebCore::DOMPluginArray::DOMPluginArray):
+ * plugins/DOMPluginArray.h:
+ * storage/Storage.cpp:
+ (WebCore::Storage::Storage):
+ * storage/Storage.h:
+
+2012-01-06 Mark Rowe <mrowe@apple.com>
+
+ REGRESSION (r83075): Save as PDF does not generate any links for webkit.org and others
+ <http://webkit.org/b/75768> <rdar://problem/10659258>
+
+ Use RenderObject::hasOutline when determining whether to always create line boxes so that
+ we take in to consideration whether we'll be creating PDF link rects.
+
+ Reviewed by Dan Bernstein.
+
+ * rendering/RenderInline.cpp:
+ (WebCore::RenderInline::styleDidChange):
+
+2012-01-06 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104373 and r104374.
+ http://trac.webkit.org/changeset/104373
+ http://trac.webkit.org/changeset/104374
+ https://bugs.webkit.org/show_bug.cgi?id=75769
+
+ Too many assertion failures. (Requested by kling on #webkit).
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::namedItemGetter):
+ * bindings/js/JSHTMLDocumentCustom.cpp:
+ (WebCore::JSHTMLDocument::nameGetter):
+ (WebCore::JSHTMLDocument::all):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ * dom/Document.cpp:
+ (WebCore::Document::~Document):
+ (WebCore::Document::openSearchDescriptionURL):
+ (WebCore::Document::cachedCollection):
+ (WebCore::Document::images):
+ (WebCore::Document::applets):
+ (WebCore::Document::embeds):
+ (WebCore::Document::plugins):
+ (WebCore::Document::objects):
+ (WebCore::Document::scripts):
+ (WebCore::Document::links):
+ (WebCore::Document::forms):
+ (WebCore::Document::anchors):
+ (WebCore::Document::all):
+ (WebCore::Document::windowNamedItems):
+ (WebCore::Document::documentNamedItems):
+ * dom/Document.h:
+ * dom/Element.cpp:
+ (WebCore::Element::~Element):
+ * dom/ElementRareData.h:
+ (WebCore::ElementRareData::cachedHTMLCollection):
+ (WebCore::ElementRareData::ensureCachedHTMLCollection):
+ * dom/NodeRareData.h:
+ (WebCore::NodeRareData::properties):
+ * html/HTMLAllCollection.cpp:
+ (WebCore::HTMLAllCollection::create):
+ (WebCore::HTMLAllCollection::namedItemWithIndex):
+ * html/HTMLAllCollection.h:
+ * html/HTMLCollection.cpp:
+ (WebCore::HTMLCollection::HTMLCollection):
+ (WebCore::HTMLCollection::create):
+ (WebCore::HTMLCollection::detachFromNode):
+ (WebCore::HTMLCollection::invalidateCacheIfNeeded):
+ (WebCore::HTMLCollection::itemAfter):
+ (WebCore::HTMLCollection::calcLength):
+ (WebCore::HTMLCollection::length):
+ (WebCore::HTMLCollection::item):
+ (WebCore::HTMLCollection::nextItem):
+ (WebCore::HTMLCollection::namedItem):
+ (WebCore::HTMLCollection::updateNameCache):
+ (WebCore::HTMLCollection::hasNamedItem):
+ (WebCore::HTMLCollection::namedItems):
+ (WebCore::HTMLCollection::tags):
+ * html/HTMLCollection.h:
+ * html/HTMLDataListElement.cpp:
+ (WebCore::HTMLDataListElement::options):
+ * html/HTMLDataListElement.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::children):
+ * html/HTMLElement.h:
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::create):
+ (WebCore::HTMLFormCollection::calcLength):
+ (WebCore::HTMLFormCollection::item):
+ (WebCore::HTMLFormCollection::getNamedItem):
+ (WebCore::HTMLFormCollection::namedItem):
+ (WebCore::HTMLFormCollection::updateNameCache):
+ * html/HTMLFormCollection.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::~HTMLFormElement):
+ (WebCore::HTMLFormElement::elements):
+ * html/HTMLFormElement.h:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::selectedOption):
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::imageElement):
+ (WebCore::HTMLMapElement::areas):
+ * html/HTMLMapElement.h:
+ * html/HTMLNameCollection.cpp:
+ (WebCore::HTMLNameCollection::itemAfter):
+ * html/HTMLNameCollection.h:
+ (WebCore::HTMLNameCollection::create):
+ * html/HTMLOptionsCollection.cpp:
+ (WebCore::HTMLOptionsCollection::create):
+ (WebCore::HTMLOptionsCollection::add):
+ (WebCore::HTMLOptionsCollection::remove):
+ (WebCore::HTMLOptionsCollection::selectedIndex):
+ (WebCore::HTMLOptionsCollection::setSelectedIndex):
+ (WebCore::HTMLOptionsCollection::setLength):
+ * html/HTMLOptionsCollection.h:
+ * html/HTMLPropertiesCollection.cpp:
+ (WebCore::HTMLPropertiesCollection::create):
+ (WebCore::HTMLPropertiesCollection::length):
+ (WebCore::HTMLPropertiesCollection::item):
+ (WebCore::HTMLPropertiesCollection::names):
+ * html/HTMLPropertiesCollection.h:
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::~HTMLSelectElement):
+ (WebCore::HTMLSelectElement::options):
+ * html/HTMLSelectElement.h:
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::~HTMLTableElement):
+
+2012-01-06 Andreas Kling <awesomekling@apple.com>
+
+ Unreviewed build fix after r104373.
+
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::~HTMLTableElement):
+
+2012-01-06 Andreas Kling <awesomekling@apple.com>
+
+ Simplify HTMLCollection ownership model.
+ <http://webkit.org/b/75437>
+
+ Reviewed by Sam Weinig.
+
+ Remove HTMLCollection's inheritance from RefCounted and use OwnPtr to store it.
+ Added ref()/deref() methods that forward to the collection's base node, these
+ are only ever used by DOM wrappers.
+
+ This is a behavior change, HTMLCollection wrappers now keep the base node alive.
+
+ Test: fast/dom/htmlcollection-protects-base.html
+
+ * html/HTMLCollection.h:
+ (WebCore::HTMLCollection::ref):
+ (WebCore::HTMLCollection::deref):
+
+ Removed inheritance from RefCounted. Added ref/deref that forward the refs
+ to the collection's base Node.
+
+ * dom/Element.cpp:
+ (WebCore::Element::~Element):
+ * dom/Document.h:
+ * dom/Document.cpp:
+ (WebCore::Document::~Document):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::~HTMLFormElement):
+ * html/HTMLSelectElement.h:
+ * html/HTMLSelectElement.cpp:
+
+ Remove HTMLCollection::detachFromNode() and call sites.
+
+ * html/HTMLAllCollection.cpp:
+ (WebCore::HTMLAllCollection::namedItemWithIndex):
+ * html/HTMLCollection.cpp:
+ (WebCore::HTMLCollection::HTMLCollection):
+ (WebCore::HTMLCollection::invalidateCacheIfNeeded):
+ (WebCore::HTMLCollection::itemAfter):
+ (WebCore::HTMLCollection::calcLength):
+ (WebCore::HTMLCollection::length):
+ (WebCore::HTMLCollection::item):
+ (WebCore::HTMLCollection::nextItem):
+ (WebCore::HTMLCollection::namedItem):
+ (WebCore::HTMLCollection::updateNameCache):
+ (WebCore::HTMLCollection::hasNamedItem):
+ (WebCore::HTMLCollection::namedItems):
+ (WebCore::HTMLCollection::tags):
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::calcLength):
+ (WebCore::HTMLFormCollection::item):
+ (WebCore::HTMLFormCollection::getNamedItem):
+ (WebCore::HTMLFormCollection::namedItem):
+ (WebCore::HTMLFormCollection::updateNameCache):
+ * html/HTMLNameCollection.cpp:
+ (WebCore::HTMLNameCollection::itemAfter):
+ * html/HTMLOptionsCollection.cpp:
+ (WebCore::HTMLOptionsCollection::add):
+ (WebCore::HTMLOptionsCollection::remove):
+ (WebCore::HTMLOptionsCollection::selectedIndex):
+ (WebCore::HTMLOptionsCollection::setSelectedIndex):
+ (WebCore::HTMLOptionsCollection::setLength):
+ * html/HTMLPropertiesCollection.cpp:
+ (WebCore::HTMLPropertiesCollection::length):
+ (WebCore::HTMLPropertiesCollection::item):
+ (WebCore::HTMLPropertiesCollection::names):
+
+ Removed base node null-checks and assertions. Added one assertion to
+ the HTMLCollection constructor (that m_base is non-null.)
+
+ * dom/Document.h:
+ * dom/Document.cpp:
+ (WebCore::Document::openSearchDescriptionURL):
+ (WebCore::Document::cachedCollection):
+ (WebCore::Document::images):
+ (WebCore::Document::applets):
+ (WebCore::Document::embeds):
+ (WebCore::Document::plugins):
+ (WebCore::Document::objects):
+ (WebCore::Document::scripts):
+ (WebCore::Document::links):
+ (WebCore::Document::forms):
+ (WebCore::Document::anchors):
+ (WebCore::Document::all):
+ (WebCore::Document::windowNamedItems):
+ (WebCore::Document::documentNamedItems):
+ * bindings/js/JSDOMWindowCustom.cpp:
+ (WebCore::namedItemGetter):
+ * bindings/js/JSHTMLDocumentCustom.cpp:
+ (WebCore::JSHTMLDocument::nameGetter):
+ (WebCore::JSHTMLDocument::all):
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::namedPropertyGetter):
+ * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+ (WebCore::V8HTMLDocument::GetNamedProperty):
+ * dom/ElementRareData.h:
+ (WebCore::ElementRareData::ensureCachedHTMLCollection):
+ * dom/NodeRareData.h:
+ (WebCore::NodeRareData::properties):
+ * html/HTMLAllCollection.h:
+ * html/HTMLAllCollection.cpp:
+ (WebCore::HTMLAllCollection::create):
+ * html/HTMLCollection.h:
+ * html/HTMLCollection.cpp:
+ (WebCore::HTMLCollection::create):
+ (WebCore::HTMLCollection::HTMLCollection):
+ * html/HTMLDataListElement.cpp:
+ (WebCore::HTMLDataListElement::options):
+ * html/HTMLDataListElement.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::children):
+ * html/HTMLElement.h:
+ * html/HTMLSelectElement.h:
+ (WebCore::HTMLSelectElement::options):
+ * html/HTMLFormCollection.h:
+ * html/HTMLFormElement.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::elements):
+ * html/HTMLNameCollection.h:
+ (WebCore::HTMLNameCollection::create):
+ * html/HTMLFormCollection.cpp:
+ (WebCore::HTMLFormCollection::create):
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::imageElement):
+ (WebCore::HTMLMapElement::areas):
+ * html/HTMLMapElement.h:
+ * html/HTMLPropertiesCollection.h:
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::rows):
+ (WebCore::HTMLTableElement::tBodies):
+ * html/HTMLTableElement.h:
+ * html/HTMLTableRowElement.cpp:
+ (WebCore::HTMLTableRowElement::insertCell):
+ (WebCore::HTMLTableRowElement::deleteCell):
+ (WebCore::HTMLTableRowElement::cells):
+ * html/HTMLTableRowElement.h:
+ * html/HTMLTableRowsCollection.cpp:
+ (WebCore::HTMLTableRowsCollection::create):
+ (WebCore::HTMLTableRowsCollection::itemAfter):
+ * html/HTMLTableRowsCollection.h:
+ * html/HTMLTableSectionElement.h:
+ * html/HTMLTableSectionElement.cpp:
+ (WebCore::HTMLTableSectionElement::insertRow):
+ (WebCore::HTMLTableSectionElement::deleteRow):
+ (WebCore::HTMLTableSectionElement::rows):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::selectedOption):
+ * html/HTMLOptionsCollection.h:
+ * html/HTMLOptionsCollection.cpp:
+ (WebCore::HTMLOptionsCollection::create):
+ * html/HTMLPropertiesCollection.cpp:
+ (WebCore::HTMLPropertiesCollection::create):
+
+ Store cached HTMLCollections in OwnPtrs. Methods that used to return
+ PassRefPtr<HTMLCollection> now simply return HTMLCollection*.
+ Updated call sites as appropriate.
+
+2012-01-06 Adam Barth <abarth@webkit.org>
+
+ DOMWindow should be a FrameDestructionObserver
+ https://bugs.webkit.org/show_bug.cgi?id=75697
+
+ Reviewed by Alexey Proskuryakov.
+
+ DOMWindow plays exactly the role of a FrameDestructionObserver, just
+ with special-case code. It should just use the general-case code.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::DOMWindow):
+ (WebCore::DOMWindow::~DOMWindow):
+ (WebCore::DOMWindow::frameDestroyed):
+ * page/DOMWindow.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::~Frame):
+ (WebCore::Frame::clearDOMWindow):
+ (WebCore::Frame::setDOMWindow):
+ * page/Frame.h:
+
+2012-01-06 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Missing Implementation of Public InspectorDOMAgent Function
+ https://bugs.webkit.org/show_bug.cgi?id=75759
+
+ Implement missing accessor and make setter public.
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::searchingForNodeInPage):
+ * inspector/InspectorDOMAgent.h:
+
+2012-01-06 W. James MacLean <wjmaclean@chromium.org>
+
+ [Chromium] Cull occluded tiles in tiled layers
+ https://bugs.webkit.org/show_bug.cgi?id=70533
+
+ Reviewed by James Robinson.
+
+ Unit test provided, must pass all existing GPU layout tests.
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/cc/CCLayerImpl.cpp:
+ (WebCore::CCLayerImpl::appendQuads):
+ (WebCore::CCLayerImpl::quadTransform):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
+ (WebCore::CCLayerTreeHostImpl::calculateRenderPasses):
+ (WebCore::CCLayerTreeHostImpl::optimizeRenderPasses):
+ (WebCore::CCLayerTreeHostImpl::drawLayers):
+ * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
+ * platform/graphics/chromium/cc/CCQuadCuller.cpp: Added.
+ (std::swap):
+ (WebCore::regionContainsRect):
+ (WebCore::CCQuadCuller::cullOccludedQuads):
+ * platform/graphics/chromium/cc/CCQuadCuller.h: Added.
+ (WebCore::CCQuadCuller::CCQuadCuller):
+ * platform/graphics/chromium/cc/CCRenderPass.cpp:
+ (WebCore::CCRenderPass::optimizeQuads):
+ * platform/graphics/chromium/cc/CCRenderPass.h:
+
+2012-01-06 Anders Carlsson <andersca@apple.com>
+
+ Move more rubberbanding code into ScrollAnimatorMac::smoothScrollWithEvent
+ https://bugs.webkit.org/show_bug.cgi?id=75750
+
+ Reviewed by Sam Weinig.
+
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::handleWheelEvent):
+ Move rubberbanding related code into smoothScrollWithEvent.
+
+ (WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
+ Move code here from handleWheelEvent and made the function return a boolean.
+
+ (WebCore::ScrollAnimatorMac::snapRubberBand):
+ Call the client.
+
+ (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
+ Ditto.
+
+2012-01-06 Greg Billock <gbillock@google.com>
+
+ WebCore implementation of the Intent object
+ See http://dvcs.w3.org/hg/web-intents/raw-file/tip/spec/Overview.html
+ for draft spec.
+
+ https://bugs.webkit.org/show_bug.cgi?id=73051
+
+ Reviewed by Adam Barth.
+
+ Test: web-intents/web-intents-api.html
+
+ * WebCore.gypi:
+ * page/DOMWindow.idl:
+ * Modules/intents/Intent.cpp: Added.
+ (WebCore::Intent::Intent):
+ (WebCore::Intent::action):
+ (WebCore::Intent::setAction):
+ (WebCore::Intent::type):
+ (WebCore::Intent::setType):
+ (WebCore::Intent::data):
+ (WebCore::Intent::setData):
+ (WebCore::Intent::create):
+ * Modules/intents/Intent.h: Added.
+ * Modules/intents/Intent.idl: Added.
+
+2012-01-06 Tim Horton <timothy_horton@apple.com>
+
+ [cg] userSpaceOnUse SVG Patterns have the wrong origin
+ https://bugs.webkit.org/show_bug.cgi?id=75741
+ <rdar://problem/9383222>
+
+ Reviewed by Simon Fraser.
+
+ The transformation from pattern space to user space should use the userToBase CTM,
+ not the current CTM.
+
+ Test: svg/custom/pattern-userSpaceOnUse-userToBaseTransform.xhtml
+
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::applyStrokePattern):
+ (WebCore::GraphicsContext::applyFillPattern):
+ (WebCore::GraphicsContext::getCTM):
+ * platform/graphics/cg/TransformationMatrixCG.cpp:
+ (WebCore::AffineTransform::AffineTransform): Add a AffineTransform(CGAffineTransform) constructor
+ * platform/graphics/transforms/AffineTransform.h:
+
+2012-01-05 Simon Fraser <simon.fraser@apple.com>
+
+ Avoid falling into tiled layers more often when the device scale factor is > 1
+ <rdar://problem/10588725>
+
+ Reviewed by John Sullivan.
+
+ Stop taking the device scale factor into account when deciding to make
+ tiled layers.
+
+ Test: compositing/tiled-layers-hidpi.html
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::requiresTiledLayer):
+
+2012-01-06 Ryosuke Niwa <rniwa@webkit.org>
+
+ Touch a bunch of files in an attempt to fix Mac release builds.
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::get):
+ * accessibility/AccessibilityAllInOne.cpp:
+ * editing/visible_units.cpp:
+ (WebCore::previousBoundary):
+
+2012-01-06 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Enable a compositing trigger for filters
+ https://bugs.webkit.org/show_bug.cgi?id=75658
+
+ This will enable forcing the compositing code path when filters exist for a RenderObject.
+
+ Reviewed by Simon Fraser.
+
+ No new functionality so no new tests.
+
+ * page/ChromeClient.h:
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::requiresCompositingLayer):
+ (WebCore::RenderLayerCompositor::requiresCompositingForFilters):
+ * rendering/RenderLayerCompositor.h:
+
+2012-01-06 Anders Carlsson <andersca@apple.com>
+
+ Add and use ScrollElasticityControllerClient::absoluteScrollPosition
+ https://bugs.webkit.org/show_bug.cgi?id=75744
+
+ Reviewed by Dan Bernstein.
+
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::absoluteScrollPosition):
+ (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
+ * platform/mac/ScrollElasticityController.h:
+
+2012-01-06 Adam Barth <abarth@webkit.org>
+
+ Move FrameDestructionObserver to its own file
+ https://bugs.webkit.org/show_bug.cgi?id=75693
+
+ Reviewed by Eric Seidel.
+
+ We should have one class per file, on general principles. Also, this
+ make it possible to use this class in DOMWindow without introducing a
+ circular include dependency.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * page/Frame.cpp:
+ * page/Frame.h:
+ * page/FrameDestructionObserver.cpp: Added.
+ (WebCore::FrameDestructionObserver::FrameDestructionObserver):
+ (WebCore::FrameDestructionObserver::~FrameDestructionObserver):
+ (WebCore::FrameDestructionObserver::frameDestroyed):
+ * page/FrameDestructionObserver.h: Added.
+ (WebCore::FrameDestructionObserver::frame):
+ * plugins/DOMMimeType.h:
+ * plugins/DOMPlugin.h:
+
+2012-01-06 Anders Carlsson <andersca@apple.com>
+
+ Fix Snow Leopard build.
+
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::immediateScrollBy):
+ Move the function definition inside #if ENABLE(RUBBER_BANDING).
+
+2012-01-04 Jon Lee <jonlee@apple.com>
+
+ Clicking on the cancel button on readonly and disabled search fields darkens as if the search field was editable
+ https://bugs.webkit.org/show_bug.cgi?id=69886
+ <rdar://problem/10070187>
+
+ Reviewed by Adele Peterson.
+
+ Tests: ManualTests/search-cancel-button.html
+
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::paintSearchFieldCancelButton): If the input is readonly and/or disabled, force the cell to
+ render without highlight.
+
+2012-01-06 Simon Fraser <simon.fraser@apple.com>
+
+ Mitigate scrollbar differences when running pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=67217
+
+ Reviewed by Dan Bernstein.
+
+ Export WebCore::Settings::mockScrollbarsEnabled() for DRT.
+
+ * WebCore.exp.in:
+
+2012-01-06 Tom Sepez <tsepez@chromium.org>
+
+ Pass Content-Security-Policy directives to worker threads.
+ https://bugs.webkit.org/show_bug.cgi?id=73242
+
+ Reviewed by David Levin.
+
+ Tests: http/tests/security/contentSecurityPolicy/shared-worker-connect-src-allowed.html
+ http/tests/security/contentSecurityPolicy/shared-worker-connect-src-blocked.html
+ http/tests/security/contentSecurityPolicy/worker-connect-src-allowed.html
+ http/tests/security/contentSecurityPolicy/worker-connect-src-blocked.html
+
+ * page/ContentSecurityPolicy.h:
+ (WebCore::ContentSecurityPolicy::policy):
+ (WebCore::ContentSecurityPolicy::headerType):
+ * workers/DedicatedWorkerContext.cpp:
+ (WebCore::DedicatedWorkerContext::DedicatedWorkerContext):
+ * workers/DedicatedWorkerContext.h:
+ (WebCore::DedicatedWorkerContext::create):
+ * workers/DedicatedWorkerThread.cpp:
+ (WebCore::DedicatedWorkerThread::create):
+ (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
+ (WebCore::DedicatedWorkerThread::createWorkerContext):
+ * workers/DedicatedWorkerThread.h:
+ * workers/DefaultSharedWorkerRepository.cpp:
+ (WebCore::SharedWorkerScriptLoader::notifyFinished):
+ (WebCore::DefaultSharedWorkerRepository::workerScriptLoaded):
+ * workers/DefaultSharedWorkerRepository.h:
+ * workers/SharedWorkerContext.cpp:
+ (WebCore::SharedWorkerContext::SharedWorkerContext):
+ * workers/SharedWorkerContext.h:
+ (WebCore::SharedWorkerContext::create):
+ * workers/SharedWorkerThread.cpp:
+ (WebCore::SharedWorkerThread::create):
+ (WebCore::SharedWorkerThread::SharedWorkerThread):
+ (WebCore::SharedWorkerThread::createWorkerContext):
+ * workers/SharedWorkerThread.h:
+ * workers/WorkerContext.cpp:
+ (WebCore::WorkerContext::WorkerContext):
+ * workers/WorkerContext.h:
+ * workers/WorkerMessagingProxy.cpp:
+ (WebCore::WorkerMessagingProxy::startWorkerContext):
+ * workers/WorkerThread.cpp:
+ (WebCore::WorkerThreadStartupData::create):
+ (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
+ (WebCore::WorkerThread::WorkerThread):
+ (WebCore::WorkerThread::workerThread):
+ * workers/WorkerThread.h:
+
+2012-01-06 Mihnea Ovidenie <mihnea@adobe.com>
+
+ [CSSRegions]Crash while collecting svg elements in render flow thread.
+ https://bugs.webkit.org/show_bug.cgi?id=73735
+
+ Reviewed by David Hyatt.
+
+ Tests: fast/regions/svg-doc-fragment-not-collected-expected.html
+ fast/regions/svg-doc-fragment-not-collected.html
+ fast/regions/svg-element-not-collected-expected.html
+ fast/regions/svg-element-not-collected.html
+ fast/regions/svg-root-element-collected.html
+
+ By allowing only svg root elements to be collected in a render flow thread,
+ the svg render tree is properly constructed, thus prevented a possible further crash.
+
+ * dom/NodeRenderingContext.cpp:
+ (WebCore::NodeRenderingContext::moveToFlowThreadIfNeeded):
+
+2012-01-06 Eric Carlson <eric.carlson@apple.com>
+
+ Make TextTrackCue more mutable
+ https://bugs.webkit.org/show_bug.cgi?id=72555
+
+ Reviewed by Anders Carlsson.
+
+ Test: media/track/track-cue-mutable.html
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Do nothing if the "ignore cue updates"
+ flag is set
+ (WebCore::HTMLMediaElement::textTrackAddCues): Block cue updates until all of the new cues have
+ been added, then call updateActiveTextTrackCues so update the display if necessary.
+ (WebCore::HTMLMediaElement::textTrackRemoveCues): Block cue updates until all of the new cues have
+ been removed, then call updateActiveTextTrackCues so update the display if necessary.
+ (WebCore::HTMLMediaElement::textTrackAddCue): Call updateActiveTextTrackCues so update the display if necessary.
+ (WebCore::HTMLMediaElement::textTrackRemoveCue): Ditto.
+ * html/HTMLMediaElement.h:
+ (WebCore::HTMLMediaElement::ignoreTrackDisplayUpdateRequests):
+ (WebCore::HTMLMediaElement::beginIgnoringTrackDisplayUpdateRequests):
+ (WebCore::HTMLMediaElement::endIgnoringTrackDisplayUpdateRequests):
+
+ * html/TextTrack.cpp:
+ (WebCore::TextTrack::cueWillChange): New, remove the cue from the media element because its
+ position in the interval tree is based on start and end times.
+ (WebCore::TextTrack::cueDidChange): Add the cue to the media element.
+ * html/TextTrack.h:
+
+ * html/TextTrackCue.cpp:
+ (WebCore::startKeyword): New, use a static String for the constant.
+ (WebCore::middleKeyword): Ditto.
+ (WebCore::endKeyword): Ditto.
+ (WebCore::horizontalKeyword): Ditto.
+ (WebCore::verticalKeyword): Ditto.
+ (WebCore::verticallrKeyword): Ditto.
+ (WebCore::TextTrackCue::cueWillChange): New, tell the track the cue is about to change.
+ (WebCore::TextTrackCue::cueDidChange): New, tell the track the cue has changed.
+ (WebCore::TextTrackCue::setId): New, attribute is mutable.
+ (WebCore::TextTrackCue::setStartTime): Ditto.
+ (WebCore::TextTrackCue::setEndTime): Ditto.
+ (WebCore::TextTrackCue::setPauseOnExit): Ditto.
+ (WebCore::TextTrackCue::direction): Ditto.
+ (WebCore::TextTrackCue::setDirection): Ditto.
+ (WebCore::TextTrackCue::setSnapToLines): Ditto.
+ (WebCore::TextTrackCue::setLinePosition): Ditto.
+ (WebCore::TextTrackCue::setTextPosition): Ditto.
+ (WebCore::TextTrackCue::setSize): Ditto.
+ (WebCore::TextTrackCue::alignment): Ditto.
+ (WebCore::TextTrackCue::setAlignment): Ditto.
+ (WebCore::TextTrackCue::parseSettings): Use the static strings.
+ * html/TextTrackCue.h:
+ (WebCore::TextTrackCue::id):
+ (WebCore::TextTrackCue::startTime):
+ (WebCore::TextTrackCue::endTime):
+ (WebCore::TextTrackCue::pauseOnExit):
+ * html/TextTrackCue.idl:
+
+2012-01-06 Oliver Hunt <oliver@apple.com>
+
+ DFG no longer optimises CanvasPixelArray
+ https://bugs.webkit.org/show_bug.cgi?id=75729
+
+ Reviewed by Gavin Barraclough.
+
+ Remove the custom ClassInfo for CanvasPixelArray as that is
+ defeating ByteArray optimisation, and is no longer needed
+ anyway as it was only there to change the visible name.
+
+ * bindings/js/JSImageDataCustom.cpp:
+ (WebCore::toJS):
+
+2012-01-06 Ken Buchanan <kenrb@chromium.org>
+
+ ASSERT failure due to combine-text with preceding spaces
+ https://bugs.webkit.org/show_bug.cgi?id=65147
+
+ Reviewed by David Hyatt.
+
+ A couple of ASSERTs were failing due to a parsing problem when
+ advancing an inline iterator to the next linebreak in a
+ RenderCombineText. skipLeadingWhitespace advances the iterator
+ over leading whitespace but when searching for the line break
+ nextLineBreak would call RenderCombineText::combineText(),
+ collapsing the text so that the iterator is pointing past the
+ end of it.
+
+ This patch causes combineText() to be called during
+ skipLeadingWhiteSpace before iteration over the RenderCombineText
+ begins.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::LineBreaker::nextLineBreak):
+ (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
+
+2012-01-06 Anders Carlsson <andersca@apple.com>
+
+ Make ScrollAnimatorMac::snapRubberBandTimerFired use m_scrollElasticityController in more places
+ https://bugs.webkit.org/show_bug.cgi?id=75726
+
+ Reviewed by Sam Weinig.
+
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::canScrollHorizontally):
+ (WebCore::ScrollAnimatorMac::canScrollVertically):
+ (WebCore::ScrollAnimatorMac::snapRubberBandTimerFired):
+ * platform/mac/ScrollElasticityController.h:
+
+2012-01-06 Pratik Solanki <psolanki@apple.com>
+
+ WebKit1 fails to compile with USE(CFNETWORK) and HAVE(NETWORK_CFDATA_ARRAY_CALLBACK)
+ https://bugs.webkit.org/show_bug.cgi?id=75675
+
+ Reviewed by Oliver Hunt.
+
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::willCacheResponse):
+
+2012-01-06 Abhishek Arya <inferno@chromium.org>
+
+ Crash with range selection across different documents.
+ https://bugs.webkit.org/show_bug.cgi?id=74285
+
+ Reviewed by Ryosuke Niwa.
+
+ Test: fast/dom/Range/range-selection-across-documents-crash.html
+
+ * page/DOMSelection.cpp:
+ (WebCore::DOMSelection::addRange):
+
+2012-01-06 Sam Weinig <sam@webkit.org>
+
+ Remove unused OwnFastMallocPtr class.
+ https://bugs.webkit.org/show_bug.cgi?id=75722
+
+ Reviewed by Geoffrey Garen.
+
+ * ForwardingHeaders/wtf/OwnFastMallocPtr.h: Removed.
+ * bindings/js/JSWebGLRenderingContextCustom.cpp:
+
+2012-01-06 Tony Chang <tony@chromium.org>
+
+ Need to relayout when stretching the height of a flex item
+ https://bugs.webkit.org/show_bug.cgi?id=75661
+
+ Reviewed by Ojan Vafai.
+
+ Test: css3/flexbox/flex-align-stretch.html
+
+ * rendering/RenderFlexibleBox.cpp:
+ (WebCore::RenderFlexibleBox::computePreferredMainAxisExtent): Always clear the override size since
+ it may be set when aligning.
+ (WebCore::RenderFlexibleBox::alignChildren): Only relayout if the height changed.
+
+2012-01-06 Anders Carlsson <andersca@apple.com>
+
+ Add ScrollElasticityControllerClient::immediateScrollBy
+ https://bugs.webkit.org/show_bug.cgi?id=75720
+
+ Reviewed by Andreas Kling.
+
+ Add a new ScrollElasticityControllerClient::immediateScrollBy client member function.
+ Also, make ScrollAnimatorMac::smoothScrollWithEvent calls go through the ScrollElasticityController
+ in preparation for moving that function to ScrollElasticityController.
+
+ * platform/mac/ScrollAnimatorMac.h:
+ * platform/mac/ScrollAnimatorMac.mm:
+ (WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
+ * platform/mac/ScrollElasticityController.h:
+
+2012-01-06 Wei James <james.wei@intel.com>
+
+ Use VectorMath lib when possible to optimize the processing in WebAudio AudioBus
+ https://bugs.webkit.org/show_bug.cgi?id=75334
+
+ Reviewed by Kenneth Russell.
+
+ * platform/audio/AudioBus.cpp:
+ (WebCore::AudioBus::processWithGainFromMonoStereo):
+
+2012-01-06 Jer Noble <jer.noble@apple.com>
+
+ Fullscreen video controller can't be dragged the first time I enter fullscreen
+ https://bugs.webkit.org/show_bug.cgi?id=75709
+
+ Reviewed by Eric Carlson.
+
+ No new tests; updated video-controls-drag.html.
+
+ When the media controls are created, check to see if we are full screen, and pass
+ that information to the newly created controls.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::createMediaControls):
+
+2012-01-05 Jer Noble <jer.noble@apple.com>
+
+ Media Element: scrubbing in full-screen mode breaks playback.
+ https://bugs.webkit.org/show_bug.cgi?id=75650
+
+ Reviewed by John Sullivan.
+
+ Test: fullscreen/video-controls-timeline.html
+
+ Only begin scrubbing if the panel itself is the mousedown event target.
+
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlPanelElement::defaultEventHandler):
+
+2012-01-05 Jer Noble <jer.noble@apple.com>
+
+ REGRESSION (r90797): Full screen video HUD cannot be dragged horizontally
+ https://bugs.webkit.org/show_bug.cgi?id=75200
+
+ Reviewed by Eric Carlson.
+
+ Test: fullscreen/video-controls-drag.html
+
+ The !important rules in fullscreenQuickTime.css are overriding the styles added by the
+ drag operation in MediaControlElements.cpp. Give the panel a "dragged" class in setPosition
+ (clearing it in resetPosition) that allows the !important rules to apply only when the
+ panel is not dragged.
+
+ * css/fullscreenQuickTime.css:
+ (video:-webkit-full-screen::-webkit-media-controls-panel):
+ (video:-webkit-full-screen::-webkit-media-controls-panel:not(.dragged)):
+ * html/shadow/MediaControlElements.cpp:
+ (WebCore::MediaControlPanelElement::setPosition):
+ (WebCore::MediaControlPanelElement::resetPosition):
+
2012-01-05 Antti Koivisto <antti@apple.com>
REGRESSION (r104060): fast/forms/textarea-metrics.html is failing
diff --git a/Source/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make
index 85cb0bfbf..f75a8906b 100644
--- a/Source/WebCore/DerivedSources.make
+++ b/Source/WebCore/DerivedSources.make
@@ -336,6 +336,7 @@ BINDING_IDLS = \
$(WebCore)/plugins/DOMMimeTypeArray.idl \
$(WebCore)/plugins/DOMPlugin.idl \
$(WebCore)/plugins/DOMPluginArray.idl \
+ $(WebCore)/storage/DOMWindowSQLDatabase.idl \
$(WebCore)/storage/Database.idl \
$(WebCore)/storage/DatabaseCallback.idl \
$(WebCore)/storage/DatabaseSync.idl \
diff --git a/Source/WebCore/DerivedSources.pri b/Source/WebCore/DerivedSources.pri
index b69b744ad..0335b3878 100644
--- a/Source/WebCore/DerivedSources.pri
+++ b/Source/WebCore/DerivedSources.pri
@@ -365,6 +365,7 @@ IDL_BINDINGS += \
plugins/DOMMimeType.idl \
plugins/DOMPluginArray.idl \
plugins/DOMMimeTypeArray.idl \
+ storage/DOMWindowSQLDatabase.idl \
storage/Database.idl \
storage/DatabaseCallback.idl \
storage/DatabaseSync.idl \
diff --git a/Source/WebCore/English.lproj/localizedStrings.js b/Source/WebCore/English.lproj/localizedStrings.js
index 2f8cb79bd..693b4732b 100644
--- a/Source/WebCore/English.lproj/localizedStrings.js
+++ b/Source/WebCore/English.lproj/localizedStrings.js
Binary files differ
diff --git a/Source/WebCore/ForwardingHeaders/wtf/OwnFastMallocPtr.h b/Source/WebCore/ForwardingHeaders/wtf/OwnFastMallocPtr.h
deleted file mode 100644
index 036d80138..000000000
--- a/Source/WebCore/ForwardingHeaders/wtf/OwnFastMallocPtr.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <JavaScriptCore/OwnFastMallocPtr.h>
diff --git a/Source/WebCore/GNUmakefile.am b/Source/WebCore/GNUmakefile.am
index ebb8cdf47..0943e707a 100644
--- a/Source/WebCore/GNUmakefile.am
+++ b/Source/WebCore/GNUmakefile.am
@@ -545,16 +545,13 @@ webcore_cppflags += -DENABLE_WEBGL=1
endif # END ENABLE_WEBGL
# ---
-# 3D rendering (CSS3 3D transforms) support
-# ---
-if ENABLE_3D_RENDERING
-FEATURE_DEFINES += ENABLE_3D_RENDERING=1
-webcore_cppflags += -DENABLE_3D_RENDERING=1
-endif # END ENABLE_3D_RENDERING
-
-# ---
-# Compile with accelerated compositing support
+# Accelerated compositing support
# ---
+if USE_ACCELERATED_COMPOSITING
+FEATURE_DEFINES += \
+ ENABLE_3D_RENDERING=1 \
+ ACCELERATED_COMPOSITING=1
+endif # END USE_ACCELERATED_COMPOSITING
if USE_TEXTURE_MAPPER_CAIRO
webcore_cppflags += \
diff --git a/Source/WebCore/GNUmakefile.list.am b/Source/WebCore/GNUmakefile.list.am
index 7c4a96a9f..2b10011ce 100644
--- a/Source/WebCore/GNUmakefile.list.am
+++ b/Source/WebCore/GNUmakefile.list.am
@@ -1674,6 +1674,8 @@ webcore_sources += \
Source/WebCore/dom/TreeDepthLimit.h \
Source/WebCore/dom/TreeScope.cpp \
Source/WebCore/dom/TreeScope.h \
+ Source/WebCore/dom/TreeScopeAdopter.cpp \
+ Source/WebCore/dom/TreeScopeAdopter.h \
Source/WebCore/dom/TreeWalker.cpp \
Source/WebCore/dom/TreeWalker.h \
Source/WebCore/dom/UIEvent.cpp \
@@ -2325,6 +2327,8 @@ webcore_sources += \
Source/WebCore/inspector/ConsoleMessage.h \
Source/WebCore/inspector/ContentSearchUtils.cpp \
Source/WebCore/inspector/ContentSearchUtils.h \
+ Source/WebCore/inspector/DOMEditor.cpp \
+ Source/WebCore/inspector/DOMEditor.h \
Source/WebCore/inspector/DOMNodeHighlighter.cpp \
Source/WebCore/inspector/DOMNodeHighlighter.h \
Source/WebCore/inspector/DOMWrapperVisitor.h \
@@ -2646,6 +2650,8 @@ webcore_sources += \
Source/WebCore/page/DOMTimer.h \
Source/WebCore/page/DOMWindow.cpp \
Source/WebCore/page/DOMWindow.h \
+ Source/WebCore/page/DOMWindowProperty.cpp \
+ Source/WebCore/page/DOMWindowProperty.h \
Source/WebCore/page/DragActions.h \
Source/WebCore/page/DragClient.h \
Source/WebCore/page/DragController.cpp \
@@ -2664,6 +2670,8 @@ webcore_sources += \
Source/WebCore/page/Frame.h \
Source/WebCore/page/FrameActionScheduler.cpp \
Source/WebCore/page/FrameActionScheduler.h \
+ Source/WebCore/page/FrameDestructionObserver.cpp \
+ Source/WebCore/page/FrameDestructionObserver.h \
Source/WebCore/page/FrameTree.cpp \
Source/WebCore/page/FrameTree.h \
Source/WebCore/page/FrameView.cpp \
@@ -2954,6 +2962,7 @@ webcore_sources += \
Source/WebCore/platform/graphics/GraphicsContext.h \
Source/WebCore/platform/graphics/GraphicsLayer.h \
Source/WebCore/platform/graphics/GraphicsLayer.cpp \
+ Source/WebCore/platform/graphics/GraphicsLayerClient.h \
Source/WebCore/platform/graphics/GraphicsTypes.cpp \
Source/WebCore/platform/graphics/GraphicsTypes.h \
Source/WebCore/platform/graphics/GraphicsTypes3D.h \
@@ -3745,6 +3754,8 @@ webcore_sources += \
Source/WebCore/storage/AbstractDatabase.h \
Source/WebCore/storage/ChangeVersionWrapper.cpp \
Source/WebCore/storage/ChangeVersionWrapper.h \
+ Source/WebCore/storage/DOMWindowSQLDatabase.cpp \
+ Source/WebCore/storage/DOMWindowSQLDatabase.h \
Source/WebCore/storage/DatabaseAuthorizer.cpp \
Source/WebCore/storage/DatabaseAuthorizer.h \
Source/WebCore/storage/DatabaseCallback.h \
@@ -4591,6 +4602,7 @@ webcore_built_sources += \
DerivedSources/WebCore/JSSQLTransactionSyncCallback.h
dom_binding_idls += \
+ $(WebCore)/storage/DOMWindowSQLDatabase.idl \
$(WebCore)/storage/Database.idl \
$(WebCore)/storage/DatabaseCallback.idl \
$(WebCore)/storage/DatabaseSync.idl \
@@ -5451,12 +5463,16 @@ webcore_built_sources += \
webcore_sources += \
Source/ThirdParty/ANGLE/include/GLSLANG/ShaderLang.h \
Source/ThirdParty/ANGLE/src/compiler/BaseTypes.h \
+ Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.cpp \
+ Source/ThirdParty/ANGLE/src/compiler/BuiltInFunctionEmulator.h \
Source/ThirdParty/ANGLE/src/compiler/CodeGenGLSL.cpp \
Source/ThirdParty/ANGLE/src/compiler/Common.h \
Source/ThirdParty/ANGLE/src/compiler/Compiler.cpp \
Source/ThirdParty/ANGLE/src/compiler/ConstantUnion.h \
Source/ThirdParty/ANGLE/src/compiler/debug.cpp \
Source/ThirdParty/ANGLE/src/compiler/debug.h \
+ Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.cpp \
+ Source/ThirdParty/ANGLE/src/compiler/DetectRecursion.h \
Source/ThirdParty/ANGLE/src/compiler/ExtensionBehavior.h \
Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.cpp \
Source/ThirdParty/ANGLE/src/compiler/ForLoopUnroll.h \
@@ -5498,6 +5514,7 @@ webcore_sources += \
Source/ThirdParty/ANGLE/src/compiler/preprocessor/cpp.c \
Source/ThirdParty/ANGLE/src/compiler/preprocessor/cpp.h \
Source/ThirdParty/ANGLE/src/compiler/preprocessor/cppstruct.c \
+ Source/ThirdParty/ANGLE/src/compiler/preprocessor/length_limits.h \
Source/ThirdParty/ANGLE/src/compiler/preprocessor/memory.c \
Source/ThirdParty/ANGLE/src/compiler/preprocessor/memory.h \
Source/ThirdParty/ANGLE/src/compiler/preprocessor/parser.h \
@@ -5631,7 +5648,7 @@ webcore_sources += \
endif # END ENABLE_REQUEST_ANIMATION_FRAME
# ---
-# Compile with accelerated compositing support
+# Accelerated compositing support
# ---
if USE_ACCELERATED_COMPOSITING
if USE_CLUTTER
@@ -5646,6 +5663,7 @@ if USE_TEXTURE_MAPPER_CAIRO
webcore_sources += \
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp \
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h \
+ Source/WebCore/platform/graphics/texmap/TextureMapper.cpp \
Source/WebCore/platform/graphics/texmap/TextureMapper.h \
Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp \
Source/WebCore/platform/graphics/texmap/TextureMapperNode.h \
@@ -5661,6 +5679,7 @@ webcore_sources += \
Source/WebCore/platform/graphics/opengl/TextureMapperGL.h \
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp \
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h \
+ Source/WebCore/platform/graphics/texmap/TextureMapper.cpp \
Source/WebCore/platform/graphics/texmap/TextureMapper.h \
Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp \
Source/WebCore/platform/graphics/texmap/TextureMapperNode.h \
diff --git a/Source/WebCore/Modules/intents/Intent.cpp b/Source/WebCore/Modules/intents/Intent.cpp
new file mode 100644
index 000000000..60a3248b0
--- /dev/null
+++ b/Source/WebCore/Modules/intents/Intent.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Google, Inc. ("Google") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Intent.h"
+
+#if ENABLE(WEB_INTENTS)
+
+#include "ExceptionCode.h"
+#include "SerializedScriptValue.h"
+
+namespace WebCore {
+
+PassRefPtr<Intent> Intent::create(const String& action, const String& type, PassRefPtr<SerializedScriptValue> data, ExceptionCode& ec)
+{
+ if (action.isEmpty()) {
+ ec = SYNTAX_ERR;
+ return 0;
+ }
+ if (type.isEmpty()) {
+ ec = SYNTAX_ERR;
+ return 0;
+ }
+
+ return adoptRef(new Intent(action, type, data));
+}
+
+Intent::Intent(const String& action, const String& type, PassRefPtr<SerializedScriptValue> data)
+ : m_action(action)
+ , m_type(type)
+{
+ if (data)
+ m_data = SerializedScriptValue::createFromWire(data->toWireString());
+ else
+ m_data = SerializedScriptValue::nullValue();
+}
+
+const String& Intent::action() const
+{
+ return m_action;
+}
+
+const String& Intent::type() const
+{
+ return m_type;
+}
+
+SerializedScriptValue* Intent::data() const
+{
+ return m_data.get();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_INTENTS)
diff --git a/Source/WebCore/Modules/intents/Intent.h b/Source/WebCore/Modules/intents/Intent.h
new file mode 100644
index 000000000..96bebd6e5
--- /dev/null
+++ b/Source/WebCore/Modules/intents/Intent.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Google, Inc. ("Google") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Intent_h
+#define Intent_h
+
+#if ENABLE(WEB_INTENTS)
+
+#include <wtf/Forward.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class SerializedScriptValue;
+
+typedef int ExceptionCode;
+
+class Intent : public RefCounted<Intent> {
+public:
+ static PassRefPtr<Intent> create(const String& action, const String& type, PassRefPtr<SerializedScriptValue> data, ExceptionCode&);
+
+ const String& action() const;
+ const String& type() const;
+ SerializedScriptValue* data() const;
+
+ int identifier() const;
+ void setIdentifier(int);
+
+private:
+ Intent(const String& action, const String& type, PassRefPtr<SerializedScriptValue> data);
+
+ String m_action;
+ String m_type;
+ RefPtr<SerializedScriptValue> m_data;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // Intent_h
diff --git a/Source/WebCore/Modules/intents/Intent.idl b/Source/WebCore/Modules/intents/Intent.idl
new file mode 100644
index 000000000..33657f4c8
--- /dev/null
+++ b/Source/WebCore/Modules/intents/Intent.idl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module window {
+ interface [
+ Conditional=WEB_INTENTS,
+ Constructor(in DOMString action, in DOMString type, in [Optional=CallWithNullValue] SerializedScriptValue data),
+ ConstructorRaisesException
+ ] Intent {
+ readonly attribute DOMString action;
+ readonly attribute DOMString type;
+ readonly attribute SerializedScriptValue data;
+ };
+}
diff --git a/Source/WebCore/Modules/intents/IntentRequest.cpp b/Source/WebCore/Modules/intents/IntentRequest.cpp
new file mode 100644
index 000000000..eeca4af29
--- /dev/null
+++ b/Source/WebCore/Modules/intents/IntentRequest.cpp
@@ -0,0 +1,104 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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 Google, Inc. ("Google") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "IntentRequest.h"
+
+#if ENABLE(WEB_INTENTS)
+
+#include "ScriptExecutionContext.h"
+#include "SerializedScriptValue.h"
+
+namespace WebCore {
+
+PassRefPtr<IntentRequest> IntentRequest::create(ScriptExecutionContext* context,
+ PassRefPtr<Intent> intent,
+ PassRefPtr<IntentResultCallback> successCallback,
+ PassRefPtr<IntentResultCallback> errorCallback)
+{
+ return adoptRef(new IntentRequest(context, intent, successCallback, errorCallback));
+}
+
+IntentRequest::IntentRequest(ScriptExecutionContext* context,
+ PassRefPtr<Intent> intent,
+ PassRefPtr<IntentResultCallback> successCallback,
+ PassRefPtr<IntentResultCallback> errorCallback)
+ : ActiveDOMObject(context, this)
+ , m_intent(intent)
+ , m_successCallback(successCallback)
+ , m_errorCallback(errorCallback)
+{
+ setPendingActivity(this);
+}
+
+void IntentRequest::contextDestroyed()
+{
+ ContextDestructionObserver::contextDestroyed();
+ m_successCallback.clear();
+ m_errorCallback.clear();
+}
+
+void IntentRequest::stop()
+{
+ m_successCallback.clear();
+ m_errorCallback.clear();
+}
+
+void IntentRequest::postResult(SerializedScriptValue* data)
+{
+ // Callback could lead to deletion of this.
+ RefPtr<IntentRequest> protector(this);
+
+ if (!m_successCallback)
+ return;
+
+ m_successCallback->handleEvent(data);
+
+ m_successCallback.clear();
+ m_errorCallback.clear();
+ unsetPendingActivity(this);
+}
+
+void IntentRequest::postFailure(SerializedScriptValue* data)
+{
+ // Callback could lead to deletion of this.
+ RefPtr<IntentRequest> protector(this);
+
+ if (!m_errorCallback)
+ return;
+
+ m_errorCallback->handleEvent(data);
+
+ m_successCallback.clear();
+ m_errorCallback.clear();
+ unsetPendingActivity(this);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_INTENTS)
diff --git a/Source/WebCore/Modules/intents/IntentRequest.h b/Source/WebCore/Modules/intents/IntentRequest.h
new file mode 100644
index 000000000..7a809a98e
--- /dev/null
+++ b/Source/WebCore/Modules/intents/IntentRequest.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Google, Inc. ("Google") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntentRequest_h
+#define IntentRequest_h
+
+#if ENABLE(WEB_INTENTS)
+
+#include "ActiveDOMObject.h"
+#include "Intent.h"
+#include "IntentResultCallback.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class ScriptExecutionContext;
+
+class IntentRequest : public RefCounted<IntentRequest>, public ActiveDOMObject {
+public:
+ static PassRefPtr<IntentRequest> create(ScriptExecutionContext*, PassRefPtr<Intent>, PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback);
+
+ Intent* intent() { return m_intent.get(); }
+
+ void postResult(SerializedScriptValue*);
+ void postFailure(SerializedScriptValue*);
+
+ virtual void contextDestroyed() OVERRIDE;
+
+ virtual void stop() OVERRIDE;
+
+private:
+ IntentRequest(ScriptExecutionContext*, PassRefPtr<Intent>, PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback);
+
+ RefPtr<Intent> m_intent;
+ RefPtr<IntentResultCallback> m_successCallback;
+ RefPtr<IntentResultCallback> m_errorCallback;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IntentRequest_h
diff --git a/Source/WebCore/Modules/intents/IntentResultCallback.h b/Source/WebCore/Modules/intents/IntentResultCallback.h
new file mode 100644
index 000000000..e4cdeb049
--- /dev/null
+++ b/Source/WebCore/Modules/intents/IntentResultCallback.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Google, Inc. ("Google") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef IntentResultCallback_h
+#define IntentResultCallback_h
+
+#if ENABLE(WEB_INTENTS)
+
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class SerializedScriptValue;
+
+class IntentResultCallback : public RefCounted<IntentResultCallback> {
+public:
+ virtual ~IntentResultCallback() { }
+ virtual bool handleEvent(SerializedScriptValue* result) = 0;
+};
+
+}
+
+#endif
+
+#endif // IntentResultCallback_h
diff --git a/Source/WebKit/chromium/public/platform/WebMimeRegistry.h b/Source/WebCore/Modules/intents/IntentResultCallback.idl
index 4137b0756..feb4a3cc6 100644
--- a/Source/WebKit/chromium/public/platform/WebMimeRegistry.h
+++ b/Source/WebCore/Modules/intents/IntentResultCallback.idl
@@ -23,7 +23,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-// This is a temporary forwarding header to ease the Platform transition for downstream users of the WebKit API.
-// See https://bugs.webkit.org/show_bug.cgi?id=74583
-// FIXME: Remove as soon as downstream clients are updated.
-#include "../../../../Platform/chromium/public/WebMimeRegistry.h"
+module window {
+ interface [
+ Conditional=WEB_INTENTS,
+ Callback=FunctionOnly
+ ] IntentResultCallback {
+ boolean handleEvent(in SerializedScriptValue result);
+ };
+}
diff --git a/Source/WebCore/Modules/intents/NavigatorIntents.cpp b/Source/WebCore/Modules/intents/NavigatorIntents.cpp
new file mode 100644
index 000000000..b5636fd78
--- /dev/null
+++ b/Source/WebCore/Modules/intents/NavigatorIntents.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2011, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigatorIntents.h"
+
+#if ENABLE(WEB_INTENTS)
+
+#include "Document.h"
+#include "ExceptionCode.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
+#include "Intent.h"
+#include "IntentRequest.h"
+#include "IntentResultCallback.h"
+#include "Navigator.h"
+#include "ScriptController.h"
+
+namespace WebCore {
+
+NavigatorIntents::NavigatorIntents()
+{
+}
+
+NavigatorIntents::~NavigatorIntents()
+{
+}
+
+void NavigatorIntents::startActivity(Navigator* navigator,
+ PassRefPtr<Intent> intent,
+ PassRefPtr<IntentResultCallback> successCallback,
+ PassRefPtr<IntentResultCallback> errorCallback,
+ ExceptionCode& ec)
+{
+ if (!navigator->frame() || !intent) {
+ ec = INVALID_STATE_ERR;
+ return;
+ }
+
+ if (intent->action().isEmpty() || intent->type().isEmpty()) {
+ ec = VALIDATION_ERR;
+ return;
+ }
+
+ if (!ScriptController::processingUserGesture()) {
+ ec = INVALID_ACCESS_ERR;
+ return;
+ }
+
+ RefPtr<IntentRequest> request = IntentRequest::create(navigator->frame()->document(),
+ intent, successCallback, errorCallback);
+ navigator->frame()->loader()->client()->dispatchIntent(request);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_INTENTS)
diff --git a/Source/WebCore/Modules/intents/NavigatorIntents.h b/Source/WebCore/Modules/intents/NavigatorIntents.h
new file mode 100644
index 000000000..af227c260
--- /dev/null
+++ b/Source/WebCore/Modules/intents/NavigatorIntents.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011, Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ */
+
+#ifndef NavigatorIntents_h
+#define NavigatorIntents_h
+
+#if ENABLE(WEB_INTENTS)
+
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+class Intent;
+class IntentResultCallback;
+class Navigator;
+
+typedef int ExceptionCode;
+
+class NavigatorIntents {
+public:
+ static void startActivity(Navigator*, PassRefPtr<Intent>, PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback, ExceptionCode&);
+
+private:
+ NavigatorIntents();
+ ~NavigatorIntents();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_INTENTS)
+
+#endif // NavigatorIntents_h
diff --git a/Source/WebCore/Modules/intents/NavigatorIntents.idl b/Source/WebCore/Modules/intents/NavigatorIntents.idl
new file mode 100644
index 000000000..755f58e1a
--- /dev/null
+++ b/Source/WebCore/Modules/intents/NavigatorIntents.idl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011 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.
+ */
+
+module window {
+
+ interface [
+ Conditional=WEB_INTENTS,
+ Supplemental=Navigator
+ ] NavigatorIntents {
+ void startActivity(in Intent intent,
+ in [Callback=FunctionOnly, Optional] IntentResultCallback successCallback,
+ in [Callback=FunctionOnly, Optional] IntentResultCallback failureCallback)
+ raises(DOMException);
+ };
+
+}
diff --git a/Source/WebCore/Target.pri b/Source/WebCore/Target.pri
index 68b9fe0ce..5db851ad4 100644
--- a/Source/WebCore/Target.pri
+++ b/Source/WebCore/Target.pri
@@ -574,6 +574,7 @@ SOURCES += \
dom/TouchList.cpp \
dom/Traversal.cpp \
dom/TreeScope.cpp \
+ dom/TreeScopeAdopter.cpp \
dom/TreeWalker.cpp \
dom/UIEvent.cpp \
dom/UIEventWithKeyState.cpp \
@@ -848,6 +849,7 @@ SOURCES += \
html/shadow/TextControlInnerElements.cpp \
inspector/ConsoleMessage.cpp \
inspector/ContentSearchUtils.cpp \
+ inspector/DOMEditor.cpp \
inspector/DOMNodeHighlighter.cpp \
inspector/IdentifiersFactory.cpp \
inspector/InjectedScript.cpp \
@@ -967,12 +969,14 @@ SOURCES += \
page/DOMSelection.cpp \
page/DOMTimer.cpp \
page/DOMWindow.cpp \
+ page/DOMWindowProperty.cpp \
page/DragController.cpp \
page/EventHandler.cpp \
page/EventSource.cpp \
page/FocusController.cpp \
page/Frame.cpp \
page/FrameActionScheduler.cpp \
+ page/FrameDestructionObserver.cpp \
page/FrameTree.cpp \
page/FrameView.cpp \
page/Geolocation.cpp \
@@ -1168,6 +1172,7 @@ SOURCES += \
rendering/BidiRun.cpp \
rendering/CounterNode.cpp \
rendering/EllipsisBox.cpp \
+ rendering/FilterEffectRenderer.cpp \
rendering/FixedTableLayout.cpp \
rendering/HitTestingTransformState.cpp \
rendering/HitTestResult.cpp \
@@ -1274,6 +1279,7 @@ SOURCES += \
rendering/style/StyleTransformData.cpp \
rendering/style/StyleVisualData.cpp \
storage/AbstractDatabase.cpp \
+ storage/DOMWindowSQLDatabase.cpp \
storage/Database.cpp \
storage/DatabaseAuthorizer.cpp \
storage/DatabaseSync.cpp \
@@ -1671,6 +1677,7 @@ HEADERS += \
dom/Traversal.h \
dom/TreeDepthLimit.h \
dom/TreeScope.h \
+ dom/TreeScopeAdopter.h \
dom/TreeWalker.h \
dom/UIEvent.h \
dom/UIEventWithKeyState.h \
@@ -1902,6 +1909,7 @@ HEADERS += \
html/track/WebVTTTokenizer.h \
inspector/ConsoleMessage.h \
inspector/ContentSearchUtils.h \
+ inspector/DOMEditor.h \
inspector/DOMNodeHighlighter.h \
inspector/DOMWrapperVisitor.h \
inspector/IdentifiersFactory.h \
@@ -2282,6 +2290,7 @@ HEADERS += \
rendering/break_lines.h \
rendering/CounterNode.h \
rendering/EllipsisBox.h \
+ rendering/FilterEffectRenderer.h \
rendering/FixedTableLayout.h \
rendering/HitTestingTransformState.h \
rendering/HitTestResult.h \
@@ -2465,6 +2474,7 @@ HEADERS += \
rendering/svg/SVGTextRunRenderingContext.h \
storage/AbstractDatabase.h \
storage/ChangeVersionWrapper.h \
+ storage/DOMWindowSQLDatabase.h \
storage/DatabaseAuthorizer.h \
storage/Database.h \
storage/DatabaseCallback.h \
@@ -3733,9 +3743,11 @@ contains(DEFINES, ENABLE_WEBGL=1) {
ANGLE_HEADERS += \
$$ANGLE_DIR/src/compiler/BaseTypes.h \
+ $$ANGLE_DIR/src/compiler/BuiltInFunctionEmulator.h \
$$ANGLE_DIR/src/compiler/Common.h \
$$ANGLE_DIR/src/compiler/ConstantUnion.h \
$$ANGLE_DIR/src/compiler/debug.h \
+ $$ANGLE_DIR/src/compiler/DetectRecursion.h \
$$ANGLE_DIR/src/compiler/ExtensionBehavior.h \
$$ANGLE_DIR/src/compiler/ForLoopUnroll.h \
$$ANGLE_DIR/src/compiler/glslang.h \
@@ -3753,6 +3765,7 @@ contains(DEFINES, ENABLE_WEBGL=1) {
$$ANGLE_DIR/src/compiler/preprocessor/atom.h \
$$ANGLE_DIR/src/compiler/preprocessor/compile.h \
$$ANGLE_DIR/src/compiler/preprocessor/cpp.h \
+ $$ANGLE_DIR/src/compiler/preprocessor/length_limits.h \
$$ANGLE_DIR/src/compiler/preprocessor/memory.h \
$$ANGLE_DIR/src/compiler/preprocessor/parser.h \
$$ANGLE_DIR/src/compiler/preprocessor/preprocess.h \
@@ -3784,9 +3797,11 @@ contains(DEFINES, ENABLE_WEBGL=1) {
HEADERS += $$ANGLE_HEADERS
ANGLE_SOURCES += \
+ $$ANGLE_DIR/src/compiler/BuiltInFunctionEmulator.cpp \
$$ANGLE_DIR/src/compiler/CodeGenGLSL.cpp \
$$ANGLE_DIR/src/compiler/Compiler.cpp \
$$ANGLE_DIR/src/compiler/debug.cpp \
+ $$ANGLE_DIR/src/compiler/DetectRecursion.cpp \
$$ANGLE_DIR/src/compiler/ForLoopUnroll.cpp \
$$ANGLE_DIR/src/compiler/glslang_lex.cpp \
$$ANGLE_DIR/src/compiler/glslang_tab.cpp \
@@ -3898,6 +3913,7 @@ contains(CONFIG, texmap) {
SOURCES += \
platform/graphics/qt/TextureMapperQt.cpp \
+ platform/graphics/texmap/TextureMapper.cpp \
platform/graphics/texmap/TextureMapperNode.cpp \
platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in
index a2a056415..0989a2558 100644
--- a/Source/WebCore/WebCore.exp.in
+++ b/Source/WebCore/WebCore.exp.in
@@ -943,6 +943,7 @@ __ZN7WebCore8Settings19setShowDebugBordersEb
__ZN7WebCore8Settings20setCursiveFontFamilyERKN3WTF12AtomicStringE11UScriptCode
__ZN7WebCore8Settings20setFantasyFontFamilyERKN3WTF12AtomicStringE11UScriptCode
__ZN7WebCore8Settings20setXSSAuditorEnabledEb
+__ZN7WebCore8Settings21mockScrollbarsEnabledEv
__ZN7WebCore8Settings21setShowRepaintCounterEb
__ZN7WebCore8Settings21setStandardFontFamilyERKN3WTF12AtomicStringE11UScriptCode
__ZN7WebCore8Settings21setWebSecurityEnabledEb
@@ -1324,8 +1325,14 @@ __ZNK7WebCore4KURL11isLocalFileEv
__ZNK7WebCore4KURL12baseAsStringEv
__ZNK7WebCore4KURL14fileSystemPathEv
__ZNK7WebCore4KURL17lastPathComponentEv
+__ZNK7WebCore4KURL18fragmentIdentifierEv
+__ZNK7WebCore4KURL21hasFragmentIdentifierEv
__ZNK7WebCore4KURL4hostEv
+__ZNK7WebCore4KURL4passEv
__ZNK7WebCore4KURL4pathEv
+__ZNK7WebCore4KURL4portEv
+__ZNK7WebCore4KURL4userEv
+__ZNK7WebCore4KURL5queryEv
__ZNK7WebCore4KURL8protocolEv
__ZNK7WebCore4KURLcvP5NSURLEv
__ZNK7WebCore4Node14isDescendantOfEPKS0_
@@ -1406,7 +1413,6 @@ __ZNK7WebCore8Document13axObjectCacheEv
__ZNK7WebCore8Document13nodesFromRectEiijjjjb
__ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
__ZNK7WebCore8Document16dashboardRegionsEv
-__ZNK7WebCore8Document20cacheDocumentElementEv
__ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
__ZNK7WebCore8Document4bodyEv
__ZNK7WebCore8Document4pageEv
diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp
index a24b448f4..5d2b95c78 100644
--- a/Source/WebCore/WebCore.gyp/WebCore.gyp
+++ b/Source/WebCore/WebCore.gyp/WebCore.gyp
@@ -51,6 +51,7 @@
'../',
'../..',
'../Modules/gamepad',
+ '../Modules/intents',
'../accessibility',
'../accessibility/chromium',
'../bindings',
diff --git a/Source/WebCore/WebCore.gypi b/Source/WebCore/WebCore.gypi
index f355868d5..dea8224bf 100644
--- a/Source/WebCore/WebCore.gypi
+++ b/Source/WebCore/WebCore.gypi
@@ -1149,6 +1149,9 @@
'Modules/gamepad/Gamepad.idl',
'Modules/gamepad/GamepadList.idl',
'Modules/gamepad/NavigatorGamepad.idl',
+ 'Modules/intents/Intent.idl',
+ 'Modules/intents/IntentResultCallback.idl',
+ 'Modules/intents/NavigatorIntents.idl',
'css/CSSCharsetRule.idl',
'css/CSSFontFaceRule.idl',
'css/CSSImportRule.idl',
@@ -1449,6 +1452,7 @@
'plugins/DOMMimeTypeArray.idl',
'plugins/DOMPlugin.idl',
'plugins/DOMPluginArray.idl',
+ 'storage/DOMWindowSQLDatabase.idl',
'storage/Database.idl',
'storage/DatabaseCallback.idl',
'storage/DatabaseSync.idl',
@@ -1695,6 +1699,13 @@
'Modules/gamepad/GamepadList.h',
'Modules/gamepad/NavigatorGamepad.cpp',
'Modules/gamepad/NavigatorGamepad.h',
+ 'Modules/intents/Intent.cpp',
+ 'Modules/intents/Intent.h',
+ 'Modules/intents/IntentRequest.cpp',
+ 'Modules/intents/IntentRequest.h',
+ 'Modules/intents/IntentResultCallback.h',
+ 'Modules/intents/NavigatorIntents.cpp',
+ 'Modules/intents/NavigatorIntents.h',
'accessibility/AXObjectCache.cpp',
'accessibility/AccessibilityARIAGrid.cpp',
'accessibility/AccessibilityARIAGrid.h',
@@ -2323,15 +2334,6 @@
'bridge/jni/jsc/JavaRuntimeObject.cpp',
'bridge/jni/jsc/JavaRuntimeObject.h',
'bridge/jni/jsc/JavaStringJSC.h',
- 'bridge/jni/v8/JNIUtilityPrivate.cpp',
- 'bridge/jni/v8/JNIUtilityPrivate.h',
- 'bridge/jni/v8/JavaClassV8.h',
- 'bridge/jni/v8/JavaFieldV8.h',
- 'bridge/jni/v8/JavaInstanceV8.h',
- 'bridge/jni/v8/JavaMethodV8.h',
- 'bridge/jni/v8/JavaNPObjectV8.cpp',
- 'bridge/jni/v8/JavaNPObjectV8.h',
- 'bridge/jni/v8/JavaValueV8.h',
'bridge/jsc/BridgeJSC.cpp',
'bridge/npruntime.cpp',
'bridge/npruntime_priv.h',
@@ -2729,6 +2731,8 @@
'inspector/ConsoleMessage.h',
'inspector/ContentSearchUtils.cpp',
'inspector/ContentSearchUtils.h',
+ 'inspector/DOMEditor.cpp',
+ 'inspector/DOMEditor.h',
'inspector/DOMNodeHighlighter.cpp',
'inspector/DOMNodeHighlighter.h',
'inspector/DOMWrapperVisitor.h',
@@ -2988,6 +2992,8 @@
'page/DOMTimer.cpp',
'page/DOMTimer.h',
'page/DOMWindow.cpp',
+ 'page/DOMWindowProperty.cpp',
+ 'page/DOMWindowProperty.h',
'page/DragController.cpp',
'page/EventHandler.cpp',
'page/EventSource.cpp',
@@ -2996,6 +3002,8 @@
'page/Frame.cpp',
'page/FrameActionScheduler.cpp',
'page/FrameActionScheduler.h',
+ 'page/FrameDestructionObserver.cpp',
+ 'page/FrameDestructionObserver.h',
'page/FrameTree.cpp',
'page/FrameView.cpp',
'page/Geolocation.cpp',
@@ -3614,6 +3622,9 @@
'platform/graphics/chromium/cc/CCInputHandler.h',
'platform/graphics/chromium/cc/CCLayerImpl.cpp',
'platform/graphics/chromium/cc/CCLayerImpl.h',
+ 'platform/graphics/chromium/cc/CCLayerIterator.cpp',
+ 'platform/graphics/chromium/cc/CCLayerIterator.h',
+ 'platform/graphics/chromium/cc/CCLayerIteratorPosition.h',
'platform/graphics/chromium/cc/CCLayerQuad.cpp',
'platform/graphics/chromium/cc/CCLayerQuad.h',
'platform/graphics/chromium/cc/CCLayerSorter.cpp',
@@ -3632,6 +3643,8 @@
'platform/graphics/chromium/cc/CCPluginLayerImpl.h',
'platform/graphics/chromium/cc/CCProxy.cpp',
'platform/graphics/chromium/cc/CCProxy.h',
+ 'platform/graphics/chromium/cc/CCQuadCuller.cpp',
+ 'platform/graphics/chromium/cc/CCQuadCuller.h',
'platform/graphics/chromium/cc/CCRenderPass.cpp',
'platform/graphics/chromium/cc/CCRenderPass.h',
'platform/graphics/chromium/cc/CCRenderSurface.cpp',
@@ -3922,6 +3935,7 @@
'platform/graphics/skia/TransformationMatrixSkia.cpp',
'platform/graphics/texmap/GraphicsLayerTextureMapper.cpp',
'platform/graphics/texmap/GraphicsLayerTextureMapper.h',
+ 'platform/graphics/texmap/TextureMapper.cpp',
'platform/graphics/texmap/TextureMapper.h',
'platform/graphics/texmap/TextureMapperNode.cpp',
'platform/graphics/texmap/TextureMapperNode.h',
@@ -4904,6 +4918,8 @@
'storage/AbstractDatabase.cpp',
'storage/ChangeVersionWrapper.cpp',
'storage/ChangeVersionWrapper.h',
+ 'storage/DOMWindowSQLDatabase.cpp',
+ 'storage/DOMWindowSQLDatabase.h',
'storage/Database.cpp',
'storage/DatabaseAuthorizer.cpp',
'storage/DatabaseAuthorizer.h',
@@ -5466,6 +5482,8 @@
'dom/TreeDepthLimit.h',
'dom/TreeScope.cpp',
'dom/TreeScope.h',
+ 'dom/TreeScopeAdopter.cpp',
+ 'dom/TreeScopeAdopter.h',
'dom/TreeWalker.cpp',
'dom/TreeWalker.h',
'dom/UIEvent.cpp',
diff --git a/Source/WebCore/WebCore.vcproj/WebCore.vcproj b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
index 105611536..63f135129 100755
--- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/Source/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -25186,6 +25186,14 @@
>
</File>
<File
+ RelativePath="..\page\DOMWindowProperty.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\page\DOMWindowProperty.h"
+ >
+ </File>
+ <File
RelativePath="..\page\DragActions.h"
>
</File>
@@ -25252,14 +25260,22 @@
<File
RelativePath="..\page\Frame.h"
>
- <File
- RelativePath="..\page\FrameActionScheduler.cpp"
- >
- </File>
- <File
- RelativePath="..\page\FrameActionScheduler.h"
- >
- </File>
+ </File>
+ <File
+ RelativePath="..\page\FrameActionScheduler.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\page\FrameActionScheduler.h"
+ >
+ </File>
+ <File
+ RelativePath="..\page\FrameDestructionObserver.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\page\FrameDestructionObserver.h"
+ >
</File>
<File
RelativePath="..\page\FrameTree.cpp"
@@ -51774,6 +51790,62 @@
>
</File>
<File
+ RelativePath="..\dom\TreeScopeAdopter.cpp"
+ >
+ <FileConfiguration
+ Name="Debug|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release_Cairo_CFLite|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug_All|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Production|Win32"
+ ExcludedFromBuild="true"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath="..\dom\TreeScopeAdopter.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\TreeWalker.cpp"
>
<FileConfiguration
@@ -70454,6 +70526,14 @@
>
</File>
<File
+ RelativePath="..\storage\DOMWindowSQLDatabase.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\storage\DOMWindowSQLDatabase.h"
+ >
+ </File>
+ <File
RelativePath="..\storage\Database.cpp"
>
</File>
@@ -71058,6 +71138,14 @@
>
</File>
<File
+ RelativePath="..\inspector\DOMEditor.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\inspector\DOMEditor.h"
+ >
+ </File>
+ <File
RelativePath="..\inspector\DOMNodeHighlighter.cpp"
>
</File>
diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
index e19bbc7e6..db99f1149 100644
--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1852,6 +1852,8 @@
7AA51B6F1483B61600AD2752 /* InspectorBaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */; };
7AA51DD5148506A900AD2752 /* InspectorMemoryAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */; };
7AA51DD6148506A900AD2752 /* InspectorMemoryAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */; };
+ 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */; };
+ 7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AABA25814BC613300AA9A11 /* DOMEditor.h */; };
7AB0B1C01211A62200A76940 /* InspectorDatabaseAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */; };
7AB0B1C11211A62200A76940 /* InspectorDatabaseAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */; };
7ADE722610CBBB9B006B3B3A /* ContextMenuProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */; };
@@ -3269,6 +3271,8 @@
973DC640145A9409002842C2 /* ExceptionCodeDescription.h in Headers */ = {isa = PBXBuildFile; fileRef = 973DC63E145A9409002842C2 /* ExceptionCodeDescription.h */; settings = {ATTRIBUTES = (Private, ); }; };
973E325610883B7C005BC493 /* ResourceLoadNotifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */; };
973E325710883B7C005BC493 /* ResourceLoadNotifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 973E325510883B7C005BC493 /* ResourceLoadNotifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 974A862214B7ADBB003FDC76 /* FrameDestructionObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 974A862014B7ADBB003FDC76 /* FrameDestructionObserver.cpp */; };
+ 974A862314B7ADBB003FDC76 /* FrameDestructionObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 974A862114B7ADBB003FDC76 /* FrameDestructionObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
974D2DA4146A535D00D51F8B /* SecurityPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 974D2DA2146A535D00D51F8B /* SecurityPolicy.cpp */; };
974D2DA5146A535D00D51F8B /* SecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 974D2DA3146A535D00D51F8B /* SecurityPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
9752D38D1413104B003305BD /* JSHTMLSpanElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9752D38B1413104B003305BD /* JSHTMLSpanElement.cpp */; };
@@ -3367,6 +3371,8 @@
97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; };
97C471DB12F925BD0086354B /* ContentSecurityPolicy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */; };
97C471DC12F925BD0086354B /* ContentSecurityPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */; };
+ 97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */ = {isa = PBXBuildFile; fileRef = 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */; settings = {ATTRIBUTES = (Private, ); }; };
97DCE20110807C750057D394 /* HistoryController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DCE1FF10807C750057D394 /* HistoryController.cpp */; };
97DCE20210807C750057D394 /* HistoryController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DCE20010807C750057D394 /* HistoryController.h */; settings = {ATTRIBUTES = (Private, ); }; };
97E4028F13A696ED00913D67 /* IconController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E4028D13A696ED00913D67 /* IconController.cpp */; };
@@ -3507,6 +3513,8 @@
A77979290D6B9E64003851B9 /* JSImageData.h in Headers */ = {isa = PBXBuildFile; fileRef = A77979250D6B9E64003851B9 /* JSImageData.h */; };
A77B41A012E675A90054343D /* TextEventInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = A77B419F12E675A90054343D /* TextEventInputType.h */; settings = {ATTRIBUTES = (Private, ); }; };
A77D0012133B0AEB00D6658C /* TextChecking.h in Headers */ = {isa = PBXBuildFile; fileRef = A77D0011133B0AEB00D6658C /* TextChecking.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A77E1FEF14AACB6E005B7CB6 /* TreeScopeAdopter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A77E1FED14AACB6E005B7CB6 /* TreeScopeAdopter.cpp */; };
+ A77E1FF014AACB6E005B7CB6 /* TreeScopeAdopter.h in Headers */ = {isa = PBXBuildFile; fileRef = A77E1FEE14AACB6E005B7CB6 /* TreeScopeAdopter.h */; };
A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A781C6A613828B5D0012A62A /* DocumentMarker.cpp */; };
A784941B0B5FE507001E237A /* Clipboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A784941A0B5FE507001E237A /* Clipboard.cpp */; };
A78E526F1346BD1700AD9C31 /* MeterShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */; };
@@ -4040,6 +4048,8 @@
A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80040A19516E00A8EF5F /* StyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */; };
A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A8F457A014BC1A88000CEA59 /* DOMWindowSQLDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8F4579D14BC13EC000CEA59 /* DOMWindowSQLDatabase.cpp */; };
+ A8F457A114BC1A94000CEA59 /* DOMWindowSQLDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = A8F4579E14BC13EC000CEA59 /* DOMWindowSQLDatabase.h */; };
A8F46A840CB20A9D003A9670 /* DOMSVGClipPathElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8503612C0ACE007B001F3D9E /* DOMSVGClipPathElement.h */; };
A8F46A880CB20A9D003A9670 /* DOMSVGGradientElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85C9A2EC0AD7E90300FBFF1E /* DOMSVGGradientElement.h */; };
A8F46A890CB20A9D003A9670 /* DOMSVGAnimateColorElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 850361280ACE007B001F3D9E /* DOMSVGAnimateColorElement.h */; };
@@ -9156,6 +9166,8 @@
7AA51B6D1483B61600AD2752 /* InspectorBaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorBaseAgent.cpp; sourceTree = "<group>"; };
7AA51DD3148506A900AD2752 /* InspectorMemoryAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorMemoryAgent.cpp; sourceTree = "<group>"; };
7AA51DD4148506A900AD2752 /* InspectorMemoryAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorMemoryAgent.h; sourceTree = "<group>"; };
+ 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMEditor.cpp; sourceTree = "<group>"; };
+ 7AABA25814BC613300AA9A11 /* DOMEditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMEditor.h; sourceTree = "<group>"; };
7AB0B1BE1211A62200A76940 /* InspectorDatabaseAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDatabaseAgent.cpp; sourceTree = "<group>"; };
7AB0B1BF1211A62200A76940 /* InspectorDatabaseAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDatabaseAgent.h; sourceTree = "<group>"; };
7ADE722510CBBB9B006B3B3A /* ContextMenuProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuProvider.h; sourceTree = "<group>"; };
@@ -10525,6 +10537,8 @@
973DC63E145A9409002842C2 /* ExceptionCodeDescription.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExceptionCodeDescription.h; sourceTree = "<group>"; };
973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadNotifier.cpp; sourceTree = "<group>"; };
973E325510883B7C005BC493 /* ResourceLoadNotifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadNotifier.h; sourceTree = "<group>"; };
+ 974A862014B7ADBB003FDC76 /* FrameDestructionObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameDestructionObserver.cpp; sourceTree = "<group>"; };
+ 974A862114B7ADBB003FDC76 /* FrameDestructionObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameDestructionObserver.h; sourceTree = "<group>"; };
974D2DA2146A535D00D51F8B /* SecurityPolicy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecurityPolicy.cpp; sourceTree = "<group>"; };
974D2DA3146A535D00D51F8B /* SecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityPolicy.h; sourceTree = "<group>"; };
9752D38B1413104B003305BD /* JSHTMLSpanElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSpanElement.cpp; sourceTree = "<group>"; };
@@ -10625,6 +10639,8 @@
97C1F552122855CB00EDE616 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTMLToken.h; path = parser/HTMLToken.h; sourceTree = "<group>"; };
97C471D912F925BC0086354B /* ContentSecurityPolicy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentSecurityPolicy.cpp; sourceTree = "<group>"; };
97C471DA12F925BD0086354B /* ContentSecurityPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentSecurityPolicy.h; sourceTree = "<group>"; };
+ 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowProperty.cpp; sourceTree = "<group>"; };
+ 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowProperty.h; sourceTree = "<group>"; };
97DCE1FF10807C750057D394 /* HistoryController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryController.cpp; sourceTree = "<group>"; };
97DCE20010807C750057D394 /* HistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryController.h; sourceTree = "<group>"; };
97E4028D13A696ED00913D67 /* IconController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IconController.cpp; sourceTree = "<group>"; };
@@ -10778,6 +10794,8 @@
A77979250D6B9E64003851B9 /* JSImageData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSImageData.h; sourceTree = "<group>"; };
A77B419F12E675A90054343D /* TextEventInputType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEventInputType.h; sourceTree = "<group>"; };
A77D0011133B0AEB00D6658C /* TextChecking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextChecking.h; sourceTree = "<group>"; };
+ A77E1FED14AACB6E005B7CB6 /* TreeScopeAdopter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TreeScopeAdopter.cpp; sourceTree = "<group>"; };
+ A77E1FEE14AACB6E005B7CB6 /* TreeScopeAdopter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TreeScopeAdopter.h; sourceTree = "<group>"; };
A781C6A613828B5D0012A62A /* DocumentMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentMarker.cpp; sourceTree = "<group>"; };
A784941A0B5FE507001E237A /* Clipboard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Clipboard.cpp; sourceTree = "<group>"; };
A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MeterShadowElement.cpp; sourceTree = "<group>"; };
@@ -11305,6 +11323,9 @@
A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
A8F4578F14B2B004000CEA59 /* resolve-supplemental.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "resolve-supplemental.pl"; path = "scripts/resolve-supplemental.pl"; sourceTree = "<group>"; };
+ A8F4579D14BC13EC000CEA59 /* DOMWindowSQLDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowSQLDatabase.cpp; sourceTree = "<group>"; };
+ A8F4579E14BC13EC000CEA59 /* DOMWindowSQLDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowSQLDatabase.h; sourceTree = "<group>"; };
+ A8F4579F14BC13EC000CEA59 /* DOMWindowSQLDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowSQLDatabase.idl; sourceTree = "<group>"; };
A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pattern.h; sourceTree = "<group>"; };
A8FA6E5C0E4CFDED00D5CF49 /* Pattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Pattern.cpp; sourceTree = "<group>"; };
A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMimeType.cpp; sourceTree = "<group>"; };
@@ -14376,6 +14397,9 @@
1AE82EC90CAAE177002237AE /* storage */ = {
isa = PBXGroup;
children = (
+ A8F4579D14BC13EC000CEA59 /* DOMWindowSQLDatabase.cpp */,
+ A8F4579E14BC13EC000CEA59 /* DOMWindowSQLDatabase.h */,
+ A8F4579F14BC13EC000CEA59 /* DOMWindowSQLDatabase.idl */,
B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */,
B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */,
514185ED0CD65F0400763C99 /* ChangeVersionWrapper.cpp */,
@@ -14561,6 +14585,8 @@
41F0618C0F5F069800A07EAC /* ConsoleMessage.h */,
59102FB914327D3B003C9D04 /* ContentSearchUtils.cpp */,
59102FBA14327D3B003C9D04 /* ContentSearchUtils.h */,
+ 7AABA25714BC613300AA9A11 /* DOMEditor.cpp */,
+ 7AABA25814BC613300AA9A11 /* DOMEditor.h */,
4F1442261339FD6200E0D6F8 /* DOMNodeHighlighter.cpp */,
4F1442271339FD6200E0D6F8 /* DOMNodeHighlighter.h */,
F35AE5AB14925F5B004D5776 /* DOMWrapperVisitor.h */,
@@ -15649,6 +15675,8 @@
1403B99609EB13AF00797C7F /* DOMWindow.cpp */,
1403B99509EB13AF00797C7F /* DOMWindow.h */,
1403B90C09EB124500797C7F /* DOMWindow.idl */,
+ 97D2AD0114B823A60093DF32 /* DOMWindowProperty.cpp */,
+ 97D2AD0214B823A60093DF32 /* DOMWindowProperty.h */,
A718760D0B2A120100A16ECE /* DragActions.h */,
A7CA59620B27C1F200FA021D /* DragClient.h */,
A7CA595C0B27BD9E00FA021D /* DragController.cpp */,
@@ -15668,6 +15696,8 @@
65BF022A0974816300C43196 /* Frame.h */,
A7B070D0130A409C00A3763C /* FrameActionScheduler.cpp */,
A7B070D1130A409C00A3763C /* FrameActionScheduler.h */,
+ 974A862014B7ADBB003FDC76 /* FrameDestructionObserver.cpp */,
+ 974A862114B7ADBB003FDC76 /* FrameDestructionObserver.h */,
65A21482097A3F5300B9050A /* FrameTree.cpp */,
65A21483097A3F5300B9050A /* FrameTree.h */,
65CBFEF70974F607001DAC25 /* FrameView.cpp */,
@@ -21450,6 +21480,8 @@
37FD4297118368460093C029 /* TreeDepthLimit.h */,
14D64B5A134A5B6B00E58FDA /* TreeScope.cpp */,
14D64B5B134A5B6B00E58FDA /* TreeScope.h */,
+ A77E1FED14AACB6E005B7CB6 /* TreeScopeAdopter.cpp */,
+ A77E1FEE14AACB6E005B7CB6 /* TreeScopeAdopter.h */,
854FE72E0A2297BE0058D7AD /* TreeWalker.cpp */,
854FE72F0A2297BE0058D7AD /* TreeWalker.h */,
1A750D3C0A90DE35000FF215 /* TreeWalker.idl */,
@@ -24702,6 +24734,7 @@
854FE7370A2297BE0058D7AD /* Traversal.h in Headers */,
37FD4298118368460093C029 /* TreeDepthLimit.h in Headers */,
14D64B5D134A5B6B00E58FDA /* TreeScope.h in Headers */,
+ A77E1FF014AACB6E005B7CB6 /* TreeScopeAdopter.h in Headers */,
1419D2C50CEA6F6100FF507A /* TreeShared.h in Headers */,
854FE7390A2297BE0058D7AD /* TreeWalker.h in Headers */,
37C28A6810F659CC008C7813 /* TypesettingFeatures.h in Headers */,
@@ -24876,6 +24909,10 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
977E2E0F12F0FC9C00C13379 /* XSSAuditor.h in Headers */,
FD537353137B651800008DCE /* ZeroPole.h in Headers */,
+ 974A862314B7ADBB003FDC76 /* FrameDestructionObserver.h in Headers */,
+ 97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
+ 7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */,
+ A8F457A114BC1A94000CEA59 /* DOMWindowSQLDatabase.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -27634,6 +27671,7 @@
49E911D10EF86D47009D0CAF /* TranslateTransformOperation.cpp in Sources */,
854FE7360A2297BE0058D7AD /* Traversal.cpp in Sources */,
14D64B5C134A5B6B00E58FDA /* TreeScope.cpp in Sources */,
+ A77E1FEF14AACB6E005B7CB6 /* TreeScopeAdopter.cpp in Sources */,
854FE7380A2297BE0058D7AD /* TreeWalker.cpp in Sources */,
93309E19099E64920056E581 /* TypingCommand.cpp in Sources */,
85031B4D0A44EFC700F992E0 /* UIEvent.cpp in Sources */,
@@ -27779,6 +27817,10 @@
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
977E2E0E12F0FC9C00C13379 /* XSSAuditor.cpp in Sources */,
FD537352137B651800008DCE /* ZeroPole.cpp in Sources */,
+ 974A862214B7ADBB003FDC76 /* FrameDestructionObserver.cpp in Sources */,
+ 97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */,
+ 7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */,
+ A8F457A014BC1A88000CEA59 /* DOMWindowSQLDatabase.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebCore/accessibility/AXObjectCache.cpp b/Source/WebCore/accessibility/AXObjectCache.cpp
index c0b2bab55..02d5bfb23 100644
--- a/Source/WebCore/accessibility/AXObjectCache.cpp
+++ b/Source/WebCore/accessibility/AXObjectCache.cpp
@@ -178,7 +178,7 @@ AccessibilityObject* AXObjectCache::get(RenderObject* renderer)
ASSERT(!HashTraits<AXID>::isDeletedValue(axID));
if (!axID)
return 0;
-
+
return m_objects.get(axID).get();
}
diff --git a/Source/WebCore/accessibility/AccessibilityAllInOne.cpp b/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
index dd7f7776d..b329ad016 100644
--- a/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
+++ b/Source/WebCore/accessibility/AccessibilityAllInOne.cpp
@@ -44,3 +44,4 @@
#include "AccessibilityTableColumn.cpp"
#include "AccessibilityTableHeaderContainer.cpp"
#include "AccessibilityTableRow.cpp"
+
diff --git a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
index 730c11c3a..942f200e2 100644
--- a/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -2400,7 +2400,7 @@ AccessibilityObject* AccessibilityRenderObject::accessibilityParentForImageMap(H
void AccessibilityRenderObject::getDocumentLinks(AccessibilityChildrenVector& result)
{
Document* document = m_renderer->document();
- RefPtr<HTMLCollection> coll = document->links();
+ HTMLCollection* coll = document->links();
Node* curr = coll->firstItem();
while (curr) {
RenderObject* obj = curr->renderer();
diff --git a/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index d6e0082c0..eadacaf3b 100644
--- a/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -76,7 +76,6 @@
using namespace WebCore;
-static GQuark gailTextUtilQuark = 0;
static GQuark hyperlinkObjectQuark = 0;
static AccessibilityObject* fallbackObject()
@@ -846,7 +845,6 @@ static void webkit_accessible_class_init(AtkObjectClass* klass)
klass->get_attributes = webkit_accessible_get_attributes;
klass->ref_relation_set = webkit_accessible_ref_relation_set;
- gailTextUtilQuark = g_quark_from_static_string("webkit-accessible-gail-text-util");
hyperlinkObjectQuark = g_quark_from_static_string("webkit-accessible-hyperlink-object");
}
@@ -1293,13 +1291,8 @@ static gchar* webkit_accessible_text_get_text(AtkText* text, gint startOffset, g
static GailTextUtil* getGailTextUtilForAtk(AtkText* textObject)
{
- gpointer data = g_object_get_qdata(G_OBJECT(textObject), gailTextUtilQuark);
- if (data)
- return static_cast<GailTextUtil*>(data);
-
GailTextUtil* gailTextUtil = gail_text_util_new();
gail_text_util_text_setup(gailTextUtil, webkit_accessible_text_get_text(textObject, 0, -1));
- g_object_set_qdata_full(G_OBJECT(textObject), gailTextUtilQuark, gailTextUtil, g_object_unref);
return gailTextUtil;
}
@@ -1352,20 +1345,8 @@ static gint webkit_accessible_text_get_caret_offset(AtkText* text)
if (!coreObject->isAccessibilityRenderObject())
return 0;
- Document* document = coreObject->document();
- if (!document)
- return 0;
-
- Node* focusedNode = coreObject->selection().end().deprecatedNode();
- if (!focusedNode)
- return 0;
-
- RenderObject* focusedRenderer = focusedNode->renderer();
- AccessibilityObject* focusedObject = document->axObjectCache()->getOrCreate(focusedRenderer);
-
int offset;
- // Don't ignore links if the offset is being requested for a link.
- if (!objectAndOffsetUnignored(focusedObject, offset, !coreObject->isLink()))
+ if (!objectFocusedAndCaretOffsetUnignored(coreObject, offset))
return 0;
RenderObject* renderer = coreObject->renderer();
@@ -2733,40 +2714,67 @@ AtkObject* webkit_accessible_get_focused_element(WebKitAccessible* accessible)
return focusedObj->wrapper();
}
-AccessibilityObject* objectAndOffsetUnignored(AccessibilityObject* coreObject, int& offset, bool ignoreLinks)
+AccessibilityObject* objectFocusedAndCaretOffsetUnignored(AccessibilityObject* referenceObject, int& offset)
{
// Indication that something bogus has transpired.
offset = -1;
- AccessibilityObject* realObject = coreObject;
- if (realObject->accessibilityIsIgnored())
- realObject = realObject->parentObjectUnignored();
- if (!realObject)
+ Document* document = referenceObject->document();
+ if (!document)
+ return 0;
+
+ Node* focusedNode = referenceObject->selection().end().containerNode();
+ if (!focusedNode)
return 0;
- if (ignoreLinks && realObject->isLink())
- realObject = realObject->parentObjectUnignored();
- if (!realObject)
+ RenderObject* focusedRenderer = focusedNode->renderer();
+ if (!focusedRenderer)
return 0;
- Node* node = realObject->node();
- if (node) {
- VisiblePosition startPosition = VisiblePosition(positionBeforeNode(node), DOWNSTREAM);
- VisiblePosition endPosition = realObject->selection().visibleEnd();
+ AccessibilityObject* focusedObject = document->axObjectCache()->getOrCreate(focusedRenderer);
+ if (!focusedObject)
+ return 0;
- if (startPosition == endPosition)
- offset = 0;
- else if (!isStartOfLine(endPosition)) {
- RefPtr<Range> range = makeRange(startPosition, endPosition.previous());
- offset = TextIterator::rangeLength(range.get(), true) + 1;
- } else {
- RefPtr<Range> range = makeRange(startPosition, endPosition);
- offset = TextIterator::rangeLength(range.get(), true);
- }
+ // Look for the actual (not ignoring accessibility) selected object.
+ if (focusedObject->accessibilityIsIgnored())
+ focusedObject = focusedObject->parentObjectUnignored();
+ if (!focusedObject)
+ return 0;
+
+ // Don't ignore links if the offset is being requested for a link.
+ if (!referenceObject->isLink() && focusedObject->isLink())
+ focusedObject = focusedObject->parentObjectUnignored();
+ if (!focusedObject)
+ return 0;
+ Node* startNode = 0;
+ if (focusedObject != referenceObject || focusedObject->isTextControl()) {
+ // We need to use the first child's node of the reference
+ // object as the start point to calculate the caret offset
+ // because we want it to be relative to the object of
+ // reference, not just to the focused object (which could have
+ // previous siblings which should be taken into account too).
+ AccessibilityObject* axFirstChild = referenceObject->firstChild();
+ if (axFirstChild)
+ startNode = axFirstChild->node();
+ }
+ if (!startNode)
+ startNode = focusedObject->node();
+
+ VisiblePosition startPosition = VisiblePosition(firstPositionInNode(startNode), DOWNSTREAM);
+ VisiblePosition endPosition = focusedObject->selection().visibleEnd();
+
+ if (startPosition == endPosition)
+ offset = 0;
+ else if (!isStartOfLine(endPosition)) {
+ RefPtr<Range> range = makeRange(startPosition, endPosition.previous());
+ offset = TextIterator::rangeLength(range.get(), true) + 1;
+ } else {
+ RefPtr<Range> range = makeRange(startPosition, endPosition);
+ offset = TextIterator::rangeLength(range.get(), true);
}
- return realObject;
+ return focusedObject;
}
#endif // HAVE(ACCESSIBILITY)
diff --git a/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.h b/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.h
index e8cec08f3..c56f32fa9 100644
--- a/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.h
+++ b/Source/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.h
@@ -60,7 +60,7 @@ void webkit_accessible_detach (WebKitAccessible* accessible);
AtkObject* webkit_accessible_get_focused_element(WebKitAccessible* accessible);
-WebCore::AccessibilityObject* objectAndOffsetUnignored(WebCore::AccessibilityObject* coreObject, int& offset, bool ignoreLinks);
+WebCore::AccessibilityObject* objectFocusedAndCaretOffsetUnignored(WebCore::AccessibilityObject*, int& offset);
G_END_DECLS
diff --git a/Source/WebCore/bindings/generic/BindingSecurity.h b/Source/WebCore/bindings/generic/BindingSecurity.h
index a1c464ba1..57862e13a 100644
--- a/Source/WebCore/bindings/generic/BindingSecurity.h
+++ b/Source/WebCore/bindings/generic/BindingSecurity.h
@@ -55,7 +55,7 @@ public:
// Check if it is safe to access the given node from the
// current security context.
- static bool checkNodeSecurity(State<Binding>*, Node* target);
+ static bool allowAccessToNode(State<Binding>*, Node* target);
static bool allowPopUp(State<Binding>*);
static bool allowSettingFrameSrcToJavascriptUrl(State<Binding>*, HTMLFrameElementBase*, const String& value);
@@ -101,7 +101,7 @@ bool BindingSecurity<Binding>::canAccessFrame(State<Binding>* state,
}
template <class Binding>
-bool BindingSecurity<Binding>::checkNodeSecurity(State<Binding>* state, Node* node)
+bool BindingSecurity<Binding>::allowAccessToNode(State<Binding>* state, Node* node)
{
if (!node)
return false;
@@ -131,7 +131,7 @@ bool BindingSecurity<Binding>::allowSettingFrameSrcToJavascriptUrl(State<Binding
{
if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(value))) {
Node* contentDoc = frame->contentDocument();
- if (contentDoc && !checkNodeSecurity(state, contentDoc))
+ if (contentDoc && !allowAccessToNode(state, contentDoc))
return false;
}
return true;
diff --git a/Source/WebCore/bindings/js/JSDOMBinding.cpp b/Source/WebCore/bindings/js/JSDOMBinding.cpp
index 2f49994ce..de78d47e1 100644
--- a/Source/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/Source/WebCore/bindings/js/JSDOMBinding.cpp
@@ -216,12 +216,12 @@ DOMWindow* firstDOMWindow(ExecState* exec)
return asJSDOMWindow(exec->dynamicGlobalObject())->impl();
}
-bool checkNodeSecurity(ExecState* exec, Node* node)
+bool allowAccessToNode(ExecState* exec, Node* node)
{
- return node && allowsAccessFromFrame(exec, node->document()->frame());
+ return node && allowAccessToFrame(exec, node->document()->frame());
}
-bool allowsAccessFromFrame(ExecState* exec, Frame* frame)
+bool allowAccessToFrame(ExecState* exec, Frame* frame)
{
if (!frame)
return false;
@@ -229,7 +229,7 @@ bool allowsAccessFromFrame(ExecState* exec, Frame* frame)
return window && window->allowsAccessFrom(exec);
}
-bool allowsAccessFromFrame(ExecState* exec, Frame* frame, String& message)
+bool allowAccessToFrame(ExecState* exec, Frame* frame, String& message)
{
if (!frame)
return false;
@@ -244,12 +244,6 @@ void printErrorMessageForFrame(Frame* frame, const String& message)
frame->domWindow()->printErrorMessage(message);
}
-// FIXME: We should remove or at least deprecate this function. Callers can use firstDOMWindow directly.
-Frame* toDynamicFrame(ExecState* exec)
-{
- return firstDOMWindow(exec)->frame();
-}
-
JSValue objectToStringFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
{
return JSFunction::create(exec, exec->lexicalGlobalObject(), 0, propertyName, objectProtoFuncToString);
diff --git a/Source/WebCore/bindings/js/JSDOMBinding.h b/Source/WebCore/bindings/js/JSDOMBinding.h
index d81847c79..a66c84752 100644
--- a/Source/WebCore/bindings/js/JSDOMBinding.h
+++ b/Source/WebCore/bindings/js/JSDOMBinding.h
@@ -280,22 +280,21 @@ enum ParameterMissingPolicy {
// Validates that the passed object is a sequence type per section 4.1.13 of the WebIDL spec.
JSC::JSObject* toJSSequence(JSC::ExecState*, JSC::JSValue, unsigned&);
- bool checkNodeSecurity(JSC::ExecState*, Node*);
-
- // Helpers for Window, History, and Location classes to implement cross-domain policy.
- // Besides the cross-domain check, they need non-caching versions of staticFunctionGetter for
- // because we do not want current property values involved at all.
- // FIXME: These functions should be named frameAllowsAccessFrom, because the access is *to* the frame.
- bool allowsAccessFromFrame(JSC::ExecState*, Frame*);
- bool allowsAccessFromFrame(JSC::ExecState*, Frame*, String& message);
+ // FIXME: Implement allowAccessToContext(JSC::ExecState*, ScriptExecutionContext*);
+ bool allowAccessToNode(JSC::ExecState*, Node*);
+ bool allowAccessToFrame(JSC::ExecState*, Frame*);
+ bool allowAccessToFrame(JSC::ExecState*, Frame*, String& message);
+ // FIXME: Implement allowAccessToDOMWindow(JSC::ExecState*, DOMWindow*);
+
+ // FIXME: Remove these functions in favor of activeContext and
+ // firstContext, which return ScriptExecutionContext*. We prefer to use
+ // ScriptExecutionContext* as the context object in the bindings.
DOMWindow* activeDOMWindow(JSC::ExecState*);
DOMWindow* firstDOMWindow(JSC::ExecState*);
void printErrorMessageForFrame(Frame*, const String& message);
JSC::JSValue objectToStringFunctionGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier& propertyName);
- Frame* toDynamicFrame(JSC::ExecState*);
-
inline JSC::JSValue jsString(JSC::ExecState* exec, const String& s)
{
StringImpl* stringImpl = s.impl();
diff --git a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
index c685c78fa..a23d8b225 100644
--- a/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -115,10 +115,10 @@ static JSValue namedItemGetter(ExecState* exec, JSValue slotBase, const Identifi
ASSERT(document);
ASSERT(document->isHTMLDocument());
- RefPtr<HTMLCollection> collection = document->windowNamedItems(identifierToAtomicString(propertyName));
+ HTMLCollection* collection = document->windowNamedItems(identifierToAtomicString(propertyName));
if (collection->length() == 1)
return toJS(exec, thisObj, collection->firstItem());
- return toJS(exec, thisObj, collection.get());
+ return toJS(exec, thisObj, collection);
}
bool JSDOMWindow::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
diff --git a/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp b/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
index c00a55192..fd518459a 100644
--- a/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLDocumentCustom.cpp
@@ -61,7 +61,7 @@ JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, const Iden
JSHTMLDocument* thisObj = static_cast<JSHTMLDocument*>(asObject(slotBase));
HTMLDocument* document = static_cast<HTMLDocument*>(thisObj->impl());
- RefPtr<HTMLCollection> collection = document->documentNamedItems(identifierToAtomicString(propertyName));
+ HTMLCollection* collection = document->documentNamedItems(identifierToAtomicString(propertyName));
unsigned length = collection->length();
if (!length)
@@ -77,7 +77,7 @@ JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, const Iden
return toJS(exec, thisObj->globalObject(), node);
}
- return toJS(exec, thisObj->globalObject(), collection.get());
+ return toJS(exec, thisObj->globalObject(), collection);
}
// Custom attributes
@@ -89,7 +89,7 @@ JSValue JSHTMLDocument::all(ExecState* exec) const
if (v)
return v;
- return toJS(exec, globalObject(), static_cast<HTMLDocument*>(impl())->all().get());
+ return toJS(exec, globalObject(), static_cast<HTMLDocument*>(impl())->all());
}
void JSHTMLDocument::setAll(ExecState* exec, JSValue value)
diff --git a/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp b/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp
index 599416704..c6cc2488b 100644
--- a/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHTMLFrameElementCustom.cpp
@@ -45,7 +45,7 @@ static inline bool allowSettingJavascriptURL(ExecState* exec, HTMLFrameElement*
{
if (protocolIsJavaScript(stripLeadingAndTrailingHTMLSpaces(value))) {
Document* contentDocument = imp->contentDocument();
- if (contentDocument && !checkNodeSecurity(exec, contentDocument))
+ if (contentDocument && !allowAccessToNode(exec, contentDocument))
return false;
}
return true;
diff --git a/Source/WebCore/bindings/js/JSHistoryCustom.cpp b/Source/WebCore/bindings/js/JSHistoryCustom.cpp
index 7e5438e4a..72ea5424c 100644
--- a/Source/WebCore/bindings/js/JSHistoryCustom.cpp
+++ b/Source/WebCore/bindings/js/JSHistoryCustom.cpp
@@ -61,7 +61,7 @@ bool JSHistory::getOwnPropertySlotDelegate(ExecState* exec, const Identifier& pr
// Our custom code is only needed to implement the Window cross-domain scheme, so if access is
// allowed, return false so the normal lookup will take place.
String message;
- if (allowsAccessFromFrame(exec, impl()->frame(), message))
+ if (allowAccessToFrame(exec, impl()->frame(), message))
return false;
// Check for the few functions that we allow, even when called cross-domain.
@@ -101,7 +101,7 @@ bool JSHistory::getOwnPropertyDescriptorDelegate(ExecState* exec, const Identifi
}
// Throw out all cross domain access
- if (!allowsAccessFromFrame(exec, impl()->frame()))
+ if (!allowAccessToFrame(exec, impl()->frame()))
return true;
// Check for the few functions that we allow, even when called cross-domain.
@@ -141,7 +141,7 @@ bool JSHistory::getOwnPropertyDescriptorDelegate(ExecState* exec, const Identifi
bool JSHistory::putDelegate(ExecState* exec, const Identifier&, JSValue, PutPropertySlot&)
{
// Only allow putting by frames in the same origin.
- if (!allowsAccessFromFrame(exec, impl()->frame()))
+ if (!allowAccessToFrame(exec, impl()->frame()))
return true;
return false;
}
@@ -150,7 +150,7 @@ bool JSHistory::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
{
JSHistory* thisObject = jsCast<JSHistory*>(cell);
// Only allow deleting by frames in the same origin.
- if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
+ if (!allowAccessToFrame(exec, thisObject->impl()->frame()))
return false;
return Base::deleteProperty(thisObject, exec, propertyName);
}
@@ -159,7 +159,7 @@ void JSHistory::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyN
{
JSHistory* thisObject = jsCast<JSHistory*>(object);
// Only allow the history object to enumerated by frames in the same origin.
- if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
+ if (!allowAccessToFrame(exec, thisObject->impl()->frame()))
return;
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
diff --git a/Source/WebCore/bindings/js/JSImageDataCustom.cpp b/Source/WebCore/bindings/js/JSImageDataCustom.cpp
index 0f89e9059..d2ca476c7 100644
--- a/Source/WebCore/bindings/js/JSImageDataCustom.cpp
+++ b/Source/WebCore/bindings/js/JSImageDataCustom.cpp
@@ -47,10 +47,9 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, ImageData* imageD
wrapper = CREATE_DOM_WRAPPER(exec, globalObject, ImageData, imageData);
Identifier dataName(exec, "data");
- static const ClassInfo cpaClassInfo = { "CanvasPixelArray", &JSByteArray::s_info, 0, 0, CREATE_METHOD_TABLE(JSByteArray) };
- Structure* cpaStructure = getCachedDOMStructure(globalObject, &cpaClassInfo);
+ Structure* cpaStructure = getCachedDOMStructure(globalObject, &JSByteArray::s_info);
if (!cpaStructure)
- cpaStructure = cacheDOMStructure(globalObject, JSByteArray::createStructure(exec->globalData(), globalObject, jsNull(), &cpaClassInfo), &cpaClassInfo);
+ cpaStructure = cacheDOMStructure(globalObject, JSByteArray::createStructure(exec->globalData(), globalObject, jsNull(), &JSByteArray::s_info), &JSByteArray::s_info);
wrapper->putDirect(exec->globalData(), dataName, JSByteArray::create(exec, cpaStructure, imageData->data()->data()), DontDelete | ReadOnly);
exec->heap()->reportExtraMemoryCost(imageData->data()->length());
diff --git a/Source/WebCore/bindings/js/JSLocationCustom.cpp b/Source/WebCore/bindings/js/JSLocationCustom.cpp
index 095eabc43..22032c7da 100644
--- a/Source/WebCore/bindings/js/JSLocationCustom.cpp
+++ b/Source/WebCore/bindings/js/JSLocationCustom.cpp
@@ -59,7 +59,7 @@ bool JSLocation::getOwnPropertySlotDelegate(ExecState* exec, const Identifier& p
// Our custom code is only needed to implement the Window cross-domain scheme, so if access is
// allowed, return false so the normal lookup will take place.
String message;
- if (allowsAccessFromFrame(exec, frame, message))
+ if (allowAccessToFrame(exec, frame, message))
return false;
// Check for the few functions that we allow, even when called cross-domain.
@@ -95,7 +95,7 @@ bool JSLocation::getOwnPropertyDescriptorDelegate(ExecState* exec, const Identif
}
// throw out all cross domain access
- if (!allowsAccessFromFrame(exec, frame))
+ if (!allowAccessToFrame(exec, frame))
return true;
// Check for the few functions that we allow, even when called cross-domain.
@@ -134,7 +134,7 @@ bool JSLocation::putDelegate(ExecState* exec, const Identifier& propertyName, JS
if (propertyName == exec->propertyNames().toString || propertyName == exec->propertyNames().valueOf)
return true;
- bool sameDomainAccess = allowsAccessFromFrame(exec, frame);
+ bool sameDomainAccess = allowAccessToFrame(exec, frame);
const HashEntry* entry = JSLocation::s_info.propHashTable(exec)->entry(exec, propertyName);
if (!entry) {
@@ -156,7 +156,7 @@ bool JSLocation::deleteProperty(JSCell* cell, ExecState* exec, const Identifier&
{
JSLocation* thisObject = jsCast<JSLocation*>(cell);
// Only allow deleting by frames in the same origin.
- if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
+ if (!allowAccessToFrame(exec, thisObject->impl()->frame()))
return false;
return Base::deleteProperty(thisObject, exec, propertyName);
}
@@ -165,7 +165,7 @@ void JSLocation::getOwnPropertyNames(JSObject* object, ExecState* exec, Property
{
JSLocation* thisObject = jsCast<JSLocation*>(object);
// Only allow the location object to enumerated by frames in the same origin.
- if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))
+ if (!allowAccessToFrame(exec, thisObject->impl()->frame()))
return;
Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
}
@@ -270,7 +270,7 @@ JSValue JSLocation::assign(ExecState* exec)
JSValue JSLocation::toStringFunction(ExecState* exec)
{
Frame* frame = impl()->frame();
- if (!frame || !allowsAccessFromFrame(exec, frame))
+ if (!frame || !allowAccessToFrame(exec, frame))
return jsUndefined();
return jsString(exec, impl()->toString());
diff --git a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
index 5c7cbffc2..69010aec0 100644
--- a/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
+++ b/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
@@ -71,7 +71,6 @@
#include <wtf/FastMalloc.h>
#include <wtf/Float32Array.h>
#include <wtf/Int32Array.h>
-#include <wtf/OwnFastMallocPtr.h>
#if ENABLE(VIDEO)
#include "HTMLVideoElement.h"
diff --git a/Source/WebCore/bindings/js/ScriptController.cpp b/Source/WebCore/bindings/js/ScriptController.cpp
index 0f1c1c7dc..9562f492a 100644
--- a/Source/WebCore/bindings/js/ScriptController.cpp
+++ b/Source/WebCore/bindings/js/ScriptController.cpp
@@ -248,7 +248,7 @@ bool ScriptController::canAccessFromCurrentOrigin(Frame *frame)
{
ExecState* exec = JSMainThreadExecState::currentState();
if (exec)
- return allowsAccessFromFrame(exec, frame);
+ return allowAccessToFrame(exec, frame);
// If the current state is 0 we're in a call path where the DOM security
// check doesn't apply (eg. parser).
return true;
diff --git a/Source/WebCore/bindings/js/SerializedScriptValue.cpp b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
index a56a8dc9f..3ac6ecf58 100644
--- a/Source/WebCore/bindings/js/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/js/SerializedScriptValue.cpp
@@ -1261,8 +1261,7 @@ DeserializationResult CloneDeserializer::deserialize()
fail();
goto error;
}
- JSArray* outArray = constructEmptyArray(m_exec, m_globalObject);
- outArray->setLength(length);
+ JSArray* outArray = constructEmptyArray(m_exec, m_globalObject, length);
m_gcBuffer.append(outArray);
outputArrayStack.append(outArray);
// fallthrough
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index 22a3e6a6a..d3145929f 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -201,7 +201,6 @@ sub ShouldSkipTypeInImplementation
return 1 if $typeInfo->signature->extendedAttributes->{"CustomArgumentHandling"}
or $typeInfo->signature->extendedAttributes->{"CustomGetter"}
- or $typeInfo->signature->extendedAttributes->{"NeedsUserGestureCheck"}
or $typeInfo->signature->extendedAttributes->{"CPPCustom"};
# FIXME: We don't generate bindings for SVG related interfaces yet
@@ -669,7 +668,7 @@ sub GenerateImplementation
push(@implContent, "$implClassNameWithNamespace* ${className}::impl() const\n");
push(@implContent, "{\n");
- push(@implContent, " return m_impl ? m_impl->impl.get() : 0;\n");
+ push(@implContent, " return m_impl ? WTF::getPtr(m_impl->impl) : 0;\n");
push(@implContent, "}\n\n");
# Destructor
@@ -849,7 +848,16 @@ sub GenerateImplementation
my @functionContent = ();
push(@parameterNames, "ec") if $raisesExceptions;
- my $content = "impl()->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+
+ my $content;
+ if ($function->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ $implIncludes{"${implementedBy}.h"} = 1;
+ unshift(@parameterNames, "impl()");
+ $content = "${implementedBy}::" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+ } else {
+ $content = "impl()->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+ }
if ($returnType eq "void") {
# Special case 'void' return type.
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index c2ccfb3ee..702e8e6c8 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -769,14 +769,6 @@ sub GenerateFunction {
push(@callImplParams, $paramName);
}
- # Not quite sure what to do with this yet, but we need to take into
- # account the difference in parameters between the IDL file and the
- # actual implementation.
- if ($function->signature->extendedAttributes->{"NeedsUserGestureCheck"}) {
- $functionSig .= ", gboolean isUserGesture";
- push(@callImplParams, "false");
- }
-
if ($returnType ne "void" && $returnValueIsGDOMType && $functionSigType ne "DOMObject") {
if ($functionSigType ne "EventTarget") {
$implIncludes{"webkit/WebKitDOM${functionSigType}Private.h"} = 1;
@@ -945,7 +937,15 @@ EOF
}
$getterContentHead = "${assign}convertToUTF8String(${functionName}(" . join(", ", @arguments) . "));\n";
} else {
- $getterContentHead = "${assign}convertToUTF8String(item->${functionSigName}(" . join(", ", @callImplParams) . "));\n";
+ my @arguments = @callImplParams;
+ if ($function->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ $implIncludes{"${implementedBy}.h"} = 1;
+ unshift(@arguments, "item");
+ $getterContentHead = "${assign}convertToUTF8String(${implementedBy}::${functionSigName}(" . join(", ", @arguments) . "));\n";
+ } else {
+ $getterContentHead = "${assign}convertToUTF8String(item->${functionSigName}(" . join(", ", @arguments) . "));\n";
+ }
}
push(@cBody, " ${getterContentHead}");
} else {
@@ -976,7 +976,15 @@ EOF
$contentHead = "${assign}${assignPre}${functionName}(" . join(", ", @arguments) . "${assignPost});\n";
}
} else {
- $contentHead = "${assign}${assignPre}item->${functionSigName}(" . join(", ", @callImplParams) . "${assignPost});\n";
+ my @arguments = @callImplParams;
+ if ($function->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ $implIncludes{"${implementedBy}.h"} = 1;
+ unshift(@arguments, "item");
+ $contentHead = "${assign}${assignPre}${implementedBy}::${functionSigName}(" . join(", ", @arguments) . "${assignPost});\n";
+ } else {
+ $contentHead = "${assign}${assignPre}item->${functionSigName}(" . join(", ", @arguments) . "${assignPost});\n";
+ }
}
push(@cBody, " ${contentHead}");
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
index c63deecec..10106ecbe 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -522,7 +522,7 @@ sub GenerateGetOwnPropertyDescriptorBody
if ($interfaceName eq "DOMWindow") {
push(@implContent, " if (!thisObject->allowsAccessFrom(exec))\n");
} else {
- push(@implContent, " if (!allowsAccessFromFrame(exec, thisObject->impl()->frame()))\n");
+ push(@implContent, " if (!allowAccessToFrame(exec, thisObject->impl()->frame()))\n");
}
push(@implContent, " return false;\n");
}
@@ -1752,15 +1752,15 @@ sub GenerateImplementation
} else {
push(@implContent, " return castedThis->$implGetterFunctionName(exec);\n");
}
- } elsif ($attribute->signature->extendedAttributes->{"CheckNodeSecurity"}) {
+ } elsif ($attribute->signature->extendedAttributes->{"allowAccessToNode"}) {
$implIncludes{"JSDOMBinding.h"} = 1;
push(@implContent, " $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
- push(@implContent, " return checkNodeSecurity(exec, impl->$implGetterFunctionName()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");
+ push(@implContent, " return allowAccessToNode(exec, impl->$implGetterFunctionName()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");
} elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
$implIncludes{"Document.h"} = 1;
$implIncludes{"JSDOMBinding.h"} = 1;
push(@implContent, " $implClassName* impl = static_cast<$implClassName*>(castedThis->impl());\n");
- push(@implContent, " return checkNodeSecurity(exec, impl->contentDocument()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");
+ push(@implContent, " return allowAccessToNode(exec, impl->contentDocument()) ? " . NativeToJSValue($attribute->signature, 0, $implClassName, "impl->$implGetterFunctionName()", "castedThis") . " : jsUndefined();\n");
} elsif ($type eq "EventListener") {
$implIncludes{"EventListener.h"} = 1;
push(@implContent, " UNUSED_PARAM(exec);\n");
@@ -1928,7 +1928,7 @@ sub GenerateImplementation
if ($interfaceName eq "DOMWindow") {
push(@implContent, " if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
} else {
- push(@implContent, " if (!allowsAccessFromFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
+ push(@implContent, " if (!allowAccessToFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
}
push(@implContent, " return;\n");
}
@@ -2056,7 +2056,7 @@ sub GenerateImplementation
if ($interfaceName eq "DOMWindow") {
push(@implContent, " if (!static_cast<$className*>(thisObject)->allowsAccessFrom(exec))\n");
} else {
- push(@implContent, " if (!allowsAccessFromFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
+ push(@implContent, " if (!allowAccessToFrame(exec, static_cast<$className*>(thisObject)->impl()->frame()))\n");
}
push(@implContent, " return;\n");
}
@@ -2170,7 +2170,7 @@ sub GenerateImplementation
}
if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"} and !$function->isStatic) {
- push(@implContent, " if (!checkNodeSecurity(exec, impl->getSVGDocument(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
+ push(@implContent, " if (!allowAccessToNode(exec, impl->getSVGDocument(" . (@{$function->raisesExceptions} ? "ec" : "") .")))\n");
push(@implContent, " return JSValue::encode(jsUndefined());\n");
$implIncludes{"JSDOMBinding.h"} = 1;
}
@@ -2181,8 +2181,8 @@ sub GenerateImplementation
push(@implContent, GenerateEventListenerCall($className, "remove"));
} else {
my $numParameters = @{$function->parameters};
- my ($functionString, $paramIndex) = GenerateParametersCheck(\@implContent, $function, $dataNode, $numParameters, $implClassName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType);
- GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " ", $svgPropertyType, $implClassName);
+ my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $dataNode, $numParameters, $implClassName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType);
+ GenerateImplementationFunctionCall($function, $functionString, " ", $svgPropertyType, $implClassName);
}
}
@@ -2419,19 +2419,23 @@ sub GenerateParametersCheck
my $svgPropertyOrListPropertyType = shift;
my $svgListPropertyType = shift;
- my $paramIndex = 0;
my $argsIndex = 0;
my $hasOptionalArguments = 0;
- my $functionBase = "";
+ my @arguments;
+ my $functionName;
if ($function->isStatic) {
- $functionBase = "${implClassName}::";
+ $functionName = "${implClassName}::${functionImplementationName}";
+ } elsif ($function->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ AddToImplIncludes("${implementedBy}.h");
+ unshift(@arguments, "impl");
+ $functionName = "${implementedBy}::${functionImplementationName}";
} elsif ($svgPropertyOrListPropertyType and !$svgListPropertyType) {
- $functionBase = "podImpl.";
+ $functionName = "podImpl.${functionImplementationName}";
} else {
- $functionBase = "impl->";
+ $functionName = "impl->${functionImplementationName}";
}
- my $functionString = "$functionBase$functionImplementationName(";
if ($function->signature->extendedAttributes->{"CustomArgumentHandling"} and !$function->isStatic) {
push(@$outputArray, " RefPtr<ScriptArguments> scriptArguments(createScriptArguments(exec, $numParameters));\n");
@@ -2444,12 +2448,7 @@ sub GenerateParametersCheck
my $callWith = $function->signature->extendedAttributes->{"CallWith"};
if ($callWith and !$function->signature->extendedAttributes->{"Constructor"}) {
my $callWithArg = "COMPILE_ASSERT(false)";
- if ($callWith eq "DynamicFrame") {
- push(@$outputArray, " Frame* dynamicFrame = toDynamicFrame(exec);\n");
- push(@$outputArray, " if (!dynamicFrame)\n");
- push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
- $callWithArg = "dynamicFrame";
- } elsif ($callWith eq "ScriptState") {
+ if ($callWith eq "ScriptState") {
$callWithArg = "exec";
} elsif ($callWith eq "ScriptExecutionContext") {
push(@$outputArray, " ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();\n");
@@ -2457,9 +2456,7 @@ sub GenerateParametersCheck
push(@$outputArray, " return JSValue::encode(jsUndefined());\n");
$callWithArg = "scriptContext";
}
- $functionString .= ", " if $paramIndex;
- $functionString .= $callWithArg;
- $paramIndex++;
+ push @arguments, $callWithArg;
}
$implIncludes{"ExceptionCode.h"} = 1;
@@ -2478,7 +2475,16 @@ sub GenerateParametersCheck
$hasOptionalArguments = 1;
}
push(@$outputArray, " if (argsCount <= $argsIndex) {\n");
- GenerateImplementationFunctionCall($function, $functionString, $paramIndex, " " x 2, $svgPropertyType, $implClassName);
+
+ my @optionalCallbackArguments = @arguments;
+ if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
+ push @optionalCallbackArguments, "scriptArguments, callStack";
+ }
+ if (@{$function->raisesExceptions}) {
+ push @optionalCallbackArguments, "ec";
+ }
+ my $functionString = "$functionName(" . join(", ", @optionalCallbackArguments) . ")";
+ GenerateImplementationFunctionCall($function, $functionString, " " x 2, $svgPropertyType, $implClassName);
push(@$outputArray, " }\n\n");
}
@@ -2559,27 +2565,23 @@ sub GenerateParametersCheck
}
}
- $functionString .= ", " if $paramIndex;
-
if ($argType eq "NodeFilter") {
- $functionString .= "$name.get()";
+ push @arguments, "$name.get()";
} elsif ($codeGenerator->IsSVGTypeNeedingTearOff($argType) and not $implClassName =~ /List$/) {
- $functionString .= "$name->propertyReference()";
+ push @arguments, "$name->propertyReference()";
} else {
- $functionString .= $name;
+ push @arguments, $name;
}
$argsIndex++;
- $paramIndex++;
}
- if ($function->signature->extendedAttributes->{"NeedsUserGestureCheck"}) {
- $functionString .= ", " if $paramIndex;
- $functionString .= "ScriptController::processingUserGesture()";
- $paramIndex++;
- $implIncludes{"ScriptController.h"} = 1;
+ if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
+ push @arguments, "scriptArguments, callStack";
}
-
- return ($functionString, $paramIndex);
+ if (@{$function->raisesExceptions}) {
+ push @arguments, "ec";
+ }
+ return ("$functionName(" . join(", ", @arguments) . ")", scalar @arguments);
}
sub GenerateCallbackHeader
@@ -2744,23 +2746,10 @@ sub GenerateImplementationFunctionCall()
{
my $function = shift;
my $functionString = shift;
- my $paramIndex = shift;
my $indent = shift;
my $svgPropertyType = shift;
my $implClassName = shift;
- if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
- $functionString .= ", " if $paramIndex;
- $paramIndex += 2;
- $functionString .= "scriptArguments, callStack";
- }
-
- if (@{$function->raisesExceptions}) {
- $functionString .= ", " if $paramIndex;
- $functionString .= "ec";
- }
- $functionString .= ")";
-
if ($function->signature->type eq "void") {
push(@implContent, $indent . "$functionString;\n");
push(@implContent, $indent . "setDOMException(exec, ec);\n") if @{$function->raisesExceptions};
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index 34ab887cf..93739daa9 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -1607,9 +1607,13 @@ sub GenerateImplementation
splice(@parameterNames, $currentParameter, 1, "${paramName}Core->propertyReference()");
}
- my $content = $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
-
- if ($svgPropertyType) {
+ my $content;
+ if ($function->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ $implIncludes{"${implementedBy}.h"} = 1;
+ unshift(@parameterNames, $caller);
+ $content = "${implementedBy}::" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
+ } elsif ($svgPropertyType) {
$implIncludes{"ExceptionCode.h"} = 1;
push(@functionContent, " if (IMPL->role() == WebCore::AnimValRole) {\n");
push(@functionContent, " WebCore::raiseOnDOMError(WebCore::NO_MODIFICATION_ALLOWED_ERR);\n");
@@ -1620,9 +1624,9 @@ sub GenerateImplementation
}
push(@functionContent, " }\n");
push(@functionContent, " $svgPropertyType& podImpl = IMPL->propertyReference();\n");
- $content = "podImpl.$content";
+ $content = "podImpl." . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
} else {
- $content = $caller . "->$content";
+ $content = "$caller->" . $codeGenerator->WK_lcfirst($functionName) . "(" . join(", ", @parameterNames) . ")";
}
if ($returnType eq "void") {
diff --git a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
index a5667add2..c016cf9a0 100644
--- a/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -291,8 +291,6 @@ sub GenerateHeader
}
}
- my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
-
# - Add default header template
push(@headerContent, GenerateHeaderContentHeader($dataNode));
@@ -883,10 +881,10 @@ END
}
# Generate security checks if necessary
- if ($attribute->signature->extendedAttributes->{"CheckNodeSecurity"}) {
- push(@implContentDecls, " if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->$attrName()))\n return v8::Handle<v8::Value>();\n\n");
+ if ($attribute->signature->extendedAttributes->{"allowAccessToNode"}) {
+ push(@implContentDecls, " if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->$attrName()))\n return v8::Handle<v8::Value>();\n\n");
} elsif ($attribute->signature->extendedAttributes->{"CheckFrameSecurity"}) {
- push(@implContentDecls, " if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->contentDocument()))\n return v8::Handle<v8::Value>();\n\n");
+ push(@implContentDecls, " if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->contentDocument()))\n return v8::Handle<v8::Value>();\n\n");
}
my $useExceptions = 1 if @{$attribute->getterExceptions};
@@ -1434,7 +1432,7 @@ END
}
if ($function->signature->extendedAttributes->{"SVGCheckSecurityDocument"}) {
push(@implContentDecls, <<END);
- if (!V8BindingSecurity::checkNodeSecurity(V8BindingState::Only(), imp->getSVGDocument(ec)))
+ if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->getSVGDocument(ec)))
return v8::Handle<v8::Value>();
END
}
@@ -2211,7 +2209,6 @@ sub GenerateImplementation
my $visibleInterfaceName = GetVisibleInterfaceName($interfaceName);
my $className = "V8$interfaceName";
my $implClassName = $interfaceName;
- my $hasLegacyParent = $dataNode->extendedAttributes->{"LegacyParent"};
# - Add default header template
push(@implFixedHeader, GenerateImplementationContentHeader($dataNode));
@@ -3185,23 +3182,26 @@ sub GenerateFunctionCallString()
$name = $function->signature->extendedAttributes->{"ImplementationFunction"};
}
- my $functionString = "imp->${name}(";
- if ($function->isStatic) {
- $functionString = "${implClassName}::${name}(";
- }
-
my $index = 0;
my $hasScriptState = 0;
+ my @arguments;
+ my $functionName;
+ if ($function->isStatic) {
+ $functionName = "${implClassName}::${name}";
+ } elsif ($function->signature->extendedAttributes->{"ImplementedBy"}) {
+ my $implementedBy = $function->signature->extendedAttributes->{"ImplementedBy"};
+ AddToImplIncludes("${implementedBy}.h");
+ unshift(@arguments, "imp");
+ $functionName = "${implementedBy}::${name}";
+ } else {
+ $functionName = "imp->${name}";
+ }
+
my $callWith = $function->signature->extendedAttributes->{"CallWith"};
if ($callWith) {
my $callWithArg = "COMPILE_ASSERT(false)";
- if ($callWith eq "DynamicFrame") {
- $result .= $indent . "Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();\n";
- $result .= $indent . "if (!enteredFrame)\n";
- $result .= $indent . " return v8::Undefined();\n";
- $callWithArg = "enteredFrame";
- } elsif ($callWith eq "ScriptState") {
+ if ($callWith eq "ScriptState") {
$result .= $indent . "EmptyScriptState state;\n";
$callWithArg = "&state";
$hasScriptState = 1;
@@ -3211,8 +3211,7 @@ sub GenerateFunctionCallString()
$result .= $indent . " return v8::Undefined();\n";
$callWithArg = "scriptContext";
}
- $functionString .= ", " if $index;
- $functionString .= $callWithArg;
+ push @arguments, $callWithArg;
$index++;
$numberOfParameters++
}
@@ -3221,45 +3220,34 @@ sub GenerateFunctionCallString()
if ($index eq $numberOfParameters) {
last;
}
- $functionString .= ", " if $index;
my $paramName = $parameter->name;
my $paramType = $parameter->type;
if ($parameter->type eq "NodeFilter" || $parameter->type eq "XPathNSResolver") {
- $functionString .= "$paramName.get()";
+ push @arguments, "$paramName.get()";
} elsif ($codeGenerator->IsSVGTypeNeedingTearOff($parameter->type) and not $implClassName =~ /List$/) {
- $functionString .= "$paramName->propertyReference()";
+ push @arguments, "$paramName->propertyReference()";
$result .= $indent . "if (!$paramName) {\n";
$result .= $indent . " V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR);\n";
$result .= $indent . " return v8::Handle<v8::Value>();\n";
$result .= $indent . "}\n";
} elsif ($parameter->type eq "SVGMatrix" and $implClassName eq "SVGTransformList") {
- $functionString .= "$paramName.get()";
+ push @arguments, "$paramName.get()";
} else {
- $functionString .= $paramName;
+ push @arguments, $paramName;
}
$index++;
}
if ($function->signature->extendedAttributes->{"CustomArgumentHandling"}) {
- $functionString .= ", " if $index;
- $functionString .= "scriptArguments, callStack";
- $index += 2;
- }
-
- if ($function->signature->extendedAttributes->{"NeedsUserGestureCheck"}) {
- $functionString .= ", " if $index;
- $functionString .= "ScriptController::processingUserGesture()";
- $index++;
- AddToImplIncludes("ScriptController.h");
+ push @arguments, "scriptArguments, callStack";
}
if (@{$function->raisesExceptions}) {
- $functionString .= ", " if $index;
- $functionString .= "ec";
- $index++;
+ push @arguments, "ec";
}
- $functionString .= ")";
+
+ my $functionString = "$functionName(" . join(", ", @arguments) . ")";
my $return = "result";
my $returnIsRef = IsRefPtrType($returnType);
@@ -3429,6 +3417,7 @@ sub GetNativeTypeForCallbacks
{
my $type = shift;
return "const String&" if $type eq "DOMString";
+ return "SerializedScriptValue*" if $type eq "SerializedScriptValue";
# Callbacks use raw pointers, so pass isParameter = 1
return GetNativeType($type, 1);
diff --git a/Source/WebCore/bindings/scripts/generate-bindings.pl b/Source/WebCore/bindings/scripts/generate-bindings.pl
index 4a8a95584..cb51f2c6d 100755
--- a/Source/WebCore/bindings/scripts/generate-bindings.pl
+++ b/Source/WebCore/bindings/scripts/generate-bindings.pl
@@ -159,6 +159,18 @@ foreach my $idlFile (@supplementedIdlFiles) {
}
push(@{$targetDataNode->attributes}, $attribute);
}
+
+ foreach my $function (@{$dataNode->functions}) {
+ # Record that this attribute is implemented by $interfaceName.
+ $function->signature->extendedAttributes->{"ImplementedBy"} = $interfaceName;
+
+ # Add interface-wide extended attributes to each attribute.
+ foreach my $extendedAttributeName (keys %{$dataNode->extendedAttributes}) {
+ next if ($extendedAttributeName eq "Supplemental");
+ $function->signature->extendedAttributes->{$extendedAttributeName} = $dataNode->extendedAttributes->{$extendedAttributeName};
+ }
+ push(@{$targetDataNode->functions}, $function);
+ }
}
}
}
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.cpp
new file mode 100644
index 000000000..6d7956501
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.cpp
@@ -0,0 +1,111 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebDOMTestActiveDOMObject.h"
+
+#include "KURL.h"
+#include "Node.h"
+#include "TestActiveDOMObject.h"
+#include "WebDOMNode.h"
+#include "WebDOMString.h"
+#include "WebExceptionHandler.h"
+#include "wtf/text/AtomicString.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+struct WebDOMTestActiveDOMObject::WebDOMTestActiveDOMObjectPrivate {
+ WebDOMTestActiveDOMObjectPrivate(WebCore::TestActiveDOMObject* object = 0)
+ : impl(object)
+ {
+ }
+
+ RefPtr<WebCore::TestActiveDOMObject> impl;
+};
+
+WebDOMTestActiveDOMObject::WebDOMTestActiveDOMObject()
+ : WebDOMObject()
+ , m_impl(0)
+{
+}
+
+WebDOMTestActiveDOMObject::WebDOMTestActiveDOMObject(WebCore::TestActiveDOMObject* impl)
+ : WebDOMObject()
+ , m_impl(new WebDOMTestActiveDOMObjectPrivate(impl))
+{
+}
+
+WebDOMTestActiveDOMObject::WebDOMTestActiveDOMObject(const WebDOMTestActiveDOMObject& copy)
+ : WebDOMObject()
+{
+ m_impl = copy.impl() ? new WebDOMTestActiveDOMObjectPrivate(copy.impl()) : 0;
+}
+
+WebDOMTestActiveDOMObject& WebDOMTestActiveDOMObject::operator=(const WebDOMTestActiveDOMObject& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestActiveDOMObjectPrivate(copy.impl()) : 0;
+ return *this;
+}
+
+WebCore::TestActiveDOMObject* WebDOMTestActiveDOMObject::impl() const
+{
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
+}
+
+WebDOMTestActiveDOMObject::~WebDOMTestActiveDOMObject()
+{
+ delete m_impl;
+ m_impl = 0;
+}
+
+int WebDOMTestActiveDOMObject::excitingAttr() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->excitingAttr();
+}
+
+void WebDOMTestActiveDOMObject::excitingFunction(const WebDOMNode& nextChild)
+{
+ if (!impl())
+ return;
+
+ impl()->excitingFunction(toWebCore(nextChild));
+}
+
+void WebDOMTestActiveDOMObject::postMessage(const WebDOMString& message)
+{
+ if (!impl())
+ return;
+
+ impl()->postMessage(message);
+}
+
+WebCore::TestActiveDOMObject* toWebCore(const WebDOMTestActiveDOMObject& wrapper)
+{
+ return wrapper.impl();
+}
+
+WebDOMTestActiveDOMObject toWebKit(WebCore::TestActiveDOMObject* value)
+{
+ return WebDOMTestActiveDOMObject(value);
+}
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.h
new file mode 100644
index 000000000..66d14df09
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestActiveDOMObject.h
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebDOMTestActiveDOMObject_h
+#define WebDOMTestActiveDOMObject_h
+
+#include <WebDOMObject.h>
+#include <WebDOMString.h>
+
+namespace WebCore {
+class TestActiveDOMObject;
+};
+
+class WebDOMNode;
+
+class WebDOMTestActiveDOMObject : public WebDOMObject {
+public:
+ WebDOMTestActiveDOMObject();
+ explicit WebDOMTestActiveDOMObject(WebCore::TestActiveDOMObject*);
+ WebDOMTestActiveDOMObject(const WebDOMTestActiveDOMObject&);
+ WebDOMTestActiveDOMObject& operator=(const WebDOMTestActiveDOMObject&);
+ virtual ~WebDOMTestActiveDOMObject();
+
+ int excitingAttr() const;
+
+ void excitingFunction(const WebDOMNode& nextChild);
+ void postMessage(const WebDOMString& message);
+
+ WebCore::TestActiveDOMObject* impl() const;
+
+protected:
+ struct WebDOMTestActiveDOMObjectPrivate;
+ WebDOMTestActiveDOMObjectPrivate* m_impl;
+};
+
+WebCore::TestActiveDOMObject* toWebCore(const WebDOMTestActiveDOMObject&);
+WebDOMTestActiveDOMObject toWebKit(WebCore::TestActiveDOMObject*);
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp
index 483b2575a..a082c4ad3 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestCallback.cpp
@@ -76,7 +76,7 @@ WebDOMTestCallback& WebDOMTestCallback::operator=(const WebDOMTestCallback& copy
WebCore::TestCallback* WebDOMTestCallback::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestCallback::~WebDOMTestCallback()
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventConstructor.cpp
index 7a0b04e38..51aca880c 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventConstructor.cpp
@@ -65,7 +65,7 @@ WebDOMTestEventConstructor& WebDOMTestEventConstructor::operator=(const WebDOMTe
WebCore::TestEventConstructor* WebDOMTestEventConstructor::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestEventConstructor::~WebDOMTestEventConstructor()
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.cpp
new file mode 100644
index 000000000..beccea107
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.cpp
@@ -0,0 +1,95 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * 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 "WebDOMTestEventTarget.h"
+
+#include "Event.h"
+#include "KURL.h"
+#include "Node.h"
+#include "TestEventTarget.h"
+#include "WebDOMEvent.h"
+#include "WebDOMNode.h"
+#include "WebDOMString.h"
+#include "WebExceptionHandler.h"
+#include "WebNativeEventListener.h"
+#include "wtf/text/AtomicString.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+WebDOMTestEventTarget::WebDOMTestEventTarget()
+ : WebDOMEventTarget()
+{
+}
+
+WebDOMTestEventTarget::WebDOMTestEventTarget(WebCore::TestEventTarget* impl)
+ : WebDOMEventTarget(impl)
+{
+}
+
+WebCore::TestEventTarget* WebDOMTestEventTarget::impl() const
+{
+ return static_cast<WebCore::TestEventTarget*>(WebDOMEventTarget::impl());
+}
+
+WebDOMNode WebDOMTestEventTarget::item(unsigned index)
+{
+ if (!impl())
+ return WebDOMNode();
+
+ return toWebKit(WTF::getPtr(impl()->item(index)));
+}
+
+void WebDOMTestEventTarget::addEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture)
+{
+ if (!impl())
+ return;
+
+ impl()->addEventListener(type, toWebCore(listener), useCapture);
+}
+
+void WebDOMTestEventTarget::removeEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture)
+{
+ if (!impl())
+ return;
+
+ impl()->removeEventListener(type, toWebCore(listener), useCapture);
+}
+
+bool WebDOMTestEventTarget::dispatchEvent(const WebDOMEvent& evt)
+{
+ if (!impl())
+ return false;
+
+ WebCore::ExceptionCode ec = 0;
+ bool result = impl()->dispatchEvent(toWebCore(evt), ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return result;
+}
+
+WebCore::TestEventTarget* toWebCore(const WebDOMTestEventTarget& wrapper)
+{
+ return wrapper.impl();
+}
+
+WebDOMTestEventTarget toWebKit(WebCore::TestEventTarget* value)
+{
+ return WebDOMTestEventTarget(value);
+}
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.h
new file mode 100644
index 000000000..37a52dddd
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestEventTarget.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebDOMTestEventTarget_h
+#define WebDOMTestEventTarget_h
+
+#include <WebDOMEventTarget.h>
+#include <WebDOMString.h>
+
+namespace WebCore {
+class TestEventTarget;
+};
+
+class WebDOMEvent;
+class WebDOMEventListener;
+class WebDOMNode;
+
+class WebDOMTestEventTarget : public WebDOMEventTarget {
+public:
+ WebDOMTestEventTarget();
+ explicit WebDOMTestEventTarget(WebCore::TestEventTarget*);
+ virtual ~WebDOMTestEventTarget() { }
+
+ WebDOMNode item(unsigned index);
+ void addEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture);
+ void removeEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture);
+ bool dispatchEvent(const WebDOMEvent& evt);
+
+ WebCore::TestEventTarget* impl() const;
+};
+
+WebCore::TestEventTarget* toWebCore(const WebDOMTestEventTarget&);
+WebDOMTestEventTarget toWebKit(WebCore::TestEventTarget*);
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
index f114f9048..7d08ba1fd 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
@@ -26,8 +26,10 @@
#include "KURL.h"
#include "TestInterface.h"
+#include "TestObj.h"
#include "TestSupplemental.h"
#include "WebDOMString.h"
+#include "WebDOMTestObj.h"
#include "WebExceptionHandler.h"
#include "wtf/text/AtomicString.h"
#include <wtf/GetPtr.h>
@@ -69,7 +71,7 @@ WebDOMTestInterface& WebDOMTestInterface::operator=(const WebDOMTestInterface& c
WebCore::TestInterface* WebDOMTestInterface::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestInterface::~WebDOMTestInterface()
@@ -79,33 +81,60 @@ WebDOMTestInterface::~WebDOMTestInterface()
}
#if ENABLE(Condition11) || ENABLE(Condition12)
-WebDOMString WebDOMTestInterface::str1() const
+WebDOMString WebDOMTestInterface::supplementalStr1() const
{
if (!impl())
return WebDOMString();
- return static_cast<const WTF::String&>(TestSupplemental::str1(impl()));
+ return static_cast<const WTF::String&>(TestSupplemental::supplementalStr1(impl()));
}
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-WebDOMString WebDOMTestInterface::str2() const
+WebDOMString WebDOMTestInterface::supplementalStr2() const
{
if (!impl())
return WebDOMString();
- return static_cast<const WTF::String&>(TestSupplemental::str2(impl()));
+ return static_cast<const WTF::String&>(TestSupplemental::supplementalStr2(impl()));
}
-void WebDOMTestInterface::setStr2(const WebDOMString& newStr2)
+void WebDOMTestInterface::setSupplementalStr2(const WebDOMString& newSupplementalStr2)
{
if (!impl())
return;
- TestSupplemental::setStr2(impl(), newStr2);
+ TestSupplemental::setSupplementalStr2(impl(), newSupplementalStr2);
}
#endif
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+void WebDOMTestInterface::supplementalMethod1()
+{
+ if (!impl())
+ return;
+
+ TestSupplemental::supplementalMethod1(impl());
+}
+
+#endif
+
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+WebDOMTestObj WebDOMTestInterface::supplementalMethod2(const WebDOMString& strArg, const WebDOMTestObj& objArg)
+{
+ if (!impl())
+ return WebDOMTestObj();
+
+ WebCore::ExceptionCode ec = 0;
+ WebDOMTestObj result = toWebKit(WTF::getPtr(TestSupplemental::supplementalMethod2(impl(), strArg, toWebCore(objArg), ec)));
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return result;
+}
+
+#endif
+
WebCore::TestInterface* toWebCore(const WebDOMTestInterface& wrapper)
{
return wrapper.impl();
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
index 5aa03c795..3d48186e2 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
@@ -32,6 +32,7 @@ namespace WebCore {
class TestInterface;
};
+class WebDOMTestObj;
class WebDOMTestInterface : public WebDOMObject {
public:
@@ -42,13 +43,16 @@ public:
virtual ~WebDOMTestInterface();
#if ENABLE(Condition11) || ENABLE(Condition12)
- WebDOMString str1() const;
+ WebDOMString supplementalStr1() const;
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
- WebDOMString str2() const;
- void setStr2(const WebDOMString&);
+ WebDOMString supplementalStr2() const;
+ void setSupplementalStr2(const WebDOMString&);
#endif
+ void supplementalMethod1();
+ WebDOMTestObj supplementalMethod2(const WebDOMString& strArg, const WebDOMTestObj& objArg);
+
WebCore::TestInterface* impl() const;
protected:
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
index 7543fc4ab..392911d6e 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestMediaQueryListListener.cpp
@@ -64,7 +64,7 @@ WebDOMTestMediaQueryListListener& WebDOMTestMediaQueryListListener::operator=(co
WebCore::TestMediaQueryListListener* WebDOMTestMediaQueryListListener::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestMediaQueryListListener::~WebDOMTestMediaQueryListListener()
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestNamedConstructor.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestNamedConstructor.cpp
index f0c3777bf..e0c365b51 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestNamedConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestNamedConstructor.cpp
@@ -62,7 +62,7 @@ WebDOMTestNamedConstructor& WebDOMTestNamedConstructor::operator=(const WebDOMTe
WebCore::TestNamedConstructor* WebDOMTestNamedConstructor::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestNamedConstructor::~WebDOMTestNamedConstructor()
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index 5ce103067..9dac2da8a 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -21,17 +21,33 @@
#include "config.h"
#include "WebDOMTestObj.h"
+#include "Document.h"
#include "HTMLNames.h"
#include "IDBKey.h"
#include "KURL.h"
#include "OptionsObject.h"
+#include "SVGPoint.h"
#include "SerializedScriptValue.h"
#include "TestObj.h"
+#include "WebDOMDocument.h"
#include "WebDOMIDBKey.h"
#include "WebDOMOptionsObject.h"
+#include "WebDOMSVGPoint.h"
#include "WebDOMString.h"
+#include "WebDOMa.h"
+#include "WebDOMb.h"
+#include "WebDOMbool.h"
+#include "WebDOMc.h"
+#include "WebDOMd.h"
+#include "WebDOMe.h"
#include "WebExceptionHandler.h"
#include "WebNativeEventListener.h"
+#include "a.h"
+#include "b.h"
+#include "bool.h"
+#include "c.h"
+#include "d.h"
+#include "e.h"
#include "wtf/text/AtomicString.h"
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
@@ -72,7 +88,7 @@ WebDOMTestObj& WebDOMTestObj::operator=(const WebDOMTestObj& copy)
WebCore::TestObj* WebDOMTestObj::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestObj::~WebDOMTestObj()
@@ -619,6 +635,62 @@ void WebDOMTestObj::setConditionalAttr6(const WebDOMTestObjectCConstructor& newC
}
#endif
+WebDOMDocument WebDOMTestObj::contentDocument() const
+{
+ if (!impl())
+ return WebDOMDocument();
+
+ return toWebKit(WTF::getPtr(impl()->contentDocument()));
+}
+
+WebDOMSVGPoint WebDOMTestObj::mutablePoint() const
+{
+ if (!impl())
+ return WebDOMSVGPoint();
+
+ return toWebKit(WTF::getPtr(impl()->mutablePoint()));
+}
+
+void WebDOMTestObj::setMutablePoint(const WebDOMSVGPoint& newMutablePoint)
+{
+ if (!impl())
+ return;
+
+ impl()->setMutablePoint(toWebCore(newMutablePoint));
+}
+
+WebDOMSVGPoint WebDOMTestObj::immutablePoint() const
+{
+ if (!impl())
+ return WebDOMSVGPoint();
+
+ return toWebKit(WTF::getPtr(impl()->immutablePoint()));
+}
+
+void WebDOMTestObj::setImmutablePoint(const WebDOMSVGPoint& newImmutablePoint)
+{
+ if (!impl())
+ return;
+
+ impl()->setImmutablePoint(toWebCore(newImmutablePoint));
+}
+
+float WebDOMTestObj::strictFloat() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->strictFloat();
+}
+
+void WebDOMTestObj::setStrictFloat(float newStrictFloat)
+{
+ if (!impl())
+ return;
+
+ impl()->setStrictFloat(newStrictFloat);
+}
+
int WebDOMTestObj::description() const
{
if (!impl())
@@ -760,30 +832,6 @@ void WebDOMTestObj::removeEventListener(const WebDOMString& type, const WebDOMEv
impl()->removeEventListener(type, toWebCore(listener), useCapture);
}
-void WebDOMTestObj::withDynamicFrame()
-{
- if (!impl())
- return;
-
- impl()->withDynamicFrame();
-}
-
-void WebDOMTestObj::withDynamicFrameAndArg(int intArg)
-{
- if (!impl())
- return;
-
- impl()->withDynamicFrameAndArg(intArg);
-}
-
-void WebDOMTestObj::withDynamicFrameAndOptionalArg(int intArg, int optionalArg)
-{
- if (!impl())
- return;
-
- impl()->withDynamicFrameAndOptionalArg(intArg, optionalArg);
-}
-
void WebDOMTestObj::withScriptStateVoid()
{
if (!impl())
@@ -929,6 +977,81 @@ void WebDOMTestObj::overloadedMethod1(const WebDOMString& type)
#endif
+void WebDOMTestObj::convert1(const WebDOMa& )
+{
+ if (!impl())
+ return;
+
+ impl()->convert1(toWebCore());
+}
+
+void WebDOMTestObj::convert2(const WebDOMb& )
+{
+ if (!impl())
+ return;
+
+ impl()->convert2(toWebCore());
+}
+
+void WebDOMTestObj::convert3(const WebDOMc& )
+{
+ if (!impl())
+ return;
+
+ impl()->convert3(toWebCore());
+}
+
+void WebDOMTestObj::convert4(const WebDOMd& )
+{
+ if (!impl())
+ return;
+
+ impl()->convert4(toWebCore());
+}
+
+void WebDOMTestObj::convert5(const WebDOMe& )
+{
+ if (!impl())
+ return;
+
+ impl()->convert5(toWebCore());
+}
+
+WebDOMSVGPoint WebDOMTestObj::mutablePointFunction()
+{
+ if (!impl())
+ return WebDOMSVGPoint();
+
+ return toWebKit(WTF::getPtr(impl()->mutablePointFunction()));
+}
+
+WebDOMSVGPoint WebDOMTestObj::immutablePointFunction()
+{
+ if (!impl())
+ return WebDOMSVGPoint();
+
+ return toWebKit(WTF::getPtr(impl()->immutablePointFunction()));
+}
+
+void WebDOMTestObj::orange()
+{
+ if (!impl())
+ return;
+
+ impl()->orange();
+}
+
+WebDOMbool WebDOMTestObj::strictFunction(const WebDOMString& str, float a, int b)
+{
+ if (!impl())
+ return WebDOMbool();
+
+ WebCore::ExceptionCode ec = 0;
+ WebDOMbool result = toWebKit(WTF::getPtr(impl()->strictFunction(str, a, b, ec)));
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return result;
+}
+
WebCore::TestObj* toWebCore(const WebDOMTestObj& wrapper)
{
return wrapper.impl();
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index b1a9278b2..e9b03bc3a 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -30,14 +30,22 @@ namespace WebCore {
class TestObj;
};
+class WebDOMDocument;
class WebDOMEventListener;
class WebDOMIDBKey;
class WebDOMOptionsObject;
+class WebDOMSVGPoint;
class WebDOMString;
class WebDOMTestObj;
class WebDOMTestObjectAConstructor;
class WebDOMTestObjectBConstructor;
class WebDOMTestObjectCConstructor;
+class WebDOMa;
+class WebDOMb;
+class WebDOMbool;
+class WebDOMc;
+class WebDOMd;
+class WebDOMe;
class WebDOMTestObj : public WebDOMObject {
public:
@@ -143,6 +151,13 @@ public:
WebDOMTestObjectCConstructor conditionalAttr6() const;
void setConditionalAttr6(const WebDOMTestObjectCConstructor&);
#endif
+ WebDOMDocument contentDocument() const;
+ WebDOMSVGPoint mutablePoint() const;
+ void setMutablePoint(const WebDOMSVGPoint&);
+ WebDOMSVGPoint immutablePoint() const;
+ void setImmutablePoint(const WebDOMSVGPoint&);
+ float strictFloat() const;
+ void setStrictFloat(float);
int description() const;
int id() const;
void setId(int);
@@ -163,11 +178,6 @@ public:
void customMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
void addEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture);
void removeEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture);
- void withDynamicFrame();
- void withDynamicFrameAndArg(int intArg);
- void withDynamicFrameAndOptionalArg(int intArg, int optionalArg);
- void withDynamicFrameAndUserGesture(int intArg);
- void withDynamicFrameAndUserGestureASAD(int intArg, int optionalArg);
void withScriptStateVoid();
WebDOMTestObj withScriptStateObj();
void withScriptStateVoidException();
@@ -183,6 +193,15 @@ public:
int classMethodWithOptional(int arg);
void overloadedMethod1(int arg);
void overloadedMethod1(const WebDOMString& type);
+ void convert1(const WebDOMa& );
+ void convert2(const WebDOMb& );
+ void convert3(const WebDOMc& );
+ void convert4(const WebDOMd& );
+ void convert5(const WebDOMe& );
+ WebDOMSVGPoint mutablePointFunction();
+ WebDOMSVGPoint immutablePointFunction();
+ void orange();
+ WebDOMbool strictFunction(const WebDOMString& str, float a, int b);
WebCore::TestObj* impl() const;
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.cpp
new file mode 100644
index 000000000..4410331c7
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.cpp
@@ -0,0 +1,93 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebDOMTestOverridingNameGetter.h"
+
+#include "KURL.h"
+#include "TestOverridingNameGetter.h"
+#include "WebDOMString.h"
+#include "WebExceptionHandler.h"
+#include "wtf/text/AtomicString.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+
+struct WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetterPrivate {
+ WebDOMTestOverridingNameGetterPrivate(WebCore::TestOverridingNameGetter* object = 0)
+ : impl(object)
+ {
+ }
+
+ RefPtr<WebCore::TestOverridingNameGetter> impl;
+};
+
+WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetter()
+ : WebDOMObject()
+ , m_impl(0)
+{
+}
+
+WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetter(WebCore::TestOverridingNameGetter* impl)
+ : WebDOMObject()
+ , m_impl(new WebDOMTestOverridingNameGetterPrivate(impl))
+{
+}
+
+WebDOMTestOverridingNameGetter::WebDOMTestOverridingNameGetter(const WebDOMTestOverridingNameGetter& copy)
+ : WebDOMObject()
+{
+ m_impl = copy.impl() ? new WebDOMTestOverridingNameGetterPrivate(copy.impl()) : 0;
+}
+
+WebDOMTestOverridingNameGetter& WebDOMTestOverridingNameGetter::operator=(const WebDOMTestOverridingNameGetter& copy)
+{
+ delete m_impl;
+ m_impl = copy.impl() ? new WebDOMTestOverridingNameGetterPrivate(copy.impl()) : 0;
+ return *this;
+}
+
+WebCore::TestOverridingNameGetter* WebDOMTestOverridingNameGetter::impl() const
+{
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
+}
+
+WebDOMTestOverridingNameGetter::~WebDOMTestOverridingNameGetter()
+{
+ delete m_impl;
+ m_impl = 0;
+}
+
+void WebDOMTestOverridingNameGetter::anotherFunction(const WebDOMString& str)
+{
+ if (!impl())
+ return;
+
+ impl()->anotherFunction(str);
+}
+
+WebCore::TestOverridingNameGetter* toWebCore(const WebDOMTestOverridingNameGetter& wrapper)
+{
+ return wrapper.impl();
+}
+
+WebDOMTestOverridingNameGetter toWebKit(WebCore::TestOverridingNameGetter* value)
+{
+ return WebDOMTestOverridingNameGetter(value);
+}
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.h b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.h
new file mode 100644
index 000000000..a6c681ef7
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestOverridingNameGetter.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebDOMTestOverridingNameGetter_h
+#define WebDOMTestOverridingNameGetter_h
+
+#include <WebDOMObject.h>
+#include <WebDOMString.h>
+
+namespace WebCore {
+class TestOverridingNameGetter;
+};
+
+
+class WebDOMTestOverridingNameGetter : public WebDOMObject {
+public:
+ WebDOMTestOverridingNameGetter();
+ explicit WebDOMTestOverridingNameGetter(WebCore::TestOverridingNameGetter*);
+ WebDOMTestOverridingNameGetter(const WebDOMTestOverridingNameGetter&);
+ WebDOMTestOverridingNameGetter& operator=(const WebDOMTestOverridingNameGetter&);
+ virtual ~WebDOMTestOverridingNameGetter();
+
+ void anotherFunction(const WebDOMString& str);
+
+ WebCore::TestOverridingNameGetter* impl() const;
+
+protected:
+ struct WebDOMTestOverridingNameGetterPrivate;
+ WebDOMTestOverridingNameGetterPrivate* m_impl;
+};
+
+WebCore::TestOverridingNameGetter* toWebCore(const WebDOMTestOverridingNameGetter&);
+WebDOMTestOverridingNameGetter toWebKit(WebCore::TestOverridingNameGetter*);
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp
index e16af2d97..edae8ad3c 100644
--- a/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp
@@ -66,7 +66,7 @@ WebDOMTestSerializedScriptValueInterface& WebDOMTestSerializedScriptValueInterfa
WebCore::TestSerializedScriptValueInterface* WebDOMTestSerializedScriptValueInterface::impl() const
{
- return m_impl ? m_impl->impl.get() : 0;
+ return m_impl ? WTF::getPtr(m_impl->impl) : 0;
}
WebDOMTestSerializedScriptValueInterface::~WebDOMTestSerializedScriptValueInterface()
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp
new file mode 100644
index 000000000..c93a92cd9
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp
@@ -0,0 +1,203 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <glib-object.h>
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
+#include "ExceptionCode.h"
+#include "JSMainThreadExecState.h"
+#include "TestActiveDOMObject.h"
+#include "WebKitDOMBinding.h"
+#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMNode.h"
+#include "webkit/WebKitDOMNodePrivate.h"
+#include "webkit/WebKitDOMTestActiveDOMObject.h"
+#include "webkit/WebKitDOMTestActiveDOMObjectPrivate.h"
+#include "webkitdefines.h"
+#include "webkitglobalsprivate.h"
+#include "webkitmarshal.h"
+
+namespace WebKit {
+
+WebKitDOMTestActiveDOMObject* kit(WebCore::TestActiveDOMObject* obj)
+{
+ g_return_val_if_fail(obj, 0);
+
+ if (gpointer ret = DOMObjectCache::get(obj))
+ return static_cast<WebKitDOMTestActiveDOMObject*>(ret);
+
+ return static_cast<WebKitDOMTestActiveDOMObject*>(DOMObjectCache::put(obj, WebKit::wrapTestActiveDOMObject(obj)));
+}
+
+} // namespace WebKit //
+
+void
+webkit_dom_test_active_dom_object_exciting_function(WebKitDOMTestActiveDOMObject* self, WebKitDOMNode* next_child)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestActiveDOMObject * item = WebKit::core(self);
+ g_return_if_fail(next_child);
+ WebCore::Node * converted_next_child = NULL;
+ if (next_child != NULL) {
+ converted_next_child = WebKit::core(next_child);
+ g_return_if_fail(converted_next_child);
+ }
+ item->excitingFunction(converted_next_child);
+}
+
+void
+webkit_dom_test_active_dom_object_post_message(WebKitDOMTestActiveDOMObject* self, const gchar* message)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestActiveDOMObject * item = WebKit::core(self);
+ g_return_if_fail(message);
+ WTF::String converted_message = WTF::String::fromUTF8(message);
+ item->postMessage(converted_message);
+}
+
+glong
+webkit_dom_test_active_dom_object_get_exciting_attr(WebKitDOMTestActiveDOMObject* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestActiveDOMObject * item = WebKit::core(self);
+ glong res = item->excitingAttr();
+ return res;
+}
+
+
+G_DEFINE_TYPE(WebKitDOMTestActiveDOMObject, webkit_dom_test_active_dom_object, WEBKIT_TYPE_DOM_OBJECT)
+
+namespace WebKit {
+
+WebCore::TestActiveDOMObject* core(WebKitDOMTestActiveDOMObject* request)
+{
+ g_return_val_if_fail(request, 0);
+
+ WebCore::TestActiveDOMObject* coreObject = static_cast<WebCore::TestActiveDOMObject*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+ g_return_val_if_fail(coreObject, 0);
+
+ return coreObject;
+}
+
+} // namespace WebKit
+enum {
+ PROP_0,
+ PROP_EXCITING_ATTR,
+};
+
+
+static void webkit_dom_test_active_dom_object_finalize(GObject* object)
+{
+ WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+
+ if (dom_object->coreObject) {
+ WebCore::TestActiveDOMObject* coreObject = static_cast<WebCore::TestActiveDOMObject *>(dom_object->coreObject);
+
+ WebKit::DOMObjectCache::forget(coreObject);
+ coreObject->deref();
+
+ dom_object->coreObject = NULL;
+ }
+
+ G_OBJECT_CLASS(webkit_dom_test_active_dom_object_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_active_dom_object_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_active_dom_object_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ WebKitDOMTestActiveDOMObject* self = WEBKIT_DOM_TEST_ACTIVE_DOM_OBJECT(object);
+ WebCore::TestActiveDOMObject* coreSelf = WebKit::core(self);
+ switch (prop_id) {
+ case PROP_EXCITING_ATTR:
+ {
+ g_value_set_long(value, coreSelf->excitingAttr());
+ break;
+ }
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_active_dom_object_constructed(GObject* object)
+{
+
+ if (G_OBJECT_CLASS(webkit_dom_test_active_dom_object_parent_class)->constructed)
+ G_OBJECT_CLASS(webkit_dom_test_active_dom_object_parent_class)->constructed(object);
+}
+
+static void webkit_dom_test_active_dom_object_class_init(WebKitDOMTestActiveDOMObjectClass* requestClass)
+{
+ GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+ gobjectClass->finalize = webkit_dom_test_active_dom_object_finalize;
+ gobjectClass->set_property = webkit_dom_test_active_dom_object_set_property;
+ gobjectClass->get_property = webkit_dom_test_active_dom_object_get_property;
+ gobjectClass->constructed = webkit_dom_test_active_dom_object_constructed;
+
+ g_object_class_install_property(gobjectClass,
+ PROP_EXCITING_ATTR,
+ g_param_spec_long("exciting-attr", /* name */
+ "test_active_dom_object_exciting-attr", /* short description */
+ "read-only glong TestActiveDOMObject.exciting-attr", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READABLE));
+
+
+}
+
+static void webkit_dom_test_active_dom_object_init(WebKitDOMTestActiveDOMObject* request)
+{
+}
+
+namespace WebKit {
+WebKitDOMTestActiveDOMObject* wrapTestActiveDOMObject(WebCore::TestActiveDOMObject* coreObject)
+{
+ g_return_val_if_fail(coreObject, 0);
+
+ /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+ * in a C-allocated GObject structure. See the finalize() code for the
+ * matching deref().
+ */
+ coreObject->ref();
+
+ return WEBKIT_DOM_TEST_ACTIVE_DOM_OBJECT(g_object_new(WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT,
+ "core-object", coreObject, NULL));
+}
+} // namespace WebKit
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h
new file mode 100644
index 000000000..f3cfdb3a9
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.h
@@ -0,0 +1,83 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WebKitDOMTestActiveDOMObject_h
+#define WebKitDOMTestActiveDOMObject_h
+
+#include "webkit/webkitdomdefines.h"
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+#include "webkit/WebKitDOMObject.h"
+
+
+G_BEGIN_DECLS
+#define WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT (webkit_dom_test_active_dom_object_get_type())
+#define WEBKIT_DOM_TEST_ACTIVE_DOM_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT, WebKitDOMTestActiveDOMObject))
+#define WEBKIT_DOM_TEST_ACTIVE_DOM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT, WebKitDOMTestActiveDOMObjectClass)
+#define WEBKIT_DOM_IS_TEST_ACTIVE_DOM_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT))
+#define WEBKIT_DOM_IS_TEST_ACTIVE_DOM_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT))
+#define WEBKIT_DOM_TEST_ACTIVE_DOM_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOM_TEST_ACTIVE_DOM_OBJECT, WebKitDOMTestActiveDOMObjectClass))
+
+struct _WebKitDOMTestActiveDOMObject {
+ WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestActiveDOMObjectClass {
+ WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_active_dom_object_get_type (void);
+
+/**
+ * webkit_dom_test_active_dom_object_exciting_function:
+ * @self: A #WebKitDOMTestActiveDOMObject
+ * @next_child: A #WebKitDOMNode
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_active_dom_object_exciting_function(WebKitDOMTestActiveDOMObject* self, WebKitDOMNode* next_child);
+
+/**
+ * webkit_dom_test_active_dom_object_post_message:
+ * @self: A #WebKitDOMTestActiveDOMObject
+ * @message: A #gchar
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_active_dom_object_post_message(WebKitDOMTestActiveDOMObject* self, const gchar* message);
+
+/**
+ * webkit_dom_test_active_dom_object_get_exciting_attr:
+ * @self: A #WebKitDOMTestActiveDOMObject
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API glong
+webkit_dom_test_active_dom_object_get_exciting_attr(WebKitDOMTestActiveDOMObject* self);
+
+G_END_DECLS
+
+#endif /* WebKitDOMTestActiveDOMObject_h */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h
new file mode 100644
index 000000000..f28c7f9d1
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObjectPrivate.h
@@ -0,0 +1,39 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WEB_KIT_DOM_TEST_ACTIVE_DOM_OBJECT_PRIVATE_H
+#define WEB_KIT_DOM_TEST_ACTIVE_DOM_OBJECT_PRIVATE_H
+
+#include <glib-object.h>
+#include <webkit/WebKitDOMObject.h>
+#include "TestActiveDOMObject.h"
+namespace WebKit {
+ WebKitDOMTestActiveDOMObject *
+ wrapTestActiveDOMObject(WebCore::TestActiveDOMObject *coreObject);
+
+ WebCore::TestActiveDOMObject *
+ core(WebKitDOMTestActiveDOMObject *request);
+
+ WebKitDOMTestActiveDOMObject*
+ kit(WebCore::TestActiveDOMObject* node);
+
+} // namespace WebKit
+
+#endif /* WEB_KIT_DOM_TEST_ACTIVE_DOM_OBJECT_PRIVATE_H */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp
new file mode 100644
index 000000000..c6ad86e43
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp
@@ -0,0 +1,220 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <glib-object.h>
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
+#include "ExceptionCode.h"
+#include "GObjectEventListener.h"
+#include "JSMainThreadExecState.h"
+#include "Node.h"
+#include "TestEventTarget.h"
+#include "WebKitDOMBinding.h"
+#include "WebKitDOMEventPrivate.h"
+#include "WebKitDOMEventTarget.h"
+#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMEvent.h"
+#include "webkit/WebKitDOMEventPrivate.h"
+#include "webkit/WebKitDOMNode.h"
+#include "webkit/WebKitDOMNodePrivate.h"
+#include "webkit/WebKitDOMTestEventTarget.h"
+#include "webkit/WebKitDOMTestEventTargetPrivate.h"
+#include "webkitdefines.h"
+#include "webkitglobalsprivate.h"
+#include "webkitmarshal.h"
+
+namespace WebKit {
+
+WebKitDOMTestEventTarget* kit(WebCore::TestEventTarget* obj)
+{
+ g_return_val_if_fail(obj, 0);
+
+ if (gpointer ret = DOMObjectCache::get(obj))
+ return static_cast<WebKitDOMTestEventTarget*>(ret);
+
+ return static_cast<WebKitDOMTestEventTarget*>(DOMObjectCache::put(obj, WebKit::wrapTestEventTarget(obj)));
+}
+
+} // namespace WebKit //
+
+static void webkit_dom_test_event_target_dispatch_event(WebKitDOMEventTarget* target, WebKitDOMEvent* event, GError** error)
+{
+ WebCore::Event* coreEvent = WebKit::core(event);
+ WebCore::TestEventTarget* coreTarget = static_cast<WebCore::TestEventTarget*>(WEBKIT_DOM_OBJECT(target)->coreObject);
+
+ WebCore::ExceptionCode ec = 0;
+ coreTarget->dispatchEvent(coreEvent, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription description(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), description.code, description.name);
+ }
+}
+
+static gboolean webkit_dom_test_event_target_add_event_listener(WebKitDOMEventTarget* target, const char* eventName, GCallback handler, gboolean bubble, gpointer userData)
+{
+ WebCore::TestEventTarget* coreTarget = static_cast<WebCore::TestEventTarget*>(WEBKIT_DOM_OBJECT(target)->coreObject);
+ return WebCore::GObjectEventListener::addEventListener(G_OBJECT(target), coreTarget, eventName, handler, bubble, userData);
+}
+
+static gboolean webkit_dom_test_event_target_remove_event_listener(WebKitDOMEventTarget* target, const char* eventName, GCallback handler, gboolean bubble)
+{
+ WebCore::TestEventTarget* coreTarget = static_cast<WebCore::TestEventTarget*>(WEBKIT_DOM_OBJECT(target)->coreObject);
+ return WebCore::GObjectEventListener::removeEventListener(G_OBJECT(target), coreTarget, eventName, handler, bubble);
+}
+
+static void webkit_dom_event_target_init(WebKitDOMEventTargetIface* iface)
+{
+ iface->dispatch_event = webkit_dom_test_event_target_dispatch_event;
+ iface->add_event_listener = webkit_dom_test_event_target_add_event_listener;
+ iface->remove_event_listener = webkit_dom_test_event_target_remove_event_listener;
+}
+
+WebKitDOMNode*
+webkit_dom_test_event_target_item(WebKitDOMTestEventTarget* self, gulong index)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestEventTarget * item = WebKit::core(self);
+ PassRefPtr<WebCore::Node> g_res = WTF::getPtr(item->item(index));
+ WebKitDOMNode* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+gboolean
+webkit_dom_test_event_target_dispatch_event(WebKitDOMTestEventTarget* self, WebKitDOMEvent* evt, GError **error)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestEventTarget * item = WebKit::core(self);
+ g_return_val_if_fail(evt, 0);
+ WebCore::Event * converted_evt = NULL;
+ if (evt != NULL) {
+ converted_evt = WebKit::core(evt);
+ g_return_val_if_fail(converted_evt, 0);
+ }
+ WebCore::ExceptionCode ec = 0;
+ gboolean res = item->dispatchEvent(converted_evt, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+ return res;
+}
+
+
+G_DEFINE_TYPE_WITH_CODE(WebKitDOMTestEventTarget, webkit_dom_test_event_target, WEBKIT_TYPE_DOM_OBJECT, G_IMPLEMENT_INTERFACE(WEBKIT_TYPE_DOM_EVENT_TARGET, webkit_dom_event_target_init))
+
+namespace WebKit {
+
+WebCore::TestEventTarget* core(WebKitDOMTestEventTarget* request)
+{
+ g_return_val_if_fail(request, 0);
+
+ WebCore::TestEventTarget* coreObject = static_cast<WebCore::TestEventTarget*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+ g_return_val_if_fail(coreObject, 0);
+
+ return coreObject;
+}
+
+} // namespace WebKit
+enum {
+ PROP_0,
+};
+
+
+static void webkit_dom_test_event_target_finalize(GObject* object)
+{
+ WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+
+ if (dom_object->coreObject) {
+ WebCore::TestEventTarget* coreObject = static_cast<WebCore::TestEventTarget *>(dom_object->coreObject);
+
+ WebKit::DOMObjectCache::forget(coreObject);
+ coreObject->deref();
+
+ dom_object->coreObject = NULL;
+ }
+
+ G_OBJECT_CLASS(webkit_dom_test_event_target_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_event_target_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_event_target_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_event_target_constructed(GObject* object)
+{
+
+ if (G_OBJECT_CLASS(webkit_dom_test_event_target_parent_class)->constructed)
+ G_OBJECT_CLASS(webkit_dom_test_event_target_parent_class)->constructed(object);
+}
+
+static void webkit_dom_test_event_target_class_init(WebKitDOMTestEventTargetClass* requestClass)
+{
+ GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+ gobjectClass->finalize = webkit_dom_test_event_target_finalize;
+ gobjectClass->set_property = webkit_dom_test_event_target_set_property;
+ gobjectClass->get_property = webkit_dom_test_event_target_get_property;
+ gobjectClass->constructed = webkit_dom_test_event_target_constructed;
+
+
+
+}
+
+static void webkit_dom_test_event_target_init(WebKitDOMTestEventTarget* request)
+{
+}
+
+namespace WebKit {
+WebKitDOMTestEventTarget* wrapTestEventTarget(WebCore::TestEventTarget* coreObject)
+{
+ g_return_val_if_fail(coreObject, 0);
+
+ /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+ * in a C-allocated GObject structure. See the finalize() code for the
+ * matching deref().
+ */
+ coreObject->ref();
+
+ return WEBKIT_DOM_TEST_EVENT_TARGET(g_object_new(WEBKIT_TYPE_DOM_TEST_EVENT_TARGET,
+ "core-object", coreObject, NULL));
+}
+} // namespace WebKit
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h
new file mode 100644
index 000000000..c10635b57
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTarget.h
@@ -0,0 +1,74 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WebKitDOMTestEventTarget_h
+#define WebKitDOMTestEventTarget_h
+
+#include "webkit/webkitdomdefines.h"
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+#include "webkit/WebKitDOMObject.h"
+
+
+G_BEGIN_DECLS
+#define WEBKIT_TYPE_DOM_TEST_EVENT_TARGET (webkit_dom_test_event_target_get_type())
+#define WEBKIT_DOM_TEST_EVENT_TARGET(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_TEST_EVENT_TARGET, WebKitDOMTestEventTarget))
+#define WEBKIT_DOM_TEST_EVENT_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOM_TEST_EVENT_TARGET, WebKitDOMTestEventTargetClass)
+#define WEBKIT_DOM_IS_TEST_EVENT_TARGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_TEST_EVENT_TARGET))
+#define WEBKIT_DOM_IS_TEST_EVENT_TARGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOM_TEST_EVENT_TARGET))
+#define WEBKIT_DOM_TEST_EVENT_TARGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOM_TEST_EVENT_TARGET, WebKitDOMTestEventTargetClass))
+
+struct _WebKitDOMTestEventTarget {
+ WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestEventTargetClass {
+ WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_event_target_get_type (void);
+
+/**
+ * webkit_dom_test_event_target_item:
+ * @self: A #WebKitDOMTestEventTarget
+ * @index: A #gulong
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMNode*
+webkit_dom_test_event_target_item(WebKitDOMTestEventTarget* self, gulong index);
+
+/**
+ * webkit_dom_test_event_target_dispatch_event:
+ * @self: A #WebKitDOMTestEventTarget
+ * @evt: A #WebKitDOMEvent
+ * @error: #GError
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API gboolean
+webkit_dom_test_event_target_dispatch_event(WebKitDOMTestEventTarget* self, WebKitDOMEvent* evt, GError **error);
+
+G_END_DECLS
+
+#endif /* WebKitDOMTestEventTarget_h */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h
new file mode 100644
index 000000000..e5616e3df
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventTargetPrivate.h
@@ -0,0 +1,39 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WEB_KIT_DOM_TEST_EVENT_TARGET_PRIVATE_H
+#define WEB_KIT_DOM_TEST_EVENT_TARGET_PRIVATE_H
+
+#include <glib-object.h>
+#include <webkit/WebKitDOMObject.h>
+#include "TestEventTarget.h"
+namespace WebKit {
+ WebKitDOMTestEventTarget *
+ wrapTestEventTarget(WebCore::TestEventTarget *coreObject);
+
+ WebCore::TestEventTarget *
+ core(WebKitDOMTestEventTarget *request);
+
+ WebKitDOMTestEventTarget*
+ kit(WebCore::TestEventTarget* node);
+
+} // namespace WebKit
+
+#endif /* WEB_KIT_DOM_TEST_EVENT_TARGET_PRIVATE_H */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
index 5f8fafed3..26ab91bc8 100644
--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
@@ -29,11 +29,14 @@
#include "ExceptionCode.h"
#include "JSMainThreadExecState.h"
#include "TestInterface.h"
+#include "TestObj.h"
#include "TestSupplemental.h"
#include "WebKitDOMBinding.h"
#include "gobject/ConvertToUTF8String.h"
#include "webkit/WebKitDOMTestInterface.h"
#include "webkit/WebKitDOMTestInterfacePrivate.h"
+#include "webkit/WebKitDOMTestObj.h"
+#include "webkit/WebKitDOMTestObjPrivate.h"
#include "webkitdefines.h"
#include "webkitglobalsprivate.h"
#include "webkitmarshal.h"
@@ -52,14 +55,53 @@ WebKitDOMTestInterface* kit(WebCore::TestInterface* obj)
} // namespace WebKit //
+void
+webkit_dom_test_interface_supplemental_method1(WebKitDOMTestInterface* self)
+{
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestInterface * item = WebKit::core(self);
+ TestSupplemental::supplementalMethod1(item);
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+}
+
+WebKitDOMTestObj*
+webkit_dom_test_interface_supplemental_method2(WebKitDOMTestInterface* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error)
+{
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestInterface * item = WebKit::core(self);
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WTF::String converted_str_arg = WTF::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = NULL;
+ if (obj_arg != NULL) {
+ converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ }
+ WebCore::ExceptionCode ec = 0;
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(TestSupplemental::supplementalMethod2(item, converted_str_arg, converted_obj_arg, ec));
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+ WebKitDOMTestObj* res = WebKit::kit(g_res.get());
+ return res;
+#else
+ return NULL;
+#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
+}
+
gchar*
-webkit_dom_test_interface_get_str1(WebKitDOMTestInterface* self)
+webkit_dom_test_interface_get_supplemental_str1(WebKitDOMTestInterface* self)
{
#if ENABLE(Condition11) || ENABLE(Condition12)
g_return_val_if_fail(self, 0);
WebCore::JSMainThreadNullState state;
WebCore::TestInterface * item = WebKit::core(self);
- gchar* res = convertToUTF8String(TestSupplemental::str1(item));
+ gchar* res = convertToUTF8String(TestSupplemental::supplementalStr1(item));
return res;
#else
return NULL;
@@ -67,13 +109,13 @@ webkit_dom_test_interface_get_str1(WebKitDOMTestInterface* self)
}
gchar*
-webkit_dom_test_interface_get_str2(WebKitDOMTestInterface* self)
+webkit_dom_test_interface_get_supplemental_str2(WebKitDOMTestInterface* self)
{
#if ENABLE(Condition11) || ENABLE(Condition12)
g_return_val_if_fail(self, 0);
WebCore::JSMainThreadNullState state;
WebCore::TestInterface * item = WebKit::core(self);
- gchar* res = convertToUTF8String(TestSupplemental::str2(item));
+ gchar* res = convertToUTF8String(TestSupplemental::supplementalStr2(item));
return res;
#else
return NULL;
@@ -81,7 +123,7 @@ webkit_dom_test_interface_get_str2(WebKitDOMTestInterface* self)
}
void
-webkit_dom_test_interface_set_str2(WebKitDOMTestInterface* self, const gchar* value)
+webkit_dom_test_interface_set_supplemental_str2(WebKitDOMTestInterface* self, const gchar* value)
{
#if ENABLE(Condition11) || ENABLE(Condition12)
g_return_if_fail(self);
@@ -89,7 +131,7 @@ webkit_dom_test_interface_set_str2(WebKitDOMTestInterface* self, const gchar* va
WebCore::TestInterface * item = WebKit::core(self);
g_return_if_fail(value);
WTF::String converted_value = WTF::String::fromUTF8(value);
- TestSupplemental::setStr2(item, converted_value);
+ TestSupplemental::setSupplementalStr2(item, converted_value);
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
}
@@ -112,10 +154,10 @@ WebCore::TestInterface* core(WebKitDOMTestInterface* request)
enum {
PROP_0,
#if ENABLE(Condition11) || ENABLE(Condition12)
- PROP_STR1,
+ PROP_SUPPLEMENTAL_STR1,
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
#if ENABLE(Condition11) || ENABLE(Condition12)
- PROP_STR2,
+ PROP_SUPPLEMENTAL_STR2,
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
};
@@ -143,9 +185,9 @@ static void webkit_dom_test_interface_set_property(GObject* object, guint prop_i
WebCore::TestInterface* coreSelf = WebKit::core(self);
switch (prop_id) {
#if ENABLE(Condition11) || ENABLE(Condition12)
- case PROP_STR2:
+ case PROP_SUPPLEMENTAL_STR2:
{
- TestSupplemental::setStr2(coreSelf, WTF::String::fromUTF8(g_value_get_string(value)));
+ TestSupplemental::setSupplementalStr2(coreSelf, WTF::String::fromUTF8(g_value_get_string(value)));
break;
}
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
@@ -163,16 +205,16 @@ static void webkit_dom_test_interface_get_property(GObject* object, guint prop_i
WebCore::TestInterface* coreSelf = WebKit::core(self);
switch (prop_id) {
#if ENABLE(Condition11) || ENABLE(Condition12)
- case PROP_STR1:
+ case PROP_SUPPLEMENTAL_STR1:
{
- g_value_take_string(value, convertToUTF8String(TestSupplemental::str1(coreSelf)));
+ g_value_take_string(value, convertToUTF8String(TestSupplemental::supplementalStr1(coreSelf)));
break;
}
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
#if ENABLE(Condition11) || ENABLE(Condition12)
- case PROP_STR2:
+ case PROP_SUPPLEMENTAL_STR2:
{
- g_value_take_string(value, convertToUTF8String(TestSupplemental::str2(coreSelf)));
+ g_value_take_string(value, convertToUTF8String(TestSupplemental::supplementalStr2(coreSelf)));
break;
}
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
@@ -200,19 +242,19 @@ static void webkit_dom_test_interface_class_init(WebKitDOMTestInterfaceClass* re
#if ENABLE(Condition11) || ENABLE(Condition12)
g_object_class_install_property(gobjectClass,
- PROP_STR1,
- g_param_spec_string("str1", /* name */
- "test_interface_str1", /* short description */
- "read-only gchar* TestInterface.str1", /* longer - could do with some extra doc stuff here */
+ PROP_SUPPLEMENTAL_STR1,
+ g_param_spec_string("supplemental-str1", /* name */
+ "test_interface_supplemental-str1", /* short description */
+ "read-only gchar* TestInterface.supplemental-str1", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READABLE));
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
#if ENABLE(Condition11) || ENABLE(Condition12)
g_object_class_install_property(gobjectClass,
- PROP_STR2,
- g_param_spec_string("str2", /* name */
- "test_interface_str2", /* short description */
- "read-write gchar* TestInterface.str2", /* longer - could do with some extra doc stuff here */
+ PROP_SUPPLEMENTAL_STR2,
+ g_param_spec_string("supplemental-str2", /* name */
+ "test_interface_supplemental-str2", /* short description */
+ "read-write gchar* TestInterface.supplemental-str2", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READWRITE));
#endif /* ENABLE(Condition11) || ENABLE(Condition12) */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.h
index 7c365058b..ea1a7b150 100644
--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.h
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.h
@@ -47,27 +47,50 @@ WEBKIT_API GType
webkit_dom_test_interface_get_type (void);
/**
- * webkit_dom_test_interface_get_str1:
+ * webkit_dom_test_interface_supplemental_method1:
+ * @self: A #WebKitDOMTestInterface
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_interface_supplemental_method1(WebKitDOMTestInterface* self);
+
+/**
+ * webkit_dom_test_interface_supplemental_method2:
+ * @self: A #WebKitDOMTestInterface
+ * @str_arg: A #gchar
+ * @obj_arg: A #WebKitDOMTestObj
+ * @error: #GError
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMTestObj*
+webkit_dom_test_interface_supplemental_method2(WebKitDOMTestInterface* self, const gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error);
+
+/**
+ * webkit_dom_test_interface_get_supplemental_str1:
* @self: A #WebKitDOMTestInterface
*
* Returns:
*
**/
WEBKIT_API gchar*
-webkit_dom_test_interface_get_str1(WebKitDOMTestInterface* self);
+webkit_dom_test_interface_get_supplemental_str1(WebKitDOMTestInterface* self);
/**
- * webkit_dom_test_interface_get_str2:
+ * webkit_dom_test_interface_get_supplemental_str2:
* @self: A #WebKitDOMTestInterface
*
* Returns:
*
**/
WEBKIT_API gchar*
-webkit_dom_test_interface_get_str2(WebKitDOMTestInterface* self);
+webkit_dom_test_interface_get_supplemental_str2(WebKitDOMTestInterface* self);
/**
- * webkit_dom_test_interface_set_str2:
+ * webkit_dom_test_interface_set_supplemental_str2:
* @self: A #WebKitDOMTestInterface
* @value: A #gchar
*
@@ -75,7 +98,7 @@ webkit_dom_test_interface_get_str2(WebKitDOMTestInterface* self);
*
**/
WEBKIT_API void
-webkit_dom_test_interface_set_str2(WebKitDOMTestInterface* self, const gchar* value);
+webkit_dom_test_interface_set_supplemental_str2(WebKitDOMTestInterface* self, const gchar* value);
G_END_DECLS
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index c92625580..70147cb81 100644
--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -24,20 +24,39 @@
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "DOMObjectCache.h"
+#include "Document.h"
#include "ExceptionCode.h"
#include "HTMLNames.h"
#include "JSMainThreadExecState.h"
+#include "SVGPoint.h"
#include "TestObj.h"
#include "WebKitDOMBinding.h"
+#include "bool.h"
#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMDocument.h"
+#include "webkit/WebKitDOMDocumentPrivate.h"
#include "webkit/WebKitDOMIDBKey.h"
#include "webkit/WebKitDOMIDBKeyPrivate.h"
#include "webkit/WebKitDOMOptionsObject.h"
#include "webkit/WebKitDOMOptionsObjectPrivate.h"
+#include "webkit/WebKitDOMSVGPoint.h"
+#include "webkit/WebKitDOMSVGPointPrivate.h"
#include "webkit/WebKitDOMSerializedScriptValue.h"
#include "webkit/WebKitDOMSerializedScriptValuePrivate.h"
#include "webkit/WebKitDOMTestObj.h"
#include "webkit/WebKitDOMTestObjPrivate.h"
+#include "webkit/WebKitDOMa.h"
+#include "webkit/WebKitDOMaPrivate.h"
+#include "webkit/WebKitDOMb.h"
+#include "webkit/WebKitDOMbPrivate.h"
+#include "webkit/WebKitDOMbool.h"
+#include "webkit/WebKitDOMboolPrivate.h"
+#include "webkit/WebKitDOMc.h"
+#include "webkit/WebKitDOMcPrivate.h"
+#include "webkit/WebKitDOMd.h"
+#include "webkit/WebKitDOMdPrivate.h"
+#include "webkit/WebKitDOMe.h"
+#include "webkit/WebKitDOMePrivate.h"
#include "webkitdefines.h"
#include "webkitglobalsprivate.h"
#include "webkitmarshal.h"
@@ -230,51 +249,6 @@ webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error
}
void
-webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self)
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- item->withDynamicFrame();
-}
-
-void
-webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int_arg)
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- item->withDynamicFrameAndArg(int_arg);
-}
-
-void
-webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, glong int_arg, glong optional_arg)
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- item->withDynamicFrameAndOptionalArg(int_arg, optional_arg);
-}
-
-void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg, gboolean isUserGesture)
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- 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, gboolean isUserGesture)
-{
- g_return_if_fail(self);
- WebCore::JSMainThreadNullState state;
- WebCore::TestObj * item = WebKit::core(self);
- item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg, false);
-}
-
-void
webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
{
g_return_if_fail(self);
@@ -439,6 +413,130 @@ webkit_dom_test_obj_overloaded_method1(WebKitDOMTestObj* self, const gchar* type
#endif /* ENABLE(Condition1) */
}
+void
+webkit_dom_test_obj_convert1(WebKitDOMTestObj* self, WebKitDOMa* )
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail();
+ WebCore::a * converted_ = NULL;
+ if ( != NULL) {
+ converted_ = WebKit::core();
+ g_return_if_fail(converted_);
+ }
+ item->convert1(converted_);
+}
+
+void
+webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMb* )
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail();
+ WebCore::b * converted_ = NULL;
+ if ( != NULL) {
+ converted_ = WebKit::core();
+ g_return_if_fail(converted_);
+ }
+ item->convert2(converted_);
+}
+
+void
+webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, WebKitDOMc* )
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail();
+ WebCore::c * converted_ = NULL;
+ if ( != NULL) {
+ converted_ = WebKit::core();
+ g_return_if_fail(converted_);
+ }
+ item->convert3(converted_);
+}
+
+void
+webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMd* )
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail();
+ WebCore::d * converted_ = NULL;
+ if ( != NULL) {
+ converted_ = WebKit::core();
+ g_return_if_fail(converted_);
+ }
+ item->convert4(converted_);
+}
+
+void
+webkit_dom_test_obj_convert5(WebKitDOMTestObj* self, WebKitDOMe* )
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail();
+ WebCore::e * converted_ = NULL;
+ if ( != NULL) {
+ converted_ = WebKit::core();
+ g_return_if_fail(converted_);
+ }
+ item->convert5(converted_);
+}
+
+WebKitDOMSVGPoint*
+webkit_dom_test_obj_mutable_point_function(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ PassRefPtr<WebCore::SVGPoint> g_res = WTF::getPtr(item->mutablePointFunction());
+ WebKitDOMSVGPoint* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+WebKitDOMSVGPoint*
+webkit_dom_test_obj_immutable_point_function(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ PassRefPtr<WebCore::SVGPoint> g_res = WTF::getPtr(item->immutablePointFunction());
+ WebKitDOMSVGPoint* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+void
+webkit_dom_test_obj_orange(WebKitDOMTestObj* self)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ item->orange();
+}
+
+WebKitDOMbool*
+webkit_dom_test_obj_strict_function(WebKitDOMTestObj* self, const gchar* str, gfloat a, gint b, GError **error)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_val_if_fail(str, 0);
+ WTF::String converted_str = WTF::String::fromUTF8(str);
+ WebCore::ExceptionCode ec = 0;
+ PassRefPtr<WebCore::bool> g_res = WTF::getPtr(item->strictFunction(converted_str, a, b, ec));
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc(ec);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+ WebKitDOMbool* res = WebKit::kit(g_res.get());
+ return res;
+}
+
glong
webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self)
{
@@ -1069,6 +1167,88 @@ webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value)
#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
}
+WebKitDOMDocument*
+webkit_dom_test_obj_get_content_document(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ PassRefPtr<WebCore::Document> g_res = WTF::getPtr(item->contentDocument());
+ WebKitDOMDocument* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+WebKitDOMSVGPoint*
+webkit_dom_test_obj_get_mutable_point(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ PassRefPtr<WebCore::SVGPoint> g_res = WTF::getPtr(item->mutablePoint());
+ WebKitDOMSVGPoint* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_mutable_point(WebKitDOMTestObj* self, WebKitDOMSVGPoint* value)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::SVGPoint * converted_value = NULL;
+ if (value != NULL) {
+ converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ }
+ item->setMutablePoint(converted_value);
+}
+
+WebKitDOMSVGPoint*
+webkit_dom_test_obj_get_immutable_point(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ PassRefPtr<WebCore::SVGPoint> g_res = WTF::getPtr(item->immutablePoint());
+ WebKitDOMSVGPoint* res = WebKit::kit(g_res.get());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_immutable_point(WebKitDOMTestObj* self, WebKitDOMSVGPoint* value)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::SVGPoint * converted_value = NULL;
+ if (value != NULL) {
+ converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ }
+ item->setImmutablePoint(converted_value);
+}
+
+gfloat
+webkit_dom_test_obj_get_strict_float(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ gfloat res = item->strictFloat();
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_strict_float(WebKitDOMTestObj* self, gfloat value)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setStrictFloat(value);
+}
+
glong
webkit_dom_test_obj_get_description(WebKitDOMTestObj* self)
{
@@ -1164,6 +1344,10 @@ enum {
#if ENABLE(Condition1) || ENABLE(Condition2)
PROP_CONDITIONAL_ATTR3,
#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+ PROP_CONTENT_DOCUMENT,
+ PROP_MUTABLE_POINT,
+ PROP_IMMUTABLE_POINT,
+ PROP_STRICT_FLOAT,
PROP_DESCRIPTION,
PROP_ID,
PROP_HASH,
@@ -1317,6 +1501,11 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
break;
}
#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+ case PROP_STRICT_FLOAT:
+ {
+ coreSelf->setStrictFloat((g_value_get_float(value)));
+ break;
+ }
case PROP_ID:
{
coreSelf->setId((g_value_get_long(value)));
@@ -1501,6 +1690,29 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa
break;
}
#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+ case PROP_CONTENT_DOCUMENT:
+ {
+ RefPtr<WebCore::Document> ptr = coreSelf->contentDocument();
+ g_value_set_object(value, WebKit::kit(ptr.get()));
+ break;
+ }
+ case PROP_MUTABLE_POINT:
+ {
+ RefPtr<WebCore::SVGPoint> ptr = coreSelf->mutablePoint();
+ g_value_set_object(value, WebKit::kit(ptr.get()));
+ break;
+ }
+ case PROP_IMMUTABLE_POINT:
+ {
+ RefPtr<WebCore::SVGPoint> ptr = coreSelf->immutablePoint();
+ g_value_set_object(value, WebKit::kit(ptr.get()));
+ break;
+ }
+ case PROP_STRICT_FLOAT:
+ {
+ g_value_set_float(value, coreSelf->strictFloat());
+ break;
+ }
case PROP_DESCRIPTION:
{
g_value_set_long(value, coreSelf->description());
@@ -1790,6 +2002,36 @@ G_MAXLONG, /* max */
WEBKIT_PARAM_READWRITE));
#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
g_object_class_install_property(gobjectClass,
+ PROP_CONTENT_DOCUMENT,
+ g_param_spec_object("content-document", /* name */
+ "test_obj_content-document", /* short description */
+ "read-only WebKitDOMDocument* TestObj.content-document", /* longer - could do with some extra doc stuff here */
+ WEBKIT_TYPE_DOM_DOCUMENT, /* gobject type */
+ WEBKIT_PARAM_READABLE));
+ g_object_class_install_property(gobjectClass,
+ PROP_MUTABLE_POINT,
+ g_param_spec_object("mutable-point", /* name */
+ "test_obj_mutable-point", /* short description */
+ "read-write WebKitDOMSVGPoint* TestObj.mutable-point", /* longer - could do with some extra doc stuff here */
+ WEBKIT_TYPE_DOM_SVG_POINT, /* gobject type */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_IMMUTABLE_POINT,
+ g_param_spec_object("immutable-point", /* name */
+ "test_obj_immutable-point", /* short description */
+ "read-write WebKitDOMSVGPoint* TestObj.immutable-point", /* longer - could do with some extra doc stuff here */
+ WEBKIT_TYPE_DOM_SVG_POINT, /* gobject type */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_STRICT_FLOAT,
+ g_param_spec_float("strict-float", /* name */
+ "test_obj_strict-float", /* short description */
+ "read-write gfloat TestObj.strict-float", /* longer - could do with some extra doc stuff here */
+ -G_MAXFLOAT, /* min */
+G_MAXFLOAT, /* max */
+0.0, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
PROP_DESCRIPTION,
g_param_spec_long("description", /* name */
"test_obj_description", /* short description */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
index c7696df5a..a60b97eea 100644
--- a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
@@ -174,62 +174,6 @@ WEBKIT_API void
webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error);
/**
- * webkit_dom_test_obj_with_dynamic_frame:
- * @self: A #WebKitDOMTestObj
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self);
-
-/**
- * webkit_dom_test_obj_with_dynamic_frame_and_arg:
- * @self: A #WebKitDOMTestObj
- * @int_arg: A #glong
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int_arg);
-
-/**
- * webkit_dom_test_obj_with_dynamic_frame_and_optional_arg:
- * @self: A #WebKitDOMTestObj
- * @int_arg: A #glong
- * @optional_arg: A #glong
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, glong int_arg, glong optional_arg);
-
-/**
- * webkit_dom_test_obj_with_dynamic_frame_and_user_gesture:
- * @self: A #WebKitDOMTestObj
- * @int_arg: A #glong
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg, gboolean isUserGesture);
-
-/**
- * webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad:
- * @self: A #WebKitDOMTestObj
- * @int_arg: A #glong
- * @optional_arg: A #glong
- *
- * Returns:
- *
-**/
-WEBKIT_API void
-webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg, gboolean isUserGesture);
-
-/**
* webkit_dom_test_obj_with_script_state_void:
* @self: A #WebKitDOMTestObj
*
@@ -391,6 +335,105 @@ WEBKIT_API void
webkit_dom_test_obj_overloaded_method1(WebKitDOMTestObj* self, const gchar* type);
/**
+ * webkit_dom_test_obj_convert1:
+ * @self: A #WebKitDOMTestObj
+ * @: A #WebKitDOMa
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_convert1(WebKitDOMTestObj* self, WebKitDOMa* );
+
+/**
+ * webkit_dom_test_obj_convert2:
+ * @self: A #WebKitDOMTestObj
+ * @: A #WebKitDOMb
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_convert2(WebKitDOMTestObj* self, WebKitDOMb* );
+
+/**
+ * webkit_dom_test_obj_convert3:
+ * @self: A #WebKitDOMTestObj
+ * @: A #WebKitDOMc
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_convert3(WebKitDOMTestObj* self, WebKitDOMc* );
+
+/**
+ * webkit_dom_test_obj_convert4:
+ * @self: A #WebKitDOMTestObj
+ * @: A #WebKitDOMd
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_convert4(WebKitDOMTestObj* self, WebKitDOMd* );
+
+/**
+ * webkit_dom_test_obj_convert5:
+ * @self: A #WebKitDOMTestObj
+ * @: A #WebKitDOMe
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_convert5(WebKitDOMTestObj* self, WebKitDOMe* );
+
+/**
+ * webkit_dom_test_obj_mutable_point_function:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMSVGPoint*
+webkit_dom_test_obj_mutable_point_function(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_immutable_point_function:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMSVGPoint*
+webkit_dom_test_obj_immutable_point_function(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_orange:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_orange(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_strict_function:
+ * @self: A #WebKitDOMTestObj
+ * @str: A #gchar
+ * @a: A #gfloat
+ * @b: A #gint
+ * @error: #GError
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMbool*
+webkit_dom_test_obj_strict_function(WebKitDOMTestObj* self, const gchar* str, gfloat a, gint b, GError **error);
+
+/**
* webkit_dom_test_obj_get_read_only_int_attr:
* @self: A #WebKitDOMTestObj
*
@@ -1004,6 +1047,79 @@ WEBKIT_API void
webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value);
/**
+ * webkit_dom_test_obj_get_content_document:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMDocument*
+webkit_dom_test_obj_get_content_document(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_get_mutable_point:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMSVGPoint*
+webkit_dom_test_obj_get_mutable_point(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_mutable_point:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #WebKitDOMSVGPoint
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_mutable_point(WebKitDOMTestObj* self, WebKitDOMSVGPoint* value);
+
+/**
+ * webkit_dom_test_obj_get_immutable_point:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API WebKitDOMSVGPoint*
+webkit_dom_test_obj_get_immutable_point(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_immutable_point:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #WebKitDOMSVGPoint
+ *
+ * Returns: (transfer none):
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_immutable_point(WebKitDOMTestObj* self, WebKitDOMSVGPoint* value);
+
+/**
+ * webkit_dom_test_obj_get_strict_float:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API gfloat
+webkit_dom_test_obj_get_strict_float(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_strict_float:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #gfloat
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_strict_float(WebKitDOMTestObj* self, gfloat value);
+
+/**
* webkit_dom_test_obj_get_description:
* @self: A #WebKitDOMTestObj
*
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.cpp b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.cpp
new file mode 100644
index 000000000..2f76ae1bb
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.cpp
@@ -0,0 +1,159 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include <glib-object.h>
+#include "config.h"
+
+#include <wtf/GetPtr.h>
+#include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
+#include "ExceptionCode.h"
+#include "JSMainThreadExecState.h"
+#include "TestOverridingNameGetter.h"
+#include "WebKitDOMBinding.h"
+#include "gobject/ConvertToUTF8String.h"
+#include "webkit/WebKitDOMTestOverridingNameGetter.h"
+#include "webkit/WebKitDOMTestOverridingNameGetterPrivate.h"
+#include "webkitdefines.h"
+#include "webkitglobalsprivate.h"
+#include "webkitmarshal.h"
+
+namespace WebKit {
+
+WebKitDOMTestOverridingNameGetter* kit(WebCore::TestOverridingNameGetter* obj)
+{
+ g_return_val_if_fail(obj, 0);
+
+ if (gpointer ret = DOMObjectCache::get(obj))
+ return static_cast<WebKitDOMTestOverridingNameGetter*>(ret);
+
+ return static_cast<WebKitDOMTestOverridingNameGetter*>(DOMObjectCache::put(obj, WebKit::wrapTestOverridingNameGetter(obj)));
+}
+
+} // namespace WebKit //
+
+void
+webkit_dom_test_overriding_name_getter_another_function(WebKitDOMTestOverridingNameGetter* self, const gchar* str)
+{
+ g_return_if_fail(self);
+ WebCore::JSMainThreadNullState state;
+ WebCore::TestOverridingNameGetter * item = WebKit::core(self);
+ g_return_if_fail(str);
+ WTF::String converted_str = WTF::String::fromUTF8(str);
+ item->anotherFunction(converted_str);
+}
+
+
+G_DEFINE_TYPE(WebKitDOMTestOverridingNameGetter, webkit_dom_test_overriding_name_getter, WEBKIT_TYPE_DOM_OBJECT)
+
+namespace WebKit {
+
+WebCore::TestOverridingNameGetter* core(WebKitDOMTestOverridingNameGetter* request)
+{
+ g_return_val_if_fail(request, 0);
+
+ WebCore::TestOverridingNameGetter* coreObject = static_cast<WebCore::TestOverridingNameGetter*>(WEBKIT_DOM_OBJECT(request)->coreObject);
+ g_return_val_if_fail(coreObject, 0);
+
+ return coreObject;
+}
+
+} // namespace WebKit
+enum {
+ PROP_0,
+};
+
+
+static void webkit_dom_test_overriding_name_getter_finalize(GObject* object)
+{
+ WebKitDOMObject* dom_object = WEBKIT_DOM_OBJECT(object);
+
+ if (dom_object->coreObject) {
+ WebCore::TestOverridingNameGetter* coreObject = static_cast<WebCore::TestOverridingNameGetter *>(dom_object->coreObject);
+
+ WebKit::DOMObjectCache::forget(coreObject);
+ coreObject->deref();
+
+ dom_object->coreObject = NULL;
+ }
+
+ G_OBJECT_CLASS(webkit_dom_test_overriding_name_getter_parent_class)->finalize(object);
+}
+
+static void webkit_dom_test_overriding_name_getter_set_property(GObject* object, guint prop_id, const GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_overriding_name_getter_get_property(GObject* object, guint prop_id, GValue* value, GParamSpec* pspec)
+{
+ WebCore::JSMainThreadNullState state;
+ switch (prop_id) {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
+ break;
+ }
+}
+
+
+static void webkit_dom_test_overriding_name_getter_constructed(GObject* object)
+{
+
+ if (G_OBJECT_CLASS(webkit_dom_test_overriding_name_getter_parent_class)->constructed)
+ G_OBJECT_CLASS(webkit_dom_test_overriding_name_getter_parent_class)->constructed(object);
+}
+
+static void webkit_dom_test_overriding_name_getter_class_init(WebKitDOMTestOverridingNameGetterClass* requestClass)
+{
+ GObjectClass *gobjectClass = G_OBJECT_CLASS(requestClass);
+ gobjectClass->finalize = webkit_dom_test_overriding_name_getter_finalize;
+ gobjectClass->set_property = webkit_dom_test_overriding_name_getter_set_property;
+ gobjectClass->get_property = webkit_dom_test_overriding_name_getter_get_property;
+ gobjectClass->constructed = webkit_dom_test_overriding_name_getter_constructed;
+
+
+
+}
+
+static void webkit_dom_test_overriding_name_getter_init(WebKitDOMTestOverridingNameGetter* request)
+{
+}
+
+namespace WebKit {
+WebKitDOMTestOverridingNameGetter* wrapTestOverridingNameGetter(WebCore::TestOverridingNameGetter* coreObject)
+{
+ g_return_val_if_fail(coreObject, 0);
+
+ /* We call ref() rather than using a C++ smart pointer because we can't store a C++ object
+ * in a C-allocated GObject structure. See the finalize() code for the
+ * matching deref().
+ */
+ coreObject->ref();
+
+ return WEBKIT_DOM_TEST_OVERRIDING_NAME_GETTER(g_object_new(WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER,
+ "core-object", coreObject, NULL));
+}
+} // namespace WebKit
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h
new file mode 100644
index 000000000..743432a5d
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetter.h
@@ -0,0 +1,62 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WebKitDOMTestOverridingNameGetter_h
+#define WebKitDOMTestOverridingNameGetter_h
+
+#include "webkit/webkitdomdefines.h"
+#include <glib-object.h>
+#include <webkit/webkitdefines.h>
+#include "webkit/WebKitDOMObject.h"
+
+
+G_BEGIN_DECLS
+#define WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER (webkit_dom_test_overriding_name_getter_get_type())
+#define WEBKIT_DOM_TEST_OVERRIDING_NAME_GETTER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER, WebKitDOMTestOverridingNameGetter))
+#define WEBKIT_DOM_TEST_OVERRIDING_NAME_GETTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER, WebKitDOMTestOverridingNameGetterClass)
+#define WEBKIT_DOM_IS_TEST_OVERRIDING_NAME_GETTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER))
+#define WEBKIT_DOM_IS_TEST_OVERRIDING_NAME_GETTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER))
+#define WEBKIT_DOM_TEST_OVERRIDING_NAME_GETTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_DOM_TEST_OVERRIDING_NAME_GETTER, WebKitDOMTestOverridingNameGetterClass))
+
+struct _WebKitDOMTestOverridingNameGetter {
+ WebKitDOMObject parent_instance;
+};
+
+struct _WebKitDOMTestOverridingNameGetterClass {
+ WebKitDOMObjectClass parent_class;
+};
+
+WEBKIT_API GType
+webkit_dom_test_overriding_name_getter_get_type (void);
+
+/**
+ * webkit_dom_test_overriding_name_getter_another_function:
+ * @self: A #WebKitDOMTestOverridingNameGetter
+ * @str: A #gchar
+ *
+ * Returns:
+ *
+**/
+WEBKIT_API void
+webkit_dom_test_overriding_name_getter_another_function(WebKitDOMTestOverridingNameGetter* self, const gchar* str);
+
+G_END_DECLS
+
+#endif /* WebKitDOMTestOverridingNameGetter_h */
diff --git a/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetterPrivate.h b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetterPrivate.h
new file mode 100644
index 000000000..174e3c670
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestOverridingNameGetterPrivate.h
@@ -0,0 +1,39 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef WEB_KIT_DOM_TEST_OVERRIDING_NAME_GETTER_PRIVATE_H
+#define WEB_KIT_DOM_TEST_OVERRIDING_NAME_GETTER_PRIVATE_H
+
+#include <glib-object.h>
+#include <webkit/WebKitDOMObject.h>
+#include "TestOverridingNameGetter.h"
+namespace WebKit {
+ WebKitDOMTestOverridingNameGetter *
+ wrapTestOverridingNameGetter(WebCore::TestOverridingNameGetter *coreObject);
+
+ WebCore::TestOverridingNameGetter *
+ core(WebKitDOMTestOverridingNameGetter *request);
+
+ WebKitDOMTestOverridingNameGetter*
+ kit(WebCore::TestOverridingNameGetter* node);
+
+} // namespace WebKit
+
+#endif /* WEB_KIT_DOM_TEST_OVERRIDING_NAME_GETTER_PRIVATE_H */
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
new file mode 100644
index 000000000..d7bfd9f0f
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.cpp
@@ -0,0 +1,247 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestActiveDOMObject.h"
+
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "JSNode.h"
+#include "TestActiveDOMObject.h"
+#include <runtime/Error.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSTestActiveDOMObject);
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestActiveDOMObject);
+
+/* Hash table */
+
+static const HashTableValue JSTestActiveDOMObjectTableValues[] =
+{
+ { "excitingAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestActiveDOMObjectExcitingAttr), (intptr_t)0, NoIntrinsic },
+ { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestActiveDOMObjectConstructor), (intptr_t)0, NoIntrinsic },
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestActiveDOMObjectTable = { 4, 3, JSTestActiveDOMObjectTableValues, 0 };
+/* Hash table for constructor */
+
+static const HashTableValue JSTestActiveDOMObjectConstructorTableValues[] =
+{
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestActiveDOMObjectConstructorTable = { 1, 0, JSTestActiveDOMObjectConstructorTableValues, 0 };
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestActiveDOMObjectConstructor);
+
+const ClassInfo JSTestActiveDOMObjectConstructor::s_info = { "TestActiveDOMObjectConstructor", &Base::s_info, &JSTestActiveDOMObjectConstructorTable, 0, CREATE_METHOD_TABLE(JSTestActiveDOMObjectConstructor) };
+
+JSTestActiveDOMObjectConstructor::JSTestActiveDOMObjectConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(structure, globalObject)
+{
+}
+
+void JSTestActiveDOMObjectConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+ Base::finishCreation(exec->globalData());
+ ASSERT(inherits(&s_info));
+ putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestActiveDOMObjectPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
+bool JSTestActiveDOMObjectConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestActiveDOMObjectConstructor, JSDOMWrapper>(exec, &JSTestActiveDOMObjectConstructorTable, static_cast<JSTestActiveDOMObjectConstructor*>(cell), propertyName, slot);
+}
+
+bool JSTestActiveDOMObjectConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestActiveDOMObjectConstructor, JSDOMWrapper>(exec, &JSTestActiveDOMObjectConstructorTable, static_cast<JSTestActiveDOMObjectConstructor*>(object), propertyName, descriptor);
+}
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestActiveDOMObjectPrototypeTableValues[] =
+{
+ { "excitingFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestActiveDOMObjectPrototypeFunctionExcitingFunction), (intptr_t)1, NoIntrinsic },
+ { "postMessage", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestActiveDOMObjectPrototypeFunctionPostMessage), (intptr_t)1, NoIntrinsic },
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestActiveDOMObjectPrototypeTable = { 4, 3, JSTestActiveDOMObjectPrototypeTableValues, 0 };
+const ClassInfo JSTestActiveDOMObjectPrototype::s_info = { "TestActiveDOMObjectPrototype", &Base::s_info, &JSTestActiveDOMObjectPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestActiveDOMObjectPrototype) };
+
+JSObject* JSTestActiveDOMObjectPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestActiveDOMObject>(exec, globalObject);
+}
+
+bool JSTestActiveDOMObjectPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestActiveDOMObjectPrototype* thisObject = jsCast<JSTestActiveDOMObjectPrototype*>(cell);
+ return getStaticFunctionSlot<JSObject>(exec, &JSTestActiveDOMObjectPrototypeTable, thisObject, propertyName, slot);
+}
+
+bool JSTestActiveDOMObjectPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestActiveDOMObjectPrototype* thisObject = jsCast<JSTestActiveDOMObjectPrototype*>(object);
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSTestActiveDOMObjectPrototypeTable, thisObject, propertyName, descriptor);
+}
+
+const ClassInfo JSTestActiveDOMObject::s_info = { "TestActiveDOMObject", &Base::s_info, &JSTestActiveDOMObjectTable, 0 , CREATE_METHOD_TABLE(JSTestActiveDOMObject) };
+
+JSTestActiveDOMObject::JSTestActiveDOMObject(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestActiveDOMObject> impl)
+ : JSDOMWrapper(structure, globalObject)
+ , m_impl(impl.leakRef())
+{
+}
+
+void JSTestActiveDOMObject::finishCreation(JSGlobalData& globalData)
+{
+ Base::finishCreation(globalData);
+ ASSERT(inherits(&s_info));
+}
+
+JSObject* JSTestActiveDOMObject::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return JSTestActiveDOMObjectPrototype::create(exec->globalData(), globalObject, JSTestActiveDOMObjectPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
+}
+
+void JSTestActiveDOMObject::destroy(JSC::JSCell* cell)
+{
+ JSTestActiveDOMObject* thisObject = jsCast<JSTestActiveDOMObject*>(cell);
+ thisObject->releaseImplIfNotNull();
+}
+
+bool JSTestActiveDOMObject::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestActiveDOMObject* thisObject = jsCast<JSTestActiveDOMObject*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ return getStaticValueSlot<JSTestActiveDOMObject, Base>(exec, &JSTestActiveDOMObjectTable, thisObject, propertyName, slot);
+}
+
+bool JSTestActiveDOMObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestActiveDOMObject* thisObject = jsCast<JSTestActiveDOMObject*>(object);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ if (!allowAccessToFrame(exec, thisObject->impl()->frame()))
+ return false;
+ return getStaticValueDescriptor<JSTestActiveDOMObject, Base>(exec, &JSTestActiveDOMObjectTable, thisObject, propertyName, descriptor);
+}
+
+JSValue jsTestActiveDOMObjectExcitingAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestActiveDOMObject* castedThis = static_cast<JSTestActiveDOMObject*>(asObject(slotBase));
+ if (!castedThis->allowsAccessFrom(exec))
+ return jsUndefined();
+ UNUSED_PARAM(exec);
+ TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl());
+ JSValue result = jsNumber(impl->excitingAttr());
+ return result;
+}
+
+
+JSValue jsTestActiveDOMObjectConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestActiveDOMObject* domObject = static_cast<JSTestActiveDOMObject*>(asObject(slotBase));
+ if (!domObject->allowsAccessFrom(exec))
+ return jsUndefined();
+ return JSTestActiveDOMObject::getConstructor(exec, domObject->globalObject());
+}
+
+JSValue JSTestActiveDOMObject::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestActiveDOMObjectConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunction(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestActiveDOMObject::s_info))
+ return throwVMTypeError(exec);
+ JSTestActiveDOMObject* castedThis = static_cast<JSTestActiveDOMObject*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestActiveDOMObject::s_info);
+ if (!castedThis->allowsAccessFrom(exec))
+ return JSValue::encode(jsUndefined());
+ TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ Node* nextChild(toNode(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->excitingFunction(nextChild);
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestActiveDOMObject::s_info))
+ return throwVMTypeError(exec);
+ JSTestActiveDOMObject* castedThis = static_cast<JSTestActiveDOMObject*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestActiveDOMObject::s_info);
+ TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ const String& message(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->postMessage(message);
+ return JSValue::encode(jsUndefined());
+}
+
+static inline bool isObservable(JSTestActiveDOMObject* jsTestActiveDOMObject)
+{
+ if (jsTestActiveDOMObject->hasCustomProperties())
+ return true;
+ return false;
+}
+
+bool JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ JSTestActiveDOMObject* jsTestActiveDOMObject = static_cast<JSTestActiveDOMObject*>(handle.get().asCell());
+ if (!isObservable(jsTestActiveDOMObject))
+ return false;
+ UNUSED_PARAM(visitor);
+ return false;
+}
+
+void JSTestActiveDOMObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+ JSTestActiveDOMObject* jsTestActiveDOMObject = static_cast<JSTestActiveDOMObject*>(handle.get().asCell());
+ DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
+ uncacheWrapper(world, jsTestActiveDOMObject->impl(), jsTestActiveDOMObject);
+ jsTestActiveDOMObject->releaseImpl();
+}
+
+JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestActiveDOMObject* impl)
+{
+ return wrap<JSTestActiveDOMObject>(exec, globalObject, impl);
+}
+
+TestActiveDOMObject* toTestActiveDOMObject(JSC::JSValue value)
+{
+ return value.inherits(&JSTestActiveDOMObject::s_info) ? static_cast<JSTestActiveDOMObject*>(asObject(value))->impl() : 0;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
new file mode 100644
index 000000000..bcd224dd2
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestActiveDOMObject.h
@@ -0,0 +1,147 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef JSTestActiveDOMObject_h
+#define JSTestActiveDOMObject_h
+
+#include "JSDOMBinding.h"
+#include "TestActiveDOMObject.h"
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSObject.h>
+#include <runtime/ObjectPrototype.h>
+
+namespace WebCore {
+
+class JSTestActiveDOMObject : public JSDOMWrapper {
+public:
+ typedef JSDOMWrapper Base;
+ static JSTestActiveDOMObject* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestActiveDOMObject> impl)
+ {
+ JSTestActiveDOMObject* ptr = new (NotNull, JSC::allocateCell<JSTestActiveDOMObject>(globalObject->globalData().heap)) JSTestActiveDOMObject(structure, globalObject, impl);
+ ptr->finishCreation(globalObject->globalData());
+ return ptr;
+ }
+
+ static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+ static void destroy(JSC::JSCell*);
+ static const JSC::ClassInfo s_info;
+
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+
+ static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
+ TestActiveDOMObject* impl() const { return m_impl; }
+ void releaseImpl() { m_impl->deref(); m_impl = 0; }
+
+ void releaseImplIfNotNull() { if (m_impl) { m_impl->deref(); m_impl = 0; } }
+
+private:
+ TestActiveDOMObject* m_impl;
+protected:
+ JSTestActiveDOMObject(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestActiveDOMObject>);
+ void finishCreation(JSC::JSGlobalData&);
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+class JSTestActiveDOMObjectOwner : public JSC::WeakHandleOwner {
+ virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+ virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestActiveDOMObject*)
+{
+ DEFINE_STATIC_LOCAL(JSTestActiveDOMObjectOwner, jsTestActiveDOMObjectOwner, ());
+ return &jsTestActiveDOMObjectOwner;
+}
+
+inline void* wrapperContext(DOMWrapperWorld* world, TestActiveDOMObject*)
+{
+ return world;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestActiveDOMObject*);
+TestActiveDOMObject* toTestActiveDOMObject(JSC::JSValue);
+
+class JSTestActiveDOMObjectPrototype : public JSC::JSNonFinalObject {
+public:
+ typedef JSC::JSNonFinalObject Base;
+ static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
+ static JSTestActiveDOMObjectPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSTestActiveDOMObjectPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestActiveDOMObjectPrototype>(globalData.heap)) JSTestActiveDOMObjectPrototype(globalData, globalObject, structure);
+ ptr->finishCreation(globalData);
+ return ptr;
+ }
+
+ static const JSC::ClassInfo s_info;
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+
+private:
+ JSTestActiveDOMObjectPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+class JSTestActiveDOMObjectConstructor : public DOMConstructorObject {
+private:
+ JSTestActiveDOMObjectConstructor(JSC::Structure*, JSDOMGlobalObject*);
+ void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
+
+public:
+ typedef DOMConstructorObject Base;
+ static JSTestActiveDOMObjectConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
+ {
+ JSTestActiveDOMObjectConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestActiveDOMObjectConstructor>(*exec->heap())) JSTestActiveDOMObjectConstructor(structure, globalObject);
+ ptr->finishCreation(exec, globalObject);
+ return ptr;
+ }
+
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static const JSC::ClassInfo s_info;
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+};
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunction(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(JSC::ExecState*);
+// Attributes
+
+JSC::JSValue jsTestActiveDOMObjectExcitingAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestActiveDOMObjectConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
index 2f9e3508b..feb3e1f41 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventConstructor.cpp
@@ -113,6 +113,8 @@ EncodedJSValue JSC_HOST_CALL JSTestEventConstructorConstructor::constructJSTestE
bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, JSDictionary& dictionary)
{
+ if (!dictionary.tryGetProperty("attr2", eventInit.attr2))
+ return false;
return true;
}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
new file mode 100644
index 000000000..e453a2532
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.cpp
@@ -0,0 +1,354 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestEventTarget.h"
+
+#include "Event.h"
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "JSEvent.h"
+#include "JSEventListener.h"
+#include "JSNode.h"
+#include "Node.h"
+#include "TestEventTarget.h"
+#include "wtf/text/AtomicString.h"
+#include <runtime/Error.h>
+#include <runtime/PropertyNameArray.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSTestEventTarget);
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestEventTarget);
+
+/* Hash table */
+
+static const HashTableValue JSTestEventTargetTableValues[] =
+{
+ { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestEventTargetConstructor), (intptr_t)0, NoIntrinsic },
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestEventTargetTable = { 2, 1, JSTestEventTargetTableValues, 0 };
+/* Hash table for constructor */
+
+static const HashTableValue JSTestEventTargetConstructorTableValues[] =
+{
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestEventTargetConstructorTable = { 1, 0, JSTestEventTargetConstructorTableValues, 0 };
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestEventTargetConstructor);
+
+const ClassInfo JSTestEventTargetConstructor::s_info = { "TestEventTargetConstructor", &Base::s_info, &JSTestEventTargetConstructorTable, 0, CREATE_METHOD_TABLE(JSTestEventTargetConstructor) };
+
+JSTestEventTargetConstructor::JSTestEventTargetConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(structure, globalObject)
+{
+}
+
+void JSTestEventTargetConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+ Base::finishCreation(exec->globalData());
+ ASSERT(inherits(&s_info));
+ putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestEventTargetPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
+bool JSTestEventTargetConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestEventTargetConstructor, JSDOMWrapper>(exec, &JSTestEventTargetConstructorTable, static_cast<JSTestEventTargetConstructor*>(cell), propertyName, slot);
+}
+
+bool JSTestEventTargetConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestEventTargetConstructor, JSDOMWrapper>(exec, &JSTestEventTargetConstructorTable, static_cast<JSTestEventTargetConstructor*>(object), propertyName, descriptor);
+}
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestEventTargetPrototypeTableValues[] =
+{
+ { "item", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionItem), (intptr_t)1, NoIntrinsic },
+ { "addEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionAddEventListener), (intptr_t)3, NoIntrinsic },
+ { "removeEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionRemoveEventListener), (intptr_t)3, NoIntrinsic },
+ { "dispatchEvent", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestEventTargetPrototypeFunctionDispatchEvent), (intptr_t)1, NoIntrinsic },
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestEventTargetPrototypeTable = { 8, 7, JSTestEventTargetPrototypeTableValues, 0 };
+const ClassInfo JSTestEventTargetPrototype::s_info = { "TestEventTargetPrototype", &Base::s_info, &JSTestEventTargetPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestEventTargetPrototype) };
+
+JSObject* JSTestEventTargetPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestEventTarget>(exec, globalObject);
+}
+
+bool JSTestEventTargetPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestEventTargetPrototype* thisObject = jsCast<JSTestEventTargetPrototype*>(cell);
+ return getStaticFunctionSlot<JSObject>(exec, &JSTestEventTargetPrototypeTable, thisObject, propertyName, slot);
+}
+
+bool JSTestEventTargetPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestEventTargetPrototype* thisObject = jsCast<JSTestEventTargetPrototype*>(object);
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSTestEventTargetPrototypeTable, thisObject, propertyName, descriptor);
+}
+
+const ClassInfo JSTestEventTarget::s_info = { "TestEventTarget", &Base::s_info, &JSTestEventTargetTable, 0 , CREATE_METHOD_TABLE(JSTestEventTarget) };
+
+JSTestEventTarget::JSTestEventTarget(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestEventTarget> impl)
+ : JSDOMWrapper(structure, globalObject)
+ , m_impl(impl.leakRef())
+{
+}
+
+void JSTestEventTarget::finishCreation(JSGlobalData& globalData)
+{
+ Base::finishCreation(globalData);
+ ASSERT(inherits(&s_info));
+}
+
+JSObject* JSTestEventTarget::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return JSTestEventTargetPrototype::create(exec->globalData(), globalObject, JSTestEventTargetPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
+}
+
+void JSTestEventTarget::destroy(JSC::JSCell* cell)
+{
+ JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(cell);
+ thisObject->releaseImplIfNotNull();
+}
+
+bool JSTestEventTarget::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ const HashEntry* entry = JSTestEventTargetTable.entry(exec, propertyName);
+ if (entry) {
+ slot.setCustom(thisObject, entry->propertyGetter());
+ return true;
+ }
+ bool ok;
+ unsigned index = propertyName.toUInt32(ok);
+ if (ok && index < static_cast<TestEventTarget*>(thisObject->impl())->length()) {
+ slot.setCustomIndex(thisObject, index, indexGetter);
+ return true;
+ }
+ if (canGetItemsForName(exec, static_cast<TestEventTarget*>(thisObject->impl()), propertyName)) {
+ slot.setCustom(thisObject, thisObject->nameGetter);
+ return true;
+ }
+ return getStaticValueSlot<JSTestEventTarget, Base>(exec, &JSTestEventTargetTable, thisObject, propertyName, slot);
+}
+
+bool JSTestEventTarget::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(object);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ const HashEntry* entry = JSTestEventTargetTable.entry(exec, propertyName);
+ if (entry) {
+ PropertySlot slot;
+ slot.setCustom(thisObject, entry->propertyGetter());
+ descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
+ return true;
+ }
+ bool ok;
+ unsigned index = propertyName.toUInt32(ok);
+ if (ok && index < static_cast<TestEventTarget*>(thisObject->impl())->length()) {
+ PropertySlot slot;
+ slot.setCustomIndex(thisObject, index, indexGetter);
+ descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
+ return true;
+ }
+ if (canGetItemsForName(exec, static_cast<TestEventTarget*>(thisObject->impl()), propertyName)) {
+ PropertySlot slot;
+ slot.setCustom(thisObject, nameGetter);
+ descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
+ return true;
+ }
+ return getStaticValueDescriptor<JSTestEventTarget, Base>(exec, &JSTestEventTargetTable, thisObject, propertyName, descriptor);
+}
+
+bool JSTestEventTarget::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
+{
+ JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ if (propertyName < static_cast<TestEventTarget*>(thisObject->impl())->length()) {
+ slot.setCustomIndex(thisObject, propertyName, thisObject->indexGetter);
+ return true;
+ }
+ return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
+}
+
+JSValue jsTestEventTargetConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestEventTarget* domObject = static_cast<JSTestEventTarget*>(asObject(slotBase));
+ return JSTestEventTarget::getConstructor(exec, domObject->globalObject());
+}
+
+void JSTestEventTarget::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
+{
+ JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(object);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ for (unsigned i = 0; i < static_cast<TestEventTarget*>(thisObject->impl())->length(); ++i)
+ propertyNames.add(Identifier::from(exec, i));
+ Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
+}
+
+JSValue JSTestEventTarget::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestEventTargetConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestEventTarget::s_info))
+ return throwVMTypeError(exec);
+ JSTestEventTarget* castedThis = static_cast<JSTestEventTarget*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
+ TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ int index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
+ if (index < 0) {
+ setDOMException(exec, INDEX_SIZE_ERR);
+ return JSValue::encode(jsUndefined());
+ }
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->item(index)));
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestEventTarget::s_info))
+ return throwVMTypeError(exec);
+ JSTestEventTarget* castedThis = static_cast<JSTestEventTarget*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
+ TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
+ if (exec->argumentCount() < 2)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ JSValue listener = exec->argument(1);
+ if (!listener.isObject())
+ return JSValue::encode(jsUndefined());
+ impl->addEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)), exec->argument(2).toBoolean(exec));
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListener(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestEventTarget::s_info))
+ return throwVMTypeError(exec);
+ JSTestEventTarget* castedThis = static_cast<JSTestEventTarget*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
+ TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
+ if (exec->argumentCount() < 2)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ JSValue listener = exec->argument(1);
+ if (!listener.isObject())
+ return JSValue::encode(jsUndefined());
+ impl->removeEventListener(ustringToAtomicString(exec->argument(0).toString(exec)), JSEventListener::create(asObject(listener), castedThis, false, currentWorld(exec)).get(), exec->argument(2).toBoolean(exec));
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestEventTarget::s_info))
+ return throwVMTypeError(exec);
+ JSTestEventTarget* castedThis = static_cast<JSTestEventTarget*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestEventTarget::s_info);
+ TestEventTarget* impl = static_cast<TestEventTarget*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ ExceptionCode ec = 0;
+ Event* evt(toEvent(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ JSC::JSValue result = jsBoolean(impl->dispatchEvent(evt, ec));
+ setDOMException(exec, ec);
+ return JSValue::encode(result);
+}
+
+void JSTestEventTarget::visitChildren(JSCell* cell, SlotVisitor& visitor)
+{
+ JSTestEventTarget* thisObject = jsCast<JSTestEventTarget*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ COMPILE_ASSERT(StructureFlags & OverridesVisitChildren, OverridesVisitChildrenWithoutSettingFlag);
+ ASSERT(thisObject->structure()->typeInfo().overridesVisitChildren());
+ Base::visitChildren(thisObject, visitor);
+ thisObject->impl()->visitJSEventListeners(visitor);
+}
+
+
+JSValue JSTestEventTarget::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
+{
+ JSTestEventTarget* thisObj = static_cast<JSTestEventTarget*>(asObject(slotBase));
+ ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
+ return toJS(exec, thisObj->globalObject(), static_cast<TestEventTarget*>(thisObj->impl())->item(index));
+}
+
+static inline bool isObservable(JSTestEventTarget* jsTestEventTarget)
+{
+ if (jsTestEventTarget->hasCustomProperties())
+ return true;
+ if (jsTestEventTarget->impl()->hasEventListeners())
+ return true;
+ return false;
+}
+
+bool JSTestEventTargetOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ JSTestEventTarget* jsTestEventTarget = static_cast<JSTestEventTarget*>(handle.get().asCell());
+ if (!isObservable(jsTestEventTarget))
+ return false;
+ UNUSED_PARAM(visitor);
+ return false;
+}
+
+void JSTestEventTargetOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+ JSTestEventTarget* jsTestEventTarget = static_cast<JSTestEventTarget*>(handle.get().asCell());
+ DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
+ uncacheWrapper(world, jsTestEventTarget->impl(), jsTestEventTarget);
+ jsTestEventTarget->releaseImpl();
+}
+
+JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestEventTarget* impl)
+{
+ return wrap<JSTestEventTarget>(exec, globalObject, impl);
+}
+
+TestEventTarget* toTestEventTarget(JSC::JSValue value)
+{
+ return value.inherits(&JSTestEventTarget::s_info) ? static_cast<JSTestEventTarget*>(asObject(value))->impl() : 0;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
new file mode 100644
index 000000000..6fd4a3447
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestEventTarget.h
@@ -0,0 +1,156 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef JSTestEventTarget_h
+#define JSTestEventTarget_h
+
+#include "JSDOMBinding.h"
+#include "TestEventTarget.h"
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSObject.h>
+#include <runtime/ObjectPrototype.h>
+
+namespace WebCore {
+
+class JSTestEventTarget : public JSDOMWrapper {
+public:
+ typedef JSDOMWrapper Base;
+ static JSTestEventTarget* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestEventTarget> impl)
+ {
+ JSTestEventTarget* ptr = new (NotNull, JSC::allocateCell<JSTestEventTarget>(globalObject->globalData().heap)) JSTestEventTarget(structure, globalObject, impl);
+ ptr->finishCreation(globalObject->globalData());
+ return ptr;
+ }
+
+ static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+ static bool getOwnPropertySlotByIndex(JSC::JSCell*, JSC::ExecState*, unsigned propertyName, JSC::PropertySlot&);
+ static void destroy(JSC::JSCell*);
+ static const JSC::ClassInfo s_info;
+
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+
+ static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
+ static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
+ static void visitChildren(JSCell*, JSC::SlotVisitor&);
+
+ TestEventTarget* impl() const { return m_impl; }
+ void releaseImpl() { m_impl->deref(); m_impl = 0; }
+
+ void releaseImplIfNotNull() { if (m_impl) { m_impl->deref(); m_impl = 0; } }
+
+private:
+ TestEventTarget* m_impl;
+protected:
+ JSTestEventTarget(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestEventTarget>);
+ void finishCreation(JSC::JSGlobalData&);
+ static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | JSC::MasqueradesAsUndefined | Base::StructureFlags;
+ static JSC::JSValue indexGetter(JSC::ExecState*, JSC::JSValue, unsigned);
+private:
+ static bool canGetItemsForName(JSC::ExecState*, TestEventTarget*, const JSC::Identifier&);
+ static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+};
+
+class JSTestEventTargetOwner : public JSC::WeakHandleOwner {
+ virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+ virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestEventTarget*)
+{
+ DEFINE_STATIC_LOCAL(JSTestEventTargetOwner, jsTestEventTargetOwner, ());
+ return &jsTestEventTargetOwner;
+}
+
+inline void* wrapperContext(DOMWrapperWorld* world, TestEventTarget*)
+{
+ return world;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestEventTarget*);
+TestEventTarget* toTestEventTarget(JSC::JSValue);
+
+class JSTestEventTargetPrototype : public JSC::JSNonFinalObject {
+public:
+ typedef JSC::JSNonFinalObject Base;
+ static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
+ static JSTestEventTargetPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSTestEventTargetPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestEventTargetPrototype>(globalData.heap)) JSTestEventTargetPrototype(globalData, globalObject, structure);
+ ptr->finishCreation(globalData);
+ return ptr;
+ }
+
+ static const JSC::ClassInfo s_info;
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+
+private:
+ JSTestEventTargetPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::OverridesVisitChildren | Base::StructureFlags;
+};
+
+class JSTestEventTargetConstructor : public DOMConstructorObject {
+private:
+ JSTestEventTargetConstructor(JSC::Structure*, JSDOMGlobalObject*);
+ void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
+
+public:
+ typedef DOMConstructorObject Base;
+ static JSTestEventTargetConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
+ {
+ JSTestEventTargetConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestEventTargetConstructor>(*exec->heap())) JSTestEventTargetConstructor(structure, globalObject);
+ ptr->finishCreation(exec, globalObject);
+ return ptr;
+ }
+
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static const JSC::ClassInfo s_info;
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+};
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionItem(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionAddEventListener(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionRemoveEventListener(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestEventTargetPrototypeFunctionDispatchEvent(JSC::ExecState*);
+// Attributes
+
+JSC::JSValue jsTestEventTargetConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
index b226e59d6..fa54a33e9 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
@@ -26,7 +26,10 @@
#include "ExceptionCode.h"
#include "JSDOMBinding.h"
+#include "JSTestInterfaceCustom.h"
+#include "JSTestObj.h"
#include "TestInterface.h"
+#include "TestObj.h"
#include "TestSupplemental.h"
#include <runtime/Error.h>
#include <wtf/GetPtr.h>
@@ -48,19 +51,19 @@ ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestInterface);
static const HashTableValue JSTestInterfaceTableValues[] =
{
#if ENABLE(Condition11) || ENABLE(Condition12)
- { "str1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceStr1), (intptr_t)0, NoIntrinsic },
+ { "supplementalStr1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr1), (intptr_t)0, NoIntrinsic },
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
- { "str2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceStr2), (intptr_t)setJSTestInterfaceStr2, NoIntrinsic },
+ { "supplementalStr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr2), (intptr_t)setJSTestInterfaceSupplementalStr2, NoIntrinsic },
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
- { "str3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceStr3), (intptr_t)setJSTestInterfaceStr3, NoIntrinsic },
+ { "supplementalStr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t)setJSTestInterfaceSupplementalStr3, NoIntrinsic },
#endif
{ "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t)0, NoIntrinsic },
{ 0, 0, 0, 0, NoIntrinsic }
};
-static const HashTable JSTestInterfaceTable = { 8, 7, JSTestInterfaceTableValues, 0 };
+static const HashTable JSTestInterfaceTable = { 9, 7, JSTestInterfaceTableValues, 0 };
/* Hash table for constructor */
static const HashTableValue JSTestInterfaceConstructorTableValues[] =
@@ -128,10 +131,16 @@ ConstructType JSTestInterfaceConstructor::getConstructData(JSCell*, ConstructDat
static const HashTableValue JSTestInterfacePrototypeTableValues[] =
{
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t)0, NoIntrinsic },
+#endif
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t)2, NoIntrinsic },
+#endif
{ 0, 0, 0, 0, NoIntrinsic }
};
-static const HashTable JSTestInterfacePrototypeTable = { 1, 0, JSTestInterfacePrototypeTableValues, 0 };
+static const HashTable JSTestInterfacePrototypeTable = { 5, 3, JSTestInterfacePrototypeTableValues, 0 };
const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &Base::s_info, &JSTestInterfacePrototypeTable, 0, CREATE_METHOD_TABLE(JSTestInterfacePrototype) };
JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -139,6 +148,18 @@ JSObject* JSTestInterfacePrototype::self(ExecState* exec, JSGlobalObject* global
return getDOMPrototype<JSTestInterface>(exec, globalObject);
}
+bool JSTestInterfacePrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestInterfacePrototype* thisObject = jsCast<JSTestInterfacePrototype*>(cell);
+ return getStaticFunctionSlot<JSObject>(exec, &JSTestInterfacePrototypeTable, thisObject, propertyName, slot);
+}
+
+bool JSTestInterfacePrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestInterfacePrototype* thisObject = jsCast<JSTestInterfacePrototype*>(object);
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSTestInterfacePrototypeTable, thisObject, propertyName, descriptor);
+}
+
const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, &JSTestInterfaceTable, 0 , CREATE_METHOD_TABLE(JSTestInterface) };
JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestInterface> impl)
@@ -179,35 +200,35 @@ bool JSTestInterface::getOwnPropertyDescriptor(JSObject* object, ExecState* exec
}
#if ENABLE(Condition11) || ENABLE(Condition12)
-JSValue jsTestInterfaceStr1(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestInterfaceSupplementalStr1(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- JSValue result = jsString(exec, TestSupplemental::str1(impl));
+ JSValue result = jsString(exec, TestSupplemental::supplementalStr1(impl));
return result;
}
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-JSValue jsTestInterfaceStr2(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestInterfaceSupplementalStr2(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- JSValue result = jsString(exec, TestSupplemental::str2(impl));
+ JSValue result = jsString(exec, TestSupplemental::supplementalStr2(impl));
return result;
}
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-JSValue jsTestInterfaceStr3(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestInterfaceSupplementalStr3(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(slotBase));
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- return castedThis->str3(impl, exec);
+ return castedThis->supplementalStr3(impl, exec);
}
#endif
@@ -222,25 +243,27 @@ void JSTestInterface::put(JSCell* cell, ExecState* exec, const Identifier& prope
{
JSTestInterface* thisObject = jsCast<JSTestInterface*>(cell);
ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ if (thisObject->putDelegate(exec, propertyName, value, slot))
+ return;
lookupPut<JSTestInterface, Base>(exec, propertyName, value, &JSTestInterfaceTable, thisObject, slot);
}
#if ENABLE(Condition11) || ENABLE(Condition12)
-void setJSTestInterfaceStr2(ExecState* exec, JSObject* thisObject, JSValue value)
+void setJSTestInterfaceSupplementalStr2(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestInterface* castedThis = static_cast<JSTestInterface*>(thisObject);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- TestSupplemental::setStr2(impl, ustringToString(value.isEmpty() ? UString() : value.toString(exec)));
+ TestSupplemental::setSupplementalStr2(impl, ustringToString(value.isEmpty() ? UString() : value.toString(exec)));
}
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-void setJSTestInterfaceStr3(ExecState* exec, JSObject* thisObject, JSValue value)
+void setJSTestInterfaceSupplementalStr3(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestInterface* castedThis = static_cast<JSTestInterface*>(thisObject);
TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
- castedThis->setStr3(impl, exec, value);
+ castedThis->setSupplementalStr3(impl, exec, value);
}
#endif
@@ -250,6 +273,50 @@ JSValue JSTestInterface::getConstructor(ExecState* exec, JSGlobalObject* globalO
return getDOMConstructor<JSTestInterfaceConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
}
+#if ENABLE(Condition11) || ENABLE(Condition12)
+EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestInterface::s_info))
+ return throwVMTypeError(exec);
+ JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestInterface::s_info);
+ TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
+ TestSupplemental::supplementalMethod1(impl);
+ return JSValue::encode(jsUndefined());
+}
+
+#endif
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestInterface::s_info))
+ return throwVMTypeError(exec);
+ JSTestInterface* castedThis = static_cast<JSTestInterface*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestInterface::s_info);
+ TestInterface* impl = static_cast<TestInterface*>(castedThis->impl());
+ if (exec->argumentCount() < 2)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ ExceptionCode ec = 0;
+ ScriptExecutionContext* scriptContext = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
+ if (!scriptContext)
+ return JSValue::encode(jsUndefined());
+ const String& strArg(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ TestObj* objArg(toTestObj(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(TestSupplemental::supplementalMethod2(impl, scriptContext, strArg, objArg, ec)));
+ setDOMException(exec, ec);
+ return JSValue::encode(result);
+}
+
+#endif
+
static inline bool isObservable(JSTestInterface* jsTestInterface)
{
if (jsTestInterface->hasCustomProperties())
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
index dc38ad7ef..ec94eed36 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h
@@ -45,6 +45,7 @@ public:
static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
+ bool putDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSC::PutPropertySlot&);
static void destroy(JSC::JSCell*);
static const JSC::ClassInfo s_info;
@@ -56,7 +57,7 @@ public:
static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
// Custom attributes
- JSC::JSValue str3(TestInterface*, JSC::ExecState*) const;
+ JSC::JSValue supplementalStr3(TestInterface*, JSC::ExecState*) const;
TestInterface* impl() const { return m_impl; }
void releaseImpl() { m_impl->deref(); m_impl = 0; }
@@ -101,6 +102,8 @@ public:
}
static const JSC::ClassInfo s_info;
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
@@ -109,7 +112,7 @@ public:
private:
JSTestInterfacePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
protected:
- static const unsigned StructureFlags = Base::StructureFlags;
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
};
class JSTestInterfaceConstructor : public DOMConstructorObject {
@@ -139,13 +142,17 @@ protected:
static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
};
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(JSC::ExecState*);
// Attributes
-JSC::JSValue jsTestInterfaceStr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-JSC::JSValue jsTestInterfaceStr2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-void setJSTestInterfaceStr2(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsTestInterfaceStr3(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-void setJSTestInterfaceStr3(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestInterfaceSupplementalStr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 2e5c1b263..e91a11403 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -21,24 +21,37 @@
#include "config.h"
#include "JSTestObj.h"
+#include "Document.h"
#include "ExceptionCode.h"
#include "HTMLNames.h"
#include "IDBBindingUtilities.h"
#include "IDBKey.h"
#include "JSDOMBinding.h"
#include "JSDOMStringList.h"
+#include "JSDocument.h"
#include "JSEventListener.h"
#include "JSOptionsObject.h"
+#include "JSSVGDocument.h"
+#include "JSSVGPoint.h"
#include "JSTestCallback.h"
#include "JSTestObj.h"
+#include "JSa.h"
+#include "JSb.h"
+#include "JSbool.h"
+#include "JSc.h"
+#include "JSd.h"
+#include "JSe.h"
+#include "JSint.h"
#include "JSlog.h"
#include "KURL.h"
+#include "SVGDocument.h"
+#include "SVGStaticPropertyTearOff.h"
#include "ScriptArguments.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
-#include "ScriptController.h"
#include "SerializedScriptValue.h"
#include "TestObj.h"
+#include "bool.h"
#include <runtime/Error.h>
#include <runtime/JSString.h>
#include <wtf/GetPtr.h>
@@ -115,6 +128,10 @@ static const HashTableValue JSTestObjTableValues[] =
#endif
{ "cachedAttribute1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute1), (intptr_t)0, NoIntrinsic },
{ "cachedAttribute2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCachedAttribute2), (intptr_t)0, NoIntrinsic },
+ { "contentDocument", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjContentDocument), (intptr_t)0, NoIntrinsic },
+ { "mutablePoint", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjMutablePoint), (intptr_t)setJSTestObjMutablePoint, NoIntrinsic },
+ { "immutablePoint", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjImmutablePoint), (intptr_t)setJSTestObjImmutablePoint, NoIntrinsic },
+ { "strictFloat", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictFloat), (intptr_t)setJSTestObjStrictFloat, NoIntrinsic },
{ "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0, NoIntrinsic },
{ "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId, NoIntrinsic },
{ "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0, NoIntrinsic },
@@ -122,7 +139,7 @@ static const HashTableValue JSTestObjTableValues[] =
{ 0, 0, 0, 0, NoIntrinsic }
};
-static const HashTable JSTestObjTable = { 135, 127, JSTestObjTableValues, 0 };
+static const HashTable JSTestObjTable = { 136, 127, JSTestObjTableValues, 0 };
/* Hash table for constructor */
static const HashTableValue JSTestObjConstructorTableValues[] =
@@ -242,11 +259,6 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
{ "customArgsAndException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomArgsAndException), (intptr_t)1, NoIntrinsic },
{ "addEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionAddEventListener), (intptr_t)3, NoIntrinsic },
{ "removeEventListener", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionRemoveEventListener), (intptr_t)3, NoIntrinsic },
- { "withDynamicFrame", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrame), (intptr_t)0, NoIntrinsic },
- { "withDynamicFrameAndArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndArg), (intptr_t)1, NoIntrinsic },
- { "withDynamicFrameAndOptionalArg", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg), (intptr_t)2, NoIntrinsic },
- { "withDynamicFrameAndUserGesture", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture), (intptr_t)1, NoIntrinsic },
- { "withDynamicFrameAndUserGestureASAD", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD), (intptr_t)2, NoIntrinsic },
{ "withScriptStateVoid", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoid), (intptr_t)0, NoIntrinsic },
{ "withScriptStateObj", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateObj), (intptr_t)0, NoIntrinsic },
{ "withScriptStateVoidException", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionWithScriptStateVoidException), (intptr_t)0, NoIntrinsic },
@@ -268,10 +280,20 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
{ "conditionalMethod3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalMethod3), (intptr_t)0, NoIntrinsic },
#endif
{ "overloadedMethod", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOverloadedMethod), (intptr_t)2, NoIntrinsic },
+ { "getSVGDocument", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionGetSVGDocument), (intptr_t)0, NoIntrinsic },
+ { "convert1", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert1), (intptr_t)1, NoIntrinsic },
+ { "convert2", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert2), (intptr_t)1, NoIntrinsic },
+ { "convert3", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert3), (intptr_t)1, NoIntrinsic },
+ { "convert4", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert4), (intptr_t)1, NoIntrinsic },
+ { "convert5", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConvert5), (intptr_t)1, NoIntrinsic },
+ { "mutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMutablePointFunction), (intptr_t)0, NoIntrinsic },
+ { "immutablePointFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionImmutablePointFunction), (intptr_t)0, NoIntrinsic },
+ { "orange", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOrange), (intptr_t)0, NoIntrinsic },
+ { "strictFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionStrictFunction), (intptr_t)3, NoIntrinsic },
{ 0, 0, 0, 0, NoIntrinsic }
};
-static const HashTable JSTestObjPrototypeTable = { 137, 127, JSTestObjPrototypeTableValues, 0 };
+static const HashTable JSTestObjPrototypeTable = { 138, 127, JSTestObjPrototypeTableValues, 0 };
const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", &Base::s_info, &JSTestObjPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -708,6 +730,44 @@ JSValue jsTestObjCachedAttribute2(ExecState* exec, JSValue slotBase, const Ident
}
+JSValue jsTestObjContentDocument(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ return allowAccessToNode(exec, impl->contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->contentDocument())) : jsUndefined();
+}
+
+
+JSValue jsTestObjMutablePoint(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::create(impl, impl->mutablePoint(), &TestObj::updateMutablePoint)));
+ return result;
+}
+
+
+JSValue jsTestObjImmutablePoint(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->immutablePoint())));
+ return result;
+}
+
+
+JSValue jsTestObjStrictFloat(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(impl->strictFloat());
+ return result;
+}
+
+
JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
@@ -1014,6 +1074,30 @@ void setJSTestObjConditionalAttr6Constructor(ExecState* exec, JSObject* thisObje
#endif
+void setJSTestObjMutablePoint(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ impl->setMutablePoint(toSVGPoint(value));
+}
+
+
+void setJSTestObjImmutablePoint(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ impl->setImmutablePoint(toSVGPoint(value));
+}
+
+
+void setJSTestObjStrictFloat(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ impl->setStrictFloat(value.toFloat(exec));
+}
+
+
void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
@@ -1309,121 +1393,6 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(ExecS
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(ExecState* exec)
-{
- JSValue thisValue = exec->hostThisValue();
- if (!thisValue.inherits(&JSTestObj::s_info))
- return throwVMTypeError(exec);
- JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- Frame* dynamicFrame = toDynamicFrame(exec);
- if (!dynamicFrame)
- return JSValue::encode(jsUndefined());
- impl->withDynamicFrame(dynamicFrame);
- return JSValue::encode(jsUndefined());
-}
-
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(ExecState* exec)
-{
- JSValue thisValue = exec->hostThisValue();
- if (!thisValue.inherits(&JSTestObj::s_info))
- return throwVMTypeError(exec);
- JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
- Frame* dynamicFrame = toDynamicFrame(exec);
- if (!dynamicFrame)
- return JSValue::encode(jsUndefined());
- int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
- impl->withDynamicFrameAndArg(dynamicFrame, intArg);
- return JSValue::encode(jsUndefined());
-}
-
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(ExecState* exec)
-{
- JSValue thisValue = exec->hostThisValue();
- if (!thisValue.inherits(&JSTestObj::s_info))
- return throwVMTypeError(exec);
- JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
- Frame* dynamicFrame = toDynamicFrame(exec);
- if (!dynamicFrame)
- return JSValue::encode(jsUndefined());
- int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
-
- size_t argsCount = exec->argumentCount();
- if (argsCount <= 1) {
- impl->withDynamicFrameAndOptionalArg(dynamicFrame, intArg);
- return JSValue::encode(jsUndefined());
- }
-
- int optionalArg(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
- impl->withDynamicFrameAndOptionalArg(dynamicFrame, intArg, optionalArg);
- return JSValue::encode(jsUndefined());
-}
-
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(ExecState* exec)
-{
- JSValue thisValue = exec->hostThisValue();
- if (!thisValue.inherits(&JSTestObj::s_info))
- return throwVMTypeError(exec);
- JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
- Frame* dynamicFrame = toDynamicFrame(exec);
- if (!dynamicFrame)
- return JSValue::encode(jsUndefined());
- int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
- impl->withDynamicFrameAndUserGesture(dynamicFrame, intArg, ScriptController::processingUserGesture());
- return JSValue::encode(jsUndefined());
-}
-
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(ExecState* exec)
-{
- JSValue thisValue = exec->hostThisValue();
- if (!thisValue.inherits(&JSTestObj::s_info))
- return throwVMTypeError(exec);
- JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
- ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
- TestObj* impl = static_cast<TestObj*>(castedThis->impl());
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
- Frame* dynamicFrame = toDynamicFrame(exec);
- if (!dynamicFrame)
- return JSValue::encode(jsUndefined());
- int intArg(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toInt32(exec));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
-
- size_t argsCount = exec->argumentCount();
- if (argsCount <= 1) {
- impl->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg);
- return JSValue::encode(jsUndefined());
- }
-
- int optionalArg(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toInt32(exec));
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
- impl->withDynamicFrameAndUserGestureASAD(dynamicFrame, intArg, optionalArg, ScriptController::processingUserGesture());
- return JSValue::encode(jsUndefined());
-}
-
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
@@ -1907,6 +1876,174 @@ EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(ExecS
#endif
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ if (!allowAccessToNode(exec, impl->getSVGDocument(ec)))
+ return JSValue::encode(jsUndefined());
+
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->getSVGDocument(ec)));
+ setDOMException(exec, ec);
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ a* (toa(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->convert1();
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ b* (tob(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->convert2();
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ c* (toc(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->convert3();
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ d* (tod(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->convert4();
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ e* (toe(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->convert5();
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->mutablePointFunction())));
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(impl->immutablePointFunction())));
+ return JSValue::encode(result);
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ impl->banana();
+ return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestObj::s_info))
+ return throwVMTypeError(exec);
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestObj::s_info);
+ TestObj* impl = static_cast<TestObj*>(castedThis->impl());
+ if (exec->argumentCount() < 3)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ ExceptionCode ec = 0;
+ const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ float a(MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined).toFloat(exec));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ if (exec->argumentCount() > 2 && !exec->argument(2).isUndefinedOrNull() && !exec->argument(2).inherits(&JSint::s_info))
+ return throwVMTypeError(exec);
+ int* b(toint(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
+ JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl->strictFunction(str, a, b, ec)));
+ setDOMException(exec, ec);
+ return JSValue::encode(result);
+}
+
void JSTestObj::visitChildren(JSCell* cell, SlotVisitor& visitor)
{
JSTestObj* thisObject = jsCast<JSTestObj*>(cell);
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
index fa73139c8..ae4041de6 100644
--- a/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -166,11 +166,6 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomArgsAndException(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionAddEventListener(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionRemoveEventListener(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrame(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndArg(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndOptionalArg(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGesture(JSC::ExecState*);
-JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithDynamicFrameAndUserGestureASAD(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoid(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateObj(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionWithScriptStateVoidException(JSC::ExecState*);
@@ -189,6 +184,16 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(JSC
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethod(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionClassMethodWithOptional(JSC::ExecState*);
JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionOverloadedMethod1(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionGetSVGDocument(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert1(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert2(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert3(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert4(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConvert5(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMutablePointFunction(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionImmutablePointFunction(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOrange(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionStrictFunction(JSC::ExecState*);
// Attributes
JSC::JSValue jsTestObjReadOnlyIntAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
@@ -259,6 +264,13 @@ JSC::JSValue jsTestObjConditionalAttr6Constructor(JSC::ExecState*, JSC::JSValue,
void setJSTestObjConditionalAttr6Constructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjCachedAttribute1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjCachedAttribute2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjContentDocument(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjMutablePoint(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjMutablePoint(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjImmutablePoint(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjImmutablePoint(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjStrictFloat(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjStrictFloat(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjDescription(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
JSC::JSValue jsTestObjId(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjId(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp b/Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp
new file mode 100644
index 000000000..1d87ea91c
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.cpp
@@ -0,0 +1,220 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "JSTestOverridingNameGetter.h"
+
+#include "ExceptionCode.h"
+#include "JSDOMBinding.h"
+#include "TestOverridingNameGetter.h"
+#include "wtf/text/AtomicString.h"
+#include <runtime/Error.h>
+#include <wtf/GetPtr.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+ASSERT_CLASS_FITS_IN_CELL(JSTestOverridingNameGetter);
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestOverridingNameGetter);
+
+/* Hash table */
+
+static const HashTableValue JSTestOverridingNameGetterTableValues[] =
+{
+ { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestOverridingNameGetterConstructor), (intptr_t)0, NoIntrinsic },
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestOverridingNameGetterTable = { 2, 1, JSTestOverridingNameGetterTableValues, 0 };
+/* Hash table for constructor */
+
+static const HashTableValue JSTestOverridingNameGetterConstructorTableValues[] =
+{
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestOverridingNameGetterConstructorTable = { 1, 0, JSTestOverridingNameGetterConstructorTableValues, 0 };
+ASSERT_HAS_TRIVIAL_DESTRUCTOR(JSTestOverridingNameGetterConstructor);
+
+const ClassInfo JSTestOverridingNameGetterConstructor::s_info = { "TestOverridingNameGetterConstructor", &Base::s_info, &JSTestOverridingNameGetterConstructorTable, 0, CREATE_METHOD_TABLE(JSTestOverridingNameGetterConstructor) };
+
+JSTestOverridingNameGetterConstructor::JSTestOverridingNameGetterConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(structure, globalObject)
+{
+}
+
+void JSTestOverridingNameGetterConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
+{
+ Base::finishCreation(exec->globalData());
+ ASSERT(inherits(&s_info));
+ putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestOverridingNameGetterPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
+bool JSTestOverridingNameGetterConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ return getStaticValueSlot<JSTestOverridingNameGetterConstructor, JSDOMWrapper>(exec, &JSTestOverridingNameGetterConstructorTable, static_cast<JSTestOverridingNameGetterConstructor*>(cell), propertyName, slot);
+}
+
+bool JSTestOverridingNameGetterConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ return getStaticValueDescriptor<JSTestOverridingNameGetterConstructor, JSDOMWrapper>(exec, &JSTestOverridingNameGetterConstructorTable, static_cast<JSTestOverridingNameGetterConstructor*>(object), propertyName, descriptor);
+}
+
+/* Hash table for prototype */
+
+static const HashTableValue JSTestOverridingNameGetterPrototypeTableValues[] =
+{
+ { "anotherFunction", DontDelete | JSC::Function, (intptr_t)static_cast<NativeFunction>(jsTestOverridingNameGetterPrototypeFunctionAnotherFunction), (intptr_t)1, NoIntrinsic },
+ { 0, 0, 0, 0, NoIntrinsic }
+};
+
+static const HashTable JSTestOverridingNameGetterPrototypeTable = { 2, 1, JSTestOverridingNameGetterPrototypeTableValues, 0 };
+const ClassInfo JSTestOverridingNameGetterPrototype::s_info = { "TestOverridingNameGetterPrototype", &Base::s_info, &JSTestOverridingNameGetterPrototypeTable, 0, CREATE_METHOD_TABLE(JSTestOverridingNameGetterPrototype) };
+
+JSObject* JSTestOverridingNameGetterPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMPrototype<JSTestOverridingNameGetter>(exec, globalObject);
+}
+
+bool JSTestOverridingNameGetterPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestOverridingNameGetterPrototype* thisObject = jsCast<JSTestOverridingNameGetterPrototype*>(cell);
+ return getStaticFunctionSlot<JSObject>(exec, &JSTestOverridingNameGetterPrototypeTable, thisObject, propertyName, slot);
+}
+
+bool JSTestOverridingNameGetterPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestOverridingNameGetterPrototype* thisObject = jsCast<JSTestOverridingNameGetterPrototype*>(object);
+ return getStaticFunctionDescriptor<JSObject>(exec, &JSTestOverridingNameGetterPrototypeTable, thisObject, propertyName, descriptor);
+}
+
+const ClassInfo JSTestOverridingNameGetter::s_info = { "TestOverridingNameGetter", &Base::s_info, &JSTestOverridingNameGetterTable, 0 , CREATE_METHOD_TABLE(JSTestOverridingNameGetter) };
+
+JSTestOverridingNameGetter::JSTestOverridingNameGetter(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestOverridingNameGetter> impl)
+ : JSDOMWrapper(structure, globalObject)
+ , m_impl(impl.leakRef())
+{
+}
+
+void JSTestOverridingNameGetter::finishCreation(JSGlobalData& globalData)
+{
+ Base::finishCreation(globalData);
+ ASSERT(inherits(&s_info));
+}
+
+JSObject* JSTestOverridingNameGetter::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return JSTestOverridingNameGetterPrototype::create(exec->globalData(), globalObject, JSTestOverridingNameGetterPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
+}
+
+void JSTestOverridingNameGetter::destroy(JSC::JSCell* cell)
+{
+ JSTestOverridingNameGetter* thisObject = jsCast<JSTestOverridingNameGetter*>(cell);
+ thisObject->releaseImplIfNotNull();
+}
+
+bool JSTestOverridingNameGetter::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
+{
+ JSTestOverridingNameGetter* thisObject = jsCast<JSTestOverridingNameGetter*>(cell);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ if (canGetItemsForName(exec, static_cast<TestOverridingNameGetter*>(thisObject->impl()), propertyName)) {
+ slot.setCustom(thisObject, thisObject->nameGetter);
+ return true;
+ }
+ return getStaticValueSlot<JSTestOverridingNameGetter, Base>(exec, &JSTestOverridingNameGetterTable, thisObject, propertyName, slot);
+}
+
+bool JSTestOverridingNameGetter::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
+{
+ JSTestOverridingNameGetter* thisObject = jsCast<JSTestOverridingNameGetter*>(object);
+ ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
+ if (canGetItemsForName(exec, static_cast<TestOverridingNameGetter*>(thisObject->impl()), propertyName)) {
+ PropertySlot slot;
+ slot.setCustom(thisObject, nameGetter);
+ descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
+ return true;
+ }
+ return getStaticValueDescriptor<JSTestOverridingNameGetter, Base>(exec, &JSTestOverridingNameGetterTable, thisObject, propertyName, descriptor);
+}
+
+JSValue jsTestOverridingNameGetterConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestOverridingNameGetter* domObject = static_cast<JSTestOverridingNameGetter*>(asObject(slotBase));
+ return JSTestOverridingNameGetter::getConstructor(exec, domObject->globalObject());
+}
+
+JSValue JSTestOverridingNameGetter::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
+{
+ return getDOMConstructor<JSTestOverridingNameGetterConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestOverridingNameGetterPrototypeFunctionAnotherFunction(ExecState* exec)
+{
+ JSValue thisValue = exec->hostThisValue();
+ if (!thisValue.inherits(&JSTestOverridingNameGetter::s_info))
+ return throwVMTypeError(exec);
+ JSTestOverridingNameGetter* castedThis = static_cast<JSTestOverridingNameGetter*>(asObject(thisValue));
+ ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestOverridingNameGetter::s_info);
+ TestOverridingNameGetter* impl = static_cast<TestOverridingNameGetter*>(castedThis->impl());
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createTypeError(exec, "Not enough arguments"));
+ const String& str(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+ impl->anotherFunction(str);
+ return JSValue::encode(jsUndefined());
+}
+
+static inline bool isObservable(JSTestOverridingNameGetter* jsTestOverridingNameGetter)
+{
+ if (jsTestOverridingNameGetter->hasCustomProperties())
+ return true;
+ return false;
+}
+
+bool JSTestOverridingNameGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+ JSTestOverridingNameGetter* jsTestOverridingNameGetter = static_cast<JSTestOverridingNameGetter*>(handle.get().asCell());
+ if (!isObservable(jsTestOverridingNameGetter))
+ return false;
+ UNUSED_PARAM(visitor);
+ return false;
+}
+
+void JSTestOverridingNameGetterOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+ JSTestOverridingNameGetter* jsTestOverridingNameGetter = static_cast<JSTestOverridingNameGetter*>(handle.get().asCell());
+ DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
+ uncacheWrapper(world, jsTestOverridingNameGetter->impl(), jsTestOverridingNameGetter);
+ jsTestOverridingNameGetter->releaseImpl();
+}
+
+JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestOverridingNameGetter* impl)
+{
+ return wrap<JSTestOverridingNameGetter>(exec, globalObject, impl);
+}
+
+TestOverridingNameGetter* toTestOverridingNameGetter(JSC::JSValue value)
+{
+ return value.inherits(&JSTestOverridingNameGetter::s_info) ? static_cast<JSTestOverridingNameGetter*>(asObject(value))->impl() : 0;
+}
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.h b/Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.h
new file mode 100644
index 000000000..220bfd33c
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/JS/JSTestOverridingNameGetter.h
@@ -0,0 +1,148 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef JSTestOverridingNameGetter_h
+#define JSTestOverridingNameGetter_h
+
+#include "JSDOMBinding.h"
+#include "TestOverridingNameGetter.h"
+#include <runtime/JSGlobalObject.h>
+#include <runtime/JSObject.h>
+#include <runtime/ObjectPrototype.h>
+
+namespace WebCore {
+
+class JSTestOverridingNameGetter : public JSDOMWrapper {
+public:
+ typedef JSDOMWrapper Base;
+ static JSTestOverridingNameGetter* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestOverridingNameGetter> impl)
+ {
+ JSTestOverridingNameGetter* ptr = new (NotNull, JSC::allocateCell<JSTestOverridingNameGetter>(globalObject->globalData().heap)) JSTestOverridingNameGetter(structure, globalObject, impl);
+ ptr->finishCreation(globalObject->globalData());
+ return ptr;
+ }
+
+ static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
+ static void destroy(JSC::JSCell*);
+ static const JSC::ClassInfo s_info;
+
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+
+ static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
+ TestOverridingNameGetter* impl() const { return m_impl; }
+ void releaseImpl() { m_impl->deref(); m_impl = 0; }
+
+ void releaseImplIfNotNull() { if (m_impl) { m_impl->deref(); m_impl = 0; } }
+
+private:
+ TestOverridingNameGetter* m_impl;
+protected:
+ JSTestOverridingNameGetter(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<TestOverridingNameGetter>);
+ void finishCreation(JSC::JSGlobalData&);
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+private:
+ static bool canGetItemsForName(JSC::ExecState*, TestOverridingNameGetter*, const JSC::Identifier&);
+ static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+};
+
+class JSTestOverridingNameGetterOwner : public JSC::WeakHandleOwner {
+ virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+ virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestOverridingNameGetter*)
+{
+ DEFINE_STATIC_LOCAL(JSTestOverridingNameGetterOwner, jsTestOverridingNameGetterOwner, ());
+ return &jsTestOverridingNameGetterOwner;
+}
+
+inline void* wrapperContext(DOMWrapperWorld* world, TestOverridingNameGetter*)
+{
+ return world;
+}
+
+JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestOverridingNameGetter*);
+TestOverridingNameGetter* toTestOverridingNameGetter(JSC::JSValue);
+
+class JSTestOverridingNameGetterPrototype : public JSC::JSNonFinalObject {
+public:
+ typedef JSC::JSNonFinalObject Base;
+ static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
+ static JSTestOverridingNameGetterPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
+ {
+ JSTestOverridingNameGetterPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestOverridingNameGetterPrototype>(globalData.heap)) JSTestOverridingNameGetterPrototype(globalData, globalObject, structure);
+ ptr->finishCreation(globalData);
+ return ptr;
+ }
+
+ static const JSC::ClassInfo s_info;
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+
+private:
+ JSTestOverridingNameGetterPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
+};
+
+class JSTestOverridingNameGetterConstructor : public DOMConstructorObject {
+private:
+ JSTestOverridingNameGetterConstructor(JSC::Structure*, JSDOMGlobalObject*);
+ void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
+
+public:
+ typedef DOMConstructorObject Base;
+ static JSTestOverridingNameGetterConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
+ {
+ JSTestOverridingNameGetterConstructor* ptr = new (NotNull, JSC::allocateCell<JSTestOverridingNameGetterConstructor>(*exec->heap())) JSTestOverridingNameGetterConstructor(structure, globalObject);
+ ptr->finishCreation(exec, globalObject);
+ return ptr;
+ }
+
+ static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ static const JSC::ClassInfo s_info;
+ static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
+ {
+ return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
+ }
+protected:
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+};
+
+// Functions
+
+JSC::EncodedJSValue JSC_HOST_CALL jsTestOverridingNameGetterPrototypeFunctionAnotherFunction(JSC::ExecState*);
+// Attributes
+
+JSC::JSValue jsTestOverridingNameGetterConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/bridge/jni/v8/JavaMethodV8.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h
index f07116092..8f63275df 100644
--- a/Source/WebCore/bridge/jni/v8/JavaMethodV8.h
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.h
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2003, 2004, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
- * Copyright 2010, The Android Open Source Project
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -21,37 +21,20 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JavaMethodV8_h
-#define JavaMethodV8_h
+#import <WebCore/DOMObject.h>
-#if ENABLE(JAVA_BRIDGE)
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
-#include "Bridge.h"
-#include "JavaType.h"
+@class DOMNode;
+@class NSString;
-#include <wtf/text/WTFString.h>
+@interface DOMTestActiveDOMObject : DOMObject
+- (int)excitingAttr;
+- (void)excitingFunction:(DOMNode *)nextChild;
+- (void)postMessage:(NSString *)message;
+@end
-namespace JSC {
-
-namespace Bindings {
-
-typedef const char* RuntimeType;
-
-class JavaMethod : public Method {
-public:
- virtual ~JavaMethod() { }
-
- virtual String name() const = 0;
- virtual String parameterAt(int) const = 0;
-};
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
-
-#endif // JavaMethodV8_h
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm
new file mode 100644
index 000000000..53d667bfc
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm
@@ -0,0 +1,107 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestActiveDOMObject.h"
+
+#import "DOMBlobInternal.h"
+#import "DOMCSSRuleInternal.h"
+#import "DOMCSSValueInternal.h"
+#import "DOMEventInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMStyleSheetInternal.h"
+#import "DOMTestActiveDOMObjectInternal.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "KURL.h"
+#import "Node.h"
+#import "TestActiveDOMObject.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestActiveDOMObject*>(_internal)
+
+@implementation DOMTestActiveDOMObject
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestActiveDOMObject class], self))
+ return;
+
+ if (_internal)
+ IMPL->deref();
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ if (_internal)
+ IMPL->deref();
+ [super finalize];
+}
+
+- (int)excitingAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->excitingAttr();
+}
+
+- (void)excitingFunction:(DOMNode *)nextChild
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->excitingFunction(core(nextChild));
+}
+
+- (void)postMessage:(NSString *)message
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->postMessage(message);
+}
+
+@end
+
+WebCore::TestActiveDOMObject* core(DOMTestActiveDOMObject *wrapper)
+{
+ return wrapper ? reinterpret_cast<WebCore::TestActiveDOMObject*>(wrapper->_internal) : 0;
+}
+
+DOMTestActiveDOMObject *kit(WebCore::TestActiveDOMObject* value)
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
+ if (!value)
+ return nil;
+ if (DOMTestActiveDOMObject *wrapper = getDOMWrapper(value))
+ return [[wrapper retain] autorelease];
+ DOMTestActiveDOMObject *wrapper = [[DOMTestActiveDOMObject alloc] _init];
+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+ value->ref();
+ addDOMWrapper(wrapper, value);
+ return [wrapper autorelease];
+}
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h
new file mode 100644
index 000000000..6d21e38c6
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestActiveDOMObjectInternal.h
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMTestActiveDOMObject.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+namespace WebCore {
+ class TestActiveDOMObject;
+}
+
+WebCore::TestActiveDOMObject* core(DOMTestActiveDOMObject *);
+DOMTestActiveDOMObject *kit(WebCore::TestActiveDOMObject*);
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.h
new file mode 100644
index 000000000..5208095d1
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMObject.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+@class DOMEvent;
+@class DOMNode;
+@class NSString;
+@protocol DOMEventListener;
+
+@interface DOMTestEventTarget : DOMObject
+- (DOMNode *)item:(unsigned)index;
+- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
+- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
+- (BOOL)dispatchEvent:(DOMEvent *)evt;
+@end
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.mm
new file mode 100644
index 000000000..94b05a9b7
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTarget.mm
@@ -0,0 +1,121 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestEventTarget.h"
+
+#import "DOMBlobInternal.h"
+#import "DOMCSSRuleInternal.h"
+#import "DOMCSSValueInternal.h"
+#import "DOMEventInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMStyleSheetInternal.h"
+#import "DOMTestEventTargetInternal.h"
+#import "Event.h"
+#import "EventListener.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "KURL.h"
+#import "Node.h"
+#import "ObjCEventListener.h"
+#import "TestEventTarget.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestEventTarget*>(_internal)
+
+@implementation DOMTestEventTarget
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestEventTarget class], self))
+ return;
+
+ if (_internal)
+ IMPL->deref();
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ if (_internal)
+ IMPL->deref();
+ [super finalize];
+}
+
+- (DOMNode *)item:(unsigned)index
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(IMPL->item(index)));
+}
+
+- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
+{
+ WebCore::JSMainThreadNullState state;
+ RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
+ IMPL->addEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
+}
+
+- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture
+{
+ WebCore::JSMainThreadNullState state;
+ RefPtr<WebCore::EventListener> nativeEventListener = WebCore::ObjCEventListener::wrap(listener);
+ IMPL->removeEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
+}
+
+- (BOOL)dispatchEvent:(DOMEvent *)evt
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ BOOL result = IMPL->dispatchEvent(core(evt), ec);
+ WebCore::raiseOnDOMError(ec);
+ return result;
+}
+
+@end
+
+WebCore::TestEventTarget* core(DOMTestEventTarget *wrapper)
+{
+ return wrapper ? reinterpret_cast<WebCore::TestEventTarget*>(wrapper->_internal) : 0;
+}
+
+DOMTestEventTarget *kit(WebCore::TestEventTarget* value)
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
+ if (!value)
+ return nil;
+ if (DOMTestEventTarget *wrapper = getDOMWrapper(value))
+ return [[wrapper retain] autorelease];
+ DOMTestEventTarget *wrapper = [[DOMTestEventTarget alloc] _init];
+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+ value->ref();
+ addDOMWrapper(wrapper, value);
+ return [wrapper autorelease];
+}
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h
new file mode 100644
index 000000000..d4f658d89
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestEventTargetInternal.h
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMTestEventTarget.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+namespace WebCore {
+ class TestEventTarget;
+}
+
+WebCore::TestEventTarget* core(DOMTestEventTarget *);
+DOMTestEventTarget *kit(WebCore::TestEventTarget*);
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.h
index 234259b45..4457de6fb 100644
--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.h
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.h
@@ -28,20 +28,23 @@
#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+@class DOMTestObj;
@class NSString;
@interface DOMTestInterface : DOMObject
#if ENABLE(Condition11) || ENABLE(Condition12)
-- (NSString *)str1;
+- (NSString *)supplementalStr1;
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-- (NSString *)str2;
-- (void)setStr2:(NSString *)newStr2;
+- (NSString *)supplementalStr2;
+- (void)setSupplementalStr2:(NSString *)newSupplementalStr2;
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-- (NSString *)str3;
-- (void)setStr3:(NSString *)newStr3;
+- (NSString *)supplementalStr3;
+- (void)setSupplementalStr3:(NSString *)newSupplementalStr3;
#endif
+- (void)supplementalMethod1;
+- (DOMTestObj *)supplementalMethod2:(NSString *)strArg objArg:(DOMTestObj *)objArg;
@end
#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
index f469cf10a..0e02b9563 100644
--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
@@ -39,10 +39,12 @@
#import "DOMNodeInternal.h"
#import "DOMStyleSheetInternal.h"
#import "DOMTestInterfaceInternal.h"
+#import "DOMTestObjInternal.h"
#import "ExceptionHandlers.h"
#import "JSMainThreadExecState.h"
#import "KURL.h"
#import "TestInterface.h"
+#import "TestObj.h"
#import "TestSupplemental.h"
#import "ThreadCheck.h"
#import "WebCoreObjCExtras.h"
@@ -71,41 +73,64 @@
}
#if ENABLE(Condition11) || ENABLE(Condition12)
-- (NSString *)str1
+- (NSString *)supplementalStr1
{
WebCore::JSMainThreadNullState state;
- return TestSupplemental::str1(IMPL);
+ return TestSupplemental::supplementalStr1(IMPL);
}
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-- (NSString *)str2
+- (NSString *)supplementalStr2
{
WebCore::JSMainThreadNullState state;
- return TestSupplemental::str2(IMPL);
+ return TestSupplemental::supplementalStr2(IMPL);
}
-- (void)setStr2:(NSString *)newStr2
+- (void)setSupplementalStr2:(NSString *)newSupplementalStr2
{
WebCore::JSMainThreadNullState state;
- TestSupplemental::setStr2(IMPL, newStr2);
+ TestSupplemental::setSupplementalStr2(IMPL, newSupplementalStr2);
}
#endif
#if ENABLE(Condition11) || ENABLE(Condition12)
-- (NSString *)str3
+- (NSString *)supplementalStr3
{
WebCore::JSMainThreadNullState state;
- return TestSupplemental::str3(IMPL);
+ return TestSupplemental::supplementalStr3(IMPL);
}
-- (void)setStr3:(NSString *)newStr3
+- (void)setSupplementalStr3:(NSString *)newSupplementalStr3
{
WebCore::JSMainThreadNullState state;
- TestSupplemental::setStr3(IMPL, newStr3);
+ TestSupplemental::setSupplementalStr3(IMPL, newSupplementalStr3);
}
#endif
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+- (void)supplementalMethod1
+{
+ WebCore::JSMainThreadNullState state;
+ TestSupplemental::supplementalMethod1(IMPL);
+}
+
+#endif
+
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+- (DOMTestObj *)supplementalMethod2:(NSString *)strArg objArg:(DOMTestObj *)objArg
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ DOMTestObj *result = kit(WTF::getPtr(TestSupplemental::supplementalMethod2(IMPL, strArg, core(objArg), ec)));
+ WebCore::raiseOnDOMError(ec);
+ return result;
+}
+
+#endif
+
@end
WebCore::TestInterface* core(DOMTestInterface *wrapper)
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 62ce33237..282995ae8 100644
--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -28,12 +28,21 @@
#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+@class DOMDocument;
@class DOMIDBKey;
@class DOMOptionsObject;
+@class DOMSVGDocument;
+@class DOMSVGPoint;
@class DOMTestObj;
@class DOMTestObjectAConstructor;
@class DOMTestObjectBConstructor;
@class DOMTestObjectCConstructor;
+@class DOMa;
+@class DOMb;
+@class DOMbool;
+@class DOMc;
+@class DOMd;
+@class DOMe;
@class DOMlog;
@class NSString;
@protocol DOMEventListener;
@@ -135,6 +144,13 @@ enum {
- (DOMTestObjectCConstructor *)conditionalAttr6;
- (void)setConditionalAttr6:(DOMTestObjectCConstructor *)newConditionalAttr6;
#endif
+- (DOMDocument *)contentDocument;
+- (DOMSVGPoint *)mutablePoint;
+- (void)setMutablePoint:(DOMSVGPoint *)newMutablePoint;
+- (DOMSVGPoint *)immutablePoint;
+- (void)setImmutablePoint:(DOMSVGPoint *)newImmutablePoint;
+- (float)strictFloat;
+- (void)setStrictFloat:(float)newStrictFloat;
- (int)descriptionName;
- (int)idName;
- (void)setIdName:(int)newIdName;
@@ -155,11 +171,6 @@ enum {
- (void)customArgsAndException:(DOMlog *)intArg;
- (void)addEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
- (void)removeEventListener:(NSString *)type listener:(id <DOMEventListener>)listener useCapture:(BOOL)useCapture;
-- (void)withDynamicFrame;
-- (void)withDynamicFrameAndArg:(int)intArg;
-- (void)withDynamicFrameAndOptionalArg:(int)intArg optionalArg:(int)optionalArg;
-- (void)withDynamicFrameAndUserGesture:(int)intArg;
-- (void)withDynamicFrameAndUserGestureASAD:(int)intArg optionalArg:(int)optionalArg;
- (void)withScriptStateVoid;
- (DOMTestObj *)withScriptStateObj;
- (void)withScriptStateVoidException;
@@ -175,6 +186,16 @@ enum {
- (int)classMethodWithOptional:(int)arg;
- (void)overloadedMethod1:(int)arg;
- (void)overloadedMethod1:(NSString *)type;
+- (DOMSVGDocument *)getSVGDocument;
+- (void)convert1:(DOMa *);
+- (void)convert2:(DOMb *);
+- (void)convert3:(DOMc *);
+- (void)convert4:(DOMd *);
+- (void)convert5:(DOMe *);
+- (DOMSVGPoint *)mutablePointFunction;
+- (DOMSVGPoint *)immutablePointFunction;
+- (void)orange;
+- (DOMbool *)strictFunction:(NSString *)str a:(float)a b:(int)b;
@end
#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index b2dca6325..08f1f1e7a 100644
--- a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -32,16 +32,26 @@
#import "DOMBlobInternal.h"
#import "DOMCSSRuleInternal.h"
#import "DOMCSSValueInternal.h"
+#import "DOMDocumentInternal.h"
#import "DOMEventInternal.h"
#import "DOMIDBKeyInternal.h"
#import "DOMNodeInternal.h"
#import "DOMOptionsObjectInternal.h"
+#import "DOMSVGDocumentInternal.h"
+#import "DOMSVGPointInternal.h"
#import "DOMStyleSheetInternal.h"
#import "DOMTestObjInternal.h"
#import "DOMTestObjectAConstructorInternal.h"
#import "DOMTestObjectBConstructorInternal.h"
#import "DOMTestObjectCConstructorInternal.h"
+#import "DOMaInternal.h"
+#import "DOMbInternal.h"
+#import "DOMboolInternal.h"
+#import "DOMcInternal.h"
+#import "DOMdInternal.h"
+#import "DOMeInternal.h"
#import "DOMlogInternal.h"
+#import "Document.h"
#import "EventListener.h"
#import "ExceptionHandlers.h"
#import "HTMLNames.h"
@@ -50,6 +60,8 @@
#import "KURL.h"
#import "ObjCEventListener.h"
#import "OptionsObject.h"
+#import "SVGDocument.h"
+#import "SVGStaticPropertyTearOff.h"
#import "SerializedScriptValue.h"
#import "TestObj.h"
#import "TestObjectAConstructor.h"
@@ -58,6 +70,12 @@
#import "ThreadCheck.h"
#import "WebCoreObjCExtras.h"
#import "WebScriptObjectPrivate.h"
+#import "a.h"
+#import "b.h"
+#import "bool.h"
+#import "c.h"
+#import "d.h"
+#import "e.h"
#import "log.h"
#import <wtf/GetPtr.h>
@@ -514,6 +532,52 @@
}
#endif
+- (DOMDocument *)contentDocument
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(IMPL->contentDocument()));
+}
+
+- (DOMSVGPoint *)mutablePoint
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(WebCore::SVGStaticPropertyTearOff<WebCore::TestObj, WebCore::FloatPoint>::create(IMPL, IMPL->mutablePoint(), &WebCore::TestObj::updateMutablePoint)));
+}
+
+- (void)setMutablePoint:(DOMSVGPoint *)newMutablePoint
+{
+ WebCore::JSMainThreadNullState state;
+ ASSERT(newMutablePoint);
+
+ IMPL->setMutablePoint(core(newMutablePoint));
+}
+
+- (DOMSVGPoint *)immutablePoint
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(WebCore::SVGPropertyTearOff<WebCore::FloatPoint>::create(IMPL->immutablePoint())));
+}
+
+- (void)setImmutablePoint:(DOMSVGPoint *)newImmutablePoint
+{
+ WebCore::JSMainThreadNullState state;
+ ASSERT(newImmutablePoint);
+
+ IMPL->setImmutablePoint(core(newImmutablePoint));
+}
+
+- (float)strictFloat
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->strictFloat();
+}
+
+- (void)setStrictFloat:(float)newStrictFloat
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setStrictFloat(newStrictFloat);
+}
+
- (int)descriptionName
{
WebCore::JSMainThreadNullState state;
@@ -643,36 +707,6 @@
IMPL->removeEventListener(type, WTF::getPtr(nativeEventListener), useCapture);
}
-- (void)withDynamicFrame
-{
- WebCore::JSMainThreadNullState state;
- IMPL->withDynamicFrame();
-}
-
-- (void)withDynamicFrameAndArg:(int)intArg
-{
- WebCore::JSMainThreadNullState state;
- IMPL->withDynamicFrameAndArg(intArg);
-}
-
-- (void)withDynamicFrameAndOptionalArg:(int)intArg optionalArg:(int)optionalArg
-{
- WebCore::JSMainThreadNullState state;
- IMPL->withDynamicFrameAndOptionalArg(intArg, optionalArg);
-}
-
-- (void)withDynamicFrameAndUserGesture:(int)intArg
-{
- WebCore::JSMainThreadNullState state;
- IMPL->withDynamicFrameAndUserGesture(intArg);
-}
-
-- (void)withDynamicFrameAndUserGestureASAD:(int)intArg optionalArg:(int)optionalArg
-{
- WebCore::JSMainThreadNullState state;
- IMPL->withDynamicFrameAndUserGestureASAD(intArg, optionalArg);
-}
-
- (void)withScriptStateVoid
{
WebCore::JSMainThreadNullState state;
@@ -788,6 +822,72 @@
#endif
+- (DOMSVGDocument *)getSVGDocument
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ DOMSVGDocument *result = kit(WTF::getPtr(IMPL->getSVGDocument(ec)));
+ WebCore::raiseOnDOMError(ec);
+ return result;
+}
+
+- (void)convert1:(DOMa *)
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->convert1(core());
+}
+
+- (void)convert2:(DOMb *)
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->convert2(core());
+}
+
+- (void)convert3:(DOMc *)
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->convert3(core());
+}
+
+- (void)convert4:(DOMd *)
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->convert4(core());
+}
+
+- (void)convert5:(DOMe *)
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->convert5(core());
+}
+
+- (DOMSVGPoint *)mutablePointFunction
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(WebCore::SVGPropertyTearOff<WebCore::FloatPoint>::create(IMPL->mutablePointFunction())));
+}
+
+- (DOMSVGPoint *)immutablePointFunction
+{
+ WebCore::JSMainThreadNullState state;
+ return kit(WTF::getPtr(WebCore::SVGPropertyTearOff<WebCore::FloatPoint>::create(IMPL->immutablePointFunction())));
+}
+
+- (void)orange
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->orange();
+}
+
+- (DOMbool *)strictFunction:(NSString *)str a:(float)a b:(int)b
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ DOMbool *result = kit(WTF::getPtr(IMPL->strictFunction(str, a, b, ec)));
+ WebCore::raiseOnDOMError(ec);
+ return result;
+}
+
@end
WebCore::TestObj* core(DOMTestObj *wrapper)
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.h
new file mode 100644
index 000000000..3d7b44793
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMObject.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+@class NSString;
+
+@interface DOMTestOverridingNameGetter : DOMObject
+- (void)anotherFunction:(NSString *)str;
+@end
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.mm b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.mm
new file mode 100644
index 000000000..3a80097bf
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetter.mm
@@ -0,0 +1,94 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "DOMInternal.h"
+
+#import "DOMTestOverridingNameGetter.h"
+
+#import "DOMBlobInternal.h"
+#import "DOMCSSRuleInternal.h"
+#import "DOMCSSValueInternal.h"
+#import "DOMEventInternal.h"
+#import "DOMNodeInternal.h"
+#import "DOMStyleSheetInternal.h"
+#import "DOMTestOverridingNameGetterInternal.h"
+#import "ExceptionHandlers.h"
+#import "JSMainThreadExecState.h"
+#import "KURL.h"
+#import "TestOverridingNameGetter.h"
+#import "ThreadCheck.h"
+#import "WebCoreObjCExtras.h"
+#import "WebScriptObjectPrivate.h"
+#import <wtf/GetPtr.h>
+
+#define IMPL reinterpret_cast<WebCore::TestOverridingNameGetter*>(_internal)
+
+@implementation DOMTestOverridingNameGetter
+
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([DOMTestOverridingNameGetter class], self))
+ return;
+
+ if (_internal)
+ IMPL->deref();
+ [super dealloc];
+}
+
+- (void)finalize
+{
+ if (_internal)
+ IMPL->deref();
+ [super finalize];
+}
+
+- (void)anotherFunction:(NSString *)str
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->anotherFunction(str);
+}
+
+@end
+
+WebCore::TestOverridingNameGetter* core(DOMTestOverridingNameGetter *wrapper)
+{
+ return wrapper ? reinterpret_cast<WebCore::TestOverridingNameGetter*>(wrapper->_internal) : 0;
+}
+
+DOMTestOverridingNameGetter *kit(WebCore::TestOverridingNameGetter* value)
+{
+ { DOM_ASSERT_MAIN_THREAD(); WebCoreThreadViolationCheckRoundOne(); };
+ if (!value)
+ return nil;
+ if (DOMTestOverridingNameGetter *wrapper = getDOMWrapper(value))
+ return [[wrapper retain] autorelease];
+ DOMTestOverridingNameGetter *wrapper = [[DOMTestOverridingNameGetter alloc] _init];
+ wrapper->_internal = reinterpret_cast<DOMObjectInternal*>(value);
+ value->ref();
+ addDOMWrapper(wrapper, value);
+ return [wrapper autorelease];
+}
diff --git a/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetterInternal.h b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetterInternal.h
new file mode 100644
index 000000000..573cf6f11
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/ObjC/DOMTestOverridingNameGetterInternal.h
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the WebKit open source project.
+ * This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebCore/DOMTestOverridingNameGetter.h>
+
+#if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
+
+namespace WebCore {
+ class TestOverridingNameGetter;
+}
+
+WebCore::TestOverridingNameGetter* core(DOMTestOverridingNameGetter *);
+DOMTestOverridingNameGetter *kit(WebCore::TestOverridingNameGetter*);
+
+#endif
diff --git a/Source/WebCore/bindings/scripts/test/TestDomainSecurity.idl b/Source/WebCore/bindings/scripts/test/TestDomainSecurity.idl
new file mode 100644
index 000000000..09d60bd52
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/TestDomainSecurity.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, 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 WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module test {
+ interface [
+ CheckDomainSecurity
+ ] TestActiveDOMObject {
+ readonly attribute long excitingAttr;
+ void excitingFunction(in Node nextChild);
+ [DoNotCheckDomainSecurity] void postMessage(in DOMString message);
+ };
+}
diff --git a/Source/WebCore/bindings/scripts/test/TestEventConstructor.idl b/Source/WebCore/bindings/scripts/test/TestEventConstructor.idl
index c057ca7b5..7783826e3 100644
--- a/Source/WebCore/bindings/scripts/test/TestEventConstructor.idl
+++ b/Source/WebCore/bindings/scripts/test/TestEventConstructor.idl
@@ -34,6 +34,6 @@ module test {
] TestEventConstructor {
// Attributes
readonly attribute DOMString attr1;
- readonly attribute [InitializedAtConstructor] DOMString attr2;
+ readonly attribute [InitializedByConstructor] DOMString attr2;
};
}
diff --git a/Source/WebCore/bindings/scripts/test/TestEventTarget.idl b/Source/WebCore/bindings/scripts/test/TestEventTarget.idl
new file mode 100644
index 000000000..beedb5730
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/TestEventTarget.idl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, 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 WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module events {
+
+ interface [
+ EventTarget,
+ HasIndexGetter,
+ HasNameGetter,
+ MasqueradesAsUndefined
+ ] TestEventTarget {
+
+ Node item(in [IsIndex] unsigned long index);
+
+ void addEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ void removeEventListener(in DOMString type,
+ in EventListener listener,
+ in [Optional] boolean useCapture);
+ boolean dispatchEvent(in Event evt)
+ raises(EventException);
+ };
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/TestInterface.idl b/Source/WebCore/bindings/scripts/test/TestInterface.idl
index 2b054a823..eb4943ceb 100644
--- a/Source/WebCore/bindings/scripts/test/TestInterface.idl
+++ b/Source/WebCore/bindings/scripts/test/TestInterface.idl
@@ -31,6 +31,7 @@
module test {
interface [
ActiveDOMObject,
+ DelegatingPutFunction,
Conditional=Condition1|Condition2,
CallWith=ScriptExecutionContext,
Constructor(in DOMString str1, in [Optional=CallWithDefaultValue] DOMString str2),
diff --git a/Source/WebCore/bindings/scripts/test/TestObj.idl b/Source/WebCore/bindings/scripts/test/TestObj.idl
index 655dfe10d..ed338c6b2 100644
--- a/Source/WebCore/bindings/scripts/test/TestObj.idl
+++ b/Source/WebCore/bindings/scripts/test/TestObj.idl
@@ -101,11 +101,6 @@ module test {
in [Optional] boolean useCapture);
// 'CallWith' extended attribute
- [CallWith=DynamicFrame] void withDynamicFrame();
- [CallWith=DynamicFrame] void withDynamicFrameAndArg(in long intArg);
- [CallWith=DynamicFrame] void withDynamicFrameAndOptionalArg(in long intArg, in [Optional] long optionalArg);
- [NeedsUserGestureCheck, CallWith=DynamicFrame] void withDynamicFrameAndUserGesture(in long intArg);
- [NeedsUserGestureCheck, CallWith=DynamicFrame] void withDynamicFrameAndUserGestureASAD(in long intArg, in [Optional] long optionalArg);
[CallWith=ScriptState] void withScriptStateVoid();
[CallWith=ScriptState] TestObj withScriptStateObj();
[CallWith=ScriptState] void withScriptStateVoidException()
@@ -184,6 +179,27 @@ module test {
attribute double[] doubleArray;
#endif
+ readonly attribute [CheckFrameSecurity] Document contentDocument;
+ [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
+ raises(DOMException);
+
+ void convert1(in [ConvertNullStringTo=Null] a);
+ void convert2(in [ConvertNullStringTo=Undefined] b);
+ void convert3(in [ConvertNullStringTo=False] c);
+ void convert4(in [ConvertNullToNullString] d);
+ void convert5(in [ConvertUndefinedOrNullToNullString] e);
+
+ attribute SVGPoint mutablePoint;
+ attribute [Immutable] SVGPoint immutablePoint;
+ SVGPoint mutablePointFunction();
+ [Immutable] SVGPoint immutablePointFunction();
+
+ [ImplementationFunction=banana] void orange();
+
+ attribute [StrictTypeChecking] float strictFloat;
+ [StrictTypeChecking] bool strictFunction(in DOMString str, in float a, in int b)
+ raises(DOMException);
+
// ObjectiveC reserved words.
readonly attribute long description;
attribute long id;
diff --git a/Source/WebCore/bindings/scripts/test/TestOverridingNameGetter.idl b/Source/WebCore/bindings/scripts/test/TestOverridingNameGetter.idl
new file mode 100644
index 000000000..a56ea5f2e
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/TestOverridingNameGetter.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary formstrArg, 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 WARRANTIEstrArg, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module events {
+
+ interface [
+ HasOverridingNameGetter
+ ] TestOverridingNameGetter {
+ void anotherFunction(in DOMString str);
+ };
+
+}
diff --git a/Source/WebCore/bindings/scripts/test/TestSupplemental.idl b/Source/WebCore/bindings/scripts/test/TestSupplemental.idl
index 466fdd51a..7ddca1748 100644
--- a/Source/WebCore/bindings/scripts/test/TestSupplemental.idl
+++ b/Source/WebCore/bindings/scripts/test/TestSupplemental.idl
@@ -33,8 +33,11 @@ module test {
Conditional=Condition11|Condition12,
Supplemental=TestInterface
] TestSupplemental {
- readonly attribute DOMString str1;
- attribute DOMString str2;
- attribute [CustomGetter, CustomSetter] DOMString str3;
+ readonly attribute DOMString supplementalStr1;
+ attribute DOMString supplementalStr2;
+ attribute [CustomGetter, CustomSetter] DOMString supplementalStr3;
+
+ void supplementalMethod1();
+ [CallWith=ScriptExecutionContext] TestObj supplementalMethod2(in DOMString strArg, in TestObj objArg) raises(DOMException);
};
}
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
new file mode 100644
index 000000000..66582879b
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
@@ -0,0 +1,199 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestActiveDOMObject.h"
+
+#include "ExceptionCode.h"
+#include "RuntimeEnabledFeatures.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8BindingState.h"
+#include "V8DOMWrapper.h"
+#include "V8IsolatedContext.h"
+#include "V8Node.h"
+#include "V8Proxy.h"
+#include <wtf/UnusedParam.h>
+
+namespace WebCore {
+
+WrapperTypeInfo V8TestActiveDOMObject::info = { V8TestActiveDOMObject::GetTemplate, V8TestActiveDOMObject::derefObject, 0, 0 };
+
+namespace TestActiveDOMObjectInternal {
+
+template <typename T> void V8_USE(T) { }
+
+static v8::Handle<v8::Value> excitingAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestActiveDOMObject.excitingAttr._get");
+ TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(info.Holder());
+ return v8::Integer::New(imp->excitingAttr());
+}
+
+static v8::Handle<v8::Value> excitingFunctionCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestActiveDOMObject.excitingFunction");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder());
+ if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), true))
+ return v8::Handle<v8::Value>();
+ EXCEPTION_BLOCK(Node*, nextChild, V8Node::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ imp->excitingFunction(nextChild);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> postMessageCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestActiveDOMObject.postMessage");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(args.Holder());
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, message, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
+ imp->postMessage(message);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> postMessageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestActiveDOMObject.postMessage._get");
+ static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(TestActiveDOMObjectInternal::postMessageCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate())));
+ v8::Handle<v8::Object> holder = V8DOMWrapper::lookupDOMWrapper(V8TestActiveDOMObject::GetTemplate(), info.This());
+ if (holder.IsEmpty()) {
+ // can only reach here by 'object.__proto__.func', and it should passed
+ // domain security check already
+ return privateTemplate->GetFunction();
+ }
+ TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
+ if (!V8BindingSecurity::canAccessFrame(V8BindingState::Only(), imp->frame(), false)) {
+ static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(TestActiveDOMObjectInternal::postMessageCallback, v8::Handle<v8::Value>(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate())));
+ return sharedTemplate->GetFunction();
+ }
+ return privateTemplate->GetFunction();
+}
+
+} // namespace TestActiveDOMObjectInternal
+
+static const BatchedAttribute TestActiveDOMObjectAttrs[] = {
+ // Attribute 'excitingAttr' (Type: 'readonly attribute' ExtAttr: '')
+ {"excitingAttr", TestActiveDOMObjectInternal::excitingAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+};
+
+static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestActiveDOMObjectTemplate(v8::Persistent<v8::FunctionTemplate> desc)
+{
+ desc->ReadOnlyPrototype();
+
+ v8::Local<v8::Signature> defaultSignature;
+ defaultSignature = configureTemplate(desc, "TestActiveDOMObject", v8::Persistent<v8::FunctionTemplate>(), V8TestActiveDOMObject::internalFieldCount,
+ TestActiveDOMObjectAttrs, WTF_ARRAY_LENGTH(TestActiveDOMObjectAttrs),
+ 0, 0);
+ UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ UNUSED_PARAM(instance); // In some cases, it will not be used.
+ UNUSED_PARAM(proto); // In some cases, it will not be used.
+ instance->SetAccessCheckCallbacks(V8TestActiveDOMObject::namedSecurityCheck, V8TestActiveDOMObject::indexedSecurityCheck, v8::External::Wrap(&V8TestActiveDOMObject::info));
+
+ // Custom Signature 'excitingFunction'
+ const int excitingFunctionArgc = 1;
+ v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8Node::GetRawTemplate() };
+ v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv);
+ proto->Set(v8::String::New("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectInternal::excitingFunctionCallback, v8::Handle<v8::Value>(), excitingFunctionSignature));
+
+ // Function 'postMessage' (ExtAttr: 'DoNotCheckDomainSecurity')
+ proto->SetAccessor(v8::String::New("postMessage"), TestActiveDOMObjectInternal::postMessageAttrGetter, 0, v8::Handle<v8::Value>(), v8::ALL_CAN_READ, static_cast<v8::PropertyAttribute>(v8::DontDelete | v8::ReadOnly));
+
+ // Custom toString template
+ desc->Set(getToStringName(), getToStringTemplate());
+ return desc;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestActiveDOMObject::GetRawTemplate()
+{
+ V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
+ V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
+ if (result != data->rawTemplateMap().end())
+ return result->second;
+
+ v8::HandleScope handleScope;
+ v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+ data->rawTemplateMap().add(&info, templ);
+ return templ;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestActiveDOMObject::GetTemplate()
+{
+ V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
+ V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
+ if (result != data->templateMap().end())
+ return result->second;
+
+ v8::HandleScope handleScope;
+ v8::Persistent<v8::FunctionTemplate> templ =
+ ConfigureV8TestActiveDOMObjectTemplate(GetRawTemplate());
+ data->templateMap().add(&info, templ);
+ return templ;
+}
+
+bool V8TestActiveDOMObject::HasInstance(v8::Handle<v8::Value> value)
+{
+ return GetRawTemplate()->HasInstance(value);
+}
+
+
+v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(TestActiveDOMObject* impl)
+{
+ v8::Handle<v8::Object> wrapper;
+ V8Proxy* proxy = 0;
+ if (impl->frame()) {
+ proxy = V8Proxy::retrieve(impl->frame());
+ if (proxy)
+ proxy->windowShell()->initContextIfNeeded();
+ }
+
+ v8::Handle<v8::Context> context;
+ if (proxy)
+ context = proxy->context();
+
+ // Enter the node's context and create the wrapper in that context.
+ if (!context.IsEmpty())
+ context->Enter();
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
+ // Exit the node's context if it was entered.
+ if (!context.IsEmpty())
+ context->Exit();
+ if (wrapper.IsEmpty())
+ return wrapper;
+
+ impl->ref();
+ v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
+
+ if (!hasDependentLifetime)
+ wrapperHandle.MarkIndependent();
+ getDOMObjectMap().set(impl, wrapperHandle);
+ return wrapper;
+}
+
+void V8TestActiveDOMObject::derefObject(void* object)
+{
+ static_cast<TestActiveDOMObject*>(object)->deref();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
new file mode 100644
index 000000000..e163b3dd6
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h
@@ -0,0 +1,81 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef V8TestActiveDOMObject_h
+#define V8TestActiveDOMObject_h
+
+#include "TestActiveDOMObject.h"
+#include "V8DOMWrapper.h"
+#include "WrapperTypeInfo.h"
+#include <v8.h>
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class V8TestActiveDOMObject {
+public:
+ static const bool hasDependentLifetime = false;
+ static bool HasInstance(v8::Handle<v8::Value>);
+ static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+ static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+ static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestActiveDOMObject*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestActiveDOMObject*);
+ static void derefObject(void*);
+ static WrapperTypeInfo info;
+ static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+ static bool namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType, v8::Local<v8::Value> data);
+ static bool indexedSecurityCheck(v8::Local<v8::Object> host, uint32_t index, v8::AccessType, v8::Local<v8::Value> data);
+ static v8::Handle<v8::Object> existingWrapper(TestActiveDOMObject*);
+
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestActiveDOMObject*);
+};
+
+ALWAYS_INLINE v8::Handle<v8::Object> V8TestActiveDOMObject::existingWrapper(TestActiveDOMObject* impl)
+{
+ return getDOMObjectMap().get(impl);
+}
+
+v8::Handle<v8::Object> V8TestActiveDOMObject::wrap(TestActiveDOMObject* impl)
+{
+ v8::Handle<v8::Object> wrapper = existingWrapper(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestActiveDOMObject::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestActiveDOMObject::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestActiveDOMObject > impl)
+{
+ return toV8(impl.get());
+}
+
+}
+
+#endif // V8TestActiveDOMObject_h
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
index 14e2b0d71..dd33aa056 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
@@ -58,7 +58,7 @@ static v8::Handle<v8::Value> attr2AttrGetter(v8::Local<v8::String> name, const v
static const BatchedAttribute TestEventConstructorAttrs[] = {
// Attribute 'attr1' (Type: 'readonly attribute' ExtAttr: '')
{"attr1", TestEventConstructorInternal::attr1AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'attr2' (Type: 'readonly attribute' ExtAttr: 'InitializedAtConstructor')
+ // Attribute 'attr2' (Type: 'readonly attribute' ExtAttr: 'InitializedByConstructor')
{"attr2", TestEventConstructorInternal::attr2AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
};
@@ -91,6 +91,7 @@ v8::Handle<v8::Value> V8TestEventConstructor::constructorCallback(const v8::Argu
bool fillTestEventConstructorInit(TestEventConstructorInit& eventInit, const OptionsObject& options)
{
+ options.get("attr2", eventInit.attr2);
return true;
}
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
new file mode 100644
index 000000000..00e0f34ec
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
@@ -0,0 +1,198 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestEventTarget.h"
+
+#include "ExceptionCode.h"
+#include "RuntimeEnabledFeatures.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8BindingState.h"
+#include "V8Collection.h"
+#include "V8DOMWrapper.h"
+#include "V8Event.h"
+#include "V8IsolatedContext.h"
+#include "V8Node.h"
+#include "V8Proxy.h"
+#include <wtf/UnusedParam.h>
+
+namespace WebCore {
+
+WrapperTypeInfo V8TestEventTarget::info = { V8TestEventTarget::GetTemplate, V8TestEventTarget::derefObject, 0, 0 };
+
+namespace TestEventTargetInternal {
+
+template <typename T> void V8_USE(T) { }
+
+static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestEventTarget.item");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder());
+ ExceptionCode ec = 0;
+ {
+ EXCEPTION_BLOCK(int, index, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
+ if (UNLIKELY(index < 0)) {
+ ec = INDEX_SIZE_ERR;
+ goto fail;
+ }
+ return toV8(imp->item(index));
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> addEventListenerCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestEventTarget.addEventListener()");
+ RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOrCreate);
+ if (listener) {
+ V8TestEventTarget::toNative(args.Holder())->addEventListener(v8ValueToAtomicWebCoreString(args[0]), listener, args[2]->BooleanValue());
+ createHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex);
+ }
+ return v8::Undefined();
+}
+
+static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestEventTarget.removeEventListener()");
+ RefPtr<EventListener> listener = V8DOMWrapper::getEventListener(args[1], false, ListenerFindOnly);
+ if (listener) {
+ V8TestEventTarget::toNative(args.Holder())->removeEventListener(v8ValueToAtomicWebCoreString(args[0]), listener.get(), args[2]->BooleanValue());
+ removeHiddenDependency(args.Holder(), args[1], V8TestEventTarget::eventListenerCacheIndex);
+ }
+ return v8::Undefined();
+}
+
+static v8::Handle<v8::Value> dispatchEventCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestEventTarget.dispatchEvent");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestEventTarget* imp = V8TestEventTarget::toNative(args.Holder());
+ ExceptionCode ec = 0;
+ {
+ EXCEPTION_BLOCK(Event*, evt, V8Event::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8Event::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ bool result = imp->dispatchEvent(evt, ec);
+ if (UNLIKELY(ec))
+ goto fail;
+ return v8Boolean(result);
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+}
+
+} // namespace TestEventTargetInternal
+
+static const BatchedCallback TestEventTargetCallbacks[] = {
+ {"item", TestEventTargetInternal::itemCallback},
+ {"addEventListener", TestEventTargetInternal::addEventListenerCallback},
+ {"removeEventListener", TestEventTargetInternal::removeEventListenerCallback},
+};
+
+static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestEventTargetTemplate(v8::Persistent<v8::FunctionTemplate> desc)
+{
+ desc->ReadOnlyPrototype();
+
+ v8::Local<v8::Signature> defaultSignature;
+ defaultSignature = configureTemplate(desc, "TestEventTarget", v8::Persistent<v8::FunctionTemplate>(), V8TestEventTarget::internalFieldCount,
+ 0, 0,
+ TestEventTargetCallbacks, WTF_ARRAY_LENGTH(TestEventTargetCallbacks));
+ UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ UNUSED_PARAM(instance); // In some cases, it will not be used.
+ UNUSED_PARAM(proto); // In some cases, it will not be used.
+
+ setCollectionIndexedGetter<TestEventTarget, Node>(desc);
+ desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestEventTarget::namedPropertyGetter, 0, 0, 0, 0);
+ desc->InstanceTemplate()->MarkAsUndetectable();
+
+ // Custom Signature 'dispatchEvent'
+ const int dispatchEventArgc = 1;
+ v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8Event::GetRawTemplate() };
+ v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
+ proto->Set(v8::String::New("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetInternal::dispatchEventCallback, v8::Handle<v8::Value>(), dispatchEventSignature));
+
+ // Custom toString template
+ desc->Set(getToStringName(), getToStringTemplate());
+ return desc;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestEventTarget::GetRawTemplate()
+{
+ V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
+ V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
+ if (result != data->rawTemplateMap().end())
+ return result->second;
+
+ v8::HandleScope handleScope;
+ v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+ data->rawTemplateMap().add(&info, templ);
+ return templ;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestEventTarget::GetTemplate()
+{
+ V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
+ V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
+ if (result != data->templateMap().end())
+ return result->second;
+
+ v8::HandleScope handleScope;
+ v8::Persistent<v8::FunctionTemplate> templ =
+ ConfigureV8TestEventTargetTemplate(GetRawTemplate());
+ data->templateMap().add(&info, templ);
+ return templ;
+}
+
+bool V8TestEventTarget::HasInstance(v8::Handle<v8::Value> value)
+{
+ return GetRawTemplate()->HasInstance(value);
+}
+
+
+v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(TestEventTarget* impl)
+{
+ v8::Handle<v8::Object> wrapper;
+ V8Proxy* proxy = 0;
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
+ if (wrapper.IsEmpty())
+ return wrapper;
+
+ impl->ref();
+ v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
+
+ if (!hasDependentLifetime)
+ wrapperHandle.MarkIndependent();
+ getDOMObjectMap().set(impl, wrapperHandle);
+ return wrapper;
+}
+
+void V8TestEventTarget::derefObject(void* object)
+{
+ static_cast<TestEventTarget*>(object)->deref();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
new file mode 100644
index 000000000..073412f80
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h
@@ -0,0 +1,82 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef V8TestEventTarget_h
+#define V8TestEventTarget_h
+
+#include "TestEventTarget.h"
+#include "V8DOMWrapper.h"
+#include "WrapperTypeInfo.h"
+#include <v8.h>
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class V8TestEventTarget {
+public:
+ static const bool hasDependentLifetime = false;
+ static bool HasInstance(v8::Handle<v8::Value>);
+ static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+ static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+ static TestEventTarget* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestEventTarget*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestEventTarget*);
+ static void derefObject(void*);
+ static WrapperTypeInfo info;
+ static v8::Handle<v8::Value> indexedPropertyGetter(uint32_t, const v8::AccessorInfo&);
+ static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&);
+ static const int eventListenerCacheIndex = v8DefaultWrapperInternalFieldCount + 0;
+ static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1;
+ static v8::Handle<v8::Object> existingWrapper(TestEventTarget*);
+
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestEventTarget*);
+};
+
+ALWAYS_INLINE v8::Handle<v8::Object> V8TestEventTarget::existingWrapper(TestEventTarget* impl)
+{
+ return getDOMObjectMap().get(impl);
+}
+
+v8::Handle<v8::Object> V8TestEventTarget::wrap(TestEventTarget* impl)
+{
+ v8::Handle<v8::Object> wrapper = existingWrapper(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestEventTarget::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestEventTarget* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestEventTarget::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestEventTarget > impl)
+{
+ return toV8(impl.get());
+}
+
+}
+
+#endif // V8TestEventTarget_h
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index 5358b5ecb..ec1f4e046 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -32,7 +32,11 @@
#include "V8DOMWrapper.h"
#include "V8IsolatedContext.h"
#include "V8Proxy.h"
+#include "V8TestObj.h"
#include "V8TestSupplemental.h"
+#include <wtf/GetPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
#include <wtf/UnusedParam.h>
namespace WebCore {
@@ -45,56 +49,101 @@ template <typename T> void V8_USE(T) { }
#if ENABLE(Condition11) || ENABLE(Condition12)
-static v8::Handle<v8::Value> str1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> supplementalStr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestInterface.str1._get");
+ INC_STATS("DOM.TestInterface.supplementalStr1._get");
TestInterface* imp = V8TestInterface::toNative(info.Holder());
- return v8String(TestSupplemental::str1(imp));
+ return v8String(TestSupplemental::supplementalStr1(imp));
}
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
-static v8::Handle<v8::Value> str2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> supplementalStr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestInterface.str2._get");
+ INC_STATS("DOM.TestInterface.supplementalStr2._get");
TestInterface* imp = V8TestInterface::toNative(info.Holder());
- return v8String(TestSupplemental::str2(imp));
+ return v8String(TestSupplemental::supplementalStr2(imp));
}
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
-static void str2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void supplementalStr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestInterface.str2._set");
+ INC_STATS("DOM.TestInterface.supplementalStr2._set");
TestInterface* imp = V8TestInterface::toNative(info.Holder());
STRING_TO_V8PARAMETER_EXCEPTION_BLOCK_VOID(V8Parameter<>, v, value);
- TestSupplemental::setStr2(imp, v);
+ TestSupplemental::setSupplementalStr2(imp, v);
return;
}
#endif // ENABLE(Condition11) || ENABLE(Condition12)
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static v8::Handle<v8::Value> supplementalMethod1Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestInterface.supplementalMethod1");
+ TestInterface* imp = V8TestInterface::toNative(args.Holder());
+ TestSupplemental::supplementalMethod1(imp);
+ return v8::Handle<v8::Value>();
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
+#if ENABLE(Condition11) || ENABLE(Condition12)
+
+static v8::Handle<v8::Value> supplementalMethod2Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestInterface.supplementalMethod2");
+ if (args.Length() < 2)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestInterface* imp = V8TestInterface::toNative(args.Holder());
+ ExceptionCode ec = 0;
+ {
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, strArg, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
+ EXCEPTION_BLOCK(TestObj*, objArg, V8TestObj::HasInstance(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined))) : 0);
+ ScriptExecutionContext* scriptContext = getScriptExecutionContext();
+ if (!scriptContext)
+ return v8::Undefined();
+ RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(imp, scriptContext, strArg, objArg, ec);
+ if (UNLIKELY(ec))
+ goto fail;
+ return toV8(result.release());
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+}
+
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
} // namespace TestInterfaceInternal
static const BatchedAttribute TestInterfaceAttrs[] = {
#if ENABLE(Condition11) || ENABLE(Condition12)
- // Attribute 'str1' (Type: 'readonly attribute' ExtAttr: 'Conditional ImplementedBy')
- {"str1", TestInterfaceInternal::str1AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'supplementalStr1' (Type: 'readonly attribute' ExtAttr: 'Conditional ImplementedBy')
+ {"supplementalStr1", TestInterfaceInternal::supplementalStr1AttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
- // Attribute 'str2' (Type: 'attribute' ExtAttr: 'Conditional ImplementedBy')
- {"str2", TestInterfaceInternal::str2AttrGetter, TestInterfaceInternal::str2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'supplementalStr2' (Type: 'attribute' ExtAttr: 'Conditional ImplementedBy')
+ {"supplementalStr2", TestInterfaceInternal::supplementalStr2AttrGetter, TestInterfaceInternal::supplementalStr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
#endif // ENABLE(Condition11) || ENABLE(Condition12)
#if ENABLE(Condition11) || ENABLE(Condition12)
- // Attribute 'str3' (Type: 'attribute' ExtAttr: 'CustomSetter CustomGetter Conditional ImplementedBy')
- {"str3", V8TestSupplemental::str3AccessorGetter, V8TestSupplemental::str3AccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'supplementalStr3' (Type: 'attribute' ExtAttr: 'CustomSetter CustomGetter Conditional ImplementedBy')
+ {"supplementalStr3", V8TestSupplemental::supplementalStr3AccessorGetter, V8TestSupplemental::supplementalStr3AccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
#endif // ENABLE(Condition11) || ENABLE(Condition12)
};
+static const BatchedCallback TestInterfaceCallbacks[] = {
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ {"supplementalMethod1", TestInterfaceInternal::supplementalMethod1Callback},
+#endif
+};
+
v8::Handle<v8::Value> V8TestInterface::constructorCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestInterface.Constructor");
@@ -135,11 +184,23 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestInterfaceTemplate(v8:
v8::Local<v8::Signature> defaultSignature;
defaultSignature = configureTemplate(desc, "TestInterface", v8::Persistent<v8::FunctionTemplate>(), V8TestInterface::internalFieldCount,
TestInterfaceAttrs, WTF_ARRAY_LENGTH(TestInterfaceAttrs),
- 0, 0);
+ TestInterfaceCallbacks, WTF_ARRAY_LENGTH(TestInterfaceCallbacks));
UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
desc->SetCallHandler(V8TestInterface::constructorCallback);
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ UNUSED_PARAM(instance); // In some cases, it will not be used.
+ UNUSED_PARAM(proto); // In some cases, it will not be used.
+ // Custom Signature 'supplementalMethod2'
+ const int supplementalMethod2Argc = 2;
+ v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8TestObj::GetRawTemplate() };
+ v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv);
+#if ENABLE(Condition11) || ENABLE(Condition12)
+ proto->Set(v8::String::New("supplementalMethod2"), v8::FunctionTemplate::New(TestInterfaceInternal::supplementalMethod2Callback, v8::Handle<v8::Value>(), supplementalMethod2Signature));
+#endif // ENABLE(Condition11) || ENABLE(Condition12)
+
// Custom toString template
desc->Set(getToStringName(), getToStringTemplate());
return desc;
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index a048c8341..7216c0278 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -47,6 +47,7 @@ public:
static WrapperTypeInfo info;
static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments&);
+ static v8::Handle<v8::Value> namedPropertySetter(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::AccessorInfo&);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
static v8::Handle<v8::Object> existingWrapper(TestInterface*);
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index cb3cd6cb2..17c0a03ad 100644
--- a/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -27,19 +27,29 @@
#include "IDBKey.h"
#include "OptionsObject.h"
#include "RuntimeEnabledFeatures.h"
+#include "SVGPropertyTearOff.h"
+#include "SVGStaticPropertyTearOff.h"
#include "ScriptArguments.h"
#include "ScriptCallStack.h"
#include "ScriptCallStackFactory.h"
-#include "ScriptController.h"
#include "SerializedScriptValue.h"
#include "V8Binding.h"
#include "V8BindingMacros.h"
#include "V8BindingState.h"
#include "V8DOMWrapper.h"
+#include "V8Document.h"
#include "V8IsolatedContext.h"
#include "V8Proxy.h"
+#include "V8SVGDocument.h"
+#include "V8SVGPoint.h"
#include "V8TestCallback.h"
+#include "V8a.h"
#include "V8any.h"
+#include "V8b.h"
+#include "V8bool.h"
+#include "V8c.h"
+#include "V8d.h"
+#include "V8e.h"
#include "V8int.h"
#include "V8log.h"
#include <wtf/GetPtr.h>
@@ -675,6 +685,64 @@ static void doubleArrayAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
return;
}
+static v8::Handle<v8::Value> contentDocumentAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.contentDocument._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->contentDocument()))
+ return v8::Handle<v8::Value>();
+
+ return toV8(imp->contentDocument());
+}
+
+static v8::Handle<v8::Value> mutablePointAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.mutablePoint._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return toV8(WTF::getPtr(SVGStaticPropertyTearOff<TestObj, FloatPoint>::create(imp, imp->mutablePoint(), &TestObj::updateMutablePoint)));
+}
+
+static void mutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.mutablePoint._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+ imp->setMutablePoint(WTF::getPtr(v));
+ return;
+}
+
+static v8::Handle<v8::Value> immutablePointAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.immutablePoint._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePoint())));
+}
+
+static void immutablePointAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.immutablePoint._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
+ imp->setImmutablePoint(WTF::getPtr(v));
+ return;
+}
+
+static v8::Handle<v8::Value> strictFloatAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.strictFloat._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Number::New(imp->strictFloat());
+}
+
+static void strictFloatAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.strictFloat._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ float v = static_cast<float>(value->NumberValue());
+ imp->setStrictFloat(v);
+ return;
+}
+
static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.description._get");
@@ -894,89 +962,6 @@ static v8::Handle<v8::Value> removeEventListenerCallback(const v8::Arguments& ar
return v8::Undefined();
}
-static v8::Handle<v8::Value> withDynamicFrameCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.TestObj.withDynamicFrame");
- TestObj* imp = V8TestObj::toNative(args.Holder());
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrame(enteredFrame);
- return v8::Handle<v8::Value>();
-}
-
-static v8::Handle<v8::Value> withDynamicFrameAndArgCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.TestObj.withDynamicFrameAndArg");
- if (args.Length() < 1)
- return throwError("Not enough arguments", V8Proxy::TypeError);
- TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrameAndArg(enteredFrame, intArg);
- return v8::Handle<v8::Value>();
-}
-
-static v8::Handle<v8::Value> withDynamicFrameAndOptionalArgCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.TestObj.withDynamicFrameAndOptionalArg");
- if (args.Length() < 1)
- return throwError("Not enough arguments", V8Proxy::TypeError);
- TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
- if (args.Length() <= 1) {
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrameAndOptionalArg(enteredFrame, intArg);
- return v8::Handle<v8::Value>();
- }
- EXCEPTION_BLOCK(int, optionalArg, toInt32(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)));
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrameAndOptionalArg(enteredFrame, intArg, optionalArg);
- return v8::Handle<v8::Value>();
-}
-
-static v8::Handle<v8::Value> withDynamicFrameAndUserGestureCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.TestObj.withDynamicFrameAndUserGesture");
- if (args.Length() < 1)
- return throwError("Not enough arguments", V8Proxy::TypeError);
- TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrameAndUserGesture(enteredFrame, intArg, ScriptController::processingUserGesture());
- return v8::Handle<v8::Value>();
-}
-
-static v8::Handle<v8::Value> withDynamicFrameAndUserGestureASADCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.TestObj.withDynamicFrameAndUserGestureASAD");
- if (args.Length() < 1)
- return throwError("Not enough arguments", V8Proxy::TypeError);
- TestObj* imp = V8TestObj::toNative(args.Holder());
- EXCEPTION_BLOCK(int, intArg, toInt32(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)));
- if (args.Length() <= 1) {
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrameAndUserGestureASAD(enteredFrame, intArg, ScriptController::processingUserGesture());
- return v8::Handle<v8::Value>();
- }
- EXCEPTION_BLOCK(int, optionalArg, toInt32(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)));
- Frame* enteredFrame = V8Proxy::retrieveFrameForEnteredContext();
- if (!enteredFrame)
- return v8::Undefined();
- imp->withDynamicFrameAndUserGestureASAD(enteredFrame, intArg, optionalArg, ScriptController::processingUserGesture());
- return v8::Handle<v8::Value>();
-}
-
static v8::Handle<v8::Value> withScriptStateVoidCallback(const v8::Arguments& args)
{
INC_STATS("DOM.TestObj.withScriptStateVoid");
@@ -1362,6 +1347,122 @@ static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments
return v8::Handle<v8::Value>();
}
+static v8::Handle<v8::Value> getSVGDocumentCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.getSVGDocument");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ ExceptionCode ec = 0;
+ {
+ if (!V8BindingSecurity::allowAccessToNode(V8BindingState::Only(), imp->getSVGDocument(ec)))
+ return v8::Handle<v8::Value>();
+ RefPtr<SVGDocument> result = imp->getSVGDocument(ec);
+ if (UNLIKELY(ec))
+ goto fail;
+ return toV8(result.release());
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> convert1Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.convert1");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(a*, , V8a::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8a::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ imp->convert1();
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> convert2Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.convert2");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(b*, , V8b::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8b::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ imp->convert2();
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> convert3Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.convert3");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(c*, , V8c::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8c::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ imp->convert3();
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> convert4Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.convert4");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(d*, , V8d::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8d::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ imp->convert4();
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> convert5Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.convert5");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(e*, , V8e::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8e::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
+ imp->convert5();
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> mutablePointFunctionCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.mutablePointFunction");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->mutablePointFunction())));
+}
+
+static v8::Handle<v8::Value> immutablePointFunctionCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.immutablePointFunction");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ return toV8(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->immutablePointFunction())));
+}
+
+static v8::Handle<v8::Value> orangeCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.orange");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ imp->banana();
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> strictFunctionCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.strictFunction");
+ if (args.Length() < 3)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ ExceptionCode ec = 0;
+ {
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
+ EXCEPTION_BLOCK(float, a, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined)->NumberValue()));
+ EXCEPTION_BLOCK(int, b, V8int::HasInstance(MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined)) ? V8int::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined))) : 0);
+ RefPtr<bool> result = imp->strictFunction(str, a, b, ec);
+ if (UNLIKELY(ec))
+ goto fail;
+ return toV8(result.release());
+ }
+ fail:
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+}
+
} // namespace TestObjInternal
static const BatchedAttribute TestObjAttrs[] = {
@@ -1455,6 +1556,14 @@ static const BatchedAttribute TestObjAttrs[] = {
{"floatArray", TestObjInternal::floatArrayAttrGetter, TestObjInternal::floatArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'doubleArray' (Type: 'attribute' ExtAttr: '')
{"doubleArray", TestObjInternal::doubleArrayAttrGetter, TestObjInternal::doubleArrayAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'contentDocument' (Type: 'readonly attribute' ExtAttr: 'CheckFrameSecurity')
+ {"contentDocument", TestObjInternal::contentDocumentAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'mutablePoint' (Type: 'attribute' ExtAttr: '')
+ {"mutablePoint", TestObjInternal::mutablePointAttrGetter, TestObjInternal::mutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'immutablePoint' (Type: 'attribute' ExtAttr: 'Immutable')
+ {"immutablePoint", TestObjInternal::immutablePointAttrGetter, TestObjInternal::immutablePointAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'strictFloat' (Type: 'attribute' ExtAttr: 'StrictTypeChecking')
+ {"strictFloat", TestObjInternal::strictFloatAttrGetter, TestObjInternal::strictFloatAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'description' (Type: 'readonly attribute' ExtAttr: '')
{"description", TestObjInternal::descriptionAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'id' (Type: 'attribute' ExtAttr: '')
@@ -1475,11 +1584,6 @@ static const BatchedCallback TestObjCallbacks[] = {
{"customMethodWithArgs", V8TestObj::customMethodWithArgsCallback},
{"addEventListener", TestObjInternal::addEventListenerCallback},
{"removeEventListener", TestObjInternal::removeEventListenerCallback},
- {"withDynamicFrame", TestObjInternal::withDynamicFrameCallback},
- {"withDynamicFrameAndArg", TestObjInternal::withDynamicFrameAndArgCallback},
- {"withDynamicFrameAndOptionalArg", TestObjInternal::withDynamicFrameAndOptionalArgCallback},
- {"withDynamicFrameAndUserGesture", TestObjInternal::withDynamicFrameAndUserGestureCallback},
- {"withDynamicFrameAndUserGestureASAD", TestObjInternal::withDynamicFrameAndUserGestureASADCallback},
{"withScriptStateVoid", TestObjInternal::withScriptStateVoidCallback},
{"withScriptStateObj", TestObjInternal::withScriptStateObjCallback},
{"withScriptStateVoidException", TestObjInternal::withScriptStateVoidExceptionCallback},
@@ -1501,6 +1605,11 @@ static const BatchedCallback TestObjCallbacks[] = {
{"conditionalMethod3", TestObjInternal::conditionalMethod3Callback},
#endif
{"overloadedMethod", TestObjInternal::overloadedMethodCallback},
+ {"getSVGDocument", TestObjInternal::getSVGDocumentCallback},
+ {"mutablePointFunction", TestObjInternal::mutablePointFunctionCallback},
+ {"immutablePointFunction", TestObjInternal::immutablePointFunctionCallback},
+ {"orange", TestObjInternal::orangeCallback},
+ {"strictFunction", TestObjInternal::strictFunctionCallback},
};
static const BatchedConstant TestObjConsts[] = {
@@ -1623,6 +1732,36 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
if (RuntimeEnabledFeatures::featureNameEnabled())
proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
+
+ // Custom Signature 'convert1'
+ const int convert1Argc = 1;
+ v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8a::GetRawTemplate() };
+ v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
+ proto->Set(v8::String::New("convert1"), v8::FunctionTemplate::New(TestObjInternal::convert1Callback, v8::Handle<v8::Value>(), convert1Signature));
+
+ // Custom Signature 'convert2'
+ const int convert2Argc = 1;
+ v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8b::GetRawTemplate() };
+ v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
+ proto->Set(v8::String::New("convert2"), v8::FunctionTemplate::New(TestObjInternal::convert2Callback, v8::Handle<v8::Value>(), convert2Signature));
+
+ // Custom Signature 'convert3'
+ const int convert3Argc = 1;
+ v8::Handle<v8::FunctionTemplate> convert3Argv[convert3Argc] = { V8c::GetRawTemplate() };
+ v8::Handle<v8::Signature> convert3Signature = v8::Signature::New(desc, convert3Argc, convert3Argv);
+ proto->Set(v8::String::New("convert3"), v8::FunctionTemplate::New(TestObjInternal::convert3Callback, v8::Handle<v8::Value>(), convert3Signature));
+
+ // Custom Signature 'convert4'
+ const int convert4Argc = 1;
+ v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8d::GetRawTemplate() };
+ v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
+ proto->Set(v8::String::New("convert4"), v8::FunctionTemplate::New(TestObjInternal::convert4Callback, v8::Handle<v8::Value>(), convert4Signature));
+
+ // Custom Signature 'convert5'
+ const int convert5Argc = 1;
+ v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8e::GetRawTemplate() };
+ v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
+ proto->Set(v8::String::New("convert5"), v8::FunctionTemplate::New(TestObjInternal::convert5Callback, v8::Handle<v8::Value>(), convert5Signature));
batchConfigureConstants(desc, proto, TestObjConsts, WTF_ARRAY_LENGTH(TestObjConsts));
// Custom toString template
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.cpp b/Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.cpp
new file mode 100644
index 000000000..1ca6a4de9
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.cpp
@@ -0,0 +1,135 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#include "config.h"
+#include "V8TestOverridingNameGetter.h"
+
+#include "ExceptionCode.h"
+#include "RuntimeEnabledFeatures.h"
+#include "V8Binding.h"
+#include "V8BindingMacros.h"
+#include "V8BindingState.h"
+#include "V8DOMWrapper.h"
+#include "V8IsolatedContext.h"
+#include "V8Proxy.h"
+#include <wtf/UnusedParam.h>
+
+namespace WebCore {
+
+WrapperTypeInfo V8TestOverridingNameGetter::info = { V8TestOverridingNameGetter::GetTemplate, V8TestOverridingNameGetter::derefObject, 0, 0 };
+
+namespace TestOverridingNameGetterInternal {
+
+template <typename T> void V8_USE(T) { }
+
+static v8::Handle<v8::Value> anotherFunctionCallback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestOverridingNameGetter.anotherFunction");
+ if (args.Length() < 1)
+ return throwError("Not enough arguments", V8Proxy::TypeError);
+ TestOverridingNameGetter* imp = V8TestOverridingNameGetter::toNative(args.Holder());
+ STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<>, str, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
+ imp->anotherFunction(str);
+ return v8::Handle<v8::Value>();
+}
+
+} // namespace TestOverridingNameGetterInternal
+
+static const BatchedCallback TestOverridingNameGetterCallbacks[] = {
+ {"anotherFunction", TestOverridingNameGetterInternal::anotherFunctionCallback},
+};
+
+static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestOverridingNameGetterTemplate(v8::Persistent<v8::FunctionTemplate> desc)
+{
+ desc->ReadOnlyPrototype();
+
+ v8::Local<v8::Signature> defaultSignature;
+ defaultSignature = configureTemplate(desc, "TestOverridingNameGetter", v8::Persistent<v8::FunctionTemplate>(), V8TestOverridingNameGetter::internalFieldCount,
+ 0, 0,
+ TestOverridingNameGetterCallbacks, WTF_ARRAY_LENGTH(TestOverridingNameGetterCallbacks));
+ UNUSED_PARAM(defaultSignature); // In some cases, it will not be used.
+ v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
+ v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ UNUSED_PARAM(instance); // In some cases, it will not be used.
+ UNUSED_PARAM(proto); // In some cases, it will not be used.
+
+ desc->InstanceTemplate()->SetNamedPropertyHandler(V8TestOverridingNameGetter::namedPropertyGetter, 0, 0, 0, 0);
+
+ // Custom toString template
+ desc->Set(getToStringName(), getToStringTemplate());
+ return desc;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestOverridingNameGetter::GetRawTemplate()
+{
+ V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
+ V8BindingPerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
+ if (result != data->rawTemplateMap().end())
+ return result->second;
+
+ v8::HandleScope handleScope;
+ v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+ data->rawTemplateMap().add(&info, templ);
+ return templ;
+}
+
+v8::Persistent<v8::FunctionTemplate> V8TestOverridingNameGetter::GetTemplate()
+{
+ V8BindingPerIsolateData* data = V8BindingPerIsolateData::current();
+ V8BindingPerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
+ if (result != data->templateMap().end())
+ return result->second;
+
+ v8::HandleScope handleScope;
+ v8::Persistent<v8::FunctionTemplate> templ =
+ ConfigureV8TestOverridingNameGetterTemplate(GetRawTemplate());
+ data->templateMap().add(&info, templ);
+ return templ;
+}
+
+bool V8TestOverridingNameGetter::HasInstance(v8::Handle<v8::Value> value)
+{
+ return GetRawTemplate()->HasInstance(value);
+}
+
+
+v8::Handle<v8::Object> V8TestOverridingNameGetter::wrapSlow(TestOverridingNameGetter* impl)
+{
+ v8::Handle<v8::Object> wrapper;
+ V8Proxy* proxy = 0;
+ wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
+ if (wrapper.IsEmpty())
+ return wrapper;
+
+ impl->ref();
+ v8::Persistent<v8::Object> wrapperHandle = v8::Persistent<v8::Object>::New(wrapper);
+
+ if (!hasDependentLifetime)
+ wrapperHandle.MarkIndependent();
+ getDOMObjectMap().set(impl, wrapperHandle);
+ return wrapper;
+}
+
+void V8TestOverridingNameGetter::derefObject(void* object)
+{
+ static_cast<TestOverridingNameGetter*>(object)->deref();
+}
+
+} // namespace WebCore
diff --git a/Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.h b/Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.h
new file mode 100644
index 000000000..8c1b8e021
--- /dev/null
+++ b/Source/WebCore/bindings/scripts/test/V8/V8TestOverridingNameGetter.h
@@ -0,0 +1,80 @@
+/*
+ This file is part of the WebKit open source project.
+ This file has been generated by generate-bindings.pl. DO NOT MODIFY!
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+*/
+
+#ifndef V8TestOverridingNameGetter_h
+#define V8TestOverridingNameGetter_h
+
+#include "TestOverridingNameGetter.h"
+#include "V8DOMWrapper.h"
+#include "WrapperTypeInfo.h"
+#include <v8.h>
+#include <wtf/HashMap.h>
+#include <wtf/text/StringHash.h>
+
+namespace WebCore {
+
+class V8TestOverridingNameGetter {
+public:
+ static const bool hasDependentLifetime = false;
+ static bool HasInstance(v8::Handle<v8::Value>);
+ static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
+ static v8::Persistent<v8::FunctionTemplate> GetTemplate();
+ static TestOverridingNameGetter* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestOverridingNameGetter*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestOverridingNameGetter*);
+ static void derefObject(void*);
+ static WrapperTypeInfo info;
+ static v8::Handle<v8::Value> namedPropertyGetter(v8::Local<v8::String>, const v8::AccessorInfo&);
+ static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+ static v8::Handle<v8::Object> existingWrapper(TestOverridingNameGetter*);
+
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestOverridingNameGetter*);
+};
+
+ALWAYS_INLINE v8::Handle<v8::Object> V8TestOverridingNameGetter::existingWrapper(TestOverridingNameGetter* impl)
+{
+ return getDOMObjectMap().get(impl);
+}
+
+v8::Handle<v8::Object> V8TestOverridingNameGetter::wrap(TestOverridingNameGetter* impl)
+{
+ v8::Handle<v8::Object> wrapper = existingWrapper(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestOverridingNameGetter::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestOverridingNameGetter* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestOverridingNameGetter::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestOverridingNameGetter > impl)
+{
+ return toV8(impl.get());
+}
+
+}
+
+#endif // V8TestOverridingNameGetter_h
diff --git a/Source/WebCore/bindings/v8/ScriptController.cpp b/Source/WebCore/bindings/v8/ScriptController.cpp
index da6bf7a89..cb37809a7 100644
--- a/Source/WebCore/bindings/v8/ScriptController.cpp
+++ b/Source/WebCore/bindings/v8/ScriptController.cpp
@@ -102,11 +102,6 @@ bool ScriptController::canAccessFromCurrentOrigin(Frame *frame)
return !v8::Context::InContext() || V8BindingSecurity::canAccessFrame(V8BindingState::Only(), frame, true);
}
-bool ScriptController::isSafeScript(Frame* target)
-{
- return V8BindingSecurity::canAccessFrame(V8BindingState::Only(), target, true);
-}
-
ScriptController::ScriptController(Frame* frame)
: m_frame(frame)
, m_sourceURL(0)
diff --git a/Source/WebCore/bindings/v8/ScriptController.h b/Source/WebCore/bindings/v8/ScriptController.h
index 3b25b15db..24c188587 100644
--- a/Source/WebCore/bindings/v8/ScriptController.h
+++ b/Source/WebCore/bindings/v8/ScriptController.h
@@ -147,9 +147,6 @@ public:
// V8Proxy::retrieveFrameForEnteredContext() for more information.
static Frame* retrieveFrameForCurrentContext();
- // Check whether it is safe to access a frame in another domain.
- static bool isSafeScript(Frame*);
-
// Pass command-line flags to the JS engine.
static void setFlags(const char* string, int length);
diff --git a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 5bdff1445..b74b26446 100644
--- a/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -512,11 +512,11 @@ v8::Handle<v8::Value> V8DOMWindow::namedPropertyGetter(v8::Local<v8::String> nam
if (doc && doc->isHTMLDocument()) {
if (static_cast<HTMLDocument*>(doc)->hasNamedItem(propName.impl()) || doc->hasElementWithId(propName.impl())) {
- RefPtr<HTMLCollection> items = doc->windowNamedItems(propName);
+ HTMLCollection* items = doc->windowNamedItems(propName);
if (items->length() >= 1) {
if (items->length() == 1)
return toV8(items->firstItem());
- return toV8(items.release());
+ return toV8(items);
}
}
}
diff --git a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
index aef37c78b..41ae07171 100644
--- a/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
+++ b/Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
@@ -79,7 +79,7 @@ v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocumen
if (!htmlDocument->hasNamedItem(key.impl()) && !htmlDocument->hasExtraNamedItem(key.impl()))
return v8::Handle<v8::Value>();
- RefPtr<HTMLCollection> items = htmlDocument->documentNamedItems(key);
+ HTMLCollection* items = htmlDocument->documentNamedItems(key);
if (!items->length())
return v8::Handle<v8::Value>();
@@ -92,7 +92,7 @@ v8::Handle<v8::Value> V8HTMLDocument::GetNamedProperty(HTMLDocument* htmlDocumen
return toV8(node);
}
- return toV8(items.release());
+ return toV8(items);
}
// HTMLDocument ----------------------------------------------------------------
diff --git a/Source/WebCore/bindings/v8/specialization/V8BindingState.cpp b/Source/WebCore/bindings/v8/specialization/V8BindingState.cpp
index 9a91476f9..6152f492c 100644
--- a/Source/WebCore/bindings/v8/specialization/V8BindingState.cpp
+++ b/Source/WebCore/bindings/v8/specialization/V8BindingState.cpp
@@ -84,9 +84,4 @@ void State<V8Binding>::immediatelyReportUnsafeAccessTo(Frame* target)
V8Proxy::reportUnsafeAccessTo(target);
}
-bool State<V8Binding>::allowsAccessFromFrame(Frame* frame)
-{
- return ScriptController::isSafeScript(frame);
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/bindings/v8/specialization/V8BindingState.h b/Source/WebCore/bindings/v8/specialization/V8BindingState.h
index ce00d61f9..3cda15f49 100644
--- a/Source/WebCore/bindings/v8/specialization/V8BindingState.h
+++ b/Source/WebCore/bindings/v8/specialization/V8BindingState.h
@@ -55,9 +55,6 @@ public:
Frame* activeFrame();
Frame* firstFrame();
- // FIXME: This should be shared in BindingSecurity
- bool allowsAccessFromFrame(Frame*);
-
private:
explicit State() {}
~State();
diff --git a/Source/WebCore/bridge/jni/JNIUtility.cpp b/Source/WebCore/bridge/jni/JNIUtility.cpp
index d3c6c857c..69d57810e 100644
--- a/Source/WebCore/bridge/jni/JNIUtility.cpp
+++ b/Source/WebCore/bridge/jni/JNIUtility.cpp
@@ -187,10 +187,6 @@ JavaType javaTypeFromClassName(const char* name)
type = JavaTypeVoid;
else if ('[' == name[0])
type = JavaTypeArray;
-#if USE(V8)
- else if (!strcmp("java.lang.String", name))
- type = JavaTypeString;
-#endif
else
type = JavaTypeObject;
@@ -207,9 +203,6 @@ const char* signatureFromJavaType(JavaType type)
return "[";
case JavaTypeObject:
-#if USE(V8)
- case JavaTypeString:
-#endif
return "L";
case JavaTypeBoolean:
@@ -300,9 +293,6 @@ jvalue getJNIField(jobject obj, JavaType type, const char* name, const char* sig
switch (type) {
case JavaTypeArray:
case JavaTypeObject:
-#if USE(V8)
- case JavaTypeString:
-#endif
result.l = env->functions->GetObjectField(env, obj, field);
break;
case JavaTypeBoolean:
@@ -356,9 +346,6 @@ jvalue callJNIMethod(jobject object, JavaType returnType, const char* name, cons
callJNIMethodIDA<void>(object, methodId, args);
break;
case JavaTypeObject:
-#if USE(V8)
- case JavaTypeString:
-#endif
result.l = callJNIMethodIDA<jobject>(object, methodId, args);
break;
case JavaTypeBoolean:
diff --git a/Source/WebCore/bridge/jni/JavaType.h b/Source/WebCore/bridge/jni/JavaType.h
index 17053fb12..e80ffec11 100644
--- a/Source/WebCore/bridge/jni/JavaType.h
+++ b/Source/WebCore/bridge/jni/JavaType.h
@@ -53,20 +53,6 @@ enum JavaType {
JavaTypeFloat,
JavaTypeDouble,
JavaTypeArray,
-#if USE(V8)
- // JavaTypeString is distinct from JavaTypeObject because strings receive
- // special handling when we convert to and from JavaScript. When calling
- // Java methods, we must create Java String objects for string arguments.
- // However, at conversion time we cannot assume that the mechanism used to
- // interact with Java is JNI. Instead we use a special JavaTypeString.
- // Implementations of JavaInstance which use JNI will create a Java String
- // object when converting the JavaValue to a jvalue.
- //
- // Note that this type is independent of the JavaScript engine, but is
- // currently used only with V8.
- // See https://bugs.webkit.org/show_bug.cgi?id=57023.
- JavaTypeString,
-#endif
};
} // namespace Bindings
diff --git a/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp b/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp
index 3cb388903..5e18ea8ba 100644
--- a/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp
+++ b/Source/WebCore/bridge/jni/jsc/JavaMethodJSC.cpp
@@ -92,9 +92,7 @@ JavaMethod::~JavaMethod()
// we get '.' between components from the reflection API.
static void appendClassName(StringBuilder& builder, const char* className)
{
-#if USE(JSC)
ASSERT(JSLock::lockCount() > 0);
-#endif
char* c = fastStrDup(className);
@@ -113,9 +111,7 @@ static void appendClassName(StringBuilder& builder, const char* className)
const char* JavaMethod::signature() const
{
if (!m_signature) {
-#if USE(JSC)
JSLock lock(SilenceAssertionsOnly);
-#endif
StringBuilder signatureBuilder;
signatureBuilder.append('(');
@@ -126,11 +122,7 @@ const char* JavaMethod::signature() const
appendClassName(signatureBuilder, javaClassName.data());
else {
signatureBuilder.append(signatureFromJavaType(type));
- if (type == JavaTypeObject
-#if USE(V8)
- || type == JavaTypeString
-#endif
- ) {
+ if (type == JavaTypeObject) {
appendClassName(signatureBuilder, javaClassName.data());
signatureBuilder.append(';');
}
@@ -143,11 +135,7 @@ const char* JavaMethod::signature() const
appendClassName(signatureBuilder, returnType);
else {
signatureBuilder.append(signatureFromJavaType(m_returnType));
- if (m_returnType == JavaTypeObject
-#if USE(V8)
- || m_returnType == JavaTypeString
-#endif
- ) {
+ if (m_returnType == JavaTypeObject) {
appendClassName(signatureBuilder, returnType);
signatureBuilder.append(';');
}
diff --git a/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp b/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp
deleted file mode 100644
index 88e41742b..000000000
--- a/Source/WebCore/bridge/jni/v8/JNIUtilityPrivate.cpp
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * Copyright 2010, 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 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 "JNIUtilityPrivate.h"
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JavaInstanceV8.h"
-#include "JavaNPObjectV8.h"
-#include "JavaValueV8.h"
-#include <wtf/text/CString.h>
-
-namespace JSC {
-
-namespace Bindings {
-
-JavaValue convertNPVariantToJavaValue(NPVariant value, const String& javaClass)
-{
- CString javaClassName = javaClass.utf8();
- JavaType javaType = javaTypeFromClassName(javaClassName.data());
- JavaValue result;
- result.m_type = javaType;
- NPVariantType type = value.type;
-
- switch (javaType) {
- case JavaTypeArray:
- case JavaTypeObject:
- {
- // See if we have a Java instance.
- if (type == NPVariantType_Object) {
- NPObject* objectImp = NPVARIANT_TO_OBJECT(value);
- result.m_objectValue = ExtractJavaInstance(objectImp);
- }
- }
- break;
-
- case JavaTypeString:
- {
-#ifdef CONVERT_NULL_TO_EMPTY_STRING
- if (type == NPVariantType_Null) {
- result.m_type = JavaTypeString;
- result.m_stringValue = String::fromUTF8("");
- } else
-#else
- if (type == NPVariantType_String)
-#endif
- {
- NPString src = NPVARIANT_TO_STRING(value);
- result.m_type = JavaTypeString;
- result.m_stringValue = String::fromUTF8(src.UTF8Characters);
- }
- }
- break;
-
- case JavaTypeBoolean:
- {
- if (type == NPVariantType_Bool)
- result.m_booleanValue = NPVARIANT_TO_BOOLEAN(value);
- }
- break;
-
- case JavaTypeByte:
- {
- if (type == NPVariantType_Int32)
- result.m_byteValue = static_cast<signed char>(NPVARIANT_TO_INT32(value));
- else if (type == NPVariantType_Double)
- result.m_byteValue = static_cast<signed char>(NPVARIANT_TO_DOUBLE(value));
- }
- break;
-
- case JavaTypeChar:
- {
- if (type == NPVariantType_Int32)
- result.m_charValue = static_cast<unsigned short>(NPVARIANT_TO_INT32(value));
- }
- break;
-
- case JavaTypeShort:
- {
- if (type == NPVariantType_Int32)
- result.m_shortValue = static_cast<short>(NPVARIANT_TO_INT32(value));
- else if (type == NPVariantType_Double)
- result.m_shortValue = static_cast<short>(NPVARIANT_TO_DOUBLE(value));
- }
- break;
-
- case JavaTypeInt:
- {
- if (type == NPVariantType_Int32)
- result.m_intValue = static_cast<int>(NPVARIANT_TO_INT32(value));
- else if (type == NPVariantType_Double)
- result.m_intValue = static_cast<int>(NPVARIANT_TO_DOUBLE(value));
- }
- break;
-
- case JavaTypeLong:
- {
- if (type == NPVariantType_Int32)
- result.m_longValue = static_cast<long long>(NPVARIANT_TO_INT32(value));
- else if (type == NPVariantType_Double)
- result.m_longValue = static_cast<long long>(NPVARIANT_TO_DOUBLE(value));
- }
- break;
-
- case JavaTypeFloat:
- {
- if (type == NPVariantType_Int32)
- result.m_floatValue = static_cast<float>(NPVARIANT_TO_INT32(value));
- else if (type == NPVariantType_Double)
- result.m_floatValue = static_cast<float>(NPVARIANT_TO_DOUBLE(value));
- }
- break;
-
- case JavaTypeDouble:
- {
- if (type == NPVariantType_Int32)
- result.m_doubleValue = static_cast<double>(NPVARIANT_TO_INT32(value));
- else if (type == NPVariantType_Double)
- result.m_doubleValue = static_cast<double>(NPVARIANT_TO_DOUBLE(value));
- }
- break;
- default:
- break;
- }
- return result;
-}
-
-
-void convertJavaValueToNPVariant(JavaValue value, NPVariant* result)
-{
- switch (value.m_type) {
- case JavaTypeVoid:
- {
- VOID_TO_NPVARIANT(*result);
- }
- break;
-
- case JavaTypeObject:
- {
- // If the JavaValue is a String object, it should have type JavaTypeString.
- if (value.m_objectValue)
- OBJECT_TO_NPVARIANT(JavaInstanceToNPObject(value.m_objectValue.get()), *result);
- else
- VOID_TO_NPVARIANT(*result);
- }
- break;
-
- case JavaTypeString:
- {
- const char* utf8String = strdup(value.m_stringValue.utf8().data());
- // The copied string is freed in NPN_ReleaseVariantValue (see npruntime.cpp)
- STRINGZ_TO_NPVARIANT(utf8String, *result);
- }
- break;
-
- case JavaTypeBoolean:
- {
- BOOLEAN_TO_NPVARIANT(value.m_booleanValue, *result);
- }
- break;
-
- case JavaTypeByte:
- {
- INT32_TO_NPVARIANT(value.m_byteValue, *result);
- }
- break;
-
- case JavaTypeChar:
- {
- INT32_TO_NPVARIANT(value.m_charValue, *result);
- }
- break;
-
- case JavaTypeShort:
- {
- INT32_TO_NPVARIANT(value.m_shortValue, *result);
- }
- break;
-
- case JavaTypeInt:
- {
- INT32_TO_NPVARIANT(value.m_intValue, *result);
- }
- break;
-
- // TODO: Check if cast to double is needed.
- case JavaTypeLong:
- {
- DOUBLE_TO_NPVARIANT(value.m_longValue, *result);
- }
- break;
-
- case JavaTypeFloat:
- {
- DOUBLE_TO_NPVARIANT(value.m_floatValue, *result);
- }
- break;
-
- case JavaTypeDouble:
- {
- DOUBLE_TO_NPVARIANT(value.m_doubleValue, *result);
- }
- break;
-
- case JavaTypeInvalid:
- default:
- {
- VOID_TO_NPVARIANT(*result);
- }
- break;
- }
-}
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
diff --git a/Source/WebCore/bridge/jni/v8/JavaInstanceV8.h b/Source/WebCore/bridge/jni/v8/JavaInstanceV8.h
deleted file mode 100644
index 20d027428..000000000
--- a/Source/WebCore/bridge/jni/v8/JavaInstanceV8.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
- * Copyright 2010, 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 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 JavaInstanceV8_h
-#define JavaInstanceV8_h
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JavaValueV8.h"
-#include <wtf/RefCounted.h>
-
-using namespace WTF;
-
-namespace JSC {
-
-namespace Bindings {
-
-class JavaClass;
-class JavaField;
-class JavaMethod;
-
-class JavaInstance : public RefCounted<JavaInstance> {
-public:
- virtual ~JavaInstance() {}
-
- virtual JavaClass* getClass() const = 0;
- // args must be an array of length greater than or equal to the number of
- // arguments expected by the method.
- virtual JavaValue invokeMethod(const JavaMethod&, JavaValue* args) = 0;
- virtual JavaValue getField(const JavaField&) = 0;
-};
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
-
-#endif // JavaInstanceV8_h
diff --git a/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp b/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
deleted file mode 100644
index 988df2d86..000000000
--- a/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.cpp
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright 2010, 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 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 "JavaNPObjectV8.h"
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JNIUtilityPrivate.h"
-#include "JavaClassV8.h"
-#include "JavaFieldV8.h"
-#include "JavaInstanceV8.h"
-#include "JavaMethodV8.h"
-#include "JavaValueV8.h"
-#include "npruntime_impl.h"
-
-namespace JSC {
-
-namespace Bindings {
-
-static NPObject* AllocJavaNPObject(NPP, NPClass*)
-{
- JavaNPObject* obj = static_cast<JavaNPObject*>(malloc(sizeof(JavaNPObject)));
- if (!obj)
- return 0;
- memset(obj, 0, sizeof(JavaNPObject));
- return reinterpret_cast<NPObject*>(obj);
-}
-
-static void FreeJavaNPObject(NPObject* npobj)
-{
- JavaNPObject* obj = reinterpret_cast<JavaNPObject*>(npobj);
- obj->m_instance = 0; // free does not call the destructor
- free(obj);
-}
-
-static NPClass JavaNPObjectClass = {
- NP_CLASS_STRUCT_VERSION,
- AllocJavaNPObject, // allocate,
- FreeJavaNPObject, // free,
- 0, // invalidate
- JavaNPObjectHasMethod,
- JavaNPObjectInvoke,
- 0, // invokeDefault,
- JavaNPObjectHasProperty,
- JavaNPObjectGetProperty,
- 0, // setProperty
- 0, // removeProperty
- 0, // enumerate
- 0 // construct
-};
-
-NPObject* JavaInstanceToNPObject(JavaInstance* instance)
-{
- JavaNPObject* object = reinterpret_cast<JavaNPObject*>(_NPN_CreateObject(0, &JavaNPObjectClass));
- object->m_instance = instance;
- return reinterpret_cast<NPObject*>(object);
-}
-
-// Returns null if obj is not a wrapper of JavaInstance
-JavaInstance* ExtractJavaInstance(NPObject* obj)
-{
- if (obj->_class == &JavaNPObjectClass)
- return reinterpret_cast<JavaNPObject*>(obj)->m_instance.get();
- return 0;
-}
-
-bool JavaNPObjectHasMethod(NPObject* obj, NPIdentifier identifier)
-{
- JavaInstance* instance = ExtractJavaInstance(obj);
- if (!instance)
- return false;
- NPUTF8* name = _NPN_UTF8FromIdentifier(identifier);
- if (!name)
- return false;
-
- bool result = (instance->getClass()->methodsNamed(name).size() > 0);
-
- // TODO: use NPN_MemFree
- free(name);
-
- return result;
-}
-
-bool JavaNPObjectInvoke(NPObject* obj, NPIdentifier identifier, const NPVariant* args, uint32_t argCount, NPVariant* result)
-{
- JavaInstance* instance = ExtractJavaInstance(obj);
- if (!instance)
- return false;
- NPUTF8* name = _NPN_UTF8FromIdentifier(identifier);
- if (!name)
- return false;
-
- MethodList methodList = instance->getClass()->methodsNamed(name);
- // TODO: use NPN_MemFree
- free(name);
-
- // Try to find a good match for the overloaded method. The
- // fundamental problem is that JavaScript doesn't have the
- // notion of method overloading and Java does. We could
- // get a bit more sophisticated and attempt to do some
- // type checking as well as checking the number of parameters.
- size_t numMethods = methodList.size();
- JavaMethod* aMethod;
- JavaMethod* jMethod = 0;
- for (size_t methodIndex = 0; methodIndex < numMethods; methodIndex++) {
- aMethod = methodList[methodIndex];
- if (aMethod->numParameters() == static_cast<int>(argCount)) {
- jMethod = aMethod;
- break;
- }
- }
- if (!jMethod)
- return false;
-
- JavaValue* jArgs = new JavaValue[argCount];
- for (unsigned int i = 0; i < argCount; i++)
- jArgs[i] = convertNPVariantToJavaValue(args[i], jMethod->parameterAt(i));
-
- JavaValue jResult = instance->invokeMethod(*jMethod, jArgs);
- delete[] jArgs;
-
- VOID_TO_NPVARIANT(*result);
- convertJavaValueToNPVariant(jResult, result);
- return true;
-}
-
-bool JavaNPObjectHasProperty(NPObject* obj, NPIdentifier identifier)
-{
- JavaInstance* instance = ExtractJavaInstance(obj);
- if (!instance)
- return false;
- NPUTF8* name = _NPN_UTF8FromIdentifier(identifier);
- if (!name)
- return false;
- bool result = instance->getClass()->fieldNamed(name);
- free(name);
- return result;
-}
-
-bool JavaNPObjectGetProperty(NPObject* obj, NPIdentifier identifier, NPVariant* result)
-{
- VOID_TO_NPVARIANT(*result);
- JavaInstance* instance = ExtractJavaInstance(obj);
- if (!instance)
- return false;
- NPUTF8* name = _NPN_UTF8FromIdentifier(identifier);
- if (!name)
- return false;
-
- JavaField* field = instance->getClass()->fieldNamed(name);
- free(name); // TODO: use NPN_MemFree
- if (!field)
- return false;
-
- JavaValue value = instance->getField(*field);
-
- convertJavaValueToNPVariant(value, result);
-
- return true;
-}
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
diff --git a/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.h b/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.h
deleted file mode 100644
index ff3bb5fc0..000000000
--- a/Source/WebCore/bridge/jni/v8/JavaNPObjectV8.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2010, 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 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 JavaNPObjectV8_h
-#define JavaNPObjectV8_h
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "npruntime.h"
-#include <wtf/RefPtr.h>
-
-
-namespace JSC {
-
-namespace Bindings {
-
-class JavaInstance;
-
-struct JavaNPObject {
- NPObject m_object;
- RefPtr<JavaInstance> m_instance;
-};
-
-NPObject* JavaInstanceToNPObject(JavaInstance*);
-JavaInstance* ExtractJavaInstance(NPObject*);
-
-bool JavaNPObjectHasMethod(NPObject*, NPIdentifier name);
-bool JavaNPObjectInvoke(NPObject*, NPIdentifier methodName, const NPVariant* args, uint32_t argCount, NPVariant* result);
-bool JavaNPObjectHasProperty(NPObject*, NPIdentifier name);
-bool JavaNPObjectGetProperty(NPObject*, NPIdentifier name, NPVariant* result);
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
-
-#endif // JavaNPObjectV8_h
diff --git a/Source/WebCore/bridge/jni/v8/JavaValueV8.h b/Source/WebCore/bridge/jni/v8/JavaValueV8.h
deleted file mode 100644
index 3e1c623c1..000000000
--- a/Source/WebCore/bridge/jni/v8/JavaValueV8.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2011, 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:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR 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 JavaValueV8_h
-#define JavaValueV8_h
-
-#if ENABLE(JAVA_BRIDGE)
-
-#include "JavaType.h"
-
-#include <wtf/text/WTFString.h>
-
-namespace JSC {
-
-namespace Bindings {
-
-class JavaInstance;
-
-// A variant used to represent a Java value, almost identical to the JNI
-// jvalue type. It exists because the logic to convert between JavaScript
-// objects (as JavaNPObject or JSValue) and Java objects should not depend upon
-// JNI, to allow ports to provide a JavaInstance object etc which does not use
-// JNI. This means that the 'object' field of this variant uses JavaInstance,
-// not jobject.
-//
-// Note that this class is independent of the JavaScript engine, but is
-// currently used only with V8.
-// See https://bugs.webkit.org/show_bug.cgi?id=57023.
-struct JavaValue {
- JavaValue() : m_type(JavaTypeInvalid) {}
-
- JavaType m_type;
- // We don't use a union because we want to be able to ref-count some of the
- // values. This requires types with non-trivial constructors.
- RefPtr<JavaInstance> m_objectValue;
- bool m_booleanValue;
- signed char m_byteValue;
- unsigned short m_charValue;
- short m_shortValue;
- int m_intValue;
- long long m_longValue;
- float m_floatValue;
- double m_doubleValue;
- String m_stringValue;
-};
-
-} // namespace Bindings
-
-} // namespace JSC
-
-#endif // ENABLE(JAVA_BRIDGE)
-
-#endif // JavaValueV8_h
diff --git a/Source/WebCore/bridge/jsc/BridgeJSC.h b/Source/WebCore/bridge/jsc/BridgeJSC.h
index 95a3973d1..a9f2baed0 100644
--- a/Source/WebCore/bridge/jsc/BridgeJSC.h
+++ b/Source/WebCore/bridge/jsc/BridgeJSC.h
@@ -27,8 +27,6 @@
#ifndef BridgeJSC_h
#define BridgeJSC_h
-#if USE(JSC)
-
#include "Bridge.h"
#include <runtime/JSString.h>
#include <wtf/HashMap.h>
@@ -151,6 +149,4 @@ typedef HashMap<RefPtr<StringImpl>, Field*> FieldMap;
} // namespace JSC
-#endif // USE(JSC)
-
#endif
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index 3e0dc8c21..112abbe83 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -217,10 +217,11 @@ static const int computedProperties[] = {
#endif
CSSPropertyWebkitFlexOrder,
CSSPropertyWebkitFlexPack,
- CSSPropertyWebkitFlexAlign,
+ CSSPropertyWebkitFlexItemAlign,
CSSPropertyWebkitFlexDirection,
CSSPropertyWebkitFlexFlow,
CSSPropertyWebkitFlexWrap,
+ CSSPropertyWebkitFontKerning,
CSSPropertyWebkitFontSmoothing,
#if ENABLE(CSS_GRID_LAYOUT)
CSSPropertyWebkitGridColumns,
@@ -576,14 +577,9 @@ PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo
return cssValuePool->createColorValue(color.rgb());
}
-static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const RenderStyle* style, CSSValuePool* cssValuePool)
+static PassRefPtr<CSSValueList> getBorderRadiusCornerValues(LengthSize radius, const RenderStyle* style, CSSValuePool* cssValuePool)
{
RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
- if (radius.width() == radius.height()) {
- if (radius.width().type() == Percent)
- return cssValuePool->createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
- return zoomAdjustedPixelValue(radius.width().value(), style, cssValuePool);
- }
if (radius.width().type() == Percent)
list->append(cssValuePool->createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE));
else
@@ -595,6 +591,58 @@ static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const
return list.release();
}
+static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius, const RenderStyle* style, CSSValuePool* cssValuePool)
+{
+ if (radius.width() == radius.height()) {
+ if (radius.width().type() == Percent)
+ return cssValuePool->createValue(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE);
+ return zoomAdjustedPixelValue(radius.width().value(), style, cssValuePool);
+ }
+ return getBorderRadiusCornerValues(radius, style, cssValuePool);
+}
+
+static PassRefPtr<CSSValueList> getBorderRadiusShorthandValue(const RenderStyle* style, CSSValuePool* cssValuePool)
+{
+ RefPtr<CSSValueList> list = CSSValueList::createSlashSeparated();
+ bool showHorizontalBottomLeft = style->borderTopRightRadius().width() != style->borderBottomLeftRadius().width();
+ bool showHorizontalBottomRight = style->borderBottomRightRadius().width() != style->borderTopLeftRadius().width();
+ bool showHorizontalTopRight = style->borderTopRightRadius().width() != style->borderTopLeftRadius().width();
+
+ bool showVerticalBottomLeft = style->borderTopRightRadius().height() != style->borderBottomLeftRadius().height();
+ bool showVerticalBottomRight = (style->borderBottomRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomLeft;
+ bool showVerticalTopRight = (style->borderTopRightRadius().height() != style->borderTopLeftRadius().height()) || showVerticalBottomRight;
+ bool showVerticalTopLeft = (style->borderTopLeftRadius().width() != style->borderTopLeftRadius().height());
+
+ RefPtr<CSSValueList> topLeftRadius = getBorderRadiusCornerValues(style->borderTopLeftRadius(), style, cssValuePool);
+ RefPtr<CSSValueList> topRightRadius = getBorderRadiusCornerValues(style->borderTopRightRadius(), style, cssValuePool);
+ RefPtr<CSSValueList> bottomRightRadius = getBorderRadiusCornerValues(style->borderBottomRightRadius(), style, cssValuePool);
+ RefPtr<CSSValueList> bottomLeftRadius = getBorderRadiusCornerValues(style->borderBottomLeftRadius(), style, cssValuePool);
+
+ RefPtr<CSSValueList> horizontalRadii = CSSValueList::createSpaceSeparated();
+ horizontalRadii->append(topLeftRadius->item(0));
+ if (showHorizontalTopRight)
+ horizontalRadii->append(topRightRadius->item(0));
+ if (showHorizontalBottomRight)
+ horizontalRadii->append(bottomRightRadius->item(0));
+ if (showHorizontalBottomLeft)
+ horizontalRadii->append(bottomLeftRadius->item(0));
+
+ list->append(horizontalRadii);
+
+ if (showVerticalTopLeft) {
+ RefPtr<CSSValueList> verticalRadii = CSSValueList::createSpaceSeparated();
+ verticalRadii->append(topLeftRadius->item(1));
+ if (showVerticalTopRight)
+ verticalRadii->append(topRightRadius->item(1));
+ if (showVerticalBottomRight)
+ verticalRadii->append(bottomRightRadius->item(1));
+ if (showVerticalBottomLeft)
+ verticalRadii->append(bottomLeftRadius->item(1));
+ list->append(verticalRadii);
+ }
+ return list.release();
+}
+
static LayoutRect sizingBox(RenderObject* renderer)
{
if (!renderer->isBox())
@@ -1473,8 +1521,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return cssValuePool->createValue(style->flexOrder(), CSSPrimitiveValue::CSS_NUMBER);
case CSSPropertyWebkitFlexPack:
return cssValuePool->createValue(style->flexPack());
- case CSSPropertyWebkitFlexAlign:
- return cssValuePool->createValue(style->flexAlign());
+ case CSSPropertyWebkitFlexItemAlign:
+ return cssValuePool->createValue(style->flexItemAlign());
case CSSPropertyWebkitFlexDirection:
return cssValuePool->createValue(style->flexDirection());
case CSSPropertyWebkitFlexWrap:
@@ -1819,6 +1867,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
return cssValuePool->createValue(style->matchNearestMailBlockquoteColor());
case CSSPropertyResize:
return cssValuePool->createValue(style->resize());
+ case CSSPropertyWebkitFontKerning:
+ return cssValuePool->createValue(style->fontDescription().kerning());
case CSSPropertyWebkitFontSmoothing:
return cssValuePool->createValue(style->fontDescription().fontSmoothing());
case CSSPropertyZIndex:
@@ -2135,7 +2185,6 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyWebkitFilter:
return valueForFilter(style.get());
#endif
- /* Shorthand properties, currently not supported see bug 13658*/
case CSSPropertyBackground: {
const int properties[5] = { CSSPropertyBackgroundColor, CSSPropertyBackgroundImage,
CSSPropertyBackgroundRepeat, CSSPropertyBackgroundAttachment,
@@ -2170,7 +2219,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
case CSSPropertyBorderImage:
return valueForNinePieceImage(style->borderImage(), cssValuePool);
case CSSPropertyBorderRadius:
- break;
+ return getBorderRadiusShorthandValue(style.get(), cssValuePool);
case CSSPropertyBorderRight: {
const int properties[3] = { CSSPropertyBorderRightWidth, CSSPropertyBorderRightStyle,
CSSPropertyBorderRightColor };
diff --git a/Source/WebCore/css/CSSFontFaceSrcValue.cpp b/Source/WebCore/css/CSSFontFaceSrcValue.cpp
index 57300ef71..3cdece883 100644
--- a/Source/WebCore/css/CSSFontFaceSrcValue.cpp
+++ b/Source/WebCore/css/CSSFontFaceSrcValue.cpp
@@ -26,6 +26,9 @@
#include "config.h"
#include "CSSFontFaceSrcValue.h"
#include "CSSStyleSheet.h"
+#include "CachedFont.h"
+#include "CachedResourceLoader.h"
+#include "Document.h"
#include "FontCustomPlatformData.h"
#include "Node.h"
@@ -76,5 +79,14 @@ void CSSFontFaceSrcValue::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const
addSubresourceURL(urls, styleSheet->completeURL(m_resource));
}
+CachedFont* CSSFontFaceSrcValue::cachedFont(Document* document)
+{
+ if (!m_cachedFont) {
+ ResourceRequest request(document->completeURL(m_resource));
+ m_cachedFont = document->cachedResourceLoader()->requestFont(request);
+ }
+ return m_cachedFont.get();
+}
+
}
diff --git a/Source/WebCore/css/CSSFontFaceSrcValue.h b/Source/WebCore/css/CSSFontFaceSrcValue.h
index 121f4d4e1..a5f54de47 100644
--- a/Source/WebCore/css/CSSFontFaceSrcValue.h
+++ b/Source/WebCore/css/CSSFontFaceSrcValue.h
@@ -27,11 +27,14 @@
#define CSSFontFaceSrcValue_h
#include "CSSValue.h"
+#include "CachedResourceHandle.h"
#include "PlatformString.h"
#include <wtf/PassRefPtr.h>
namespace WebCore {
+class CachedFont;
+class Document;
class SVGFontFaceElement;
class CSSFontFaceSrcValue : public CSSValue {
@@ -64,6 +67,8 @@ public:
void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
+ CachedFont* cachedFont(Document*);
+
private:
CSSFontFaceSrcValue(const String& resource, bool local)
: CSSValue(FontFaceSrcClass)
@@ -79,6 +84,8 @@ private:
String m_format;
bool m_isLocal;
+ CachedResourceHandle<CachedFont> m_cachedFont;
+
#if ENABLE(SVG_FONTS)
SVGFontFaceElement* m_svgFontFaceElement;
#endif
diff --git a/Source/WebCore/css/CSSFontSelector.cpp b/Source/WebCore/css/CSSFontSelector.cpp
index ed715038a..4c90ae3d7 100644
--- a/Source/WebCore/css/CSSFontSelector.cpp
+++ b/Source/WebCore/css/CSSFontSelector.cpp
@@ -243,8 +243,7 @@ void CSSFontSelector::addFontFaceRule(const CSSFontFaceRule* fontFaceRule)
Settings* settings = m_document ? m_document->frame() ? m_document->frame()->settings() : 0 : 0;
bool allowDownloading = foundSVGFont || (settings && settings->downloadableBinaryFontsEnabled());
if (allowDownloading && item->isSupportedFormat() && m_document) {
- ResourceRequest request(m_document->completeURL(item->resource()));
- CachedFont* cachedFont = m_document->cachedResourceLoader()->requestFont(request);
+ CachedFont* cachedFont = item->cachedFont(m_document);
if (cachedFont) {
source = adoptPtr(new CSSFontFaceSource(item->resource(), cachedFont));
#if ENABLE(SVG_FONTS)
diff --git a/Source/WebCore/css/CSSInitialValue.h b/Source/WebCore/css/CSSInitialValue.h
index f5888903b..dd86d8424 100644
--- a/Source/WebCore/css/CSSInitialValue.h
+++ b/Source/WebCore/css/CSSInitialValue.h
@@ -39,12 +39,16 @@ public:
String customCssText() const;
+ bool isImplicit() const { return m_isImplicit; }
+
private:
CSSInitialValue(bool implicit)
: CSSValue(InitialClass)
+ , m_isImplicit(implicit)
{
- m_isImplicitInitialValue = implicit;
}
+
+ bool m_isImplicit;
};
} // namespace WebCore
diff --git a/Source/WebCore/css/CSSMutableStyleDeclaration.h b/Source/WebCore/css/CSSMutableStyleDeclaration.h
index 54e08edb4..f483fbe5c 100644
--- a/Source/WebCore/css/CSSMutableStyleDeclaration.h
+++ b/Source/WebCore/css/CSSMutableStyleDeclaration.h
@@ -127,8 +127,6 @@ public:
void addSubresourceStyleURLs(ListHashSet<KURL>&);
- bool propertiesEqual(const CSSMutableStyleDeclaration* o) const { return m_properties == o->m_properties; }
-
protected:
CSSMutableStyleDeclaration(CSSRule* parentRule);
CSSMutableStyleDeclaration();
diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp
index 7940b2774..2f5cab605 100644
--- a/Source/WebCore/css/CSSParser.cpp
+++ b/Source/WebCore/css/CSSParser.cpp
@@ -906,28 +906,28 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyPosition: // static | relative | absolute | fixed | inherit
- if (id == CSSValueStatic ||
- id == CSSValueRelative ||
- id == CSSValueAbsolute ||
- id == CSSValueFixed)
+ if (id == CSSValueStatic
+ || id == CSSValueRelative
+ || id == CSSValueAbsolute
+ || id == CSSValueFixed)
validPrimitive = true;
break;
- case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit
+ case CSSPropertyPageBreakAfter: // auto | always | avoid | left | right | inherit
case CSSPropertyPageBreakBefore:
case CSSPropertyWebkitColumnBreakAfter:
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitRegionBreakAfter:
case CSSPropertyWebkitRegionBreakBefore:
- if (id == CSSValueAuto ||
- id == CSSValueAlways ||
- id == CSSValueAvoid ||
- id == CSSValueLeft ||
- id == CSSValueRight)
+ if (id == CSSValueAuto
+ || id == CSSValueAlways
+ || id == CSSValueAvoid
+ || id == CSSValueLeft
+ || id == CSSValueRight)
validPrimitive = true;
break;
- case CSSPropertyPageBreakInside: // avoid | auto | inherit
+ case CSSPropertyPageBreakInside: // avoid | auto | inherit
case CSSPropertyWebkitColumnBreakInside:
case CSSPropertyWebkitRegionBreakInside:
if (id == CSSValueAuto || id == CSSValueAvoid)
@@ -935,8 +935,8 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyEmptyCells: // show | hide | inherit
- if (id == CSSValueShow ||
- id == CSSValueHide)
+ if (id == CSSValueShow
+ || id == CSSValueHide)
validPrimitive = true;
break;
@@ -945,11 +945,11 @@ bool CSSParser::parseValue(int propId, bool important)
return parseContent(propId, important);
case CSSPropertyWhiteSpace: // normal | pre | nowrap | inherit
- if (id == CSSValueNormal ||
- id == CSSValuePre ||
- id == CSSValuePreWrap ||
- id == CSSValuePreLine ||
- id == CSSValueNowrap)
+ if (id == CSSValueNormal
+ || id == CSSValuePre
+ || id == CSSValuePreWrap
+ || id == CSSValuePreLine
+ || id == CSSValueNowrap)
validPrimitive = true;
break;
@@ -1036,8 +1036,8 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyClear: // none | left | right | both | inherit
- if (id == CSSValueNone || id == CSSValueLeft ||
- id == CSSValueRight|| id == CSSValueBoth)
+ if (id == CSSValueNone || id == CSSValueLeft
+ || id == CSSValueRight|| id == CSSValueBoth)
validPrimitive = true;
break;
@@ -1045,7 +1045,7 @@ bool CSSParser::parseValue(int propId, bool important)
// left | right | center | justify | webkit_left | webkit_right | webkit_center | webkit_match_parent |
// start | end | <string> | inherit
if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id == CSSValueStart || id == CSSValueEnd
- || value->unit == CSSPrimitiveValue::CSS_STRING)
+ || value->unit == CSSPrimitiveValue::CSS_STRING)
validPrimitive = true;
break;
@@ -1408,7 +1408,7 @@ bool CSSParser::parseValue(int propId, bool important)
return parseCounter(propId, 1, important);
validPrimitive = true;
break;
- case CSSPropertyCounterReset: // [ <identifier> <integer>? ]+ | none | inherit
+ case CSSPropertyCounterReset: // [ <identifier> <integer>? ]+ | none | inherit
if (id != CSSValueNone)
return parseCounter(propId, 0, important);
validPrimitive = true;
@@ -1637,8 +1637,8 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyWebkitFlexPack:
validPrimitive = id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueJustify;
break;
- case CSSPropertyWebkitFlexAlign:
- validPrimitive = id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueBaseline || id == CSSValueStretch;
+ case CSSPropertyWebkitFlexItemAlign:
+ validPrimitive = id == CSSValueAuto || id == CSSValueStart || id == CSSValueEnd || id == CSSValueCenter || id == CSSValueBaseline || id == CSSValueStretch;
break;
case CSSPropertyWebkitFlexDirection:
validPrimitive = id == CSSValueRow || id == CSSValueRowReverse || id == CSSValueColumn || id == CSSValueColumnReverse;
@@ -2009,7 +2009,7 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyWebkitTapHighlightColor:
if ((id >= CSSValueAqua && id <= CSSValueWindowtext) || id == CSSValueMenu
|| (id >= CSSValueWebkitFocusRingColor && id < CSSValueWebkitText && !m_strict)) {
- validPrimitive = true;
+ validPrimitive = true;
} else {
parsedValue = parseColor();
if (parsedValue)
@@ -2228,6 +2228,11 @@ bool CSSParser::parseValue(int propId, bool important)
return parseFontFeatureSettings(important);
break;
+ case CSSPropertyWebkitFontKerning:
+ if (id == CSSValueAuto || id == CSSValueNormal || id == CSSValueNone)
+ validPrimitive = true;
+ break;
+
case CSSPropertyWebkitWrapShapeInside:
case CSSPropertyWebkitWrapShapeOutside:
if (id == CSSValueAuto)
@@ -5170,7 +5175,7 @@ PassRefPtr<CSSValueList> CSSParser::parseShadow(CSSParserValueList* valueList, i
if (!parsedColor || !context.allowColor)
return 0; // This value is not a color or length and is invalid or
- // it is a color, but a color isn't allowed at this point.
+ // it is a color, but a color isn't allowed at this point.
context.commitColor(parsedColor.release());
}
@@ -5458,7 +5463,7 @@ bool CSSParser::parseBorderImage(int propId, RefPtr<CSSValue>& result)
static bool isBorderImageRepeatKeyword(int id)
{
- return id == CSSValueStretch || id == CSSValueRepeat || id == CSSValueSpace || id == CSSValueRound;
+ return id == CSSValueStretch || id == CSSValueRepeat || id == CSSValueSpace || id == CSSValueRound;
}
bool CSSParser::parseBorderImageRepeat(RefPtr<CSSValue>& result)
@@ -5543,7 +5548,7 @@ public:
m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
}
if (!m_left)
- m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
+ m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
// Now build a rect value to hold all four of our primitive values.
RefPtr<Quad> quad = Quad::create();
@@ -5659,7 +5664,7 @@ public:
m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
}
if (!m_left)
- m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
+ m_left = m_cssValuePool->createValue(m_right->getDoubleValue(), (CSSPrimitiveValue::UnitTypes)m_right->primitiveType());
// Now build a quad value to hold all four of our primitive values.
RefPtr<Quad> quad = Quad::create();
@@ -6619,7 +6624,7 @@ static void filterInfoForName(const CSSParserString& name, WebKitCSSFilterValue:
else if (equalIgnoringCase(name, "sepia("))
filterType = WebKitCSSFilterValue::SepiaFilterOperation;
else if (equalIgnoringCase(name, "saturate("))
- filterType = WebKitCSSFilterValue::SaturateFilterOperation;
+ filterType = WebKitCSSFilterValue::SaturateFilterOperation;
else if (equalIgnoringCase(name, "hue-rotate("))
filterType = WebKitCSSFilterValue::HueRotateFilterOperation;
else if (equalIgnoringCase(name, "invert("))
diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h
index f8444ca6a..6d85beeb3 100644
--- a/Source/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h
@@ -1158,6 +1158,9 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
{
m_primitiveUnitType = CSS_IDENT;
switch (e) {
+ case AlignAuto:
+ m_value.ident = CSSValueAuto;
+ break;
case AlignStart:
m_value.ident = CSSValueStart;
break;
@@ -1179,6 +1182,8 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(EFlexAlign e)
template<> inline CSSPrimitiveValue::operator EFlexAlign() const
{
switch (m_value.ident) {
+ case CSSValueAuto:
+ return AlignAuto;
case CSSValueStart:
return AlignStart;
case CSSValueEnd:
@@ -2821,6 +2826,41 @@ template<> inline CSSPrimitiveValue::operator EPointerEvents() const
}
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontDescription::Kerning kerning)
+ : CSSValue(PrimitiveClass)
+{
+ m_primitiveUnitType = CSS_IDENT;
+ switch (kerning) {
+ case FontDescription::AutoKerning:
+ m_value.ident = CSSValueAuto;
+ return;
+ case FontDescription::NormalKerning:
+ m_value.ident = CSSValueNormal;
+ return;
+ case FontDescription::NoneKerning:
+ m_value.ident = CSSValueNone;
+ return;
+ }
+
+ ASSERT_NOT_REACHED();
+ m_value.ident = CSSValueAuto;
+}
+
+template<> inline CSSPrimitiveValue::operator FontDescription::Kerning() const
+{
+ switch (m_value.ident) {
+ case CSSValueAuto:
+ return FontDescription::AutoKerning;
+ case CSSValueNormal:
+ return FontDescription::NormalKerning;
+ case CSSValueNone:
+ return FontDescription::NoneKerning;
+ }
+
+ ASSERT_NOT_REACHED();
+ return FontDescription::AutoKerning;
+}
+
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(FontSmoothingMode smoothing)
: CSSValue(PrimitiveClass)
{
diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp
index 3bbf03227..b3d056c56 100644
--- a/Source/WebCore/css/CSSProperty.cpp
+++ b/Source/WebCore/css/CSSProperty.cpp
@@ -318,6 +318,7 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
case CSSPropertyWebkitBoxDirection:
case CSSPropertyWebkitColorCorrection:
case CSSPropertyWebkitFontFeatureSettings:
+ case CSSPropertyWebkitFontKerning:
case CSSPropertyWebkitFontSmoothing:
case CSSPropertyWebkitLocale:
case CSSPropertyWebkitHighlight:
@@ -558,7 +559,7 @@ bool CSSProperty::isInheritedProperty(unsigned propertyID)
#endif
case CSSPropertyWebkitFlexOrder:
case CSSPropertyWebkitFlexPack:
- case CSSPropertyWebkitFlexAlign:
+ case CSSPropertyWebkitFlexItemAlign:
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexFlow:
case CSSPropertyWebkitFlexWrap:
diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in
index c0299da60..e69875bb8 100644
--- a/Source/WebCore/css/CSSPropertyNames.in
+++ b/Source/WebCore/css/CSSPropertyNames.in
@@ -21,6 +21,7 @@ font-variant
font-weight
text-rendering
-webkit-font-feature-settings
+-webkit-font-kerning
-webkit-font-smoothing
-webkit-locale
-webkit-text-orientation
@@ -253,9 +254,9 @@ z-index
#if defined(ENABLE_CSS_FILTERS) && ENABLE_CSS_FILTERS
-webkit-filter
#endif
--webkit-flex-align
-webkit-flex-direction
-webkit-flex-flow
+-webkit-flex-item-align
-webkit-flex-order
-webkit-flex-pack
-webkit-flex-wrap
diff --git a/Source/WebCore/css/CSSStyleApplyProperty.cpp b/Source/WebCore/css/CSSStyleApplyProperty.cpp
index 389f25c4a..0b4a63336 100644
--- a/Source/WebCore/css/CSSStyleApplyProperty.cpp
+++ b/Source/WebCore/css/CSSStyleApplyProperty.cpp
@@ -1672,7 +1672,7 @@ CSSStyleApplyProperty::CSSStyleApplyProperty()
setPropertyHandler(CSSPropertyWebkitFlexOrder, ApplyPropertyDefault<int, &RenderStyle::flexOrder, int, &RenderStyle::setFlexOrder, int, &RenderStyle::initialFlexOrder>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexPack, ApplyPropertyDefault<EFlexPack, &RenderStyle::flexPack, EFlexPack, &RenderStyle::setFlexPack, EFlexPack, &RenderStyle::initialFlexPack>::createHandler());
- setPropertyHandler(CSSPropertyWebkitFlexAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexAlign, EFlexAlign, &RenderStyle::setFlexAlign, EFlexAlign, &RenderStyle::initialFlexAlign>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitFlexItemAlign, ApplyPropertyDefault<EFlexAlign, &RenderStyle::flexItemAlign, EFlexAlign, &RenderStyle::setFlexItemAlign, EFlexAlign, &RenderStyle::initialFlexItemAlign>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexDirection, ApplyPropertyDefault<EFlexDirection, &RenderStyle::flexDirection, EFlexDirection, &RenderStyle::setFlexDirection, EFlexDirection, &RenderStyle::initialFlexDirection>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexWrap, ApplyPropertyDefault<EFlexWrap, &RenderStyle::flexWrap, EFlexWrap, &RenderStyle::setFlexWrap, EFlexWrap, &RenderStyle::initialFlexWrap>::createHandler());
setPropertyHandler(CSSPropertyWebkitFlexFlow, ApplyPropertyExpanding<SuppressValue, CSSPropertyWebkitFlexDirection, CSSPropertyWebkitFlexWrap>::createHandler());
@@ -1681,6 +1681,7 @@ CSSStyleApplyProperty::CSSStyleApplyProperty()
setPropertyHandler(CSSPropertyFontStyle, ApplyPropertyFont<FontItalic, &FontDescription::italic, &FontDescription::setItalic, FontItalicOff>::createHandler());
setPropertyHandler(CSSPropertyFontVariant, ApplyPropertyFont<FontSmallCaps, &FontDescription::smallCaps, &FontDescription::setSmallCaps, FontSmallCapsOff>::createHandler());
setPropertyHandler(CSSPropertyTextRendering, ApplyPropertyFont<TextRenderingMode, &FontDescription::textRenderingMode, &FontDescription::setTextRenderingMode, AutoTextRendering>::createHandler());
+ setPropertyHandler(CSSPropertyWebkitFontKerning, ApplyPropertyFont<FontDescription::Kerning, &FontDescription::kerning, &FontDescription::setKerning, FontDescription::AutoKerning>::createHandler());
setPropertyHandler(CSSPropertyWebkitFontSmoothing, ApplyPropertyFont<FontSmoothingMode, &FontDescription::fontSmoothing, &FontDescription::setFontSmoothing, AutoSmoothing>::createHandler());
setPropertyHandler(CSSPropertyWebkitTextOrientation, ApplyPropertyFont<TextOrientation, &FontDescription::textOrientation, &FontDescription::setTextOrientation, TextOrientationVerticalRight>::createHandler());
setPropertyHandler(CSSPropertyFontWeight, ApplyPropertyFontWeight::createHandler());
diff --git a/Source/WebCore/css/CSSStyleSelector.cpp b/Source/WebCore/css/CSSStyleSelector.cpp
index b0282c120..97f19cfba 100644
--- a/Source/WebCore/css/CSSStyleSelector.cpp
+++ b/Source/WebCore/css/CSSStyleSelector.cpp
@@ -330,6 +330,7 @@ CSSStyleSelector::CSSStyleSelector(Document* document, StyleSheetList* styleShee
bool strictParsing, bool matchAuthorAndUserStyles)
: m_hasUAAppearance(false)
, m_backgroundData(BackgroundFillLayer)
+ , m_matchedDeclarationCacheAdditionsSinceLastSweep(0)
, m_checker(document, strictParsing)
, m_parentStyle(0)
, m_rootElementStyle(0)
@@ -479,7 +480,27 @@ void CSSStyleSelector::addKeyframeStyle(PassRefPtr<WebKitCSSKeyframesRule> rule)
CSSStyleSelector::~CSSStyleSelector()
{
m_fontSelector->clearDocument();
- deleteAllValues(m_viewportDependentMediaQueryResults);
+}
+
+void CSSStyleSelector::sweepMatchedDeclarationCache()
+{
+ // Look for cache entries containing a style declaration with a single ref and remove them.
+ // This may happen when an element attribute mutation causes it to swap out its Attribute::decl()
+ // for another CSSMappedAttributeDeclaration, potentially leaving this cache with the last ref.
+ Vector<unsigned, 16> toRemove;
+ MatchedStyleDeclarationCache::iterator it = m_matchedStyleDeclarationCache.begin();
+ MatchedStyleDeclarationCache::iterator end = m_matchedStyleDeclarationCache.end();
+ for (; it != end; ++it) {
+ Vector<MatchedStyleDeclaration>& matchedStyleDeclarations = it->second.matchedStyleDeclarations;
+ for (size_t i = 0; i < matchedStyleDeclarations.size(); ++i) {
+ if (matchedStyleDeclarations[i].styleDeclaration->hasOneRef()) {
+ toRemove.append(it->first);
+ break;
+ }
+ }
+ }
+ for (size_t i = 0; i < toRemove.size(); ++i)
+ m_matchedStyleDeclarationCache.remove(toRemove[i]);
}
CSSStyleSelector::Features::Features()
@@ -627,12 +648,6 @@ static void ensureDefaultStyleSheetsForElement(Element* element)
#endif
}
-CSSStyleSelector::MatchedStyleDeclaration::MatchedStyleDeclaration()
-{
- // Make sure all memory is zero initializes as we calculate hash over the bytes of this object.
- memset(this, 0, sizeof(*this));
-}
-
void CSSStyleSelector::addMatchedDeclaration(CSSMutableStyleDeclaration* styleDeclaration, unsigned linkMatchType)
{
m_matchedDecls.grow(m_matchedDecls.size() + 1);
@@ -815,12 +830,12 @@ void CSSStyleSelector::matchAllRules(MatchResult& result)
const NamedNodeMap* map = m_styledElement->attributeMap();
for (unsigned i = 0; i < map->length(); ++i) {
Attribute* attr = map->attributeItem(i);
- if (attr->isMappedAttribute() && attr->decl()) {
+ if (attr->decl()) {
+ ASSERT(attr->isMappedAttribute());
result.lastAuthorRule = m_matchedDecls.size();
if (result.firstAuthorRule == -1)
result.firstAuthorRule = result.lastAuthorRule;
addMatchedDeclaration(attr->decl());
- result.isCacheable = false;
}
}
}
@@ -2212,7 +2227,7 @@ void CSSStyleSelector::applyDeclaration(CSSMutableStyleDeclaration* styleDeclara
int property = current.id();
if (applyFirst) {
COMPILE_ASSERT(firstCSSProperty == CSSPropertyColor, CSS_color_is_first_property);
- COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 16, CSS_zoom_is_end_of_first_prop_range);
+ COMPILE_ASSERT(CSSPropertyZoom == CSSPropertyColor + 17, CSS_zoom_is_end_of_first_prop_range);
COMPILE_ASSERT(CSSPropertyLineHeight == CSSPropertyZoom + 1, CSS_line_height_is_after_zoom);
// give special priority to font-xxx, color properties, etc
if (property > CSSPropertyLineHeight)
@@ -2239,7 +2254,7 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e
if (m_style->insideLink() != NotInsideLink) {
for (int i = startIndex; i <= endIndex; ++i) {
- CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration;
+ CSSMutableStyleDeclaration* styleDeclaration = m_matchedDecls[i].styleDeclaration.get();
unsigned linkMatchType = m_matchedDecls[i].linkMatchType;
// FIXME: It would be nicer to pass these as arguments but that requires changes in many places.
m_applyPropertyToRegularStyle = linkMatchType & SelectorChecker::MatchLink;
@@ -2252,7 +2267,7 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e
return;
}
for (int i = startIndex; i <= endIndex; ++i)
- applyDeclaration<applyFirst>(m_matchedDecls[i].styleDeclaration, isImportant, inheritedOnly);
+ applyDeclaration<applyFirst>(m_matchedDecls[i].styleDeclaration.get(), isImportant, inheritedOnly);
}
unsigned CSSStyleSelector::computeDeclarationHash(MatchedStyleDeclaration* declarations, unsigned size)
@@ -2310,6 +2325,12 @@ const CSSStyleSelector::MatchedStyleDeclarationCacheItem* CSSStyleSelector::find
void CSSStyleSelector::addToMatchedDeclarationCache(const RenderStyle* style, const RenderStyle* parentStyle, unsigned hash, const MatchResult& matchResult)
{
+ static unsigned matchedDeclarationCacheAdditionsBetweenSweeps = 100;
+ if (++m_matchedDeclarationCacheAdditionsSinceLastSweep >= matchedDeclarationCacheAdditionsBetweenSweeps) {
+ sweepMatchedDeclarationCache();
+ m_matchedDeclarationCacheAdditionsSinceLastSweep = 0;
+ }
+
ASSERT(hash);
MatchedStyleDeclarationCacheItem cacheItem;
cacheItem.matchedStyleDeclarations.append(m_matchedDecls);
@@ -3698,7 +3719,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
case CSSPropertyWordSpacing:
case CSSPropertyWebkitFlexOrder:
case CSSPropertyWebkitFlexPack:
- case CSSPropertyWebkitFlexAlign:
+ case CSSPropertyWebkitFlexItemAlign:
case CSSPropertyWebkitFlexDirection:
case CSSPropertyWebkitFlexFlow:
case CSSPropertyWebkitFlexWrap:
@@ -4703,7 +4724,7 @@ bool CSSStyleSelector::hasSelectorForAttribute(const AtomicString &attrname) con
void CSSStyleSelector::addViewportDependentMediaQueryResult(const MediaQueryExp* expr, bool result)
{
- m_viewportDependentMediaQueryResults.append(new MediaQueryResult(*expr, result));
+ m_viewportDependentMediaQueryResults.append(adoptPtr(new MediaQueryResult(*expr, result)));
}
bool CSSStyleSelector::affectedByViewportChange() const
diff --git a/Source/WebCore/css/CSSStyleSelector.h b/Source/WebCore/css/CSSStyleSelector.h
index 872b634f5..856193f99 100644
--- a/Source/WebCore/css/CSSStyleSelector.h
+++ b/Source/WebCore/css/CSSStyleSelector.h
@@ -346,9 +346,14 @@ private:
void loadPendingImages();
struct MatchedStyleDeclaration {
- MatchedStyleDeclaration();
- CSSMutableStyleDeclaration* styleDeclaration;
- unsigned linkMatchType;
+ MatchedStyleDeclaration() : possiblyPaddedMember(0) { }
+
+ RefPtr<CSSMutableStyleDeclaration> styleDeclaration;
+ union {
+ unsigned linkMatchType;
+ // Used to make sure all memory is zero-initialized since we compute the hash over the bytes of this object.
+ void* possiblyPaddedMember;
+ };
};
static unsigned computeDeclarationHash(MatchedStyleDeclaration*, unsigned size);
struct MatchedStyleDeclarationCacheItem {
@@ -360,11 +365,16 @@ private:
const MatchedStyleDeclarationCacheItem* findFromMatchedDeclarationCache(unsigned hash, const MatchResult&);
void addToMatchedDeclarationCache(const RenderStyle*, const RenderStyle* parentStyle, unsigned hash, const MatchResult&);
+ // Every N additions to the matched declaration cache trigger a sweep where entries holding
+ // the last reference to a style declaration are garbage collected.
+ void sweepMatchedDeclarationCache();
+
// We collect the set of decls that match in |m_matchedDecls|. We then walk the
// set of matched decls four times, once for those properties that others depend on (like font-size),
// and then a second time for all the remaining properties. We then do the same two passes
// for any !important rules.
Vector<MatchedStyleDeclaration, 64> m_matchedDecls;
+ unsigned m_matchedDeclarationCacheAdditionsSinceLastSweep;
typedef HashMap<unsigned, MatchedStyleDeclarationCacheItem> MatchedStyleDeclarationCache;
MatchedStyleDeclarationCache m_matchedStyleDeclarationCache;
@@ -397,7 +407,7 @@ private:
bool m_sameOriginOnly;
RefPtr<CSSFontSelector> m_fontSelector;
- Vector<MediaQueryResult*> m_viewportDependentMediaQueryResults;
+ Vector<OwnPtr<MediaQueryResult> > m_viewportDependentMediaQueryResults;
bool m_applyPropertyToRegularStyle;
bool m_applyPropertyToVisitedLinkStyle;
diff --git a/Source/WebCore/css/CSSValue.cpp b/Source/WebCore/css/CSSValue.cpp
index 0e83c0818..711e4c5ed 100644
--- a/Source/WebCore/css/CSSValue.cpp
+++ b/Source/WebCore/css/CSSValue.cpp
@@ -65,6 +65,11 @@ class SameSizeAsCSSValue : public RefCounted<SameSizeAsCSSValue> {
COMPILE_ASSERT(sizeof(CSSValue) == sizeof(SameSizeAsCSSValue), CSS_value_should_stay_small);
+bool CSSValue::isImplicitInitialValue() const
+{
+ return m_classType == InitialClass && static_cast<const CSSInitialValue*>(this)->isImplicit();
+}
+
CSSValue::Type CSSValue::cssValueType() const
{
if (isInheritedValue())
diff --git a/Source/WebCore/css/CSSValue.h b/Source/WebCore/css/CSSValue.h
index ce95369ab..fd5e6f520 100644
--- a/Source/WebCore/css/CSSValue.h
+++ b/Source/WebCore/css/CSSValue.h
@@ -68,7 +68,7 @@ public:
bool isFontValue() const { return m_classType == FontClass; }
bool isImageGeneratorValue() const { return m_classType >= CanvasClass && m_classType <= RadialGradientClass; }
bool isImageValue() const { return m_classType == ImageClass || m_classType == CursorImageClass; }
- bool isImplicitInitialValue() const { return m_classType == InitialClass && m_isImplicitInitialValue; }
+ bool isImplicitInitialValue() const;
bool isInheritedValue() const { return m_classType == InheritedClass; }
bool isInitialValue() const { return m_classType == InitialClass; }
bool isReflectValue() const { return m_classType == ReflectClass; }
@@ -145,14 +145,20 @@ protected:
// Do not append non-list class types here.
};
+ static const size_t ValueListSeparatorBits = 2;
+ enum ValueListSeparator {
+ SpaceSeparator,
+ CommaSeparator,
+ SlashSeparator
+ };
+
ClassType classType() const { return static_cast<ClassType>(m_classType); }
explicit CSSValue(ClassType classType)
: m_primitiveUnitType(0)
, m_hasCachedCSSText(false)
, m_isQuirkValue(false)
- , m_isImplicitInitialValue(false)
- , m_isSpaceSeparatedValueList(false)
+ , m_valueListSeparator(SpaceSeparator)
, m_classType(classType)
{
}
@@ -174,11 +180,7 @@ protected:
mutable bool m_hasCachedCSSText : 1;
bool m_isQuirkValue : 1;
- // CSSInitialValue bits:
- bool m_isImplicitInitialValue : 1;
-
- // CSSValueList bits:
- bool m_isSpaceSeparatedValueList : 1;
+ unsigned char m_valueListSeparator : ValueListSeparatorBits;
private:
unsigned char m_classType : ClassTypeBits; // ClassType
diff --git a/Source/WebCore/css/CSSValueList.cpp b/Source/WebCore/css/CSSValueList.cpp
index 661e183a7..07aa789b0 100644
--- a/Source/WebCore/css/CSSValueList.cpp
+++ b/Source/WebCore/css/CSSValueList.cpp
@@ -24,25 +24,26 @@
#include "CSSParserValues.h"
#include "PlatformString.h"
#include <wtf/PassOwnPtr.h>
+#include <wtf/text/StringBuilder.h>
namespace WebCore {
-CSSValueList::CSSValueList(ClassType classType, bool isSpaceSeparated)
+CSSValueList::CSSValueList(ClassType classType, ValueListSeparator listSeparator)
: CSSValue(classType)
{
- m_isSpaceSeparatedValueList = isSpaceSeparated;
+ m_valueListSeparator = listSeparator;
}
-CSSValueList::CSSValueList(bool isSpaceSeparated)
+CSSValueList::CSSValueList(ValueListSeparator listSeparator)
: CSSValue(ValueListClass)
{
- m_isSpaceSeparatedValueList = isSpaceSeparated;
+ m_valueListSeparator = listSeparator;
}
CSSValueList::CSSValueList(CSSParserValueList* list)
: CSSValue(ValueListClass)
{
- m_isSpaceSeparatedValueList = true;
+ m_valueListSeparator = SpaceSeparator;
if (list) {
size_t size = list->size();
for (unsigned i = 0; i < size; ++i)
@@ -88,28 +89,51 @@ bool CSSValueList::hasValue(CSSValue* val) const
PassRefPtr<CSSValueList> CSSValueList::copy()
{
- PassRefPtr<CSSValueList> newList = isSpaceSeparated() ? createSpaceSeparated() : createCommaSeparated();
+ RefPtr<CSSValueList> newList;
+ switch (m_valueListSeparator) {
+ case SpaceSeparator:
+ newList = createSpaceSeparated();
+ break;
+ case CommaSeparator:
+ newList = createCommaSeparated();
+ break;
+ case SlashSeparator:
+ newList = createSlashSeparated();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
for (size_t index = 0; index < m_values.size(); index++)
newList->append(m_values[index]);
- return newList;
+ return newList.release();
}
String CSSValueList::customCssText() const
{
- String result = "";
+ StringBuilder result;
+ String separator;
+ switch (m_valueListSeparator) {
+ case SpaceSeparator:
+ separator = " ";
+ break;
+ case CommaSeparator:
+ separator = ", ";
+ break;
+ case SlashSeparator:
+ separator = " / ";
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
unsigned size = m_values.size();
for (unsigned i = 0; i < size; i++) {
- if (!result.isEmpty()) {
- if (isSpaceSeparated())
- result += " ";
- else
- result += ", ";
- }
- result += m_values[i]->cssText();
+ if (!result.isEmpty())
+ result.append(separator);
+ result.append(m_values[i]->cssText());
}
- return result;
+ return result.toString();
}
void CSSValueList::addSubresourceStyleURLs(ListHashSet<KURL>& urls, const CSSStyleSheet* styleSheet)
diff --git a/Source/WebCore/css/CSSValueList.h b/Source/WebCore/css/CSSValueList.h
index c62262a9e..16d195b0d 100644
--- a/Source/WebCore/css/CSSValueList.h
+++ b/Source/WebCore/css/CSSValueList.h
@@ -33,11 +33,15 @@ class CSSValueList : public CSSValue {
public:
static PassRefPtr<CSSValueList> createCommaSeparated()
{
- return adoptRef(new CSSValueList(false));
+ return adoptRef(new CSSValueList(CommaSeparator));
}
static PassRefPtr<CSSValueList> createSpaceSeparated()
{
- return adoptRef(new CSSValueList(true));
+ return adoptRef(new CSSValueList(SpaceSeparator));
+ }
+ static PassRefPtr<CSSValueList> createSlashSeparated()
+ {
+ return adoptRef(new CSSValueList(SlashSeparator));
}
static PassRefPtr<CSSValueList> createFromParserValueList(CSSParserValueList* list)
{
@@ -59,14 +63,12 @@ public:
void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
protected:
- CSSValueList(ClassType, bool isSpaceSeparated);
+ CSSValueList(ClassType, ValueListSeparator);
private:
- explicit CSSValueList(bool isSpaceSeparated);
+ explicit CSSValueList(ValueListSeparator);
explicit CSSValueList(CSSParserValueList*);
- bool isSpaceSeparated() const { return m_isSpaceSeparatedValueList; }
-
Vector<RefPtr<CSSValue> > m_values;
};
diff --git a/Source/WebCore/css/StyleMedia.cpp b/Source/WebCore/css/StyleMedia.cpp
index 90b574017..5db8a6f98 100644
--- a/Source/WebCore/css/StyleMedia.cpp
+++ b/Source/WebCore/css/StyleMedia.cpp
@@ -36,7 +36,7 @@
namespace WebCore {
StyleMedia::StyleMedia(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
diff --git a/Source/WebCore/css/StyleMedia.h b/Source/WebCore/css/StyleMedia.h
index 760524271..032929e08 100644
--- a/Source/WebCore/css/StyleMedia.h
+++ b/Source/WebCore/css/StyleMedia.h
@@ -27,6 +27,7 @@
#ifndef StyleMedia_h
#define StyleMedia_h
+#include "DOMWindowProperty.h"
#include "PlatformString.h"
#include <wtf/RefCounted.h>
@@ -34,24 +35,15 @@ namespace WebCore {
class Frame;
-class StyleMedia : public RefCounted<StyleMedia> {
+class StyleMedia : public RefCounted<StyleMedia>, public DOMWindowProperty {
public:
- static PassRefPtr<StyleMedia> create(Frame* frame)
- {
- return adoptRef(new StyleMedia(frame));
- }
-
- Frame* frame() { return m_frame; }
- void disconnectFrame() { m_frame = 0; }
+ static PassRefPtr<StyleMedia> create(Frame* frame) { return adoptRef(new StyleMedia(frame));}
String type() const;
-
bool matchMedium(const String&) const;
private:
- StyleMedia(Frame*);
-
- Frame* m_frame;
+ explicit StyleMedia(Frame*);
};
} // namespace
diff --git a/Source/WebCore/css/WebKitCSSFilterValue.cpp b/Source/WebCore/css/WebKitCSSFilterValue.cpp
index b8e39933a..93ae41097 100644
--- a/Source/WebCore/css/WebKitCSSFilterValue.cpp
+++ b/Source/WebCore/css/WebKitCSSFilterValue.cpp
@@ -35,7 +35,7 @@
namespace WebCore {
WebKitCSSFilterValue::WebKitCSSFilterValue(FilterOperationType operationType)
- : CSSValueList(WebKitCSSFilterClass, typeUsesSpaceSeparator(operationType))
+ : CSSValueList(WebKitCSSFilterClass, typeUsesSpaceSeparator(operationType) ? SpaceSeparator : CommaSeparator)
, m_type(operationType)
{
}
diff --git a/Source/WebCore/css/WebKitCSSTransformValue.cpp b/Source/WebCore/css/WebKitCSSTransformValue.cpp
index 6a391ac85..3e2f9e60d 100644
--- a/Source/WebCore/css/WebKitCSSTransformValue.cpp
+++ b/Source/WebCore/css/WebKitCSSTransformValue.cpp
@@ -33,7 +33,7 @@
namespace WebCore {
WebKitCSSTransformValue::WebKitCSSTransformValue(TransformOperationType op)
- : CSSValueList(WebKitCSSTransformClass, false)
+ : CSSValueList(WebKitCSSTransformClass, CommaSeparator)
, m_type(op)
{
}
diff --git a/Source/WebCore/css/fullscreenQuickTime.css b/Source/WebCore/css/fullscreenQuickTime.css
index a5559768d..ea1ebd6ec 100644
--- a/Source/WebCore/css/fullscreenQuickTime.css
+++ b/Source/WebCore/css/fullscreenQuickTime.css
@@ -29,9 +29,6 @@ video:-webkit-full-screen::-webkit-media-controls-panel {
-webkit-box-pack: end !important;
-webkit-appearance: none !important;
- bottom: 50px !important;
- left: 50% !important;
- margin-left: -220px !important;
padding: 12px 0 0 10px !important;
width: 430px !important;
height: 48px !important;
@@ -58,6 +55,12 @@ video:-webkit-full-screen::-webkit-media-controls-panel {
-webkit-transition: opacity 0.3s linear !important;
}
+video:-webkit-full-screen::-webkit-media-controls-panel:not(.dragged) {
+ bottom: 50px !important;
+ left: 50% !important;
+ margin-left: -220px !important;
+}
+
video:-webkit-animating-full-screen-transition::-webkit-media-controls-panel {
opacity: 0 ! important;
-webkit-transition: opacity 0 ! important;
diff --git a/Source/WebCore/dom/Attr.cpp b/Source/WebCore/dom/Attr.cpp
index cf2111ff2..6930fa1dc 100644
--- a/Source/WebCore/dom/Attr.cpp
+++ b/Source/WebCore/dom/Attr.cpp
@@ -129,7 +129,7 @@ void Attr::setValue(const AtomicString& value)
createTextChild();
m_ignoreChildrenChanged--;
- invalidateNodeListsCacheAfterAttributeChanged();
+ invalidateNodeListsCacheAfterAttributeChanged(m_attribute->name());
}
void Attr::setValue(const AtomicString& value, ExceptionCode&)
@@ -174,7 +174,7 @@ void Attr::childrenChanged(bool changedByParser, Node* beforeChange, Node* after
Node::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- invalidateNodeListsCacheAfterAttributeChanged();
+ invalidateNodeListsCacheAfterAttributeChanged(m_attribute->name());
// FIXME: We should include entity references in the value
diff --git a/Source/WebCore/dom/CheckedRadioButtons.cpp b/Source/WebCore/dom/CheckedRadioButtons.cpp
index 38e5efbbc..9ab89120f 100644
--- a/Source/WebCore/dom/CheckedRadioButtons.cpp
+++ b/Source/WebCore/dom/CheckedRadioButtons.cpp
@@ -25,34 +25,32 @@
namespace WebCore {
-void CheckedRadioButtons::addButton(HTMLFormControlElement* element)
+static inline bool shouldMakeRadioGroup(HTMLInputElement* element)
{
- // We only want to add radio buttons.
- if (!element->isRadioButton())
- return;
+ return element->isRadioButton() && !element->name().isEmpty() && element->inDocument();
+}
- // Without a name, there is no group.
- if (element->name().isEmpty())
+void CheckedRadioButtons::addButton(HTMLInputElement* element)
+{
+ if (!shouldMakeRadioGroup(element))
return;
- HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element);
-
// We only track checked buttons.
- if (!inputElement->checked())
+ if (!element->checked())
return;
if (!m_nameToCheckedRadioButtonMap)
m_nameToCheckedRadioButtonMap = adoptPtr(new NameToInputMap);
- pair<NameToInputMap::iterator, bool> result = m_nameToCheckedRadioButtonMap->add(element->name().impl(), inputElement);
+ pair<NameToInputMap::iterator, bool> result = m_nameToCheckedRadioButtonMap->add(element->name().impl(), element);
if (result.second)
return;
HTMLInputElement* oldCheckedButton = result.first->second;
- if (oldCheckedButton == inputElement)
+ if (oldCheckedButton == element)
return;
- result.first->second = inputElement;
+ result.first->second = element;
oldCheckedButton->setChecked(false);
}
@@ -66,7 +64,7 @@ HTMLInputElement* CheckedRadioButtons::checkedButtonForGroup(const AtomicString&
return m_nameToCheckedRadioButtonMap->get(name.impl());
}
-void CheckedRadioButtons::removeButton(HTMLFormControlElement* element)
+void CheckedRadioButtons::removeButton(HTMLInputElement* element)
{
if (element->name().isEmpty() || !m_nameToCheckedRadioButtonMap)
return;
@@ -77,9 +75,7 @@ void CheckedRadioButtons::removeButton(HTMLFormControlElement* element)
if (it == m_nameToCheckedRadioButtonMap->end() || it->second != element)
return;
- HTMLInputElement* inputElement = element->toInputElement();
- ASSERT_UNUSED(inputElement, inputElement);
- ASSERT(inputElement->shouldAppearChecked());
+ ASSERT(element->shouldAppearChecked());
ASSERT(element->isRadioButton());
m_nameToCheckedRadioButtonMap->remove(it);
diff --git a/Source/WebCore/dom/CheckedRadioButtons.h b/Source/WebCore/dom/CheckedRadioButtons.h
index 0fa457acb..925b50678 100644
--- a/Source/WebCore/dom/CheckedRadioButtons.h
+++ b/Source/WebCore/dom/CheckedRadioButtons.h
@@ -27,13 +27,12 @@
namespace WebCore {
-class HTMLFormControlElement;
class HTMLInputElement;
class CheckedRadioButtons {
public:
- void addButton(HTMLFormControlElement*);
- void removeButton(HTMLFormControlElement*);
+ void addButton(HTMLInputElement*);
+ void removeButton(HTMLInputElement*);
HTMLInputElement* checkedButtonForGroup(const AtomicString& groupName) const;
private:
diff --git a/Source/WebCore/dom/ContainerNode.cpp b/Source/WebCore/dom/ContainerNode.cpp
index 49caa8e21..d5cd09b9f 100644
--- a/Source/WebCore/dom/ContainerNode.cpp
+++ b/Source/WebCore/dom/ContainerNode.cpp
@@ -99,7 +99,7 @@ void ContainerNode::takeAllChildrenFrom(ContainerNode* oldParent)
// FIXME: Together with adoptNode above, the tree scope might get updated recursively twice
// (if the document changed or oldParent was in a shadow tree, AND *this is in a shadow tree).
// Can we do better?
- child->setTreeScopeRecursively(treeScope());
+ treeScope()->adoptIfNeeded(child.get());
if (attached() && !child->attached())
child->attach();
}
@@ -175,7 +175,7 @@ bool ContainerNode::insertBefore(PassRefPtr<Node> newChild, Node* refChild, Exce
InspectorInstrumentation::willInsertDOMNode(document(), child, this);
#endif
- child->setTreeScopeRecursively(treeScope());
+ treeScope()->adoptIfNeeded(child);
insertBeforeCommon(next.get(), child);
@@ -329,7 +329,7 @@ bool ContainerNode::replaceChild(PassRefPtr<Node> newChild, Node* oldChild, Exce
InspectorInstrumentation::willInsertDOMNode(document(), child.get(), this);
#endif
- child->setTreeScopeRecursively(treeScope());
+ treeScope()->adoptIfNeeded(child.get());
// Add child after "prev".
forbidEventDispatch();
@@ -509,7 +509,7 @@ void ContainerNode::removeBetween(Node* previousChild, Node* nextChild, Node* ol
oldChild->setNextSibling(0);
oldChild->setParent(0);
- oldChild->setTreeScopeRecursively(document());
+ document()->adoptIfNeeded(oldChild);
allowEventDispatch();
}
@@ -564,7 +564,7 @@ void ContainerNode::removeChildren()
n->setPreviousSibling(0);
n->setNextSibling(0);
n->setParent(0);
- n->setTreeScopeRecursively(document());
+ document()->adoptIfNeeded(n.get());
m_firstChild = next;
if (n == m_lastChild)
@@ -649,7 +649,7 @@ bool ContainerNode::appendChild(PassRefPtr<Node> newChild, ExceptionCode& ec, bo
InspectorInstrumentation::willInsertDOMNode(document(), child, this);
#endif
- child->setTreeScopeRecursively(treeScope());
+ treeScope()->adoptIfNeeded(child);
// Append child to the end of the list
forbidEventDispatch();
@@ -697,7 +697,7 @@ void ContainerNode::parserAddChild(PassRefPtr<Node> newChild)
Node* last = m_lastChild;
// FIXME: This method should take a PassRefPtr.
appendChildToContainer<Node, ContainerNode>(newChild.get(), this);
- newChild->setTreeScopeRecursively(treeScope());
+ treeScope()->adoptIfNeeded(newChild.get());
allowEventDispatch();
diff --git a/Source/WebCore/dom/DOMAllInOne.cpp b/Source/WebCore/dom/DOMAllInOne.cpp
index d0bcecaa2..55094653f 100644
--- a/Source/WebCore/dom/DOMAllInOne.cpp
+++ b/Source/WebCore/dom/DOMAllInOne.cpp
@@ -129,6 +129,7 @@
#include "TransformSourceLibxslt.cpp"
#include "Traversal.cpp"
#include "TreeScope.cpp"
+#include "TreeScopeAdopter.cpp"
#include "TreeWalker.cpp"
#include "UIEvent.cpp"
#include "UIEventWithKeyState.cpp"
diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp
index 66fb4738e..d2a02c94f 100644
--- a/Source/WebCore/dom/Document.cpp
+++ b/Source/WebCore/dom/Document.cpp
@@ -498,6 +498,10 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
static int docID = 0;
m_docID = docID++;
+
+#ifndef NDEBUG
+ m_updatingStyleSelector = false;
+#endif
}
static void histogramMutationEventUsage(const unsigned short& listenerTypes)
@@ -567,14 +571,6 @@ Document::~Document()
if (m_mediaQueryMatcher)
m_mediaQueryMatcher->documentDestroyed();
-
- for (unsigned i = 0; i < NumUnnamedDocumentCachedTypes; ++i) {
- if (m_collections[i])
- m_collections[i]->detachFromNode();
- }
-
- if (m_allCollection)
- m_allCollection->detachFromNode();
}
void Document::removedLastRef()
@@ -712,9 +708,9 @@ void Document::setDocType(PassRefPtr<DocumentType> docType)
ASSERT(!m_docType || !docType);
m_docType = docType;
if (m_docType)
- m_docType->setTreeScopeRecursively(this);
+ this->adoptIfNeeded(m_docType.get());
// Doctype affects the interpretation of the stylesheets.
- m_styleSelector.clear();
+ clearStyleSelector();
}
DOMImplementation* Document::implementation()
@@ -728,14 +724,12 @@ void Document::childrenChanged(bool changedByParser, Node* beforeChange, Node* a
{
TreeScope::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
- // Invalidate the document element we have cached in case it was replaced.
- m_documentElement = 0;
-}
-
-void Document::cacheDocumentElement() const
-{
- ASSERT(!m_documentElement);
- m_documentElement = firstElementChild(this);
+ Element* newDocumentElement = firstElementChild(this);
+ if (newDocumentElement == m_documentElement)
+ return;
+ m_documentElement = newDocumentElement;
+ // The root style used for media query matching depends on the document element.
+ clearStyleSelector();
}
PassRefPtr<Element> Document::createElement(const AtomicString& name, ExceptionCode& ec)
@@ -949,7 +943,7 @@ PassRefPtr<Node> Document::adoptNode(PassRefPtr<Node> source, ExceptionCode& ec)
source->parentNode()->removeChild(source.get(), ec);
}
- source->setTreeScopeRecursively(this);
+ this->adoptIfNeeded(source.get());
return source;
}
@@ -1808,6 +1802,12 @@ void Document::createStyleSelector()
!inQuirksMode(), matchAuthorAndUserStyles));
combineCSSFeatureFlags();
}
+
+inline void Document::clearStyleSelector()
+{
+ ASSERT(!m_updatingStyleSelector);
+ m_styleSelector.clear();
+}
void Document::attach()
{
@@ -3171,22 +3171,29 @@ bool Document::testAddedStylesheetRequiresStyleRecalc(CSSStyleSheet* stylesheet)
return true;
HashSet<AtomicStringImpl*>::iterator end = idScopes.end();
for (HashSet<AtomicStringImpl*>::iterator it = idScopes.begin(); it != end; ++it) {
- if (hasElementWithId(*it))
+ AtomicStringImpl* id = *it;
+ Element* idElement = getElementById(id);
+ if (!idElement)
+ continue;
+ if (containsMultipleElementsWithId(id))
return true;
+ idElement->setNeedsStyleRecalc();
}
end = classScopes.end();
for (HashSet<AtomicStringImpl*>::iterator it = classScopes.begin(); it != end; ++it) {
// FIXME: getElementsByClassName is not optimal for this. We should handle all classes in a single pass.
- if (getElementsByClassName(*it)->length())
- return true;
+ RefPtr<NodeList> classElements = getElementsByClassName(*it);
+ unsigned elementCount = classElements->length();
+ for (unsigned i = 0; i < elementCount; ++i)
+ classElements->item(i)->setNeedsStyleRecalc();
}
return false;
}
-void Document::analyzeStylesheetChange(StyleSelectorUpdateFlag updateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, bool& requiresStyleSelectorReset, bool& requiresStyleRecalc)
+void Document::analyzeStylesheetChange(StyleSelectorUpdateFlag updateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, bool& requiresStyleSelectorReset, bool& requiresFullStyleRecalc)
{
requiresStyleSelectorReset = true;
- requiresStyleRecalc = true;
+ requiresFullStyleRecalc = true;
// Stylesheets of <style> elements that @import stylesheets are active but loading. We need to trigger a full recalc when such loads are done.
bool hasActiveLoadingStylesheet = false;
@@ -3225,11 +3232,13 @@ void Document::analyzeStylesheetChange(StyleSelectorUpdateFlag updateFlag, const
if (testAddedStylesheetRequiresStyleRecalc(static_cast<CSSStyleSheet*>(newStylesheets[i].get())))
return;
}
- requiresStyleRecalc = false;
+ requiresFullStyleRecalc = false;
}
bool Document::updateActiveStylesheets(StyleSelectorUpdateFlag updateFlag)
{
+ ASSERT(!m_updatingStyleSelector);
+
if (m_inStyleRecalc) {
// SVG <use> element may manage to invalidate style selector in the middle of a style recalc.
// https://bugs.webkit.org/show_bug.cgi?id=54344
@@ -3245,13 +3254,22 @@ bool Document::updateActiveStylesheets(StyleSelectorUpdateFlag updateFlag)
collectActiveStylesheets(newStylesheets);
bool requiresStyleSelectorReset;
- bool requiresStyleRecalc;
- analyzeStylesheetChange(updateFlag, newStylesheets, requiresStyleSelectorReset, requiresStyleRecalc);
+ bool requiresFullStyleRecalc;
+ analyzeStylesheetChange(updateFlag, newStylesheets, requiresStyleSelectorReset, requiresFullStyleRecalc);
if (requiresStyleSelectorReset)
- m_styleSelector.clear();
+ clearStyleSelector();
else {
- m_styleSelector->appendAuthorStylesheets(m_styleSheets->length(), newStylesheets);
+#ifndef NDEBUG
+ m_updatingStyleSelector = true;
+#endif
+ // Detach the style selector temporarily so it can't get deleted during appendAuthorStylesheets
+ OwnPtr<CSSStyleSelector> detachedStyleSelector = m_styleSelector.release();
+ detachedStyleSelector->appendAuthorStylesheets(m_styleSheets->length(), newStylesheets);
+ m_styleSelector = detachedStyleSelector.release();
+#ifndef NDEBUG
+ m_updatingStyleSelector = false;
+#endif
resetCSSFeatureFlags();
}
m_styleSheets->swap(newStylesheets);
@@ -3259,7 +3277,7 @@ bool Document::updateActiveStylesheets(StyleSelectorUpdateFlag updateFlag)
m_didCalculateStyleSelector = true;
m_hasDirtyStyleSelector = false;
- return requiresStyleRecalc;
+ return requiresFullStyleRecalc;
}
void Document::setHoverNode(PassRefPtr<Node> newHoverNode)
@@ -4176,7 +4194,7 @@ KURL Document::openSearchDescriptionURL()
if (!head())
return KURL();
- RefPtr<HTMLCollection> children = head()->children();
+ HTMLCollection* children = head()->children();
for (Node* child = children->firstItem(); child; child = children->nextItem()) {
if (!child->hasTagName(linkTag))
continue;
@@ -4301,81 +4319,81 @@ bool Document::hasSVGRootNode() const
}
#endif
-const RefPtr<HTMLCollection>& Document::cachedCollection(CollectionType type)
+HTMLCollection* Document::cachedCollection(CollectionType type)
{
ASSERT(static_cast<unsigned>(type) < NumUnnamedDocumentCachedTypes);
if (!m_collections[type])
m_collections[type] = HTMLCollection::create(this, type);
- return m_collections[type];
+ return m_collections[type].get();
}
-PassRefPtr<HTMLCollection> Document::images()
+HTMLCollection* Document::images()
{
return cachedCollection(DocImages);
}
-PassRefPtr<HTMLCollection> Document::applets()
+HTMLCollection* Document::applets()
{
return cachedCollection(DocApplets);
}
-PassRefPtr<HTMLCollection> Document::embeds()
+HTMLCollection* Document::embeds()
{
return cachedCollection(DocEmbeds);
}
-PassRefPtr<HTMLCollection> Document::plugins()
+HTMLCollection* Document::plugins()
{
// This is an alias for embeds() required for the JS DOM bindings.
return cachedCollection(DocEmbeds);
}
-PassRefPtr<HTMLCollection> Document::objects()
+HTMLCollection* Document::objects()
{
return cachedCollection(DocObjects);
}
-PassRefPtr<HTMLCollection> Document::scripts()
+HTMLCollection* Document::scripts()
{
return cachedCollection(DocScripts);
}
-PassRefPtr<HTMLCollection> Document::links()
+HTMLCollection* Document::links()
{
return cachedCollection(DocLinks);
}
-PassRefPtr<HTMLCollection> Document::forms()
+HTMLCollection* Document::forms()
{
return cachedCollection(DocForms);
}
-PassRefPtr<HTMLCollection> Document::anchors()
+HTMLCollection* Document::anchors()
{
return cachedCollection(DocAnchors);
}
-PassRefPtr<HTMLAllCollection> Document::all()
+HTMLAllCollection* Document::all()
{
if (!m_allCollection)
m_allCollection = HTMLAllCollection::create(this);
- return m_allCollection;
+ return m_allCollection.get();
}
-PassRefPtr<HTMLCollection> Document::windowNamedItems(const AtomicString& name)
+HTMLCollection* Document::windowNamedItems(const AtomicString& name)
{
- RefPtr<HTMLNameCollection>& collection = m_windowNamedItemCollections.add(name.impl(), 0).first->second;
+ OwnPtr<HTMLNameCollection>& collection = m_windowNamedItemCollections.add(name.impl(), nullptr).first->second;
if (!collection)
collection = HTMLNameCollection::create(this, WindowNamedItems, name);
- return collection;
+ return collection.get();
}
-PassRefPtr<HTMLCollection> Document::documentNamedItems(const AtomicString& name)
+HTMLCollection* Document::documentNamedItems(const AtomicString& name)
{
- RefPtr<HTMLNameCollection>& collection = m_documentNamedItemCollections.add(name.impl(), 0).first->second;
+ OwnPtr<HTMLNameCollection>& collection = m_documentNamedItemCollections.add(name.impl(), nullptr).first->second;
if (!collection)
collection = HTMLNameCollection::create(this, DocumentNamedItems, name);
- return collection;
+ return collection.get();
}
void Document::finishedParsing()
diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h
index 38610cb50..45092d3fb 100644
--- a/Source/WebCore/dom/Document.h
+++ b/Source/WebCore/dom/Document.h
@@ -331,8 +331,6 @@ public:
Element* documentElement() const
{
- if (!m_documentElement)
- cacheDocumentElement();
return m_documentElement.get();
}
@@ -410,19 +408,19 @@ public:
PassRefPtr<Node> adoptNode(PassRefPtr<Node> source, ExceptionCode&);
- PassRefPtr<HTMLCollection> images();
- PassRefPtr<HTMLCollection> embeds();
- PassRefPtr<HTMLCollection> plugins(); // an alias for embeds() required for the JS DOM bindings.
- PassRefPtr<HTMLCollection> applets();
- PassRefPtr<HTMLCollection> links();
- PassRefPtr<HTMLCollection> forms();
- PassRefPtr<HTMLCollection> anchors();
- PassRefPtr<HTMLCollection> objects();
- PassRefPtr<HTMLCollection> scripts();
- PassRefPtr<HTMLCollection> windowNamedItems(const AtomicString& name);
- PassRefPtr<HTMLCollection> documentNamedItems(const AtomicString& name);
+ HTMLCollection* images();
+ HTMLCollection* embeds();
+ HTMLCollection* plugins(); // an alias for embeds() required for the JS DOM bindings.
+ HTMLCollection* applets();
+ HTMLCollection* links();
+ HTMLCollection* forms();
+ HTMLCollection* anchors();
+ HTMLCollection* objects();
+ HTMLCollection* scripts();
+ HTMLCollection* windowNamedItems(const AtomicString& name);
+ HTMLCollection* documentNamedItems(const AtomicString& name);
- PassRefPtr<HTMLAllCollection> all();
+ HTMLAllCollection* all();
// Other methods (not part of DOM)
bool isHTMLDocument() const { return m_isHTML; }
@@ -1155,18 +1153,17 @@ private:
void updateFocusAppearanceTimerFired(Timer<Document>*);
void updateBaseURL();
- void cacheDocumentElement() const;
-
void buildAccessKeyMap(TreeScope* root);
void createStyleSelector();
+ void clearStyleSelector();
void combineCSSFeatureFlags();
void resetCSSFeatureFlags();
bool updateActiveStylesheets(StyleSelectorUpdateFlag);
void collectActiveStylesheets(Vector<RefPtr<StyleSheet> >&);
bool testAddedStylesheetRequiresStyleRecalc(CSSStyleSheet*);
- void analyzeStylesheetChange(StyleSelectorUpdateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, bool& requiresStyleSelectorReset, bool& requiresStyleRecalc);
+ void analyzeStylesheetChange(StyleSelectorUpdateFlag, const Vector<RefPtr<StyleSheet> >& newStylesheets, bool& requiresStyleSelectorReset, bool& requiresFullStyleRecalc);
void deleteCustomFonts();
@@ -1182,7 +1179,7 @@ private:
PageVisibilityState visibilityState() const;
#endif
- const RefPtr<HTMLCollection>& cachedCollection(CollectionType);
+ HTMLCollection* cachedCollection(CollectionType);
int m_guardRefCount;
@@ -1255,7 +1252,7 @@ private:
RefPtr<Node> m_focusedNode;
RefPtr<Node> m_hoverNode;
RefPtr<Node> m_activeNode;
- mutable RefPtr<Element> m_documentElement;
+ RefPtr<Element> m_documentElement;
uint64_t m_domTreeVersion;
static uint64_t s_globalTreeVersion;
@@ -1365,10 +1362,10 @@ private:
CheckedRadioButtons m_checkedRadioButtons;
- RefPtr<HTMLCollection> m_collections[NumUnnamedDocumentCachedTypes];
- RefPtr<HTMLAllCollection> m_allCollection;
+ OwnPtr<HTMLCollection> m_collections[NumUnnamedDocumentCachedTypes];
+ OwnPtr<HTMLAllCollection> m_allCollection;
- typedef HashMap<AtomicStringImpl*, RefPtr<HTMLNameCollection> > NamedCollectionMap;
+ typedef HashMap<AtomicStringImpl*, OwnPtr<HTMLNameCollection> > NamedCollectionMap;
NamedCollectionMap m_documentNamedItemCollections;
NamedCollectionMap m_windowNamedItemCollections;
@@ -1449,6 +1446,10 @@ private:
Timer<Document> m_pendingTasksTimer;
Vector<OwnPtr<Task> > m_pendingTasks;
+
+#ifndef NDEBUG
+ bool m_updatingStyleSelector;
+#endif
};
// Put these methods here, because they require the Document definition, but we really want to inline them.
diff --git a/Source/WebCore/dom/DynamicNodeList.cpp b/Source/WebCore/dom/DynamicNodeList.cpp
index 10cfcce39..788ab6ef6 100644
--- a/Source/WebCore/dom/DynamicNodeList.cpp
+++ b/Source/WebCore/dom/DynamicNodeList.cpp
@@ -28,45 +28,9 @@
namespace WebCore {
-DynamicSubtreeNodeList::SubtreeCaches::SubtreeCaches()
- : m_cachedItem(0)
- , m_isLengthCacheValid(false)
- , m_isItemCacheValid(false)
- , m_domTreeVersionAtTimeOfCaching(0)
-{
-}
-
-void DynamicSubtreeNodeList::SubtreeCaches::setLengthCache(Node* node, unsigned length)
-{
- if (m_isItemCacheValid && !domVersionIsConsistent()) {
- m_cachedItem = node;
- m_isItemCacheValid = false;
- } else if (!m_isItemCacheValid)
- m_cachedItem = node; // Used in domVersionIsConsistent.
- m_cachedLength = length;
- m_isLengthCacheValid = true;
- m_domTreeVersionAtTimeOfCaching = node->document()->domTreeVersion();
-}
-
-void DynamicSubtreeNodeList::SubtreeCaches::setItemCache(Node* item, unsigned offset)
-{
- if (m_isLengthCacheValid && !domVersionIsConsistent())
- m_isLengthCacheValid = false;
- m_cachedItem = item;
- m_cachedItemOffset = offset;
- m_isItemCacheValid = true;
- m_domTreeVersionAtTimeOfCaching = item->document()->domTreeVersion();
-}
-
-void DynamicSubtreeNodeList::SubtreeCaches::reset()
-{
- m_cachedItem = 0;
- m_isLengthCacheValid = false;
- m_isItemCacheValid = false;
-}
-
DynamicSubtreeNodeList::DynamicSubtreeNodeList(PassRefPtr<Node> node)
: DynamicNodeList(node)
+ , m_caches(Caches::create())
{
rootNode()->registerDynamicSubtreeNodeList(this);
}
@@ -78,15 +42,16 @@ DynamicSubtreeNodeList::~DynamicSubtreeNodeList()
unsigned DynamicSubtreeNodeList::length() const
{
- if (m_caches.isLengthCacheValid())
- return m_caches.cachedLength();
+ if (m_caches->isLengthCacheValid)
+ return m_caches->cachedLength;
unsigned length = 0;
for (Node* n = node()->firstChild(); n; n = n->traverseNextNode(rootNode()))
length += n->isElementNode() && nodeMatches(static_cast<Element*>(n));
- m_caches.setLengthCache(node(), length);
+ m_caches->cachedLength = length;
+ m_caches->isLengthCacheValid = true;
return length;
}
@@ -97,7 +62,9 @@ Node* DynamicSubtreeNodeList::itemForwardsFromCurrent(Node* start, unsigned offs
for (Node* n = start; n; n = n->traverseNextNode(rootNode())) {
if (n->isElementNode() && nodeMatches(static_cast<Element*>(n))) {
if (!remainingOffset) {
- m_caches.setItemCache(n, offset);
+ m_caches->lastItem = n;
+ m_caches->lastItemOffset = offset;
+ m_caches->isItemCacheValid = true;
return n;
}
--remainingOffset;
@@ -113,7 +80,9 @@ Node* DynamicSubtreeNodeList::itemBackwardsFromCurrent(Node* start, unsigned off
for (Node* n = start; n; n = n->traversePreviousNode(rootNode())) {
if (n->isElementNode() && nodeMatches(static_cast<Element*>(n))) {
if (!remainingOffset) {
- m_caches.setItemCache(n, offset);
+ m_caches->lastItem = n;
+ m_caches->lastItemOffset = offset;
+ m_caches->isItemCacheValid = true;
return n;
}
++remainingOffset;
@@ -127,12 +96,12 @@ Node* DynamicSubtreeNodeList::item(unsigned offset) const
{
int remainingOffset = offset;
Node* start = node()->firstChild();
- if (m_caches.isItemCacheValid()) {
- if (offset == m_caches.cachedItemOffset())
- return m_caches.cachedItem();
- if (offset > m_caches.cachedItemOffset() || m_caches.cachedItemOffset() - offset < offset) {
- start = m_caches.cachedItem();
- remainingOffset -= m_caches.cachedItemOffset();
+ if (m_caches->isItemCacheValid) {
+ if (offset == m_caches->lastItemOffset)
+ return m_caches->lastItem;
+ else if (offset > m_caches->lastItemOffset || m_caches->lastItemOffset - offset < offset) {
+ start = m_caches->lastItem;
+ remainingOffset -= m_caches->lastItemOffset;
}
}
@@ -170,7 +139,7 @@ bool DynamicSubtreeNodeList::isDynamicNodeList() const
void DynamicSubtreeNodeList::invalidateCache()
{
- m_caches.reset();
+ m_caches->reset();
}
DynamicSubtreeNodeList::Caches::Caches()
@@ -180,12 +149,12 @@ DynamicSubtreeNodeList::Caches::Caches()
{
}
-PassRefPtr<DynamicNodeList::Caches> DynamicNodeList::Caches::create()
+PassRefPtr<DynamicSubtreeNodeList::Caches> DynamicSubtreeNodeList::Caches::create()
{
return adoptRef(new Caches());
}
-void DynamicNodeList::Caches::reset()
+void DynamicSubtreeNodeList::Caches::reset()
{
lastItem = 0;
isLengthCacheValid = false;
diff --git a/Source/WebCore/dom/DynamicNodeList.h b/Source/WebCore/dom/DynamicNodeList.h
index a90455006..606fc64bf 100644
--- a/Source/WebCore/dom/DynamicNodeList.h
+++ b/Source/WebCore/dom/DynamicNodeList.h
@@ -24,7 +24,6 @@
#ifndef DynamicNodeList_h
#define DynamicNodeList_h
-#include "Document.h"
#include "NodeList.h"
#include <wtf/RefCounted.h>
#include <wtf/Forward.h>
@@ -46,11 +45,9 @@ public:
unsigned lastItemOffset;
bool isLengthCacheValid : 1;
bool isItemCacheValid : 1;
-
protected:
Caches();
};
-
DynamicNodeList(PassRefPtr<Node> node)
: m_node(node)
{ }
@@ -79,40 +76,9 @@ public:
protected:
DynamicSubtreeNodeList(PassRefPtr<Node> rootNode);
+ mutable RefPtr<Caches> m_caches;
private:
-
- class SubtreeCaches {
- public:
- SubtreeCaches();
-
- bool isLengthCacheValid() const { return m_isLengthCacheValid && domVersionIsConsistent(); }
- bool isItemCacheValid() const { return m_isItemCacheValid && domVersionIsConsistent(); }
-
- unsigned cachedLength() const { return m_cachedLength; }
- Node* cachedItem() const { return m_cachedItem; }
- unsigned cachedItemOffset() const { return m_cachedItemOffset; }
-
- void setLengthCache(Node* nodeForDocumentVersion, unsigned length);
- void setItemCache(Node*, unsigned offset);
- void reset();
-
- private:
- Node* m_cachedItem;
- unsigned m_cachedItemOffset;
- unsigned m_cachedLength : 30;
- unsigned m_isLengthCacheValid : 1;
- unsigned m_isItemCacheValid : 1;
-
- bool domVersionIsConsistent() const
- {
- return m_cachedItem && m_cachedItem->document()->domTreeVersion() == m_domTreeVersionAtTimeOfCaching;
- }
- uint64_t m_domTreeVersionAtTimeOfCaching;
- };
-
- mutable SubtreeCaches m_caches;
-
virtual bool isDynamicNodeList() const;
Node* itemForwardsFromCurrent(Node* start, unsigned offset, int remainingOffset) const;
Node* itemBackwardsFromCurrent(Node* start, unsigned offset, int remainingOffset) const;
diff --git a/Source/WebCore/dom/Element.cpp b/Source/WebCore/dom/Element.cpp
index 109311651..24486d7be 100644
--- a/Source/WebCore/dom/Element.cpp
+++ b/Source/WebCore/dom/Element.cpp
@@ -123,16 +123,6 @@ Element::~Element()
removeShadowRoot();
if (m_attributeMap)
m_attributeMap->detachFromElement();
-
- if (hasRareData()) {
- ElementRareData* elementRareData = rareData();
- if (elementRareData->hasCachedHTMLCollections()) {
- for (unsigned type = 0; type < NumNodeCollectionTypes; ++type) {
- if (HTMLCollection* collection = elementRareData->cachedHTMLCollection(static_cast<CollectionType>(FirstNodeCollectionType + type)))
- collection->detachFromNode();
- }
- }
- }
}
inline ElementRareData* Element::rareData() const
@@ -674,7 +664,7 @@ void Element::attributeChanged(Attribute* attr, bool)
void Element::updateAfterAttributeChanged(Attribute* attr)
{
- invalidateNodeListsCacheAfterAttributeChanged();
+ invalidateNodeListsCacheAfterAttributeChanged(attr->name());
if (!AXObjectCache::accessibilityEnabled())
return;
@@ -708,9 +698,12 @@ void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
{
if (needsStyleRecalc())
return;
-
- if (document()->attached() && document()->styleSelector()->hasSelectorForAttribute(attr->name().localName()))
- setNeedsStyleRecalc();
+ if (!document()->attached())
+ return;
+ CSSStyleSelector* styleSelector = document()->styleSelectorIfExists();
+ if (styleSelector && !styleSelector->hasSelectorForAttribute(attr->name().localName()))
+ return;
+ setNeedsStyleRecalc();
}
void Element::idAttributeChanged(Attribute* attr)
@@ -1221,7 +1214,7 @@ void Element::removeShadowRoot()
oldRoot->detach();
oldRoot->setShadowHost(0);
- oldRoot->setTreeScopeRecursively(document());
+ document()->adoptIfNeeded(oldRoot.get());
if (oldRoot->inDocument())
oldRoot->removedFromDocument();
else
diff --git a/Source/WebCore/dom/ElementRareData.h b/Source/WebCore/dom/ElementRareData.h
index c5cf6cdff..4036a3136 100644
--- a/Source/WebCore/dom/ElementRareData.h
+++ b/Source/WebCore/dom/ElementRareData.h
@@ -43,25 +43,19 @@ public:
using NodeRareData::needsFocusAppearanceUpdateSoonAfterAttach;
using NodeRareData::setNeedsFocusAppearanceUpdateSoonAfterAttach;
- typedef FixedArray<RefPtr<HTMLCollection>, NumNodeCollectionTypes> CachedHTMLCollectionArray;
+ typedef FixedArray<OwnPtr<HTMLCollection>, NumNodeCollectionTypes> CachedHTMLCollectionArray;
bool hasCachedHTMLCollections() const
{
return m_cachedCollections;
}
- HTMLCollection* cachedHTMLCollection(CollectionType type) const
- {
- ASSERT(m_cachedCollections);
- return (*m_cachedCollections)[type - FirstNodeCollectionType].get();
- }
-
HTMLCollection* ensureCachedHTMLCollection(Element* element, CollectionType type)
{
if (!m_cachedCollections)
m_cachedCollections = adoptPtr(new CachedHTMLCollectionArray);
- RefPtr<HTMLCollection>& collection = (*m_cachedCollections)[type - FirstNodeCollectionType];
+ OwnPtr<HTMLCollection>& collection = (*m_cachedCollections)[type - FirstNodeCollectionType];
if (!collection)
collection = HTMLCollection::create(element, type);
return collection.get();
diff --git a/Source/WebCore/dom/NamedNodeMap.cpp b/Source/WebCore/dom/NamedNodeMap.cpp
index 07ff84ded..c4a87ef4c 100644
--- a/Source/WebCore/dom/NamedNodeMap.cpp
+++ b/Source/WebCore/dom/NamedNodeMap.cpp
@@ -344,9 +344,7 @@ bool NamedNodeMap::mappedMapsEquivalent(const NamedNodeMap* otherMap) const
ASSERT(attr->isMappedAttribute());
Attribute* otherAttr = otherMap->getAttributeItem(attr->name());
- if (!otherAttr || !otherAttr->decl() || attr->value() != otherAttr->value())
- return false;
- if (!attr->decl()->propertiesEqual(otherAttr->decl()))
+ if (!otherAttr || attr->decl() != otherAttr->decl() || attr->value() != otherAttr->value())
return false;
}
}
diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp
index 8d1655dad..a1c76246d 100644
--- a/Source/WebCore/dom/Node.cpp
+++ b/Source/WebCore/dom/Node.cpp
@@ -90,6 +90,7 @@
#include "TagNodeList.h"
#include "Text.h"
#include "TextEvent.h"
+#include "TreeScopeAdopter.h"
#include "UIEvent.h"
#include "UIEventWithKeyState.h"
#include "WebKitAnimationEvent.h"
@@ -417,37 +418,30 @@ Node::~Node()
doc->guardDeref();
}
-#ifndef NDEBUG
-
-static bool didMoveToNewDocumentWasCalled;
-static Document* oldDocumentDidMoveToNewDocumentWasCalledWith;
-
-#endif
-
void Node::setDocument(Document* document)
{
ASSERT(!inDocument() || m_document == document);
if (inDocument() || m_document == document)
return;
- document->guardRef();
-
- if (m_document) {
- m_document->moveNodeIteratorsToNewDocument(this, document);
- m_document->guardDeref();
- }
-
- Document* oldDocument = m_document;
m_document = document;
+}
-#ifndef NDEBUG
- didMoveToNewDocumentWasCalled = false;
- oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument;
-#endif
+NodeRareData* Node::setTreeScope(TreeScope* scope)
+{
+ if (!scope) {
+ if (hasRareData()) {
+ NodeRareData* data = rareData();
+ data->setTreeScope(0);
+ return data;
+ }
- didMoveToNewDocument(oldDocument);
+ return 0;
+ }
- ASSERT(didMoveToNewDocumentWasCalled);
+ NodeRareData* data = ensureRareData();
+ data->setTreeScope(scope);
+ return data;
}
TreeScope* Node::treeScope() const
@@ -459,54 +453,6 @@ TreeScope* Node::treeScope() const
return scope ? scope : m_document;
}
-void Node::setTreeScopeRecursively(TreeScope* newTreeScope)
-{
- ASSERT(this);
- ASSERT(!isDocumentNode());
- ASSERT(newTreeScope);
- ASSERT(!m_deletionHasBegun);
-
- TreeScope* currentTreeScope = treeScope();
- if (currentTreeScope == newTreeScope)
- return;
-
- Document* currentDocument = document();
- Document* newDocument = newTreeScope->document();
- // If an element is moved from a document and then eventually back again the collection cache for
- // that element may contain stale data as changes made to it will have updated the DOMTreeVersion
- // of the document it was moved to. By increasing the DOMTreeVersion of the donating document here
- // we ensure that the collection cache will be invalidated as needed when the element is moved back.
- if (currentDocument && currentDocument != newDocument)
- currentDocument->incDOMTreeVersion();
-
- for (Node* node = this; node; node = node->traverseNextNode(this)) {
- if (newTreeScope == newDocument) {
- if (node->hasRareData())
- node->rareData()->setTreeScope(0);
- // Setting the new document tree scope will be handled implicitly
- // by setDocument() below.
- } else
- node->ensureRareData()->setTreeScope(newTreeScope);
-
- if (node->hasRareData() && node->rareData()->nodeLists()) {
- node->rareData()->nodeLists()->invalidateCaches();
- if (currentTreeScope)
- currentTreeScope->removeNodeListCache();
- newTreeScope->addNodeListCache();
- }
-
- node->setDocument(newDocument);
-
- if (!node->isElementNode())
- continue;
- if (ShadowRoot* shadowRoot = toElement(node)->shadowRoot()) {
- shadowRoot->setParentTreeScope(newTreeScope);
- if (currentDocument != newDocument)
- shadowRoot->setDocumentRecursively(newDocument);
- }
- }
-}
-
NodeRareData* Node::rareData() const
{
ASSERT(hasRareData());
@@ -871,19 +817,6 @@ inline static ShadowRoot* shadowRoot(Node* node)
return node->isElementNode() ? toElement(node)->shadowRoot() : 0;
}
-void Node::setDocumentRecursively(Document* newDocument)
-{
- ASSERT(document() != newDocument);
-
- for (Node* node = this; node; node = node->traverseNextNode(this)) {
- node->setDocument(newDocument);
- if (!node->isElementNode())
- continue;
- if (ShadowRoot* shadow = shadowRoot(node))
- shadow->setDocumentRecursively(newDocument);
- }
-}
-
inline void Node::setStyleChange(StyleChangeType changeType)
{
m_nodeFlags = (m_nodeFlags & ~StyleChangeMask) | changeType;
@@ -1022,19 +955,73 @@ void Node::unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList* list)
removeNodeListCacheIfPossible(this, data);
}
-void Node::invalidateNodeListsCacheAfterAttributeChanged()
+void Node::invalidateNodeListsCacheAfterAttributeChanged(const QualifiedName& attrName)
{
if (hasRareData() && isAttributeNode()) {
NodeRareData* data = rareData();
ASSERT(!data->nodeLists());
data->clearChildNodeListCache();
}
+
+ // This list should be sync'ed with NodeListsNodeData.
+ if (attrName != classAttr
+#if ENABLE(MICRODATA)
+ && attrName != itemscopeAttr
+ && attrName != itempropAttr
+#endif
+ && attrName != nameAttr)
+ return;
+
+ if (!treeScope()->hasNodeListCaches())
+ return;
+
+ for (Node* node = this; node; node = node->parentNode()) {
+ ASSERT(this == node || !node->isAttributeNode());
+ if (!node->hasRareData())
+ continue;
+ NodeRareData* data = node->rareData();
+ if (!data->nodeLists())
+ continue;
+
+ data->nodeLists()->invalidateCachesThatDependOnAttributes();
+ removeNodeListCacheIfPossible(node, data);
+ }
}
void Node::invalidateNodeListsCacheAfterChildrenChanged()
{
if (hasRareData())
rareData()->clearChildNodeListCache();
+
+ if (!treeScope()->hasNodeListCaches())
+ return;
+ for (Node* node = this; node; node = node->parentNode()) {
+ if (!node->hasRareData())
+ continue;
+ NodeRareData* data = node->rareData();
+ if (!data->nodeLists())
+ continue;
+
+ data->nodeLists()->invalidateCaches();
+
+ NodeListsNodeData::NodeListSet::iterator end = data->nodeLists()->m_listsWithCaches.end();
+ for (NodeListsNodeData::NodeListSet::iterator it = data->nodeLists()->m_listsWithCaches.begin(); it != end; ++it)
+ (*it)->invalidateCache();
+
+ removeNodeListCacheIfPossible(node, data);
+ }
+}
+
+void Node::notifyLocalNodeListsLabelChanged()
+{
+ if (!hasRareData())
+ return;
+ NodeRareData* data = rareData();
+ if (!data->nodeLists())
+ return;
+
+ if (data->nodeLists()->m_labelsNodeListCache)
+ data->nodeLists()->m_labelsNodeListCache->invalidateCache();
}
void Node::removeCachedClassNodeList(ClassNodeList* list, const String& className)
@@ -2217,6 +2204,23 @@ FloatPoint Node::convertFromPage(const FloatPoint& p) const
return p;
}
+#if ENABLE(MICRODATA)
+void Node::itemTypeAttributeChanged()
+{
+ Node * rootNode = document();
+
+ if (!rootNode->hasRareData())
+ return;
+
+ NodeRareData* data = rootNode->rareData();
+
+ if (!data->nodeLists())
+ return;
+
+ data->nodeLists()->invalidateMicrodataItemListCaches();
+}
+#endif
+
#ifndef NDEBUG
static void appendAttributeDesc(const Node* node, String& string, const QualifiedName& name, const char* attrDesc)
@@ -2345,7 +2349,11 @@ void NodeListsNodeData::invalidateCaches()
TagNodeListCacheNS::const_iterator tagCacheNSEnd = m_tagNodeListCacheNS.end();
for (TagNodeListCacheNS::const_iterator it = m_tagNodeListCacheNS.begin(); it != tagCacheNSEnd; ++it)
it->second->invalidateCache();
+ invalidateCachesThatDependOnAttributes();
+}
+void NodeListsNodeData::invalidateCachesThatDependOnAttributes()
+{
ClassNodeListCache::iterator classCacheEnd = m_classNodeListCache.end();
for (ClassNodeListCache::iterator it = m_classNodeListCache.begin(); it != classCacheEnd; ++it)
it->second->invalidateCache();
@@ -2359,7 +2367,6 @@ void NodeListsNodeData::invalidateCaches()
#if ENABLE(MICRODATA)
invalidateMicrodataItemListCaches();
#endif
-
}
#if ENABLE(MICRODATA)
@@ -2435,12 +2442,7 @@ void Node::removedFromDocument()
void Node::didMoveToNewDocument(Document* oldDocument)
{
- ASSERT(!didMoveToNewDocumentWasCalled);
- ASSERT_UNUSED(oldDocument, oldDocument == oldDocumentDidMoveToNewDocumentWasCalledWith);
-
-#ifndef NDEBUG
- didMoveToNewDocumentWasCalled = true;
-#endif
+ TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(oldDocument);
// FIXME: Event listener types for this node should be set on the new owner document here.
diff --git a/Source/WebCore/dom/Node.h b/Source/WebCore/dom/Node.h
index 5733fff5d..9d6068b6e 100644
--- a/Source/WebCore/dom/Node.h
+++ b/Source/WebCore/dom/Node.h
@@ -105,6 +105,7 @@ enum StyleChangeType {
class Node : public EventTarget, public ScriptWrappable, public TreeShared<ContainerNode> {
friend class Document;
friend class TreeScope;
+ friend class TreeScopeAdopter;
public:
enum NodeType {
@@ -407,9 +408,6 @@ public:
TreeScope* treeScope() const;
- // Used by the basic DOM methods (e.g., appendChild()).
- void setTreeScopeRecursively(TreeScope*);
-
// Returns true if this node is associated with a document and is in its associated document's
// node tree, false otherwise.
bool inDocument() const
@@ -545,8 +543,9 @@ public:
void registerDynamicSubtreeNodeList(DynamicSubtreeNodeList*);
void unregisterDynamicSubtreeNodeList(DynamicSubtreeNodeList*);
- void invalidateNodeListsCacheAfterAttributeChanged();
+ void invalidateNodeListsCacheAfterAttributeChanged(const QualifiedName&);
void invalidateNodeListsCacheAfterChildrenChanged();
+ void notifyLocalNodeListsLabelChanged();
void removeCachedClassNodeList(ClassNodeList*, const String&);
void removeCachedNameNodeList(NameNodeList*, const String&);
@@ -614,6 +613,8 @@ public:
virtual EventTargetData* ensureEventTargetData();
#if ENABLE(MICRODATA)
+ void itemTypeAttributeChanged();
+
DOMSettableTokenList* itemProp();
DOMSettableTokenList* itemRef();
DOMSettableTokenList* itemType();
@@ -719,9 +720,9 @@ protected:
void clearHasCustomStyleForRenderer() { clearFlag(HasCustomStyleForRendererFlag); }
private:
- // Do not use this method to change the document of a node until after the node has been
- // removed from its previous document.
- void setDocumentRecursively(Document*);
+ // These API should be only used for a tree scope migration.
+ // setTreeScope() returns NodeRareData to save extra nodeRareData() invocations on the caller site.
+ NodeRareData* setTreeScope(TreeScope*);
void setDocument(Document*);
enum EditableLevel { Editable, RichlyEditable };
diff --git a/Source/WebCore/dom/NodeRareData.h b/Source/WebCore/dom/NodeRareData.h
index 2249e526b..362135c99 100644
--- a/Source/WebCore/dom/NodeRareData.h
+++ b/Source/WebCore/dom/NodeRareData.h
@@ -78,6 +78,7 @@ public:
}
void invalidateCaches();
+ void invalidateCachesThatDependOnAttributes();
#if ENABLE(MICRODATA)
void invalidateMicrodataItemListCaches();
@@ -221,7 +222,7 @@ public:
HTMLPropertiesCollection* properties(Node* node)
{
if (!m_properties)
- m_properties = HTMLPropertiesCollection::create(node);
+ m_properties = adoptPtr(HTMLPropertiesCollection::create(node));
return m_properties.get();
}
@@ -256,7 +257,7 @@ private:
mutable RefPtr<DOMSettableTokenList> m_itemProp;
mutable RefPtr<DOMSettableTokenList> m_itemRef;
mutable RefPtr<DOMSettableTokenList> m_itemType;
- mutable RefPtr<HTMLPropertiesCollection> m_properties;
+ mutable OwnPtr<HTMLPropertiesCollection> m_properties;
#endif
};
diff --git a/Source/WebCore/dom/NodeRenderingContext.cpp b/Source/WebCore/dom/NodeRenderingContext.cpp
index 96529fb86..ef85f7d23 100644
--- a/Source/WebCore/dom/NodeRenderingContext.cpp
+++ b/Source/WebCore/dom/NodeRenderingContext.cpp
@@ -36,6 +36,10 @@
#include "ShadowInclusionSelector.h"
#include "ShadowRoot.h"
+#if ENABLE(SVG)
+#include "SVGNames.h"
+#endif
+
namespace WebCore {
NodeRenderingContext::NodeRenderingContext(Node* node)
@@ -277,6 +281,13 @@ void NodeRenderingContext::moveToFlowThreadIfNeeded()
if (!m_node->isElementNode() || !m_style || m_style->flowThread().isEmpty())
return;
+#if ENABLE(SVG)
+ // Allow only svg root elements to be directly collected by a render flow thread.
+ if (m_node->isSVGElement()
+ && (!(m_node->hasTagName(SVGNames::svgTag) && m_node->parentNode() && !m_node->parentNode()->isSVGElement())))
+ return;
+#endif
+
m_flowThread = m_style->flowThread();
ASSERT(m_node->document()->renderView());
m_parentFlowRenderer = m_node->document()->renderView()->ensureRenderFlowThreadWithName(m_flowThread);
diff --git a/Source/WebCore/dom/TreeScope.cpp b/Source/WebCore/dom/TreeScope.cpp
index 35bad51ce..91f3c295b 100644
--- a/Source/WebCore/dom/TreeScope.cpp
+++ b/Source/WebCore/dom/TreeScope.cpp
@@ -31,6 +31,7 @@
#include "HTMLMapElement.h"
#include "HTMLNames.h"
#include "NodeRareData.h"
+#include "TreeScopeAdopter.h"
namespace WebCore {
@@ -137,5 +138,16 @@ bool TreeScope::applyAuthorSheets() const
return true;
}
+void TreeScope::adoptIfNeeded(Node* node)
+{
+ ASSERT(this);
+ ASSERT(node);
+ ASSERT(!node->isDocumentNode());
+ ASSERT(!node->m_deletionHasBegun);
+ TreeScopeAdopter adopter(node, this);
+ if (adopter.needsScopeChange())
+ adopter.execute();
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/dom/TreeScope.h b/Source/WebCore/dom/TreeScope.h
index cbe3ee07a..fd6c3cb8d 100644
--- a/Source/WebCore/dom/TreeScope.h
+++ b/Source/WebCore/dom/TreeScope.h
@@ -64,6 +64,9 @@ public:
virtual bool applyAuthorSheets() const;
+ // Used by the basic DOM mutation methods (e.g., appendChild()).
+ void adoptIfNeeded(Node*);
+
protected:
TreeScope(Document*, ConstructionType = CreateContainer);
virtual ~TreeScope();
diff --git a/Source/WebCore/dom/TreeScopeAdopter.cpp b/Source/WebCore/dom/TreeScopeAdopter.cpp
new file mode 100644
index 000000000..ab117923e
--- /dev/null
+++ b/Source/WebCore/dom/TreeScopeAdopter.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * (C) 2001 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+#include "config.h"
+#include "TreeScopeAdopter.h"
+
+#include "Document.h"
+#include "NodeRareData.h"
+#include "ShadowRoot.h"
+
+namespace WebCore {
+
+static inline ShadowRoot* shadowRootFor(Node* node)
+{
+ return node->isElementNode() ? toElement(node)->shadowRoot() : 0;
+}
+
+void TreeScopeAdopter::moveTreeToNewScope(Node* root) const
+{
+ ASSERT(needsScopeChange());
+
+ // If an element is moved from a document and then eventually back again the collection cache for
+ // that element may contain stale data as changes made to it will have updated the DOMTreeVersion
+ // of the document it was moved to. By increasing the DOMTreeVersion of the donating document here
+ // we ensure that the collection cache will be invalidated as needed when the element is moved back.
+ Document* oldDocument = m_oldScope ? m_oldScope->document() : 0;
+ Document* newDocument = m_newScope->document();
+ bool willMoveToNewDocument = oldDocument != newDocument;
+ if (oldDocument && willMoveToNewDocument)
+ oldDocument->incDOMTreeVersion();
+
+ for (Node* node = root; node; node = node->traverseNextNode(root)) {
+ NodeRareData* rareData = node->setTreeScope(newDocument == m_newScope ? 0 : m_newScope);
+ if (rareData && rareData->nodeLists()) {
+ rareData->nodeLists()->invalidateCaches();
+ if (m_oldScope)
+ m_oldScope->removeNodeListCache();
+ m_newScope->addNodeListCache();
+ }
+
+ if (willMoveToNewDocument)
+ moveNodeToNewDocument(node, oldDocument, newDocument);
+
+ if (ShadowRoot* shadow = shadowRootFor(node)) {
+ shadow->setParentTreeScope(m_newScope);
+ if (willMoveToNewDocument)
+ moveTreeToNewDocument(shadow, oldDocument, newDocument);
+ }
+ }
+}
+
+void TreeScopeAdopter::moveTreeToNewDocument(Node* root, Document* oldDocument, Document* newDocument) const
+{
+ for (Node* node = root; node; node = node->traverseNextNode(root)) {
+ moveNodeToNewDocument(node, oldDocument, newDocument);
+ if (ShadowRoot* shadow = shadowRootFor(node))
+ moveTreeToNewDocument(shadow, oldDocument, newDocument);
+ }
+}
+
+#ifndef NDEBUG
+static bool didMoveToNewDocumentWasCalled = false;
+static Document* oldDocumentDidMoveToNewDocumentWasCalledWith = 0;
+
+void TreeScopeAdopter::ensureDidMoveToNewDocumentWasCalled(Document* oldDocument)
+{
+ ASSERT(!didMoveToNewDocumentWasCalled);
+ ASSERT_UNUSED(oldDocument, oldDocument == oldDocumentDidMoveToNewDocumentWasCalledWith);
+ didMoveToNewDocumentWasCalled = true;
+}
+#endif
+
+inline void TreeScopeAdopter::moveNodeToNewDocument(Node* node, Document* oldDocument, Document* newDocument) const
+{
+ ASSERT(!node->inDocument() || oldDocument != newDocument);
+
+ newDocument->guardRef();
+ if (oldDocument) {
+ oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
+ oldDocument->guardDeref();
+ }
+
+ node->setDocument(newDocument);
+
+#ifndef NDEBUG
+ didMoveToNewDocumentWasCalled = false;
+ oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument;
+#endif
+
+ node->didMoveToNewDocument(oldDocument);
+ ASSERT(didMoveToNewDocumentWasCalled);
+}
+
+}
diff --git a/Source/WebCore/dom/TreeScopeAdopter.h b/Source/WebCore/dom/TreeScopeAdopter.h
new file mode 100644
index 000000000..d2bd4d4f0
--- /dev/null
+++ b/Source/WebCore/dom/TreeScopeAdopter.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * (C) 2001 Dirk Mueller (mueller@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2011 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 TreeScopeAdopter_h
+#define TreeScopeAdopter_h
+
+#include "Element.h"
+
+namespace WebCore {
+
+class TreeScopeAdopter {
+public:
+ explicit TreeScopeAdopter(Node* toAdopt, TreeScope* newScope);
+
+ void execute() const { moveTreeToNewScope(m_toAdopt); }
+ bool needsScopeChange() const { return m_oldScope != m_newScope; }
+
+#ifdef NDEBUG
+ static void ensureDidMoveToNewDocumentWasCalled(Document*) { }
+#else
+ static void ensureDidMoveToNewDocumentWasCalled(Document*);
+#endif
+
+private:
+ void moveTreeToNewScope(Node*) const;
+ void moveTreeToNewDocument(Node*, Document* oldDocument, Document* newDocument) const;
+ void moveNodeToNewDocument(Node*, Document* oldDocument, Document* newDocument) const;
+
+ Node* m_toAdopt;
+ TreeScope* m_newScope;
+ TreeScope* m_oldScope;
+};
+
+inline TreeScopeAdopter::TreeScopeAdopter(Node* toAdopt, TreeScope* newScope)
+ : m_toAdopt(toAdopt)
+ , m_newScope(newScope)
+ , m_oldScope(toAdopt->treeScope())
+{
+ ASSERT(newScope);
+}
+
+}
+
+#endif
diff --git a/Source/WebCore/editing/gtk/FrameSelectionGtk.cpp b/Source/WebCore/editing/gtk/FrameSelectionGtk.cpp
index a327e0699..a63787023 100644
--- a/Source/WebCore/editing/gtk/FrameSelectionGtk.cpp
+++ b/Source/WebCore/editing/gtk/FrameSelectionGtk.cpp
@@ -80,20 +80,17 @@ void FrameSelection::notifyAccessibilityForSelectionChange()
if (!AXObjectCache::accessibilityEnabled())
return;
- // Reset lastFocuseNode and return for no valid selections.
+ // Return for no valid selections.
if (!m_selection.start().isNotNull() || !m_selection.end().isNotNull())
return;
- RenderObject* focusedNode = m_selection.end().deprecatedNode()->renderer();
- AccessibilityObject* accessibilityObject = m_frame->document()->axObjectCache()->getOrCreate(focusedNode);
-
- // Need to check this as getOrCreate could return 0,
+ // Look for the accessibility object for the Frame.
+ AccessibilityObject* accessibilityObject = m_frame->document()->axObjectCache()->rootObjectForFrame(m_frame);
if (!accessibilityObject)
return;
int offset;
- // Always report the events w.r.t. the non-linked unignored parent. (i.e. ignoreLinks == true).
- RefPtr<AccessibilityObject> object = objectAndOffsetUnignored(accessibilityObject, offset, true);
+ RefPtr<AccessibilityObject> object = objectFocusedAndCaretOffsetUnignored(accessibilityObject, offset);
if (!object)
return;
diff --git a/Source/WebCore/editing/visible_units.cpp b/Source/WebCore/editing/visible_units.cpp
index 338127801..509fa1d19 100644
--- a/Source/WebCore/editing/visible_units.cpp
+++ b/Source/WebCore/editing/visible_units.cpp
@@ -88,7 +88,7 @@ static VisiblePosition previousBoundary(const VisiblePosition& c, BoundarySearch
searchRange->setStart(start.deprecatedNode(), start.deprecatedEditingOffset(), ec);
searchRange->setEnd(end.deprecatedNode(), end.deprecatedEditingOffset(), ec);
-
+
ASSERT(!ec);
if (ec)
return VisiblePosition();
diff --git a/Source/WebCore/html/FormAssociatedElement.cpp b/Source/WebCore/html/FormAssociatedElement.cpp
index feb1d0d7a..d2f3f4abc 100644
--- a/Source/WebCore/html/FormAssociatedElement.cpp
+++ b/Source/WebCore/html/FormAssociatedElement.cpp
@@ -35,13 +35,14 @@ namespace WebCore {
using namespace HTMLNames;
-FormAssociatedElement::FormAssociatedElement(HTMLFormElement* form)
- : m_form(form)
+FormAssociatedElement::FormAssociatedElement()
+ : m_form(0)
{
}
FormAssociatedElement::~FormAssociatedElement()
{
+ setForm(0);
}
ValidityState* FormAssociatedElement::validity()
@@ -76,19 +77,13 @@ void FormAssociatedElement::removedFromDocument()
void FormAssociatedElement::insertedIntoTree()
{
HTMLElement* element = toHTMLElement(this);
- if (element->fastHasAttribute(formAttr)) {
- // Resets the form owner at first to make sure the element don't
- // associate any form elements when there is no element which has
- // the given ID.
- if (m_form) {
- m_form->removeFormElement(this);
- m_form = 0;
- }
- Element* formElement = element->treeScope()->getElementById(element->fastGetAttribute(formAttr));
- if (formElement && formElement->hasTagName(formTag)) {
- m_form = static_cast<HTMLFormElement*>(formElement);
- m_form->registerFormElement(this);
- }
+ const AtomicString& formId = element->fastGetAttribute(formAttr);
+ if (!formId.isNull()) {
+ HTMLFormElement* newForm = 0;
+ Element* newFormCandidate = element->treeScope()->getElementById(formId);
+ if (newFormCandidate && newFormCandidate->hasTagName(formTag))
+ newForm = static_cast<HTMLFormElement*>(newFormCandidate);
+ setForm(newForm);
return;
}
if (!m_form) {
@@ -96,9 +91,7 @@ void FormAssociatedElement::insertedIntoTree()
// JavaScript and inserted inside a form. In the case of the parser
// setting a form, we will already have a non-null value for m_form,
// and so we don't need to do anything.
- m_form = element->findFormAncestor();
- if (m_form)
- m_form->registerFormElement(this);
+ setForm(element->findFormAncestor());
}
}
@@ -117,15 +110,38 @@ void FormAssociatedElement::removedFromTree()
// If the form and element are both in the same tree, preserve the connection to the form.
// Otherwise, null out our form and remove ourselves from the form's list of elements.
if (m_form && findRoot(element) != findRoot(m_form))
- removeFromForm();
+ setForm(0);
}
-void FormAssociatedElement::removeFromForm()
+void FormAssociatedElement::setForm(HTMLFormElement* newForm)
{
+ if (m_form == newForm)
+ return;
+ willChangeForm();
+ if (m_form)
+ m_form->removeFormElement(this);
+ m_form = newForm;
+ if (m_form)
+ m_form->registerFormElement(this);
+ didChangeForm();
+}
+
+void FormAssociatedElement::willChangeForm()
+{
+}
+
+void FormAssociatedElement::didChangeForm()
+{
+}
+
+void FormAssociatedElement::formWillBeDestroyed()
+{
+ ASSERT(m_form);
if (!m_form)
return;
- m_form->removeFormElement(this);
+ willChangeForm();
m_form = 0;
+ didChangeForm();
}
void FormAssociatedElement::resetFormOwner()
@@ -135,9 +151,8 @@ void FormAssociatedElement::resetFormOwner()
if (m_form) {
if (formId.isNull())
return;
- m_form->removeFormElement(this);
}
- m_form = 0;
+ HTMLFormElement* newForm = 0;
if (!formId.isNull() && element->inDocument()) {
// The HTML5 spec says that the element should be associated with
// the first element in the document to have an ID that equal to
@@ -145,11 +160,10 @@ void FormAssociatedElement::resetFormOwner()
// treeScope()->getElementById() over the given element.
Element* firstElement = element->treeScope()->getElementById(formId);
if (firstElement && firstElement->hasTagName(formTag))
- m_form = static_cast<HTMLFormElement*>(firstElement);
+ newForm = static_cast<HTMLFormElement*>(firstElement);
} else
- m_form = element->findFormAncestor();
- if (m_form)
- m_form->registerFormElement(this);
+ newForm = element->findFormAncestor();
+ setForm(newForm);
}
void FormAssociatedElement::formAttributeChanged()
@@ -157,11 +171,7 @@ void FormAssociatedElement::formAttributeChanged()
HTMLElement* element = toHTMLElement(this);
if (!element->fastHasAttribute(formAttr)) {
// The form attribute removed. We need to reset form owner here.
- if (m_form)
- m_form->removeFormElement(this);
- m_form = element->findFormAncestor();
- if (m_form)
- form()->registerFormElement(this);
+ setForm(element->findFormAncestor());
element->document()->unregisterFormElementWithFormAttribute(this);
} else
resetFormOwner();
diff --git a/Source/WebCore/html/FormAssociatedElement.h b/Source/WebCore/html/FormAssociatedElement.h
index 1a8e1657e..b336f373c 100644
--- a/Source/WebCore/html/FormAssociatedElement.h
+++ b/Source/WebCore/html/FormAssociatedElement.h
@@ -53,12 +53,12 @@ public:
// Return true for a successful control (see HTML4-17.13.2).
virtual bool appendFormData(FormDataList&, bool) { return false; }
- virtual void formDestroyed() { m_form = 0; }
+ void formWillBeDestroyed();
void resetFormOwner();
protected:
- FormAssociatedElement(HTMLFormElement*);
+ FormAssociatedElement();
void insertedIntoTree();
void removedFromTree();
@@ -66,10 +66,15 @@ protected:
void removedFromDocument();
void didMoveToNewDocument(Document* oldDocument);
- void setForm(HTMLFormElement* form) { m_form = form; }
- void removeFromForm();
+ void setForm(HTMLFormElement*);
void formAttributeChanged();
+ // If you add an override of willChangeForm() or didChangeForm() to a class
+ // derived from this one, you will need to add a call to setForm(0) to the
+ // destructor of that class.
+ virtual void willChangeForm();
+ virtual void didChangeForm();
+
private:
virtual const AtomicString& formControlName() const = 0;
diff --git a/Source/WebCore/html/HTMLAllCollection.cpp b/Source/WebCore/html/HTMLAllCollection.cpp
index 3dc07a388..ea7ae9763 100644
--- a/Source/WebCore/html/HTMLAllCollection.cpp
+++ b/Source/WebCore/html/HTMLAllCollection.cpp
@@ -30,9 +30,9 @@
namespace WebCore {
-PassRefPtr<HTMLAllCollection> HTMLAllCollection::create(Document* document)
+PassOwnPtr<HTMLAllCollection> HTMLAllCollection::create(Document* document)
{
- return adoptRef(new HTMLAllCollection(document));
+ return adoptPtr(new HTMLAllCollection(document));
}
HTMLAllCollection::HTMLAllCollection(Document* document)
@@ -46,9 +46,6 @@ HTMLAllCollection::~HTMLAllCollection()
Node* HTMLAllCollection::namedItemWithIndex(const AtomicString& name, unsigned index) const
{
- if (!base())
- return 0;
-
invalidateCacheIfNeeded();
updateNameCache();
diff --git a/Source/WebCore/html/HTMLAllCollection.h b/Source/WebCore/html/HTMLAllCollection.h
index ae97a53ac..d636bbd01 100644
--- a/Source/WebCore/html/HTMLAllCollection.h
+++ b/Source/WebCore/html/HTMLAllCollection.h
@@ -32,7 +32,7 @@ namespace WebCore {
class HTMLAllCollection : public HTMLCollection {
public:
- static PassRefPtr<HTMLAllCollection> create(Document*);
+ static PassOwnPtr<HTMLAllCollection> create(Document*);
virtual ~HTMLAllCollection();
Node* namedItemWithIndex(const AtomicString& name, unsigned index) const;
diff --git a/Source/WebCore/html/HTMLCanvasElement.cpp b/Source/WebCore/html/HTMLCanvasElement.cpp
index ca993e31c..681fb93ca 100644
--- a/Source/WebCore/html/HTMLCanvasElement.cpp
+++ b/Source/WebCore/html/HTMLCanvasElement.cpp
@@ -423,13 +423,13 @@ bool HTMLCanvasElement::shouldAccelerate(const IntSize& size) const
{
#if USE(IOSURFACE_CANVAS_BACKING_STORE)
UNUSED_PARAM(size);
- return document()->settings()->canvasUsesAcceleratedDrawing();
+ return document()->settings() && document()->settings()->canvasUsesAcceleratedDrawing();
#elif ENABLE(ACCELERATED_2D_CANVAS)
if (m_context && !m_context->is2d())
return false;
Settings* settings = document()->settings();
- if (!settings->accelerated2dCanvasEnabled())
+ if (!settings || !settings->accelerated2dCanvasEnabled())
return false;
// Do not use acceleration for small canvas.
@@ -465,7 +465,12 @@ void HTMLCanvasElement::createImageBuffer() const
if (!bufferSize.width() || !bufferSize.height())
return;
- RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated : Unaccelerated;
+ RenderingMode renderingMode = shouldAccelerate(bufferSize) ? Accelerated :
+#if USE(SKIA)
+ UnacceleratedNonPlatformBuffer;
+#else
+ Unaccelerated;
+#endif
m_imageBuffer = ImageBuffer::create(bufferSize, ColorSpaceDeviceRGB, renderingMode);
if (!m_imageBuffer)
return;
diff --git a/Source/WebCore/html/HTMLCollection.cpp b/Source/WebCore/html/HTMLCollection.cpp
index 0803fe9cc..e6f2eac0a 100644
--- a/Source/WebCore/html/HTMLCollection.cpp
+++ b/Source/WebCore/html/HTMLCollection.cpp
@@ -41,6 +41,7 @@ HTMLCollection::HTMLCollection(Node* base, CollectionType type)
, m_type(type)
, m_base(base)
{
+ ASSERT(m_base);
m_cache.clear();
}
@@ -76,24 +77,17 @@ bool HTMLCollection::shouldIncludeChildren(CollectionType type)
return false;
}
-PassRefPtr<HTMLCollection> HTMLCollection::create(Node* base, CollectionType type)
+PassOwnPtr<HTMLCollection> HTMLCollection::create(Node* base, CollectionType type)
{
- return adoptRef(new HTMLCollection(base, type));
+ return adoptPtr(new HTMLCollection(base, type));
}
HTMLCollection::~HTMLCollection()
{
}
-void HTMLCollection::detachFromNode()
-{
- m_base = 0;
-}
-
void HTMLCollection::invalidateCacheIfNeeded() const
{
- ASSERT(m_base);
-
uint64_t docversion = static_cast<HTMLDocument*>(m_base->document())->domTreeVersion();
if (m_cache.version == docversion)
@@ -161,8 +155,6 @@ static Node* nextNodeOrSibling(Node* base, Node* node, bool includeChildren)
Element* HTMLCollection::itemAfter(Element* previous) const
{
- ASSERT(m_base);
-
Node* current;
if (!previous)
current = m_base->firstChild();
@@ -182,8 +174,6 @@ Element* HTMLCollection::itemAfter(Element* previous) const
unsigned HTMLCollection::calcLength() const
{
- ASSERT(m_base);
-
unsigned len = 0;
for (Element* current = itemAfter(0); current; current = itemAfter(current))
++len;
@@ -194,9 +184,6 @@ unsigned HTMLCollection::calcLength() const
// calculation every time if anything has changed
unsigned HTMLCollection::length() const
{
- if (!m_base)
- return 0;
-
invalidateCacheIfNeeded();
if (!m_cache.hasLength) {
m_cache.length = calcLength();
@@ -207,9 +194,6 @@ unsigned HTMLCollection::length() const
Node* HTMLCollection::item(unsigned index) const
{
- if (!m_base)
- return 0;
-
invalidateCacheIfNeeded();
if (m_cache.current && m_cache.position == index)
return m_cache.current;
@@ -236,7 +220,6 @@ Node* HTMLCollection::firstItem() const
Node* HTMLCollection::nextItem() const
{
- ASSERT(m_base);
invalidateCacheIfNeeded();
// Look for the 'second' item. The first one is currentItem, already given back.
@@ -276,9 +259,6 @@ bool HTMLCollection::checkForNameMatch(Element* element, bool checkName, const A
Node* HTMLCollection::namedItem(const AtomicString& name) const
{
- if (!m_base)
- return 0;
-
// http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/nameditem.asp
// This method first searches for an object with a matching id
// attribute. If a match is not found, the method then searches for an
@@ -306,8 +286,6 @@ Node* HTMLCollection::namedItem(const AtomicString& name) const
void HTMLCollection::updateNameCache() const
{
- ASSERT(m_base);
-
if (m_cache.hasNameCache)
return;
@@ -328,9 +306,6 @@ void HTMLCollection::updateNameCache() const
bool HTMLCollection::hasNamedItem(const AtomicString& name) const
{
- if (!m_base)
- return false;
-
if (name.isEmpty())
return false;
@@ -352,9 +327,6 @@ bool HTMLCollection::hasNamedItem(const AtomicString& name) const
void HTMLCollection::namedItems(const AtomicString& name, Vector<RefPtr<Node> >& result) const
{
- if (!m_base)
- return;
-
ASSERT(result.isEmpty());
if (name.isEmpty())
return;
@@ -374,9 +346,6 @@ void HTMLCollection::namedItems(const AtomicString& name, Vector<RefPtr<Node> >&
PassRefPtr<NodeList> HTMLCollection::tags(const String& name)
{
- if (!m_base)
- return 0;
-
return m_base->getElementsByTagName(name);
}
diff --git a/Source/WebCore/html/HTMLCollection.h b/Source/WebCore/html/HTMLCollection.h
index 76bc24102..fa3ff1ead 100644
--- a/Source/WebCore/html/HTMLCollection.h
+++ b/Source/WebCore/html/HTMLCollection.h
@@ -23,26 +23,29 @@
#ifndef HTMLCollection_h
#define HTMLCollection_h
+#include "Node.h"
#include "CollectionType.h"
-#include <wtf/RefCounted.h>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class Document;
class Element;
-class Node;
class NodeList;
-class HTMLCollection : public RefCounted<HTMLCollection> {
+class HTMLCollection {
public:
- static PassRefPtr<HTMLCollection> create(Node* base, CollectionType);
+ static PassOwnPtr<HTMLCollection> create(Node* base, CollectionType);
virtual ~HTMLCollection();
+ void ref() { m_base->ref(); }
+ void deref() { m_base->deref(); }
+
unsigned length() const;
-
+
virtual Node* item(unsigned index) const;
virtual Node* nextItem() const;
@@ -58,8 +61,6 @@ public:
Node* base() const { return m_base; }
CollectionType type() const { return static_cast<CollectionType>(m_type); }
- void detachFromNode();
-
protected:
HTMLCollection(Node* base, CollectionType);
diff --git a/Source/WebCore/html/HTMLDataListElement.cpp b/Source/WebCore/html/HTMLDataListElement.cpp
index 964d3422a..f6cc7da33 100644
--- a/Source/WebCore/html/HTMLDataListElement.cpp
+++ b/Source/WebCore/html/HTMLDataListElement.cpp
@@ -47,7 +47,7 @@ PassRefPtr<HTMLDataListElement> HTMLDataListElement::create(const QualifiedName&
return adoptRef(new HTMLDataListElement(tagName, document));
}
-PassRefPtr<HTMLCollection> HTMLDataListElement::options()
+HTMLCollection* HTMLDataListElement::options()
{
return ensureCachedHTMLCollection(DataListOptions);
}
diff --git a/Source/WebCore/html/HTMLDataListElement.h b/Source/WebCore/html/HTMLDataListElement.h
index 97e608f5a..64bfc89dd 100644
--- a/Source/WebCore/html/HTMLDataListElement.h
+++ b/Source/WebCore/html/HTMLDataListElement.h
@@ -43,7 +43,7 @@ class HTMLDataListElement : public HTMLElement {
public:
static PassRefPtr<HTMLDataListElement> create(const QualifiedName&, Document*);
- PassRefPtr<HTMLCollection> options();
+ HTMLCollection* options();
private:
HTMLDataListElement(const QualifiedName&, Document*);
diff --git a/Source/WebCore/html/HTMLElement.cpp b/Source/WebCore/html/HTMLElement.cpp
index 573d581d4..a78f4d057 100644
--- a/Source/WebCore/html/HTMLElement.cpp
+++ b/Source/WebCore/html/HTMLElement.cpp
@@ -237,6 +237,7 @@ void HTMLElement::parseMappedAttribute(Attribute* attr)
setItemRef(attr->value());
} else if (attr->name() == itemtypeAttr) {
setItemType(attr->value());
+ itemTypeAttributeChanged();
#endif
}
// standard events
@@ -642,7 +643,7 @@ static Element* contextElementForInsertion(const String& where, Element* element
{
if (equalIgnoringCase(where, "beforeBegin") || equalIgnoringCase(where, "afterEnd")) {
ContainerNode* parent = element->parentNode();
- if (parent && parent->isDocumentNode()) {
+ if (parent && !parent->isElementNode()) {
ec = NO_MODIFICATION_ALLOWED_ERR;
return 0;
}
@@ -824,7 +825,7 @@ void HTMLElement::setTabIndex(int value)
setAttribute(tabindexAttr, String::number(value));
}
-PassRefPtr<HTMLCollection> HTMLElement::children()
+HTMLCollection* HTMLElement::children()
{
return ensureCachedHTMLCollection(NodeChildren);
}
diff --git a/Source/WebCore/html/HTMLElement.h b/Source/WebCore/html/HTMLElement.h
index b98b2ddc4..a86b2b917 100644
--- a/Source/WebCore/html/HTMLElement.h
+++ b/Source/WebCore/html/HTMLElement.h
@@ -39,8 +39,8 @@ class HTMLElement : public StyledElement {
public:
static PassRefPtr<HTMLElement> create(const QualifiedName& tagName, Document*);
- PassRefPtr<HTMLCollection> children();
-
+ HTMLCollection* children();
+
virtual String title() const;
virtual short tabIndex() const;
diff --git a/Source/WebCore/html/HTMLFormCollection.cpp b/Source/WebCore/html/HTMLFormCollection.cpp
index 6b19d446e..d25653fe8 100644
--- a/Source/WebCore/html/HTMLFormCollection.cpp
+++ b/Source/WebCore/html/HTMLFormCollection.cpp
@@ -40,9 +40,9 @@ HTMLFormCollection::HTMLFormCollection(HTMLFormElement* form)
{
}
-PassRefPtr<HTMLFormCollection> HTMLFormCollection::create(HTMLFormElement* form)
+PassOwnPtr<HTMLFormCollection> HTMLFormCollection::create(HTMLFormElement* form)
{
- return adoptRef(new HTMLFormCollection(form));
+ return adoptPtr(new HTMLFormCollection(form));
}
HTMLFormCollection::~HTMLFormCollection()
@@ -51,15 +51,11 @@ HTMLFormCollection::~HTMLFormCollection()
unsigned HTMLFormCollection::calcLength() const
{
- ASSERT(base());
return static_cast<HTMLFormElement*>(base())->length();
}
Node* HTMLFormCollection::item(unsigned index) const
{
- if (!base())
- return 0;
-
invalidateCacheIfNeeded();
if (m_cache.current && m_cache.position == index)
@@ -96,9 +92,6 @@ Node* HTMLFormCollection::item(unsigned index) const
Element* HTMLFormCollection::getNamedItem(const QualifiedName& attrName, const AtomicString& name) const
{
- if (!base())
- return 0;
-
m_cache.position = 0;
return getNamedFormItem(attrName, name, 0);
}
@@ -143,9 +136,6 @@ Node* HTMLFormCollection::nextItem() const
Node* HTMLFormCollection::namedItem(const AtomicString& name) const
{
- if (!base())
- return 0;
-
// http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/nameditem.asp
// This method first searches for an object with a matching id
// attribute. If a match is not found, the method then searches for an
@@ -161,9 +151,6 @@ Node* HTMLFormCollection::namedItem(const AtomicString& name) const
void HTMLFormCollection::updateNameCache() const
{
- if (!base())
- return;
-
if (m_cache.hasNameCache)
return;
diff --git a/Source/WebCore/html/HTMLFormCollection.h b/Source/WebCore/html/HTMLFormCollection.h
index 7d2963820..60c6d2b48 100644
--- a/Source/WebCore/html/HTMLFormCollection.h
+++ b/Source/WebCore/html/HTMLFormCollection.h
@@ -35,7 +35,7 @@ class QualifiedName;
class HTMLFormCollection : public HTMLCollection {
public:
- static PassRefPtr<HTMLFormCollection> create(HTMLFormElement*);
+ static PassOwnPtr<HTMLFormCollection> create(HTMLFormElement*);
virtual ~HTMLFormCollection();
diff --git a/Source/WebCore/html/HTMLFormControlElement.cpp b/Source/WebCore/html/HTMLFormControlElement.cpp
index 71a44844b..b13b25676 100644
--- a/Source/WebCore/html/HTMLFormControlElement.cpp
+++ b/Source/WebCore/html/HTMLFormControlElement.cpp
@@ -50,7 +50,6 @@ using namespace std;
HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
: HTMLElement(tagName, document)
- , FormAssociatedElement(form)
, m_disabled(false)
, m_readOnly(false)
, m_required(false)
@@ -61,18 +60,12 @@ HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Doc
, m_wasChangedSinceLastFormControlChangeEvent(false)
, m_hasAutofocused(false)
{
- if (!this->form())
- setForm(findFormAncestor());
- if (this->form())
- this->form()->registerFormElement(this);
-
+ setForm(form ? form : findFormAncestor());
setHasCustomWillOrDidRecalcStyle();
}
HTMLFormControlElement::~HTMLFormControlElement()
{
- if (form())
- form()->removeFormElement(this);
}
void HTMLFormControlElement::detach()
@@ -108,11 +101,9 @@ bool HTMLFormControlElement::formNoValidate() const
void HTMLFormControlElement::parseMappedAttribute(Attribute* attr)
{
- if (attr->name() == formAttr) {
+ if (attr->name() == formAttr)
formAttributeChanged();
- if (!form())
- document()->checkedRadioButtons().addButton(this);
- } else if (attr->name() == disabledAttr) {
+ else if (attr->name() == disabledAttr) {
bool oldDisabled = m_disabled;
m_disabled = !attr->isNull();
if (oldDisabled != m_disabled) {
@@ -205,9 +196,6 @@ void HTMLFormControlElement::didMoveToNewDocument(Document* oldDocument)
void HTMLFormControlElement::insertedIntoTree(bool deep)
{
FormAssociatedElement::insertedIntoTree();
- if (!form())
- document()->checkedRadioButtons().addButton(this);
-
HTMLElement::insertedIntoTree(deep);
}
diff --git a/Source/WebCore/html/HTMLFormElement.cpp b/Source/WebCore/html/HTMLFormElement.cpp
index dab47efff..92b684a4e 100644
--- a/Source/WebCore/html/HTMLFormElement.cpp
+++ b/Source/WebCore/html/HTMLFormElement.cpp
@@ -91,14 +91,11 @@ PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName
HTMLFormElement::~HTMLFormElement()
{
- if (m_elementsCollection)
- m_elementsCollection->detachFromNode();
-
if (!shouldAutocomplete())
document()->unregisterForPageCacheSuspensionCallbacks(this);
for (unsigned i = 0; i < m_associatedElements.size(); ++i)
- m_associatedElements[i]->formDestroyed();
+ m_associatedElements[i]->formWillBeDestroyed();
for (unsigned i = 0; i < m_imageElements.size(); ++i)
m_imageElements[i]->m_form = 0;
}
@@ -459,18 +456,11 @@ unsigned HTMLFormElement::formElementIndex(FormAssociatedElement* associatedElem
void HTMLFormElement::registerFormElement(FormAssociatedElement* e)
{
- if (e->isFormControlElement()) {
- HTMLFormControlElement* element = static_cast<HTMLFormControlElement*>(e);
- document()->checkedRadioButtons().removeButton(element);
- m_checkedRadioButtons.addButton(element);
- }
m_associatedElements.insert(formElementIndex(e), e);
}
void HTMLFormElement::removeFormElement(FormAssociatedElement* e)
{
- if (e->isFormControlElement())
- m_checkedRadioButtons.removeButton(static_cast<HTMLFormControlElement*>(e));
unsigned index;
for (index = 0; index < m_associatedElements.size(); ++index) {
if (m_associatedElements[index] == e)
@@ -501,11 +491,11 @@ void HTMLFormElement::removeImgElement(HTMLImageElement* e)
removeFromVector(m_imageElements, e);
}
-PassRefPtr<HTMLCollection> HTMLFormElement::elements()
+HTMLCollection* HTMLFormElement::elements()
{
if (!m_elementsCollection)
m_elementsCollection = HTMLFormCollection::create(this);
- return m_elementsCollection;
+ return m_elementsCollection.get();
}
String HTMLFormElement::name() const
diff --git a/Source/WebCore/html/HTMLFormElement.h b/Source/WebCore/html/HTMLFormElement.h
index 2dd8af1ff..08c114119 100644
--- a/Source/WebCore/html/HTMLFormElement.h
+++ b/Source/WebCore/html/HTMLFormElement.h
@@ -47,7 +47,7 @@ public:
static PassRefPtr<HTMLFormElement> create(const QualifiedName&, Document*);
virtual ~HTMLFormElement();
- PassRefPtr<HTMLCollection> elements();
+ HTMLCollection* elements();
void getNamedElements(const AtomicString&, Vector<RefPtr<Node> >&);
unsigned length() const;
@@ -149,7 +149,7 @@ private:
FormSubmission::Attributes m_attributes;
OwnPtr<AliasMap> m_elementAliases;
- RefPtr<HTMLFormCollection> m_elementsCollection;
+ OwnPtr<HTMLFormCollection> m_elementsCollection;
CheckedRadioButtons m_checkedRadioButtons;
diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp
index 46d1049bd..3bb9af093 100644
--- a/Source/WebCore/html/HTMLInputElement.cpp
+++ b/Source/WebCore/html/HTMLInputElement.cpp
@@ -116,11 +116,9 @@ HTMLInputElement::~HTMLInputElement()
if (needsSuspensionCallback())
document()->unregisterForPageCacheSuspensionCallbacks(this);
- document()->checkedRadioButtons().removeButton(this);
-
- // Need to remove this from the form while it is still an HTMLInputElement,
- // so can't wait for the base class's destructor to do it.
- removeFromForm();
+ // Need to remove form association while this is still an HTMLInputElement
+ // so that virtual functions are called correctly.
+ setForm(0);
}
const AtomicString& HTMLInputElement::formControlName() const
@@ -179,8 +177,7 @@ bool HTMLInputElement::shouldAutocomplete() const
void HTMLInputElement::updateCheckedRadioButtons()
{
- if (attached() && checked())
- checkedRadioButtons().addButton(this);
+ checkedRadioButtons().addButton(this);
if (form()) {
const Vector<FormAssociatedElement*>& controls = form()->associatedElements();
@@ -1502,6 +1499,32 @@ void HTMLInputElement::documentDidResumeFromPageCache()
reset();
}
+void HTMLInputElement::willChangeForm()
+{
+ checkedRadioButtons().removeButton(this);
+ HTMLTextFormControlElement::willChangeForm();
+}
+
+void HTMLInputElement::didChangeForm()
+{
+ HTMLTextFormControlElement::didChangeForm();
+ checkedRadioButtons().addButton(this);
+}
+
+void HTMLInputElement::insertedIntoDocument()
+{
+ HTMLTextFormControlElement::insertedIntoDocument();
+ ASSERT(inDocument());
+ checkedRadioButtons().addButton(this);
+}
+
+void HTMLInputElement::removedFromDocument()
+{
+ ASSERT(inDocument());
+ checkedRadioButtons().removeButton(this);
+ HTMLTextFormControlElement::removedFromDocument();
+}
+
void HTMLInputElement::didMoveToNewDocument(Document* oldDocument)
{
m_inputType->willMoveToNewOwnerDocument();
@@ -1576,7 +1599,7 @@ HTMLOptionElement* HTMLInputElement::selectedOption() const
HTMLDataListElement* sourceElement = dataList();
if (!sourceElement)
return 0;
- RefPtr<HTMLCollection> options = sourceElement->options();
+ HTMLCollection* options = sourceElement->options();
if (!options)
return 0;
unsigned length = options->length();
diff --git a/Source/WebCore/html/HTMLInputElement.h b/Source/WebCore/html/HTMLInputElement.h
index 054436dd4..d21244d39 100644
--- a/Source/WebCore/html/HTMLInputElement.h
+++ b/Source/WebCore/html/HTMLInputElement.h
@@ -249,6 +249,10 @@ private:
enum AutoCompleteSetting { Uninitialized, On, Off };
enum AnyStepHandling { RejectAny, AnyIsDefaultStep };
+ virtual void willChangeForm() OVERRIDE;
+ virtual void didChangeForm() OVERRIDE;
+ virtual void insertedIntoDocument() OVERRIDE;
+ virtual void removedFromDocument() OVERRIDE;
virtual void didMoveToNewDocument(Document* oldDocument) OVERRIDE;
virtual bool isKeyboardFocusable(KeyboardEvent*) const;
diff --git a/Source/WebCore/html/HTMLLabelElement.cpp b/Source/WebCore/html/HTMLLabelElement.cpp
index 6cbd21900..318fe88da 100644
--- a/Source/WebCore/html/HTMLLabelElement.cpp
+++ b/Source/WebCore/html/HTMLLabelElement.cpp
@@ -154,4 +154,15 @@ void HTMLLabelElement::accessKeyAction(bool sendMouseEvents)
HTMLElement::accessKeyAction(sendMouseEvents);
}
+void HTMLLabelElement::parseMappedAttribute(Attribute* attribute)
+{
+ if (attribute->name() == forAttr) {
+ // htmlFor attribute change affects other nodes than this.
+ // Clear the caches to ensure that the labels caches are cleared.
+ if (document())
+ document()->notifyLocalNodeListsLabelChanged();
+ } else
+ HTMLElement::parseMappedAttribute(attribute);
+}
+
} // namespace
diff --git a/Source/WebCore/html/HTMLLabelElement.h b/Source/WebCore/html/HTMLLabelElement.h
index 32a55e449..2f8497839 100644
--- a/Source/WebCore/html/HTMLLabelElement.h
+++ b/Source/WebCore/html/HTMLLabelElement.h
@@ -50,6 +50,8 @@ private:
virtual void defaultEventHandler(Event*);
void focus(bool restorePreviousSelection = true);
+
+ virtual void parseMappedAttribute(Attribute*);
};
} //namespace
diff --git a/Source/WebCore/html/HTMLMapElement.cpp b/Source/WebCore/html/HTMLMapElement.cpp
index 098295b73..bf4a3b333 100644
--- a/Source/WebCore/html/HTMLMapElement.cpp
+++ b/Source/WebCore/html/HTMLMapElement.cpp
@@ -82,7 +82,7 @@ bool HTMLMapElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size,
HTMLImageElement* HTMLMapElement::imageElement()
{
- RefPtr<HTMLCollection> coll = document()->images();
+ HTMLCollection* coll = document()->images();
for (Node* curr = coll->firstItem(); curr; curr = coll->nextItem()) {
if (!curr->hasTagName(imgTag))
continue;
@@ -126,7 +126,7 @@ void HTMLMapElement::parseMappedAttribute(Attribute* attribute)
HTMLElement::parseMappedAttribute(attribute);
}
-PassRefPtr<HTMLCollection> HTMLMapElement::areas()
+HTMLCollection* HTMLMapElement::areas()
{
return ensureCachedHTMLCollection(MapAreas);
}
diff --git a/Source/WebCore/html/HTMLMapElement.h b/Source/WebCore/html/HTMLMapElement.h
index 300676695..925895cab 100644
--- a/Source/WebCore/html/HTMLMapElement.h
+++ b/Source/WebCore/html/HTMLMapElement.h
@@ -41,7 +41,7 @@ public:
bool mapMouseEvent(LayoutPoint location, const LayoutSize&, HitTestResult&);
HTMLImageElement* imageElement();
- PassRefPtr<HTMLCollection> areas();
+ HTMLCollection* areas();
private:
HTMLMapElement(const QualifiedName&, Document*);
diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp
index 0b693b2b9..4f06af6ea 100644
--- a/Source/WebCore/html/HTMLMediaElement.cpp
+++ b/Source/WebCore/html/HTMLMediaElement.cpp
@@ -236,6 +236,7 @@ HTMLMediaElement::HTMLMediaElement(const QualifiedName& tagName, Document* docum
, m_tracksAreReady(true)
, m_haveVisibleTextTrack(false)
, m_textTracks(0)
+ , m_ignoreTrackDisplayUpdate(0)
#endif
#if ENABLE(WEB_AUDIO)
, m_audioSourceNode(0)
@@ -325,6 +326,10 @@ void HTMLMediaElement::attributeChanged(Attribute* attr, bool preserveDecls)
scheduleLoad(MediaResource);
} else if (attrName == controlsAttr)
configureMediaControls();
+#if PLATFORM(MAC)
+ else if (attrName == loopAttr)
+ updateDisableSleep();
+#endif
}
void HTMLMediaElement::parseMappedAttribute(Attribute* attr)
@@ -948,6 +953,9 @@ void HTMLMediaElement::loadResource(const KURL& initialURL, ContentType& content
#if ENABLE(VIDEO_TRACK)
void HTMLMediaElement::updateActiveTextTrackCues(float movieTime)
{
+ if (ignoreTrackDisplayUpdateRequests())
+ return;
+
CueList previouslyActiveCues = m_currentlyActiveCues;
bool activeSetChanged = false;
@@ -1030,24 +1038,32 @@ void HTMLMediaElement::textTrackKindChanged(TextTrack*)
void HTMLMediaElement::textTrackAddCues(TextTrack*, const TextTrackCueList* cues)
{
+ beginIgnoringTrackDisplayUpdateRequests();
for (size_t i = 0; i < cues->length(); ++i)
textTrackAddCue(cues->item(i)->track(), cues->item(i));
+ endIgnoringTrackDisplayUpdateRequests();
+ updateActiveTextTrackCues(currentTime());
}
void HTMLMediaElement::textTrackRemoveCues(TextTrack*, const TextTrackCueList* cues)
{
+ beginIgnoringTrackDisplayUpdateRequests();
for (size_t i = 0; i < cues->length(); ++i)
textTrackRemoveCue(cues->item(i)->track(), cues->item(i));
+ endIgnoringTrackDisplayUpdateRequests();
+ updateActiveTextTrackCues(currentTime());
}
void HTMLMediaElement::textTrackAddCue(TextTrack*, PassRefPtr<TextTrackCue> cue)
{
m_cueTree.add(m_cueTree.createInterval(cue->startTime(), cue->endTime(), cue.get()));
+ updateActiveTextTrackCues(currentTime());
}
void HTMLMediaElement::textTrackRemoveCue(TextTrack*, PassRefPtr<TextTrackCue> cue)
{
m_cueTree.remove(m_cueTree.createInterval(cue->startTime(), cue->endTime(), cue.get()));
+ updateActiveTextTrackCues(currentTime());
}
#endif
@@ -1258,6 +1274,9 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
if (state == MediaPlayer::Idle) {
if (m_networkState > NETWORK_IDLE) {
m_progressEventTimer.stop();
+ if (hasMediaControls() && m_player->bytesLoaded() != m_previousProgress)
+ mediaControls()->bufferingProgressed();
+
scheduleEvent(eventNames().suspendEvent);
setShouldDelayLoadEvent(false);
}
@@ -1273,6 +1292,8 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
if (state == MediaPlayer::Loaded) {
if (m_networkState != NETWORK_IDLE) {
m_progressEventTimer.stop();
+ if (hasMediaControls() && m_player->bytesLoaded() != m_previousProgress)
+ mediaControls()->bufferingProgressed();
// Schedule one last progress event so we guarantee that at least one is fired
// for files that load very quickly.
@@ -1436,6 +1457,8 @@ void HTMLMediaElement::progressEventTimerFired(Timer<HTMLMediaElement>*)
m_sentStalledEvent = false;
if (renderer())
renderer()->updateFromElement();
+ if (hasMediaControls())
+ mediaControls()->bufferingProgressed();
}
}
@@ -1994,6 +2017,9 @@ void HTMLMediaElement::setLoop(bool b)
{
LOG(Media, "HTMLMediaElement::setLoop(%s)", boolString(b));
setBooleanAttribute(loopAttr, b);
+#if PLATFORM(MAC)
+ updateDisableSleep();
+#endif
}
bool HTMLMediaElement::controls() const
@@ -2725,10 +2751,7 @@ void HTMLMediaElement::mediaPlayerRateChanged(MediaPlayer*)
invalidateCachedTime();
#if PLATFORM(MAC)
- if (m_player->paused() && m_sleepDisabler)
- m_sleepDisabler = nullptr;
- else if (!m_player->paused() && !m_sleepDisabler)
- m_sleepDisabler = DisplaySleepDisabler::create("com.apple.WebCore: HTMLMediaElement playback");
+ updateDisableSleep();
#endif
endProcessingMediaPlayerCallback();
@@ -3484,6 +3507,8 @@ bool HTMLMediaElement::createMediaControls()
controls->setMediaController(m_mediaController ? m_mediaController.get() : static_cast<MediaControllerInterface*>(this));
controls->reset();
+ if (isFullscreen())
+ controls->enteredFullscreen();
ensureShadowRoot()->appendChild(controls, ec);
return true;
@@ -3722,6 +3747,21 @@ void HTMLMediaElement::applyMediaFragmentURI()
}
}
+#if PLATFORM(MAC)
+void HTMLMediaElement::updateDisableSleep()
+{
+ if (!shouldDisableSleep() && m_sleepDisabler)
+ m_sleepDisabler = nullptr;
+ else if (shouldDisableSleep() && !m_sleepDisabler)
+ m_sleepDisabler = DisplaySleepDisabler::create("com.apple.WebCore: HTMLMediaElement playback");
+}
+
+bool HTMLMediaElement::shouldDisableSleep() const
+{
+ return m_player && !m_player->paused() && hasVideo() && hasAudio() && !loop();
+}
+#endif
+
}
#endif
diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h
index 2623a65f0..198b9b210 100644
--- a/Source/WebCore/html/HTMLMediaElement.h
+++ b/Source/WebCore/html/HTMLMediaElement.h
@@ -400,6 +400,10 @@ private:
bool userIsInterestedInThisLanguage(const String&) const;
bool userIsInterestedInThisTrack(HTMLTrackElement*) const;
HTMLTrackElement* showingTrackWithSameKind(HTMLTrackElement*) const;
+
+ bool ignoreTrackDisplayUpdateRequests() const { return m_ignoreTrackDisplayUpdate > 0; }
+ void beginIgnoringTrackDisplayUpdateRequests() { ++m_ignoreTrackDisplayUpdate; }
+ void endIgnoringTrackDisplayUpdateRequests() { ASSERT(m_ignoreTrackDisplayUpdate); --m_ignoreTrackDisplayUpdate; }
#endif
// These "internal" functions do not check user gesture restrictions.
@@ -457,6 +461,11 @@ private:
bool isLiveStream() const { return movieLoadType() == MediaPlayer::LiveStream; }
bool isAutoplaying() const { return m_autoplaying; }
+#if PLATFORM(MAC)
+ void updateDisableSleep();
+ bool shouldDisableSleep() const;
+#endif
+
Timer<HTMLMediaElement> m_loadTimer;
Timer<HTMLMediaElement> m_asyncEventTimer;
Timer<HTMLMediaElement> m_progressEventTimer;
@@ -566,6 +575,7 @@ private:
Vector<RefPtr<TextTrack> > m_textTracksWhenResourceSelectionBegan;
CueIntervalTree m_cueTree;
CueList m_currentlyActiveCues;
+ int m_ignoreTrackDisplayUpdate;
#endif
#if ENABLE(WEB_AUDIO)
@@ -599,7 +609,7 @@ template <>
struct ValueToString<TextTrackCue*> {
static String string(TextTrackCue* const& cue)
{
- return String::format("%p id=%s interval=%f-->%f cue=%s)", cue, cue->id().utf8().data(), cue->startTime(), cue->endTime(), cue->getCueAsSource().utf8().data());
+ return String::format("%p id=%s interval=%f-->%f cue=%s)", cue, cue->id().utf8().data(), cue->startTime(), cue->endTime(), cue->text().utf8().data());
}
};
#endif
diff --git a/Source/WebCore/html/HTMLNameCollection.cpp b/Source/WebCore/html/HTMLNameCollection.cpp
index ad73d3201..aaf5b4d02 100644
--- a/Source/WebCore/html/HTMLNameCollection.cpp
+++ b/Source/WebCore/html/HTMLNameCollection.cpp
@@ -40,9 +40,6 @@ HTMLNameCollection::HTMLNameCollection(Document* document, CollectionType type,
Element* HTMLNameCollection::itemAfter(Element* previous) const
{
- if (!base())
- return 0;
-
ASSERT(previous != base());
Node* current;
diff --git a/Source/WebCore/html/HTMLNameCollection.h b/Source/WebCore/html/HTMLNameCollection.h
index c4087cbd4..f844657f3 100644
--- a/Source/WebCore/html/HTMLNameCollection.h
+++ b/Source/WebCore/html/HTMLNameCollection.h
@@ -33,9 +33,9 @@ class Document;
class HTMLNameCollection : public HTMLCollection {
public:
- static PassRefPtr<HTMLNameCollection> create(Document* document, CollectionType type, const AtomicString& name)
+ static PassOwnPtr<HTMLNameCollection> create(Document* document, CollectionType type, const AtomicString& name)
{
- return adoptRef(new HTMLNameCollection(document, type, name));
+ return adoptPtr(new HTMLNameCollection(document, type, name));
}
private:
diff --git a/Source/WebCore/html/HTMLObjectElement.cpp b/Source/WebCore/html/HTMLObjectElement.cpp
index e9bc36c24..3f9f77fb2 100644
--- a/Source/WebCore/html/HTMLObjectElement.cpp
+++ b/Source/WebCore/html/HTMLObjectElement.cpp
@@ -55,21 +55,15 @@ using namespace HTMLNames;
inline HTMLObjectElement::HTMLObjectElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form, bool createdByParser)
: HTMLPlugInImageElement(tagName, document, createdByParser, ShouldNotPreferPlugInsForImages)
- , FormAssociatedElement(form)
, m_docNamedItem(true)
, m_useFallbackContent(false)
{
ASSERT(hasTagName(objectTag));
- if (!this->form())
- setForm(findFormAncestor());
- if (this->form())
- this->form()->registerFormElement(this);
+ setForm(form ? form : findFormAncestor());
}
inline HTMLObjectElement::~HTMLObjectElement()
{
- if (form())
- form()->removeFormElement(this);
}
PassRefPtr<HTMLObjectElement> HTMLObjectElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form, bool createdByParser)
diff --git a/Source/WebCore/html/HTMLOptionsCollection.cpp b/Source/WebCore/html/HTMLOptionsCollection.cpp
index 3abb35300..ca8a1b07d 100644
--- a/Source/WebCore/html/HTMLOptionsCollection.cpp
+++ b/Source/WebCore/html/HTMLOptionsCollection.cpp
@@ -32,9 +32,9 @@ HTMLOptionsCollection::HTMLOptionsCollection(HTMLSelectElement* select)
{
}
-PassRefPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(HTMLSelectElement* select)
+PassOwnPtr<HTMLOptionsCollection> HTMLOptionsCollection::create(HTMLSelectElement* select)
{
- return adoptRef(new HTMLOptionsCollection(select));
+ return adoptPtr(new HTMLOptionsCollection(select));
}
void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, ExceptionCode &ec)
@@ -59,9 +59,6 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
ec = 0;
HTMLSelectElement* select = toHTMLSelectElement(base());
- if (!select)
- return;
-
if (index == -1 || unsigned(index) >= length())
select->add(newOption, 0, ec);
else
@@ -72,29 +69,21 @@ void HTMLOptionsCollection::add(PassRefPtr<HTMLOptionElement> element, int index
void HTMLOptionsCollection::remove(int index)
{
- if (!base())
- return;
toHTMLSelectElement(base())->remove(index);
}
int HTMLOptionsCollection::selectedIndex() const
{
- if (!base())
- return -1;
return toHTMLSelectElement(base())->selectedIndex();
}
void HTMLOptionsCollection::setSelectedIndex(int index)
{
- if (!base())
- return;
toHTMLSelectElement(base())->setSelectedIndex(index);
}
void HTMLOptionsCollection::setLength(unsigned length, ExceptionCode& ec)
{
- if (!base())
- return;
toHTMLSelectElement(base())->setLength(length, ec);
}
diff --git a/Source/WebCore/html/HTMLOptionsCollection.h b/Source/WebCore/html/HTMLOptionsCollection.h
index 333334b5d..bc9bdfa70 100644
--- a/Source/WebCore/html/HTMLOptionsCollection.h
+++ b/Source/WebCore/html/HTMLOptionsCollection.h
@@ -35,7 +35,7 @@ typedef int ExceptionCode;
class HTMLOptionsCollection : public HTMLCollection {
public:
- static PassRefPtr<HTMLOptionsCollection> create(HTMLSelectElement*);
+ static PassOwnPtr<HTMLOptionsCollection> create(HTMLSelectElement*);
void add(PassRefPtr<HTMLOptionElement>, ExceptionCode&);
void add(PassRefPtr<HTMLOptionElement>, int index, ExceptionCode&);
diff --git a/Source/WebCore/html/HTMLPropertiesCollection.cpp b/Source/WebCore/html/HTMLPropertiesCollection.cpp
index 439bae68c..86fcecfae 100644
--- a/Source/WebCore/html/HTMLPropertiesCollection.cpp
+++ b/Source/WebCore/html/HTMLPropertiesCollection.cpp
@@ -49,9 +49,9 @@ static inline bool compareTreeOrder(Node* node1, Node* node2)
return (node2->compareDocumentPosition(node1) & (Node::DOCUMENT_POSITION_PRECEDING | Node::DOCUMENT_POSITION_DISCONNECTED)) == Node::DOCUMENT_POSITION_PRECEDING;
}
-PassRefPtr<HTMLPropertiesCollection> HTMLPropertiesCollection::create(PassRefPtr<Node> itemNode)
+PassOwnPtr<HTMLPropertiesCollection> HTMLPropertiesCollection::create(PassRefPtr<Node> itemNode)
{
- return adoptRef(new HTMLPropertiesCollection(itemNode));
+ return adoptPtr(new HTMLPropertiesCollection(itemNode));
}
HTMLPropertiesCollection::HTMLPropertiesCollection(PassRefPtr<Node> itemNode)
@@ -123,9 +123,6 @@ void HTMLPropertiesCollection::findPropetiesOfAnItem(Node* root) const
unsigned HTMLPropertiesCollection::length() const
{
- if (!base())
- return 0;
-
if (!base()->isHTMLElement() || !toHTMLElement(base())->fastHasAttribute(itemscopeAttr))
return 0;
@@ -136,9 +133,6 @@ unsigned HTMLPropertiesCollection::length() const
Node* HTMLPropertiesCollection::item(unsigned index) const
{
- if (!base())
- return 0;
-
if (!base()->isHTMLElement() || !toHTMLElement(base())->fastHasAttribute(itemscopeAttr))
return 0;
@@ -157,9 +151,6 @@ PassRefPtr<DOMStringList> HTMLPropertiesCollection::names() const
m_properties.clear();
m_propertyNames->clear();
- if (!base())
- return 0;
-
if (!base()->isHTMLElement() || !toHTMLElement(base())->fastHasAttribute(itemscopeAttr))
return m_propertyNames;
diff --git a/Source/WebCore/html/HTMLPropertiesCollection.h b/Source/WebCore/html/HTMLPropertiesCollection.h
index ca822f160..e7524f983 100644
--- a/Source/WebCore/html/HTMLPropertiesCollection.h
+++ b/Source/WebCore/html/HTMLPropertiesCollection.h
@@ -41,7 +41,7 @@ class DOMStringList;
class HTMLPropertiesCollection : public HTMLCollection {
public:
- static PassRefPtr<HTMLPropertiesCollection> create(PassRefPtr<Node>);
+ static PassOwnPtr<HTMLPropertiesCollection> create(PassRefPtr<Node>);
virtual ~HTMLPropertiesCollection();
unsigned length() const OVERRIDE;
diff --git a/Source/WebCore/html/HTMLSelectElement.cpp b/Source/WebCore/html/HTMLSelectElement.cpp
index 95421f30b..bfebf8e64 100644
--- a/Source/WebCore/html/HTMLSelectElement.cpp
+++ b/Source/WebCore/html/HTMLSelectElement.cpp
@@ -92,12 +92,6 @@ HTMLSelectElement::HTMLSelectElement(const QualifiedName& tagName, Document* doc
ASSERT(hasTagName(selectTag));
}
-HTMLSelectElement::~HTMLSelectElement()
-{
- if (m_optionsCollection)
- m_optionsCollection->detachFromNode();
-}
-
PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
ASSERT(tagName.matches(selectTag));
@@ -331,11 +325,11 @@ RenderObject* HTMLSelectElement::createRenderer(RenderArena* arena, RenderStyle*
return new (arena) RenderListBox(this);
}
-PassRefPtr<HTMLOptionsCollection> HTMLSelectElement::options()
+HTMLOptionsCollection* HTMLSelectElement::options()
{
if (!m_optionsCollection)
m_optionsCollection = HTMLOptionsCollection::create(this);
- return m_optionsCollection;
+ return m_optionsCollection.get();
}
void HTMLSelectElement::updateListItemSelectedStates()
diff --git a/Source/WebCore/html/HTMLSelectElement.h b/Source/WebCore/html/HTMLSelectElement.h
index 5363cc781..cd0ebb4e4 100644
--- a/Source/WebCore/html/HTMLSelectElement.h
+++ b/Source/WebCore/html/HTMLSelectElement.h
@@ -28,6 +28,7 @@
#include "Event.h"
#include "HTMLFormControlElementWithState.h"
+#include "HTMLOptionsCollection.h"
#include <wtf/Vector.h>
namespace WebCore {
@@ -39,8 +40,6 @@ class HTMLSelectElement : public HTMLFormControlElementWithState {
public:
static PassRefPtr<HTMLSelectElement> create(const QualifiedName&, Document*, HTMLFormElement*);
- virtual ~HTMLSelectElement();
-
int selectedIndex() const;
void setSelectedIndex(int);
@@ -63,7 +62,7 @@ public:
String value() const;
void setValue(const String&);
- PassRefPtr<HTMLOptionsCollection> options();
+ HTMLOptionsCollection* options();
void optionElementChildrenChanged();
@@ -175,7 +174,7 @@ private:
virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
- RefPtr<HTMLOptionsCollection> m_optionsCollection;
+ OwnPtr<HTMLOptionsCollection> m_optionsCollection;
// m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHRElement objects.
mutable Vector<HTMLElement*> m_listItems;
diff --git a/Source/WebCore/html/HTMLTableElement.cpp b/Source/WebCore/html/HTMLTableElement.cpp
index b6a4a5a6d..342cff2b3 100644
--- a/Source/WebCore/html/HTMLTableElement.cpp
+++ b/Source/WebCore/html/HTMLTableElement.cpp
@@ -54,12 +54,6 @@ HTMLTableElement::HTMLTableElement(const QualifiedName& tagName, Document* docum
ASSERT(hasTagName(tableTag));
}
-HTMLTableElement::~HTMLTableElement()
-{
- if (m_rowsCollection)
- m_rowsCollection->detachFromNode();
-}
-
PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document* document)
{
return adoptRef(new HTMLTableElement(tableTag, document));
@@ -624,14 +618,14 @@ bool HTMLTableElement::isURLAttribute(Attribute *attr) const
return attr->name() == backgroundAttr || HTMLElement::isURLAttribute(attr);
}
-PassRefPtr<HTMLCollection> HTMLTableElement::rows()
+HTMLCollection* HTMLTableElement::rows()
{
if (!m_rowsCollection)
m_rowsCollection = HTMLTableRowsCollection::create(this);
- return m_rowsCollection;
+ return m_rowsCollection.get();
}
-PassRefPtr<HTMLCollection> HTMLTableElement::tBodies()
+HTMLCollection* HTMLTableElement::tBodies()
{
return ensureCachedHTMLCollection(TableTBodies);
}
diff --git a/Source/WebCore/html/HTMLTableElement.h b/Source/WebCore/html/HTMLTableElement.h
index 63e26056a..deed9518d 100644
--- a/Source/WebCore/html/HTMLTableElement.h
+++ b/Source/WebCore/html/HTMLTableElement.h
@@ -40,8 +40,6 @@ public:
static PassRefPtr<HTMLTableElement> create(Document*);
static PassRefPtr<HTMLTableElement> create(const QualifiedName&, Document*);
- virtual ~HTMLTableElement();
-
HTMLTableCaptionElement* caption() const;
void setCaption(PassRefPtr<HTMLTableCaptionElement>, ExceptionCode&);
@@ -60,8 +58,8 @@ public:
PassRefPtr<HTMLElement> insertRow(int index, ExceptionCode&);
void deleteRow(int index, ExceptionCode&);
- PassRefPtr<HTMLCollection> rows();
- PassRefPtr<HTMLCollection> tBodies();
+ HTMLCollection* rows();
+ HTMLCollection* tBodies();
String rules() const;
String summary() const;
@@ -103,7 +101,7 @@ private:
unsigned short m_padding;
RefPtr<CSSMappedAttributeDeclaration> m_paddingDecl;
- RefPtr<HTMLTableRowsCollection> m_rowsCollection;
+ OwnPtr<HTMLTableRowsCollection> m_rowsCollection;
};
} //namespace
diff --git a/Source/WebCore/html/HTMLTableRowElement.cpp b/Source/WebCore/html/HTMLTableRowElement.cpp
index 5ec3bce2b..cc5f90767 100644
--- a/Source/WebCore/html/HTMLTableRowElement.cpp
+++ b/Source/WebCore/html/HTMLTableRowElement.cpp
@@ -120,7 +120,7 @@ int HTMLTableRowElement::sectionRowIndex() const
PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionCode& ec)
{
- RefPtr<HTMLCollection> children = cells();
+ HTMLCollection* children = cells();
int numCells = children ? children->length() : 0;
if (index < -1 || index > numCells) {
ec = INDEX_SIZE_ERR;
@@ -143,7 +143,7 @@ PassRefPtr<HTMLElement> HTMLTableRowElement::insertCell(int index, ExceptionCode
void HTMLTableRowElement::deleteCell(int index, ExceptionCode& ec)
{
- RefPtr<HTMLCollection> children = cells();
+ HTMLCollection* children = cells();
int numCells = children ? children->length() : 0;
if (index == -1)
index = numCells-1;
@@ -154,7 +154,7 @@ void HTMLTableRowElement::deleteCell(int index, ExceptionCode& ec)
ec = INDEX_SIZE_ERR;
}
-PassRefPtr<HTMLCollection> HTMLTableRowElement::cells()
+HTMLCollection* HTMLTableRowElement::cells()
{
return ensureCachedHTMLCollection(TRCells);
}
diff --git a/Source/WebCore/html/HTMLTableRowElement.h b/Source/WebCore/html/HTMLTableRowElement.h
index c433677ac..cce97c31b 100644
--- a/Source/WebCore/html/HTMLTableRowElement.h
+++ b/Source/WebCore/html/HTMLTableRowElement.h
@@ -44,7 +44,7 @@ public:
PassRefPtr<HTMLElement> insertCell(int index, ExceptionCode&);
void deleteCell(int index, ExceptionCode&);
- PassRefPtr<HTMLCollection> cells();
+ HTMLCollection* cells();
void setCells(HTMLCollection *, ExceptionCode&);
private:
diff --git a/Source/WebCore/html/HTMLTableRowsCollection.cpp b/Source/WebCore/html/HTMLTableRowsCollection.cpp
index 6a8567ca6..df8998ddf 100644
--- a/Source/WebCore/html/HTMLTableRowsCollection.cpp
+++ b/Source/WebCore/html/HTMLTableRowsCollection.cpp
@@ -156,14 +156,13 @@ HTMLTableRowsCollection::HTMLTableRowsCollection(HTMLTableElement* table)
{
}
-PassRefPtr<HTMLTableRowsCollection> HTMLTableRowsCollection::create(HTMLTableElement* table)
+PassOwnPtr<HTMLTableRowsCollection> HTMLTableRowsCollection::create(HTMLTableElement* table)
{
- return adoptRef(new HTMLTableRowsCollection(table));
+ return adoptPtr(new HTMLTableRowsCollection(table));
}
Element* HTMLTableRowsCollection::itemAfter(Element* previous) const
{
- ASSERT(base());
ASSERT(!previous || previous->hasLocalName(trTag));
return rowAfter(static_cast<HTMLTableElement*>(base()), static_cast<HTMLTableRowElement*>(previous));
}
diff --git a/Source/WebCore/html/HTMLTableRowsCollection.h b/Source/WebCore/html/HTMLTableRowsCollection.h
index 66002d08c..11fb8d199 100644
--- a/Source/WebCore/html/HTMLTableRowsCollection.h
+++ b/Source/WebCore/html/HTMLTableRowsCollection.h
@@ -38,7 +38,7 @@ class HTMLTableRowElement;
class HTMLTableRowsCollection : public HTMLCollection {
public:
- static PassRefPtr<HTMLTableRowsCollection> create(HTMLTableElement*);
+ static PassOwnPtr<HTMLTableRowsCollection> create(HTMLTableElement*);
static HTMLTableRowElement* rowAfter(HTMLTableElement*, HTMLTableRowElement*);
static HTMLTableRowElement* lastRow(HTMLTableElement*);
diff --git a/Source/WebCore/html/HTMLTableSectionElement.cpp b/Source/WebCore/html/HTMLTableSectionElement.cpp
index 73a8367af..3297ad624 100644
--- a/Source/WebCore/html/HTMLTableSectionElement.cpp
+++ b/Source/WebCore/html/HTMLTableSectionElement.cpp
@@ -63,7 +63,7 @@ void HTMLTableSectionElement::additionalAttributeStyleDecls(Vector<CSSMutableSty
PassRefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionCode& ec)
{
RefPtr<HTMLTableRowElement> row;
- RefPtr<HTMLCollection> children = rows();
+ HTMLCollection* children = rows();
int numRows = children ? (int)children->length() : 0;
if (index < -1 || index > numRows)
ec = INDEX_SIZE_ERR; // per the DOM
@@ -85,7 +85,7 @@ PassRefPtr<HTMLElement> HTMLTableSectionElement::insertRow(int index, ExceptionC
void HTMLTableSectionElement::deleteRow(int index, ExceptionCode& ec)
{
- RefPtr<HTMLCollection> children = rows();
+ HTMLCollection* children = rows();
int numRows = children ? (int)children->length() : 0;
if (index == -1)
index = numRows - 1;
@@ -149,7 +149,7 @@ void HTMLTableSectionElement::setVAlign(const String &value)
setAttribute(valignAttr, value);
}
-PassRefPtr<HTMLCollection> HTMLTableSectionElement::rows()
+HTMLCollection* HTMLTableSectionElement::rows()
{
return ensureCachedHTMLCollection(TSectionRows);
}
diff --git a/Source/WebCore/html/HTMLTableSectionElement.h b/Source/WebCore/html/HTMLTableSectionElement.h
index a84cbde6d..295904c4a 100644
--- a/Source/WebCore/html/HTMLTableSectionElement.h
+++ b/Source/WebCore/html/HTMLTableSectionElement.h
@@ -51,7 +51,7 @@ public:
String vAlign() const;
void setVAlign(const String&);
- PassRefPtr<HTMLCollection> rows();
+ HTMLCollection* rows();
private:
HTMLTableSectionElement(const QualifiedName& tagName, Document*);
diff --git a/Source/WebCore/html/TextTrack.cpp b/Source/WebCore/html/TextTrack.cpp
index 164fe3355..bdfbaa205 100644
--- a/Source/WebCore/html/TextTrack.cpp
+++ b/Source/WebCore/html/TextTrack.cpp
@@ -251,6 +251,25 @@ void TextTrack::fireCueChangeEvent()
ExceptionCode ec = 0;
dispatchEvent(Event::create(eventNames().cuechangeEvent, false, false), ec);
}
+
+void TextTrack::cueWillChange(TextTrackCue* cue)
+{
+ if (!m_client)
+ return;
+
+ // The cue may need to be repositioned in the media element's interval tree, may need to
+ // be re-rendered, etc, so remove it before the modification...
+ m_client->textTrackRemoveCue(this, cue);
+}
+
+void TextTrack::cueDidChange(TextTrackCue* cue)
+{
+ if (!m_client)
+ return;
+
+ // ... and add it back again.
+ m_client->textTrackAddCue(this, cue);
+}
} // namespace WebCore
diff --git a/Source/WebCore/html/TextTrack.h b/Source/WebCore/html/TextTrack.h
index 9d69d5976..f6ecec848 100644
--- a/Source/WebCore/html/TextTrack.h
+++ b/Source/WebCore/html/TextTrack.h
@@ -98,6 +98,9 @@ public:
void addCue(PassRefPtr<TextTrackCue>, ExceptionCode&);
void removeCue(TextTrackCue*, ExceptionCode&);
+
+ void cueWillChange(TextTrackCue*);
+ void cueDidChange(TextTrackCue*);
virtual void fireCueChangeEvent();
DEFINE_ATTRIBUTE_EVENT_LISTENER(cuechange);
diff --git a/Source/WebCore/html/TextTrackCue.cpp b/Source/WebCore/html/TextTrackCue.cpp
index 55519e5bd..e1c01266e 100644
--- a/Source/WebCore/html/TextTrackCue.cpp
+++ b/Source/WebCore/html/TextTrackCue.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -42,6 +43,41 @@
namespace WebCore {
+static const AtomicString& startKeyword()
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, start, ("start"));
+ return start;
+}
+
+static const AtomicString& middleKeyword()
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, middle, ("middle"));
+ return middle;
+}
+
+static const AtomicString& endKeyword()
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, end, ("end"));
+ return end;
+}
+
+static const AtomicString& horizontalKeyword()
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, horizontal, ("horizontal"));
+ return horizontal;
+}
+
+static const AtomicString& verticalKeyword()
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, vertical, ("vertical"));
+ return vertical;
+}
+static const AtomicString& verticallrKeyword()
+{
+ DEFINE_STATIC_LOCAL(const AtomicString, verticallr, ("vertical-lr"));
+ return verticallr;
+}
+
TextTrackCue::TextTrackCue(ScriptExecutionContext* context, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit)
: m_id(id)
, m_startTime(start)
@@ -64,6 +100,18 @@ TextTrackCue::~TextTrackCue()
{
}
+void TextTrackCue::cueWillChange()
+{
+ if (m_track)
+ m_track->cueWillChange(this);
+}
+
+void TextTrackCue::cueDidChange()
+{
+ if (m_track)
+ m_track->cueDidChange(this);
+}
+
TextTrack* TextTrackCue::track() const
{
return m_track.get();
@@ -74,61 +122,213 @@ void TextTrackCue::setTrack(PassRefPtr<TextTrack>track)
m_track = track;
}
-String TextTrackCue::id() const
+void TextTrackCue::setId(const String& id)
{
- return m_id;
+ if (m_id == id)
+ return;
+
+ cueWillChange();
+ m_id = id;
+ cueDidChange();
}
-double TextTrackCue::startTime() const
+void TextTrackCue::setStartTime(double value)
{
- return m_startTime;
+ if (m_startTime == value)
+ return;
+
+ cueWillChange();
+ m_startTime = value;
+ cueDidChange();
}
-
-double TextTrackCue::endTime() const
+
+void TextTrackCue::setEndTime(double value)
{
- return m_endTime;
+ if (m_endTime == value)
+ return;
+
+ cueWillChange();
+ m_endTime = value;
+ cueDidChange();
}
-
-bool TextTrackCue::pauseOnExit() const
+
+void TextTrackCue::setPauseOnExit(bool value)
{
- return m_pauseOnExit;
+ if (m_pauseOnExit == value)
+ return;
+
+ cueWillChange();
+ m_pauseOnExit = value;
+ cueDidChange();
}
-String TextTrackCue::direction() const
+const String& TextTrackCue::direction() const
{
switch (m_writingDirection) {
case Horizontal:
- return "horizontal";
+ return horizontalKeyword();
case VerticalGrowingLeft:
- return "vertical";
+ return verticalKeyword();
case VerticalGrowingRight:
- return "vertical-lr";
+ return verticallrKeyword();
default:
- return "";
+ ASSERT_NOT_REACHED();
+ return emptyString();
+ }
+}
+
+void TextTrackCue::setDirection(const String& value, ExceptionCode& ec)
+{
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-direction
+ // On setting, the text track cue writing direction must be set to the value given
+ // in the first cell of the row in the table above whose second cell is a
+ // case-sensitive match for the new value, if any. If none of the values match, then
+ // the user agent must instead throw a SyntaxError exception.
+
+ Direction direction = m_writingDirection;
+ if (value == horizontalKeyword())
+ direction = Horizontal;
+ else if (value == verticalKeyword())
+ direction = VerticalGrowingLeft;
+ else if (value == verticallrKeyword())
+ direction = VerticalGrowingRight;
+ else
+ ec = SYNTAX_ERR;
+
+ if (direction == m_writingDirection)
+ return;
+
+ cueWillChange();
+ m_writingDirection = direction;
+ cueDidChange();
+}
+
+void TextTrackCue::setSnapToLines(bool value)
+{
+ if (m_snapToLines == value)
+ return;
+
+ cueWillChange();
+ m_snapToLines = value;
+ cueDidChange();
+}
+
+void TextTrackCue::setLinePosition(int position, ExceptionCode& ec)
+{
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-lineposition
+ // On setting, if the text track cue snap-to-lines flag is not set, and the new
+ // value is negative or greater than 100, then throw an IndexSizeError exception.
+ if (!m_snapToLines && (position < 0 || position > 100)) {
+ ec = INDEX_SIZE_ERR;
+ return;
}
+
+ // Otherwise, set the text track cue line position to the new value.
+ if (m_linePosition == position)
+ return;
+
+ cueWillChange();
+ m_linePosition = position;
+ cueDidChange();
}
-String TextTrackCue::alignment() const
+void TextTrackCue::setTextPosition(int position, ExceptionCode& ec)
+{
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-lineposition
+ // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception.
+ // Otherwise, set the text track cue text position to the new value.
+ if (position < 0 || position > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ // Otherwise, set the text track cue line position to the new value.
+ if (m_textPosition == position)
+ return;
+
+ cueWillChange();
+ m_textPosition = position;
+ cueDidChange();
+}
+
+void TextTrackCue::setSize(int size, ExceptionCode& ec)
+{
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size
+ // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError
+ // exception. Otherwise, set the text track cue size to the new value.
+ if (size < 0 || size > 100) {
+ ec = INDEX_SIZE_ERR;
+ return;
+ }
+
+ // Otherwise, set the text track cue line position to the new value.
+ if (m_cueSize == size)
+ return;
+
+ cueWillChange();
+ m_cueSize = size;
+ cueDidChange();
+}
+
+const String& TextTrackCue::alignment() const
{
switch (m_cueAlignment) {
- case Start:
- return "start";
+ case Start:
+ return startKeyword();
case Middle:
- return "middle";
+ return middleKeyword();
case End:
- return "end";
+ return endKeyword();
default:
- return "";
+ ASSERT_NOT_REACHED();
+ return emptyString();
}
}
-String TextTrackCue::getCueAsSource()
+void TextTrackCue::setAlignment(const String& value, ExceptionCode& ec)
+{
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-alignment
+ // On setting, the text track cue alignment must be set to the value given in the
+ // first cell of the row in the table above whose second cell is a case-sensitive
+ // match for the new value, if any. If none of the values match, then the user
+ // agent must instead throw a SyntaxError exception.
+
+ Alignment alignment = m_cueAlignment;
+ if (value == startKeyword())
+ alignment = Start;
+ else if (value == middleKeyword())
+ alignment = Middle;
+ else if (value == endKeyword())
+ alignment = End;
+ else
+ ec = SYNTAX_ERR;
+
+ if (alignment == m_cueAlignment)
+ return;
+
+ cueWillChange();
+ m_cueAlignment = alignment;
+ cueDidChange();
+}
+
+void TextTrackCue::setText(const String& text)
{
- return m_content;
+ if (m_content == text)
+ return;
+
+ cueWillChange();
+ // Clear the document fragment but don't bother to create it again just yet as we can do that
+ // when it is requested.
+ m_documentFragment = 0;
+ m_content = text;
+ cueDidChange();
}
PassRefPtr<DocumentFragment> TextTrackCue::getCueAsHTML()
{
+ if (!m_documentFragment)
+ m_documentFragment = WebVTTParser::create(0, m_scriptExecutionContext)->createDocumentFragmentFromCueText(m_content);
+
return m_documentFragment;
}
@@ -187,9 +387,9 @@ void TextTrackCue::parseSettings(const String& input)
{
// 1-3 - Collect the next word and set the writing direction accordingly.
String writingDirection = WebVTTParser::collectWord(input, &position);
- if (writingDirection == "vertical")
+ if (writingDirection == verticalKeyword())
m_writingDirection = VerticalGrowingLeft;
- else if (writingDirection == "vertical-lr")
+ else if (writingDirection == verticallrKeyword())
m_writingDirection = VerticalGrowingRight;
}
break;
@@ -297,11 +497,11 @@ void TextTrackCue::parseSettings(const String& input)
{
// 1-4 - Collect the next word and set the cue alignment accordingly.
String cueAlignment = WebVTTParser::collectWord(input, &position);
- if (cueAlignment == "start")
+ if (cueAlignment == startKeyword())
m_cueAlignment = Start;
- else if (cueAlignment == "middle")
+ else if (cueAlignment == middleKeyword())
m_cueAlignment = Middle;
- else if (cueAlignment == "end")
+ else if (cueAlignment == endKeyword())
m_cueAlignment = End;
}
break;
diff --git a/Source/WebCore/html/TextTrackCue.h b/Source/WebCore/html/TextTrackCue.h
index 9480afa0a..16faf63ca 100644
--- a/Source/WebCore/html/TextTrackCue.h
+++ b/Source/WebCore/html/TextTrackCue.h
@@ -59,19 +59,39 @@ public:
TextTrack* track() const;
void setTrack(PassRefPtr<TextTrack>);
- String id() const;
- double startTime() const;
- double endTime() const;
- bool pauseOnExit() const;
-
- String direction() const;
+ const String& id() const { return m_id; }
+ void setId(const String&);
+
+ double startTime() const { return m_startTime; }
+ void setStartTime(double);
+
+ double endTime() const { return m_endTime; }
+ void setEndTime(double);
+
+ bool pauseOnExit() const { return m_pauseOnExit; }
+ void setPauseOnExit(bool);
+
+ const String& direction() const;
+ void setDirection(const String&, ExceptionCode&);
+
bool snapToLines() const { return m_snapToLines; }
+ void setSnapToLines(bool);
+
int linePosition() const { return m_linePosition; }
+ void setLinePosition(int, ExceptionCode&);
+
int textPosition() const { return m_textPosition; }
+ void setTextPosition(int, ExceptionCode&);
+
int size() const { return m_cueSize; }
- String alignment() const;
+ void setSize(int, ExceptionCode&);
+
+ const String& alignment() const;
+ void setAlignment(const String&, ExceptionCode&);
+
+ const String& text() const { return m_content; }
+ void setText(const String&);
- String getCueAsSource();
PassRefPtr<DocumentFragment> getCueAsHTML();
void setCueHTML(PassRefPtr<DocumentFragment>);
@@ -96,6 +116,8 @@ private:
TextTrackCue(ScriptExecutionContext*, const String& id, double start, double end, const String& content, const String& settings, bool pauseOnExit);
void parseSettings(const String&);
+ void cueWillChange();
+ void cueDidChange();
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
diff --git a/Source/WebCore/html/TextTrackCue.idl b/Source/WebCore/html/TextTrackCue.idl
index 8f43aba2b..913a9bd44 100644
--- a/Source/WebCore/html/TextTrackCue.idl
+++ b/Source/WebCore/html/TextTrackCue.idl
@@ -36,20 +36,25 @@ module html {
CustomIsReachable
] TextTrackCue {
readonly attribute TextTrack track;
- readonly attribute DOMString id;
- readonly attribute double startTime;
- readonly attribute double endTime;
- readonly attribute boolean pauseOnExit;
+ attribute DOMString id;
+ attribute double startTime;
+ attribute double endTime;
+ attribute boolean pauseOnExit;
- readonly attribute DOMString direction;
- readonly attribute boolean snapToLines;
- readonly attribute long linePosition;
- readonly attribute long textPosition;
- readonly attribute long size;
- readonly attribute DOMString alignment;
+ attribute DOMString direction
+ setter raises (DOMException);
+ attribute boolean snapToLines;
+ attribute long linePosition
+ setter raises (DOMException);
+ attribute long textPosition
+ setter raises (DOMException);
+ attribute long size
+ setter raises (DOMException);
+ attribute DOMString alignment
+ setter raises (DOMException);
- DOMString getCueAsSource();
+ attribute DOMString text;
DocumentFragment getCueAsHTML();
attribute EventListener onenter;
diff --git a/Source/WebCore/html/canvas/WebGLContextEvent.cpp b/Source/WebCore/html/canvas/WebGLContextEvent.cpp
index 3351a4b08..ad2dd717d 100644
--- a/Source/WebCore/html/canvas/WebGLContextEvent.cpp
+++ b/Source/WebCore/html/canvas/WebGLContextEvent.cpp
@@ -28,6 +28,8 @@
#include "EventNames.h"
+#if ENABLE(WEBGL)
+
namespace WebCore {
WebGLContextEventInit::WebGLContextEventInit()
@@ -60,3 +62,5 @@ const AtomicString& WebGLContextEvent::interfaceName() const
}
} // namespace WebCore
+
+#endif // ENABLE(WEBGL)
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index a7b9cf648..d17741fb3 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -5037,7 +5037,8 @@ void WebGLRenderingContext::maybeRestoreContext(Timer<WebGLRenderingContext>*)
// Construct a new drawing buffer with the new GraphicsContext3D.
if (m_drawingBuffer) {
m_drawingBuffer->discardResources();
- m_drawingBuffer = DrawingBuffer::create(m_context.get(), m_drawingBuffer->size(), !m_attributes.preserveDrawingBuffer);
+ m_drawingBuffer = DrawingBuffer::create(context.get(), m_drawingBuffer->size(), !m_attributes.preserveDrawingBuffer);
+ m_drawingBuffer->bind();
}
m_context = context;
diff --git a/Source/WebCore/html/parser/XSSAuditor.cpp b/Source/WebCore/html/parser/XSSAuditor.cpp
index c48e73e8c..138a67118 100644
--- a/Source/WebCore/html/parser/XSSAuditor.cpp
+++ b/Source/WebCore/html/parser/XSSAuditor.cpp
@@ -411,6 +411,7 @@ bool XSSAuditor::filterEmbedToken(HTMLToken& token)
bool didBlockScript = false;
+ didBlockScript |= eraseAttributeIfInjected(token, codeAttr, String(), SrcLikeAttribute);
didBlockScript |= eraseAttributeIfInjected(token, srcAttr, blankURL().string(), SrcLikeAttribute);
didBlockScript |= eraseAttributeIfInjected(token, typeAttr);
diff --git a/Source/WebCore/html/shadow/MediaControlElements.cpp b/Source/WebCore/html/shadow/MediaControlElements.cpp
index e4faae203..d88b87f03 100644
--- a/Source/WebCore/html/shadow/MediaControlElements.cpp
+++ b/Source/WebCore/html/shadow/MediaControlElements.cpp
@@ -34,6 +34,7 @@
#include "CSSStyleSelector.h"
#include "CSSValueKeywords.h"
+#include "DOMTokenList.h"
#include "EventNames.h"
#include "FloatConversion.h"
#include "Frame.h"
@@ -185,6 +186,9 @@ void MediaControlPanelElement::setPosition(const LayoutPoint& position)
style->setProperty(CSSPropertyTop, top, CSSPrimitiveValue::CSS_PX);
style->setProperty(CSSPropertyMarginLeft, 0.0, CSSPrimitiveValue::CSS_PX);
style->setProperty(CSSPropertyMarginTop, 0.0, CSSPrimitiveValue::CSS_PX);
+
+ ExceptionCode ignored;
+ classList()->add("dragged", ignored);
}
void MediaControlPanelElement::resetPosition()
@@ -195,6 +199,9 @@ void MediaControlPanelElement::resetPosition()
style->removeProperty(CSSPropertyTop);
style->removeProperty(CSSPropertyMarginLeft);
style->removeProperty(CSSPropertyMarginTop);
+
+ ExceptionCode ignored;
+ classList()->remove("dragged", ignored);
}
void MediaControlPanelElement::makeOpaque()
@@ -229,12 +236,12 @@ void MediaControlPanelElement::defaultEventHandler(Event* event)
if (event->isMouseEvent()) {
LayoutPoint location = static_cast<MouseEvent*>(event)->absoluteLocation();
- if (event->type() == eventNames().mousedownEvent) {
+ if (event->type() == eventNames().mousedownEvent && event->target() == this) {
startDrag(location);
event->setDefaultHandled();
- } else if (event->type() == eventNames().mousemoveEvent)
+ } else if (event->type() == eventNames().mousemoveEvent && m_isBeingDragged)
continueDrag(location);
- else if (event->type() == eventNames().mouseupEvent) {
+ else if (event->type() == eventNames().mouseupEvent && m_isBeingDragged) {
continueDrag(location);
endDrag();
event->setDefaultHandled();
diff --git a/Source/WebCore/html/shadow/MediaControlRootElement.cpp b/Source/WebCore/html/shadow/MediaControlRootElement.cpp
index 47f88bc82..a358bd0b7 100644
--- a/Source/WebCore/html/shadow/MediaControlRootElement.cpp
+++ b/Source/WebCore/html/shadow/MediaControlRootElement.cpp
@@ -642,7 +642,7 @@ void MediaControlRootElement::updateTextTrackDisplay()
if (!cue->track() || cue->track()->mode() != TextTrack::SHOWING)
continue;
- String cueText = cue->getCueAsSource();
+ String cueText = cue->text();
if (!cueText.isEmpty()) {
if (!nothingToDisplay)
m_textTrackDisplay->appendChild(document()->createElement(HTMLNames::brTag, false), ASSERT_NO_EXCEPTION);
@@ -664,6 +664,14 @@ const AtomicString& MediaControlRootElement::shadowPseudoId() const
return id;
}
+void MediaControlRootElement::bufferingProgressed()
+{
+ // We only need to update buffering progress when paused, during normal
+ // playback playbackProgressed() will take care of it.
+ if (m_mediaController->paused())
+ m_timeline->setPosition(m_mediaController->currentTime());
+}
+
}
#endif
diff --git a/Source/WebCore/html/shadow/MediaControlRootElement.h b/Source/WebCore/html/shadow/MediaControlRootElement.h
index 7010d02d4..106750968 100644
--- a/Source/WebCore/html/shadow/MediaControlRootElement.h
+++ b/Source/WebCore/html/shadow/MediaControlRootElement.h
@@ -112,6 +112,8 @@ public:
virtual bool shouldHideControls();
+ void bufferingProgressed();
+
private:
MediaControlRootElement(Document*);
diff --git a/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp b/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp
index dea66fbfe..e69d818d3 100644
--- a/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp
+++ b/Source/WebCore/html/shadow/MediaControlRootElementChromium.cpp
@@ -376,7 +376,7 @@ void MediaControlRootElementChromium::updateTextTrackDisplay()
if (!cue->track() || cue->track()->mode() != TextTrack::SHOWING)
continue;
- String cueText = cue->getCueAsSource();
+ String cueText = cue->text();
if (!cueText.isEmpty()) {
if (!nothingToDisplay)
m_textTrackDisplay->appendChild(document()->createElement(HTMLNames::brTag, false), ASSERT_NO_EXCEPTION);
@@ -398,6 +398,14 @@ const AtomicString& MediaControlRootElementChromium::shadowPseudoId() const
return id;
}
+void MediaControlRootElementChromium::bufferingProgressed()
+{
+ // We only need to update buffering progress when paused, during normal
+ // playback playbackProgressed() will take care of it.
+ if (m_mediaController->paused())
+ m_timeline->setPosition(m_mediaController->currentTime());
+}
+
}
#endif
diff --git a/Source/WebCore/html/shadow/MediaControlRootElementChromium.h b/Source/WebCore/html/shadow/MediaControlRootElementChromium.h
index d895c3bc3..366186b65 100644
--- a/Source/WebCore/html/shadow/MediaControlRootElementChromium.h
+++ b/Source/WebCore/html/shadow/MediaControlRootElementChromium.h
@@ -99,6 +99,8 @@ public:
void updateTextTrackDisplay();
#endif
+ void bufferingProgressed();
+
virtual bool shouldHideControls();
private:
diff --git a/Source/WebCore/html/shadow/MediaControls.h b/Source/WebCore/html/shadow/MediaControls.h
index a61e34e11..28908a9a1 100644
--- a/Source/WebCore/html/shadow/MediaControls.h
+++ b/Source/WebCore/html/shadow/MediaControls.h
@@ -78,6 +78,8 @@ class MediaControls : public HTMLDivElement {
virtual void updateTextTrackDisplay() = 0;
#endif
+ virtual void bufferingProgressed() = 0;
+
protected:
MediaControls(Document*);
diff --git a/Source/WebCore/html/track/WebVTTParser.cpp b/Source/WebCore/html/track/WebVTTParser.cpp
index 9d619527c..114978f82 100644
--- a/Source/WebCore/html/track/WebVTTParser.cpp
+++ b/Source/WebCore/html/track/WebVTTParser.cpp
@@ -222,7 +222,7 @@ WebVTTParser::ParseState WebVTTParser::collectTimingsAndSettings(const String& l
WebVTTParser::ParseState WebVTTParser::collectCueText(const String& line, unsigned length, unsigned position)
{
if (line.isEmpty()) {
- processCueText();
+ createNewCue();
return Id;
}
if (!m_currentContent.isEmpty())
@@ -230,7 +230,7 @@ WebVTTParser::ParseState WebVTTParser::collectCueText(const String& line, unsign
m_currentContent.append(line);
if (position >= length)
- processCueText();
+ createNewCue();
return CueText;
}
@@ -242,30 +242,42 @@ WebVTTParser::ParseState WebVTTParser::ignoreBadCue(const String& line)
return Id;
}
-void WebVTTParser::processCueText()
+PassRefPtr<DocumentFragment> WebVTTParser::createDocumentFragmentFromCueText(const String& text)
{
- // 51 - Cue text processing based on
+ // Cue text processing based on
// 4.8.10.13.4 WebVTT cue text parsing rules and
// 4.8.10.13.5 WebVTT cue text DOM construction rules.
- if (m_currentContent.length() <= 0)
- return;
+
+ if (!text.length())
+ return 0;
ASSERT(m_scriptExecutionContext->isDocument());
Document* document = static_cast<Document*>(m_scriptExecutionContext);
-
- m_attachmentRoot = DocumentFragment::create(document);
- m_currentNode = m_attachmentRoot;
+
+ RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
+ m_currentNode = fragment;
m_tokenizer->reset();
m_token.clear();
-
- SegmentedString content(m_currentContent.toString());
+
+ SegmentedString content(text);
while (m_tokenizer->nextToken(content, m_token))
constructTreeFromToken(document);
+ return fragment.release();
+}
+
+void WebVTTParser::createNewCue()
+{
+ if (!m_currentContent.length())
+ return;
+
+ RefPtr<DocumentFragment> attachmentRoot = createDocumentFragmentFromCueText(m_currentContent.toString());
+
RefPtr<TextTrackCue> cue = TextTrackCue::create(m_scriptExecutionContext, m_currentId, m_currentStartTime, m_currentEndTime, m_currentContent.toString(), m_currentSettings, false);
- cue->setCueHTML(m_attachmentRoot);
+ cue->setCueHTML(attachmentRoot);
m_cuelist.append(cue);
- m_client->newCuesParsed();
+ if (m_client)
+ m_client->newCuesParsed();
}
void WebVTTParser::resetCueValues()
@@ -342,6 +354,8 @@ void WebVTTParser::constructTreeFromToken(Document* document)
AtomicString tokenTagName(m_token.name().data(), m_token.name().size());
QualifiedName tagName(nullAtom, tokenTagName, xhtmlNamespaceURI);
+ // http://dev.w3.org/html5/webvtt/#webvtt-cue-text-dom-construction-rules
+
switch (m_token.type()) {
case WebVTTTokenTypes::Character: {
String content(m_token.characters().data(), m_token.characters().size());
diff --git a/Source/WebCore/html/track/WebVTTParser.h b/Source/WebCore/html/track/WebVTTParser.h
index 244ee8f32..4e1dc0453 100644
--- a/Source/WebCore/html/track/WebVTTParser.h
+++ b/Source/WebCore/html/track/WebVTTParser.h
@@ -84,10 +84,12 @@ public:
static String collectWord(const String&, unsigned*);
// Input data to the parser to parse.
- virtual void parseBytes(const char* data, unsigned length);
+ void parseBytes(const char* data, unsigned length);
// Transfers ownership of last parsed cues to caller.
- virtual void getNewCues(Vector<RefPtr<TextTrackCue> >&);
+ void getNewCues(Vector<RefPtr<TextTrackCue> >&);
+
+ PassRefPtr<DocumentFragment> createDocumentFragmentFromCueText(const String&);
protected:
WebVTTParser(WebVTTParserClient*, ScriptExecutionContext*);
@@ -101,7 +103,7 @@ private:
ParseState collectCueText(const String&, unsigned length, unsigned);
ParseState ignoreBadCue(const String&);
- void processCueText();
+ void createNewCue();
void resetCueValues();
double collectTimeStamp(const String&, unsigned*);
void skipWhiteSpace(const String&, unsigned*);
@@ -119,7 +121,6 @@ private:
WebVTTToken m_token;
OwnPtr<WebVTTTokenizer> m_tokenizer;
- RefPtr<DocumentFragment> m_attachmentRoot;
RefPtr<ContainerNode> m_currentNode;
WebVTTParserClient* m_client;
diff --git a/Source/WebCore/inspector/DOMEditor.cpp b/Source/WebCore/inspector/DOMEditor.cpp
new file mode 100644
index 000000000..6209fdb6d
--- /dev/null
+++ b/Source/WebCore/inspector/DOMEditor.cpp
@@ -0,0 +1,293 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMEditor.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "Base64.h"
+#include "Document.h"
+#include "HTMLDocument.h"
+#include "HTMLDocumentParser.h"
+#include "HTMLElement.h"
+#include "HTMLHeadElement.h"
+#include "Node.h"
+
+#include <wtf/RefPtr.h>
+#include <wtf/SHA1.h>
+#include <wtf/text/CString.h>
+
+using namespace std;
+
+namespace WebCore {
+
+struct DOMEditor::NodeDigest {
+ NodeDigest(Node* node) : m_node(node) { }
+
+ String m_digest;
+ String m_attrsDigest;
+ Node* m_node;
+ Vector<OwnPtr<NodeDigest> > m_children;
+};
+
+DOMEditor::DOMEditor(Document* document) : m_document(document) { }
+
+DOMEditor::~DOMEditor() { }
+
+void DOMEditor::patch(const String& markup)
+{
+ RefPtr<HTMLDocument> newDocument = HTMLDocument::create(0, KURL());
+ RefPtr<DocumentParser> parser = HTMLDocumentParser::create(newDocument.get(), false);
+ parser->insert(markup); // Use insert() so that the parser will not yield.
+ parser->finish();
+ parser->detach();
+
+ if (!patchElement(m_document->head(), newDocument->head()) || !patchElement(m_document->body(), newDocument->body())) {
+ // Fall back to rewrite.
+ m_document->write(markup);
+ m_document->close();
+ }
+}
+
+bool DOMEditor::patchElement(Element* oldElement, Element* newElement)
+{
+ if (oldElement) {
+ if (newElement) {
+ OwnPtr<NodeDigest> oldInfo = createNodeDigest(oldElement);
+ OwnPtr<NodeDigest> newInfo = createNodeDigest(newElement);
+ return patchNode(oldInfo.get(), newInfo.get());
+ }
+ oldElement->removeAllChildren();
+ return true;
+ }
+ if (newElement) {
+ ExceptionCode ec = 0;
+ m_document->documentElement()->appendChild(newElement, ec);
+ return !ec;
+ }
+ return true;
+}
+
+bool DOMEditor::patchNode(NodeDigest* oldDigest, NodeDigest* newDigest)
+{
+ if (oldDigest->m_digest == newDigest->m_digest)
+ return true;
+
+ Node* oldNode = oldDigest->m_node;
+ Node* newNode = newDigest->m_node;
+
+ if (newNode->nodeType() != oldNode->nodeType() || newNode->nodeName() != oldNode->nodeName()) {
+ ExceptionCode ec = 0;
+ oldNode->parentNode()->replaceChild(newNode, oldNode, ec);
+ if (ec)
+ return false;
+ return true;
+ }
+
+ ExceptionCode ec = 0;
+ if (oldNode->nodeValue() != newNode->nodeValue())
+ oldNode->setNodeValue(newNode->nodeValue(), ec);
+ if (ec)
+ return false;
+
+ if (oldNode->nodeType() == Node::ELEMENT_NODE && oldDigest->m_attrsDigest != newDigest->m_attrsDigest) {
+ Element* oldElement = static_cast<Element*>(oldNode);
+ Element* newElement = static_cast<Element*>(newNode);
+ oldElement->setAttributesFromElement(*newElement);
+ }
+ if (oldDigest->m_node->nodeType() != Node::ELEMENT_NODE)
+ return true;
+
+ return patchChildren(static_cast<ContainerNode*>(oldNode), oldDigest->m_children, newDigest->m_children);
+}
+
+bool DOMEditor::patchChildren(ContainerNode* oldParent, Vector<OwnPtr<NodeDigest> >& oldList, Vector<OwnPtr<NodeDigest> >& newList)
+{
+ // Trim tail.
+ size_t offset = 0;
+ for (; offset < oldList.size() && offset < newList.size() && oldList[oldList.size() - offset - 1]->m_digest == newList[newList.size() - offset - 1]->m_digest; ++offset) { }
+ if (offset > 0) {
+ oldList.resize(oldList.size() - offset);
+ newList.resize(newList.size() - offset);
+ }
+
+ // Trim head.
+ for (offset = 0; offset < oldList.size() && offset < newList.size() && oldList[offset]->m_digest == newList[offset]->m_digest; ++offset) { }
+ if (offset > 0) {
+ oldList.remove(0, offset);
+ newList.remove(0, offset);
+ }
+
+ // Diff the children lists.
+ typedef Vector<pair<NodeDigest*, size_t> > ResultMap;
+ ResultMap newMap(newList.size());
+ ResultMap oldMap(oldList.size());
+
+ for (size_t i = 0; i < oldMap.size(); ++i)
+ oldMap[i].first = 0;
+ for (size_t i = 0; i < newMap.size(); ++i)
+ newMap[i].first = 0;
+
+ typedef HashMap<String, Vector<size_t> > DiffTable;
+ DiffTable newTable;
+ DiffTable oldTable;
+
+ for (size_t i = 0; i < newList.size(); ++i) {
+ DiffTable::iterator it = newTable.add(newList[i]->m_digest, Vector<size_t>()).first;
+ it->second.append(i);
+ }
+
+ for (size_t i = 0; i < oldList.size(); ++i) {
+ DiffTable::iterator it = oldTable.add(oldList[i]->m_digest, Vector<size_t>()).first;
+ it->second.append(i);
+ }
+
+ for (DiffTable::iterator newIt = newTable.begin(); newIt != newTable.end(); ++newIt) {
+ if (newIt->second.size() != 1)
+ continue;
+
+ DiffTable::iterator oldIt = oldTable.find(newIt->first);
+ if (oldIt == oldTable.end() || oldIt->second.size() != 1)
+ continue;
+ make_pair(newList[newIt->second[0]].get(), oldIt->second[0]);
+ newMap[newIt->second[0]] = make_pair(newList[newIt->second[0]].get(), oldIt->second[0]);
+ oldMap[oldIt->second[0]] = make_pair(oldList[oldIt->second[0]].get(), newIt->second[0]);
+ }
+
+ for (size_t i = 0; newList.size() > 0 && i < newList.size() - 1; ++i) {
+ if (!newMap[i].first || newMap[i + 1].first)
+ continue;
+
+ size_t j = newMap[i].second + 1;
+ if (j < oldMap.size() && !oldMap[j].first && newList[i + 1]->m_digest == oldList[j]->m_digest) {
+ newMap[i + 1] = make_pair(newList[i + 1].get(), j);
+ oldMap[j] = make_pair(oldList[j].get(), i + 1);
+ }
+ }
+
+ for (size_t i = newList.size() - 1; newList.size() > 0 && i > 0; --i) {
+ if (!newMap[i].first || newMap[i - 1].first || newMap[i].second <= 0)
+ continue;
+
+ size_t j = newMap[i].second - 1;
+ if (!oldMap[j].first && newList[i - 1]->m_digest == oldList[j]->m_digest) {
+ newMap[i - 1] = make_pair(newList[i - 1].get(), j);
+ oldMap[j] = make_pair(oldList[j].get(), i - 1);
+ }
+ }
+
+ HashSet<NodeDigest*> merges;
+ for (size_t i = 0; i < oldList.size(); ++i) {
+ if (oldMap[i].first)
+ continue;
+
+ // Check if this change is between stable nodes. If it is, consider it as "modified".
+ if ((!i || oldMap[i - 1].first) && (i == oldMap.size() - 1 || oldMap[i + 1].first)) {
+ size_t anchorCandidate = i ? oldMap[i - 1].second + 1 : 0;
+ size_t anchorAfter = i == oldMap.size() - 1 ? anchorCandidate + 1 : oldMap[i + 1].second;
+ if (anchorAfter - anchorCandidate == 1 && anchorCandidate < newList.size()) {
+ if (!patchNode(oldList[i].get(), newList[anchorCandidate].get()))
+ return false;
+
+ merges.add(newList[anchorCandidate].get());
+ } else
+ oldList[i]->m_node->parentNode()->removeChild(oldList[i]->m_node);
+ } else {
+ ContainerNode* parentNode = static_cast<ContainerNode*>(oldList[i]->m_node->parentNode());
+ parentNode->removeChild(oldList[i]->m_node);
+ }
+ }
+
+ for (size_t i = 0; i < newMap.size(); ++i) {
+ if (newMap[i].first || merges.contains(newList[i].get()))
+ continue;
+
+ ExceptionCode ec = 0;
+ oldParent->insertBefore(newList[i]->m_node, oldParent->childNode(i + offset), ec);
+ if (ec)
+ return false;
+ }
+
+ return true;
+}
+
+static void addStringToSHA1(SHA1& sha1, const String& string)
+{
+ CString cString = string.utf8();
+ sha1.addBytes(reinterpret_cast<const uint8_t*>(cString.data()), cString.length());
+}
+
+PassOwnPtr<DOMEditor::NodeDigest> DOMEditor::createNodeDigest(Node* node)
+{
+ NodeDigest* nodeDigest = new NodeDigest(node);
+
+ SHA1 sha1;
+
+ Node::NodeType nodeType = node->nodeType();
+ sha1.addBytes(reinterpret_cast<const uint8_t*>(&nodeType), sizeof(nodeType));
+ addStringToSHA1(sha1, node->nodeName());
+ addStringToSHA1(sha1, node->nodeValue());
+
+ if (node->nodeType() == Node::ELEMENT_NODE) {
+ Node* child = node->firstChild();
+ while (child) {
+ OwnPtr<NodeDigest> childInfo = createNodeDigest(child);
+ addStringToSHA1(sha1, childInfo->m_digest);
+ child = child->nextSibling();
+ nodeDigest->m_children.append(childInfo.release());
+ }
+
+ Element* element = static_cast<Element*>(node);
+ const NamedNodeMap* attrMap = element->attributes(true);
+ if (attrMap && attrMap->length()) {
+ unsigned numAttrs = attrMap->length();
+ SHA1 attrsSHA1;
+ for (unsigned i = 0; i < numAttrs; ++i) {
+ const Attribute* attribute = attrMap->attributeItem(i);
+ addStringToSHA1(attrsSHA1, attribute->name().toString());
+ addStringToSHA1(attrsSHA1, attribute->value());
+ }
+ Vector<uint8_t, 20> attrsHash;
+ attrsSHA1.computeHash(attrsHash);
+ nodeDigest->m_attrsDigest = base64Encode(reinterpret_cast<const char*>(attrsHash.data()), 10);
+ addStringToSHA1(sha1, nodeDigest->m_attrsDigest);
+ }
+ }
+
+ Vector<uint8_t, 20> hash;
+ sha1.computeHash(hash);
+ nodeDigest->m_digest = base64Encode(reinterpret_cast<const char*>(hash.data()), 10);
+ return adoptPtr(nodeDigest);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/Source/WebCore/inspector/DOMEditor.h b/Source/WebCore/inspector/DOMEditor.h
new file mode 100644
index 000000000..657034c48
--- /dev/null
+++ b/Source/WebCore/inspector/DOMEditor.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DOMEditor_h
+#define DOMEditor_h
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class ContainerNode;
+class Document;
+class Element;
+class Node;
+
+#if ENABLE(INSPECTOR)
+
+class DOMEditor {
+public:
+ explicit DOMEditor(Document*);
+ virtual ~DOMEditor();
+
+ void patch(const String& markup);
+
+private:
+ struct NodeDigest;
+
+ bool patchElement(Element* oldElement, Element* newElement);
+ bool patchNode(NodeDigest* oldNode, NodeDigest* newNode);
+ bool patchChildren(ContainerNode* oldParent, Vector<OwnPtr<NodeDigest> >& oldChildren, Vector<OwnPtr<NodeDigest> >& newChildren);
+ PassOwnPtr<NodeDigest> createNodeDigest(Node*);
+
+ Document* m_document;
+};
+
+#endif // ENABLE(INSPECTOR)
+
+} // namespace WebCore
+
+#endif // !defined(DOMEditor_h)
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.cpp b/Source/WebCore/inspector/InspectorDOMAgent.cpp
index 0c5cac033..60df0f6bc 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/Source/WebCore/inspector/InspectorDOMAgent.cpp
@@ -47,6 +47,7 @@
#include "ContainerNode.h"
#include "Cookie.h"
#include "CookieJar.h"
+#include "DOMEditor.h"
#include "DOMNodeHighlighter.h"
#include "DOMWindow.h"
#include "Document.h"
@@ -632,13 +633,22 @@ void InspectorDOMAgent::getOuterHTML(ErrorString* errorString, int nodeId, WTF::
void InspectorDOMAgent::setOuterHTML(ErrorString* errorString, int nodeId, const String& outerHTML, int* newId)
{
+ if (!nodeId) {
+ DOMEditor domEditor(m_document.get());
+ domEditor.patch(outerHTML);
+ *newId = 0;
+ return;
+ }
+
Node* node = assertNode(errorString, nodeId);
if (!node)
return;
- Element* parentElement = node->parentElement();
- if (!parentElement)
+ Node* parentNode = node->parentNode();
+ if (!parentNode) {
+ *errorString = "Editing of the detached nodes is not supported";
return;
+ }
Document* document = node->ownerDocument();
if (!document->isHTMLDocument()) {
@@ -649,10 +659,10 @@ void InspectorDOMAgent::setOuterHTML(ErrorString* errorString, int nodeId, const
Node* previousSibling = node->previousSibling(); // Remember previous sibling before replacing node.
RefPtr<DocumentFragment> fragment = DocumentFragment::create(document);
- fragment->parseHTML(outerHTML, parentElement);
+ fragment->parseHTML(outerHTML, parentNode->nodeType() == Node::ELEMENT_NODE ? static_cast<Element*>(parentNode) : document->documentElement());
ExceptionCode ec = 0;
- parentElement->replaceChild(fragment.release(), node, ec);
+ parentNode->replaceChild(fragment.release(), node, ec);
if (ec) {
*errorString = "Failed to replace Node with new contents";
return;
@@ -670,7 +680,7 @@ void InspectorDOMAgent::setOuterHTML(ErrorString* errorString, int nodeId, const
return;
}
- Node* newNode = previousSibling ? previousSibling->nextSibling() : parentElement->firstChild();
+ Node* newNode = previousSibling ? previousSibling->nextSibling() : parentNode->firstChild();
if (!newNode) {
// The only child node has been deleted.
*newId = 0;
diff --git a/Source/WebCore/inspector/InspectorDOMAgent.h b/Source/WebCore/inspector/InspectorDOMAgent.h
index 31de399ed..17f62a6b7 100644
--- a/Source/WebCore/inspector/InspectorDOMAgent.h
+++ b/Source/WebCore/inspector/InspectorDOMAgent.h
@@ -169,7 +169,6 @@ public:
PassRefPtr<InspectorObject> resolveNode(Node*, const String& objectGroup);
bool handleMousePress();
- bool searchingForNodeInPage() const;
void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
void inspect(Node*);
void focusNode();
diff --git a/Source/WebCore/inspector/front-end/DOMAgent.js b/Source/WebCore/inspector/front-end/DOMAgent.js
index 6ee942316..dfd486ca7 100644
--- a/Source/WebCore/inspector/front-end/DOMAgent.js
+++ b/Source/WebCore/inspector/front-end/DOMAgent.js
@@ -529,6 +529,8 @@ WebInspector.DOMAgent = function() {
this._document = null;
this._attributeLoadNodeIds = {};
InspectorBackend.registerDOMDispatcher(new WebInspector.DOMDispatcher(this));
+ if (WebInspector.experimentsSettings.freeFlowDOMEditing.isEnabled())
+ new WebInspector.DOMModelResourceBinding(this);
}
WebInspector.DOMAgent.Events = {
@@ -1074,3 +1076,27 @@ WebInspector.DOMDispatcher.prototype = {
* @type {?WebInspector.DOMAgent}
*/
WebInspector.domAgent = null;
+
+/**
+ * @constructor
+ * @implements {WebInspector.ResourceDomainModelBinding}
+ */
+WebInspector.DOMModelResourceBinding = function(domAgent)
+{
+ this._domAgent = domAgent;
+ WebInspector.Resource.registerDomainModelBinding(WebInspector.Resource.Type.Document, this);
+}
+
+WebInspector.DOMModelResourceBinding.prototype = {
+ setContent: function(resource, content, majorChange, userCallback)
+ {
+ DOMAgent.setOuterHTML(0, content, userCallback);
+ },
+
+ canSetContent: function()
+ {
+ return true;
+ }
+}
+
+WebInspector.DOMModelResourceBinding.prototype.__proto__ = WebInspector.ResourceDomainModelBinding.prototype;
diff --git a/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js b/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
index 6cfe683b3..76da658b3 100644
--- a/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
+++ b/Source/WebCore/inspector/front-end/DebuggerPresentationModel.js
@@ -36,6 +36,7 @@ WebInspector.DebuggerPresentationModel = function()
{
// FIXME: apply formatter from outside as a generic mapping.
this._formatter = new WebInspector.ScriptFormatter();
+ this._rawSourceCodes = [];
this._rawSourceCodeForScriptId = {};
this._rawSourceCodeForURL = {};
this._rawSourceCodeForDocumentURL = {};
@@ -143,7 +144,8 @@ WebInspector.DebuggerPresentationModel.prototype = {
if (WebInspector.settings.sourceMapsEnabled.get() && script.sourceMapURL)
compilerSourceMapping = new WebInspector.ClosureCompilerSourceMapping(script.sourceMapURL, script.sourceURL);
- rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, resource, this._formatter, this._formatSource, compilerSourceMapping);
+ var rawSourceCode = new WebInspector.RawSourceCode(script.scriptId, script, resource, this._formatter, this._formatSource, compilerSourceMapping);
+ this._rawSourceCodes.push(rawSourceCode);
this._bindScriptToRawSourceCode(script, rawSourceCode);
if (isInlineScript)
@@ -180,10 +182,10 @@ WebInspector.DebuggerPresentationModel.prototype = {
uiSourceCodes: function()
{
var result = [];
- for (var id in this._rawSourceCodeForScriptId) {
- var uiSourceCodeList = this._rawSourceCodeForScriptId[id].sourceMapping.uiSourceCodeList();
- for (var i = 0; i < uiSourceCodeList.length; ++i)
- result.push(uiSourceCodeList[i]);
+ for (var i = 0; i < this._rawSourceCodes.length; ++i) {
+ var uiSourceCodeList = this._rawSourceCodes[i].sourceMapping.uiSourceCodeList();
+ for (var j = 0; j < uiSourceCodeList.length; ++j)
+ result.push(uiSourceCodeList[j]);
}
return result;
},
@@ -335,8 +337,8 @@ WebInspector.DebuggerPresentationModel.prototype = {
this._formatSource = formatSource;
this._breakpointManager.reset();
- for (var id in this._rawSourceCodeForScriptId)
- this._rawSourceCodeForScriptId[id].setFormatted(this._formatSource);
+ for (var i = 0; i < this._rawSourceCodes.length; ++i)
+ this._rawSourceCodes[i].setFormatted(this._formatSource);
},
/**
@@ -376,8 +378,8 @@ WebInspector.DebuggerPresentationModel.prototype = {
_consoleCleared: function()
{
- for (var id in this._rawSourceCodeForScriptId)
- this._rawSourceCodeForScriptId[id].messages = [];
+ for (var i = 0; i < this._rawSourceCodes.length; ++i)
+ this._rawSourceCodes[i].messages = [];
this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.ConsoleMessagesCleared);
},
@@ -655,15 +657,16 @@ WebInspector.DebuggerPresentationModel.prototype = {
_debuggerReset: function()
{
- for (var id in this._rawSourceCodeForScriptId) {
- var rawSourceCode = this._rawSourceCodeForScriptId[id];
+ for (var i = 0; i < this._rawSourceCodes.length; ++i) {
+ var rawSourceCode = this._rawSourceCodes[i];
if (rawSourceCode.sourceMapping) {
var uiSourceCodeList = rawSourceCode.sourceMapping.uiSourceCodeList();
- for (var i = 0; i < uiSourceCodeList.length; ++i)
- this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, uiSourceCodeList[i]);
+ for (var j = 0; j < uiSourceCodeList.length; ++j)
+ this.dispatchEventToListeners(WebInspector.DebuggerPresentationModel.Events.UISourceCodeRemoved, uiSourceCodeList[j]);
}
rawSourceCode.removeAllListeners();
}
+ this._rawSourceCodes = [];
this._rawSourceCodeForScriptId = {};
this._rawSourceCodeForURL = {};
this._rawSourceCodeForDocumentURL = {};
diff --git a/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js b/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
index 56c585338..3e6c89fc7 100644
--- a/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
+++ b/Source/WebCore/inspector/front-end/JavaScriptSourceFrame.js
@@ -37,13 +37,14 @@
*/
WebInspector.JavaScriptSourceFrame = function(scriptsPanel, model, uiSourceCode)
{
- WebInspector.SourceFrame.call(this, uiSourceCode.url);
-
this._scriptsPanel = scriptsPanel;
this._model = model;
this._uiSourceCode = uiSourceCode;
this._popoverObjectGroup = "popover";
this._breakpoints = {};
+
+ WebInspector.SourceFrame.call(this, uiSourceCode.url);
+
this._popoverHelper = new WebInspector.ObjectPopoverHelper(this.textViewer.element,
this._getPopoverAnchor.bind(this), this._onShowPopover.bind(this), this._onHidePopover.bind(this), true);
@@ -95,7 +96,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
setReadOnly: function(readOnly)
{
- if (!readOnly)
+ if (this._popoverHelper && !readOnly)
this._popoverHelper.hidePopover();
WebInspector.SourceFrame.prototype.setReadOnly.call(this, readOnly);
if (readOnly)
@@ -202,10 +203,13 @@ WebInspector.JavaScriptSourceFrame.prototype = {
cancelEditing: function()
{
+ if (WebInspector.experimentsSettings.sourceFrameAlwaysEditable.isEnabled())
+ return false;
+
WebInspector.SourceFrame.prototype.cancelEditing.call(this);
if (!this._javaScriptSourceFrameState)
- return;
+ return true;
if (typeof this._javaScriptSourceFrameState.executionLineNumber === "number") {
this.clearExecutionLine();
@@ -225,6 +229,7 @@ WebInspector.JavaScriptSourceFrame.prototype = {
}
delete this._javaScriptSourceFrameState;
+ return true;
},
didEditContent: function(error)
diff --git a/Source/WebCore/inspector/front-end/NetworkPanel.js b/Source/WebCore/inspector/front-end/NetworkPanel.js
index 41fbb23a2..772a4d2d6 100644
--- a/Source/WebCore/inspector/front-end/NetworkPanel.js
+++ b/Source/WebCore/inspector/front-end/NetworkPanel.js
@@ -76,7 +76,7 @@ WebInspector.NetworkLogView = function()
{
this._canClearBrowserCookies = result;
}
- NetworkAgent.canClearBrowserCache(onCanClearBrowserCookies.bind(this));
+ NetworkAgent.canClearBrowserCookies(onCanClearBrowserCookies.bind(this));
}
WebInspector.NetworkLogView.prototype = {
diff --git a/Source/WebCore/inspector/front-end/ResourceView.js b/Source/WebCore/inspector/front-end/ResourceView.js
index b99b58afa..3d3686ca2 100644
--- a/Source/WebCore/inspector/front-end/ResourceView.js
+++ b/Source/WebCore/inspector/front-end/ResourceView.js
@@ -82,8 +82,8 @@ WebInspector.ResourceView.nonSourceViewForResource = function(resource)
*/
WebInspector.ResourceSourceFrame = function(resource)
{
- WebInspector.SourceFrame.call(this, resource.url);
this._resource = resource;
+ WebInspector.SourceFrame.call(this, resource.url);
}
//This is a map from resource.type to mime types
@@ -147,11 +147,15 @@ WebInspector.EditableResourceSourceFrame.prototype = {
cancelEditing: function()
{
+ if (WebInspector.experimentsSettings.sourceFrameAlwaysEditable.isEnabled())
+ return false;
+
this._clearIncrementalUpdateTimer();
const majorChange = false;
if (this._viewerState)
this.resource.setContent(this._viewerState.textModelContent, majorChange);
WebInspector.SourceFrame.prototype.cancelEditing.call(this);
+ return true;
},
afterTextChanged: function(oldRange, newRange)
diff --git a/Source/WebCore/inspector/front-end/ScriptsPanel.js b/Source/WebCore/inspector/front-end/ScriptsPanel.js
index 5baae8f70..ab1cd5799 100644
--- a/Source/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/Source/WebCore/inspector/front-end/ScriptsPanel.js
@@ -1529,7 +1529,7 @@ WebInspector.ScriptsPanel.SingleFileEditorContainer.prototype = {
{
this._currentSourceFrame.detach();
this._currentSourceFrame = null;
- this.showSourceFrame(title, sourceFrame);
+ this.showSourceFrame(title, sourceFrame, tooltip);
},
/**
diff --git a/Source/WebCore/inspector/front-end/Settings.js b/Source/WebCore/inspector/front-end/Settings.js
index 9be95f85a..81805181f 100644
--- a/Source/WebCore/inspector/front-end/Settings.js
+++ b/Source/WebCore/inspector/front-end/Settings.js
@@ -168,7 +168,9 @@ WebInspector.ExperimentsSettings = function()
// Add currently running experiments here.
// FIXME: Move out from experiments once navigator is production-ready.
this.useScriptsNavigator = this._createExperiment("useScriptsNavigator", "Use file navigator and tabbed editor container in scripts panel");
-
+ this.sourceFrameAlwaysEditable = this._createExperiment("sourceFrameAlwaysEditable", "Make resources always editable");
+ this.freeFlowDOMEditing = this._createExperiment("freeFlowDOMEditing", "Enable free flow DOM editing");
+
this._cleanUpSetting();
}
diff --git a/Source/WebCore/inspector/front-end/SourceFrame.js b/Source/WebCore/inspector/front-end/SourceFrame.js
index 29b45e531..f66f67b63 100644
--- a/Source/WebCore/inspector/front-end/SourceFrame.js
+++ b/Source/WebCore/inspector/front-end/SourceFrame.js
@@ -53,6 +53,9 @@ WebInspector.SourceFrame = function(url)
this._messages = [];
this._rowMessages = {};
this._messageBubbles = {};
+
+ if (WebInspector.experimentsSettings.sourceFrameAlwaysEditable.isEnabled())
+ this.startEditing();
}
WebInspector.SourceFrame.Events = {
@@ -106,7 +109,7 @@ WebInspector.SourceFrame.prototype = {
get statusBarItems()
{
- return [this._editButton.element];
+ return WebInspector.experimentsSettings.sourceFrameAlwaysEditable.isEnabled() ? [] : [this._editButton.element];
},
get loaded()
@@ -568,8 +571,12 @@ WebInspector.SourceFrame.prototype = {
cancelEditing: function()
{
+ if (WebInspector.experimentsSettings.sourceFrameAlwaysEditable.isEnabled())
+ return false;
+
this._restoreViewerState();
this.setReadOnly(true);
+ return true;
},
get readOnly()
@@ -579,9 +586,10 @@ WebInspector.SourceFrame.prototype = {
setReadOnly: function(readOnly)
{
+ if (readOnly && WebInspector.experimentsSettings.sourceFrameAlwaysEditable.isEnabled())
+ return;
this._textViewer.readOnly = readOnly;
this._editButton.toggled = !readOnly;
- WebInspector.markBeingEdited(this._textViewer.element, !readOnly);
}
}
@@ -620,7 +628,7 @@ WebInspector.TextViewerDelegateForSourceFrame.prototype = {
cancelEditing: function()
{
- this._sourceFrame.cancelEditing();
+ return this._sourceFrame.cancelEditing();
},
populateLineGutterContextMenu: function(contextMenu, lineNumber)
diff --git a/Source/WebCore/inspector/front-end/TabbedPane.js b/Source/WebCore/inspector/front-end/TabbedPane.js
index 9b59cfcee..80e71f75d 100644
--- a/Source/WebCore/inspector/front-end/TabbedPane.js
+++ b/Source/WebCore/inspector/front-end/TabbedPane.js
@@ -484,7 +484,7 @@ WebInspector.TabbedPaneTab.prototype = {
},
/**
- * @type {string=}
+ * @type {string|undefined}
*/
get tooltip()
{
diff --git a/Source/WebCore/inspector/front-end/TextViewer.js b/Source/WebCore/inspector/front-end/TextViewer.js
index 0066e9a7b..eb44a5e15 100644
--- a/Source/WebCore/inspector/front-end/TextViewer.js
+++ b/Source/WebCore/inspector/front-end/TextViewer.js
@@ -329,8 +329,7 @@ WebInspector.TextViewer.prototype = {
if (this.readOnly)
return false;
- this._delegate.cancelEditing();
- return true;
+ return this._delegate.cancelEditing();
}
}
diff --git a/Source/WebCore/inspector/front-end/elementsPanel.css b/Source/WebCore/inspector/front-end/elementsPanel.css
index 337acce8f..d720c5438 100644
--- a/Source/WebCore/inspector/front-end/elementsPanel.css
+++ b/Source/WebCore/inspector/front-end/elementsPanel.css
@@ -31,6 +31,10 @@
white-space: nowrap;
}
+#elements-content {
+ padding-left: 0;
+}
+
#elements-content > ol {
display: inline-block;
}
diff --git a/Source/WebCore/inspector/front-end/externs.js b/Source/WebCore/inspector/front-end/externs.js
index 05b6f50a8..f7421f9a2 100644
--- a/Source/WebCore/inspector/front-end/externs.js
+++ b/Source/WebCore/inspector/front-end/externs.js
@@ -184,3 +184,5 @@ WebInspector.showPanel = function(panel)
* @type {string}
*/
WebInspector.inspectedPageDomain;
+
+WebInspector.isCompactMode = function() { return false; }
diff --git a/Source/WebCore/inspector/front-end/treeoutline.js b/Source/WebCore/inspector/front-end/treeoutline.js
index 84b70aa34..3144ee4e0 100644
--- a/Source/WebCore/inspector/front-end/treeoutline.js
+++ b/Source/WebCore/inspector/front-end/treeoutline.js
@@ -539,7 +539,7 @@ TreeOutline.prototype._searchInputKeyDown = function(event)
/**
* @param {string} searchText
- * @param {TreeElement=} startTreeElement
+ * @param {TreeElement} startTreeElement
* @param {boolean} skipStartTreeElement
*/
TreeOutline.prototype._nextSearchMatch = function(searchText, startTreeElement, skipStartTreeElement)
diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp
index de47c2a2c..1e38660bf 100644
--- a/Source/WebCore/loader/DocumentLoader.cpp
+++ b/Source/WebCore/loader/DocumentLoader.cpp
@@ -233,7 +233,17 @@ void DocumentLoader::stopLoading()
// Appcache uses ResourceHandle directly, DocumentLoader doesn't count these loads.
m_applicationCacheHost->stopLoadingInFrame(m_frame);
- if (!loading)
+ if (!loading) {
+ // If something above restarted loading we might run into mysterious crashes like
+ // https://bugs.webkit.org/show_bug.cgi?id=62764 and <rdar://problem/9328684>
+ ASSERT(!m_loading);
+ return;
+ }
+
+ // We might run in to infinite recursion if we're stopping loading as the result of
+ // detaching from the frame, so break out of that recursion here.
+ // See <rdar://problem/9673866> for more details.
+ if (m_isStopping)
return;
RefPtr<Frame> protectFrame(m_frame);
@@ -396,6 +406,10 @@ void DocumentLoader::detachFromFrame()
{
ASSERT(m_frame);
+ // It never makes sense to have a document loader that is detached from its
+ // frame have any loads active, so go ahead and kill all the loads.
+ stopLoading();
+
m_applicationCacheHost->setDOMApplicationCache(0);
InspectorInstrumentation::loaderDetachedFromFrame(m_frame, this);
m_frame = 0;
@@ -640,7 +654,7 @@ bool DocumentLoader::scheduleArchiveLoad(ResourceLoader* loader, const ResourceR
#if ENABLE(WEB_ARCHIVE)
case Archive::WebArchive:
// WebArchiveDebugMode means we fail loads instead of trying to fetch them from the network if they're not in the archive.
- return m_frame->settings()->webArchiveDebugModeEnabled() && ArchiveFactory::isArchiveMimeType(responseMIMEType());
+ return m_frame->settings() && m_frame->settings()->webArchiveDebugModeEnabled() && ArchiveFactory::isArchiveMimeType(responseMIMEType());
#endif
#if ENABLE(MHTML)
case Archive::MHTML:
diff --git a/Source/WebCore/loader/FrameLoaderClient.h b/Source/WebCore/loader/FrameLoaderClient.h
index 28aa6d65e..35c689b22 100644
--- a/Source/WebCore/loader/FrameLoaderClient.h
+++ b/Source/WebCore/loader/FrameLoaderClient.h
@@ -78,6 +78,9 @@ namespace WebCore {
#endif
class HTMLPlugInElement;
class IntSize;
+#if ENABLE(WEB_INTENTS)
+ class IntentRequest;
+#endif
class KURL;
class MessageEvent;
class NavigationAction;
@@ -323,6 +326,10 @@ namespace WebCore {
// Returns true if the embedder intercepted the postMessage call
virtual bool willCheckAndDispatchMessageEvent(SecurityOrigin* /*target*/, MessageEvent*) const { return false; }
+
+#if ENABLE(WEB_INTENTS)
+ virtual void dispatchIntent(PassRefPtr<IntentRequest> intentRequest) { }
+#endif
};
} // namespace WebCore
diff --git a/Source/WebCore/loader/SubframeLoader.cpp b/Source/WebCore/loader/SubframeLoader.cpp
index 236c72893..af0d074cd 100644
--- a/Source/WebCore/loader/SubframeLoader.cpp
+++ b/Source/WebCore/loader/SubframeLoader.cpp
@@ -109,7 +109,7 @@ bool SubframeLoader::requestPlugin(HTMLPlugInImageElement* ownerElement, const K
// as opposed to third-party code such as Flash. The user agent decides whether or not they are
// permitted, rather than WebKit.
&& !MIMETypeRegistry::isApplicationPluginMIMEType(mimeType))
- || (!settings->isJavaEnabled() && MIMETypeRegistry::isJavaAppletMIMEType(mimeType)))
+ || ((!settings || !settings->isJavaEnabled()) && MIMETypeRegistry::isJavaAppletMIMEType(mimeType)))
return false;
if (m_frame->document()) {
diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp
index 703517bca..b9a1d7e3e 100644
--- a/Source/WebCore/loader/SubresourceLoader.cpp
+++ b/Source/WebCore/loader/SubresourceLoader.cpp
@@ -211,17 +211,24 @@ void SubresourceLoader::didReceiveData(const char* data, int length, long long e
RefPtr<SubresourceLoader> protect(this);
ResourceLoader::didReceiveData(data, length, encodedDataLength, allAtOnce);
- if (m_resource->response().httpStatusCode() >= 400 && !m_resource->shouldIgnoreHTTPStatusCodeErrors()) {
- m_resource->error(CachedResource::LoadError);
- m_state = Finishing;
- cancel();
+ if (errorLoadingResource())
return;
- }
if (!m_loadingMultipartContent)
sendDataToResource(data, length);
}
+bool SubresourceLoader::errorLoadingResource()
+{
+ if (m_resource->response().httpStatusCode() < 400 || m_resource->shouldIgnoreHTTPStatusCodeErrors())
+ return false;
+
+ m_resource->error(CachedResource::LoadError);
+ m_state = Finishing;
+ cancel();
+ return true;
+}
+
void SubresourceLoader::sendDataToResource(const char* data, int length)
{
// There are two cases where we might need to create our own SharedBuffer instead of copying the one in ResourceLoader.
diff --git a/Source/WebCore/loader/SubresourceLoader.h b/Source/WebCore/loader/SubresourceLoader.h
index 2da303917..3cf2f3661 100644
--- a/Source/WebCore/loader/SubresourceLoader.h
+++ b/Source/WebCore/loader/SubresourceLoader.h
@@ -71,6 +71,7 @@ private:
#endif
virtual void releaseResources();
+ bool errorLoadingResource();
void sendDataToResource(const char*, int);
enum SubresourceLoaderState {
diff --git a/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp b/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
index 04c2f2991..ec2d71bc0 100644
--- a/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
+++ b/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
@@ -138,7 +138,7 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& passedManifest
{
ASSERT(frame && frame->page());
- if (!frame->settings()->offlineWebApplicationCacheEnabled())
+ if (!frame->settings() || !frame->settings()->offlineWebApplicationCacheEnabled())
return;
DocumentLoader* documentLoader = frame->loader()->documentLoader();
@@ -193,7 +193,7 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& passedManifest
return;
// Don't change anything on disk if private browsing is enabled.
- if (!frame->settings() || frame->settings()->privateBrowsingEnabled()) {
+ if (frame->settings()->privateBrowsingEnabled()) {
postListenerTask(ApplicationCacheHost::CHECKING_EVENT, documentLoader);
postListenerTask(ApplicationCacheHost::ERROR_EVENT, documentLoader);
return;
@@ -211,7 +211,7 @@ void ApplicationCacheGroup::selectCache(Frame* frame, const KURL& passedManifest
void ApplicationCacheGroup::selectCacheWithoutManifestURL(Frame* frame)
{
- if (!frame->settings()->offlineWebApplicationCacheEnabled())
+ if (!frame->settings() || !frame->settings()->offlineWebApplicationCacheEnabled())
return;
DocumentLoader* documentLoader = frame->loader()->documentLoader();
diff --git a/Source/WebCore/loader/appcache/DOMApplicationCache.cpp b/Source/WebCore/loader/appcache/DOMApplicationCache.cpp
index 72c9fc989..042eb396f 100644
--- a/Source/WebCore/loader/appcache/DOMApplicationCache.cpp
+++ b/Source/WebCore/loader/appcache/DOMApplicationCache.cpp
@@ -40,7 +40,7 @@
namespace WebCore {
DOMApplicationCache::DOMApplicationCache(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (cacheHost)
@@ -52,7 +52,7 @@ void DOMApplicationCache::disconnectFrame()
ApplicationCacheHost* cacheHost = applicationCacheHost();
if (cacheHost)
cacheHost->setDOMApplicationCache(0);
- m_frame = 0;
+ DOMWindowProperty::disconnectFrame();
}
ApplicationCacheHost* DOMApplicationCache::applicationCacheHost() const
diff --git a/Source/WebCore/loader/appcache/DOMApplicationCache.h b/Source/WebCore/loader/appcache/DOMApplicationCache.h
index 022841ce7..2ca44c1b3 100644
--- a/Source/WebCore/loader/appcache/DOMApplicationCache.h
+++ b/Source/WebCore/loader/appcache/DOMApplicationCache.h
@@ -27,6 +27,7 @@
#define DOMApplicationCache_h
#include "ApplicationCacheHost.h"
+#include "DOMWindowProperty.h"
#include "EventNames.h"
#include "EventTarget.h"
#include <wtf/Forward.h>
@@ -41,13 +42,12 @@ namespace WebCore {
class Frame;
class KURL;
-class DOMApplicationCache : public RefCounted<DOMApplicationCache>, public EventTarget {
+class DOMApplicationCache : public RefCounted<DOMApplicationCache>, public EventTarget, public DOMWindowProperty {
public:
static PassRefPtr<DOMApplicationCache> create(Frame* frame) { return adoptRef(new DOMApplicationCache(frame)); }
~DOMApplicationCache() { ASSERT(!m_frame); }
- Frame* frame() const { return m_frame; }
- void disconnectFrame();
+ virtual void disconnectFrame() OVERRIDE;
unsigned short status() const;
void update(ExceptionCode&);
@@ -75,7 +75,7 @@ public:
static const AtomicString& toEventType(ApplicationCacheHost::EventID id);
private:
- DOMApplicationCache(Frame*);
+ explicit DOMApplicationCache(Frame*);
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
@@ -84,7 +84,6 @@ private:
ApplicationCacheHost* applicationCacheHost() const;
- Frame* m_frame;
EventTargetData m_eventTargetData;
};
diff --git a/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp b/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp
index 15ab887f8..5008a16b4 100644
--- a/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp
+++ b/Source/WebCore/loader/cf/SubresourceLoaderCF.cpp
@@ -36,13 +36,16 @@ void SubresourceLoader::didReceiveDataArray(CFArrayRef dataArray)
ResourceLoader::didReceiveDataArray(dataArray);
+ if (errorLoadingResource())
+ return;
+
// A subresource loader does not load multipart sections progressively.
// So don't deliver any data to the loader yet.
if (!m_loadingMultipartContent) {
CFIndex arrayCount = CFArrayGetCount(dataArray);
for (CFIndex i = 0; i < arrayCount; ++i) {
CFDataRef data = reinterpret_cast<CFDataRef>(CFArrayGetValueAtIndex(dataArray, i));
- didReceiveData(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), static_cast<int>(CFDataGetLength(data)), -1, false);
+ sendDataToResource(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), static_cast<int>(CFDataGetLength(data)));
}
}
}
diff --git a/Source/WebCore/page/BarInfo.cpp b/Source/WebCore/page/BarInfo.cpp
index b6ab68619..36b2ad6a7 100644
--- a/Source/WebCore/page/BarInfo.cpp
+++ b/Source/WebCore/page/BarInfo.cpp
@@ -36,21 +36,11 @@
namespace WebCore {
BarInfo::BarInfo(Frame* frame, Type type)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
, m_type(type)
{
}
-Frame* BarInfo::frame() const
-{
- return m_frame;
-}
-
-void BarInfo::disconnectFrame()
-{
- m_frame = 0;
-}
-
BarInfo::Type BarInfo::type() const
{
return m_type;
diff --git a/Source/WebCore/page/BarInfo.h b/Source/WebCore/page/BarInfo.h
index 376b8fc6d..b369b6e4c 100644
--- a/Source/WebCore/page/BarInfo.h
+++ b/Source/WebCore/page/BarInfo.h
@@ -29,6 +29,7 @@
#ifndef BarInfo_h
#define BarInfo_h
+#include "DOMWindowProperty.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -36,22 +37,17 @@ namespace WebCore {
class Frame;
- class BarInfo : public RefCounted<BarInfo> {
+ class BarInfo : public RefCounted<BarInfo>, public DOMWindowProperty {
public:
enum Type { Locationbar, Menubar, Personalbar, Scrollbars, Statusbar, Toolbar };
static PassRefPtr<BarInfo> create(Frame* frame, Type type) { return adoptRef(new BarInfo(frame, type)); }
- Frame* frame() const;
- void disconnectFrame();
-
Type type() const;
-
bool visible() const;
private:
BarInfo(Frame*, Type);
- Frame* m_frame;
Type m_type;
};
diff --git a/Source/WebCore/page/ChromeClient.h b/Source/WebCore/page/ChromeClient.h
index 0bc863bd8..982a7cd15 100644
--- a/Source/WebCore/page/ChromeClient.h
+++ b/Source/WebCore/page/ChromeClient.h
@@ -258,6 +258,7 @@ namespace WebCore {
PluginTrigger = 1 << 2,
CanvasTrigger = 1 << 3,
AnimationTrigger = 1 << 4,
+ FilterTrigger = 1 << 5,
AllTriggers = 0xFFFFFFFF
};
typedef unsigned CompositingTriggerFlags;
diff --git a/Source/WebCore/page/Console.cpp b/Source/WebCore/page/Console.cpp
index 011cd6c48..3cc4c2ebf 100644
--- a/Source/WebCore/page/Console.cpp
+++ b/Source/WebCore/page/Console.cpp
@@ -56,7 +56,7 @@
namespace WebCore {
Console::Console(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
@@ -64,18 +64,6 @@ Console::~Console()
{
}
-Frame* Console::frame() const
-{
- return m_frame;
-}
-
-void Console::disconnectFrame()
-{
- if (m_memory)
- m_memory = 0;
- m_frame = 0;
-}
-
static void printSourceURLAndLine(const String& sourceURL, unsigned lineNumber)
{
if (!sourceURL.isEmpty()) {
@@ -348,10 +336,11 @@ void Console::warn(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCallS
addMessage(LogMessageType, WarningMessageLevel, arguments, callStack);
}
-MemoryInfo* Console::memory() const
+PassRefPtr<MemoryInfo> Console::memory() const
{
- m_memory = MemoryInfo::create(m_frame);
- return m_memory.get();
+ // FIXME: Because we create a new object here each time,
+ // console.memory !== console.memory, which seems wrong.
+ return MemoryInfo::create(m_frame);
}
static bool printExceptions = false;
diff --git a/Source/WebCore/page/Console.h b/Source/WebCore/page/Console.h
index 87fe40746..5a1000443 100644
--- a/Source/WebCore/page/Console.h
+++ b/Source/WebCore/page/Console.h
@@ -30,6 +30,7 @@
#define Console_h
#include "ConsoleTypes.h"
+#include "DOMWindowProperty.h"
#include "ScriptProfile.h"
#include "ScriptState.h"
#include <wtf/Forward.h>
@@ -48,14 +49,11 @@ class ScriptCallStack;
typedef Vector<RefPtr<ScriptProfile> > ProfilesArray;
#endif
-class Console : public RefCounted<Console> {
+class Console : public RefCounted<Console>, public DOMWindowProperty {
public:
static PassRefPtr<Console> create(Frame* frame) { return adoptRef(new Console(frame)); }
virtual ~Console();
- Frame* frame() const;
- void disconnectFrame();
-
void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
void addMessage(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack);
@@ -85,19 +83,17 @@ public:
static bool shouldPrintExceptions();
static void setShouldPrintExceptions(bool);
- MemoryInfo* memory() const;
+ PassRefPtr<MemoryInfo> memory() const;
private:
inline Page* page() const;
void addMessage(MessageType, MessageLevel, PassRefPtr<ScriptArguments>, PassRefPtr<ScriptCallStack>, bool acceptNoArguments = false);
- Console(Frame*);
+ explicit Console(Frame*);
- Frame* m_frame;
#if ENABLE(JAVASCRIPT_DEBUGGER)
ProfilesArray m_profiles;
#endif
- mutable RefPtr<MemoryInfo> m_memory;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/ContentSecurityPolicy.h b/Source/WebCore/page/ContentSecurityPolicy.h
index d94e317fa..fa7632465 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.h
+++ b/Source/WebCore/page/ContentSecurityPolicy.h
@@ -52,6 +52,8 @@ public:
};
void didReceiveHeader(const String&, HeaderType);
+ String policy() { return m_header; }
+ HeaderType headerType() { return m_reportOnly ? ReportOnly : EnforcePolicy; }
bool allowJavaScriptURLs() const;
bool allowInlineEventHandlers() const;
diff --git a/Source/WebCore/page/DOMSelection.cpp b/Source/WebCore/page/DOMSelection.cpp
index 23ad2de27..97a438dd0 100644
--- a/Source/WebCore/page/DOMSelection.cpp
+++ b/Source/WebCore/page/DOMSelection.cpp
@@ -54,20 +54,10 @@ static Node* selectionShadowAncestor(Frame* frame)
}
DOMSelection::DOMSelection(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-Frame* DOMSelection::frame() const
-{
- return m_frame;
-}
-
-void DOMSelection::disconnectFrame()
-{
- m_frame = 0;
-}
-
const VisibleSelection& DOMSelection::visibleSelection() const
{
ASSERT(m_frame);
@@ -419,7 +409,7 @@ void DOMSelection::addRange(Range* r)
}
} else {
// We don't support discontiguous selection. We don't do anything if r and range don't intersect.
- if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1) {
+ if (r->compareBoundaryPoints(Range::END_TO_START, range.get(), ec) < 1 && !ec) {
if (r->compareBoundaryPoints(Range::END_TO_END, range.get(), ec) == -1)
// The original range contains r.
selection->setSelection(VisibleSelection(range.get()));
diff --git a/Source/WebCore/page/DOMSelection.h b/Source/WebCore/page/DOMSelection.h
index b5fd19768..9803acca2 100644
--- a/Source/WebCore/page/DOMSelection.h
+++ b/Source/WebCore/page/DOMSelection.h
@@ -30,6 +30,7 @@
#ifndef DOMSelection_h
#define DOMSelection_h
+#include "DOMWindowProperty.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -43,13 +44,10 @@ namespace WebCore {
typedef int ExceptionCode;
- class DOMSelection : public RefCounted<DOMSelection> {
+ class DOMSelection : public RefCounted<DOMSelection>, public DOMWindowProperty {
public:
static PassRefPtr<DOMSelection> create(Frame* frame) { return adoptRef(new DOMSelection(frame)); }
- Frame* frame() const;
- void disconnectFrame();
-
// Safari Selection Object API
// These methods return the valid equivalents of internal editing positions.
Node* baseNode() const;
@@ -90,13 +88,12 @@ namespace WebCore {
void empty();
private:
- DOMSelection(Frame*);
+ explicit DOMSelection(Frame*);
// Convenience method for accessors, does not NULL check m_frame.
const VisibleSelection& visibleSelection() const;
bool isValidForPosition(Node*) const;
- Frame* m_frame;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/DOMWindow.cpp b/Source/WebCore/page/DOMWindow.cpp
index 346eb96c7..093266eca 100644
--- a/Source/WebCore/page/DOMWindow.cpp
+++ b/Source/WebCore/page/DOMWindow.cpp
@@ -397,16 +397,13 @@ bool DOMWindow::canShowModalDialogNow(const Frame* frame)
}
DOMWindow::DOMWindow(Frame* frame)
- : m_shouldPrintWhenFinishedLoading(false)
- , m_frame(frame)
+ : FrameDestructionObserver(frame)
+ , m_shouldPrintWhenFinishedLoading(false)
{
}
DOMWindow::~DOMWindow()
{
- if (m_frame)
- m_frame->clearFormerDOMWindow(this);
-
ASSERT(!m_screen);
ASSERT(!m_selection);
ASSERT(!m_history);
@@ -473,98 +470,60 @@ void DOMWindow::setSecurityOrigin(SecurityOrigin* securityOrigin)
m_securityOrigin = securityOrigin;
}
-void DOMWindow::disconnectFrame()
+void DOMWindow::frameDestroyed()
{
- m_frame = 0;
+ FrameDestructionObserver::frameDestroyed();
clear();
}
+void DOMWindow::registerProperty(DOMWindowProperty* property)
+{
+ m_properties.add(property);
+}
+
+void DOMWindow::unregisterProperty(DOMWindowProperty* property)
+{
+ m_properties.remove(property);
+}
+
void DOMWindow::clear()
{
- if (m_screen)
- m_screen->disconnectFrame();
- m_screen = 0;
+ HashSet<DOMWindowProperty*>::iterator stop = m_properties.end();
+ for (HashSet<DOMWindowProperty*>::iterator it = m_properties.begin(); it != stop; ++it)
+ (*it)->disconnectFrame();
+ m_properties.clear();
- if (m_selection)
- m_selection->disconnectFrame();
+ m_screen = 0;
m_selection = 0;
-
- if (m_history)
- m_history->disconnectFrame();
m_history = 0;
-
m_crypto = 0;
-
- if (m_locationbar)
- m_locationbar->disconnectFrame();
m_locationbar = 0;
-
- if (m_menubar)
- m_menubar->disconnectFrame();
m_menubar = 0;
-
- if (m_personalbar)
- m_personalbar->disconnectFrame();
m_personalbar = 0;
-
- if (m_scrollbars)
- m_scrollbars->disconnectFrame();
m_scrollbars = 0;
-
- if (m_statusbar)
- m_statusbar->disconnectFrame();
m_statusbar = 0;
-
- if (m_toolbar)
- m_toolbar->disconnectFrame();
m_toolbar = 0;
-
- if (m_console)
- m_console->disconnectFrame();
m_console = 0;
-
- if (m_navigator)
- m_navigator->disconnectFrame();
m_navigator = 0;
-
#if ENABLE(WEB_TIMING)
- if (m_performance)
- m_performance->disconnectFrame();
m_performance = 0;
#endif
-
- if (m_location)
- m_location->disconnectFrame();
m_location = 0;
-
- if (m_media)
- m_media->disconnectFrame();
m_media = 0;
-
- if (m_sessionStorage)
- m_sessionStorage->disconnectFrame();
m_sessionStorage = 0;
-
- if (m_localStorage)
- m_localStorage->disconnectFrame();
m_localStorage = 0;
-
- if (m_applicationCache)
- m_applicationCache->disconnectFrame();
m_applicationCache = 0;
-
#if ENABLE(NOTIFICATIONS)
+ // FIXME: Notifications shouldn't have different disconnection logic than
+ // the rest of the DOMWindowProperties.
resetNotifications();
#endif
-
#if ENABLE(INDEXED_DATABASE)
m_idbFactory = 0;
#endif
-
#if ENABLE(BLOB)
m_domURL = 0;
#endif
-
#if ENABLE(QUOTA)
m_storageInfo = 0;
#endif
@@ -1422,23 +1381,6 @@ double DOMWindow::devicePixelRatio() const
return page->deviceScaleFactor();
}
-#if ENABLE(SQL_DATABASE)
-PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
-{
- if (!isCurrentlyDisplayedInFrame())
- return 0;
-
- RefPtr<Database> database = 0;
- if (m_frame && AbstractDatabase::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase())
- database = Database::openDatabase(m_frame->document(), name, version, displayName, estimatedSize, creationCallback, ec);
-
- if (!database && !ec)
- ec = SECURITY_ERR;
-
- return database;
-}
-#endif
-
void DOMWindow::scrollBy(int x, int y) const
{
if (!isCurrentlyDisplayedInFrame())
diff --git a/Source/WebCore/page/DOMWindow.h b/Source/WebCore/page/DOMWindow.h
index c3e7ac453..cc297f797 100644
--- a/Source/WebCore/page/DOMWindow.h
+++ b/Source/WebCore/page/DOMWindow.h
@@ -28,6 +28,7 @@
#define DOMWindow_h
#include "EventTarget.h"
+#include "FrameDestructionObserver.h"
#include "KURL.h"
namespace WebCore {
@@ -40,6 +41,7 @@ namespace WebCore {
class DOMApplicationCache;
class DOMSelection;
class DOMURL;
+ class DOMWindowProperty;
class Database;
class DatabaseCallback;
class Document;
@@ -80,7 +82,7 @@ namespace WebCore {
enum SetLocationLocking { LockHistoryBasedOnGestureState, LockHistoryAndBackForwardList };
- class DOMWindow : public RefCounted<DOMWindow>, public EventTarget {
+ class DOMWindow : public RefCounted<DOMWindow>, public EventTarget, public FrameDestructionObserver {
public:
static PassRefPtr<DOMWindow> create(Frame* frame) { return adoptRef(new DOMWindow(frame)); }
virtual ~DOMWindow();
@@ -90,8 +92,10 @@ namespace WebCore {
virtual DOMWindow* toDOMWindow();
- Frame* frame() const { return m_frame; }
- void disconnectFrame();
+ virtual void frameDestroyed() OVERRIDE;
+
+ void registerProperty(DOMWindowProperty*);
+ void unregisterProperty(DOMWindowProperty*);
void clear();
@@ -351,10 +355,6 @@ namespace WebCore {
DOMURL* webkitURL() const;
#endif
-#if ENABLE(SQL_DATABASE)
- PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
-#endif
-
#if ENABLE(DEVICE_ORIENTATION)
DEFINE_ATTRIBUTE_EVENT_LISTENER(devicemotion);
DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
@@ -414,15 +414,15 @@ namespace WebCore {
Performance* performance() const;
#endif
- private:
- DOMWindow(Frame*);
-
// FIXME: When this DOMWindow is no longer the active DOMWindow (i.e.,
// when its document is no longer the document that is displayed in its
// frame), we would like to zero out m_frame to avoid being confused
// by the document that is currently active in m_frame.
bool isCurrentlyDisplayedInFrame() const;
+ private:
+ explicit DOMWindow(Frame*);
+
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
virtual EventTargetData* eventTargetData();
@@ -437,7 +437,9 @@ namespace WebCore {
KURL m_url;
bool m_shouldPrintWhenFinishedLoading;
- Frame* m_frame;
+
+ HashSet<DOMWindowProperty*> m_properties;
+
mutable RefPtr<Screen> m_screen;
mutable RefPtr<DOMSelection> m_selection;
mutable RefPtr<History> m_history;
diff --git a/Source/WebCore/page/DOMWindow.idl b/Source/WebCore/page/DOMWindow.idl
index 19668e3d5..9ca8bd3cf 100644
--- a/Source/WebCore/page/DOMWindow.idl
+++ b/Source/WebCore/page/DOMWindow.idl
@@ -163,10 +163,6 @@ module window {
in [Optional=CallWithDefaultValue] WebKitPoint p);
readonly attribute [EnabledAtRuntime] DOMApplicationCache applicationCache;
-#if defined(ENABLE_SQL_DATABASE) && ENABLE_SQL_DATABASE
- [EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
- raises(DOMException);
-#endif
readonly attribute [EnabledAtRuntime] Storage sessionStorage
getter raises(DOMException);
@@ -607,6 +603,8 @@ module window {
attribute [EnabledAtRuntime=webkitVideoTrack] TrackEventConstructor TrackEvent;
#endif
+ attribute [Conditional=WEB_INTENTS] IntentConstructor Intent; // Usable with the new operator
+
attribute DOMPluginConstructor Plugin;
attribute DOMPluginArrayConstructor PluginArray;
@@ -792,9 +790,6 @@ module window {
#endif
#endif
- attribute [Conditional=SQL_DATABASE] SQLExceptionConstructor SQLException;
-
-
attribute DOMFormDataConstructor FormData;
attribute [Conditional=BLOB|FILE_SYSTEM] FileErrorConstructor FileError;
diff --git a/Source/WebCore/page/DOMWindowProperty.cpp b/Source/WebCore/page/DOMWindowProperty.cpp
new file mode 100644
index 000000000..b6a9aba43
--- /dev/null
+++ b/Source/WebCore/page/DOMWindowProperty.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2011 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 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 "DOMWindowProperty.h"
+
+#include "DOMWindow.h"
+#include "Frame.h"
+
+namespace WebCore {
+
+DOMWindowProperty::DOMWindowProperty(Frame* frame)
+ : m_frame(frame)
+{
+ if (m_frame)
+ m_frame->domWindow()->registerProperty(this);
+}
+
+DOMWindowProperty::~DOMWindowProperty()
+{
+ if (m_frame)
+ m_frame->domWindow()->unregisterProperty(this);
+}
+
+void DOMWindowProperty::disconnectFrame()
+{
+ m_frame = 0;
+}
+
+}
diff --git a/Source/WebCore/page/DOMWindowProperty.h b/Source/WebCore/page/DOMWindowProperty.h
new file mode 100644
index 000000000..41baf437e
--- /dev/null
+++ b/Source/WebCore/page/DOMWindowProperty.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 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 DOMWindowProperty_h
+#define DOMWindowProperty_h
+
+namespace WebCore {
+
+class Frame;
+
+class DOMWindowProperty {
+public:
+ explicit DOMWindowProperty(Frame*);
+ virtual void disconnectFrame();
+
+ Frame* frame() const { return m_frame; }
+
+protected:
+ virtual ~DOMWindowProperty();
+
+ Frame* m_frame;
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp
index 79425629b..5d834df84 100644
--- a/Source/WebCore/page/DragController.cpp
+++ b/Source/WebCore/page/DragController.cpp
@@ -626,6 +626,7 @@ Node* DragController::draggableNode(const Frame* src, Node* startNode, const Int
if (dragMode == DRAG_AUTO) {
if ((m_dragSourceAction & DragSourceActionImage)
&& node->hasTagName(HTMLNames::imgTag)
+ && src->settings()
&& src->settings()->loadsImagesAutomatically()) {
state.m_dragType = static_cast<DragSourceAction>(state.m_dragType | DragSourceActionImage);
return node;
diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp
index c21eb7e25..1f470537c 100644
--- a/Source/WebCore/page/EventHandler.cpp
+++ b/Source/WebCore/page/EventHandler.cpp
@@ -771,7 +771,7 @@ bool EventHandler::handleMouseReleaseEvent(const MouseEventWithHitTestResults& e
&& event.event().button() != RightButton) {
VisibleSelection newSelection;
Node* node = targetNode(event);
- bool caretBrowsing = m_frame->settings()->caretBrowsingEnabled();
+ bool caretBrowsing = m_frame->settings() && m_frame->settings()->caretBrowsingEnabled();
if (node && (caretBrowsing || node->rendererIsEditable()) && node->renderer()) {
VisiblePosition pos = node->renderer()->positionForPoint(event.localPoint());
newSelection = VisibleSelection(pos);
diff --git a/Source/WebCore/page/FocusController.cpp b/Source/WebCore/page/FocusController.cpp
index 4f58df3ed..b18d4d14d 100644
--- a/Source/WebCore/page/FocusController.cpp
+++ b/Source/WebCore/page/FocusController.cpp
@@ -244,7 +244,7 @@ bool FocusController::advanceFocusInDocumentOrder(FocusDirection direction, Keyb
Node* currentNode = document->focusedNode();
// FIXME: Not quite correct when it comes to focus transitions leaving/entering the WebView itself
- bool caretBrowsing = focusedOrMainFrame()->settings()->caretBrowsingEnabled();
+ bool caretBrowsing = frame->settings() && frame->settings()->caretBrowsingEnabled();
if (caretBrowsing && !currentNode)
currentNode = frame->selection()->start().deprecatedNode();
diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp
index 392a473b3..e1f5bcf99 100644
--- a/Source/WebCore/page/Frame.cpp
+++ b/Source/WebCore/page/Frame.cpp
@@ -47,6 +47,7 @@
#include "EventNames.h"
#include "FloatQuad.h"
#include "FocusController.h"
+#include "FrameDestructionObserver.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameView.h"
@@ -218,13 +219,6 @@ Frame::~Frame()
disconnectOwnerElement();
- if (m_domWindow)
- m_domWindow->disconnectFrame();
-
- HashSet<DOMWindow*>::iterator end = m_liveFormerWindows.end();
- for (HashSet<DOMWindow*>::iterator it = m_liveFormerWindows.begin(); it != end; ++it)
- (*it)->disconnectFrame();
-
HashSet<FrameDestructionObserver*>::iterator stop = m_destructionObservers.end();
for (HashSet<FrameDestructionObserver*>::iterator it = m_destructionObservers.begin(); it != stop; ++it)
(*it)->frameDestroyed();
@@ -235,24 +229,6 @@ Frame::~Frame()
}
}
-FrameDestructionObserver::FrameDestructionObserver(Frame* frame)
- : m_frame(frame)
-{
- if (m_frame)
- m_frame->addDestructionObserver(this);
-}
-
-FrameDestructionObserver::~FrameDestructionObserver()
-{
- if (m_frame)
- m_frame->removeDestructionObserver(this);
-}
-
-void FrameDestructionObserver::frameDestroyed()
-{
- m_frame = 0;
-}
-
void Frame::addDestructionObserver(FrameDestructionObserver* observer)
{
m_destructionObservers.add(observer);
@@ -593,10 +569,8 @@ void Frame::injectUserScriptsForWorld(DOMWrapperWorld* world, const UserScriptVe
void Frame::clearDOMWindow()
{
- if (m_domWindow) {
- m_liveFormerWindows.add(m_domWindow.get());
+ if (m_domWindow)
m_domWindow->clear();
- }
m_domWindow = 0;
}
@@ -661,10 +635,8 @@ void Frame::clearTimers()
void Frame::setDOMWindow(DOMWindow* domWindow)
{
- if (m_domWindow) {
- m_liveFormerWindows.add(m_domWindow.get());
+ if (m_domWindow)
m_domWindow->clear();
- }
m_domWindow = domWindow;
}
@@ -686,11 +658,6 @@ DOMWindow* Frame::domWindow() const
return m_domWindow.get();
}
-void Frame::clearFormerDOMWindow(DOMWindow* window)
-{
- m_liveFormerWindows.remove(window);
-}
-
void Frame::pageDestroyed()
{
// FIXME: Rename this function, since it's called not only from Page destructor, but in several other cases.
diff --git a/Source/WebCore/page/Frame.h b/Source/WebCore/page/Frame.h
index f3600b40d..18da5f36a 100644
--- a/Source/WebCore/page/Frame.h
+++ b/Source/WebCore/page/Frame.h
@@ -63,7 +63,7 @@ typedef struct HBITMAP__* HBITMAP;
namespace WebCore {
class Document;
- class Frame;
+ class FrameDestructionObserver;
class FrameView;
class HTMLTableCellElement;
class RegularExpression;
@@ -74,18 +74,6 @@ namespace WebCore {
class TiledBackingStoreClient { };
#endif
- class FrameDestructionObserver {
- public:
- explicit FrameDestructionObserver(Frame*);
- virtual void frameDestroyed();
- Frame* frame() const { return m_frame; }
-
- protected:
- virtual ~FrameDestructionObserver();
-
- Frame* m_frame;
- };
-
class Frame : public RefCounted<Frame>, public TiledBackingStoreClient {
public:
static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
@@ -145,7 +133,6 @@ namespace WebCore {
DOMWindow* domWindow() const;
DOMWindow* existingDOMWindow() { return m_domWindow.get(); }
void setDOMWindow(DOMWindow*);
- void clearFormerDOMWindow(DOMWindow*);
void clearDOMWindow();
static Frame* frameForWidget(const Widget*);
@@ -224,7 +211,6 @@ namespace WebCore {
mutable NavigationScheduler m_navigationScheduler;
mutable RefPtr<DOMWindow> m_domWindow;
- HashSet<DOMWindow*> m_liveFormerWindows;
HTMLFrameOwnerElement* m_ownerElement;
RefPtr<FrameView> m_view;
diff --git a/Source/WebCore/page/FrameDestructionObserver.cpp b/Source/WebCore/page/FrameDestructionObserver.cpp
new file mode 100644
index 000000000..218f9ad8c
--- /dev/null
+++ b/Source/WebCore/page/FrameDestructionObserver.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 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 "FrameDestructionObserver.h"
+
+#include "Frame.h"
+
+namespace WebCore {
+
+FrameDestructionObserver::FrameDestructionObserver(Frame* frame)
+ : m_frame(frame)
+{
+ if (m_frame)
+ m_frame->addDestructionObserver(this);
+}
+
+FrameDestructionObserver::~FrameDestructionObserver()
+{
+ if (m_frame)
+ m_frame->removeDestructionObserver(this);
+}
+
+void FrameDestructionObserver::frameDestroyed()
+{
+ m_frame = 0;
+}
+
+}
diff --git a/Source/WebCore/page/FrameDestructionObserver.h b/Source/WebCore/page/FrameDestructionObserver.h
new file mode 100644
index 000000000..aea02223e
--- /dev/null
+++ b/Source/WebCore/page/FrameDestructionObserver.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2011 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 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 FrameDestructionObserver_h
+#define FrameDestructionObserver_h
+
+namespace WebCore {
+
+class Frame;
+
+class FrameDestructionObserver {
+public:
+ explicit FrameDestructionObserver(Frame*);
+ virtual void frameDestroyed();
+ Frame* frame() const { return m_frame; }
+
+protected:
+ virtual ~FrameDestructionObserver();
+
+ Frame* m_frame;
+};
+
+}
+
+#endif
diff --git a/Source/WebCore/page/Geolocation.cpp b/Source/WebCore/page/Geolocation.cpp
index 1daea7449..2703bcd1f 100644
--- a/Source/WebCore/page/Geolocation.cpp
+++ b/Source/WebCore/page/Geolocation.cpp
@@ -225,7 +225,7 @@ void Geolocation::Watchers::getNotifiersVector(GeoNotifierVector& copy) const
}
Geolocation::Geolocation(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
, m_service(GeolocationService::create(this))
#endif
@@ -273,7 +273,7 @@ void Geolocation::disconnectFrame()
reset();
if (m_frame && m_frame->document())
m_frame->document()->setUsingGeolocation(false);
- m_frame = 0;
+ DOMWindowProperty::disconnectFrame();
}
Geoposition* Geolocation::lastPosition()
@@ -762,7 +762,7 @@ void Geolocation::reset() {}
void Geolocation::disconnectFrame() {}
-Geolocation::Geolocation(Frame*) {}
+Geolocation::Geolocation(Frame*) : DOMWindowProperty(0) {}
Geolocation::~Geolocation() {}
diff --git a/Source/WebCore/page/Geolocation.h b/Source/WebCore/page/Geolocation.h
index b27d80b98..ea55cbf1f 100644
--- a/Source/WebCore/page/Geolocation.h
+++ b/Source/WebCore/page/Geolocation.h
@@ -27,6 +27,7 @@
#ifndef Geolocation_h
#define Geolocation_h
+#include "DOMWindowProperty.h"
#include "Geoposition.h"
#include "PositionCallback.h"
#include "PositionError.h"
@@ -47,25 +48,23 @@ class GeolocationError;
#endif
class Page;
-class Geolocation : public RefCounted<Geolocation>
+class Geolocation : public RefCounted<Geolocation>, public DOMWindowProperty
#if !ENABLE(CLIENT_BASED_GEOLOCATION) && ENABLE(GEOLOCATION)
, public GeolocationServiceClient
#endif
{
public:
static PassRefPtr<Geolocation> create(Frame* frame) { return adoptRef(new Geolocation(frame)); }
-
~Geolocation();
+ virtual void disconnectFrame() OVERRIDE;
void reset();
- void disconnectFrame();
-
+
void getCurrentPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
int watchPosition(PassRefPtr<PositionCallback>, PassRefPtr<PositionErrorCallback>, PassRefPtr<PositionOptions>);
void clearWatch(int watchId);
void setIsAllowed(bool);
- Frame* frame() const { return m_frame; }
#if ENABLE(CLIENT_BASED_GEOLOCATION)
void positionChanged();
@@ -79,8 +78,8 @@ private:
bool isAllowed() const { return m_allowGeolocation == Yes; }
bool isDenied() const { return m_allowGeolocation == No; }
-
- Geolocation(Frame*);
+
+ explicit Geolocation(Frame*);
Page* page() const;
@@ -172,7 +171,6 @@ private:
GeoNotifierSet m_oneShots;
Watchers m_watchers;
- Frame* m_frame;
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
OwnPtr<GeolocationService> m_service;
#endif
diff --git a/Source/WebCore/page/History.cpp b/Source/WebCore/page/History.cpp
index cbfc2bbdc..1f5a39f28 100644
--- a/Source/WebCore/page/History.cpp
+++ b/Source/WebCore/page/History.cpp
@@ -41,20 +41,10 @@
namespace WebCore {
History::History(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-Frame* History::frame() const
-{
- return m_frame;
-}
-
-void History::disconnectFrame()
-{
- m_frame = 0;
-}
-
unsigned History::length() const
{
if (!m_frame)
diff --git a/Source/WebCore/page/History.h b/Source/WebCore/page/History.h
index 9ec1914b3..bd50fccd2 100644
--- a/Source/WebCore/page/History.h
+++ b/Source/WebCore/page/History.h
@@ -26,6 +26,7 @@
#ifndef History_h
#define History_h
+#include "DOMWindowProperty.h"
#include "KURL.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
@@ -38,12 +39,9 @@ class ScriptExecutionContext;
class SerializedScriptValue;
typedef int ExceptionCode;
-class History : public RefCounted<History> {
+class History : public RefCounted<History>, public DOMWindowProperty {
public:
static PassRefPtr<History> create(Frame* frame) { return adoptRef(new History(frame)); }
-
- Frame* frame() const;
- void disconnectFrame();
unsigned length() const;
void back();
@@ -61,11 +59,9 @@ public:
void stateObjectAdded(PassRefPtr<SerializedScriptValue>, const String& title, const String& url, StateObjectType, ExceptionCode&);
private:
- History(Frame*);
+ explicit History(Frame*);
KURL urlForState(const String& url);
-
- Frame* m_frame;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/Location.cpp b/Source/WebCore/page/Location.cpp
index ca6f99875..1a2d2db99 100644
--- a/Source/WebCore/page/Location.cpp
+++ b/Source/WebCore/page/Location.cpp
@@ -40,15 +40,10 @@
namespace WebCore {
Location::Location(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-void Location::disconnectFrame()
-{
- m_frame = 0;
-}
-
inline const KURL& Location::url() const
{
ASSERT(m_frame);
diff --git a/Source/WebCore/page/Location.h b/Source/WebCore/page/Location.h
index 3a1047a61..b882671a8 100644
--- a/Source/WebCore/page/Location.h
+++ b/Source/WebCore/page/Location.h
@@ -29,6 +29,7 @@
#ifndef Location_h
#define Location_h
+#include "DOMWindowProperty.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
@@ -41,13 +42,10 @@ class KURL;
typedef int ExceptionCode;
-class Location : public RefCounted<Location> {
+class Location : public RefCounted<Location>, public DOMWindowProperty {
public:
static PassRefPtr<Location> create(Frame* frame) { return adoptRef(new Location(frame)); }
- Frame* frame() const { return m_frame; }
- void disconnectFrame();
-
void setHref(const String&, DOMWindow* activeWindow, DOMWindow* firstWindow);
String href() const;
@@ -74,11 +72,9 @@ public:
String toString() const { return href(); }
private:
- Location(Frame*);
+ explicit Location(Frame*);
const KURL& url() const;
-
- Frame* m_frame;
};
} // namespace WebCore
diff --git a/Source/WebCore/page/Navigator.cpp b/Source/WebCore/page/Navigator.cpp
index 4926632ee..c35e99496 100644
--- a/Source/WebCore/page/Navigator.cpp
+++ b/Source/WebCore/page/Navigator.cpp
@@ -59,13 +59,12 @@
namespace WebCore {
Navigator::Navigator(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
Navigator::~Navigator()
{
- disconnectFrame();
}
void Navigator::resetGeolocation()
@@ -74,23 +73,6 @@ void Navigator::resetGeolocation()
m_geolocation->reset();
}
-void Navigator::disconnectFrame()
-{
- if (m_plugins) {
- m_plugins->disconnectFrame();
- m_plugins = 0;
- }
- if (m_mimeTypes) {
- m_mimeTypes->disconnectFrame();
- m_mimeTypes = 0;
- }
- if (m_geolocation) {
- m_geolocation->disconnectFrame();
- m_geolocation = 0;
- }
- m_frame = 0;
-}
-
// If this function returns true, we need to hide the substring "4." that would otherwise
// appear in the appVersion string. This is to avoid problems with old versions of a
// library called OpenCube QuickMenu, which as of this writing is still being used on
diff --git a/Source/WebCore/page/Navigator.h b/Source/WebCore/page/Navigator.h
index 84f30bde3..07c9d2b4b 100644
--- a/Source/WebCore/page/Navigator.h
+++ b/Source/WebCore/page/Navigator.h
@@ -20,6 +20,7 @@
#ifndef Navigator_h
#define Navigator_h
+#include "DOMWindowProperty.h"
#include "NavigatorBase.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
@@ -40,14 +41,12 @@ class PluginData;
typedef int ExceptionCode;
-class Navigator : public NavigatorBase, public RefCounted<Navigator> {
+class Navigator : public NavigatorBase, public RefCounted<Navigator>, public DOMWindowProperty {
public:
static PassRefPtr<Navigator> create(Frame* frame) { return adoptRef(new Navigator(frame)); }
virtual ~Navigator();
void resetGeolocation();
- void disconnectFrame();
- Frame* frame() const { return m_frame; }
String appVersion() const;
String language() const;
@@ -81,8 +80,8 @@ public:
#endif
private:
- Navigator(Frame*);
- Frame* m_frame;
+ explicit Navigator(Frame*);
+
mutable RefPtr<DOMPluginArray> m_plugins;
mutable RefPtr<DOMMimeTypeArray> m_mimeTypes;
mutable RefPtr<Geolocation> m_geolocation;
diff --git a/Source/WebCore/page/Performance.cpp b/Source/WebCore/page/Performance.cpp
index 4e130ea8f..36ddcd242 100644
--- a/Source/WebCore/page/Performance.cpp
+++ b/Source/WebCore/page/Performance.cpp
@@ -42,34 +42,13 @@
namespace WebCore {
Performance::Performance(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-Frame* Performance::frame() const
+PassRefPtr<MemoryInfo> Performance::memory() const
{
- return m_frame;
-}
-
-void Performance::disconnectFrame()
-{
- if (m_memory)
- m_memory = 0;
- if (m_navigation) {
- m_navigation->disconnectFrame();
- m_navigation = 0;
- }
- if (m_timing) {
- m_timing->disconnectFrame();
- m_timing = 0;
- }
- m_frame = 0;
-}
-
-MemoryInfo* Performance::memory() const
-{
- m_memory = MemoryInfo::create(m_frame);
- return m_memory.get();
+ return MemoryInfo::create(m_frame);
}
PerformanceNavigation* Performance::navigation() const
diff --git a/Source/WebCore/page/Performance.h b/Source/WebCore/page/Performance.h
index be9e124e0..78263605e 100644
--- a/Source/WebCore/page/Performance.h
+++ b/Source/WebCore/page/Performance.h
@@ -33,6 +33,7 @@
#if ENABLE(WEB_TIMING)
+#include "DOMWindowProperty.h"
#include "MemoryInfo.h"
#include "PerformanceNavigation.h"
#include "PerformanceTiming.h"
@@ -42,27 +43,23 @@
namespace WebCore {
-class Performance : public RefCounted<Performance> {
+class Performance : public RefCounted<Performance>, public DOMWindowProperty {
public:
static PassRefPtr<Performance> create(Frame* frame) { return adoptRef(new Performance(frame)); }
- Frame* frame() const;
- void disconnectFrame();
-
- MemoryInfo* memory() const;
+ PassRefPtr<MemoryInfo> memory() const;
PerformanceNavigation* navigation() const;
PerformanceTiming* timing() const;
private:
- Performance(Frame*);
+ explicit Performance(Frame*);
- mutable RefPtr<MemoryInfo> m_memory;
mutable RefPtr<PerformanceNavigation> m_navigation;
mutable RefPtr<PerformanceTiming> m_timing;
- Frame* m_frame;
};
}
-#endif // !ENABLE(WEB_TIMING)
-#endif // !defined(Performance_h)
+#endif // ENABLE(WEB_TIMING)
+
+#endif // Performance_h
diff --git a/Source/WebCore/page/PerformanceNavigation.cpp b/Source/WebCore/page/PerformanceNavigation.cpp
index 663e942a1..d764b620b 100644
--- a/Source/WebCore/page/PerformanceNavigation.cpp
+++ b/Source/WebCore/page/PerformanceNavigation.cpp
@@ -40,20 +40,10 @@
namespace WebCore {
PerformanceNavigation::PerformanceNavigation(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-Frame* PerformanceNavigation::frame() const
-{
- return m_frame;
-}
-
-void PerformanceNavigation::disconnectFrame()
-{
- m_frame = 0;
-}
-
unsigned short PerformanceNavigation::type() const
{
if (!m_frame)
diff --git a/Source/WebCore/page/PerformanceNavigation.h b/Source/WebCore/page/PerformanceNavigation.h
index bdf6eaa93..f397923e6 100644
--- a/Source/WebCore/page/PerformanceNavigation.h
+++ b/Source/WebCore/page/PerformanceNavigation.h
@@ -33,6 +33,7 @@
#if ENABLE(WEB_TIMING)
+#include "DOMWindowProperty.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -40,13 +41,10 @@ namespace WebCore {
class Frame;
-class PerformanceNavigation : public RefCounted<PerformanceNavigation> {
+class PerformanceNavigation : public RefCounted<PerformanceNavigation>, public DOMWindowProperty {
public:
static PassRefPtr<PerformanceNavigation> create(Frame* frame) { return adoptRef(new PerformanceNavigation(frame)); }
- Frame* frame() const;
- void disconnectFrame();
-
enum PerformanceNavigationType {
TYPE_NAVIGATE,
TYPE_RELOAD,
@@ -58,9 +56,7 @@ public:
unsigned short redirectCount() const;
private:
- PerformanceNavigation(Frame*);
-
- Frame* m_frame;
+ explicit PerformanceNavigation(Frame*);
};
}
diff --git a/Source/WebCore/page/PerformanceTiming.cpp b/Source/WebCore/page/PerformanceTiming.cpp
index bdce07e73..6a4524b09 100644
--- a/Source/WebCore/page/PerformanceTiming.cpp
+++ b/Source/WebCore/page/PerformanceTiming.cpp
@@ -51,20 +51,10 @@ static unsigned long long toIntegerMilliseconds(double seconds)
}
PerformanceTiming::PerformanceTiming(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-Frame* PerformanceTiming::frame() const
-{
- return m_frame;
-}
-
-void PerformanceTiming::disconnectFrame()
-{
- m_frame = 0;
-}
-
unsigned long long PerformanceTiming::navigationStart() const
{
DocumentLoadTiming* timing = documentLoadTiming();
diff --git a/Source/WebCore/page/PerformanceTiming.h b/Source/WebCore/page/PerformanceTiming.h
index 52abd55ad..30b80b967 100644
--- a/Source/WebCore/page/PerformanceTiming.h
+++ b/Source/WebCore/page/PerformanceTiming.h
@@ -33,6 +33,7 @@
#if ENABLE(WEB_TIMING)
+#include "DOMWindowProperty.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -44,13 +45,10 @@ struct DocumentTiming;
class Frame;
class ResourceLoadTiming;
-class PerformanceTiming : public RefCounted<PerformanceTiming> {
+class PerformanceTiming : public RefCounted<PerformanceTiming>, public DOMWindowProperty {
public:
static PassRefPtr<PerformanceTiming> create(Frame* frame) { return adoptRef(new PerformanceTiming(frame)); }
- Frame* frame() const;
- void disconnectFrame();
-
unsigned long long navigationStart() const;
unsigned long long unloadEventStart() const;
unsigned long long unloadEventEnd() const;
@@ -74,7 +72,7 @@ public:
unsigned long long loadEventEnd() const;
private:
- PerformanceTiming(Frame*);
+ explicit PerformanceTiming(Frame*);
const DocumentTiming* documentTiming() const;
DocumentLoader* documentLoader() const;
@@ -82,8 +80,6 @@ private:
ResourceLoadTiming* resourceLoadTiming() const;
unsigned long long resourceLoadTimeRelativeToAbsolute(int) const;
unsigned long long monotonicTimeToIntegerMilliseconds(double) const;
-
- Frame* m_frame;
};
}
diff --git a/Source/WebCore/page/Screen.cpp b/Source/WebCore/page/Screen.cpp
index df88fa4e9..b021e5f17 100644
--- a/Source/WebCore/page/Screen.cpp
+++ b/Source/WebCore/page/Screen.cpp
@@ -39,20 +39,10 @@
namespace WebCore {
Screen::Screen(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
-Frame* Screen::frame() const
-{
- return m_frame;
-}
-
-void Screen::disconnectFrame()
-{
- m_frame = 0;
-}
-
unsigned Screen::horizontalDPI() const
{
if (!m_frame)
diff --git a/Source/WebCore/page/Screen.h b/Source/WebCore/page/Screen.h
index d084db788..2624f1a13 100644
--- a/Source/WebCore/page/Screen.h
+++ b/Source/WebCore/page/Screen.h
@@ -30,6 +30,7 @@
#ifndef Screen_h
#define Screen_h
+#include "DOMWindowProperty.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -37,13 +38,10 @@ namespace WebCore {
class Frame;
- class Screen : public RefCounted<Screen> {
+ class Screen : public RefCounted<Screen>, public DOMWindowProperty {
public:
static PassRefPtr<Screen> create(Frame *frame) { return adoptRef(new Screen(frame)); }
- Frame* frame() const;
- void disconnectFrame();
-
unsigned horizontalDPI() const;
unsigned verticalDPI() const;
unsigned height() const;
@@ -56,9 +54,7 @@ namespace WebCore {
unsigned availWidth() const;
private:
- Screen(Frame*);
-
- Frame* m_frame;
+ explicit Screen(Frame*);
};
} // namespace WebCore
diff --git a/Source/WebCore/page/Settings.cpp b/Source/WebCore/page/Settings.cpp
index 2528a2b33..403b4087f 100644
--- a/Source/WebCore/page/Settings.cpp
+++ b/Source/WebCore/page/Settings.cpp
@@ -192,7 +192,6 @@ Settings::Settings(Page* page)
, m_privilegedWebGLExtensionsEnabled(false)
, m_webAudioEnabled(false)
, m_acceleratedCanvas2dEnabled(false)
- , m_legacyAcceleratedCanvas2dEnabled(false)
, m_loadDeferringEnabled(true)
, m_tiledBackingStoreEnabled(false)
, m_paginateDuringLayoutEnabled(false)
@@ -810,11 +809,6 @@ void Settings::setAccelerated2dCanvasEnabled(bool enabled)
m_acceleratedCanvas2dEnabled = enabled;
}
-void Settings::setLegacyAccelerated2dCanvasEnabled(bool enabled)
-{
- m_legacyAcceleratedCanvas2dEnabled = enabled;
-}
-
void Settings::setMinimumAccelerated2dCanvasSize(int numPixels)
{
m_minimumAccelerated2dCanvasSize = numPixels;
diff --git a/Source/WebCore/page/Settings.h b/Source/WebCore/page/Settings.h
index 27b42e0cf..edece2f1f 100644
--- a/Source/WebCore/page/Settings.h
+++ b/Source/WebCore/page/Settings.h
@@ -360,9 +360,6 @@ namespace WebCore {
void setAccelerated2dCanvasEnabled(bool);
bool accelerated2dCanvasEnabled() const { return m_acceleratedCanvas2dEnabled; }
- void setLegacyAccelerated2dCanvasEnabled(bool);
- bool legacyAccelerated2dCanvasEnabled() const { return m_legacyAcceleratedCanvas2dEnabled; }
-
// Number of pixels below which 2D canvas is rendered in software
// even if hardware acceleration is enabled.
// Hardware acceleration is useful for large canvases where it can avoid the
@@ -612,7 +609,6 @@ namespace WebCore {
bool m_privilegedWebGLExtensionsEnabled : 1;
bool m_webAudioEnabled : 1;
bool m_acceleratedCanvas2dEnabled : 1;
- bool m_legacyAcceleratedCanvas2dEnabled : 1;
bool m_loadDeferringEnabled : 1;
bool m_tiledBackingStoreEnabled : 1;
bool m_paginateDuringLayoutEnabled : 1;
diff --git a/Source/WebCore/page/mac/FrameMac.mm b/Source/WebCore/page/mac/FrameMac.mm
index 234627858..1c835afac 100644
--- a/Source/WebCore/page/mac/FrameMac.mm
+++ b/Source/WebCore/page/mac/FrameMac.mm
@@ -113,21 +113,17 @@ NSImage *Frame::rangeImage(Range* range, bool forceBlackText) const
if (!view)
return nil;
- VisibleSelection visibleSelection(range);
-
- if (!visibleSelection.isRange())
- return nil;
-
- Position start = visibleSelection.start();
+ Position start = range->startPosition();
Position candidate = start.downstream();
- if (candidate.isCandidate())
+ if (candidate.deprecatedNode() && candidate.deprecatedNode()->renderer())
start = candidate;
- Position end = visibleSelection.end();
+
+ Position end = range->endPosition();
candidate = end.upstream();
- if (candidate.isCandidate())
+ if (candidate.deprecatedNode() && candidate.deprecatedNode()->renderer())
end = candidate;
- if (start.isNull() || end.isNull() || visibleSelection.visibleStart() == visibleSelection.visibleEnd())
+ if (start.isNull() || end.isNull() || start == end)
return nil;
RenderObject* savedStartRenderer;
@@ -137,7 +133,12 @@ NSImage *Frame::rangeImage(Range* range, bool forceBlackText) const
view->getSelection(savedStartRenderer, savedStartOffset, savedEndRenderer, savedEndOffset);
RenderObject* startRenderer = start.deprecatedNode()->renderer();
+ if (!startRenderer)
+ return nil;
+
RenderObject* endRenderer = end.deprecatedNode()->renderer();
+ if (!endRenderer)
+ return nil;
view->setSelection(startRenderer, start.deprecatedEditingOffset(), endRenderer, end.deprecatedEditingOffset(), RenderView::RepaintNothing);
NSImage* result = imageFromRect(view->selectionBounds());
diff --git a/Source/WebCore/platform/KURL.cpp b/Source/WebCore/platform/KURL.cpp
index 9eb1e2fc5..2408cc2b4 100644
--- a/Source/WebCore/platform/KURL.cpp
+++ b/Source/WebCore/platform/KURL.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004, 2007, 2008, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2007, 2008, 2011, 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -1050,6 +1050,8 @@ void KURL::parse(const String& string)
parse(buffer.data(), &string);
}
+// FIXME: (lenA != lenB) is never true in the way this function is used.
+// FIXME: This is only used for short string, we should replace equal() by a recursive template comparing the strings without loop.
static inline bool equal(const char* a, size_t lenA, const char* b, size_t lenB)
{
if (lenA != lenB)
@@ -1104,6 +1106,23 @@ static bool isNonFileHierarchicalScheme(const char* scheme, size_t schemeLength)
return false;
}
+static bool isCanonicalHostnameLowercaseForScheme(const char* scheme, size_t schemeLength)
+{
+ switch (schemeLength) {
+ case 2:
+ return equal("ws", 2, scheme, schemeLength);
+ case 3:
+ return equal("ftp", 3, scheme, schemeLength) || equal("wss", 3, scheme, schemeLength);
+ case 4:
+ return equal("http", 4, scheme, schemeLength) || equal("file", 4, scheme, schemeLength);
+ case 5:
+ return equal("https", 5, scheme, schemeLength);
+ case 6:
+ return equal("gopher", 6, scheme, schemeLength);
+ }
+ return false;
+}
+
void KURL::parse(const char* url, const String* originalString)
{
if (!url || url[0] == '\0') {
@@ -1344,8 +1363,13 @@ void KURL::parse(const char* url, const String* originalString)
if (!(isFile && hostIsLocalHost && !haveNonHostAuthorityPart)) {
strPtr = url + hostStart;
const char* hostEndPtr = url + hostEnd;
- while (strPtr < hostEndPtr)
- *p++ = *strPtr++;
+ if (isCanonicalHostnameLowercaseForScheme(buffer.data(), m_schemeEnd)) {
+ while (strPtr < hostEndPtr)
+ *p++ = toASCIILower(*strPtr++);
+ } else {
+ while (strPtr < hostEndPtr)
+ *p++ = *strPtr++;
+ }
}
m_hostEnd = p - buffer.data();
diff --git a/Source/WebCore/platform/audio/AudioBus.cpp b/Source/WebCore/platform/audio/AudioBus.cpp
index d14305e29..800197e2d 100644
--- a/Source/WebCore/platform/audio/AudioBus.cpp
+++ b/Source/WebCore/platform/audio/AudioBus.cpp
@@ -244,8 +244,7 @@ void AudioBus::sumFrom(const AudioBus &sourceBus)
GAIN_DEZIPPER \
} \
gain = totalDesiredGain; \
- for (; k < framesToProcess; ++k) \
- OP
+ OP##_V
#define STEREO_SUM \
{ \
@@ -255,6 +254,11 @@ void AudioBus::sumFrom(const AudioBus &sourceBus)
*destinationR++ = sumR; \
}
+// FIXME: this can be optimized with additional VectorMath functions.
+#define STEREO_SUM_V \
+ for (; k < framesToProcess; ++k) \
+ STEREO_SUM
+
// Mono -> stereo (mix equally into L and R)
// FIXME: Really we should apply an equal-power scaling factor here, since we're effectively panning center...
#define MONO2STEREO_SUM \
@@ -266,12 +270,20 @@ void AudioBus::sumFrom(const AudioBus &sourceBus)
*destinationR++ = sumR; \
}
+#define MONO2STEREO_SUM_V \
+ for (; k < framesToProcess; ++k) \
+ MONO2STEREO_SUM
+
#define MONO_SUM \
{ \
float sum = DenormalDisabler::flushDenormalFloatToZero(*destinationL + gain * *sourceL++); \
*destinationL++ = sum; \
}
+#define MONO_SUM_V \
+ for (; k < framesToProcess; ++k) \
+ MONO_SUM
+
#define STEREO_NO_SUM \
{ \
float sampleL = *sourceL++; \
@@ -280,6 +292,12 @@ void AudioBus::sumFrom(const AudioBus &sourceBus)
*destinationR++ = DenormalDisabler::flushDenormalFloatToZero(gain * sampleR); \
}
+#define STEREO_NO_SUM_V \
+ { \
+ vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
+ vsmul(sourceR, 1, &gain, destinationR, 1, framesToProcess - k); \
+ }
+
// Mono -> stereo (mix equally into L and R)
// FIXME: Really we should apply an equal-power scaling factor here, since we're effectively panning center...
#define MONO2STEREO_NO_SUM \
@@ -289,18 +307,28 @@ void AudioBus::sumFrom(const AudioBus &sourceBus)
*destinationR++ = DenormalDisabler::flushDenormalFloatToZero(gain * sample); \
}
+#define MONO2STEREO_NO_SUM_V \
+ { \
+ vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
+ vsmul(sourceL, 1, &gain, destinationR, 1, framesToProcess - k); \
+ }
+
#define MONO_NO_SUM \
{ \
float sampleL = *sourceL++; \
*destinationL++ = DenormalDisabler::flushDenormalFloatToZero(gain * sampleL); \
}
+#define MONO_NO_SUM_V \
+ { \
+ vsmul(sourceL, 1, &gain, destinationL, 1, framesToProcess - k); \
+ }
+
void AudioBus::processWithGainFromMonoStereo(const AudioBus &sourceBus, double* lastMixGain, double targetGain, bool sumToBus)
{
// We don't want to suddenly change the gain from mixing one time slice to the next,
// so we "de-zipper" by slowly changing the gain each sample-frame until we've achieved the target gain.
- // FIXME: optimize this method (SSE, etc.)
// FIXME: targetGain and lastMixGain should be changed to floats instead of doubles.
// Take master bus gain into account as well as the targetGain.
@@ -351,8 +379,6 @@ void AudioBus::processWithGainFromMonoStereo(const AudioBus &sourceBus, double*
if (this == &sourceBus && *lastMixGain == targetGain && targetGain == 1.0)
return;
- // FIXME: if (framesToDezipper == 0) and DenormalDisabler::flushDenormalFloatToZero() is a NOP (gcc vs. Visual Studio)
- // then we can further optimize the PROCESS_WITH_GAIN codepaths below using vsmul().
if (sourceR && destinationR) {
// Stereo
PROCESS_WITH_GAIN(STEREO_NO_SUM)
diff --git a/Source/WebCore/platform/audio/Reverb.cpp b/Source/WebCore/platform/audio/Reverb.cpp
index b6204fff7..2b787ebf3 100644
--- a/Source/WebCore/platform/audio/Reverb.cpp
+++ b/Source/WebCore/platform/audio/Reverb.cpp
@@ -87,16 +87,23 @@ static double calculateNormalizationScale(AudioBus* response)
return scale;
}
-Reverb::Reverb(AudioBus* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads)
+Reverb::Reverb(AudioBus* impulseResponse, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads, bool normalize)
{
- double scale = calculateNormalizationScale(impulseResponse);
- if (scale)
- impulseResponse->scale(scale);
+ double scale = 1;
+
+ if (normalize) {
+ scale = calculateNormalizationScale(impulseResponse);
+
+ if (scale)
+ impulseResponse->scale(scale);
+ }
initialize(impulseResponse, renderSliceSize, maxFFTSize, numberOfChannels, useBackgroundThreads);
- // Undo scaling since this shouldn't be a destructive operation on impulseResponse
- if (scale)
+ // Undo scaling since this shouldn't be a destructive operation on impulseResponse.
+ // FIXME: What about roundoff? Perhaps consider making a temporary scaled copy
+ // instead of scaling and unscaling in place.
+ if (normalize && scale)
impulseResponse->scale(1.0 / scale);
}
diff --git a/Source/WebCore/platform/audio/Reverb.h b/Source/WebCore/platform/audio/Reverb.h
index 26f5f8e64..f162e0b70 100644
--- a/Source/WebCore/platform/audio/Reverb.h
+++ b/Source/WebCore/platform/audio/Reverb.h
@@ -43,7 +43,7 @@ public:
enum { MaxFrameSize = 256 };
// renderSliceSize is a rendering hint, so the FFTs can be optimized to not all occur at the same time (very bad when rendering on a real-time thread).
- Reverb(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads);
+ Reverb(AudioBus* impulseResponseBuffer, size_t renderSliceSize, size_t maxFFTSize, size_t numberOfChannels, bool useBackgroundThreads, bool normalize);
void process(AudioBus* sourceBus, AudioBus* destinationBus, size_t framesToProcess);
void reset();
diff --git a/Source/WebCore/platform/chromium/PasteboardChromium.cpp b/Source/WebCore/platform/chromium/PasteboardChromium.cpp
index f6908de89..26a9f101f 100644
--- a/Source/WebCore/platform/chromium/PasteboardChromium.cpp
+++ b/Source/WebCore/platform/chromium/PasteboardChromium.cpp
@@ -182,10 +182,12 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
unsigned fragmentEnd = 0;
PlatformSupport::clipboardReadHTML(buffer, &markup, &srcURL, &fragmentStart, &fragmentEnd);
- RefPtr<DocumentFragment> fragment =
- createFragmentFromMarkupWithContext(frame->document(), markup, fragmentStart, fragmentEnd, srcURL, FragmentScriptingNotAllowed);
- if (fragment)
- return fragment.release();
+ if (!markup.isEmpty()) {
+ RefPtr<DocumentFragment> fragment =
+ createFragmentFromMarkupWithContext(frame->document(), markup, fragmentStart, fragmentEnd, srcURL, FragmentScriptingNotAllowed);
+ if (fragment)
+ return fragment.release();
+ }
}
if (allowPlainText) {
diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp
index 445d1d085..c2d9c58c3 100644
--- a/Source/WebCore/platform/graphics/Font.cpp
+++ b/Source/WebCore/platform/graphics/Font.cpp
@@ -404,12 +404,22 @@ Font::CodePath Font::codePath(const TextRun& run) const
if (supplementaryCharacter <= 0x1F1FF)
return Complex;
+ if (supplementaryCharacter < 0xE0100) // U+E0100 through U+E01EF Unicode variation selectors.
+ continue;
+ if (supplementaryCharacter <= 0xE01EF)
+ return Complex;
+
// FIXME: Check for Brahmi (U+11000 block), Kaithi (U+11080 block) and other complex scripts
// in plane 1 or higher.
continue;
}
+ if (c < 0xFE00) // U+FE00 through U+FE0F Unicode variation selectors
+ continue;
+ if (c <= 0xFE0F)
+ return Complex;
+
if (c < 0xFE20) // U+FE20 through U+FE2F Combining half marks
continue;
if (c <= 0xFE2F)
diff --git a/Source/WebCore/platform/graphics/Font.h b/Source/WebCore/platform/graphics/Font.h
index 11484db61..9a7a86213 100644
--- a/Source/WebCore/platform/graphics/Font.h
+++ b/Source/WebCore/platform/graphics/Font.h
@@ -116,7 +116,20 @@ public:
TypesettingFeatures typesettingFeatures() const
{
TextRenderingMode textRenderingMode = m_fontDescription.textRenderingMode();
- return textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision ? Kerning | Ligatures : 0;
+ TypesettingFeatures features = textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision ? Kerning | Ligatures : 0;
+
+ switch (m_fontDescription.kerning()) {
+ case FontDescription::NoneKerning:
+ features &= ~Kerning;
+ break;
+ case FontDescription::NormalKerning:
+ features |= Kerning;
+ break;
+ case FontDescription::AutoKerning:
+ break;
+ }
+
+ return features;
}
FontFamily& firstFamily() { return m_fontDescription.firstFamily(); }
diff --git a/Source/WebCore/platform/graphics/FontDescription.h b/Source/WebCore/platform/graphics/FontDescription.h
index 71ca2180b..51a257b41 100644
--- a/Source/WebCore/platform/graphics/FontDescription.h
+++ b/Source/WebCore/platform/graphics/FontDescription.h
@@ -72,6 +72,8 @@ public:
enum GenericFamilyType { NoFamily, StandardFamily, SerifFamily, SansSerifFamily,
MonospaceFamily, CursiveFamily, FantasyFamily, PictographFamily };
+ enum Kerning { AutoKerning, NormalKerning, NoneKerning };
+
FontDescription()
: m_specifiedSize(0)
, m_computedSize(0)
@@ -85,6 +87,7 @@ public:
, m_genericFamily(NoFamily)
, m_usePrinterFont(false)
, m_renderingMode(NormalRenderingMode)
+ , m_kerning(AutoKerning)
, m_keywordSize(0)
, m_fontSmoothing(AutoSmoothing)
, m_textRendering(AutoTextRendering)
@@ -112,6 +115,7 @@ public:
// only use fixed default size when there is only one font family, and that family is "monospace"
bool useFixedDefaultSize() const { return genericFamily() == MonospaceFamily && !family().next() && family().family() == monospaceFamily; }
FontRenderingMode renderingMode() const { return static_cast<FontRenderingMode>(m_renderingMode); }
+ Kerning kerning() const { return static_cast<Kerning>(m_kerning); }
unsigned keywordSize() const { return m_keywordSize; }
FontSmoothingMode fontSmoothing() const { return static_cast<FontSmoothingMode>(m_fontSmoothing); }
TextRenderingMode textRenderingMode() const { return static_cast<TextRenderingMode>(m_textRendering); }
@@ -141,6 +145,7 @@ public:
void setUsePrinterFont(bool p) { m_usePrinterFont = p; }
#endif
void setRenderingMode(FontRenderingMode mode) { m_renderingMode = mode; }
+ void setKerning(Kerning kerning) { m_kerning = kerning; }
void setKeywordSize(unsigned s) { m_keywordSize = s; }
void setFontSmoothing(FontSmoothingMode smoothing) { m_fontSmoothing = smoothing; }
void setTextRenderingMode(TextRenderingMode rendering) { m_textRendering = rendering; }
@@ -173,6 +178,7 @@ private:
bool m_usePrinterFont : 1;
unsigned m_renderingMode : 1; // Used to switch between CG and GDI text on Windows.
+ unsigned m_kerning : 2; // Kerning
unsigned m_keywordSize : 4; // We cache whether or not a font is currently represented by a CSS keyword (e.g., medium). If so,
// then we can accurately translate across different generic families to adjust for different preference settings
@@ -196,6 +202,7 @@ inline bool FontDescription::operator==(const FontDescription& other) const
&& m_genericFamily == other.m_genericFamily
&& m_usePrinterFont == other.m_usePrinterFont
&& m_renderingMode == other.m_renderingMode
+ && m_kerning == other.m_kerning
&& m_keywordSize == other.m_keywordSize
&& m_fontSmoothing == other.m_fontSmoothing
&& m_textRendering == other.m_textRendering
diff --git a/Source/WebCore/platform/graphics/ImageBuffer.h b/Source/WebCore/platform/graphics/ImageBuffer.h
index 7df134280..13070004c 100644
--- a/Source/WebCore/platform/graphics/ImageBuffer.h
+++ b/Source/WebCore/platform/graphics/ImageBuffer.h
@@ -59,6 +59,7 @@ namespace WebCore {
enum RenderingMode {
Unaccelerated,
+ UnacceleratedNonPlatformBuffer, // Use plain memory allocation rather than platform API to allocate backing store.
Accelerated
};
diff --git a/Source/WebCore/platform/graphics/Path.h b/Source/WebCore/platform/graphics/Path.h
index 3d1e7b12c..d14d90879 100644
--- a/Source/WebCore/platform/graphics/Path.h
+++ b/Source/WebCore/platform/graphics/Path.h
@@ -80,13 +80,16 @@ namespace WebCore {
class StrokeStyleApplier;
enum PathElementType {
- PathElementMoveToPoint,
- PathElementAddLineToPoint,
- PathElementAddQuadCurveToPoint,
- PathElementAddCurveToPoint,
- PathElementCloseSubpath
+ PathElementMoveToPoint, // The points member will contain 1 value.
+ PathElementAddLineToPoint, // The points member will contain 1 value.
+ PathElementAddQuadCurveToPoint, // The points member will contain 2 values.
+ PathElementAddCurveToPoint, // The points member will contain 3 values.
+ PathElementCloseSubpath // The points member will contain no values.
};
+ // The points in the sturcture are the same as those that would be used with the
+ // add... method. For example, a line returns the endpoint, while a cubic returns
+ // two tangent points and the endpoint.
struct PathElement {
PathElementType type;
FloatPoint* points;
diff --git a/Source/WebCore/platform/graphics/SimpleFontData.h b/Source/WebCore/platform/graphics/SimpleFontData.h
index de4a56bb8..dd86f004e 100644
--- a/Source/WebCore/platform/graphics/SimpleFontData.h
+++ b/Source/WebCore/platform/graphics/SimpleFontData.h
@@ -158,7 +158,6 @@ public:
const GlyphData& missingGlyphData() const { return m_missingGlyphData; }
void setMissingGlyphData(const GlyphData& glyphData) { m_missingGlyphData = glyphData; }
- void updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph&) const;
#ifndef NDEBUG
virtual String description() const;
diff --git a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
index 119b3a428..ac0bae306 100644
--- a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
+++ b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
@@ -32,21 +32,6 @@ using namespace Unicode;
namespace WebCore {
-inline static bool isUnicodeBMPVariationSelector(UChar character)
-{
- return (0x180B <= character && character <= 0x180D) || (0xFE00 <= character && character <= 0xFE0F);
-}
-
-inline static bool isUnicodeSupplementaryVariationSelector(UChar lead, UChar trail)
-{
- // A non-BMP variation selector character is in the range of U+E0100 to U+E01EF.
- // It can be a surrogate pair in which the high surrogate is 0xDB40 and
- // the low surrogate is in the range of U16_TRAIL(0xE0100 - 0x10000) to U16_TRAIL(0xE01EF - 0x10000).
- static const UChar trailStart = U16_TRAIL(0xE0100 - 0x10000);
- static const UChar trailEnd = U16_TRAIL(0xE01EF - 0x10000);
- return lead == 0xDB40 && trailStart <= trail && trail <= trailEnd;
-}
-
SurrogatePairAwareTextIterator::SurrogatePairAwareTextIterator(const UChar* characters, int currentCharacter, int lastCharacter, int endCharacter)
: m_characters(characters)
, m_currentCharacter(currentCharacter)
@@ -98,21 +83,6 @@ bool SurrogatePairAwareTextIterator::consume(UChar32& character, unsigned& clust
return true;
}
-bool SurrogatePairAwareTextIterator::hasTrailingVariationSelector(UChar32& selector, unsigned& clusterLength)
-{
- if (static_cast<int>(m_currentCharacter + clusterLength) < m_endCharacter && isUnicodeBMPVariationSelector(m_characters[clusterLength])) {
- selector = m_characters[clusterLength];
- clusterLength += 1;
- return true;
- }
- if (static_cast<int>(m_currentCharacter + clusterLength + 1) < m_endCharacter && isUnicodeSupplementaryVariationSelector(m_characters[clusterLength], m_characters[clusterLength + 1])) {
- selector = U16_GET_SUPPLEMENTARY(m_characters[clusterLength], m_characters[clusterLength + 1]);
- clusterLength += 2;
- return true;
- }
- return false;
-}
-
void SurrogatePairAwareTextIterator::advance(unsigned advanceLength)
{
m_characters += advanceLength;
diff --git a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h
index 8dcea8d76..1d56eb8b2 100644
--- a/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h
+++ b/Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.h
@@ -32,7 +32,6 @@ public:
SurrogatePairAwareTextIterator(const UChar*, int currentCharacter, int lastCharacter, int endCharacter);
bool consume(UChar32& character, unsigned& clusterLength);
- bool hasTrailingVariationSelector(UChar32& selector, unsigned& clusterLength);
void advance(unsigned advanceLength);
int currentCharacter() const { return m_currentCharacter; }
diff --git a/Source/WebCore/platform/graphics/WidthIterator.cpp b/Source/WebCore/platform/graphics/WidthIterator.cpp
index 06826bef3..d749a4f46 100644
--- a/Source/WebCore/platform/graphics/WidthIterator.cpp
+++ b/Source/WebCore/platform/graphics/WidthIterator.cpp
@@ -115,13 +115,6 @@ unsigned WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
ASSERT(fontData);
- // If a variation selector follows, update glyph with the selector if possible.
- UChar32 selector = 0;
- if (textIterator.hasTrailingVariationSelector(selector, clusterLength)) {
- fontData->updateGlyphWithVariationSelector(character, selector, glyph);
- advanceLength = clusterLength;
- }
-
// Now that we have a glyph and font data, get its width.
float width;
if (character == '\t' && m_run.allowTabs()) {
diff --git a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index f9e4afb24..e73272ded 100644
--- a/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -2181,10 +2181,8 @@ bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
if (!m_drawsContent || !m_allowTiledLayer || m_layer->layerType() == PlatformCALayer::LayerTypeTileCacheLayer)
return false;
- float contentsScale = pageScaleFactor * deviceScaleFactor();
-
// FIXME: catch zero-size height or width here (or earlier)?
- return m_size.width() * contentsScale > cMaxPixelDimension || m_size.height() * contentsScale > cMaxPixelDimension;
+ return m_size.width() * pageScaleFactor > cMaxPixelDimension || m_size.height() * pageScaleFactor > cMaxPixelDimension;
}
void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer, float pageScaleFactor, const FloatPoint& positionRelativeToBase)
diff --git a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
index edf3ffd0d..34c9710d9 100644
--- a/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
+++ b/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
@@ -29,6 +29,7 @@
#import "PlatformCALayer.h"
+#import "AnimationUtilities.h"
#import "BlockExceptions.h"
#import "FloatConversion.h"
#import "GraphicsContext.h"
@@ -44,6 +45,9 @@
#define HAVE_MODERN_QUARTZCORE (!defined(BUILDING_ON_LEOPARD))
+using std::min;
+using std::max;
+
using namespace WebCore;
// This value must be the same as in PlatformCAAnimationMac.mm
@@ -746,9 +750,18 @@ void PlatformCALayer::setFilters(const FilterOperations& filters)
}
case FilterOperation::SEPIA: {
const BasicColorMatrixFilterOperation* op = static_cast<const BasicColorMatrixFilterOperation*>(filterOperation);
- CIFilter* caFilter = [CIFilter filterWithName:@"CISepiaTone"];
+ CIFilter* caFilter = [CIFilter filterWithName:@"CIColorMatrix"];
[caFilter setDefaults];
- [caFilter setValue:[NSNumber numberWithFloat:op->amount()] forKey:@"inputIntensity"];
+
+ double t = op->amount();
+ t = min(max(0.0, t), 1.0);
+
+ // FIXME: Should put these values into constants (https://bugs.webkit.org/show_bug.cgi?id=76008)
+ [caFilter setValue:[CIVector vectorWithX:WebCore::blend(1.0, 0.393, t) Y:WebCore::blend(0.0, 0.769, t) Z:WebCore::blend(0.0, 0.189, t) W:0] forKey:@"inputRVector"];
+ [caFilter setValue:[CIVector vectorWithX:WebCore::blend(0.0, 0.349, t) Y:WebCore::blend(1.0, 0.686, t) Z:WebCore::blend(0.0, 0.168, t) W:0] forKey:@"inputGVector"];
+ [caFilter setValue:[CIVector vectorWithX:WebCore::blend(0.0, 0.272, t) Y:WebCore::blend(0.0, 0.534, t) Z:WebCore::blend(1.0, 0.131, t) W:0] forKey:@"inputBVector"];
+ [caFilter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:1] forKey:@"inputAVector"];
+ [caFilter setValue:[CIVector vectorWithX:0 Y:0 Z:0 W:0] forKey:@"inputBiasVector"];
[caFilter setName:@"sepiaFilter"];
[array.get() addObject:caFilter];
break;
diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index ee87f5327..20ffba646 100644
--- a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -527,8 +527,9 @@ void GraphicsContext::clipConvexPolygon(size_t numberOfPoints, const FloatPoint*
void GraphicsContext::applyStrokePattern()
{
CGContextRef cgContext = platformContext();
+ AffineTransform userToBaseCTM = AffineTransform(wkGetUserToBaseCTM(cgContext));
- RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_state.strokePattern->createPlatformPattern(getCTM()));
+ RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_state.strokePattern->createPlatformPattern(userToBaseCTM));
if (!platformPattern)
return;
@@ -542,8 +543,9 @@ void GraphicsContext::applyStrokePattern()
void GraphicsContext::applyFillPattern()
{
CGContextRef cgContext = platformContext();
+ AffineTransform userToBaseCTM = AffineTransform(wkGetUserToBaseCTM(cgContext));
- RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_state.fillPattern->createPlatformPattern(getCTM()));
+ RetainPtr<CGPatternRef> platformPattern(AdoptCF, m_state.fillPattern->createPlatformPattern(userToBaseCTM));
if (!platformPattern)
return;
@@ -1253,8 +1255,7 @@ AffineTransform GraphicsContext::getCTM() const
if (paintingDisabled())
return AffineTransform();
- CGAffineTransform t = CGContextGetCTM(platformContext());
- return AffineTransform(t.a, t.b, t.c, t.d, t.tx, t.ty);
+ return AffineTransform(CGContextGetCTM(platformContext()));
}
FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect, RoundingMode roundingMode)
diff --git a/Source/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp b/Source/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp
index b49a2ab38..dd60cfca0 100644
--- a/Source/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp
+++ b/Source/WebCore/platform/graphics/cg/TransformationMatrixCG.cpp
@@ -54,6 +54,11 @@ TransformationMatrix::operator CGAffineTransform() const
narrowPrecisionToCGFloat(f()));
}
+AffineTransform::AffineTransform(const CGAffineTransform& t)
+{
+ setMatrix(t.a, t.b, t.c, t.d, t.tx, t.ty);
+}
+
AffineTransform::operator CGAffineTransform() const
{
return CGAffineTransformMake(narrowPrecisionToCGFloat(a()),
diff --git a/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
index fa64818ad..153dd2c3c 100644
--- a/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/BitmapCanvasLayerTextureUpdater.h
@@ -37,7 +37,9 @@ namespace WebCore {
class LayerPainterChromium;
-// A CanvasLayerTextureUpdater with an internal bitmap.
+// This class rasterizes the contentRect into a PlatformCanvas. It then updates
+// textures by copying from the canvas into the texture, using MapSubImage if
+// possible.
class BitmapCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
public:
class Texture : public LayerTextureUpdater::Texture {
diff --git a/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
index e5163c202..6f2f10d9b 100644
--- a/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/BitmapSkPictureCanvasLayerTextureUpdater.h
@@ -36,6 +36,8 @@
namespace WebCore {
+// This class records the contentRect into an SkPicture, then software rasterizes
+// the SkPicture into bitmaps for each tile. This implements CCSettings::perTilePainting.
class BitmapSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLayerTextureUpdater {
public:
class Texture : public CanvasLayerTextureUpdater::Texture {
diff --git a/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h
index a8feff342..4415f6986 100644
--- a/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/CanvasLayerTextureUpdater.h
@@ -36,7 +36,9 @@ namespace WebCore {
class GraphicsContext3D;
class LayerPainterChromium;
-// A LayerTextureUpdater with an internal canvas.
+// Base class for BitmapCanvasLayerTextureUpdater and
+// SkPictureCanvasLayerTextureUpdater that reduces code duplication between
+// their respective paintContents implementations.
class CanvasLayerTextureUpdater : public LayerTextureUpdater {
public:
virtual ~CanvasLayerTextureUpdater();
diff --git a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
index 1b1d11bfa..4a10c858e 100644
--- a/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/FrameBufferSkPictureCanvasLayerTextureUpdater.h
@@ -34,6 +34,9 @@
namespace WebCore {
+// This class records the contentRect into an SkPicture, then uses accelerated
+// drawing to update the texture. The accelerated drawing goes to an
+// intermediate framebuffer and then is copied to the destination texture once done.
class FrameBufferSkPictureCanvasLayerTextureUpdater : public SkPictureCanvasLayerTextureUpdater {
public:
class Texture : public LayerTextureUpdater::Texture {
diff --git a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
index 1d6294964..a0fb35f02 100644
--- a/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
@@ -189,7 +189,9 @@ bool ImageLayerChromium::drawsContent() const
void ImageLayerChromium::createTextureUpdater(const CCLayerTreeHost* host)
{
- m_textureUpdater = ImageLayerTextureUpdater::create(host->layerRendererCapabilities().usingMapSub);
+ // Avoid creating a new texture updater which would not have a valid copy of the current image.
+ if (!m_textureUpdater)
+ m_textureUpdater = ImageLayerTextureUpdater::create(host->layerRendererCapabilities().usingMapSub);
}
bool ImageLayerChromium::needsContentsScale() const
diff --git a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index daeb97f9a..933e78253 100644
--- a/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -435,13 +435,14 @@ void LayerRendererChromium::drawDebugBorderQuad(const CCDebugBorderDrawQuad* qua
ASSERT(program && program->initialized());
GLC(context(), context()->useProgram(program->program()));
- TransformationMatrix renderMatrix = quad->layerTransform();
const IntRect& layerRect = quad->quadRect();
+ TransformationMatrix renderMatrix = quad->quadTransform();
+ renderMatrix.translate(0.5 * layerRect.width() + layerRect.x(), 0.5 * layerRect.height() + layerRect.y());
renderMatrix.scaleNonUniform(layerRect.width(), layerRect.height());
LayerRendererChromium::toGLMatrix(&glMatrix[0], projectionMatrix() * renderMatrix);
GLC(context(), context()->uniformMatrix4fv(program->vertexShader().matrixLocation(), false, &glMatrix[0], 1));
- GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation(), quad->color().red() / 255.0, quad->color().green() / 255.0, quad->color().blue() / 255.0, 1));
+ GLC(context(), context()->uniform4f(program->fragmentShader().colorLocation(), quad->color().red() / 255.0, quad->color().green() / 255.0, quad->color().blue() / 255.0, quad->color().alpha() / 255.0));
GLC(context(), context()->lineWidth(quad->width()));
@@ -679,11 +680,9 @@ void LayerRendererChromium::finishDrawingFrame()
size_t contentsMemoryUseBytes = m_contentsTextureAllocator->currentMemoryUseBytes();
size_t reclaimLimit = TextureManager::reclaimLimitBytes(viewportSize());
- if (reclaimLimit > contentsMemoryUseBytes)
- m_renderSurfaceTextureManager->setPreferredMemoryLimitBytes(reclaimLimit - contentsMemoryUseBytes);
- else
- m_renderSurfaceTextureManager->setPreferredMemoryLimitBytes(0);
-
+ size_t preferredLimit = reclaimLimit > contentsMemoryUseBytes ? reclaimLimit - contentsMemoryUseBytes : 0;
+ m_renderSurfaceTextureManager->setPreferredMemoryLimitBytes(preferredLimit);
+ m_renderSurfaceTextureManager->reduceMemoryToLimit(preferredLimit);
m_renderSurfaceTextureManager->deleteEvictedTextures(m_renderSurfaceTextureAllocator.get());
if (settings().compositeOffscreen)
diff --git a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
index 93e8d86c6..4e1822b31 100644
--- a/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
+++ b/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
@@ -96,6 +96,11 @@ private:
TransformationMatrix m_originTransform;
IntRect m_clipRect;
Vector<RefPtr<LayerChromium> > m_layerList;
+
+ // For CCLayerIteratorActions
+ int m_targetRenderSurfaceLayerIndexHistory;
+ int m_currentLayerIndexHistory;
+ friend struct CCLayerIteratorActions;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp b/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
index 9681746ba..78ad56af9 100644
--- a/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
+++ b/Source/WebCore/platform/graphics/chromium/SimpleFontDataChromiumWin.cpp
@@ -199,9 +199,4 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
return static_cast<float>(width);
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h b/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h
index 440f8b03e..95b78c3b9 100644
--- a/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h
+++ b/Source/WebCore/platform/graphics/chromium/SkPictureCanvasLayerTextureUpdater.h
@@ -39,6 +39,11 @@ namespace WebCore {
class LayerPainterChromium;
+// This class records the contentRect into an SkPicture. Subclasses, provide
+// different implementations of tile updating based on this recorded picture.
+// The BitmapSkPictureCanvasLayerTextureUpdater and
+// FrameBufferSkPictureCanvasLayerTextureUpdater are two examples of such
+// implementations.
class SkPictureCanvasLayerTextureUpdater : public CanvasLayerTextureUpdater {
public:
virtual ~SkPictureCanvasLayerTextureUpdater();
diff --git a/Source/WebCore/platform/graphics/chromium/TextureManager.cpp b/Source/WebCore/platform/graphics/chromium/TextureManager.cpp
index 30207be38..516cea90a 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureManager.cpp
+++ b/Source/WebCore/platform/graphics/chromium/TextureManager.cpp
@@ -112,7 +112,6 @@ void TextureManager::setMaxMemoryLimitBytes(size_t memoryLimitBytes)
void TextureManager::setPreferredMemoryLimitBytes(size_t memoryLimitBytes)
{
- reduceMemoryToLimit(memoryLimitBytes);
m_preferredMemoryLimitBytes = memoryLimitBytes;
}
diff --git a/Source/WebCore/platform/graphics/chromium/TextureManager.h b/Source/WebCore/platform/graphics/chromium/TextureManager.h
index c6c21ad59..a66e9d536 100644
--- a/Source/WebCore/platform/graphics/chromium/TextureManager.h
+++ b/Source/WebCore/platform/graphics/chromium/TextureManager.h
@@ -64,7 +64,9 @@ public:
static size_t memoryUseBytes(const IntSize&, GC3Denum format);
void setMaxMemoryLimitBytes(size_t);
+ size_t maxMemoryLimitBytes() { return m_maxMemoryLimitBytes; }
void setPreferredMemoryLimitBytes(size_t);
+ size_t preferredMemoryLimitBytes() { return m_preferredMemoryLimitBytes; }
TextureToken getToken();
void releaseToken(TextureToken);
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp
index 4056a4284..b4a71dc5f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDebugBorderDrawQuad.cpp
@@ -40,7 +40,7 @@ CCDebugBorderDrawQuad::CCDebugBorderDrawQuad(const CCSharedQuadState* sharedQuad
, m_width(width)
{
m_quadOpaque = false;
- if (m_color.alpha() != 1)
+ if (m_color.hasAlpha())
m_needsBlending = true;
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp
index 35477065e..e7b19a760 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.cpp
@@ -40,10 +40,11 @@ PassRefPtr<CCDelayBasedTimeSource> CCDelayBasedTimeSource::create(double interva
CCDelayBasedTimeSource::CCDelayBasedTimeSource(double intervalMs, CCThread* thread)
: m_client(0)
+ , m_hasTickTarget(false)
, m_intervalMs(intervalMs)
, m_tickTarget(0)
, m_state(STATE_INACTIVE)
- , m_thread(thread)
+ , m_timer(thread, this)
{
}
@@ -51,29 +52,45 @@ void CCDelayBasedTimeSource::setActive(bool active)
{
if (!active) {
m_state = STATE_INACTIVE;
+ m_timer.stop();
return;
}
- // Becoming active is deferred: we post a 0-delay task. When it runs, we use
- // that to establish the timebase, become truly active, and fire the first
- // tick.
if (m_state == STATE_STARTING || m_state == STATE_ACTIVE)
return;
- m_state = STATE_STARTING;
- postTickTask(0);
-}
+ if (!m_hasTickTarget) {
+ // Becoming active the first time is deferred: we post a 0-delay task. When
+ // it runs, we use that to establish the timebase, become truly active, and
+ // fire the first tick.
+ m_state = STATE_STARTING;
+ m_timer.startOneShot(0);
+ return;
+ }
-void CCDelayBasedTimeSource::postTickTask(long long delay)
-{
- this->ref();
- m_thread->postDelayedTask(createCCThreadTask(this, &CCDelayBasedTimeSource::onTick), delay);
+ m_state = STATE_ACTIVE;
+
+ double nowMs = monotonicallyIncreasingTimeMs();
+ postNextTickTask(nowMs);
}
-void CCDelayBasedTimeSource::onTick()
+void CCDelayBasedTimeSource::onTimerFired()
{
- updateState();
- this->deref();
+ ASSERT(m_state != STATE_INACTIVE);
+
+ double nowMs = monotonicallyIncreasingTimeMs();
+
+ if (m_state == STATE_STARTING) {
+ m_hasTickTarget = true;
+ m_tickTarget = nowMs;
+ m_state = STATE_ACTIVE;
+ }
+
+ postNextTickTask(nowMs);
+
+ // Fire the tick
+ if (m_client)
+ m_client->onTimerTick();
}
double CCDelayBasedTimeSource::monotonicallyIncreasingTimeMs() const
@@ -124,36 +141,22 @@ double CCDelayBasedTimeSource::monotonicallyIncreasingTimeMs() const
//
// For the really late delay, we we move to the next logical tick. The timebase is not reset.
// now=37 tickTarget=16.667 newTarget=50.000 --> tick(), postDelayedTask(floor(50.000-37)) --> postDelayedTask(13)
-void CCDelayBasedTimeSource::updateState()
+void CCDelayBasedTimeSource::postNextTickTask(double nowMs)
{
- if (m_state == STATE_INACTIVE)
- return;
-
- double now = monotonicallyIncreasingTimeMs();
-
- if (m_state == STATE_STARTING) {
- m_tickTarget = now;
- m_state = STATE_ACTIVE;
- }
-
- int numIntervalsElapsed = static_cast<int>(floor((now - m_tickTarget) / m_intervalMs));
+ int numIntervalsElapsed = static_cast<int>(floor((nowMs - m_tickTarget) / m_intervalMs));
double lastEffectiveTick = m_tickTarget + m_intervalMs * numIntervalsElapsed;
double newTickTarget = lastEffectiveTick + m_intervalMs;
- long long delay = static_cast<long long>(newTickTarget - now);
+ long long delay = static_cast<long long>(newTickTarget - nowMs);
if (!delay) {
newTickTarget = newTickTarget + m_intervalMs;
- delay = static_cast<long long>(newTickTarget - now);
+ delay = static_cast<long long>(newTickTarget - nowMs);
}
// Post another task *before* the tick and update state
- ASSERT(newTickTarget > now);
- postTickTask(delay);
+ ASSERT(newTickTarget > nowMs);
+ m_timer.startOneShot(delay);
m_tickTarget = newTickTarget;
-
- // Fire the tick
- if (m_client)
- m_client->onTimerTick();
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
index 6cc7338d5..6336b8849 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCDelayBasedTimeSource.h
@@ -26,6 +26,7 @@
#define CCDelayBasedTimeSource_h
#include "cc/CCTimeSource.h"
+#include "cc/CCTimer.h"
#include <wtf/PassRefPtr.h>
@@ -35,7 +36,7 @@ class CCThread;
// This timer implements a time source that achieves the specified interval
// in face of millisecond-precision delayed callbacks and random queueing delays.
-class CCDelayBasedTimeSource : public CCTimeSource {
+class CCDelayBasedTimeSource : public CCTimeSource, CCTimerClient {
public:
static PassRefPtr<CCDelayBasedTimeSource> create(double intervalMs, CCThread*);
@@ -45,14 +46,15 @@ public:
virtual void setActive(bool);
+ // CCTimerClient implementation.
+ virtual void onTimerFired();
+
// Virtual for testing.
virtual double monotonicallyIncreasingTimeMs() const;
protected:
CCDelayBasedTimeSource(double intervalMs, CCThread*);
- void onTick();
- void updateState();
- void postTickTask(long long delay);
+ void postNextTickTask(double nowMs);
enum State {
STATE_INACTIVE,
@@ -60,10 +62,12 @@ protected:
STATE_ACTIVE,
};
CCTimeSourceClient* m_client;
+ bool m_hasTickTarget;
double m_intervalMs;
double m_tickTarget;
State m_state;
CCThread* m_thread;
+ CCTimer m_timer;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
index 21fe68438..6837f0a5c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
@@ -129,15 +129,13 @@ PassOwnPtr<CCSharedQuadState> CCLayerImpl::createSharedQuadState() const
void CCLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState)
{
- IntRect layerRect(IntPoint(), bounds());
- quadList.append(CCCustomLayerDrawQuad::create(sharedQuadState, layerRect, this));
+ IntRect quadRect(IntPoint(), bounds());
+ quadList.append(CCCustomLayerDrawQuad::create(sharedQuadState, quadRect, this));
}
void CCLayerImpl::appendDebugBorderQuad(CCQuadList& quadList, const CCSharedQuadState* sharedQuadState) const
{
- if (!debugBorderColor().alpha())
- return;
- if (debugBorderWidth() <= 0)
+ if (!hasDebugBorders())
return;
IntRect layerRect(IntPoint(), bounds());
@@ -176,7 +174,13 @@ const IntRect CCLayerImpl::getDrawRect() const
TransformationMatrix CCLayerImpl::quadTransform() const
{
- return drawTransform();
+ TransformationMatrix quadTransformation = drawTransform();
+
+ float offsetX = -0.5 * bounds().width();
+ float offsetY = -0.5 * bounds().height();
+ quadTransformation.translate(offsetX, offsetY);
+
+ return quadTransformation;
}
void CCLayerImpl::writeIndent(TextStream& ts, int indent)
@@ -420,6 +424,11 @@ void CCLayerImpl::setDebugBorderWidth(float debugBorderWidth)
m_layerPropertyChanged = true;
}
+bool CCLayerImpl::hasDebugBorders() const
+{
+ return debugBorderColor().alpha() && debugBorderWidth() > 0;
+}
+
void CCLayerImpl::setContentBounds(const IntSize& contentBounds)
{
if (m_contentBounds == contentBounds)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
index a18fd4420..0136b01f8 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
@@ -132,6 +132,7 @@ public:
Color debugBorderColor() const { return m_debugBorderColor; }
void setDebugBorderWidth(float);
float debugBorderWidth() const { return m_debugBorderWidth; }
+ bool hasDebugBorders() const;
CCRenderSurface* renderSurface() const { return m_renderSurface.get(); }
void createRenderSurface();
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp
new file mode 100644
index 000000000..0767ff0e7
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.cpp
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "cc/CCLayerIterator.h"
+
+#include "LayerChromium.h"
+#include "RenderSurfaceChromium.h"
+#include "cc/CCLayerImpl.h"
+#include "cc/CCRenderSurface.h"
+
+namespace WebCore {
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::BackToFront::begin(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ pos.targetRenderSurfaceLayerIndex = 0;
+ pos.currentLayerIndex = CCLayerIteratorPositionValue::LayerIndexRepresentingTargetRenderSurface;
+
+ m_highestTargetRenderSurfaceLayer = 0;
+}
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::BackToFront::end(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ pos.targetRenderSurfaceLayerIndex = CCLayerIteratorPositionValue::InvalidTargetRenderSurfaceLayerIndex;
+ pos.currentLayerIndex = 0;
+}
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::BackToFront::next(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ // If the current layer has a RS, move to its layer list. Otherwise, visit the next layer in the current RS layer list.
+ if (pos.currentLayerRepresentsContributingRenderSurface()) {
+ // Save our position in the childLayer list for the RenderSurface, then jump to the next RenderSurface. Save where we
+ // came from in the next RenderSurface so we can get back to it.
+ pos.targetRenderSurface()->m_currentLayerIndexHistory = pos.currentLayerIndex;
+ int previousTargetRenderSurfaceLayer = pos.targetRenderSurfaceLayerIndex;
+
+ pos.targetRenderSurfaceLayerIndex = ++m_highestTargetRenderSurfaceLayer;
+ pos.currentLayerIndex = CCLayerIteratorPositionValue::LayerIndexRepresentingTargetRenderSurface;
+
+ pos.targetRenderSurface()->m_targetRenderSurfaceLayerIndexHistory = previousTargetRenderSurfaceLayer;
+ } else {
+ ++pos.currentLayerIndex;
+
+ int targetRenderSurfaceNumChildren = pos.targetRenderSurfaceChildren().size();
+ while (pos.currentLayerIndex == targetRenderSurfaceNumChildren) {
+ // Jump back to the previous RenderSurface, and get back the position where we were in that list, and move to the next position there.
+ if (!pos.targetRenderSurfaceLayerIndex) {
+ // End of the list
+ pos.targetRenderSurfaceLayerIndex = CCLayerIteratorPositionValue::InvalidTargetRenderSurfaceLayerIndex;
+ pos.currentLayerIndex = 0;
+ return;
+ }
+ pos.targetRenderSurfaceLayerIndex = pos.targetRenderSurface()->m_targetRenderSurfaceLayerIndexHistory;
+ pos.currentLayerIndex = pos.targetRenderSurface()->m_currentLayerIndexHistory + 1;
+
+ targetRenderSurfaceNumChildren = pos.targetRenderSurfaceChildren().size();
+ }
+ }
+}
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::FrontToBack::begin(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ pos.targetRenderSurfaceLayerIndex = 0;
+ pos.currentLayerIndex = pos.targetRenderSurfaceChildren().size() - 1;
+ goToHighestInSubtree(pos);
+}
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::FrontToBack::end(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ pos.targetRenderSurfaceLayerIndex = CCLayerIteratorPositionValue::InvalidTargetRenderSurfaceLayerIndex;
+ pos.currentLayerIndex = 0;
+}
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::FrontToBack::next(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ // Moves to the previous layer in the current RS layer list. Then we check if the
+ // new current layer has its own RS, in which case there are things in that RS layer list that are higher, so
+ // we find the highest layer in that subtree.
+ // If we move back past the front of the list, we jump up to the previous RS layer list, picking up again where we
+ // had previously recursed into the current RS layer list.
+
+ if (!pos.currentLayerRepresentsTargetRenderSurface()) {
+ // Subtracting one here will eventually cause the current layer to become that layer
+ // representing the target render surface.
+ --pos.currentLayerIndex;
+ goToHighestInSubtree(pos);
+ } else {
+ while (pos.currentLayerRepresentsTargetRenderSurface()) {
+ if (!pos.targetRenderSurfaceLayerIndex) {
+ // End of the list
+ pos.targetRenderSurfaceLayerIndex = CCLayerIteratorPositionValue::InvalidTargetRenderSurfaceLayerIndex;
+ pos.currentLayerIndex = 0;
+ return;
+ }
+ pos.targetRenderSurfaceLayerIndex = pos.targetRenderSurface()->m_targetRenderSurfaceLayerIndexHistory;
+ pos.currentLayerIndex = pos.targetRenderSurface()->m_currentLayerIndexHistory;
+ }
+ }
+}
+
+template <typename LayerType, typename RenderSurfaceType>
+void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIteratorPosition<LayerType, RenderSurfaceType>& pos)
+{
+ if (pos.currentLayerRepresentsTargetRenderSurface())
+ return;
+ while (pos.currentLayerRepresentsContributingRenderSurface()) {
+ // Save where we were in the current target surface, move to the next one, and save the target surface that we
+ // came from there so we can go back to it.
+ pos.targetRenderSurface()->m_currentLayerIndexHistory = pos.currentLayerIndex;
+ int previousTargetRenderSurfaceLayer = pos.targetRenderSurfaceLayerIndex;
+
+ for (LayerType* layer = pos.currentLayer(); pos.targetRenderSurfaceLayer() != layer; ++pos.targetRenderSurfaceLayerIndex) { }
+ pos.currentLayerIndex = pos.targetRenderSurfaceChildren().size() - 1;
+
+ pos.targetRenderSurface()->m_targetRenderSurfaceLayerIndexHistory = previousTargetRenderSurfaceLayer;
+ }
+}
+
+// Declare each of the above functions for LayerChromium and CCLayerImpl classes so that they are linked.
+template void CCLayerIteratorActions::BackToFront::begin(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+template void CCLayerIteratorActions::BackToFront::end(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+template void CCLayerIteratorActions::BackToFront::next(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+
+template void CCLayerIteratorActions::BackToFront::begin(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+template void CCLayerIteratorActions::BackToFront::end(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+template void CCLayerIteratorActions::BackToFront::next(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+
+template void CCLayerIteratorActions::FrontToBack::next(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+template void CCLayerIteratorActions::FrontToBack::end(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+template void CCLayerIteratorActions::FrontToBack::begin(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+template void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIteratorPosition<LayerChromium, RenderSurfaceChromium>&);
+
+template void CCLayerIteratorActions::FrontToBack::next(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+template void CCLayerIteratorActions::FrontToBack::end(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+template void CCLayerIteratorActions::FrontToBack::begin(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+template void CCLayerIteratorActions::FrontToBack::goToHighestInSubtree(CCLayerIteratorPosition<CCLayerImpl, CCRenderSurface>&);
+
+} // namespace WebCore
+
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h
new file mode 100644
index 000000000..8f412c44d
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIterator.h
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CCLayerIterator_h
+#define CCLayerIterator_h
+
+#include "cc/CCLayerIteratorPosition.h"
+
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+// These classes provide means to iterate over the RenderSurface-Layer tree.
+
+// Example code follows, for a tree of LayerChromium/RenderSurfaceChromium objects. See below for details.
+//
+// void doStuffOnLayers(const Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList)
+// {
+// typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> CCLayerIteratorType;
+//
+// CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList);
+// for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) {
+// // Only one of these will be true
+// if (it.representsTargetRenderSurface())
+// foo(*it); // *it is a layer representing a target RenderSurface
+// if (it.representsContributingRenderSurface())
+// bar(*it); // *it is a layer representing a RenderSurface that contributes to the layer's target RenderSurface
+// if (it.representsItself())
+// baz(*it); // *it is a layer representing itself, as it contributes to its own target RenderSurface
+// }
+// }
+
+// A RenderSurface R may be referred to in one of two different contexts. One RenderSurface is "current" at any time, for
+// whatever operation is being performed. This current surface is referred to as a target surface. For example, when R is
+// being painted it would be the target surface. Once R has been painted, its contents may be included into another
+// surface S. While S is considered the target surface when it is being painted, R is called a contributing surface
+// in this context as it contributes to the content of the target surface S.
+//
+// The iterator's current position in the tree always points to some layer. The state of the iterator indicates the role of the
+// layer, and will be one of the following three states. A single layer L will appear in the iteration process in at least one,
+// and possibly all, of these states.
+// 1. Representing the target surface: The iterator in this state, pointing at layer L, indicates that the target RenderSurface
+// is now the surface owned by L. This will occur exactly once for each RenderSurface in the tree.
+// 2. Representing a contributing surface: The iterator in this state, pointing at layer L, refers to the RenderSurface owned
+// by L as a contributing surface, without changing the current target RenderSurface.
+// 3. Representing itself: The iterator in this state, pointing at layer L, refers to the layer itself, as a child of the
+// current target RenderSurface.
+//
+// The BackToFront iterator will return a layer representing the target surface before returning layers representing themselves
+// as children of the current target surface. Whereas the FrontToBack ordering will iterate over children layers of a surface
+// before the layer representing the surface as a target surface.
+//
+// To use the iterators:
+//
+// Create a stepping iterator and end iterator by calling CCLayerIterator::begin() and CCLayerIterator::end() and passing in the
+// list of layers owning target RenderSurfaces. Step through the tree by incrementing the stepping iterator while it is != to
+// the end iterator. At each step the iterator knows what the layer is representing, and you can query the iterator to decide
+// what actions to perform with the layer given what it represents.
+
+//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// An iterator class for walking over layers in the RenderSurface-Layer tree.
+template <typename LayerType, typename RenderSurfaceType, typename IteratorActionType>
+class CCLayerIterator {
+ typedef CCLayerIterator<LayerType, RenderSurfaceType, IteratorActionType> CCLayerIteratorType;
+
+public:
+ CCLayerIterator() { }
+
+ static CCLayerIteratorType begin(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList) { return CCLayerIteratorType(renderSurfaceLayerList, true); }
+ static CCLayerIteratorType end(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList) { return CCLayerIteratorType(renderSurfaceLayerList, false); }
+
+ CCLayerIteratorType& operator++() { ASSERT(m_actions); m_actions->next(m_position); return *this; }
+ bool operator==(const CCLayerIteratorType& other) const { return m_position == other.m_position; }
+ bool operator!=(const CCLayerIteratorType& other) const { return !(*this == other); }
+
+ LayerType* operator->() const { return m_position.currentLayer(); }
+ LayerType* operator*() const { return m_position.currentLayer(); }
+
+ bool representsTargetRenderSurface() const { return m_position.currentLayerRepresentsTargetRenderSurface(); }
+ bool representsContributingRenderSurface() const { return !representsTargetRenderSurface() && m_position.currentLayerRepresentsContributingRenderSurface(); }
+ bool representsItself() const { return !representsTargetRenderSurface() && !representsContributingRenderSurface(); }
+
+ LayerType* targetRenderSurfaceLayer() const { return m_position.targetRenderSurfaceLayer(); }
+
+private:
+ CCLayerIterator(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList, bool start)
+ : m_position(renderSurfaceLayerList)
+ , m_actions(adoptPtr(new IteratorActionType()))
+ {
+ if (start && !renderSurfaceLayerList->isEmpty())
+ m_actions->begin(m_position);
+ else
+ m_actions->end(m_position);
+ }
+
+ CCLayerIteratorPosition<LayerType, RenderSurfaceType> m_position;
+ OwnPtr<IteratorActionType> m_actions;
+};
+
+// Orderings for iterating over the RenderSurface-Layer tree.
+struct CCLayerIteratorActions {
+ // Walks layers sorted by z-order from back to front.
+ class BackToFront {
+ public:
+ template <typename LayerType, typename RenderSurfaceType>
+ void begin(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+
+ template <typename LayerType, typename RenderSurfaceType>
+ void end(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+
+ template <typename LayerType, typename RenderSurfaceType>
+ void next(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+
+ private:
+ int m_highestTargetRenderSurfaceLayer;
+ };
+
+ // Walks layers sorted by z-order from front to back
+ class FrontToBack {
+ public:
+ template <typename LayerType, typename RenderSurfaceType>
+ void begin(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+
+ template <typename LayerType, typename RenderSurfaceType>
+ void end(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+
+ template <typename LayerType, typename RenderSurfaceType>
+ void next(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+
+ private:
+ template <typename LayerType, typename RenderSurfaceType>
+ void goToHighestInSubtree(CCLayerIteratorPosition<LayerType, RenderSurfaceType>&);
+ };
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerIteratorPosition.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIteratorPosition.h
new file mode 100644
index 000000000..b1f63c45f
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerIteratorPosition.h
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CCLayerIteratorPosition_h
+#define CCLayerIteratorPosition_h
+
+#include "cc/CCLayerTreeHostCommon.h"
+
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+// Non-templated constants
+struct CCLayerIteratorPositionValue {
+ static const int InvalidTargetRenderSurfaceLayerIndex = -1;
+ // This must be -1 since the iterator action code assumes that this value can be
+ // reached by subtracting one from the position of the first layer in the current
+ // target surface's child layer list, which is 0.
+ static const int LayerIndexRepresentingTargetRenderSurface = -1;
+};
+
+// A struct to hold the iterator's current position, which is passed to the various CCLayerIteratorAction functions, for them to
+// read and update. This struct exists so the templated action functions don't need to access the CCLayerIterator class.
+//
+// There is a 1:1 relationship between an instance of the CCLayerIteratorPosition class and a CCLayerIteratorActions::Foo class,
+// so an iterator action class can hold extra position data, if required, in its own class instance.
+//
+// The current position of the iterator is held in two integer variables.
+// - The targetRenderSurfaceLayerIndex is a position in the renderSurfaceLayerList. This points to a layer which owns the current
+// target surface. This is a value from 0 to n-1 (n = size of renderSurfaceLayerList = number of surfaces). A value outside of
+// this range (for example, CCLayerIteratorPositionValue::InvalidTargetRenderSurfaceLayerIndex) is used to indicate a position
+// outside the bounds of the tree.
+// - The currentLayerIndex is a position in the list of layers that are children of the current target surface. When pointing to
+// one of these layers, this is a value from 0 to n-1 (n = number of children). Since the iterator must also stop at the layers
+// representing the target surface, this is done by setting the currentLayerIndex to a value of
+// CCLayerIteratorPositionValue::LayerRepresentingTargetRenderSurface.
+template<typename LayerType, typename RenderSurfaceType>
+struct CCLayerIteratorPosition {
+ CCLayerIteratorPosition() : renderSurfaceLayerList(0) { }
+ explicit CCLayerIteratorPosition(const Vector<RefPtr<LayerType> >* renderSurfaceLayerList) : renderSurfaceLayerList(renderSurfaceLayerList) { }
+
+ inline LayerType* currentLayer() const { return currentLayerRepresentsTargetRenderSurface() ? targetRenderSurfaceLayer() : targetRenderSurfaceChildren()[currentLayerIndex].get(); }
+
+ inline bool currentLayerRepresentsContributingRenderSurface() const { return CCLayerTreeHostCommon::renderSurfaceContributesToTarget<LayerType>(currentLayer(), targetRenderSurfaceLayer()->id()); }
+ inline bool currentLayerRepresentsTargetRenderSurface() const { return currentLayerIndex == CCLayerIteratorPositionValue::LayerIndexRepresentingTargetRenderSurface; }
+
+ inline LayerType* targetRenderSurfaceLayer() const { return (*renderSurfaceLayerList)[targetRenderSurfaceLayerIndex].get(); }
+ inline RenderSurfaceType* targetRenderSurface() const { return targetRenderSurfaceLayer()->renderSurface(); }
+ inline const Vector<RefPtr<LayerType> >& targetRenderSurfaceChildren() const { return targetRenderSurface()->layerList(); }
+
+ inline bool operator==(const CCLayerIteratorPosition& other) const
+ {
+ return targetRenderSurfaceLayerIndex == other.targetRenderSurfaceLayerIndex
+ && currentLayerIndex == other.currentLayerIndex;
+ }
+
+ const Vector<RefPtr<LayerType> >* renderSurfaceLayerList;
+ int targetRenderSurfaceLayerIndex;
+ int currentLayerIndex;
+};
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
index 379d16083..8663ec0ac 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
@@ -31,6 +31,7 @@
#include "LayerRendererChromium.h"
#include "TraceEvent.h"
#include "TreeSynchronizer.h"
+#include "cc/CCLayerIterator.h"
#include "cc/CCLayerTreeHostCommon.h"
#include "cc/CCLayerTreeHostImpl.h"
#include "cc/CCSingleThreadProxy.h"
@@ -156,7 +157,7 @@ void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl)
hostImpl->setSourceFrameNumber(frameNumber());
hostImpl->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
- hostImpl->setViewport(viewportSize());
+ hostImpl->setViewportSize(viewportSize());
hostImpl->setPageScaleFactorAndLimits(pageScale(), m_minPageScale, m_maxPageScale);
m_frameNumber++;
@@ -247,8 +248,11 @@ void CCLayerTreeHost::setRootLayer(PassRefPtr<LayerChromium> rootLayer)
setNeedsCommit();
}
-void CCLayerTreeHost::setViewport(const IntSize& viewportSize)
+void CCLayerTreeHost::setViewportSize(const IntSize& viewportSize)
{
+ if (viewportSize == m_viewportSize)
+ return;
+
contentsTextureManager()->setMaxMemoryLimitBytes(TextureManager::highLimitBytes(viewportSize));
contentsTextureManager()->setPreferredMemoryLimitBytes(TextureManager::reclaimLimitBytes(viewportSize));
m_viewportSize = viewportSize;
@@ -428,57 +432,40 @@ void CCLayerTreeHost::paintMaskAndReplicaForRenderSurface(LayerChromium* renderS
void CCLayerTreeHost::paintLayerContents(const LayerList& renderSurfaceLayerList, PaintType paintType)
{
- for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
- LayerChromium* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();
- RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();
- ASSERT(renderSurface);
- ASSERT(renderSurface->drawOpacity());
-
- paintMaskAndReplicaForRenderSurface(renderSurfaceLayer, paintType);
-
- const LayerList& layerList = renderSurface->layerList();
- for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
- LayerChromium* layer = layerList[layerIndex].get();
-
- // Layers that start a new render surface will be painted when the render
- // surface's list is processed.
- if (CCLayerTreeHostCommon::renderSurfaceContributesToTarget<LayerChromium>(layer, renderSurfaceLayer->id()))
- continue;
-
- ASSERT(!layer->bounds().isEmpty());
-
- paintContentsIfDirty(layer, paintType);
+ // Use FrontToBack to allow for testing occlusion and performing culling during the tree walk.
+ typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> CCLayerIteratorType;
+
+ CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList);
+ for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) {
+ if (it.representsTargetRenderSurface()) {
+ ASSERT(it->renderSurface()->drawOpacity());
+ paintMaskAndReplicaForRenderSurface(*it, paintType);
+ } else if (it.representsItself()) {
+ ASSERT(!it->bounds().isEmpty());
+ paintContentsIfDirty(*it, paintType);
}
}
}
void CCLayerTreeHost::updateCompositorResources(GraphicsContext3D* context, CCTextureUpdater& updater)
{
- for (int surfaceIndex = m_updateList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
- LayerChromium* renderSurfaceLayer = m_updateList[surfaceIndex].get();
- RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();
- ASSERT(renderSurface);
- ASSERT(renderSurface->drawOpacity());
-
- if (renderSurfaceLayer->maskLayer())
- renderSurfaceLayer->maskLayer()->updateCompositorResources(context, updater);
-
- if (renderSurfaceLayer->replicaLayer()) {
- renderSurfaceLayer->replicaLayer()->updateCompositorResources(context, updater);
-
- if (renderSurfaceLayer->replicaLayer()->maskLayer())
- renderSurfaceLayer->replicaLayer()->maskLayer()->updateCompositorResources(context, updater);
- }
-
- const LayerList& layerList = renderSurface->layerList();
- for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
- LayerChromium* layer = layerList[layerIndex].get();
-
- if (CCLayerTreeHostCommon::renderSurfaceContributesToTarget<LayerChromium>(layer, renderSurfaceLayer->id()))
- continue;
-
- layer->updateCompositorResources(context, updater);
- }
+ // Use BackToFront since it's cheap and this isn't order-dependent.
+ typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> CCLayerIteratorType;
+
+ CCLayerIteratorType end = CCLayerIteratorType::end(&m_updateList);
+ for (CCLayerIteratorType it = CCLayerIteratorType::begin(&m_updateList); it != end; ++it) {
+ if (it.representsTargetRenderSurface()) {
+ ASSERT(it->renderSurface()->drawOpacity());
+ if (it->maskLayer())
+ it->maskLayer()->updateCompositorResources(context, updater);
+
+ if (it->replicaLayer()) {
+ it->replicaLayer()->updateCompositorResources(context, updater);
+ if (it->replicaLayer()->maskLayer())
+ it->replicaLayer()->maskLayer()->updateCompositorResources(context, updater);
+ }
+ } else if (it.representsItself())
+ it->updateCompositorResources(context, updater);
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
index 4f293eca5..2f989bcf6 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
@@ -169,7 +169,7 @@ public:
const CCSettings& settings() const { return m_settings; }
- void setViewport(const IntSize& viewportSize);
+ void setViewportSize(const IntSize&);
const IntSize& viewportSize() const { return m_viewportSize; }
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
index fc08f71ee..b4e7be415 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostCommon.cpp
@@ -33,6 +33,7 @@
#include "RenderSurfaceChromium.h"
#include "TransformationMatrix.h"
#include "cc/CCLayerImpl.h"
+#include "cc/CCLayerIterator.h"
#include "cc/CCLayerSorter.h"
#include "cc/CCRenderSurface.h"
@@ -469,15 +470,14 @@ static bool calculateDrawTransformsAndVisibilityInternal(LayerType* layer, Layer
template<typename LayerType, typename RenderSurfaceType>
static void walkLayersAndCalculateVisibleLayerRects(const Vector<RefPtr<LayerType> >& renderSurfaceLayerList)
{
- for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
- LayerType* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex].get();
- RenderSurfaceType* renderSurface = renderSurfaceLayer->renderSurface();
-
- Vector<RefPtr<LayerType> >& layerList = renderSurface->layerList();
- for (unsigned layerIndex = 0; layerIndex < layerList.size(); ++layerIndex) {
- LayerType* layer = layerList[layerIndex].get();
- IntRect visibleLayerRect = CCLayerTreeHostCommon::calculateVisibleLayerRect<LayerType>(layer);
- layer->setVisibleLayerRect(visibleLayerRect);
+ // Use BackToFront since it's cheap and this isn't order-dependent.
+ typedef CCLayerIterator<LayerType, RenderSurfaceType, CCLayerIteratorActions::BackToFront> CCLayerIteratorType;
+
+ CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList);
+ for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) {
+ if (!it.representsTargetRenderSurface()) {
+ IntRect visibleLayerRect = CCLayerTreeHostCommon::calculateVisibleLayerRect<LayerType>(*it);
+ it->setVisibleLayerRect(visibleLayerRect);
}
}
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
index f6cfaa54f..02186caaf 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
@@ -187,7 +187,7 @@ static FloatRect damageInSurfaceSpace(CCLayerImpl* renderSurfaceLayer, const Flo
return surfaceDamageRect;
}
-void CCLayerTreeHostImpl::calculateRenderPasses(Vector<OwnPtr<CCRenderPass> >& passes)
+void CCLayerTreeHostImpl::calculateRenderPasses(CCRenderPassList& passes)
{
CCLayerList renderSurfaceLayerList;
renderSurfaceLayerList.append(rootLayer());
@@ -238,6 +238,12 @@ void CCLayerTreeHostImpl::calculateRenderPasses(Vector<OwnPtr<CCRenderPass> >& p
}
}
+void CCLayerTreeHostImpl::optimizeRenderPasses(CCRenderPassList& passes)
+{
+ for (unsigned i = 0; i < passes.size(); ++i)
+ passes[i]->optimizeQuads();
+}
+
void CCLayerTreeHostImpl::drawLayers()
{
TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0);
@@ -246,9 +252,11 @@ void CCLayerTreeHostImpl::drawLayers()
if (!rootLayer())
return;
- Vector<OwnPtr<CCRenderPass> > passes;
+ CCRenderPassList passes;
calculateRenderPasses(passes);
+ optimizeRenderPasses(passes);
+
m_layerRenderer->beginDrawingFrame();
for (size_t i = 0; i < passes.size(); ++i)
m_layerRenderer->drawRenderPass(passes[i].get());
@@ -353,7 +361,7 @@ bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D>
return m_layerRenderer;
}
-void CCLayerTreeHostImpl::setViewport(const IntSize& viewportSize)
+void CCLayerTreeHostImpl::setViewportSize(const IntSize& viewportSize)
{
if (viewportSize == m_viewportSize)
return;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
index fe774ee00..e4d006d4f 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
@@ -107,7 +107,7 @@ public:
int sourceFrameNumber() const { return m_sourceFrameNumber; }
void setSourceFrameNumber(int frameNumber) { m_sourceFrameNumber = frameNumber; }
- void setViewport(const IntSize& viewportSize);
+ void setViewportSize(const IntSize&);
const IntSize& viewportSize() const { return m_viewportSize; }
void setPageScaleFactorAndLimits(float pageScale, float minPageScale, float maxPageScale);
@@ -133,7 +133,8 @@ private:
void adjustScrollsForPageScaleChange(float);
void updateMaxScrollPosition();
void trackDamageForAllSurfaces(CCLayerImpl* rootDrawLayer, const CCLayerList& renderSurfaceLayerList);
- void calculateRenderPasses(Vector<OwnPtr<CCRenderPass> >&);
+ void calculateRenderPasses(CCRenderPassList&);
+ void optimizeRenderPasses(CCRenderPassList&);
OwnPtr<LayerRendererChromium> m_layerRenderer;
RefPtr<CCLayerImpl> m_rootLayerImpl;
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
new file mode 100644
index 000000000..4a8b85130
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.cpp
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "cc/CCQuadCuller.h"
+
+#include "Region.h"
+#include "TransformationMatrix.h"
+#include "cc/CCCustomLayerDrawQuad.h"
+#include "cc/CCLayerImpl.h"
+#include "cc/CCRenderPass.h"
+#include "cc/CCRenderSurfaceDrawQuad.h"
+
+namespace std {
+
+// Specialize for OwnPtr<CCDrawQuad> since Vector doesn't know how to reverse a Vector of OwnPtr<T> in general.
+template<>
+void swap(OwnPtr<WebCore::CCDrawQuad>& a, OwnPtr<WebCore::CCDrawQuad>& b)
+{
+ a.swap(b);
+}
+
+}
+
+namespace WebCore {
+
+static bool regionContainsRect(const Region& region, const IntRect& rect)
+{
+ Region rectRegion(rect);
+ Region intersectRegion(intersect(region, rectRegion));
+
+ if (intersectRegion.isEmpty())
+ return false;
+
+ rectRegion.subtract(intersectRegion);
+ return rectRegion.isEmpty();
+}
+
+void CCQuadCuller::cullOccludedQuads(CCQuadList& quadList)
+{
+ if (!quadList.size())
+ return;
+
+ CCQuadList culledList;
+ culledList.reserveCapacity(quadList.size());
+
+ Region opaqueCoverageThusFar;
+
+ for (int i = quadList.size() - 1; i >= 0; --i) {
+ CCDrawQuad* drawQuad = quadList[i].get();
+
+ IntRect quadRect(drawQuad->quadTransform().mapRect(drawQuad->quadRect()));
+
+ bool keepQuad = !regionContainsRect(opaqueCoverageThusFar, quadRect);
+
+ if (keepQuad && drawQuad->drawsOpaque() && drawQuad->isLayerAxisAlignedIntRect())
+ opaqueCoverageThusFar.unite(Region(quadRect));
+
+ if (keepQuad)
+ culledList.append(quadList[i].release());
+ }
+ quadList.clear(); // Release anything that remains.
+
+ culledList.reverse();
+ quadList.swap(culledList);
+}
+
+} // namespace WebCore
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
new file mode 100644
index 000000000..7179285ac
--- /dev/null
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCQuadCuller.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY 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 CCQuadCuller_h
+#define CCQuadCuller_h
+
+#include "cc/CCRenderPass.h"
+
+namespace WebCore {
+
+class CCQuadCuller {
+public:
+ static void cullOccludedQuads(CCQuadList&);
+
+private:
+ // Make non-instantiable.
+ CCQuadCuller() { }
+};
+
+}
+#endif // CCQuadCuller_h
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
index 71adc4b3e..6f51fbcde 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.cpp
@@ -28,6 +28,7 @@
#include "cc/CCRenderPass.h"
#include "cc/CCLayerImpl.h"
+#include "cc/CCQuadCuller.h"
#include "cc/CCRenderSurfaceDrawQuad.h"
#include "cc/CCSharedQuadState.h"
@@ -63,4 +64,9 @@ void CCRenderPass::appendQuadsForRenderSurfaceLayer(CCLayerImpl* layer)
m_sharedQuadStateList.append(sharedQuadState.release());
}
+void CCRenderPass::optimizeQuads()
+{
+ CCQuadCuller::cullOccludedQuads(m_quadList);
+}
+
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
index 16e072e80..9fb77166c 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderPass.h
@@ -46,6 +46,8 @@ public:
void appendQuadsForLayer(CCLayerImpl*);
void appendQuadsForRenderSurfaceLayer(CCLayerImpl*);
+ void optimizeQuads();
+
const CCQuadList& quadList() const { return m_quadList; }
CCRenderSurface* targetSurface() const { return m_targetSurface; }
@@ -61,6 +63,8 @@ private:
FloatRect m_surfaceDamageRect;
};
+typedef Vector<OwnPtr<CCRenderPass> > CCRenderPassList;
+
}
#endif
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
index a8e87a9f9..ab8386d5d 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCRenderSurface.h
@@ -129,6 +129,11 @@ private:
// Stored in the "surface space" where this damage can be used for scissoring.
FloatRect m_damageRect;
+
+ // For CCLayerIteratorActions
+ int m_targetRenderSurfaceLayerIndexHistory;
+ int m_currentLayerIndexHistory;
+ friend struct CCLayerIteratorActions;
};
}
diff --git a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
index 6ccb40704..5849ef1eb 100644
--- a/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
+++ b/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
@@ -30,6 +30,7 @@
#include "cc/CCTiledLayerImpl.h"
#include "LayerRendererChromium.h"
+#include "cc/CCDebugBorderDrawQuad.h"
#include "cc/CCSolidColorDrawQuad.h"
#include "cc/CCTileDrawQuad.h"
#include <wtf/text/WTFString.h>
@@ -38,6 +39,9 @@ using namespace std;
namespace WebCore {
+static const int debugTileBorderWidth = 1;
+static const int debugTileBorderAlpha = 100;
+
class ManagedTexture;
class DrawableTile : public CCLayerTilingData::Tile {
@@ -156,6 +160,11 @@ void CCTiledLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState
const GC3Dint textureFilter = m_tiler->hasBorderTexels() ? GraphicsContext3D::LINEAR : GraphicsContext3D::NEAREST;
quadList.append(CCTileDrawQuad::create(sharedQuadState, tileRect, tile->textureId(), textureOffset, textureSize, textureFilter, contentsSwizzled(), leftEdgeAA, topEdgeAA, rightEdgeAA, bottomEdgeAA));
+
+ if (hasDebugBorders()) {
+ Color color(debugBorderColor().red(), debugBorderColor().green(), debugBorderColor().blue(), debugTileBorderAlpha);
+ quadList.append(CCDebugBorderDrawQuad::create(sharedQuadState, tileRect, color, debugTileBorderWidth));
+ }
}
}
}
diff --git a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
index f9a86eb17..027642be7 100644
--- a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
+++ b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
@@ -273,13 +273,6 @@ void FEGaussianBlur::determineAbsolutePaintRect()
void FEGaussianBlur::platformApplySoftware()
{
-#if USE(SKIA)
- if (filter()->renderingMode() == Accelerated) {
- platformApplySkia();
- return;
- }
-#endif
-
FilterEffect* in = inputEffect(0);
ByteArray* srcPixelArray = createPremultipliedImageResult();
diff --git a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
index 7f6c3bbee..b295d3608 100644
--- a/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
+++ b/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
@@ -74,7 +74,9 @@ private:
inline void platformApplyGeneric(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
inline void platformApplyNeon(ByteArray* srcPixelArray, ByteArray* tmpPixelArray, unsigned kernelSizeX, unsigned kernelSizeY, IntSize& paintSize);
- void platformApplySkia();
+#if USE(SKIA)
+ virtual bool platformApplySkia();
+#endif
float m_stdX;
float m_stdY;
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffect.cpp b/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
index 6516faadc..fbeb4bbcb 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
+++ b/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
@@ -104,6 +104,10 @@ void FilterEffect::apply()
determineAbsolutePaintRect();
// Add platform specific apply functions here and return earlier.
+#if USE(SKIA)
+ if (platformApplySkia())
+ return;
+#endif
platformApplySoftware();
}
diff --git a/Source/WebCore/platform/graphics/filters/FilterEffect.h b/Source/WebCore/platform/graphics/filters/FilterEffect.h
index 073010d27..1bae4ca0a 100644
--- a/Source/WebCore/platform/graphics/filters/FilterEffect.h
+++ b/Source/WebCore/platform/graphics/filters/FilterEffect.h
@@ -87,6 +87,9 @@ public:
void apply();
virtual void platformApplySoftware() = 0;
+#if USE(SKIA)
+ virtual bool platformApplySkia() { return false; }
+#endif
virtual void dump() = 0;
virtual void determineAbsolutePaintRect();
diff --git a/Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkia.cpp b/Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkia.cpp
new file mode 100644
index 000000000..0fd07776e
--- /dev/null
+++ b/Source/WebCore/platform/graphics/filters/skia/FEColorMatrixSkia.cpp
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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"
+#if ENABLE(FILTERS) && USE(SKIA)
+#include "FEColorMatrix.h"
+
+#include "NativeImageSkia.h"
+#include "SkColorMatrixFilter.h"
+
+namespace WebCore {
+
+static void saturateMatrix(float s, SkScalar matrix[20])
+{
+ matrix[0] = 0.213f + 0.787f * s;
+ matrix[1] = 0.715f - 0.715f * s;
+ matrix[2] = 0.072f - 0.072f * s;
+ matrix[3] = matrix[4] = 0;
+ matrix[5] = 0.213f - 0.213f * s;
+ matrix[6] = 0.715f + 0.285f * s;
+ matrix[7] = 0.072f - 0.072f * s;
+ matrix[8] = matrix[9] = 0;
+ matrix[10] = 0.213f - 0.213f * s;
+ matrix[11] = 0.715f - 0.715f * s;
+ matrix[12] = 0.072f + 0.928f * s;
+ matrix[13] = matrix[14] = 0;
+ matrix[15] = matrix[16] = matrix[17] = 0;
+ matrix[18] = 1;
+ matrix[19] = 0;
+}
+
+static void hueRotateMatrix(float hue, SkScalar matrix[20])
+{
+ float cosHue = cosf(hue * piFloat / 180);
+ float sinHue = sinf(hue * piFloat / 180);
+ matrix[0] = 0.213f + cosHue * 0.787f - sinHue * 0.213f;
+ matrix[1] = 0.715f - cosHue * 0.715f - sinHue * 0.715f;
+ matrix[2] = 0.072f - cosHue * 0.072f + sinHue * 0.928f;
+ matrix[3] = matrix[4] = 0;
+ matrix[5] = 0.213f - cosHue * 0.213f + sinHue * 0.143f;
+ matrix[6] = 0.715f + cosHue * 0.285f + sinHue * 0.140f;
+ matrix[7] = 0.072f - cosHue * 0.072f - sinHue * 0.283f;
+ matrix[8] = matrix[9] = 0;
+ matrix[10] = 0.213f - cosHue * 0.213f - sinHue * 0.787f;
+ matrix[11] = 0.715f - cosHue * 0.715f + sinHue * 0.715f;
+ matrix[12] = 0.072f + cosHue * 0.928f + sinHue * 0.072f;
+ matrix[13] = matrix[14] = 0;
+ matrix[15] = matrix[16] = matrix[17] = 0;
+ matrix[18] = 1;
+ matrix[19] = 0;
+}
+
+static void luminanceToAlphaMatrix(SkScalar matrix[20])
+{
+ memset(matrix, 0, 20 * sizeof(SkScalar));
+ matrix[15] = 0.2125f;
+ matrix[16] = 0.7154f;
+ matrix[17] = 0.0721f;
+}
+
+bool FEColorMatrix::platformApplySkia()
+{
+ ImageBuffer* resultImage = createImageBufferResult();
+ if (!resultImage)
+ return false;
+
+ FilterEffect* in = inputEffect(0);
+
+ IntRect imageRect(IntPoint(), absolutePaintRect().size());
+
+ SkScalar matrix[20];
+
+ switch (m_type) {
+ case FECOLORMATRIX_TYPE_UNKNOWN:
+ break;
+ case FECOLORMATRIX_TYPE_MATRIX:
+ for (int i = 0; i < 20; ++i)
+ matrix[i] = m_values[i];
+
+ matrix[4] *= SkScalar(255);
+ matrix[9] *= SkScalar(255);
+ matrix[14] *= SkScalar(255);
+ matrix[19] *= SkScalar(255);
+ break;
+ case FECOLORMATRIX_TYPE_SATURATE:
+ saturateMatrix(m_values[0], matrix);
+ break;
+ case FECOLORMATRIX_TYPE_HUEROTATE:
+ hueRotateMatrix(m_values[0], matrix);
+ break;
+ case FECOLORMATRIX_TYPE_LUMINANCETOALPHA:
+ luminanceToAlphaMatrix(matrix);
+ break;
+ }
+
+ RefPtr<Image> image = in->asImageBuffer()->copyImage(DontCopyBackingStore);
+ NativeImageSkia* nativeImage = image->nativeImageForCurrentFrame();
+ if (!nativeImage)
+ return false;
+
+ SkCanvas* canvas = resultImage->context()->platformContext()->canvas();
+ SkPaint paint;
+ paint.setColorFilter(new SkColorMatrixFilter(matrix))->unref();
+ paint.setXfermodeMode(SkXfermode::kSrc_Mode);
+ canvas->drawBitmap(nativeImage->bitmap(), 0, 0, &paint);
+ return true;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(FILTERS) && USE(SKIA)
diff --git a/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp b/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp
index ceb1146c7..4b36751fa 100644
--- a/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp
+++ b/Source/WebCore/platform/graphics/filters/skia/FEGaussianBlurSkia.cpp
@@ -32,11 +32,11 @@
namespace WebCore {
-void FEGaussianBlur::platformApplySkia()
+bool FEGaussianBlur::platformApplySkia()
{
ImageBuffer* resultImage = createImageBufferResult();
if (!resultImage)
- return;
+ return false;
FilterEffect* in = inputEffect(0);
@@ -57,7 +57,7 @@ void FEGaussianBlur::platformApplySkia()
paint.setColor(0xFFFFFFFF);
dstContext->drawImage(image.get(), ColorSpaceDeviceRGB, drawingRegion.location(), CompositeCopy);
canvas->restore();
- return;
+ return true;
}
};
diff --git a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
index 3cc6be713..5d6e7fb26 100644
--- a/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
+++ b/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
@@ -162,9 +162,4 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
return w;
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
}
diff --git a/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
index 32f587c46..fd5e977ce 100644
--- a/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
+++ b/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp
@@ -212,7 +212,7 @@ static void webkit_web_src_class_init(WebKitWebSrcClass* klass)
static void webkit_web_src_init(WebKitWebSrc* src)
{
- GstPadTemplate* padTemplate = gst_static_pad_template_get(&srcTemplate);
+ GRefPtr<GstPadTemplate> padTemplate = adoptGRef(gst_static_pad_template_get(&srcTemplate));
WebKitWebSrcPrivate* priv = WEBKIT_WEB_SRC_GET_PRIVATE(src);
src->priv = priv;
@@ -232,7 +232,7 @@ static void webkit_web_src_init(WebKitWebSrc* src)
GRefPtr<GstPad> targetPad = adoptGRef(gst_element_get_static_pad(GST_ELEMENT(priv->appsrc), "src"));
- priv->srcpad = gst_ghost_pad_new_from_template("src", targetPad.get(), padTemplate);
+ priv->srcpad = gst_ghost_pad_new_from_template("src", targetPad.get(), padTemplate.get());
gst_element_add_pad(GST_ELEMENT(src), priv->srcpad);
gst_pad_set_query_function(priv->srcpad, webKitWebSrcQuery);
diff --git a/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp b/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
index 5045e1070..f8bef5c00 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/FontPlatformDataHarfBuzz.cpp
@@ -36,6 +36,7 @@
#include "PlatformSupport.h"
#include "SkAdvancedTypefaceMetrics.h"
+#include "SkFontHost.h"
#include "SkPaint.h"
#include "SkTypeface.h"
@@ -116,9 +117,17 @@ int FontPlatformData::emSizeInFontUnits() const
if (m_emSizeInFontUnits)
return m_emSizeInFontUnits;
+ // FIXME: Switch to the SkTypeface::GetUnitsPerEm API once this becomes available.
+ // https://bugs.webkit.org/show_bug.cgi?id=75961
+#if OS(ANDROID)
+ // Android doesn't currently support Skia's getAdvancedTypefaceMetrics(),
+ // but it has access to another method to replace this functionality.
+ m_emSizeInFontUnits = SkFontHost::GetUnitsPerEm(m_typeface->uniqueID());
+#else
SkAdvancedTypefaceMetrics* metrics = m_typeface->getAdvancedTypefaceMetrics(SkAdvancedTypefaceMetrics::kNo_PerGlyphInfo);
m_emSizeInFontUnits = metrics->fEmSize;
metrics->unref();
+#endif
return m_emSizeInFontUnits;
}
diff --git a/Source/WebCore/platform/graphics/harfbuzz/SimpleFontDataSkia.cpp b/Source/WebCore/platform/graphics/harfbuzz/SimpleFontDataSkia.cpp
index d02c12ada..782b02fa9 100644
--- a/Source/WebCore/platform/graphics/harfbuzz/SimpleFontDataSkia.cpp
+++ b/Source/WebCore/platform/graphics/harfbuzz/SimpleFontDataSkia.cpp
@@ -236,9 +236,4 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
return round(SkScalarToFloat(width));
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index 17f226495..54c03f879 100644
--- a/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -467,32 +467,4 @@ bool SimpleFontData::canRenderCombiningCharacterSequence(const UChar* characters
return true;
}
-static inline void decomposeToUTF16(UChar* buffer, unsigned& length, const UChar32 character)
-{
- if (U_IS_BMP(character)) {
- buffer[length] = character;
- ++length;
- return;
- }
-
- buffer[length] = U16_LEAD(character);
- buffer[length + 1] = U16_TRAIL(character);
- length += 2;
-}
-
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- unsigned length = 0;
- UChar buffer[4];
-
- decomposeToUTF16(buffer, length, character);
- decomposeToUTF16(buffer, length, selector);
- ASSERT(length <= 4);
-
- CGGlyph glyphs[4];
- wkGetGlyphsForCharacters(platformData().cgFont(), buffer, glyphs, length);
- if (glyphs[0])
- glyph = glyphs[0];
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
index f5c44e536..16a3b4a9c 100644
--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
@@ -1248,7 +1248,7 @@ String GraphicsContext3D::getProgramInfoLog(Platform3DObject program)
return String();
GLsizei size = 0;
- OwnArrayPtr<GLchar> info = adoptArrayPtr(static_cast<GLchar*>(fastMalloc(length)));
+ OwnArrayPtr<GLchar> info = adoptArrayPtr(new GLchar[length]);
::glGetProgramInfoLog(program, length, &size, info.get());
return String(info.get());
@@ -1315,7 +1315,7 @@ String GraphicsContext3D::getShaderInfoLog(Platform3DObject shader)
return String();
GLsizei size = 0;
- OwnArrayPtr<GLchar> info = adoptArrayPtr(static_cast<GLchar*>(fastMalloc(length)));
+ OwnArrayPtr<GLchar> info = adoptArrayPtr(new GLchar[length]);
::glGetShaderInfoLog(shader, length, &size, info.get());
return String(info.get());
diff --git a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
index 28ee2ba10..0ff7022e3 100644
--- a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
+++ b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
@@ -41,6 +41,16 @@
#include <GL/gl.h>
#endif
+#if defined(TEXMAP_OPENGL_ES_2)
+#include <EGL/egl.h>
+#elif OS(WINDOWS)
+#include <windows.h>
+#elif OS(MAC_OS_X)
+#include <AGL/agl.h>
+#elif defined(XP_UNIX)
+#include <GL/glx.h>
+#endif
+
#if !defined(TEXMAP_OPENGL_ES_2) && !PLATFORM(QT)
extern "C" {
void glUniform1f(GLint, GLfloat);
@@ -103,7 +113,60 @@ inline static void debugGLCommand(const char* command, int line)
#endif
struct TextureMapperGLData {
- static struct GlobalGLData {
+ struct SharedGLData : public RefCounted<SharedGLData> {
+#if defined(TEXMAP_OPENGL_ES_2)
+ typedef EGLContext GLContext;
+ static GLContext getCurrentGLContext()
+ {
+ return eglGetCurrentContext();
+ }
+#elif OS(WINDOWS)
+ typedef HGLRC GLContext;
+ static GLContext getCurrentGLContext()
+ {
+ return wglGetCurrentContext();
+ }
+#elif OS(MAC_OS_X)
+ typedef AGLContext GLContext;
+ static GLContext getCurrentGLContext()
+ {
+ return aglGetCurrentContext();
+ }
+#elif defined(XP_UNIX)
+ typedef GLXContext GLContext;
+ static GLContext getCurrentGLContext()
+ {
+ return glXGetCurrentContext();
+ }
+#else
+ // Default implementation for unknown opengl.
+ // Returns always increasing number and disables GL context data sharing.
+ typedef unsigned int GLContext;
+ static GLContext getCurrentGLContext()
+ {
+ static GLContext dummyContextCounter = 0;
+ return ++dummyContextCounter;
+ }
+
+#endif
+
+ typedef HashMap<GLContext, SharedGLData*> GLContextDataMap;
+ static GLContextDataMap& glContextDataMap()
+ {
+ static GLContextDataMap map;
+ return map;
+ }
+
+ static PassRefPtr<SharedGLData> currentSharedGLData()
+ {
+ GLContext currentGLConext = getCurrentGLContext();
+ GLContextDataMap::iterator it = glContextDataMap().find(currentGLConext);
+ if (it != glContextDataMap().end())
+ return it->second;
+
+ return adoptRef(new SharedGLData(getCurrentGLContext()));
+ }
+
enum ShaderProgramIndex {
NoProgram = -1,
SimpleProgram,
@@ -128,6 +191,9 @@ struct TextureMapperGLData {
GLuint id;
GLuint vertexAttrib;
GLint vars[VariableCount];
+ GLuint vertexShader;
+ GLuint fragmentShader;
+ ProgramInfo() : id(0) { }
};
GLint getUniformLocation(ShaderProgramIndex prog, ShaderVariableIndex var, const char* name)
@@ -149,16 +215,53 @@ struct TextureMapperGLData {
GL_CMD(glLinkProgram(programID))
programs[index].vertexAttrib = glGetAttribLocation(programID, "InVertex");
programs[index].id = programID;
+ programs[index].vertexShader = vertexShader;
+ programs[index].fragmentShader = fragmentShader;
+ }
+
+ void deleteShaderProgram(ShaderProgramIndex index)
+ {
+ ProgramInfo& programInfo = programs[index];
+ GLuint programID = programInfo.id;
+ if (!programID)
+ return;
+
+ GL_CMD(glDetachShader(programID, programInfo.vertexShader))
+ GL_CMD(glDeleteShader(programInfo.vertexShader))
+ GL_CMD(glDetachShader(programID, programInfo.fragmentShader))
+ GL_CMD(glDeleteShader(programInfo.fragmentShader))
+ GL_CMD(glDeleteProgram(programID))
}
+ void initializeShaders();
+
ProgramInfo programs[ProgramCount];
int stencilIndex;
- GlobalGLData()
- : stencilIndex(1)
- { }
- } globalGLData;
+ SharedGLData(GLContext glContext) : stencilIndex(1)
+ {
+ glContextDataMap().add(glContext, this);
+ initializeShaders();
+ }
+
+ ~SharedGLData()
+ {
+ for (int i = SimpleProgram; i < ProgramCount; ++i)
+ deleteShaderProgram(ShaderProgramIndex(i));
+
+ GLContextDataMap::const_iterator end = glContextDataMap().end();
+ GLContextDataMap::iterator it;
+ for (it = glContextDataMap().begin(); it != end; ++it) {
+ if (it->second == this)
+ break;
+ }
+
+ ASSERT(it != end);
+ glContextDataMap().remove(it);
+ }
+
+ };
struct DirectlyCompositedImageRepository {
struct Entry {
@@ -211,17 +314,22 @@ struct TextureMapperGLData {
}
} directlyCompositedImages;
+ SharedGLData& sharedGLData() const
+ {
+ return *(m_sharedGLData.get());
+ }
+
TextureMapperGLData()
- : currentProgram(TextureMapperGLData::GlobalGLData::NoProgram)
+ : currentProgram(SharedGLData::NoProgram)
+ , m_sharedGLData(TextureMapperGLData::SharedGLData::currentSharedGLData())
{ }
TransformationMatrix projectionMatrix;
int currentProgram;
int previousProgram;
+ RefPtr<SharedGLData> m_sharedGLData;
};
-TextureMapperGLData::GlobalGLData TextureMapperGLData::globalGLData;
-
class BitmapTextureGL : public BitmapTexture {
public:
virtual void destroy();
@@ -289,11 +397,11 @@ private:
};
#define TEXMAP_GET_SHADER_VAR_LOCATION(prog, var) \
- if (TextureMapperGLData::globalGLData.getUniformLocation(TextureMapperGLData::globalGLData.prog##Program, TextureMapperGLData::globalGLData.var##Variable, #var) < 0) \
+ if (getUniformLocation(prog##Program, var##Variable, #var) < 0) \
LOG_ERROR("Couldn't find variable "#var" in program "#prog"\n");
#define TEXMAP_BUILD_SHADER(program) \
- TextureMapperGLData::globalGLData.createShaderProgram(vertexShaderSource##program, fragmentShaderSource##program, TextureMapperGLData::globalGLData.program##Program);
+ createShaderProgram(vertexShaderSource##program, fragmentShaderSource##program, program##Program);
TextureMapperGL::TextureMapperGL()
: m_data(new TextureMapperGLData)
@@ -301,12 +409,8 @@ TextureMapperGL::TextureMapperGL()
{
}
-void TextureMapperGL::initializeShaders()
+void TextureMapperGLData::SharedGLData::initializeShaders()
{
- static bool shadersCompiled = false;
- if (shadersCompiled)
- return;
- shadersCompiled = true;
#ifndef TEXMAP_OPENGL_ES_2
#define OES2_PRECISION_DEFINITIONS \
"#define lowp\n#define highp\n"
@@ -322,6 +426,9 @@ void TextureMapperGL::initializeShaders()
OES2_FRAGMENT_SHADER_DEFAULT_PRECISION\
#src
+ if (!initializeOpenGLShims())
+ return;
+
const char* fragmentShaderSourceOpacityAndMask =
FRAGMENT_SHADER(
uniform sampler2D SourceTexture, MaskTexture;
@@ -426,7 +533,6 @@ void TextureMapperGL::beginPainting()
glClear(GL_STENCIL_BUFFER_BIT);
bindSurface(0);
#endif
- initializeShaders();
}
void TextureMapperGL::endPainting()
@@ -454,13 +560,13 @@ void TextureMapperGL::drawTexture(const BitmapTexture& texture, const FloatRect&
void TextureMapperGL::drawTexture(uint32_t texture, bool opaque, const FloatSize& relativeSize, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture, bool flip)
{
- TextureMapperGLData::GlobalGLData::ShaderProgramIndex program;
+ TextureMapperGLData::SharedGLData::ShaderProgramIndex program;
if (maskTexture)
- program = TextureMapperGLData::GlobalGLData::OpacityAndMaskProgram;
+ program = TextureMapperGLData::SharedGLData::OpacityAndMaskProgram;
else
- program = TextureMapperGLData::GlobalGLData::SimpleProgram;
+ program = TextureMapperGLData::SharedGLData::SimpleProgram;
- const TextureMapperGLData::GlobalGLData::ProgramInfo& programInfo = data().globalGLData.programs[program];
+ const TextureMapperGLData::SharedGLData::ProgramInfo& programInfo = data().sharedGLData().programs[program];
GL_CMD(glUseProgram(programInfo.id))
data().currentProgram = program;
GL_CMD(glEnableVertexAttribArray(programInfo.vertexAttrib))
@@ -487,10 +593,10 @@ void TextureMapperGL::drawTexture(uint32_t texture, bool opaque, const FloatSize
0, 0, 1, 0,
0, flip ? relativeSize.height() : 0, 0, 1};
- GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::GlobalGLData::InMatrixVariable], 1, GL_FALSE, m4))
- GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::GlobalGLData::InSourceMatrixVariable], 1, GL_FALSE, m4src))
- GL_CMD(glUniform1i(programInfo.vars[TextureMapperGLData::GlobalGLData::SourceTextureVariable], 0))
- GL_CMD(glUniform1f(programInfo.vars[TextureMapperGLData::GlobalGLData::OpacityVariable], opacity))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::SharedGLData::InMatrixVariable], 1, GL_FALSE, m4))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::SharedGLData::InSourceMatrixVariable], 1, GL_FALSE, m4src))
+ GL_CMD(glUniform1i(programInfo.vars[TextureMapperGLData::SharedGLData::SourceTextureVariable], 0))
+ GL_CMD(glUniform1f(programInfo.vars[TextureMapperGLData::SharedGLData::OpacityVariable], opacity))
if (maskTexture && maskTexture->isValid()) {
const BitmapTextureGL* maskTextureGL = static_cast<const BitmapTextureGL*>(maskTexture);
@@ -500,8 +606,8 @@ void TextureMapperGL::drawTexture(uint32_t texture, bool opaque, const FloatSize
0, maskTextureGL->relativeSize().height(), 0, 0,
0, 0, 1, 0,
0, 0, 0, 1};
- GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::GlobalGLData::InMaskMatrixVariable], 1, GL_FALSE, m4mask));
- GL_CMD(glUniform1i(programInfo.vars[TextureMapperGLData::GlobalGLData::MaskTextureVariable], 1))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::SharedGLData::InMaskMatrixVariable], 1, GL_FALSE, m4mask));
+ GL_CMD(glUniform1i(programInfo.vars[TextureMapperGLData::SharedGLData::MaskTextureVariable], 1))
GL_CMD(glActiveTexture(GL_TEXTURE0))
}
@@ -670,7 +776,7 @@ static inline TransformationMatrix createProjectionMatrix(const IntSize& size, b
void BitmapTextureGL::bind()
{
- int& stencilIndex = TextureMapperGLData::globalGLData.stencilIndex;
+ int& stencilIndex = m_textureMapper->data().sharedGLData().stencilIndex;
if (m_surfaceNeedsReset || !m_fbo) {
if (!m_fbo)
GL_CMD(glGenFramebuffers(1, &m_fbo))
@@ -743,7 +849,7 @@ void TextureMapperGL::bindSurface(BitmapTexture *surfacePointer)
if (!surface) {
GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, 0))
data().projectionMatrix = createProjectionMatrix(viewportSize(), true).multiply(transform());
- GL_CMD(glStencilFunc(data().globalGLData.stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().globalGLData.stencilIndex - 1, data().globalGLData.stencilIndex - 1))
+ GL_CMD(glStencilFunc(data().sharedGLData().stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().sharedGLData().stencilIndex - 1, data().sharedGLData().stencilIndex - 1))
GL_CMD(glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP))
GL_CMD(glViewport(0, 0, viewportSize().width(), viewportSize().height()))
return;
@@ -754,8 +860,8 @@ void TextureMapperGL::bindSurface(BitmapTexture *surfacePointer)
void TextureMapperGL::beginClip(const TransformationMatrix& modelViewMatrix, const FloatRect& targetRect)
{
- TextureMapperGLData::GlobalGLData::ShaderProgramIndex program = TextureMapperGLData::GlobalGLData::ClipProgram;
- const TextureMapperGLData::GlobalGLData::ProgramInfo& programInfo = data().globalGLData.programs[program];
+ TextureMapperGLData::SharedGLData::ShaderProgramIndex program = TextureMapperGLData::SharedGLData::ClipProgram;
+ const TextureMapperGLData::SharedGLData::ProgramInfo& programInfo = data().sharedGLData().programs[program];
GL_CMD(glUseProgram(programInfo.id))
GL_CMD(glEnableVertexAttribArray(programInfo.vertexAttrib))
const GLfloat unitRect[] = {0, 0, 1, 0, 1, 1, 0, 1};
@@ -775,9 +881,9 @@ void TextureMapperGL::beginClip(const TransformationMatrix& modelViewMatrix, con
matrix.m41(), matrix.m42(), matrix.m43(), matrix.m44()
};
- int& stencilIndex = data().globalGLData.stencilIndex;
+ int& stencilIndex = data().sharedGLData().stencilIndex;
- GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::GlobalGLData::InMatrixVariable], 1, GL_FALSE, m4))
+ GL_CMD(glUniformMatrix4fv(programInfo.vars[TextureMapperGLData::SharedGLData::InMatrixVariable], 1, GL_FALSE, m4))
GL_CMD(glEnable(GL_STENCIL_TEST))
GL_CMD(glStencilFunc(GL_NEVER, stencilIndex, stencilIndex))
GL_CMD(glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE))
@@ -791,8 +897,8 @@ void TextureMapperGL::beginClip(const TransformationMatrix& modelViewMatrix, con
void TextureMapperGL::endClip()
{
- data().globalGLData.stencilIndex >>= 1;
- glStencilFunc(data().globalGLData.stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().globalGLData.stencilIndex - 1, data().globalGLData.stencilIndex - 1);
+ data().sharedGLData().stencilIndex >>= 1;
+ glStencilFunc(data().sharedGLData().stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().sharedGLData().stencilIndex - 1, data().sharedGLData().stencilIndex - 1);
}
PassRefPtr<BitmapTexture> TextureMapperGL::createTexture()
diff --git a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.h b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.h
index 6f4c29d80..dd2e1a7c9 100644
--- a/Source/WebCore/platform/graphics/opengl/TextureMapperGL.h
+++ b/Source/WebCore/platform/graphics/opengl/TextureMapperGL.h
@@ -55,7 +55,6 @@ public:
virtual bool isOpenGLBacked() const { return true; }
private:
- void initializeShaders();
inline TextureMapperGLData& data() { return *m_data; }
TextureMapperGLData* m_data;
GraphicsContext* m_context;
diff --git a/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp b/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp
index d6428d98e..ee8ee0f74 100644
--- a/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp
+++ b/Source/WebCore/platform/graphics/pango/SimpleFontDataPango.cpp
@@ -160,9 +160,4 @@ float SimpleFontData::platformWidthForGlyph(Glyph glyph) const
return width;
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
}
diff --git a/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp b/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
index 4ff23be1c..e95b8c5ea 100644
--- a/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/SimpleFontDataQt.cpp
@@ -189,9 +189,4 @@ void SimpleFontData::platformDestroy()
{
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
}
diff --git a/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 9135ff4e0..db343615f 100644
--- a/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -440,7 +440,17 @@ static void setPathFromConvexPoints(SkPath* path, size_t numPoints, const FloatP
path->lineTo(WebCoreFloatToSkScalar(points[i].x()),
WebCoreFloatToSkScalar(points[i].y()));
}
- path->setIsConvex(true);
+
+ /* The code used to just blindly call this
+ path->setIsConvex(true);
+ But webkit can sometimes send us non-convex 4-point values, so we mark the path's
+ convexity as unknown, so it will get computed by skia at draw time.
+ See crbug.com 108605
+ */
+ SkPath::Convexity convexity = SkPath::kConvex_Convexity;
+ if (numPoints == 4)
+ convexity = SkPath::kUnknown_Convexity;
+ path->setConvexity(convexity);
}
void GraphicsContext::drawConvexPolygon(size_t numPoints,
diff --git a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
index 37d459d16..f96c5690d 100644
--- a/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
@@ -93,6 +93,13 @@ static SkCanvas* createAcceleratedCanvas(const IntSize& size, ImageBufferData* d
return canvas;
}
+static SkCanvas* createNonPlatformCanvas(const IntSize& size)
+{
+ SkCanvas* canvas = new SkCanvas();
+ canvas->setDevice(new SkDevice(SkBitmap::kARGB_8888_Config, size.width(), size.height()))->unref();
+ return canvas;
+}
+
ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace, RenderingMode renderingMode, bool& success)
: m_data(size)
, m_size(size)
@@ -101,6 +108,8 @@ ImageBuffer::ImageBuffer(const IntSize& size, ColorSpace, RenderingMode renderin
if (renderingMode == Accelerated)
canvas = adoptPtr(createAcceleratedCanvas(size, &m_data));
+ else if (renderingMode == UnacceleratedNonPlatformBuffer)
+ canvas = adoptPtr(createNonPlatformCanvas(size));
if (!canvas)
canvas = adoptPtr(skia::TryCreateBitmapCanvas(size.width(), size.height(), false));
diff --git a/Source/WebCore/platform/graphics/skia/PathSkia.cpp b/Source/WebCore/platform/graphics/skia/PathSkia.cpp
index 7c8aea070..0ba6d070e 100644
--- a/Source/WebCore/platform/graphics/skia/PathSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PathSkia.cpp
@@ -197,7 +197,7 @@ static FloatPoint* convertPathPoints(FloatPoint dst[], const SkPoint src[], int
void Path::apply(void* info, PathApplierFunction function) const
{
- SkPath::Iter iter(*m_path, false);
+ SkPath::RawIter iter(*m_path);
SkPoint pts[4];
PathElement pathElement;
FloatPoint pathPoints[3];
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
new file mode 100644
index 000000000..2622d21ca
--- /dev/null
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
@@ -0,0 +1,79 @@
+/*
+ Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "TextureMapper.h"
+
+#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
+
+namespace WebCore {
+
+PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& size)
+{
+ if (m_texturePool.isEmpty()) {
+ RefPtr<BitmapTexture> selectedTexture = createTexture();
+ selectedTexture->reset(size, false);
+ selectedTexture->lock();
+ return selectedTexture;
+ }
+
+ size_t index = 0;
+ RefPtr<BitmapTexture> selectedTexture = m_texturePool[0];
+
+ for (size_t i = 1; i < m_texturePool.size(); ++i) {
+ RefPtr<BitmapTexture> texture = m_texturePool[i];
+
+ IntSize textureSize = texture->size();
+ IntSize selectedTextureSize = selectedTexture->size();
+
+ // We prefer to pick a texture that's equal or larger than the requested size.
+ if (textureSize.width() < size.width() || textureSize.height() < size.height())
+ continue;
+
+ // We select the new texture if the currently selected texture is smaller than the
+ // required size, and the new texture has a smaller area.
+ int textureArea = textureSize.width() * textureSize.height();
+ int selectedTextureArea = selectedTextureSize.width() * selectedTextureSize.height();
+ bool selectedTextureFitsSize =
+ selectedTextureSize.width() >= size.width()
+ && selectedTextureSize.height() >= size.height();
+
+ if (selectedTextureFitsSize && selectedTextureArea <= textureArea)
+ continue;
+
+ selectedTexture = texture;
+ index = i;
+ }
+
+ m_texturePool.remove(index);
+ selectedTexture->reset(size, false);
+ selectedTexture->lock();
+ return selectedTexture;
+}
+
+void TextureMapper::releaseTextureToPool(BitmapTexture* texture)
+{
+ if (!texture)
+ return;
+ m_texturePool.append(texture);
+ texture->unlock();
+}
+
+}
+#endif
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapper.h b/Source/WebCore/platform/graphics/texmap/TextureMapper.h
index 27058aaca..d81333daa 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapper.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapper.h
@@ -126,6 +126,9 @@ public:
virtual void beginPainting() { }
virtual void endPainting() { }
+ virtual void releaseTextureToPool(BitmapTexture* surface);
+ virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&);
+
protected:
TextureMapper()
@@ -138,6 +141,7 @@ private:
TextDrawingModeFlags m_textDrawingMode;
TransformationMatrix m_transform;
IntSize m_viewportSize;
+ Vector<RefPtr<BitmapTexture> > m_texturePool;
};
};
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
index 9157e23ac..15dff5aeb 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
@@ -31,40 +31,6 @@ namespace {
namespace WebCore {
-class TextureMapperSurfaceManager {
-public:
- TextureMapper* textureMapper;
- Vector<RefPtr<BitmapTexture> > surfaces;
- IntSize viewportSize;
-
- PassRefPtr<BitmapTexture> getIntermediateSurface()
- {
- IntSize newViewportSize = textureMapper->viewportSize();
- if (newViewportSize != viewportSize) {
- viewportSize = newViewportSize;
- surfaces.clear();
- }
- if (surfaces.isEmpty()) {
- RefPtr<BitmapTexture> newSurface = textureMapper->createTexture();
- newSurface->reset(viewportSize, false);
- return newSurface.get();
- }
- RefPtr<BitmapTexture> surface = surfaces.last();
- surface->reset(viewportSize, false);
- surfaces.removeLast();
- surface->lock();
- return surface.get();
- }
-
- void releaseIntermediateSurface(BitmapTexture* surface)
- {
- if (!surface)
- return;
- surfaces.append(surface);
- surface->unlock();
- }
-};
-
TextureMapperNode* toTextureMapperNode(GraphicsLayer* layer)
{
return layer ? toGraphicsLayerTextureMapper(layer)->node() : 0;
@@ -346,11 +312,7 @@ void TextureMapperNode::paint()
if (m_size.isEmpty())
return;
- if (!m_surfaceManager)
- m_surfaceManager = new TextureMapperSurfaceManager;
- m_surfaceManager->textureMapper = m_textureMapper;
TextureMapperPaintOptions opt;
- opt.surfaceManager = m_surfaceManager;
opt.textureMapper = m_textureMapper;
opt.textureMapper->bindSurface(0);
paintRecursive(opt);
@@ -496,7 +458,7 @@ bool TextureMapperNode::paintReflection(const TextureMapperPaintOptions& options
// The mask has to be adjusted to target coordinates.
if (maskTexture) {
- maskSurface = options.surfaceManager->getIntermediateSurface();
+ maskSurface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize());
options.textureMapper->bindSurface(maskSurface.get());
options.textureMapper->drawTexture(*maskTexture.get(), entireRect(), m_transforms.target, 1, 0);
maskTexture = maskSurface;
@@ -504,7 +466,7 @@ bool TextureMapperNode::paintReflection(const TextureMapperPaintOptions& options
// The replica's mask has to be adjusted to target coordinates.
if (replicaMaskTexture) {
- replicaMaskSurface = options.surfaceManager->getIntermediateSurface();
+ replicaMaskSurface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize());
options.textureMapper->bindSurface(replicaMaskSurface.get());
options.textureMapper->drawTexture(*replicaMaskTexture.get(), entireRect(), m_transforms.target, 1, 0);
replicaMaskTexture = replicaMaskSurface;
@@ -512,21 +474,21 @@ bool TextureMapperNode::paintReflection(const TextureMapperPaintOptions& options
// We might need to apply the mask of the content layer before we draw the reflection, as there might be yet another mask for the reflection itself.
if (useIntermediateBufferForMask) {
- RefPtr<BitmapTexture> maskSurface = options.surfaceManager->getIntermediateSurface();
+ RefPtr<BitmapTexture> maskSurface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize());
options.textureMapper->bindSurface(maskSurface.get());
options.textureMapper->drawTexture(*surface.get(), viewportRect, TransformationMatrix(), 1, maskTexture.get());
- options.surfaceManager->releaseIntermediateSurface(surface.get());
+ options.textureMapper->releaseTextureToPool(surface.get());
surface = maskSurface;
maskTexture.clear();
}
// We blend the layer and its replica in an intermediate buffer before blending into the target surface.
if (useIntermediateBufferForReplica) {
- RefPtr<BitmapTexture> replicaSurface = options.surfaceManager->getIntermediateSurface();
+ RefPtr<BitmapTexture> replicaSurface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize());
options.textureMapper->bindSurface(replicaSurface.get());
options.textureMapper->drawTexture(*surface.get(), viewportRect, m_transforms.replica, m_state.replicaLayer->m_opacity, replicaMaskTexture.get());
options.textureMapper->drawTexture(*surface.get(), viewportRect, TransformationMatrix(), 1, maskTexture.get());
- options.surfaceManager->releaseIntermediateSurface(surface.get());
+ options.textureMapper->releaseTextureToPool(surface.get());
surface = replicaSurface;
}
@@ -539,8 +501,8 @@ bool TextureMapperNode::paintReflection(const TextureMapperPaintOptions& options
// Draw the original.
options.textureMapper->drawTexture(*surface.get(), viewportRect, TransformationMatrix(), options.opacity, maskTexture.get());
- options.surfaceManager->releaseIntermediateSurface(maskSurface.get());
- options.surfaceManager->releaseIntermediateSurface(replicaMaskSurface.get());
+ options.textureMapper->releaseTextureToPool(maskSurface.get());
+ options.textureMapper->releaseTextureToPool(replicaMaskSurface.get());
return true;
}
@@ -570,12 +532,12 @@ void TextureMapperNode::paintRecursive(TextureMapperPaintOptions options)
// The mask has to be adjusted to target coordinates.
if (m_state.maskLayer) {
- maskSurface = options.surfaceManager->getIntermediateSurface();
+ maskSurface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize());
options.textureMapper->bindSurface(maskSurface.get());
options.textureMapper->drawTexture(*m_state.maskLayer->texture(), entireRect(), m_transforms.target, 1.0, 0);
}
- surface = options.surfaceManager->getIntermediateSurface();
+ surface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize());
optionsForDescendants.surface = surface.get();
options.isSurface = true;
optionsForDescendants.opacity = 1;
@@ -588,8 +550,8 @@ void TextureMapperNode::paintRecursive(TextureMapperPaintOptions options)
options.textureMapper->drawTexture(*surface.get(), viewportRect, TransformationMatrix(), options.opacity, 0);
}
- options.surfaceManager->releaseIntermediateSurface(surface.get());
- options.surfaceManager->releaseIntermediateSurface(maskSurface.get());
+ options.textureMapper->releaseTextureToPool(surface.get());
+ options.textureMapper->releaseTextureToPool(maskSurface.get());
}
TextureMapperNode::~TextureMapperNode()
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h b/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h
index fc479bac6..b40cd5d38 100644
--- a/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h
+++ b/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h
@@ -39,17 +39,20 @@ namespace WebCore {
class TextureMapperPlatformLayer;
class TextureMapperNode;
class GraphicsLayerTextureMapper;
-class TextureMapperSurfaceManager;
class TextureMapperPaintOptions {
public:
BitmapTexture* surface;
TextureMapper* textureMapper;
- TextureMapperSurfaceManager* surfaceManager;
float opacity;
bool isSurface;
- TextureMapperPaintOptions() : surface(0), textureMapper(0), opacity(1.0), isSurface(false) { }
+ TextureMapperPaintOptions()
+ : surface(0)
+ , textureMapper(0)
+ , opacity(1)
+ , isSurface(false)
+ { }
};
class TextureMapperAnimation : public RefCounted<TextureMapperAnimation> {
@@ -135,7 +138,11 @@ public:
};
TextureMapperNode()
- : m_parent(0), m_effectTarget(0), m_opacity(1.0), m_surfaceManager(0), m_textureMapper(0) { }
+ : m_parent(0)
+ , m_effectTarget(0)
+ , m_opacity(1)
+ , m_textureMapper(0)
+ { }
virtual ~TextureMapperNode();
@@ -317,7 +324,6 @@ private:
};
State m_state;
- TextureMapperSurfaceManager* m_surfaceManager;
TextureMapper* m_textureMapper;
Vector<RefPtr<TextureMapperAnimation> > m_animations;
diff --git a/Source/WebCore/platform/graphics/transforms/AffineTransform.h b/Source/WebCore/platform/graphics/transforms/AffineTransform.h
index 4d6c7da9a..d3970da29 100644
--- a/Source/WebCore/platform/graphics/transforms/AffineTransform.h
+++ b/Source/WebCore/platform/graphics/transforms/AffineTransform.h
@@ -63,6 +63,10 @@ public:
AffineTransform();
AffineTransform(double a, double b, double c, double d, double e, double f);
+#if USE(CG)
+ AffineTransform(const CGAffineTransform&);
+#endif
+
void setMatrix(double a, double b, double c, double d, double e, double f);
void map(double x, double y, double& x2, double& y2) const;
diff --git a/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp b/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
index a49abe2ef..de6687f5c 100644
--- a/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
+++ b/Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
@@ -282,9 +282,4 @@ SCRIPT_FONTPROPERTIES* SimpleFontData::scriptFontProperties() const
return m_scriptFontProperties;
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
}
diff --git a/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp b/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp
index 1ba669074..e3b842463 100644
--- a/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp
+++ b/Source/WebCore/platform/graphics/wince/SimpleFontDataWinCE.cpp
@@ -180,9 +180,4 @@ void SimpleFontData::platformCharWidthInit()
m_maxCharWidth = (tm.tmMaxCharWidth * m_platformData.size() + 36) / 72;
}
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp b/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
index d98ecbd60..cb7fb3d7a 100644
--- a/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
+++ b/Source/WebCore/platform/graphics/wx/SimpleFontDataWx.cpp
@@ -194,9 +194,4 @@ float SimpleFontData::widthForGDIGlyph(Glyph glyph) const
}
#endif
-void SimpleFontData::updateGlyphWithVariationSelector(UChar32 character, UChar32 selector, Glyph& glyph) const
-{
- // FIXME: Implement.
-}
-
}
diff --git a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 6df47339f..0cbdd0453 100644
--- a/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -75,7 +75,11 @@ extern "C" {
#if defined(JCS_EXTENSIONS) && ASSUME_LITTLE_ENDIAN
#define TURBO_JPEG_RGB_SWIZZLE
+#if USE(SKIA) && (!SK_R32_SHIFT && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16)
+inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_RGBX; }
+#else
inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_EXT_BGRX; }
+#endif
inline bool turboSwizzled(J_COLOR_SPACE colorSpace) { return colorSpace == rgbOutputColorSpace(); }
#else
inline J_COLOR_SPACE rgbOutputColorSpace() { return JCS_RGB; }
diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.h b/Source/WebCore/platform/mac/ScrollAnimatorMac.h
index 29c13aa25..94383ca5e 100644
--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.h
+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.h
@@ -123,13 +123,16 @@ private:
FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const;
void immediateScrollTo(const FloatPoint&);
- void immediateScrollBy(const FloatSize&);
#if ENABLE(RUBBER_BANDING)
/// ScrollElasticityControllerClient member functions.
virtual IntSize stretchAmount() OVERRIDE;
virtual bool pinnedInDirection(const FloatSize&) OVERRIDE;
+ virtual bool canScrollHorizontally() OVERRIDE;
+ virtual bool canScrollVertically() OVERRIDE;
+ virtual WebCore::IntPoint absoluteScrollPosition() OVERRIDE;
virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) OVERRIDE;
+ virtual void immediateScrollBy(const FloatSize&) OVERRIDE;
virtual void startSnapRubberbandTimer() OVERRIDE;
virtual void stopSnapRubberbandTimer() OVERRIDE;
@@ -138,7 +141,7 @@ private:
bool pinnedInDirection(float deltaX, float deltaY);
void snapRubberBand();
void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*);
- void smoothScrollWithEvent(const PlatformWheelEvent&);
+ bool smoothScrollWithEvent(const PlatformWheelEvent&);
void beginScrollGesture();
void endScrollGesture();
diff --git a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
index 884a87d8b..4011f33e8 100644
--- a/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
+++ b/Source/WebCore/platform/mac/ScrollAnimatorMac.mm
@@ -82,7 +82,7 @@ static NSTimeInterval systemUptime()
return [[NSProcessInfo processInfo] systemUptime];
// Get how long system has been up. Found by looking getting "boottime" from the kernel.
- static struct timeval boottime = {};
+ static struct timeval boottime = {0, 0};
if (!boottime.tv_sec) {
int mib[2] = {CTL_KERN, KERN_BOOTTIME};
size_t size = sizeof(boottime);
@@ -690,19 +690,6 @@ void ScrollAnimatorMac::immediateScrollTo(const FloatPoint& newPosition)
notifyPositionChanged();
}
-void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta)
-{
- float newPosX = adjustScrollXPositionIfNecessary(m_currentPosX + delta.width());
- float newPosY = adjustScrollYPositionIfNecessary(m_currentPosY + delta.height());
-
- if (newPosX == m_currentPosX && newPosY == m_currentPosY)
- return;
-
- m_currentPosX = newPosX;
- m_currentPosY = newPosY;
- notifyPositionChanged();
-}
-
void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoint& newPosition)
{
ASSERT(m_scrollAnimationHelper);
@@ -1008,17 +995,7 @@ bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
}
}
- bool isMomentumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone);
- if (m_scrollElasticityController.m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_scrollElasticityController.m_snapRubberbandTimerIsActive)) {
- if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
- m_scrollElasticityController.m_ignoreMomentumScrolls = false;
- return true;
- }
- return false;
- }
-
- smoothScrollWithEvent(wheelEvent);
- return true;
+ return smoothScrollWithEvent(wheelEvent);
}
void ScrollAnimatorMac::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
@@ -1065,6 +1042,27 @@ bool ScrollAnimatorMac::pinnedInDirection(const FloatSize& direction)
return pinnedInDirection(direction.width(), direction.height());
}
+bool ScrollAnimatorMac::canScrollHorizontally()
+{
+ Scrollbar* scrollbar = m_scrollableArea->horizontalScrollbar();
+ if (!scrollbar)
+ return false;
+ return scrollbar->enabled();
+}
+
+bool ScrollAnimatorMac::canScrollVertically()
+{
+ Scrollbar* scrollbar = m_scrollableArea->verticalScrollbar();
+ if (!scrollbar)
+ return false;
+ return scrollbar->enabled();
+}
+
+IntPoint ScrollAnimatorMac::absoluteScrollPosition()
+{
+ return m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin();
+}
+
void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const FloatSize& delta)
{
m_scrollableArea->setConstrainsScrollingToContentEdge(false);
@@ -1072,6 +1070,19 @@ void ScrollAnimatorMac::immediateScrollByWithoutContentEdgeConstraints(const Flo
m_scrollableArea->setConstrainsScrollingToContentEdge(true);
}
+void ScrollAnimatorMac::immediateScrollBy(const FloatSize& delta)
+{
+ float newPosX = adjustScrollXPositionIfNecessary(m_currentPosX + delta.width());
+ float newPosY = adjustScrollYPositionIfNecessary(m_currentPosY + delta.height());
+
+ if (newPosX == m_currentPosX && newPosY == m_currentPosY)
+ return;
+
+ m_currentPosX = newPosX;
+ m_currentPosY = newPosY;
+ notifyPositionChanged();
+}
+
void ScrollAnimatorMac::startSnapRubberbandTimer()
{
m_snapRubberBandTimer.startRepeating(1.0 / 60.0);
@@ -1118,8 +1129,17 @@ bool ScrollAnimatorMac::allowsHorizontalStretching() const
return false;
}
-void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEvent)
+bool ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEvent)
{
+ bool isMomentumScrollEvent = (wheelEvent.momentumPhase() != PlatformWheelEventPhaseNone);
+ if (m_scrollElasticityController.m_ignoreMomentumScrolls && (isMomentumScrollEvent || m_scrollElasticityController.m_snapRubberbandTimerIsActive)) {
+ if (wheelEvent.momentumPhase() == PlatformWheelEventPhaseEnded) {
+ m_scrollElasticityController.m_ignoreMomentumScrolls = false;
+ return true;
+ }
+ return false;
+ }
+
m_haveScrolledSincePageLoad = true;
float deltaX = m_scrollElasticityController.m_overflowScrollDelta.width();
@@ -1144,7 +1164,7 @@ void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEve
bool isHorizontallyStretched = false;
bool shouldStretch = false;
- IntSize stretchAmount = m_scrollableArea->overhangAmount();
+ IntSize stretchAmount = m_scrollElasticityController.m_client->stretchAmount();
isHorizontallyStretched = stretchAmount.width();
isVerticallyStretched = stretchAmount.height();
@@ -1207,11 +1227,11 @@ void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEve
if (!(shouldStretch || isVerticallyStretched || isHorizontallyStretched)) {
if (deltaY != 0) {
deltaY *= scrollWheelMultiplier();
- immediateScrollBy(FloatSize(0, deltaY));
+ m_scrollElasticityController.m_client->immediateScrollBy(FloatSize(0, deltaY));
}
if (deltaX != 0) {
deltaX *= scrollWheelMultiplier();
- immediateScrollBy(FloatSize(deltaX, 0));
+ m_scrollElasticityController.m_client->immediateScrollBy(FloatSize(deltaX, 0));
}
} else {
if (!allowsHorizontalStretching()) {
@@ -1220,7 +1240,7 @@ void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEve
} else if ((deltaX != 0) && !isHorizontallyStretched && !pinnedInDirection(deltaX, 0)) {
deltaX *= scrollWheelMultiplier();
- immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
+ m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(deltaX, 0));
deltaX = 0;
}
@@ -1230,11 +1250,11 @@ void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEve
} else if ((deltaY != 0) && !isVerticallyStretched && !pinnedInDirection(0, deltaY)) {
deltaY *= scrollWheelMultiplier();
- immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
+ m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(0, deltaY));
deltaY = 0;
}
- IntSize stretchAmount = m_scrollableArea->overhangAmount();
+ IntSize stretchAmount = m_scrollElasticityController.m_client->stretchAmount();
if (m_scrollElasticityController.m_momentumScrollInProgress) {
if ((pinnedInDirection(eventCoalescedDeltaX, eventCoalescedDeltaY) || (fabsf(eventCoalescedDeltaX) + fabsf(eventCoalescedDeltaY) <= 0)) && m_scrollElasticityController.m_lastMomentumScrollTimestamp) {
@@ -1249,7 +1269,7 @@ void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEve
FloatSize dampedDelta(ceilf(elasticDeltaForReboundDelta(m_scrollElasticityController.m_stretchScrollForce.width())), ceilf(elasticDeltaForReboundDelta(m_scrollElasticityController.m_stretchScrollForce.height())));
- immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
+ m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(dampedDelta - stretchAmount);
}
}
@@ -1258,6 +1278,8 @@ void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEve
m_scrollElasticityController.m_ignoreMomentumScrolls = false;
m_scrollElasticityController.m_lastMomentumScrollTimestamp = 0;
}
+
+ return true;
}
void ScrollAnimatorMac::beginScrollGesture()
@@ -1296,7 +1318,7 @@ void ScrollAnimatorMac::snapRubberBand()
m_scrollElasticityController.m_origOrigin = FloatPoint();
m_scrollElasticityController.m_origVelocity = FloatSize();
- m_snapRubberBandTimer.startRepeating(1.0/60.0);
+ m_scrollElasticityController.m_client->startSnapRubberbandTimer();
m_scrollElasticityController.m_snapRubberbandTimerIsActive = true;
}
@@ -1320,9 +1342,9 @@ void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
CFTimeInterval timeDelta = [NSDate timeIntervalSinceReferenceDate] - m_scrollElasticityController.m_startTime;
if (m_scrollElasticityController.m_startStretch == FloatSize()) {
- m_scrollElasticityController.m_startStretch = m_scrollableArea->overhangAmount();
- if (m_scrollElasticityController.m_startStretch == FloatSize()) {
- m_snapRubberBandTimer.stop();
+ m_scrollElasticityController.m_startStretch = m_scrollElasticityController.m_client->stretchAmount();
+ if (m_scrollElasticityController.m_startStretch == FloatSize()) {
+ m_scrollElasticityController.m_client->stopSnapRubberbandTimer();
m_scrollElasticityController.m_stretchScrollForce = FloatSize();
m_scrollElasticityController.m_startTime = 0;
@@ -1334,7 +1356,7 @@ void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
return;
}
- m_scrollElasticityController.m_origOrigin = (m_scrollableArea->visibleContentRect().location() + m_scrollableArea->scrollOrigin()) - m_scrollElasticityController.m_startStretch;
+ m_scrollElasticityController.m_origOrigin = m_scrollElasticityController.m_client->absoluteScrollPosition() - m_scrollElasticityController.m_startStretch;
m_scrollElasticityController.m_origVelocity = m_scrollElasticityController.m_momentumVelocity;
// Just like normal scrolling, prefer vertical rubberbanding
@@ -1342,13 +1364,11 @@ void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
m_scrollElasticityController.m_origVelocity.setWidth(0);
// Don't rubber-band horizontally if it's not possible to scroll horizontally
- Scrollbar* hScroller = m_scrollableArea->horizontalScrollbar();
- if (!hScroller || !hScroller->enabled())
+ if (!m_scrollElasticityController.m_client->canScrollHorizontally())
m_scrollElasticityController.m_origVelocity.setWidth(0);
- // Don't rubber-band vertically if it's not possible to scroll horizontally
- Scrollbar* vScroller = m_scrollableArea->verticalScrollbar();
- if (!vScroller || !vScroller->enabled())
+ // Don't rubber-band vertically if it's not possible to scroll vertically
+ if (!m_scrollElasticityController.m_client->canScrollVertically())
m_scrollElasticityController.m_origVelocity.setHeight(0);
}
@@ -1358,16 +1378,16 @@ void ScrollAnimatorMac::snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*)
if (fabs(delta.x()) >= 1 || fabs(delta.y()) >= 1) {
FloatPoint newOrigin = m_scrollElasticityController.m_origOrigin + delta;
- immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_scrollableArea->overhangAmount());
+ m_scrollElasticityController.m_client->immediateScrollByWithoutContentEdgeConstraints(FloatSize(delta.x(), delta.y()) - m_scrollElasticityController.m_client->stretchAmount());
- FloatSize newStretch = m_scrollableArea->overhangAmount();
+ FloatSize newStretch = m_scrollElasticityController.m_client->stretchAmount();
m_scrollElasticityController.m_stretchScrollForce.setWidth(reboundDeltaForElasticDelta(newStretch.width()));
m_scrollElasticityController.m_stretchScrollForce.setHeight(reboundDeltaForElasticDelta(newStretch.height()));
} else {
immediateScrollTo(m_scrollElasticityController.m_origOrigin);
- m_snapRubberBandTimer.stop();
+ m_scrollElasticityController.m_client->stopSnapRubberbandTimer();
m_scrollElasticityController.m_stretchScrollForce = FloatSize();
m_scrollElasticityController.m_startTime = 0;
diff --git a/Source/WebCore/platform/mac/ScrollElasticityController.h b/Source/WebCore/platform/mac/ScrollElasticityController.h
index f1b89b28d..066184473 100644
--- a/Source/WebCore/platform/mac/ScrollElasticityController.h
+++ b/Source/WebCore/platform/mac/ScrollElasticityController.h
@@ -41,6 +41,13 @@ protected:
public:
virtual IntSize stretchAmount() = 0;
virtual bool pinnedInDirection(const FloatSize&) = 0;
+ virtual bool canScrollHorizontally() = 0;
+ virtual bool canScrollVertically() = 0;
+
+ // Return the absolute scroll position, not relative to the scroll origin.
+ virtual WebCore::IntPoint absoluteScrollPosition() = 0;
+
+ virtual void immediateScrollBy(const FloatSize&) = 0;
virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&) = 0;
virtual void startSnapRubberbandTimer() = 0;
virtual void stopSnapRubberbandTimer() = 0;
@@ -55,13 +62,13 @@ public:
void beginScrollGesture();
private:
- ScrollElasticityControllerClient* m_client;
-
void stopSnapRubberbandTimer();
// FIXME: These member variables should be private. They are currently public as a stop-gap measure, while
// the rubber-band related code from ScrollAnimatorMac is being moved over.
public:
+ ScrollElasticityControllerClient* m_client;
+
bool m_inScrollGesture;
bool m_momentumScrollInProgress;
bool m_ignoreMomentumScrolls;
diff --git a/Source/WebCore/platform/mock/ScrollbarThemeMock.cpp b/Source/WebCore/platform/mock/ScrollbarThemeMock.cpp
index 70707d480..5d2bc3ec0 100644
--- a/Source/WebCore/platform/mock/ScrollbarThemeMock.cpp
+++ b/Source/WebCore/platform/mock/ScrollbarThemeMock.cpp
@@ -42,14 +42,15 @@ int ScrollbarThemeMock::scrollbarThickness(ScrollbarControlSize controlSize)
return cScrollbarThickness[controlSize];
}
-void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, Scrollbar*, const IntRect& trackRect)
+void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& trackRect)
{
- context->fillRect(trackRect, Color::lightGray, ColorSpaceDeviceRGB);
+ context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color(0xFFE0E0E0), ColorSpaceDeviceRGB);
}
-void ScrollbarThemeMock::paintThumb(GraphicsContext* context, Scrollbar*, const IntRect& thumbRect)
+void ScrollbarThemeMock::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& thumbRect)
{
- context->fillRect(thumbRect, Color::darkGray, ColorSpaceDeviceRGB);
+ if (scrollbar->enabled())
+ context->fillRect(thumbRect, Color::darkGray, ColorSpaceDeviceRGB);
}
}
diff --git a/Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp b/Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp
index 0820348b8..fe0df4e1b 100644
--- a/Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp
+++ b/Source/WebCore/platform/network/blackberry/ResourceHandleBlackBerry.cpp
@@ -22,6 +22,7 @@
#include "EventLoop.h"
#include "Frame.h"
#include "FrameLoaderClientBlackBerry.h"
+#include "FrameNetworkingContextBlackBerry.h"
#include "NetworkManager.h"
#include "NotImplemented.h"
#include "Page.h"
@@ -112,7 +113,7 @@ bool ResourceHandle::start(NetworkingContext* context)
return false;
// FIXME: clean up use of Frame now that we have NetworkingContext (see RIM Bug #1515)
- Frame* frame = context->wrappedFrame();
+ Frame* frame = static_cast<FrameNetworkingContextBlackBerry*>(context)->frame();
if (!frame || !frame->loader() || !frame->loader()->client() || !client())
return false;
int playerId = static_cast<FrameLoaderClientBlackBerry*>(frame->loader()->client())->playerId();
@@ -144,7 +145,7 @@ void ResourceHandle::loadResourceSynchronously(NetworkingContext* context, const
}
// FIXME: clean up use of Frame now that we have NetworkingContext (see RIM Bug #1515)
- Frame* frame = context->wrappedFrame();
+ Frame* frame = static_cast<FrameNetworkingContextBlackBerry*>(context)->frame();
if (!frame || !frame->loader() || !frame->loader()->client() || !frame->page()) {
ASSERT(false && "loadResourceSynchronously called without a frame or frame client");
return;
diff --git a/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index 7e1edc05f..3ec325444 100644
--- a/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -333,11 +333,20 @@ static CFCachedURLResponseRef willCacheResponse(CFURLConnectionRef, CFCachedURLR
handle->client()->willCacheResponse(handle, policy);
if (static_cast<CFURLCacheStoragePolicy>(policy) != CFCachedURLResponseGetStoragePolicy(cachedResponse)) {
+#if HAVE(NETWORK_CFDATA_ARRAY_CALLBACK)
+ RetainPtr<CFArrayRef> receiverData(AdoptCF, CFCachedURLResponseCopyReceiverDataArray(cachedResponse));
+ cachedResponse = CFCachedURLResponseCreateWithDataArray(kCFAllocatorDefault,
+ CFCachedURLResponseGetWrappedResponse(cachedResponse),
+ receiverData.get(),
+ CFCachedURLResponseGetUserInfo(cachedResponse),
+ static_cast<CFURLCacheStoragePolicy>(policy));
+#else
cachedResponse = CFCachedURLResponseCreateWithUserInfo(kCFAllocatorDefault,
CFCachedURLResponseGetWrappedResponse(cachedResponse),
CFCachedURLResponseGetReceiverData(cachedResponse),
CFCachedURLResponseGetUserInfo(cachedResponse),
static_cast<CFURLCacheStoragePolicy>(policy));
+#endif
} else
CFRetain(cachedResponse);
@@ -1001,7 +1010,7 @@ void ResourceHandle::setPrivateBrowsingStorageSessionIdentifierBase(const String
privateBrowsingStorageSessionIdentifierBase() = identifier;
}
-#if PLATFORM(WIN)
+#if PLATFORM(WIN) || USE(CFNETWORK)
String ResourceHandle::privateBrowsingStorageSessionIdentifierDefaultBase()
{
diff --git a/Source/WebCore/plugins/DOMMimeType.h b/Source/WebCore/plugins/DOMMimeType.h
index 2acbc46df..1906484af 100644
--- a/Source/WebCore/plugins/DOMMimeType.h
+++ b/Source/WebCore/plugins/DOMMimeType.h
@@ -21,6 +21,7 @@
#define DOMMimeType_h
#include "Frame.h"
+#include "FrameDestructionObserver.h"
#include "PluginData.h"
#include <wtf/Forward.h>
diff --git a/Source/WebCore/plugins/DOMMimeTypeArray.cpp b/Source/WebCore/plugins/DOMMimeTypeArray.cpp
index 82d40064b..d39e9f155 100644
--- a/Source/WebCore/plugins/DOMMimeTypeArray.cpp
+++ b/Source/WebCore/plugins/DOMMimeTypeArray.cpp
@@ -29,7 +29,7 @@
namespace WebCore {
DOMMimeTypeArray::DOMMimeTypeArray(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
diff --git a/Source/WebCore/plugins/DOMMimeTypeArray.h b/Source/WebCore/plugins/DOMMimeTypeArray.h
index 54fff7bf4..25c276d38 100644
--- a/Source/WebCore/plugins/DOMMimeTypeArray.h
+++ b/Source/WebCore/plugins/DOMMimeTypeArray.h
@@ -22,6 +22,7 @@
#define DOMMimeTypeArray_h
#include "DOMMimeType.h"
+#include "DOMWindowProperty.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -32,24 +33,19 @@ namespace WebCore {
class Frame;
class PluginData;
-class DOMMimeTypeArray : public RefCounted<DOMMimeTypeArray> {
+class DOMMimeTypeArray : public RefCounted<DOMMimeTypeArray>, public DOMWindowProperty {
public:
static PassRefPtr<DOMMimeTypeArray> create(Frame* frame) { return adoptRef(new DOMMimeTypeArray(frame)); }
~DOMMimeTypeArray();
- Frame* frame() { return m_frame; }
- void disconnectFrame() { m_frame = 0; }
-
unsigned length() const;
PassRefPtr<DOMMimeType> item(unsigned index);
bool canGetItemsForName(const AtomicString& propertyName);
PassRefPtr<DOMMimeType> namedItem(const AtomicString& propertyName);
private:
- DOMMimeTypeArray(Frame*);
+ explicit DOMMimeTypeArray(Frame*);
PluginData* getPluginData() const;
-
- Frame* m_frame;
};
} // namespace WebCore
diff --git a/Source/WebCore/plugins/DOMPlugin.h b/Source/WebCore/plugins/DOMPlugin.h
index ee7f001be..15b36d43a 100644
--- a/Source/WebCore/plugins/DOMPlugin.h
+++ b/Source/WebCore/plugins/DOMPlugin.h
@@ -20,6 +20,7 @@
#ifndef DOMPlugin_h
#define DOMPlugin_h
+#include "FrameDestructionObserver.h"
#include "DOMMimeType.h"
#include <wtf/Forward.h>
#include <wtf/RefPtr.h>
diff --git a/Source/WebCore/plugins/DOMPluginArray.cpp b/Source/WebCore/plugins/DOMPluginArray.cpp
index 766c3eb3d..c8a53a579 100644
--- a/Source/WebCore/plugins/DOMPluginArray.cpp
+++ b/Source/WebCore/plugins/DOMPluginArray.cpp
@@ -29,7 +29,7 @@
namespace WebCore {
DOMPluginArray::DOMPluginArray(Frame* frame)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
{
}
diff --git a/Source/WebCore/plugins/DOMPluginArray.h b/Source/WebCore/plugins/DOMPluginArray.h
index 0b1f2ba98..6c3545721 100644
--- a/Source/WebCore/plugins/DOMPluginArray.h
+++ b/Source/WebCore/plugins/DOMPluginArray.h
@@ -22,6 +22,7 @@
#define DOMPluginArray_h
#include "DOMPlugin.h"
+#include "DOMWindowProperty.h"
#include <wtf/Forward.h>
#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
@@ -32,14 +33,11 @@ namespace WebCore {
class Frame;
class PluginData;
-class DOMPluginArray : public RefCounted<DOMPluginArray> {
+class DOMPluginArray : public RefCounted<DOMPluginArray>, public DOMWindowProperty {
public:
static PassRefPtr<DOMPluginArray> create(Frame* frame) { return adoptRef(new DOMPluginArray(frame)); }
~DOMPluginArray();
- Frame* frame() { return m_frame; }
- void disconnectFrame() { m_frame = 0; }
-
unsigned length() const;
PassRefPtr<DOMPlugin> item(unsigned index);
bool canGetItemsForName(const AtomicString& propertyName);
@@ -48,10 +46,8 @@ public:
void refresh(bool reload);
private:
- DOMPluginArray(Frame*);
+ explicit DOMPluginArray(Frame*);
PluginData* pluginData() const;
-
- Frame* m_frame;
};
} // namespace WebCore
diff --git a/Source/WebCore/rendering/RenderBlockLineLayout.cpp b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
index 92dceb104..77c3ce383 100755
--- a/Source/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/Source/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -1889,6 +1889,10 @@ void RenderBlock::LineBreaker::skipLeadingWhitespace(InlineBidiResolver& resolve
}
} else if (object->isFloating())
m_block->positionNewFloatOnLine(m_block->insertFloatingObject(toRenderBox(object)), lastFloatFromPreviousLine, lineInfo, width);
+ else if (object->isText() && object->style()->hasTextCombine() && object->isCombineText()) {
+ toRenderCombineText(object)->combineText();
+ continue;
+ }
resolver.increment();
}
resolver.commitExplicitEmbedding();
@@ -2279,7 +2283,7 @@ InlineIterator RenderBlock::LineBreaker::nextLineBreak(InlineBidiResolver& resol
#endif
RenderStyle* style = t->style(lineInfo.isFirstLine());
- if (style->hasTextCombine() && current.m_obj->isCombineText())
+ if (style->hasTextCombine() && current.m_obj->isCombineText() && !toRenderCombineText(current.m_obj)->isCombined())
toRenderCombineText(current.m_obj)->combineText();
const Font& f = style->font();
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 40adf387e..506105636 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -858,23 +858,12 @@ void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
{
- const FillLayer* bgLayer = style()->backgroundLayers();
- Color bgColor = style()->visitedDependentColor(CSSPropertyBackgroundColor);
- RenderObject* bodyObject = 0;
- if (!hasBackground() && node() && node()->hasTagName(HTMLNames::htmlTag)) {
- // Locate the <body> element using the DOM. This is easier than trying
- // to crawl around a render tree with potential :before/:after content and
- // anonymous blocks created by inline <body> tags etc. We can locate the <body>
- // render object very easily via the DOM.
- HTMLElement* body = document()->body();
- bodyObject = (body && body->hasLocalName(bodyTag)) ? body->renderer() : 0;
- if (bodyObject) {
- bgLayer = bodyObject->style()->backgroundLayers();
- bgColor = bodyObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
- }
- }
+ RenderObject* rootBackgroundRenderer = rendererForRootBackground();
+
+ const FillLayer* bgLayer = rootBackgroundRenderer->style()->backgroundLayers();
+ Color bgColor = rootBackgroundRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
- paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), BackgroundBleedNone, CompositeSourceOver, bodyObject);
+ paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), BackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer);
}
BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsContext* context) const
@@ -1804,7 +1793,7 @@ bool RenderBox::sizesToIntrinsicLogicalWidth(LogicalWidthType widthType) const
// Flexible box items should shrink wrap, so we lay them out at their intrinsic widths.
// In the case of columns that have a stretch alignment, we go ahead and layout at the
// stretched size to avoid an extra layout when applying alignment.
- if (parent()->isFlexibleBox() && (!parent()->style()->isColumnFlexDirection() || style()->flexAlign() != AlignStretch))
+ if (parent()->isFlexibleBox() && (!parent()->style()->isColumnFlexDirection() || style()->flexItemAlign() != AlignStretch))
return true;
// Flexible horizontal boxes lay out children at their intrinsic widths. Also vertical boxes
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index 8f6a8684e..0a646d993 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -32,6 +32,7 @@
#include "RenderFlexibleBox.h"
#include "LayoutRepainter.h"
+#include "RenderLayer.h"
#include "RenderView.h"
namespace WebCore {
@@ -488,8 +489,11 @@ void RenderFlexibleBox::computePreferredMainAxisExtent(bool relayoutChildren, Tr
LayoutUnit flexboxAvailableContentExtent = mainAxisContentExtent();
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
+ if (child->isPositioned())
+ continue;
+
+ child->clearOverrideSize();
if (mainAxisLengthForChild(child).isAuto()) {
- child->clearOverrideSize();
if (!relayoutChildren)
child->setChildNeedsLayout(true);
child->layoutIfNeeded();
@@ -523,6 +527,11 @@ bool RenderFlexibleBox::runFreeSpaceAllocationAlgorithm(FlexOrderIterator& itera
LayoutUnit flexboxAvailableContentExtent = mainAxisContentExtent();
for (RenderBox* child = iterator.first(); child; child = iterator.next()) {
+ if (child->isPositioned()) {
+ childSizes.append(0);
+ continue;
+ }
+
LayoutUnit childPreferredSize;
if (inflexibleItems.contains(child))
childPreferredSize = inflexibleItems.get(child);
@@ -591,6 +600,24 @@ void RenderFlexibleBox::setLogicalOverrideSize(RenderBox* child, LayoutUnit chil
child->setOverrideWidth(childPreferredSize);
}
+void RenderFlexibleBox::prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOffset, LayoutUnit crossAxisOffset)
+{
+ ASSERT(child->isPositioned());
+ child->containingBlock()->insertPositionedObject(child);
+ RenderLayer* childLayer = child->layer();
+ LayoutUnit inlinePosition = isColumnFlow() ? crossAxisOffset : mainAxisOffset;
+ if (style()->flexDirection() == FlowRowReverse)
+ inlinePosition = mainAxisExtent() - mainAxisOffset;
+ childLayer->setStaticInlinePosition(inlinePosition); // FIXME: Not right for regions.
+
+ LayoutUnit staticBlockPosition = isColumnFlow() ? mainAxisOffset : crossAxisOffset;
+ if (childLayer->staticBlockPosition() != staticBlockPosition) {
+ childLayer->setStaticBlockPosition(staticBlockPosition);
+ if (child->style()->hasStaticBlockPosition(style()->isHorizontalWritingMode()))
+ child->setChildNeedsLayout(true, false);
+ }
+}
+
void RenderFlexibleBox::layoutAndPlaceChildren(FlexOrderIterator& iterator, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, float totalPositiveFlexibility)
{
LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart();
@@ -602,12 +629,17 @@ void RenderFlexibleBox::layoutAndPlaceChildren(FlexOrderIterator& iterator, cons
bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow();
size_t i = 0;
for (RenderBox* child = iterator.first(); child; child = iterator.next(), ++i) {
+ if (child->isPositioned()) {
+ prepareChildForPositionedLayout(child, mainAxisOffset, crossAxisOffset);
+ mainAxisOffset += packingSpaceBetweenChildren(availableFreeSpace, totalPositiveFlexibility, style()->flexPack(), childSizes.size());
+ continue;
+ }
LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child);
setLogicalOverrideSize(child, childPreferredSize);
child->setChildNeedsLayout(true);
child->layoutIfNeeded();
- if (child->style()->flexAlign() == AlignBaseline) {
+ if (child->style()->flexItemAlign() == AlignBaseline) {
LayoutUnit ascent = marginBoxAscent(child);
LayoutUnit descent = (crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child)) - ascent;
@@ -657,6 +689,11 @@ void RenderFlexibleBox::layoutColumnReverse(FlexOrderIterator& iterator, const W
LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefore();
size_t i = 0;
for (RenderBox* child = iterator.first(); child; child = iterator.next(), ++i) {
+ if (child->isPositioned()) {
+ child->layer()->setStaticBlockPosition(mainAxisOffset);
+ mainAxisOffset -= packingSpaceBetweenChildren(availableFreeSpace, totalPositiveFlexibility, style()->flexPack(), childSizes.size());
+ continue;
+ }
mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForChild(child);
LayoutRect oldRect = child->frameRect();
@@ -695,13 +732,23 @@ void RenderFlexibleBox::alignChildren(FlexOrderIterator& iterator, LayoutUnit ma
}
// FIXME: Make sure this does the right thing with column flows.
- switch (child->style()->flexAlign()) {
+ switch (child->style()->flexItemAlign()) {
+ case AlignAuto:
+ // FIXME: Handle this once we add flex-align.
+ break;
case AlignStretch: {
if (!isColumnFlow() && child->style()->logicalHeight().isAuto()) {
+ LayoutUnit logicalHeightBefore = child->logicalHeight();
LayoutUnit stretchedLogicalHeight = child->logicalHeight() + RenderFlexibleBox::availableAlignmentSpaceForChild(child);
child->setLogicalHeight(stretchedLogicalHeight);
child->computeLogicalHeight();
- // FIXME: We need to relayout if the height changed.
+
+ if (child->logicalHeight() != logicalHeightBefore) {
+ child->setOverrideHeight(child->logicalHeight());
+ child->setLogicalHeight(0);
+ child->setChildNeedsLayout(true);
+ child->layoutIfNeeded();
+ }
}
break;
}
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.h b/Source/WebCore/rendering/RenderFlexibleBox.h
index fe0dfa21e..fd8a3113b 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderFlexibleBox.h
@@ -96,6 +96,7 @@ private:
void computePreferredMainAxisExtent(bool relayoutChildren, TreeOrderIterator&, LayoutUnit&, float& totalPositiveFlexibility, float& totalNegativeFlexibility);
bool runFreeSpaceAllocationAlgorithm(FlexOrderIterator&, LayoutUnit& availableFreeSpace, float& totalPositiveFlexibility, float& totalNegativeFlexibility, InflexibleFlexItemSize&, WTF::Vector<LayoutUnit>& childSizes);
void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize);
+ void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOffset, LayoutUnit crossAxisOffset);
void layoutAndPlaceChildren(FlexOrderIterator&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, float totalPositiveFlexibility);
void layoutColumnReverse(FlexOrderIterator&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, float totalPositiveFlexibility);
void alignChildren(FlexOrderIterator&, LayoutUnit maxAscent);
diff --git a/Source/WebCore/rendering/RenderFrameSet.cpp b/Source/WebCore/rendering/RenderFrameSet.cpp
index 00d9c0d47..074f3ed5d 100644
--- a/Source/WebCore/rendering/RenderFrameSet.cpp
+++ b/Source/WebCore/rendering/RenderFrameSet.cpp
@@ -662,7 +662,7 @@ void RenderFrameSet::positionFramesWithFlattening()
bool RenderFrameSet::flattenFrameSet() const
{
- return frame() && frame()->settings()->frameFlatteningEnabled();
+ return frame() && frame()->settings() && frame()->settings()->frameFlatteningEnabled();
}
void RenderFrameSet::startResizing(GridAxis& axis, int position)
diff --git a/Source/WebCore/rendering/RenderFullScreen.cpp b/Source/WebCore/rendering/RenderFullScreen.cpp
index 014f17a2c..1d689f5c9 100644
--- a/Source/WebCore/rendering/RenderFullScreen.cpp
+++ b/Source/WebCore/rendering/RenderFullScreen.cpp
@@ -117,21 +117,20 @@ RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, Document* doc
fullscreenRenderer->addChild(object);
}
document->setFullScreenRenderer(fullscreenRenderer);
- if (fullscreenRenderer->placeholder())
- return fullscreenRenderer->placeholder();
return fullscreenRenderer;
}
void RenderFullScreen::unwrapRenderer()
{
- RenderObject* holder = placeholder() ? placeholder() : this;
- if (holder->parent()) {
+ if (parent()) {
RenderObject* child;
while ((child = firstChild())) {
child->remove();
- holder->parent()->addChild(child, holder);
+ parent()->addChild(child, this);
}
}
+ if (placeholder())
+ placeholder()->remove();
remove();
document()->setFullScreenRenderer(0);
}
@@ -151,11 +150,8 @@ void RenderFullScreen::createPlaceholder(PassRefPtr<RenderStyle> style, const In
if (!m_placeholder) {
m_placeholder = new (document()->renderArena()) RenderFullScreenPlaceholder(this);
m_placeholder->setStyle(style);
- if (parent()) {
+ if (parent())
parent()->addChild(m_placeholder, this);
- remove();
- }
- m_placeholder->addChild(this);
} else
m_placeholder->setStyle(style);
}
diff --git a/Source/WebCore/rendering/RenderIFrame.cpp b/Source/WebCore/rendering/RenderIFrame.cpp
index 7e8738399..743e3f4c2 100644
--- a/Source/WebCore/rendering/RenderIFrame.cpp
+++ b/Source/WebCore/rendering/RenderIFrame.cpp
@@ -95,7 +95,7 @@ bool RenderIFrame::flattenFrame()
}
Frame* frame = element->document()->frame();
- bool enabled = frame && frame->settings()->frameFlatteningEnabled();
+ bool enabled = frame && frame->settings() && frame->settings()->frameFlatteningEnabled();
if (!enabled || !frame->page())
return false;
diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp
index 4b8556bc7..0182459a1 100644
--- a/Source/WebCore/rendering/RenderInline.cpp
+++ b/Source/WebCore/rendering/RenderInline.cpp
@@ -147,7 +147,7 @@ void RenderInline::styleDidChange(StyleDifference diff, const RenderStyle* oldSt
m_lineHeight = -1;
if (!m_alwaysCreateLineBoxes) {
- bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasBoxDecorations() || style()->hasPadding() || style()->hasMargin() || style()->hasOutline();
+ bool alwaysCreateLineBoxes = hasSelfPaintingLayer() || hasBoxDecorations() || style()->hasPadding() || style()->hasMargin() || hasOutline();
if (oldStyle && alwaysCreateLineBoxes) {
dirtyLineBoxes(false);
setNeedsLayout(true);
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp
index 587e2371c..90915a3d9 100644
--- a/Source/WebCore/rendering/RenderLayer.cpp
+++ b/Source/WebCore/rendering/RenderLayer.cpp
@@ -465,11 +465,6 @@ void RenderLayer::updateLayerPositionsAfterScroll(UpdateLayerPositionsAfterScrol
// FIXME: Is it worth passing the offsetFromRoot around like in updateLayerPositions?
computeRepaintRects();
flags |= HasSeenFixedPositionedAncestor;
- } else if (renderer()->hasTransform() && !renderer()->isRenderView()) {
- // Transforms act as fixed position containers, so nothing inside a
- // transformed element can be fixed relative to the viewport if the
- // transformed element is not fixed itself or child of a fixed element.
- return;
} else if ((flags & HasSeenAncestorWithOverflowClip) && !m_canSkipRepaintRectsUpdateOnScroll) {
// If we have seen an overflow clip, we should update our repaint rects as clippedOverflowRectForRepaint
// intersects it with our ancestor overflow clip that may have moved.
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp
index 917d2869e..aa617f6bd 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.cpp
+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp
@@ -777,40 +777,13 @@ static bool hasBoxDecorationsOrBackgroundImage(const RenderStyle* style)
return hasBoxDecorations(style) || style->hasBackgroundImage();
}
-bool RenderLayerBacking::rendererHasBackground() const
-{
- // FIXME: share more code here
- if (renderer()->node() && renderer()->node()->isDocumentNode()) {
- RenderObject* htmlObject = renderer()->firstChild();
- if (!htmlObject)
- return false;
-
- if (htmlObject->hasBackground())
- return true;
-
- RenderObject* bodyObject = htmlObject->firstChild();
- if (!bodyObject)
- return false;
-
- return bodyObject->hasBackground();
- }
-
- return renderer()->hasBackground();
-}
-
Color RenderLayerBacking::rendererBackgroundColor() const
{
- // FIXME: share more code here
- if (renderer()->node() && renderer()->node()->isDocumentNode()) {
- RenderObject* htmlObject = renderer()->firstChild();
- if (htmlObject->hasBackground())
- return htmlObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
-
- RenderObject* bodyObject = htmlObject->firstChild();
- return bodyObject->style()->visitedDependentColor(CSSPropertyBackgroundColor);
- }
+ RenderObject* backgroundRenderer = renderer();
+ if (backgroundRenderer->isRoot())
+ backgroundRenderer = backgroundRenderer->rendererForRootBackground();
- return renderer()->style()->visitedDependentColor(CSSPropertyBackgroundColor);
+ return backgroundRenderer->style()->visitedDependentColor(CSSPropertyBackgroundColor);
}
void RenderLayerBacking::updateBackgroundColor()
diff --git a/Source/WebCore/rendering/RenderLayerBacking.h b/Source/WebCore/rendering/RenderLayerBacking.h
index ba1dcfaec..8b1c790be 100644
--- a/Source/WebCore/rendering/RenderLayerBacking.h
+++ b/Source/WebCore/rendering/RenderLayerBacking.h
@@ -194,7 +194,6 @@ private:
bool isDirectlyCompositedImage() const;
void updateImageContents();
- bool rendererHasBackground() const;
Color rendererBackgroundColor() const;
void updateBackgroundColor();
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index ac4464132..93331aee7 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -368,11 +368,12 @@ bool RenderLayerCompositor::updateBacking(RenderLayer* layer, CompositingChangeR
layer->ensureBacking();
#if PLATFORM(MAC) && USE(CA)
- if (m_renderView->document()->settings()->acceleratedDrawingEnabled())
+ Settings* settings = m_renderView->document()->settings();
+ if (settings && settings->acceleratedDrawingEnabled())
layer->backing()->graphicsLayer()->setAcceleratesDrawing(true);
else if (layer->renderer()->isCanvas()) {
HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(layer->renderer()->node());
- if (canvas->renderingContext() && canvas->renderingContext()->isAccelerated())
+ if (canvas->shouldAccelerate(canvas->size()))
layer->backing()->graphicsLayer()->setAcceleratesDrawing(true);
}
#endif
@@ -1331,6 +1332,7 @@ bool RenderLayerCompositor::requiresCompositingLayer(const RenderLayer* layer) c
|| clipsCompositingDescendants(layer)
|| requiresCompositingForAnimation(renderer)
|| requiresCompositingForFullScreen(renderer)
+ || requiresCompositingForFilters(renderer)
|| requiresCompositingForPosition(renderer, layer);
}
@@ -1516,6 +1518,19 @@ bool RenderLayerCompositor::requiresCompositingForFullScreen(RenderObject* rende
#endif
}
+bool RenderLayerCompositor::requiresCompositingForFilters(RenderObject* renderer) const
+{
+#if ENABLE(CSS_FILTERS)
+ if (!(m_compositingTriggers & ChromeClient::FilterTrigger))
+ return false;
+
+ return renderer->hasFilter();
+#else
+ UNUSED_PARAM(renderer);
+ return false;
+#endif
+}
+
bool RenderLayerCompositor::requiresCompositingForPosition(RenderObject* renderer, const RenderLayer* layer) const
{
// position:fixed elements that create their own stacking context (e.g. have an explicit z-index,
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.h b/Source/WebCore/rendering/RenderLayerCompositor.h
index dc4b27de3..a55ce9af7 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.h
+++ b/Source/WebCore/rendering/RenderLayerCompositor.h
@@ -285,6 +285,7 @@ private:
bool requiresCompositingForFrame(RenderObject*) const;
bool requiresCompositingWhenDescendantsAreCompositing(RenderObject*) const;
bool requiresCompositingForFullScreen(RenderObject*) const;
+ bool requiresCompositingForFilters(RenderObject*) const;
bool requiresCompositingForScrollableFrame() const;
bool requiresCompositingForPosition(RenderObject*, const RenderLayer*) const;
diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp
index 1f1eb26c8..5e217c82c 100755
--- a/Source/WebCore/rendering/RenderObject.cpp
+++ b/Source/WebCore/rendering/RenderObject.cpp
@@ -38,6 +38,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
+#include "HTMLElement.h"
#include "HTMLNames.h"
#include "HitTestResult.h"
#include "Page.h"
@@ -2126,6 +2127,23 @@ bool RenderObject::isRooted(RenderView** view)
return true;
}
+RenderObject* RenderObject::rendererForRootBackground()
+{
+ ASSERT(isRoot());
+ if (!hasBackground() && node() && node()->hasTagName(HTMLNames::htmlTag)) {
+ // Locate the <body> element using the DOM. This is easier than trying
+ // to crawl around a render tree with potential :before/:after content and
+ // anonymous blocks created by inline <body> tags etc. We can locate the <body>
+ // render object very easily via the DOM.
+ HTMLElement* body = document()->body();
+ RenderObject* bodyObject = (body && body->hasLocalName(bodyTag)) ? body->renderer() : 0;
+ if (bodyObject)
+ return bodyObject;
+ }
+
+ return this;
+}
+
bool RenderObject::hasOutlineAnnotation() const
{
return node() && node()->isLink() && document()->printing();
diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h
index 3fe185f6a..ac3339eee 100644
--- a/Source/WebCore/rendering/RenderObject.h
+++ b/Source/WebCore/rendering/RenderObject.h
@@ -851,6 +851,9 @@ public:
return outlineBoundsForRepaint(0);
}
+ // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isRoot() is true.
+ RenderObject* rendererForRootBackground();
+
protected:
// Overrides should call the superclass at the end
virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp
index 8177503a7..0e1210621 100644
--- a/Source/WebCore/rendering/RenderText.cpp
+++ b/Source/WebCore/rendering/RenderText.cpp
@@ -68,7 +68,8 @@ public:
void restartWithNewText(unsigned lastTypedCharacterOffset)
{
m_lastTypedCharacterOffset = lastTypedCharacterOffset;
- startOneShot(m_renderText->document()->settings()->passwordEchoDurationInSeconds());
+ if (Settings* settings = m_renderText->document()->settings())
+ startOneShot(settings->passwordEchoDurationInSeconds());
}
void invalidate() { m_lastTypedCharacterOffset = -1; }
unsigned lastTypedCharacterOffset() { return m_lastTypedCharacterOffset; }
diff --git a/Source/WebCore/rendering/RenderThemeChromiumMac.h b/Source/WebCore/rendering/RenderThemeChromiumMac.h
index d9bc2f2df..8d4e52e56 100644
--- a/Source/WebCore/rendering/RenderThemeChromiumMac.h
+++ b/Source/WebCore/rendering/RenderThemeChromiumMac.h
@@ -33,6 +33,7 @@ public:
static PassRefPtr<RenderTheme> create();
protected:
+ virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&);
#if ENABLE(VIDEO)
virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
virtual bool paintMediaPlayButton(RenderObject*, const PaintInfo&, const IntRect&);
diff --git a/Source/WebCore/rendering/RenderThemeChromiumMac.mm b/Source/WebCore/rendering/RenderThemeChromiumMac.mm
index 11bbafe20..5d4c9539e 100644
--- a/Source/WebCore/rendering/RenderThemeChromiumMac.mm
+++ b/Source/WebCore/rendering/RenderThemeChromiumMac.mm
@@ -19,10 +19,12 @@
*/
#import "config.h"
+#import "LocalCurrentGraphicsContext.h"
#import "RenderThemeChromiumMac.h"
#import "PaintInfo.h"
#import "PlatformSupport.h"
#import "RenderMediaControlsChromium.h"
+#import "WebCoreSystemInterface.h"
#import "UserAgentStyleSheets.h"
#import <Carbon/Carbon.h>
#import <Cocoa/Cocoa.h>
@@ -125,6 +127,23 @@ bool RenderThemeChromiumMac::shouldShowPlaceholderWhenFocused() const
return true;
}
+bool RenderThemeChromiumMac::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+{
+ // Using the Cocoa code to paint the text field as RenderThemeMac does runs
+ // into a bug when building against the 10.5 SDK, so we are forced here to
+ // use the SPI. This override of paintTextField should be able to be removed
+ // when 10.6 is the minimum required system and Chromium is built against
+ // the 10.6 SDK.
+ //
+ // https://bugs.webkit.org/show_bug.cgi?id=75860
+ // http://code.google.com/p/chromium/issues/detail?id=109567
+
+ LocalCurrentGraphicsContext localContext(paintInfo.context);
+ wkDrawBezeledTextFieldCell(r, isEnabled(o) && !isReadOnlyControl(o));
+
+ return false;
+}
+
#if ENABLE(VIDEO)
void RenderThemeChromiumMac::adjustMediaSliderThumbSize(RenderStyle* style) const
diff --git a/Source/WebCore/rendering/RenderThemeMac.mm b/Source/WebCore/rendering/RenderThemeMac.mm
index a88bd3ca8..54f13f70b 100644
--- a/Source/WebCore/rendering/RenderThemeMac.mm
+++ b/Source/WebCore/rendering/RenderThemeMac.mm
@@ -1511,7 +1511,9 @@ void RenderThemeMac::adjustSearchFieldStyle(CSSStyleSelector* selector, RenderSt
bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- Node* input = o->node()->shadowAncestorNode();
+ Element* input = toElement(o->node()->shadowAncestorNode());
+ ASSERT(input);
+
if (!input->renderer()->isBox())
return false;
@@ -1520,8 +1522,12 @@ bool RenderThemeMac::paintSearchFieldCancelButton(RenderObject* o, const PaintIn
NSSearchFieldCell* search = this->search();
- updateActiveState([search cancelButtonCell], o);
- updatePressedState([search cancelButtonCell], o);
+ if (input->isEnabledFormControl() && !input->isReadOnlyFormControl()) {
+ updateActiveState([search cancelButtonCell], o);
+ updatePressedState([search cancelButtonCell], o);
+ }
+ else if ([[search cancelButtonCell] isHighlighted])
+ [[search cancelButtonCell] setHighlighted:NO];
GraphicsContextStateSaver stateSaver(*paintInfo.context);
diff --git a/Source/WebCore/rendering/style/RenderStyle.h b/Source/WebCore/rendering/style/RenderStyle.h
index c037ace12..eddd0f88c 100644
--- a/Source/WebCore/rendering/style/RenderStyle.h
+++ b/Source/WebCore/rendering/style/RenderStyle.h
@@ -800,7 +800,7 @@ public:
float flexboxHeightNegativeFlex() const { return rareNonInheritedData->m_flexibleBox->m_heightNegativeFlex; }
int flexOrder() const { return rareNonInheritedData->m_flexibleBox->m_flexOrder; }
EFlexPack flexPack() const { return static_cast<EFlexPack>(rareNonInheritedData->m_flexibleBox->m_flexPack); }
- EFlexAlign flexAlign() const { return static_cast<EFlexAlign>(rareNonInheritedData->m_flexibleBox->m_flexAlign); }
+ EFlexAlign flexItemAlign() const { return static_cast<EFlexAlign>(rareNonInheritedData->m_flexibleBox->m_flexItemAlign); }
EFlexDirection flexDirection() const { return static_cast<EFlexDirection>(rareNonInheritedData->m_flexibleBox->m_flexDirection); }
bool isColumnFlexDirection() const { return flexDirection() == FlowColumn || flexDirection() == FlowColumnReverse; }
EFlexWrap flexWrap() const { return static_cast<EFlexWrap>(rareNonInheritedData->m_flexibleBox->m_flexWrap); }
@@ -1220,7 +1220,7 @@ public:
void setFlexboxHeightNegativeFlex(float f) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_heightNegativeFlex, f); }
void setFlexOrder(int o) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexOrder, o); }
void setFlexPack(EFlexPack p) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexPack, p); }
- void setFlexAlign(EFlexAlign a) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexAlign, a); }
+ void setFlexItemAlign(EFlexAlign a) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexItemAlign, a); }
void setFlexDirection(EFlexDirection direction) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexDirection, direction); }
void setFlexWrap(EFlexWrap w) { SET_VAR(rareNonInheritedData.access()->m_flexibleBox, m_flexWrap, w); }
#if ENABLE(CSS_GRID_LAYOUT)
@@ -1544,7 +1544,8 @@ public:
static float initialFlexboxHeightNegativeFlex() { return 0; }
static int initialFlexOrder() { return 0; }
static EFlexPack initialFlexPack() { return PackStart; }
- static EFlexAlign initialFlexAlign() { return AlignStretch; }
+ // FIXME: When we add in flex-align, default flex-item-align to AlignAuto.
+ static EFlexAlign initialFlexItemAlign() { return AlignStretch; }
static EFlexDirection initialFlexDirection() { return FlowRow; }
static EFlexWrap initialFlexWrap() { return FlexNoWrap; }
static int initialMarqueeLoopCount() { return -1; }
diff --git a/Source/WebCore/rendering/style/RenderStyleConstants.h b/Source/WebCore/rendering/style/RenderStyleConstants.h
index ada7f6101..9191ba274 100644
--- a/Source/WebCore/rendering/style/RenderStyleConstants.h
+++ b/Source/WebCore/rendering/style/RenderStyleConstants.h
@@ -177,7 +177,7 @@ enum EBoxDirection { BNORMAL, BREVERSE };
// CSS3 Flexbox Properties
enum EFlexPack { PackStart, PackEnd, PackCenter, PackJustify };
-enum EFlexAlign { AlignStart, AlignEnd, AlignCenter, AlignStretch, AlignBaseline };
+enum EFlexAlign { AlignAuto, AlignStart, AlignEnd, AlignCenter, AlignStretch, AlignBaseline };
enum EFlexDirection { FlowRow, FlowRowReverse, FlowColumn, FlowColumnReverse };
enum EFlexWrap { FlexNoWrap, FlexWrap, FlexWrapReverse };
diff --git a/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp b/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
index 53e2a23c3..5ca0edbb3 100644
--- a/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
+++ b/Source/WebCore/rendering/style/StyleFlexibleBoxData.cpp
@@ -37,7 +37,7 @@ StyleFlexibleBoxData::StyleFlexibleBoxData()
, m_heightNegativeFlex(RenderStyle::initialFlexboxHeightNegativeFlex())
, m_flexOrder(RenderStyle::initialFlexOrder())
, m_flexPack(RenderStyle::initialFlexPack())
- , m_flexAlign(RenderStyle::initialFlexAlign())
+ , m_flexItemAlign(RenderStyle::initialFlexItemAlign())
, m_flexDirection(RenderStyle::initialFlexDirection())
, m_flexWrap(RenderStyle::initialFlexWrap())
{
@@ -51,7 +51,7 @@ StyleFlexibleBoxData::StyleFlexibleBoxData(const StyleFlexibleBoxData& o)
, m_heightNegativeFlex(o.m_heightNegativeFlex)
, m_flexOrder(o.m_flexOrder)
, m_flexPack(o.m_flexPack)
- , m_flexAlign(o.m_flexAlign)
+ , m_flexItemAlign(o.m_flexItemAlign)
, m_flexDirection(o.m_flexDirection)
, m_flexWrap(o.m_flexWrap)
{
@@ -61,7 +61,7 @@ bool StyleFlexibleBoxData::operator==(const StyleFlexibleBoxData& o) const
{
return m_widthPositiveFlex == o.m_widthPositiveFlex && m_widthNegativeFlex == o.m_widthNegativeFlex
&& m_heightPositiveFlex == o.m_heightPositiveFlex && m_heightNegativeFlex == o.m_heightNegativeFlex
- && m_flexOrder == o.m_flexOrder && m_flexPack == o.m_flexPack && m_flexAlign == o.m_flexAlign
+ && m_flexOrder == o.m_flexOrder && m_flexPack == o.m_flexPack && m_flexItemAlign == o.m_flexItemAlign
&& m_flexDirection == o.m_flexDirection && m_flexWrap == o.m_flexWrap;
}
diff --git a/Source/WebCore/rendering/style/StyleFlexibleBoxData.h b/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
index a5f1a03f9..4a90fbe49 100644
--- a/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
+++ b/Source/WebCore/rendering/style/StyleFlexibleBoxData.h
@@ -50,7 +50,7 @@ public:
int m_flexOrder;
unsigned m_flexPack : 2; // EFlexPack
- unsigned m_flexAlign : 3; // EFlexAlign
+ unsigned m_flexItemAlign : 3; // EFlexAlign
unsigned m_flexDirection : 2; // EFlexDirection
unsigned m_flexWrap : 2; // EFlexWrap
diff --git a/Source/WebCore/storage/DOMWindowSQLDatabase.cpp b/Source/WebCore/storage/DOMWindowSQLDatabase.cpp
new file mode 100644
index 000000000..e4b609080
--- /dev/null
+++ b/Source/WebCore/storage/DOMWindowSQLDatabase.cpp
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DOMWindowSQLDatabase.h"
+
+#include "AbstractDatabase.h"
+#include "DOMWindow.h"
+#include "Database.h"
+#include "DatabaseCallback.h"
+#include "Document.h"
+#include "Frame.h"
+#include "SecurityOrigin.h"
+
+#if ENABLE(SQL_DATABASE)
+
+namespace WebCore {
+
+PassRefPtr<Database> DOMWindowSQLDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
+{
+ if (!window->isCurrentlyDisplayedInFrame())
+ return 0;
+
+ RefPtr<Database> database = 0;
+ if (AbstractDatabase::isAvailable() && window->document()->securityOrigin()->canAccessDatabase())
+ database = Database::openDatabase(window->document(), name, version, displayName, estimatedSize, creationCallback, ec);
+
+ if (!database && !ec)
+ ec = SECURITY_ERR;
+
+ return database;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SQL_DATABASE)
diff --git a/Source/WebCore/storage/DOMWindowSQLDatabase.h b/Source/WebCore/storage/DOMWindowSQLDatabase.h
new file mode 100644
index 000000000..7af60be7a
--- /dev/null
+++ b/Source/WebCore/storage/DOMWindowSQLDatabase.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 DOMWindowSQLDatabase_h
+#define DOMWindowSQLDatabase_h
+
+#if ENABLE(SQL_DATABASE)
+#include "ExceptionCode.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class DOMWindow;
+class Database;
+class DatabaseCallback;
+class Frame;
+
+class DOMWindowSQLDatabase {
+public:
+ static PassRefPtr<Database> openDatabase(DOMWindow*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
+
+private:
+ DOMWindowSQLDatabase() { };
+ ~DOMWindowSQLDatabase() { };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SQL_DATABASE)
+
+#endif // DOMWindowSQLDatabase_h
diff --git a/Source/WebCore/storage/DOMWindowSQLDatabase.idl b/Source/WebCore/storage/DOMWindowSQLDatabase.idl
new file mode 100644
index 000000000..678035867
--- /dev/null
+++ b/Source/WebCore/storage/DOMWindowSQLDatabase.idl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module window {
+
+ interface [
+ Conditional=SQL_DATABASE,
+ Supplemental=DOMWindow
+ ] DOMWindowSQLDatabase {
+ [EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
+ raises(DOMException);
+ attribute SQLExceptionConstructor SQLException;
+ };
+
+}
diff --git a/Source/WebCore/storage/IDBCursorBackendImpl.cpp b/Source/WebCore/storage/IDBCursorBackendImpl.cpp
index ad96c5f1a..2351f6750 100644
--- a/Source/WebCore/storage/IDBCursorBackendImpl.cpp
+++ b/Source/WebCore/storage/IDBCursorBackendImpl.cpp
@@ -97,6 +97,22 @@ void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> value, PassR
void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
{
RefPtr<IDBKey> key = prpKey;
+
+ if (m_cursor && key) {
+ ASSERT(m_cursor->key());
+ if (m_direction == IDBCursor::NEXT || m_direction == IDBCursor::NEXT_NO_DUPLICATE) {
+ if (key->isLessThan(m_cursor->key().get())) {
+ ec = IDBDatabaseException::DATA_ERR;
+ return;
+ }
+ } else {
+ if (m_cursor->key()->isLessThan(key.get())) {
+ ec = IDBDatabaseException::DATA_ERR;
+ return;
+ }
+ }
+ }
+
if (!m_transaction->scheduleTask(createCallbackTask(&IDBCursorBackendImpl::continueFunctionInternal, this, key, prpCallbacks)))
ec = IDBDatabaseException::NOT_ALLOWED_ERR;
}
diff --git a/Source/WebCore/storage/Storage.cpp b/Source/WebCore/storage/Storage.cpp
index 5ba4602fb..260ef4f74 100644
--- a/Source/WebCore/storage/Storage.cpp
+++ b/Source/WebCore/storage/Storage.cpp
@@ -41,7 +41,7 @@ PassRefPtr<Storage> Storage::create(Frame* frame, PassRefPtr<StorageArea> storag
}
Storage::Storage(Frame* frame, PassRefPtr<StorageArea> storageArea)
- : m_frame(frame)
+ : DOMWindowProperty(frame)
, m_storageArea(storageArea)
{
ASSERT(m_frame);
diff --git a/Source/WebCore/storage/Storage.h b/Source/WebCore/storage/Storage.h
index 219bc55b9..98f041ec0 100644
--- a/Source/WebCore/storage/Storage.h
+++ b/Source/WebCore/storage/Storage.h
@@ -26,6 +26,7 @@
#ifndef Storage_h
#define Storage_h
+#include "DOMWindowProperty.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -36,7 +37,7 @@ namespace WebCore {
class StorageArea;
typedef int ExceptionCode;
- class Storage : public RefCounted<Storage> {
+ class Storage : public RefCounted<Storage>, public DOMWindowProperty {
public:
static PassRefPtr<Storage> create(Frame*, PassRefPtr<StorageArea>);
~Storage();
@@ -50,13 +51,9 @@ namespace WebCore {
bool contains(const String& key) const;
- Frame* frame() { return m_frame; }
- void disconnectFrame() { m_frame = 0; }
-
private:
Storage(Frame*, PassRefPtr<StorageArea>);
- Frame* m_frame;
RefPtr<StorageArea> m_storageArea;
};
diff --git a/Source/WebCore/webaudio/ConvolverNode.cpp b/Source/WebCore/webaudio/ConvolverNode.cpp
index 315835619..6afc095bc 100644
--- a/Source/WebCore/webaudio/ConvolverNode.cpp
+++ b/Source/WebCore/webaudio/ConvolverNode.cpp
@@ -47,6 +47,7 @@ namespace WebCore {
ConvolverNode::ConvolverNode(AudioContext* context, float sampleRate)
: AudioNode(context, sampleRate)
+ , m_normalize(true)
{
addInput(adoptPtr(new AudioNodeInput(this)));
addOutput(adoptPtr(new AudioNodeOutput(this, 2)));
@@ -134,7 +135,7 @@ void ConvolverNode::setBuffer(AudioBuffer* buffer)
// Create the reverb with the given impulse response.
bool useBackgroundThreads = !context()->isOfflineContext();
- OwnPtr<Reverb> reverb = adoptPtr(new Reverb(&bufferBus, AudioNode::ProcessingSizeInFrames, MaxFFTSize, 2, useBackgroundThreads));
+ OwnPtr<Reverb> reverb = adoptPtr(new Reverb(&bufferBus, AudioNode::ProcessingSizeInFrames, MaxFFTSize, 2, useBackgroundThreads, m_normalize));
{
// Synchronize with process().
diff --git a/Source/WebCore/webaudio/ConvolverNode.h b/Source/WebCore/webaudio/ConvolverNode.h
index fb29d5c5d..12f417281 100644
--- a/Source/WebCore/webaudio/ConvolverNode.h
+++ b/Source/WebCore/webaudio/ConvolverNode.h
@@ -54,6 +54,8 @@ public:
void setBuffer(AudioBuffer*);
AudioBuffer* buffer();
+ bool normalize() const { return m_normalize; }
+ void setNormalize(bool normalize) { m_normalize = normalize; }
private:
ConvolverNode(AudioContext*, float sampleRate);
@@ -62,6 +64,9 @@ private:
// This synchronizes dynamic changes to the convolution impulse response with process().
mutable Mutex m_processLock;
+
+ // Normalize the impulse response or not. Must default to true.
+ bool m_normalize;
};
} // namespace WebCore
diff --git a/Source/WebCore/webaudio/ConvolverNode.idl b/Source/WebCore/webaudio/ConvolverNode.idl
index d3eb475f0..c658bdc19 100644
--- a/Source/WebCore/webaudio/ConvolverNode.idl
+++ b/Source/WebCore/webaudio/ConvolverNode.idl
@@ -29,5 +29,6 @@ module audio {
GenerateToJS
] ConvolverNode : AudioNode {
attribute [JSCCustomSetter] AudioBuffer buffer;
+ attribute boolean normalize;
};
}
diff --git a/Source/WebCore/workers/DedicatedWorkerContext.cpp b/Source/WebCore/workers/DedicatedWorkerContext.cpp
index ec3eca89b..202e29907 100644
--- a/Source/WebCore/workers/DedicatedWorkerContext.cpp
+++ b/Source/WebCore/workers/DedicatedWorkerContext.cpp
@@ -41,8 +41,8 @@
namespace WebCore {
-DedicatedWorkerContext::DedicatedWorkerContext(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread)
- : WorkerContext(url, userAgent, thread)
+DedicatedWorkerContext::DedicatedWorkerContext(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
+ : WorkerContext(url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType)
{
}
diff --git a/Source/WebCore/workers/DedicatedWorkerContext.h b/Source/WebCore/workers/DedicatedWorkerContext.h
index 4edf64f4f..be5befc03 100644
--- a/Source/WebCore/workers/DedicatedWorkerContext.h
+++ b/Source/WebCore/workers/DedicatedWorkerContext.h
@@ -33,6 +33,7 @@
#if ENABLE(WORKERS)
+#include "ContentSecurityPolicy.h"
#include "MessagePort.h"
#include "WorkerContext.h"
@@ -43,9 +44,9 @@ namespace WebCore {
class DedicatedWorkerContext : public WorkerContext {
public:
typedef WorkerContext Base;
- static PassRefPtr<DedicatedWorkerContext> create(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread)
+ static PassRefPtr<DedicatedWorkerContext> create(const KURL& url, const String& userAgent, DedicatedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return adoptRef(new DedicatedWorkerContext(url, userAgent, thread));
+ return adoptRef(new DedicatedWorkerContext(url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType));
}
virtual bool isDedicatedWorkerContext() const { return true; }
@@ -65,7 +66,7 @@ namespace WebCore {
DedicatedWorkerThread* thread();
private:
- DedicatedWorkerContext(const KURL&, const String&, DedicatedWorkerThread*);
+ DedicatedWorkerContext(const KURL&, const String& userAgent, DedicatedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
};
} // namespace WebCore
diff --git a/Source/WebCore/workers/DedicatedWorkerThread.cpp b/Source/WebCore/workers/DedicatedWorkerThread.cpp
index bd406a241..5f60dd85e 100644
--- a/Source/WebCore/workers/DedicatedWorkerThread.cpp
+++ b/Source/WebCore/workers/DedicatedWorkerThread.cpp
@@ -39,13 +39,13 @@
namespace WebCore {
-PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode)
+PassRefPtr<DedicatedWorkerThread> DedicatedWorkerThread::create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return adoptRef(new DedicatedWorkerThread(scriptURL, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode));
+ return adoptRef(new DedicatedWorkerThread(scriptURL, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType));
}
-DedicatedWorkerThread::DedicatedWorkerThread(const KURL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode)
- : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode)
+DedicatedWorkerThread::DedicatedWorkerThread(const KURL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
+ : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)
, m_workerObjectProxy(workerObjectProxy)
{
}
@@ -54,9 +54,9 @@ DedicatedWorkerThread::~DedicatedWorkerThread()
{
}
-PassRefPtr<WorkerContext> DedicatedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent)
+PassRefPtr<WorkerContext> DedicatedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return DedicatedWorkerContext::create(url, userAgent, this);
+ return DedicatedWorkerContext::create(url, userAgent, this, contentSecurityPolicy, contentSecurityPolicyType);
}
void DedicatedWorkerThread::runEventLoop()
diff --git a/Source/WebCore/workers/DedicatedWorkerThread.h b/Source/WebCore/workers/DedicatedWorkerThread.h
index cafffc00f..12a44da04 100644
--- a/Source/WebCore/workers/DedicatedWorkerThread.h
+++ b/Source/WebCore/workers/DedicatedWorkerThread.h
@@ -32,6 +32,7 @@
#if ENABLE(WORKERS)
+#include "ContentSecurityPolicy.h"
#include "WorkerThread.h"
namespace WebCore {
@@ -40,16 +41,16 @@ namespace WebCore {
class DedicatedWorkerThread : public WorkerThread {
public:
- static PassRefPtr<DedicatedWorkerThread> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode);
+ static PassRefPtr<DedicatedWorkerThread> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; }
~DedicatedWorkerThread();
protected:
- virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL& url, const String& userAgent);
+ virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
virtual void runEventLoop();
private:
- DedicatedWorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode);
+ DedicatedWorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
WorkerObjectProxy& m_workerObjectProxy;
};
diff --git a/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp b/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp
index 9cf5297fa..8ca4db897 100644
--- a/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp
+++ b/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp
@@ -319,7 +319,10 @@ void SharedWorkerScriptLoader::notifyFinished()
m_worker->dispatchEvent(Event::create(eventNames().errorEvent, false, true));
else {
InspectorInstrumentation::scriptImported(m_worker->scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
- DefaultSharedWorkerRepository::instance().workerScriptLoaded(*m_proxy, m_worker->scriptExecutionContext()->userAgent(m_scriptLoader->url()), m_scriptLoader->script(), m_port.release());
+ DefaultSharedWorkerRepository::instance().workerScriptLoaded(*m_proxy, m_worker->scriptExecutionContext()->userAgent(m_scriptLoader->url()),
+ m_scriptLoader->script(), m_port.release(),
+ m_worker->scriptExecutionContext()->contentSecurityPolicy()->policy(),
+ m_worker->scriptExecutionContext()->contentSecurityPolicy()->headerType());
}
m_worker->unsetPendingActivity(m_worker.get());
this->deref(); // This frees this object - must be the last action in this function.
@@ -331,7 +334,7 @@ DefaultSharedWorkerRepository& DefaultSharedWorkerRepository::instance()
return *instance;
}
-void DefaultSharedWorkerRepository::workerScriptLoaded(SharedWorkerProxy& proxy, const String& userAgent, const String& workerScript, PassOwnPtr<MessagePortChannel> port)
+void DefaultSharedWorkerRepository::workerScriptLoaded(SharedWorkerProxy& proxy, const String& userAgent, const String& workerScript, PassOwnPtr<MessagePortChannel> port, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
MutexLocker lock(m_lock);
if (proxy.isClosing())
@@ -339,7 +342,7 @@ void DefaultSharedWorkerRepository::workerScriptLoaded(SharedWorkerProxy& proxy,
// Another loader may have already started up a thread for this proxy - if so, just send a connect to the pre-existing thread.
if (!proxy.thread()) {
- RefPtr<SharedWorkerThread> thread = SharedWorkerThread::create(proxy.name(), proxy.url(), userAgent, workerScript, proxy, proxy, DontPauseWorkerContextOnStart);
+ RefPtr<SharedWorkerThread> thread = SharedWorkerThread::create(proxy.name(), proxy.url(), userAgent, workerScript, proxy, proxy, DontPauseWorkerContextOnStart, contentSecurityPolicy, contentSecurityPolicyType);
proxy.setThread(thread);
thread->start();
}
diff --git a/Source/WebCore/workers/DefaultSharedWorkerRepository.h b/Source/WebCore/workers/DefaultSharedWorkerRepository.h
index 5d5bfe8ad..75d90e0d1 100644
--- a/Source/WebCore/workers/DefaultSharedWorkerRepository.h
+++ b/Source/WebCore/workers/DefaultSharedWorkerRepository.h
@@ -33,6 +33,7 @@
#if ENABLE(SHARED_WORKERS)
+#include "ContentSecurityPolicy.h"
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/Noncopyable.h>
@@ -58,7 +59,7 @@ namespace WebCore {
WTF_MAKE_NONCOPYABLE(DefaultSharedWorkerRepository); WTF_MAKE_FAST_ALLOCATED;
public:
// Invoked once the worker script has been loaded to fire up the worker thread.
- void workerScriptLoaded(SharedWorkerProxy&, const String& userAgent, const String& workerScript, PassOwnPtr<MessagePortChannel>);
+ void workerScriptLoaded(SharedWorkerProxy&, const String& userAgent, const String& workerScript, PassOwnPtr<MessagePortChannel>, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
// Internal implementation of SharedWorkerRepository::connect()
void connectToWorker(PassRefPtr<SharedWorker>, PassOwnPtr<MessagePortChannel>, const KURL&, const String& name, ExceptionCode&);
diff --git a/Source/WebCore/workers/SharedWorkerContext.cpp b/Source/WebCore/workers/SharedWorkerContext.cpp
index 9c94cd8c4..72d98274b 100644
--- a/Source/WebCore/workers/SharedWorkerContext.cpp
+++ b/Source/WebCore/workers/SharedWorkerContext.cpp
@@ -50,8 +50,8 @@ PassRefPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> port)
return event.release();
}
-SharedWorkerContext::SharedWorkerContext(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread)
- : WorkerContext(url, userAgent, thread)
+SharedWorkerContext::SharedWorkerContext(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
+ : WorkerContext(url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType)
, m_name(name)
{
}
diff --git a/Source/WebCore/workers/SharedWorkerContext.h b/Source/WebCore/workers/SharedWorkerContext.h
index 4f2b1dfc5..79d87b924 100644
--- a/Source/WebCore/workers/SharedWorkerContext.h
+++ b/Source/WebCore/workers/SharedWorkerContext.h
@@ -33,6 +33,7 @@
#if ENABLE(SHARED_WORKERS)
+#include "ContentSecurityPolicy.h"
#include "WorkerContext.h"
namespace WebCore {
@@ -43,9 +44,9 @@ namespace WebCore {
class SharedWorkerContext : public WorkerContext {
public:
typedef WorkerContext Base;
- static PassRefPtr<SharedWorkerContext> create(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread)
+ static PassRefPtr<SharedWorkerContext> create(const String& name, const KURL& url, const String& userAgent, SharedWorkerThread* thread, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return adoptRef(new SharedWorkerContext(name, url, userAgent, thread));
+ return adoptRef(new SharedWorkerContext(name, url, userAgent, thread, contentSecurityPolicy, contentSecurityPolicyType));
}
virtual ~SharedWorkerContext();
@@ -60,7 +61,7 @@ namespace WebCore {
SharedWorkerThread* thread();
private:
- SharedWorkerContext(const String& name, const KURL&, const String&, SharedWorkerThread*);
+ SharedWorkerContext(const String& name, const KURL&, const String&, SharedWorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
diff --git a/Source/WebCore/workers/SharedWorkerThread.cpp b/Source/WebCore/workers/SharedWorkerThread.cpp
index 917be3edc..13432ece8 100644
--- a/Source/WebCore/workers/SharedWorkerThread.cpp
+++ b/Source/WebCore/workers/SharedWorkerThread.cpp
@@ -38,13 +38,13 @@
namespace WebCore {
-PassRefPtr<SharedWorkerThread> SharedWorkerThread::create(const String& name, const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode)
+PassRefPtr<SharedWorkerThread> SharedWorkerThread::create(const String& name, const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return adoptRef(new SharedWorkerThread(name, scriptURL, userAgent, sourceCode, workerLoaderProxy, workerReportingProxy, startMode));
+ return adoptRef(new SharedWorkerThread(name, scriptURL, userAgent, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType));
}
-SharedWorkerThread::SharedWorkerThread(const String& name, const KURL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode)
- : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerReportingProxy, startMode)
+SharedWorkerThread::SharedWorkerThread(const String& name, const KURL& url, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
+ : WorkerThread(url, userAgent, sourceCode, workerLoaderProxy, workerReportingProxy, startMode, contentSecurityPolicy, contentSecurityPolicyType)
, m_name(name.isolatedCopy())
{
}
@@ -53,9 +53,9 @@ SharedWorkerThread::~SharedWorkerThread()
{
}
-PassRefPtr<WorkerContext> SharedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent)
+PassRefPtr<WorkerContext> SharedWorkerThread::createWorkerContext(const KURL& url, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return SharedWorkerContext::create(m_name, url, userAgent, this);
+ return SharedWorkerContext::create(m_name, url, userAgent, this, contentSecurityPolicy, contentSecurityPolicyType);
}
} // namespace WebCore
diff --git a/Source/WebCore/workers/SharedWorkerThread.h b/Source/WebCore/workers/SharedWorkerThread.h
index d60378dee..a58230dc2 100644
--- a/Source/WebCore/workers/SharedWorkerThread.h
+++ b/Source/WebCore/workers/SharedWorkerThread.h
@@ -32,20 +32,21 @@
#if ENABLE(SHARED_WORKERS)
+#include "ContentSecurityPolicy.h"
#include "WorkerThread.h"
namespace WebCore {
class SharedWorkerThread : public WorkerThread {
public:
- static PassRefPtr<SharedWorkerThread> create(const String& name, const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode);
+ static PassRefPtr<SharedWorkerThread> create(const String& name, const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
~SharedWorkerThread();
protected:
- virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String&);
+ virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String&, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
private:
- SharedWorkerThread(const String& name, const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode);
+ SharedWorkerThread(const String& name, const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
String m_name;
};
diff --git a/Source/WebCore/workers/WorkerContext.cpp b/Source/WebCore/workers/WorkerContext.cpp
index c284608f1..65851854f 100644
--- a/Source/WebCore/workers/WorkerContext.cpp
+++ b/Source/WebCore/workers/WorkerContext.cpp
@@ -108,7 +108,7 @@ public:
virtual bool isCleanupTask() const { return true; }
};
-WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread)
+WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread, const String& policy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
: m_url(url)
, m_userAgent(userAgent)
, m_script(adoptPtr(new WorkerScriptController(this)))
@@ -120,10 +120,8 @@ WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThr
, m_eventQueue(WorkerEventQueue::create(this))
{
setSecurityOrigin(SecurityOrigin::create(url));
-
- // FIXME: This should probably adopt the ContentSecurityPolicy of the document
- // that created this worker or use the header that came with the worker script.
setContentSecurityPolicy(ContentSecurityPolicy::create(this));
+ contentSecurityPolicy()->didReceiveHeader(policy, contentSecurityPolicyType);
}
WorkerContext::~WorkerContext()
diff --git a/Source/WebCore/workers/WorkerContext.h b/Source/WebCore/workers/WorkerContext.h
index c94fa0978..c1801b107 100644
--- a/Source/WebCore/workers/WorkerContext.h
+++ b/Source/WebCore/workers/WorkerContext.h
@@ -29,6 +29,7 @@
#if ENABLE(WORKERS)
+#include "ContentSecurityPolicy.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -179,7 +180,7 @@ namespace WebCore {
#endif
protected:
- WorkerContext(const KURL&, const String&, WorkerThread*);
+ WorkerContext(const KURL&, const String&, WorkerThread*, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
virtual void logExceptionToConsole(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
void addMessageToWorkerConsole(MessageSource, MessageType, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>);
diff --git a/Source/WebCore/workers/WorkerMessagingProxy.cpp b/Source/WebCore/workers/WorkerMessagingProxy.cpp
index 392a60953..e4cd796f2 100644
--- a/Source/WebCore/workers/WorkerMessagingProxy.cpp
+++ b/Source/WebCore/workers/WorkerMessagingProxy.cpp
@@ -31,6 +31,7 @@
#include "WorkerMessagingProxy.h"
+#include "ContentSecurityPolicy.h"
#include "CrossThreadTask.h"
#include "DedicatedWorkerContext.h"
#include "DedicatedWorkerThread.h"
@@ -270,7 +271,9 @@ WorkerMessagingProxy::~WorkerMessagingProxy()
void WorkerMessagingProxy::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode)
{
- RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode);
+ RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode,
+ m_scriptExecutionContext->contentSecurityPolicy()->policy(),
+ m_scriptExecutionContext->contentSecurityPolicy()->headerType());
workerThreadCreated(thread);
thread->start();
}
diff --git a/Source/WebCore/workers/WorkerThread.cpp b/Source/WebCore/workers/WorkerThread.cpp
index 9682cd583..93ba0bfb0 100644
--- a/Source/WebCore/workers/WorkerThread.cpp
+++ b/Source/WebCore/workers/WorkerThread.cpp
@@ -65,32 +65,36 @@ unsigned WorkerThread::workerThreadCount()
struct WorkerThreadStartupData {
WTF_MAKE_NONCOPYABLE(WorkerThreadStartupData); WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode)
+ static PassOwnPtr<WorkerThreadStartupData> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
{
- return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, startMode));
+ return adoptPtr(new WorkerThreadStartupData(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType));
}
KURL m_scriptURL;
String m_userAgent;
String m_sourceCode;
WorkerThreadStartMode m_startMode;
+ String m_contentSecurityPolicy;
+ ContentSecurityPolicy::HeaderType m_contentSecurityPolicyType;
private:
- WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode);
+ WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType);
};
-WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode)
+WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
: m_scriptURL(scriptURL.copy())
, m_userAgent(userAgent.isolatedCopy())
, m_sourceCode(sourceCode.isolatedCopy())
, m_startMode(startMode)
+ , m_contentSecurityPolicy(contentSecurityPolicy.isolatedCopy())
+ , m_contentSecurityPolicyType(contentSecurityPolicyType)
{
}
-WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode)
+WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerReportingProxy& workerReportingProxy, WorkerThreadStartMode startMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType contentSecurityPolicyType)
: m_threadID(0)
, m_workerLoaderProxy(workerLoaderProxy)
, m_workerReportingProxy(workerReportingProxy)
- , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode))
+ , m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode, startMode, contentSecurityPolicy, contentSecurityPolicyType))
#if ENABLE(NOTIFICATIONS)
, m_notificationPresenter(0)
#endif
@@ -128,7 +132,7 @@ void* WorkerThread::workerThread()
{
{
MutexLocker lock(m_threadCreationMutex);
- m_workerContext = createWorkerContext(m_startupData->m_scriptURL, m_startupData->m_userAgent);
+ m_workerContext = createWorkerContext(m_startupData->m_scriptURL, m_startupData->m_userAgent, m_startupData->m_contentSecurityPolicy, m_startupData->m_contentSecurityPolicyType);
if (m_runLoop.terminated()) {
// The worker was terminated before the thread had a chance to run. Since the context didn't exist yet,
diff --git a/Source/WebCore/workers/WorkerThread.h b/Source/WebCore/workers/WorkerThread.h
index 6f3b2220f..6646b1148 100644
--- a/Source/WebCore/workers/WorkerThread.h
+++ b/Source/WebCore/workers/WorkerThread.h
@@ -29,6 +29,7 @@
#if ENABLE(WORKERS)
+#include "ContentSecurityPolicy.h"
#include "WorkerRunLoop.h"
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
@@ -67,10 +68,10 @@ namespace WebCore {
#endif
protected:
- WorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode);
+ WorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerReportingProxy&, WorkerThreadStartMode, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
// Factory method for creating a new worker context for the thread.
- virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL& url, const String& userAgent) = 0;
+ virtual PassRefPtr<WorkerContext> createWorkerContext(const KURL&, const String& userAgent, const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType) = 0;
// Executes the event loop for the worker thread. Derived classes can override to perform actions before/after entering the event loop.
virtual void runEventLoop();
diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog
index 3284277df..89991f914 100644
--- a/Source/WebKit/ChangeLog
+++ b/Source/WebKit/ChangeLog
@@ -1,3 +1,36 @@
+2012-01-11 Rafael Brandao <rafael.lobo@openbossa.org>
+
+ [Qt][WK2] Fix the build for newer Qt5
+ https://bugs.webkit.org/show_bug.cgi?id=75964
+
+ Reviewed by Simon Hausmann.
+
+ * WebKit.pri: Added the new files to the buildsystem.
+
+2012-01-10 Mike Lattanzio <mlattanzio@rim.com>
+
+ [BlackBerry] Fix assertion failure in BackingStore::blitContents
+ https://bugs.webkit.org/show_bug.cgi?id=75976
+
+ Prevent an assertion failure in BackingStore::blitContents by
+ checking that the srcRect of the transformation matrix is non empty.
+
+ Reviewed by Adam Treat.
+
+ Upstream BlackBerry port is not yet building and testable.
+
+ * blackberry/Api/BackingStore.cpp:
+ (BlackBerry::WebKit::BackingStorePrivate::blitContents):
+
+2012-01-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [Mac] Sort the resources of WebKit.xcodeproj
+ https://bugs.webkit.org/show_bug.cgi?id=75634
+
+ Reviewed by Andreas Kling.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2012-01-06 Jacky Jiang <zhajiang@rim.com>
[BlackBerry] Upstream BlackBerry WebCoreSupport cache client
diff --git a/Source/WebKit/WebKit.pri b/Source/WebKit/WebKit.pri
index ca1a0fdaf..05eb09a87 100644
--- a/Source/WebKit/WebKit.pri
+++ b/Source/WebKit/WebKit.pri
@@ -13,7 +13,8 @@ SOURCES += \
$$PWD/qt/Api/qwebscriptworld.cpp \
$$PWD/qt/Api/qwebdatabase.cpp \
$$PWD/qt/Api/qwebinspector.cpp \
- $$PWD/qt/Api/qwebkitversion.cpp
+ $$PWD/qt/Api/qwebkitversion.cpp \
+ $$PWD/qt/Api/qhttpheader.cpp
HEADERS += \
$$PWD/qt/Api/qwebframe.h \
@@ -32,5 +33,6 @@ HEADERS += \
$$PWD/qt/Api/qwebhistory.h \
$$PWD/qt/Api/qwebinspector.h \
$$PWD/qt/Api/qwebkitversion.h \
- $$PWD/qt/Api/qwebplugindatabase_p.h
+ $$PWD/qt/Api/qwebplugindatabase_p.h \
+ $$PWD/qt/Api/qhttpheader_p.h
diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
index e36b1bf87..16cdf4c00 100644
--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -771,6 +771,7 @@
files = (
939811290824BF01008DF038 /* Carbon.framework in Frameworks */,
9398112A0824BF01008DF038 /* Cocoa.framework in Frameworks */,
+ 5D4DE0991479CBDF00EA3DF4 /* DiskArbitration.framework in Frameworks */,
CD8EAC7311CAC9A300774075 /* IOKit.framework in Frameworks */,
9398112B0824BF01008DF038 /* JavaScriptCore.framework in Frameworks */,
9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */,
@@ -778,7 +779,6 @@
1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */,
9398112F0824BF01008DF038 /* Security.framework in Frameworks */,
9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */,
- 5D4DE0991479CBDF00EA3DF4 /* DiskArbitration.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -901,9 +901,9 @@
children = (
5D7BF8120C2A1D90008CE06D /* WebInspector.h */,
5D7BF8130C2A1D90008CE06D /* WebInspector.mm */,
- 7A8FF0D01075024A00A80A08 /* WebInspectorPrivate.h */,
B804176D1217A83100466BAE /* WebInspectorFrontend.h */,
B804176E1217A83100466BAE /* WebInspectorFrontend.mm */,
+ 7A8FF0D01075024A00A80A08 /* WebInspectorPrivate.h */,
1C68F663095B5FC100C2984E /* WebNodeHighlight.h */,
1C68F664095B5FC100C2984E /* WebNodeHighlight.mm */,
A5687BD8135B791A0074CBCB /* WebNodeHighlighter.h */,
@@ -935,9 +935,9 @@
254DC334016E1D3F0ECA149E /* Misc */ = {
isa = PBXGroup;
children = (
- 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */,
A864B3E5123ED83D00C2A612 /* MailQuirksUserScript.js */,
1CCFFD120B1F81F2002EE926 /* OldWebAssertions.c */,
+ 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */,
5DE92FEE0BD7017E0059A5FD /* WebAssertions.h */,
5241ADF30B1BC48A004012BD /* WebCache.h */,
5241ADF40B1BC48A004012BD /* WebCache.mm */,
@@ -1062,8 +1062,8 @@
511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */,
511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */,
3AB02AF512C1319B00FBB694 /* WebStorageManager.mm */,
- 3AB02AFF12C132B200FBB694 /* WebStorageManagerPrivate.h */,
3AE15D4F12DBDED4009323C8 /* WebStorageManagerInternal.h */,
+ 3AB02AFF12C132B200FBB694 /* WebStorageManagerPrivate.h */,
3ABB3C781309C3B500E93D94 /* WebStorageTrackerClient.h */,
3ABB3C791309C3B500E93D94 /* WebStorageTrackerClient.mm */,
);
@@ -1168,13 +1168,13 @@
39446072020F50ED0ECA1767 /* WebDataSourcePrivate.h */,
BC542C400FD7766F00D8AB5D /* WebDelegateImplementationCaching.h */,
BC542C410FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm */,
+ 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */,
+ 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */,
+ 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */,
598ADA451202275000ABAE4E /* WebDeviceOrientationProvider.h */,
- 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */,
- 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */,
598AD9251201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h */,
- 598AD9231201CF1900ABAE4E /* WebDeviceOrientationInternal.h */,
- 598AD9211201CF1000ABAE4E /* WebDeviceOrientation.mm */,
- 598AD91F1201CF0700ABAE4E /* WebDeviceOrientation.h */,
+ 598AD9271201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm */,
+ 598AD9291201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h */,
35081DAE02B6D4F50ACA2ACA /* WebDocument.h */,
ED21B9810528F7AA003299AC /* WebDocumentInternal.h */,
65FFB7FA0AD0B7D30048CD05 /* WebDocumentLoaderMac.h */,
@@ -1285,8 +1285,6 @@
children = (
B82958D1132707D0000D0E79 /* CorrectionPanel.h */,
B82958D2132707D0000D0E79 /* CorrectionPanel.mm */,
- 598AD9191201CEC900ABAE4E /* WebDeviceOrientationClient.h */,
- 598AD91D1201CECF00ABAE4E /* WebDeviceOrientationClient.mm */,
B68049710FFBCEC1009F7F62 /* WebApplicationCache.h */,
B68049720FFBCEC1009F7F62 /* WebApplicationCache.mm */,
A5DEFC1111D5344B00885273 /* WebApplicationCacheQuotaManager.h */,
@@ -1296,6 +1294,8 @@
14D8252E0AF955090004F057 /* WebChromeClient.mm */,
065AD5A10B0C32C7005A2B1D /* WebContextMenuClient.h */,
065AD5A20B0C32C7005A2B1D /* WebContextMenuClient.mm */,
+ 598AD9191201CEC900ABAE4E /* WebDeviceOrientationClient.h */,
+ 598AD91D1201CECF00ABAE4E /* WebDeviceOrientationClient.mm */,
A70936AD0B5608DC00CDB48E /* WebDragClient.h */,
A70936AE0B5608DC00CDB48E /* WebDragClient.mm */,
4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */,
@@ -1423,6 +1423,7 @@
939810650824BF01008DF038 /* CarbonWindowAdapter.h in Headers */,
939810660824BF01008DF038 /* CarbonWindowContentView.h in Headers */,
939810670824BF01008DF038 /* CarbonWindowFrame.h in Headers */,
+ B82958D3132707D0000D0E79 /* CorrectionPanel.h in Headers */,
939810680824BF01008DF038 /* HIViewAdapter.h in Headers */,
939810690824BF01008DF038 /* HIWebView.h in Headers */,
1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */,
@@ -1432,6 +1433,7 @@
1A2DBE9F0F251E3A0036F8A6 /* ProxyInstance.h in Headers */,
E169836211346D1B00894115 /* ProxyRuntimeObject.h in Headers */,
B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */,
+ A5DEFC1311D5344B00885273 /* WebApplicationCacheQuotaManager.h in Headers */,
9398109A0824BF01008DF038 /* WebArchive.h in Headers */,
44BB8B141241A022001E3A22 /* WebArchiveInternal.h in Headers */,
5DE92FEF0BD7017E0059A5FD /* WebAssertions.h in Headers */,
@@ -1445,11 +1447,12 @@
51CBFCAD0D10E6C5002DBF51 /* WebCachedFramePlatformData.h in Headers */,
14D8252F0AF955090004F057 /* WebChromeClient.h in Headers */,
939810490824BF01008DF038 /* WebClipView.h in Headers */,
- 939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */,
065AD5A30B0C32C7005A2B1D /* WebContextMenuClient.h in Headers */,
939810160824BF01008DF038 /* WebCoreStatistics.h in Headers */,
+ 93E2A1A4123B0B3C009FE12A /* WebDashboardRegion.h in Headers */,
51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */,
511F3FD60CECC88F00852565 /* WebDatabaseManagerPrivate.h in Headers */,
+ A5DEFC0F11D5343E00885273 /* WebDatabaseQuotaManager.h in Headers */,
511F3FD70CECC88F00852565 /* WebDatabaseTrackerClient.h in Headers */,
9398104B0824BF01008DF038 /* WebDataSource.h in Headers */,
658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */,
@@ -1459,6 +1462,12 @@
9398104F0824BF01008DF038 /* WebDefaultPolicyDelegate.h in Headers */,
939810760824BF01008DF038 /* WebDefaultUIDelegate.h in Headers */,
BC542C420FD7766F00D8AB5D /* WebDelegateImplementationCaching.h in Headers */,
+ 598AD9201201CF0700ABAE4E /* WebDeviceOrientation.h in Headers */,
+ 598AD91A1201CEC900ABAE4E /* WebDeviceOrientationClient.h in Headers */,
+ 598AD9241201CF1900ABAE4E /* WebDeviceOrientationInternal.h in Headers */,
+ 598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */,
+ 598AD9261201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h in Headers */,
+ 598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */,
939810500824BF01008DF038 /* WebDocument.h in Headers */,
9398107F0824BF01008DF038 /* WebDocumentInternal.h in Headers */,
65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoaderMac.h in Headers */,
@@ -1482,10 +1491,12 @@
9398105B0824BF01008DF038 /* WebFrameLoadDelegate.h in Headers */,
C0B88E8B10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h in Headers */,
931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */,
+ 9391F275121B38BD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
939810540824BF01008DF038 /* WebFramePrivate.h in Headers */,
9398106E0824BF01008DF038 /* WebFrameView.h in Headers */,
9398106F0824BF01008DF038 /* WebFrameViewInternal.h in Headers */,
939810AF0824BF01008DF038 /* WebFrameViewPrivate.h in Headers */,
+ CDA62AE2125F87C2007FD118 /* WebFullScreenController.h in Headers */,
BC7F884B10C8775A00D6133D /* WebGeolocationClient.h in Headers */,
BC7F889E10C9D30C00D6133D /* WebGeolocationPosition.h in Headers */,
BC7F88A510C9D88B00D6133D /* WebGeolocationPositionInternal.h in Headers */,
@@ -1509,6 +1520,7 @@
939810190824BF01008DF038 /* WebIconDatabasePrivate.h in Headers */,
5D7BF8140C2A1D90008CE06D /* WebInspector.h in Headers */,
06693DDC0BFBA85200216072 /* WebInspectorClient.h in Headers */,
+ B804176F1217A83100466BAE /* WebInspectorFrontend.h in Headers */,
7A8FF0D11075024A00A80A08 /* WebInspectorPrivate.h in Headers */,
939810A00824BF01008DF038 /* WebJavaPlugIn.h in Headers */,
939810420824BF01008DF038 /* WebJavaScriptTextInputPanel.h in Headers */,
@@ -1531,6 +1543,7 @@
9398107A0824BF01008DF038 /* WebKitSystemBits.h in Headers */,
1C0D40870AC1C8F40009C113 /* WebKitVersionChecks.h in Headers */,
939810790824BF01008DF038 /* WebLocalizableStrings.h in Headers */,
+ BC42D324131ED1E00075FA4B /* WebLocalizableStringsInternal.h in Headers */,
5185F62610712B80007AA393 /* WebNavigationData.h in Headers */,
0AB752370FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h in Headers */,
0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */,
@@ -1542,7 +1555,9 @@
9398102B0824BF01008DF038 /* WebNetscapePluginStream.h in Headers */,
1A4DF5220EC8C74D006BD4B4 /* WebNetscapePluginView.h in Headers */,
1C68F66F095B5FC100C2984E /* WebNodeHighlight.h in Headers */,
+ A5687BDA135B791A0074CBCB /* WebNodeHighlighter.h in Headers */,
1C68F671095B5FC100C2984E /* WebNodeHighlightView.h in Headers */,
+ 31C11A6E1476552E0049A4CC /* WebNotificationClient.h in Headers */,
EDE983800BCDF5FE00FDAE28 /* WebNSArrayExtras.h in Headers */,
939810210824BF01008DF038 /* WebNSControlExtras.h in Headers */,
939810820824BF01008DF038 /* WebNSDataExtras.h in Headers */,
@@ -1559,6 +1574,8 @@
65E0F88408500917007E5CB9 /* WebNSURLRequestExtras.h in Headers */,
65E0F9E608500F23007E5CB9 /* WebNSUserDefaultsExtras.h in Headers */,
939810240824BF01008DF038 /* WebNSViewExtras.h in Headers */,
+ 939810250824BF01008DF038 /* WebNSWindowExtras.h in Headers */,
+ A58A5799143E727000125F50 /* WebOpenPanelResultListener.h in Headers */,
9398102A0824BF01008DF038 /* WebPanelAuthenticationHandler.h in Headers */,
37B6FB4E1063530C000FDB3B /* WebPDFDocumentExtras.h in Headers */,
939810A50824BF01008DF038 /* WebPDFRepresentation.h in Headers */,
@@ -1581,6 +1598,7 @@
939810A80824BF01008DF038 /* WebPreferenceKeysPrivate.h in Headers */,
9398105D0824BF01008DF038 /* WebPreferences.h in Headers */,
9398105E0824BF01008DF038 /* WebPreferencesPrivate.h in Headers */,
+ A57E2F24120749E600048DF3 /* WebQuotaManager.h in Headers */,
0F30985F11ECFE4500F559DF /* WebRenderLayer.h in Headers */,
9398105F0824BF01008DF038 /* WebRenderNode.h in Headers */,
939810880824BF01008DF038 /* WebResource.h in Headers */,
@@ -1592,8 +1610,13 @@
C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */,
C0B1F7E810AC8E3100C925D9 /* WebScriptWorld.h in Headers */,
C0B1F7EA10AC8E3100C925D9 /* WebScriptWorldInternal.h in Headers */,
+ A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */,
+ A5DEFC0C11D5331C00885273 /* WebSecurityOriginPrivate.h in Headers */,
BC26C69E10B743F400B687ED /* WebSerializedJSValue.h in Headers */,
F67DD7E6125E4527007BDCB8 /* WebSerializedJSValuePrivate.h in Headers */,
+ 3AE15D5012DBDED4009323C8 /* WebStorageManagerInternal.h in Headers */,
+ 3AB02B0012C132B200FBB694 /* WebStorageManagerPrivate.h in Headers */,
+ 3ABB3C7A1309C3B500E93D94 /* WebStorageTrackerClient.h in Headers */,
939810270824BF01008DF038 /* WebStringTruncator.h in Headers */,
93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */,
936A2DEA0FD2D08400D312DB /* WebTextCompletionController.h in Headers */,
@@ -1609,29 +1632,6 @@
9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
- A5DEFC0B11D5331C00885273 /* WebSecurityOriginInternal.h in Headers */,
- A5DEFC0C11D5331C00885273 /* WebSecurityOriginPrivate.h in Headers */,
- 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 */,
- 598AD91A1201CEC900ABAE4E /* WebDeviceOrientationClient.h in Headers */,
- 598AD9201201CF0700ABAE4E /* WebDeviceOrientation.h in Headers */,
- 598AD9241201CF1900ABAE4E /* WebDeviceOrientationInternal.h in Headers */,
- 598AD9261201CF2500ABAE4E /* WebDeviceOrientationProviderMock.h in Headers */,
- 598AD92A1201CF3B00ABAE4E /* WebDeviceOrientationProviderMockInternal.h in Headers */,
- 598ADA461202275000ABAE4E /* WebDeviceOrientationProvider.h in Headers */,
- 93E2A1A4123B0B3C009FE12A /* WebDashboardRegion.h in Headers */,
- 3AB02B0012C132B200FBB694 /* WebStorageManagerPrivate.h in Headers */,
- CDA62AE2125F87C2007FD118 /* WebFullScreenController.h in Headers */,
- 3AE15D5012DBDED4009323C8 /* WebStorageManagerInternal.h in Headers */,
- 3ABB3C7A1309C3B500E93D94 /* WebStorageTrackerClient.h in Headers */,
- BC42D324131ED1E00075FA4B /* WebLocalizableStringsInternal.h in Headers */,
- B82958D3132707D0000D0E79 /* CorrectionPanel.h in Headers */,
- A5687BDA135B791A0074CBCB /* WebNodeHighlighter.h in Headers */,
- A58A5799143E727000125F50 /* WebOpenPanelResultListener.h in Headers */,
- 31C11A6E1476552E0049A4CC /* WebNotificationClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1703,9 +1703,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */,
- A864B3F6123ED9FA00C2A612 /* MailQuirksUserScript.js in Resources */,
939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */,
+ A864B3F6123ED9FA00C2A612 /* MailQuirksUserScript.js in Resources */,
+ 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */,
939810B70824BF01008DF038 /* url_icon.tiff in Resources */,
939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */,
5DE83A7A0D0F7F9400CAD12A /* WebJavaScriptTextInputPanel.nib in Resources */,
@@ -1878,6 +1878,7 @@
939810FD0824BF01008DF038 /* CarbonWindowAdapter.mm in Sources */,
939810FE0824BF01008DF038 /* CarbonWindowContentView.m in Sources */,
939810FF0824BF01008DF038 /* CarbonWindowFrame.m in Sources */,
+ B82958D4132707D0000D0E79 /* CorrectionPanel.mm in Sources */,
939811000824BF01008DF038 /* HIViewAdapter.m in Sources */,
939811020824BF01008DF038 /* HIWebView.mm in Sources */,
1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */,
@@ -1889,6 +1890,7 @@
1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */,
E169836C11346D5600894115 /* ProxyRuntimeObject.mm in Sources */,
B6CE5C24100BC5CE00219936 /* WebApplicationCache.mm in Sources */,
+ A5DEFC1411D5344B00885273 /* WebApplicationCacheQuotaManager.mm in Sources */,
9398111D0824BF01008DF038 /* WebArchive.mm in Sources */,
939810CF0824BF01008DF038 /* WebAuthenticationPanel.m in Sources */,
939810BC0824BF01008DF038 /* WebBackForwardList.mm in Sources */,
@@ -1899,7 +1901,9 @@
939810EB0824BF01008DF038 /* WebClipView.mm in Sources */,
065AD5A40B0C32C7005A2B1D /* WebContextMenuClient.mm in Sources */,
939810BF0824BF01008DF038 /* WebCoreStatistics.mm in Sources */,
+ 93E2A1A5123B0B3C009FE12A /* WebDashboardRegion.mm in Sources */,
511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */,
+ A5DEFC1011D5343E00885273 /* WebDatabaseQuotaManager.mm in Sources */,
511F3FD80CECC88F00852565 /* WebDatabaseTrackerClient.mm in Sources */,
939810ED0824BF01008DF038 /* WebDataSource.mm in Sources */,
939810EF0824BF01008DF038 /* WebDefaultContextMenuDelegate.mm in Sources */,
@@ -1907,6 +1911,9 @@
939810F00824BF01008DF038 /* WebDefaultPolicyDelegate.m in Sources */,
9398110A0824BF01008DF038 /* WebDefaultUIDelegate.m in Sources */,
BC542C430FD7766F00D8AB5D /* WebDelegateImplementationCaching.mm in Sources */,
+ 598AD9221201CF1000ABAE4E /* WebDeviceOrientation.mm in Sources */,
+ 598AD91E1201CECF00ABAE4E /* WebDeviceOrientationClient.mm in Sources */,
+ 598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */,
65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.mm in Sources */,
9398111C0824BF01008DF038 /* WebDOMOperations.mm in Sources */,
E15663190FB61C1F00C199CA /* WebDownload.mm in Sources */,
@@ -1917,7 +1924,9 @@
939810FC0824BF01008DF038 /* WebFormDelegate.m in Sources */,
939810F20824BF01008DF038 /* WebFrame.mm in Sources */,
931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */,
+ 9391F276121B38BD00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,
939811060824BF01008DF038 /* WebFrameView.mm in Sources */,
+ CDA62AE3125F87C2007FD118 /* WebFullScreenController.mm in Sources */,
BC7F884C10C8775A00D6133D /* WebGeolocationClient.mm in Sources */,
BC7F889F10C9D30C00D6133D /* WebGeolocationPosition.mm in Sources */,
939811130824BF01008DF038 /* WebHistory.mm in Sources */,
@@ -1930,6 +1939,7 @@
5D7BF8150C2A1D90008CE06D /* WebInspector.mm in Sources */,
06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */,
1C7B0C660EB2464D00A28502 /* WebInspectorClientCF.cpp in Sources */,
+ B80417701217A83100466BAE /* WebInspectorFrontend.mm in Sources */,
939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */,
37D1DCA91065928C0068F7EF /* WebJSPDFDoc.mm in Sources */,
939811170824BF01008DF038 /* WebKeyGenerator.mm in Sources */,
@@ -1943,6 +1953,7 @@
9398110E0824BF01008DF038 /* WebKitSystemBits.m in Sources */,
1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */,
ED5B9524111B725A00472298 /* WebLocalizableStrings.mm in Sources */,
+ BC42D34D131ED3880075FA4B /* WebLocalizableStringsInternal.mm in Sources */,
5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */,
0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */,
0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */,
@@ -1954,7 +1965,9 @@
939810D10824BF01008DF038 /* WebNetscapePluginStream.mm in Sources */,
1A4DF5230EC8C74D006BD4B4 /* WebNetscapePluginView.mm in Sources */,
1C68F670095B5FC100C2984E /* WebNodeHighlight.mm in Sources */,
+ A5687BDB135B791A0074CBCB /* WebNodeHighlighter.mm in Sources */,
1C68F672095B5FC100C2984E /* WebNodeHighlightView.mm in Sources */,
+ 31C11A6F1476552E0049A4CC /* WebNotificationClient.mm in Sources */,
EDE983810BCDF5FE00FDAE28 /* WebNSArrayExtras.m in Sources */,
939810C60824BF01008DF038 /* WebNSControlExtras.m in Sources */,
939811150824BF01008DF038 /* WebNSDataExtras.m in Sources */,
@@ -1971,6 +1984,7 @@
65E0F9E708500F23007E5CB9 /* WebNSUserDefaultsExtras.mm in Sources */,
939810C90824BF01008DF038 /* WebNSViewExtras.m in Sources */,
939810CA0824BF01008DF038 /* WebNSWindowExtras.m in Sources */,
+ A58A579A143E727000125F50 /* WebOpenPanelResultListener.mm in Sources */,
939810D00824BF01008DF038 /* WebPanelAuthenticationHandler.m in Sources */,
37B6FB4F1063530C000FDB3B /* WebPDFDocumentExtras.mm in Sources */,
9398111F0824BF01008DF038 /* WebPDFRepresentation.mm in Sources */,
@@ -1990,7 +2004,10 @@
7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.mm in Sources */,
C0167BF90D7F5DD00028696E /* WebScriptDebugger.mm in Sources */,
C0B1F7E910AC8E3100C925D9 /* WebScriptWorld.mm in Sources */,
+ A5DEFC0A11D5331C00885273 /* WebSecurityOrigin.mm in Sources */,
BC26C6A510B7447A00B687ED /* WebSerializedJSValue.mm in Sources */,
+ 3AB02AF612C1319B00FBB694 /* WebStorageManager.mm in Sources */,
+ 3ABB3C7B1309C3B500E93D94 /* WebStorageTrackerClient.mm in Sources */,
939810CC0824BF01008DF038 /* WebStringTruncator.mm in Sources */,
93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */,
936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */,
@@ -2001,23 +2018,6 @@
939811070824BF01008DF038 /* WebView.mm in Sources */,
BC2E464E0FD8A96800A9D9DE /* WebViewData.mm in Sources */,
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
- 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 */,
- 598AD91E1201CECF00ABAE4E /* WebDeviceOrientationClient.mm in Sources */,
- 598AD9221201CF1000ABAE4E /* WebDeviceOrientation.mm in Sources */,
- 598AD9281201CF3200ABAE4E /* WebDeviceOrientationProviderMock.mm in Sources */,
- 93E2A1A5123B0B3C009FE12A /* WebDashboardRegion.mm in Sources */,
- 3AB02AF612C1319B00FBB694 /* WebStorageManager.mm in Sources */,
- CDA62AE3125F87C2007FD118 /* WebFullScreenController.mm in Sources */,
- 3ABB3C7B1309C3B500E93D94 /* WebStorageTrackerClient.mm in Sources */,
- BC42D34D131ED3880075FA4B /* WebLocalizableStringsInternal.mm in Sources */,
- B82958D4132707D0000D0E79 /* CorrectionPanel.mm in Sources */,
- A5687BDB135B791A0074CBCB /* WebNodeHighlighter.mm in Sources */,
- A58A579A143E727000125F50 /* WebOpenPanelResultListener.mm in Sources */,
- 31C11A6F1476552E0049A4CC /* WebNotificationClient.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebKit/blackberry/Api/BackingStore.cpp b/Source/WebKit/blackberry/Api/BackingStore.cpp
index 30f471c3a..b9b929d4b 100644
--- a/Source/WebKit/blackberry/Api/BackingStore.cpp
+++ b/Source/WebKit/blackberry/Api/BackingStore.cpp
@@ -1241,8 +1241,9 @@ void BackingStorePrivate::blitContents(const Platform::IntRect& dstRect,
#endif
// FIXME: This should not explicitely depend on WebCore::.
- TransformationMatrix transformation = TransformationMatrix::rectToRect(
- FloatRect(FloatPoint(0.0, 0.0), WebCore::IntSize(contents.size())), WebCore::IntRect(dstRect));
+ TransformationMatrix transformation;
+ if (!contents.isEmpty())
+ transformation = TransformationMatrix::rectToRect(FloatRect(FloatPoint(0.0, 0.0), WebCore::IntSize(contents.size())), WebCore::IntRect(dstRect));
bool blittingDirectlyToCompositingWindow = m_webPage->d->m_client->window()->windowUsage() == BlackBerry::Platform::Graphics::Window::GLES2Usage;
#if USE(ACCELERATED_COMPOSITING)
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 358aa0c7d..d9cb1d2d0 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,313 @@
+2012-01-10 Daniel Cheng <dcheng@chromium.org>
+
+ [chromium] Unreviewed, roll Chromium DEPS to r117121.
+
+ * DEPS:
+
+2012-01-10 Nat Duca <nduca@chromium.org>
+
+ [chromium] Reuse old timebase when activating CCDelayBasedTimeSource
+ https://bugs.webkit.org/show_bug.cgi?id=75938
+
+ Reviewed by James Robinson.
+
+ * tests/CCDelayBasedTimeSourceTest.cpp:
+ (WebKitTests::TEST):
+
+2012-01-10 Tony Chang <tony@chromium.org>
+
+ [chromium] Unreviewed, roll Chromium DEPS to r117109.
+
+ * DEPS:
+
+2012-01-10 Bill Budge <bbudge@chromium.org>
+
+ Allow plugins to add rotate items to browser's context menu. Adds a new
+ WebPluginAction struct, with rotate types.
+ https://bugs.webkit.org/show_bug.cgi?id=75645
+
+ Reviewed by Darin Fisher.
+
+ * WebKit.gyp:
+ * public/WebContextMenuData.h:
+ * public/WebPlugin.h:
+ (WebKit::WebPlugin::canRotateView):
+ (WebKit::WebPlugin::rotateView):
+ * public/WebPluginAction.h: Added.
+ (WebKit::WebPluginAction::WebPluginAction):
+ * public/WebView.h:
+ * src/ContextMenuClientImpl.cpp:
+ (WebKit::ContextMenuClientImpl::getCustomMenuFromDefaultItems):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::performMediaPlayerAction):
+ (WebKit::WebViewImpl::performPluginAction):
+ * src/WebViewImpl.h:
+
+2012-01-10 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Create iterators for the RenderSurface-Layer tree
+ https://bugs.webkit.org/show_bug.cgi?id=74203
+
+ Reviewed by James Robinson.
+
+ * WebKit.gypi:
+ * tests/CCLayerIteratorTest.cpp: Added.
+
+2012-01-10 James Robinson <jamesr@chromium.org>
+
+ [chromium] Remove old WebMimeRegistry.h forwarding header
+ https://bugs.webkit.org/show_bug.cgi?id=75979
+
+ Reviewed by Ryosuke Niwa.
+
+ This isn't needed any more.
+
+ * WebKit.gyp:
+ * public/platform/WebMimeRegistry.h: Removed.
+ * src/FrameLoaderClientImpl.cpp:
+ * src/PlatformSupport.cpp:
+ * src/WebMediaPlayerClientImpl.cpp:
+
+2012-01-10 Adrienne Walker <enne@google.com>
+
+ [chromium] Draw debug tile borders on composited layers
+ https://bugs.webkit.org/show_bug.cgi?id=75680
+
+ Reviewed by James Robinson.
+
+ As debug borders are not a CCSetting and are instead grabbed directly
+ from each graphics layer, modify the NonCompositedContentHost to say
+ that its graphics layer has debug borders if the page settings demand
+ it.
+
+ * src/NonCompositedContentHost.cpp:
+ (WebKit::NonCompositedContentHost::NonCompositedContentHost):
+ (WebKit::NonCompositedContentHost::setShowDebugBorders):
+ (WebKit::NonCompositedContentHost::showDebugBorders):
+ * src/NonCompositedContentHost.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+
+2012-01-10 Peter Beverloo <peter@chromium.org>
+
+ [Chromium] Fix compilation with ENABLE_WEB_AUDIO=0
+ https://bugs.webkit.org/show_bug.cgi?id=75957
+
+ Reviewed by Tony Gentilcore.
+
+ Revision 104502 broke Chromium compilation for platforms which disable
+ the Web Audio API. All references to m_audioSourceProvider should be
+ guarded with the ENABLE(WEB_AUDIO) conditional.
+
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::load):
+ (WebKit::WebMediaPlayerClientImpl::loadInternal):
+
+2012-01-09 Ryosuke Niwa <rniwa@webkit.org>
+
+ Roll Chromium DEPS from 116979 to 117006.
+
+ * DEPS:
+
+2012-01-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104507.
+ http://trac.webkit.org/changeset/104507
+ https://bugs.webkit.org/show_bug.cgi?id=75936
+
+ Broke webkit_unit_tests (Requested by dimich on #webkit).
+
+ * WebKit.gypi:
+ * tests/CCLayerIteratorTest.cpp: Removed.
+
+2012-01-09 Ryosuke Niwa <rniwa@webkit.org>
+
+ Touch WebView.h in an attempt to clobber Chromium bots on build.webkit.org.
+
+ * public/WebView.h:
+
+2012-01-09 Ryosuke Niwa <rniwa@webkit.org>
+
+ Roll Chromium DEPS from 116459 to 116979.
+
+ * DEPS:
+
+2012-01-09 Dana Jansens <danakj@chromium.org>
+
+ [chromium] Create iterators for the RenderSurface-Layer tree
+ https://bugs.webkit.org/show_bug.cgi?id=74203
+
+ Reviewed by James Robinson.
+
+ * WebKit.gypi:
+ * tests/CCLayerIteratorTest.cpp: Added.
+
+2012-01-09 W. James MacLean <wjmaclean@chromium.org>
+
+ [Chromium] REGRESSION(r104368): Broke CCLayerTreeHostImplTest.blendingOffWhenDrawingOpaqueLayers
+ https://bugs.webkit.org/show_bug.cgi?id=75783
+
+ Updated unit test to reflect desired behaviour now that tile/quad culling
+ is implemented.
+
+ Reviewed by James Robinson.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKit::TEST_F):
+
+2012-01-09 Chris Rogers <crogers@google.com>
+
+ Fix potential issue in WebMediaPlayerClientImpl
+ https://bugs.webkit.org/show_bug.cgi?id=75899
+
+ Reviewed by Kenneth Russell.
+
+ * src/WebMediaPlayerClientImpl.cpp:
+ (WebKit::WebMediaPlayerClientImpl::load):
+ (WebKit::WebMediaPlayerClientImpl::loadInternal):
+ (WebKit::WebMediaPlayerClientImpl::AudioSourceProviderImpl::wrap):
+
+2012-01-09 Justin Novosad <junov@chromium.org>
+
+ [Chromium] remove all references to the legacy accelerated 2d Canvas
+ implementation
+ https://bugs.webkit.org/show_bug.cgi?id=75108
+
+ Purging an old settings flag that is no longer referenced
+
+ Reviewed by Darin Fisher.
+
+ * public/WebSettings.h:
+ * src/WebSettingsImpl.cpp:
+ * src/WebSettingsImpl.h:
+
+2012-01-09 Joshua Bell <jsbell@chromium.org>
+
+ IndexedDB: Make WebIDBDatabase::close() idempotent
+ https://bugs.webkit.org/show_bug.cgi?id=75751
+
+ Allow Chromium's back-end to safely trigger the cleanup that occurs
+ when a database connection is closed, without tracking whether or not
+ the connection was previous closed by script.
+
+ Reviewed by Tony Chang.
+
+ * src/WebIDBDatabaseImpl.cpp:
+ (WebKit::WebIDBDatabaseImpl::close):
+
+2012-01-09 Xianzhu Wang <wangxianzhu@chromium.org>
+
+ Avoid unnecessary TextureManager::reduceMemoryToLimit().
+ https://bugs.webkit.org/show_bug.cgi?id=75632
+
+ Main part of the change is in Source/WebCore.
+
+ Reviewed by James Robinson.
+
+ Tests: webkit_unit_tests --gtest_filter=TextureManagerTest.*:CCLayerTreeHostTestSetViewportSize.*
+
+ * WebKit.gypi:
+ * src/WebLayerTreeView.cpp:
+ (WebKit::WebLayerTreeView::setViewportSize):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::updateLayerTreeViewport):
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKit::TEST_F):
+ * tests/CCLayerTreeHostTest.cpp:
+ (WTF::MockLayerTreeHost::create):
+ (WTF::CCLayerTreeHostTestOpacityChange::beginTest):
+ (WTF::CCLayerTreeHostTestSetViewportSize::CCLayerTreeHostTestSetViewportSize):
+ (WTF::CCLayerTreeHostTestSetViewportSize::beginTest):
+ (WTF::CCLayerTreeHostTestSetViewportSize::afterTest):
+ (WTF::TEST_F):
+ * tests/TextureManagerTest.cpp: Added.
+ (WTF::FakeTextureAllocator::createTexture):
+ (WTF::FakeTextureAllocator::deleteTexture):
+ (WTF::texturesMemorySize):
+ (WTF::createTextureManager):
+ (WTF::requestTexture):
+ (WTF::TEST):
+
+2012-01-09 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104418.
+ http://trac.webkit.org/changeset/104418
+ https://bugs.webkit.org/show_bug.cgi?id=75855
+
+ we still need to build against CG on Mac sometimes (Requested
+ by epoger on #webkit).
+
+ * WebKit.gyp:
+ * WebKit.gypi:
+
+2012-01-08 David Levin <levin@chromium.org>
+
+ [chromium] iframes in an autoresized window get sized incorrectly.
+ https://bugs.webkit.org/show_bug.cgi?id=75806
+
+ Reviewed by Adam Barth.
+
+ TEST: fast/autoresize/autoresize-with-iframe.html
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::createFrameView): Only do autoresizing
+ for the main frame not child frames.
+
+2012-01-08 Adam Barth <abarth@webkit.org>
+
+ [Chromium] Remove use_skia option from GYP
+ https://bugs.webkit.org/show_bug.cgi?id=75811
+
+ Reviewed by Ryosuke Niwa.
+
+ The CG configuration of Chromium Mac is no longer supported.
+
+ * WebKit.gyp:
+ * WebKit.gypi:
+
+2012-01-07 Dmitry Lomov <dslomov@google.com>
+
+ Unreviewed: disabled CCLayerTreeHostImplTest.blendingOffWhenDrawingOpaqueLayers
+ and filed https://bugs.webkit.org/show_bug.cgi?id=75783.
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+ (WebKit::TEST_F):
+
+2012-01-06 W. James MacLean <wjmaclean@chromium.org>
+
+ [Chromium] Cull occluded tiles in tiled layers
+ https://bugs.webkit.org/show_bug.cgi?id=70533
+
+ Reviewed by James Robinson.
+
+ * WebKit.gypi:
+ * tests/CCQuadCullerTest.cpp: Added.
+ (WebCore::TestDrawQuad::TestDrawQuad):
+ (WebCore::TestDrawQuad::create):
+ (WebCore::setQuads):
+ (WebCore::TEST):
+
+2012-01-06 Greg Billock <gbillock@google.com>
+
+ [Web Intents] Flagged-off WebCore implementation of navigator.startActivity
+ https://bugs.webkit.org/show_bug.cgi?id=73051
+
+ Reviewed by Adam Barth.
+
+ * features.gypi:
+
+2012-01-06 Tom Sepez <tsepez@chromium.org>
+
+ Pass Content-security-policy directive to worker threads.
+ https://bugs.webkit.org/show_bug.cgi?id=73242
+
+ Reviewed by David Levin.
+
+ * src/WebSharedWorkerImpl.cpp:
+ (WebKit::WebSharedWorkerImpl::startWorkerContext):
+ * src/WebWorkerClientImpl.cpp:
+ (WebKit::WebWorkerClientImpl::startWorkerContext):
+
2012-01-05 Jochen Eisinger <jochen@chromium.org>
Check whether a WebView exists before accessing it in StorageAreaProxy. This is not necessarily the case, e.g. for detached iframes.
diff --git a/Source/WebKit/chromium/DEPS b/Source/WebKit/chromium/DEPS
index 95b392b55..71471f7ad 100644
--- a/Source/WebKit/chromium/DEPS
+++ b/Source/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '116459'
+ 'chromium_rev': '117121'
}
deps = {
diff --git a/Source/WebKit/chromium/WebKit.gyp b/Source/WebKit/chromium/WebKit.gyp
index a241978d2..2e59f8c1f 100644
--- a/Source/WebKit/chromium/WebKit.gyp
+++ b/Source/WebKit/chromium/WebKit.gyp
@@ -216,6 +216,7 @@
'public/WebPerformance.h',
'public/WebPermissionClient.h',
'public/WebPlugin.h',
+ 'public/WebPluginAction.h',
'public/WebPluginContainer.h',
'public/WebPluginDocument.h',
'public/WebPluginListBuilder.h',
@@ -312,7 +313,6 @@
'public/platform/WebLocalizedString.h',
'public/platform/WebMediaStreamDescriptor.h',
'public/platform/WebMediaStreamSource.h',
- 'public/platform/WebMimeRegistry.h',
'public/platform/WebNonCopyable.h',
'public/platform/WebPeerConnectionHandler.h',
'public/platform/WebPeerConnectionHandlerClient.h',
diff --git a/Source/WebKit/chromium/WebKit.gypi b/Source/WebKit/chromium/WebKit.gypi
index 8e8d42e4f..ca8fb39d2 100644
--- a/Source/WebKit/chromium/WebKit.gypi
+++ b/Source/WebKit/chromium/WebKit.gypi
@@ -64,12 +64,14 @@
'tests/CCDelayBasedTimeSourceTest.cpp',
'tests/CCFrameRateControllerTest.cpp',
'tests/CCLayerImplTest.cpp',
+ 'tests/CCLayerIteratorTest.cpp',
'tests/CCLayerQuadTest.cpp',
'tests/CCLayerSorterTest.cpp',
'tests/CCLayerTreeHostCommonTest.cpp',
'tests/CCLayerTreeHostImplTest.cpp',
'tests/CCLayerTreeHostTest.cpp',
'tests/CCLayerTreeTestCommon.h',
+ 'tests/CCQuadCullerTest.cpp',
'tests/CCRenderSurfaceTest.cpp',
'tests/CCSchedulerStateMachineTest.cpp',
'tests/CCSchedulerTestCommon.h',
@@ -95,6 +97,7 @@
'tests/PODIntervalTreeTest.cpp',
'tests/PODRedBlackTreeTest.cpp',
'tests/RenderTableCellTest.cpp',
+ 'tests/TextureManagerTest.cpp',
'tests/TiledLayerChromiumTest.cpp',
'tests/TilingDataTest.cpp',
'tests/TreeSynchronizerTest.cpp',
diff --git a/Source/WebKit/chromium/features.gypi b/Source/WebKit/chromium/features.gypi
index e7d9febc4..9d2e06047 100644
--- a/Source/WebKit/chromium/features.gypi
+++ b/Source/WebKit/chromium/features.gypi
@@ -159,6 +159,11 @@
'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
],
}],
+ ['enable_web_intents==1', {
+ 'feature_defines': [
+ 'ENABLE_WEB_INTENTS=1',
+ ],
+ }],
['OS=="mac"', {
'feature_defines': [
'ENABLE_RUBBER_BANDING=1',
diff --git a/Source/WebKit/chromium/public/WebContextMenuData.h b/Source/WebKit/chromium/public/WebContextMenuData.h
index e17e23717..e72a434db 100644
--- a/Source/WebKit/chromium/public/WebContextMenuData.h
+++ b/Source/WebKit/chromium/public/WebContextMenuData.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -102,6 +102,7 @@ struct WebContextMenuData {
MediaHasVideo = 0x40,
MediaControlRootElement = 0x80,
MediaCanPrint = 0x100,
+ MediaCanRotate = 0x200,
};
// Extra attributes describing media elements.
diff --git a/Source/WebKit/chromium/public/WebPlugin.h b/Source/WebKit/chromium/public/WebPlugin.h
index f0eeade42..edfda32a4 100644
--- a/Source/WebKit/chromium/public/WebPlugin.h
+++ b/Source/WebKit/chromium/public/WebPlugin.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -125,6 +125,16 @@ public:
// Tells the plugin that the user has stopped the find operation.
virtual void stopFind() { }
+ // View rotation types.
+ enum RotationType {
+ RotationType90Clockwise,
+ RotationType90Counterclockwise
+ };
+ // Whether the plugin can rotate the view of its content.
+ virtual bool canRotateView() { return false; }
+ // Rotates the plugin's view of its content.
+ virtual void rotateView(RotationType type) { }
+
protected:
~WebPlugin() { }
};
diff --git a/Source/WebKit/chromium/public/WebPluginAction.h b/Source/WebKit/chromium/public/WebPluginAction.h
new file mode 100644
index 000000000..89f12edcd
--- /dev/null
+++ b/Source/WebKit/chromium/public/WebPluginAction.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 WebPluginAction_h
+#define WebPluginAction_h
+
+namespace WebKit {
+
+struct WebPluginAction {
+ enum Type {
+ Unknown,
+ Rotate90Clockwise,
+ Rotate90Counterclockwise
+ };
+
+ Type type;
+ bool enable;
+
+ WebPluginAction()
+ : type(Unknown), enable(false) { }
+ WebPluginAction(Type type, bool enable)
+ : type(type), enable(enable) { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/Source/WebKit/chromium/public/WebSettings.h b/Source/WebKit/chromium/public/WebSettings.h
index 0e9495cd7..cce47e2e2 100644
--- a/Source/WebKit/chromium/public/WebSettings.h
+++ b/Source/WebKit/chromium/public/WebSettings.h
@@ -115,7 +115,6 @@ public:
virtual void setAcceleratedCompositingForAnimationEnabled(bool) = 0;
virtual void setAccelerated2dCanvasEnabled(bool) = 0;
virtual void setAcceleratedCompositingForFixedPositionEnabled(bool) = 0;
- virtual void setLegacyAccelerated2dCanvasEnabled(bool) = 0;
virtual void setMinimumAccelerated2dCanvasSize(int) = 0;
virtual void setAcceleratedFiltersEnabled(bool) = 0;
virtual void setMemoryInfoEnabled(bool) = 0;
diff --git a/Source/WebKit/chromium/public/WebView.h b/Source/WebKit/chromium/public/WebView.h
index 1f8530ff8..c72b6133c 100644
--- a/Source/WebKit/chromium/public/WebView.h
+++ b/Source/WebKit/chromium/public/WebView.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2010, 2011, 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -55,6 +55,7 @@ class WebSpellCheckClient;
class WebString;
class WebViewClient;
struct WebMediaPlayerAction;
+struct WebPluginAction;
struct WebPoint;
class WebView : public WebWidget {
@@ -273,10 +274,14 @@ public:
// Media ---------------------------------------------------------------
- // Performs the specified action on the node at the given location.
+ // Performs the specified media player action on the node at the given location.
virtual void performMediaPlayerAction(
const WebMediaPlayerAction&, const WebPoint& location) = 0;
+ // Performs the specified plugin action on the node at the given location.
+ virtual void performPluginAction(
+ const WebPluginAction&, const WebPoint& location) = 0;
+
// Data exchange -------------------------------------------------------
diff --git a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
index 830a23b23..cdceb0763 100644
--- a/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
+++ b/Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -234,6 +234,10 @@ PlatformMenuDescription ContextMenuClientImpl::getCustomMenuFromDefaultItems(
HTMLPlugInImageElement* pluginElement = static_cast<HTMLPlugInImageElement*>(r.innerNonSharedNode());
data.srcURL = pluginElement->document()->completeURL(pluginElement->url());
data.mediaFlags |= WebContextMenuData::MediaCanSave;
+
+ // Add context menu commands that are supported by the plugin.
+ if (plugin->plugin()->canRotateView())
+ data.mediaFlags |= WebContextMenuData::MediaCanRotate;
}
}
}
diff --git a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 46f96b508..72e71b960 100644
--- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -68,7 +68,7 @@
#include "WebFrameImpl.h"
#include "WebKit.h"
#include "platform/WebKitPlatformSupport.h"
-#include "platform/WebMimeRegistry.h"
+#include <public/WebMimeRegistry.h>
#include "WebNode.h"
#include "WebPermissionClient.h"
#include "WebPlugin.h"
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
index c3a5bb481..edf1da7a3 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.cpp
@@ -37,6 +37,7 @@ namespace WebKit {
NonCompositedContentHost::NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint)
: m_contentPaint(contentPaint)
+ , m_showDebugBorders(false)
{
m_graphicsLayer = WebCore::GraphicsLayer::create(this);
#ifndef NDEBUG
@@ -143,9 +144,15 @@ void NonCompositedContentHost::paintContents(const WebCore::GraphicsLayer*, WebC
m_contentPaint->paint(context, adjustedClipRect);
}
+void NonCompositedContentHost::setShowDebugBorders(bool showDebugBorders)
+{
+ m_showDebugBorders = showDebugBorders;
+ m_graphicsLayer->updateDebugIndicators();
+}
+
bool NonCompositedContentHost::showDebugBorders() const
{
- return false;
+ return m_showDebugBorders;
}
bool NonCompositedContentHost::showRepaintCounter() const
diff --git a/Source/WebKit/chromium/src/NonCompositedContentHost.h b/Source/WebKit/chromium/src/NonCompositedContentHost.h
index dd6958108..2ae85b736 100644
--- a/Source/WebKit/chromium/src/NonCompositedContentHost.h
+++ b/Source/WebKit/chromium/src/NonCompositedContentHost.h
@@ -61,6 +61,8 @@ public:
void protectVisibleTileTextures();
WebCore::GraphicsLayer* topLevelRootLayer() const { return m_graphicsLayer.get(); }
+ void setShowDebugBorders(bool);
+
protected:
explicit NonCompositedContentHost(PassOwnPtr<WebCore::LayerPainterChromium> contentPaint);
@@ -78,6 +80,7 @@ private:
OwnPtr<WebCore::LayerPainterChromium> m_contentPaint;
WebCore::IntSize m_viewportSize;
int m_layerAdjustX;
+ bool m_showDebugBorders;
};
} // namespace WebKit
diff --git a/Source/WebKit/chromium/src/PlatformSupport.cpp b/Source/WebKit/chromium/src/PlatformSupport.cpp
index 1d1e79778..24681ec96 100644
--- a/Source/WebKit/chromium/src/PlatformSupport.cpp
+++ b/Source/WebKit/chromium/src/PlatformSupport.cpp
@@ -57,11 +57,11 @@
#include "platform/WebDragData.h"
#include "platform/WebImage.h"
#include "platform/WebKitPlatformSupport.h"
-#include "platform/WebMimeRegistry.h"
#include "platform/WebSerializedScriptValue.h"
#include "platform/WebString.h"
#include "platform/WebURL.h"
#include "platform/WebVector.h"
+#include <public/WebMimeRegistry.h>
#if USE(CG)
#include <CoreGraphics/CGContext.h>
diff --git a/Source/WebKit/chromium/src/WebFrameImpl.cpp b/Source/WebKit/chromium/src/WebFrameImpl.cpp
index e5ae9c518..2e8a328f8 100644
--- a/Source/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/Source/WebKit/chromium/src/WebFrameImpl.cpp
@@ -2093,7 +2093,7 @@ void WebFrameImpl::createFrameView()
WebViewImpl* webView = viewImpl();
bool isMainFrame = webView->mainFrameImpl()->frame() == m_frame;
m_frame->createView(webView->size(), Color::white, webView->isTransparent(), webView->fixedLayoutSize(), isMainFrame ? webView->isFixedLayoutModeEnabled() : 0);
- if (webView->shouldAutoResize())
+ if (webView->shouldAutoResize() && isMainFrame)
m_frame->view()->enableAutoSizeMode(true, webView->minAutoSize(), webView->maxAutoSize());
#if ENABLE(GESTURE_RECOGNIZER)
diff --git a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
index f40e020bb..447b993c6 100644
--- a/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp
@@ -101,8 +101,10 @@ void WebIDBDatabaseImpl::close()
{
// Use the callbacks that ::open gave us so that the backend in
// multi-process chromium knows which database connection is closing.
- ASSERT(m_databaseCallbacks);
+ if (!m_databaseCallbacks)
+ return;
m_databaseBackend->close(m_databaseCallbacks);
+ m_databaseCallbacks = 0;
}
void WebIDBDatabaseImpl::open(WebIDBDatabaseCallbacks* callbacks)
diff --git a/Source/WebKit/chromium/src/WebLayerTreeView.cpp b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
index 44ac90541..b288b563b 100644
--- a/Source/WebKit/chromium/src/WebLayerTreeView.cpp
+++ b/Source/WebKit/chromium/src/WebLayerTreeView.cpp
@@ -81,7 +81,7 @@ void WebLayerTreeView::composite()
void WebLayerTreeView::setViewportSize(const WebSize& viewportSize)
{
- m_private->setViewport(viewportSize);
+ m_private->setViewportSize(viewportSize);
}
WebSize WebLayerTreeView::viewportSize() const
diff --git a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
index dd2bc221e..891c31f3f 100644
--- a/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
+++ b/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
@@ -31,11 +31,11 @@
#include "platform/WebCString.h"
#include "platform/WebCanvas.h"
#include "platform/WebKitPlatformSupport.h"
-#include "platform/WebMimeRegistry.h"
#include "platform/WebRect.h"
#include "platform/WebSize.h"
#include "platform/WebString.h"
#include "platform/WebURL.h"
+#include <public/WebMimeRegistry.h>
#if USE(ACCELERATED_COMPOSITING)
#include "RenderLayerCompositor.h"
@@ -237,6 +237,9 @@ void WebMediaPlayerClientImpl::load(const String& url)
m_url = url;
if (m_preload == MediaPlayer::None) {
+#if ENABLE(WEB_AUDIO)
+ m_audioSourceProvider.wrap(0); // Clear weak reference to m_webMediaPlayer's WebAudioSourceProvider.
+#endif
m_webMediaPlayer.clear();
m_delayingLoad = true;
} else
@@ -245,6 +248,10 @@ void WebMediaPlayerClientImpl::load(const String& url)
void WebMediaPlayerClientImpl::loadInternal()
{
+#if ENABLE(WEB_AUDIO)
+ m_audioSourceProvider.wrap(0); // Clear weak reference to m_webMediaPlayer's WebAudioSourceProvider.
+#endif
+
Frame* frame = static_cast<HTMLMediaElement*>(m_mediaPlayer->mediaPlayerClient())->document()->frame();
m_webMediaPlayer = createWebMediaPlayer(this, frame);
if (m_webMediaPlayer) {
@@ -688,8 +695,6 @@ WebMediaPlayerClientImpl::WebMediaPlayerClientImpl()
#if ENABLE(WEB_AUDIO)
void WebMediaPlayerClientImpl::AudioSourceProviderImpl::wrap(WebAudioSourceProvider* provider)
{
- if (m_webAudioSourceProvider && m_webAudioSourceProvider != provider)
- m_webAudioSourceProvider->setClient(0);
m_webAudioSourceProvider = provider;
if (m_webAudioSourceProvider)
m_webAudioSourceProvider->setClient(m_client.get());
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.cpp b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
index d11f45220..7733e2699 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.cpp
@@ -368,11 +368,6 @@ void WebSettingsImpl::setAccelerated2dCanvasEnabled(bool enabled)
m_settings->setAccelerated2dCanvasEnabled(enabled);
}
-void WebSettingsImpl::setLegacyAccelerated2dCanvasEnabled(bool enabled)
-{
- m_settings->setLegacyAccelerated2dCanvasEnabled(enabled);
-}
-
void WebSettingsImpl::setAcceleratedCompositingForFixedPositionEnabled(bool enabled)
{
m_settings->setAcceleratedCompositingForFixedPositionEnabled(enabled);
diff --git a/Source/WebKit/chromium/src/WebSettingsImpl.h b/Source/WebKit/chromium/src/WebSettingsImpl.h
index 8fe9fe6ca..cc70d1316 100644
--- a/Source/WebKit/chromium/src/WebSettingsImpl.h
+++ b/Source/WebKit/chromium/src/WebSettingsImpl.h
@@ -107,7 +107,6 @@ public:
virtual void setAcceleratedCompositingForAnimationEnabled(bool);
virtual void setAccelerated2dCanvasEnabled(bool);
virtual void setAcceleratedCompositingForFixedPositionEnabled(bool);
- virtual void setLegacyAccelerated2dCanvasEnabled(bool);
virtual void setMinimumAccelerated2dCanvasSize(int);
virtual void setAcceleratedFiltersEnabled(bool);
virtual void setMemoryInfoEnabled(bool);
diff --git a/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp b/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp
index 231aaac2e..a2e16847d 100644
--- a/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp
+++ b/Source/WebKit/chromium/src/WebSharedWorkerImpl.cpp
@@ -365,7 +365,8 @@ void WebSharedWorkerImpl::startWorkerContext(const WebURL& url, const WebString&
{
initializeLoader(url);
WorkerThreadStartMode startMode = m_pauseWorkerContextOnStart ? PauseWorkerContextOnStart : DontPauseWorkerContextOnStart;
- setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this, startMode));
+ // FIXME: pass content-security-policy directives into shared worker.
+ setWorkerThread(SharedWorkerThread::create(name, url, userAgent, sourceCode, *this, *this, startMode, "", ContentSecurityPolicy::ReportOnly));
workerThread()->start();
}
diff --git a/Source/WebKit/chromium/src/WebViewImpl.cpp b/Source/WebKit/chromium/src/WebViewImpl.cpp
index b9355fc83..a14748353 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.cpp
+++ b/Source/WebKit/chromium/src/WebViewImpl.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
+ * Copyright (C) 2011, 2012 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -95,6 +95,7 @@
#include "ProgressTracker.h"
#include "RenderLayerCompositor.h"
#include "RenderView.h"
+#include "RenderWidget.h"
#include "ResourceHandle.h"
#include "SchemeRegistry.h"
#include "ScrollAnimator.h"
@@ -125,6 +126,7 @@
#include "WebMediaPlayerAction.h"
#include "WebNode.h"
#include "WebPlugin.h"
+#include "WebPluginAction.h"
#include "WebPluginContainerImpl.h"
#include "platform/WebPoint.h"
#include "WebPopupMenuImpl.h"
@@ -2183,7 +2185,7 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
HitTestResult result = hitTestResultForWindowPos(location);
RefPtr<Node> node = result.innerNonSharedNode();
if (!node->hasTagName(HTMLNames::videoTag) && !node->hasTagName(HTMLNames::audioTag))
- return;
+ return;
RefPtr<HTMLMediaElement> mediaElement =
static_pointer_cast<HTMLMediaElement>(node);
@@ -2208,6 +2210,33 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
}
}
+void WebViewImpl::performPluginAction(const WebPluginAction& action,
+ const WebPoint& location)
+{
+ HitTestResult result = hitTestResultForWindowPos(location);
+ RefPtr<Node> node = result.innerNonSharedNode();
+ if (!node->hasTagName(HTMLNames::objectTag) && !node->hasTagName(HTMLNames::embedTag))
+ return;
+
+ RenderObject* object = node->renderer();
+ if (object && object->isWidget()) {
+ Widget* widget = toRenderWidget(object)->widget();
+ if (widget && widget->isPluginContainer()) {
+ WebPluginContainerImpl* plugin = static_cast<WebPluginContainerImpl*>(widget);
+ switch (action.type) {
+ case WebPluginAction::Rotate90Clockwise:
+ plugin->plugin()->rotateView(WebPlugin::RotationType90Clockwise);
+ break;
+ case WebPluginAction::Rotate90Counterclockwise:
+ plugin->plugin()->rotateView(WebPlugin::RotationType90Counterclockwise);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
+ }
+}
+
void WebViewImpl::copyImageAt(const WebPoint& point)
{
if (!m_page)
@@ -2977,6 +3006,7 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
ccSettings.partialSwapEnabled = page()->settings()->partialSwapEnabled();
m_nonCompositedContentHost = NonCompositedContentHost::create(WebViewImplContentPainter::create(this));
+ m_nonCompositedContentHost->setShowDebugBorders(page()->settings()->showDebugBorders());
m_layerTreeHost = CCLayerTreeHost::create(this, ccSettings);
if (m_layerTreeHost) {
m_layerTreeHost->setHaveWheelEventHandlers(m_haveWheelEventHandlers);
@@ -3089,7 +3119,7 @@ void WebViewImpl::updateLayerTreeViewport()
layerAdjustX = -view->contentsSize().width() + view->visibleContentRect(false).width();
}
m_nonCompositedContentHost->setViewport(visibleRect.size(), view->contentsSize(), scroll, pageScaleFactor(), layerAdjustX);
- m_layerTreeHost->setViewport(visibleRect.size());
+ m_layerTreeHost->setViewportSize(visibleRect.size());
m_layerTreeHost->setPageScale(pageScaleFactor());
}
diff --git a/Source/WebKit/chromium/src/WebViewImpl.h b/Source/WebKit/chromium/src/WebViewImpl.h
index e5b5a525f..6ea196a75 100644
--- a/Source/WebKit/chromium/src/WebViewImpl.h
+++ b/Source/WebKit/chromium/src/WebViewImpl.h
@@ -186,6 +186,9 @@ public:
virtual void performMediaPlayerAction(
const WebMediaPlayerAction& action,
const WebPoint& location);
+ virtual void performPluginAction(
+ const WebPluginAction&,
+ const WebPoint&);
virtual void copyImageAt(const WebPoint& point);
virtual void dragSourceEndedAt(
const WebPoint& clientPoint,
diff --git a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp
index 5090affbc..d36e83a70 100644
--- a/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp
+++ b/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp
@@ -86,7 +86,9 @@ WorkerContextProxy* WebWorkerClientImpl::createWorkerContextProxy(Worker* worker
void WebWorkerClientImpl::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerThreadStartMode startMode)
{
- RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode);
+ RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this, startMode,
+ m_scriptExecutionContext->contentSecurityPolicy()->policy(),
+ m_scriptExecutionContext->contentSecurityPolicy()->headerType());
m_proxy->workerThreadCreated(thread);
thread->start();
}
diff --git a/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp b/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp
index 05a753bb9..41c9d119e 100644
--- a/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp
+++ b/Source/WebKit/chromium/tests/CCDelayBasedTimeSourceTest.cpp
@@ -224,7 +224,7 @@ TEST(CCDelayBasedTimeSourceTest, AchievesTargetRateWithNoNoise)
EXPECT_NEAR(1000.0 / 60.0, averageInterval, 0.1);
}
-TEST(CCDelayBasedTimeSource, TestUnrefWhilePending)
+TEST(CCDelayBasedTimeSource, TestDeactivateWhilePending)
{
FakeCCThread thread;
FakeCCTimeSourceClient client;
@@ -233,7 +233,57 @@ TEST(CCDelayBasedTimeSource, TestUnrefWhilePending)
timer->setActive(true); // Should post a task.
timer->setActive(false);
timer.clear();
- thread.runPendingTask(); // Should run the posted task, and delete the timer object.
+ thread.runPendingTask(); // Should run the posted task without crashing.
+}
+
+TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateBeforeNextTickTime)
+{
+ FakeCCThread thread;
+ FakeCCTimeSourceClient client;
+ RefPtr<FakeCCDelayBasedTimeSource> timer = FakeCCDelayBasedTimeSource::create(1000.0 / 60.0, &thread);
+ timer->setClient(&client);
+
+ // Should run the activate task, and pick up a new timebase.
+ timer->setActive(true);
+ timer->setMonotonicallyIncreasingTimeMs(0);
+ thread.runPendingTask();
+
+ // Stop the timer
+ timer->setActive(false);
+
+ // Task will be pending anyway, run it
+ thread.runPendingTask();
+
+ // Start the timer again, but before the next tick time the timer previously
+ // planned on using. That same tick time should still be targeted.
+ timer->setMonotonicallyIncreasingTimeMs(4);
+ timer->setActive(true);
+ EXPECT_EQ(12, thread.pendingDelay());
+}
+
+TEST(CCDelayBasedTimeSource, TestDeactivateAndReactivateAfterNextTickTime)
+{
+ FakeCCThread thread;
+ FakeCCTimeSourceClient client;
+ RefPtr<FakeCCDelayBasedTimeSource> timer = FakeCCDelayBasedTimeSource::create(1000.0 / 60.0, &thread);
+ timer->setClient(&client);
+
+ // Should run the activate task, and pick up a new timebase.
+ timer->setActive(true);
+ timer->setMonotonicallyIncreasingTimeMs(0);
+ thread.runPendingTask();
+
+ // Stop the timer
+ timer->setActive(false);
+
+ // Task will be pending anyway, run it
+ thread.runPendingTask();
+
+ // Start the timer again, but before the next tick time the timer previously
+ // planned on using. That same tick time should still be targeted.
+ timer->setMonotonicallyIncreasingTimeMs(20);
+ timer->setActive(true);
+ EXPECT_EQ(13, thread.pendingDelay());
}
}
diff --git a/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
new file mode 100644
index 000000000..47a6fd4dc
--- /dev/null
+++ b/Source/WebKit/chromium/tests/CCLayerIteratorTest.cpp
@@ -0,0 +1,275 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "cc/CCLayerIterator.h"
+
+#include "LayerChromium.h"
+#include "cc/CCLayerTreeHostCommon.h"
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using ::testing::Mock;
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::AnyNumber;
+
+namespace {
+
+class TestLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<TestLayerChromium> create() { return adoptRef(new TestLayerChromium()); }
+
+ int m_countRepresentingTargetSurface;
+ int m_countRepresentingContributingSurface;
+ int m_countRepresentingItself;
+
+ virtual bool drawsContent() const { return m_drawsContent; }
+ void setDrawsContent(bool drawsContent) { m_drawsContent = drawsContent; }
+
+private:
+ TestLayerChromium()
+ : LayerChromium(0)
+ , m_drawsContent(true)
+ {
+ setBounds(IntSize(100, 100));
+ setDrawableContentRect(IntRect(0, 0, 100, 100));
+ }
+
+ bool m_drawsContent;
+};
+
+#define EXPECT_COUNT(layer, target, contrib, itself) \
+ EXPECT_EQ(target, layer->m_countRepresentingTargetSurface); \
+ EXPECT_EQ(contrib, layer->m_countRepresentingContributingSurface); \
+ EXPECT_EQ(itself, layer->m_countRepresentingItself);
+
+typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::FrontToBack> FrontToBack;
+typedef CCLayerIterator<LayerChromium, RenderSurfaceChromium, CCLayerIteratorActions::BackToFront> BackToFront;
+
+void resetCounts(Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList)
+{
+ for (unsigned surfaceIndex = 0; surfaceIndex < renderSurfaceLayerList.size(); ++surfaceIndex) {
+ TestLayerChromium* renderSurfaceLayer = static_cast<TestLayerChromium*>(renderSurfaceLayerList[surfaceIndex].get());
+ RenderSurfaceChromium* renderSurface = renderSurfaceLayer->renderSurface();
+
+ renderSurfaceLayer->m_countRepresentingTargetSurface = -1;
+ renderSurfaceLayer->m_countRepresentingContributingSurface = -1;
+ renderSurfaceLayer->m_countRepresentingItself = -1;
+
+ for (unsigned layerIndex = 0; layerIndex < renderSurface->layerList().size(); ++layerIndex) {
+ TestLayerChromium* layer = static_cast<TestLayerChromium*>(renderSurface->layerList()[layerIndex].get());
+
+ layer->m_countRepresentingTargetSurface = -1;
+ layer->m_countRepresentingContributingSurface = -1;
+ layer->m_countRepresentingItself = -1;
+ }
+ }
+}
+
+void iterateFrontToBack(Vector<RefPtr<LayerChromium> >* renderSurfaceLayerList)
+{
+ resetCounts(*renderSurfaceLayerList);
+ int count = 0;
+ for (FrontToBack it = FrontToBack::begin(renderSurfaceLayerList); it != FrontToBack::end(renderSurfaceLayerList); ++it, ++count) {
+ TestLayerChromium* layer = static_cast<TestLayerChromium*>(*it);
+ if (it.representsTargetRenderSurface())
+ layer->m_countRepresentingTargetSurface = count;
+ if (it.representsContributingRenderSurface())
+ layer->m_countRepresentingContributingSurface = count;
+ if (it.representsItself())
+ layer->m_countRepresentingItself = count;
+ }
+}
+
+void iterateBackToFront(Vector<RefPtr<LayerChromium> >* renderSurfaceLayerList)
+{
+ resetCounts(*renderSurfaceLayerList);
+ int count = 0;
+ for (BackToFront it = BackToFront::begin(renderSurfaceLayerList); it != BackToFront::end(renderSurfaceLayerList); ++it, ++count) {
+ TestLayerChromium* layer = static_cast<TestLayerChromium*>(*it);
+ if (it.representsTargetRenderSurface())
+ layer->m_countRepresentingTargetSurface = count;
+ if (it.representsContributingRenderSurface())
+ layer->m_countRepresentingContributingSurface = count;
+ if (it.representsItself())
+ layer->m_countRepresentingItself = count;
+ }
+}
+
+TEST(CCLayerIteratorTest, simpleTree)
+{
+ RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> first = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> second = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> third = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> fourth = TestLayerChromium::create();
+
+ rootLayer->createRenderSurface();
+
+ rootLayer->addChild(first);
+ rootLayer->addChild(second);
+ rootLayer->addChild(third);
+ rootLayer->addChild(fourth);
+
+ Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
+ Vector<RefPtr<LayerChromium> > layerList;
+ renderSurfaceLayerList.append(rootLayer);
+ CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer.get(), rootLayer.get(),
+ TransformationMatrix(), TransformationMatrix(),
+ renderSurfaceLayerList, layerList,
+ 256);
+
+ iterateBackToFront(&renderSurfaceLayerList);
+ EXPECT_COUNT(rootLayer, 0, -1, 1);
+ EXPECT_COUNT(first, -1, -1, 2);
+ EXPECT_COUNT(second, -1, -1, 3);
+ EXPECT_COUNT(third, -1, -1, 4);
+ EXPECT_COUNT(fourth, -1, -1, 5);
+
+ iterateFrontToBack(&renderSurfaceLayerList);
+ EXPECT_COUNT(rootLayer, 5, -1, 4);
+ EXPECT_COUNT(first, -1, -1, 3);
+ EXPECT_COUNT(second, -1, -1, 2);
+ EXPECT_COUNT(third, -1, -1, 1);
+ EXPECT_COUNT(fourth, -1, -1, 0);
+
+}
+
+TEST(CCLayerIteratorTest, complexTree)
+{
+ RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root1 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root2 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root3 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root21 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root22 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root23 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root221 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root231 = TestLayerChromium::create();
+
+ rootLayer->createRenderSurface();
+
+ rootLayer->addChild(root1);
+ rootLayer->addChild(root2);
+ rootLayer->addChild(root3);
+ root2->addChild(root21);
+ root2->addChild(root22);
+ root2->addChild(root23);
+ root22->addChild(root221);
+ root23->addChild(root231);
+
+ Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
+ Vector<RefPtr<LayerChromium> > layerList;
+ renderSurfaceLayerList.append(rootLayer);
+ CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer.get(), rootLayer.get(),
+ TransformationMatrix(), TransformationMatrix(),
+ renderSurfaceLayerList, layerList,
+ 256);
+
+ iterateBackToFront(&renderSurfaceLayerList);
+ EXPECT_COUNT(rootLayer, 0, -1, 1);
+ EXPECT_COUNT(root1, -1, -1, 2);
+ EXPECT_COUNT(root2, -1, -1, 3);
+ EXPECT_COUNT(root21, -1, -1, 4);
+ EXPECT_COUNT(root22, -1, -1, 5);
+ EXPECT_COUNT(root221, -1, -1, 6);
+ EXPECT_COUNT(root23, -1, -1, 7);
+ EXPECT_COUNT(root231, -1, -1, 8);
+ EXPECT_COUNT(root3, -1, -1, 9);
+
+ iterateFrontToBack(&renderSurfaceLayerList);
+ EXPECT_COUNT(rootLayer, 9, -1, 8);
+ EXPECT_COUNT(root1, -1, -1, 7);
+ EXPECT_COUNT(root2, -1, -1, 6);
+ EXPECT_COUNT(root21, -1, -1, 5);
+ EXPECT_COUNT(root22, -1, -1, 4);
+ EXPECT_COUNT(root221, -1, -1, 3);
+ EXPECT_COUNT(root23, -1, -1, 2);
+ EXPECT_COUNT(root231, -1, -1, 1);
+ EXPECT_COUNT(root3, -1, -1, 0);
+
+}
+
+TEST(CCLayerIteratorTest, complexTreeMultiSurface)
+{
+ RefPtr<TestLayerChromium> rootLayer = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root1 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root2 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root3 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root21 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root22 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root23 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root221 = TestLayerChromium::create();
+ RefPtr<TestLayerChromium> root231 = TestLayerChromium::create();
+
+ rootLayer->createRenderSurface();
+
+ rootLayer->addChild(root1);
+ rootLayer->addChild(root2);
+ rootLayer->addChild(root3);
+ root2->setDrawsContent(false);
+ root2->setOpacity(0.5); // Force the layer to own a new surface.
+ root2->addChild(root21);
+ root2->addChild(root22);
+ root2->addChild(root23);
+ root22->setOpacity(0.5);
+ root22->addChild(root221);
+ root23->setOpacity(0.5);
+ root23->addChild(root231);
+
+ Vector<RefPtr<LayerChromium> > renderSurfaceLayerList;
+ Vector<RefPtr<LayerChromium> > layerList;
+ renderSurfaceLayerList.append(rootLayer);
+ CCLayerTreeHostCommon::calculateDrawTransformsAndVisibility(rootLayer.get(), rootLayer.get(),
+ TransformationMatrix(), TransformationMatrix(),
+ renderSurfaceLayerList, layerList,
+ 256);
+
+ iterateBackToFront(&renderSurfaceLayerList);
+ EXPECT_COUNT(rootLayer, 0, -1, 1);
+ EXPECT_COUNT(root1, -1, -1, 2);
+ EXPECT_COUNT(root2, 4, 3, -1);
+ EXPECT_COUNT(root21, -1, -1, 5);
+ EXPECT_COUNT(root22, 7, 6, 8);
+ EXPECT_COUNT(root221, -1, -1, 9);
+ EXPECT_COUNT(root23, 11, 10, 12);
+ EXPECT_COUNT(root231, -1, -1, 13);
+ EXPECT_COUNT(root3, -1, -1, 14);
+
+ iterateFrontToBack(&renderSurfaceLayerList);
+ EXPECT_COUNT(rootLayer, 14, -1, 13);
+ EXPECT_COUNT(root1, -1, -1, 12);
+ EXPECT_COUNT(root2, 10, 11, -1);
+ EXPECT_COUNT(root21, -1, -1, 9);
+ EXPECT_COUNT(root22, 7, 8, 6);
+ EXPECT_COUNT(root221, -1, -1, 5);
+ EXPECT_COUNT(root23, 3, 4, 2);
+ EXPECT_COUNT(root231, -1, -1, 1);
+ EXPECT_COUNT(root3, -1, -1, 0);
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
index e98f44da2..9b87d00fa 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp
@@ -217,12 +217,13 @@ private:
bool m_drawn;
};
+// https://bugs.webkit.org/show_bug.cgi?id=75783
TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
{
GraphicsContext3D::Attributes attrs;
RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(new BlendStateTrackerContext()), attrs, 0, GraphicsContext3D::RenderDirectlyToHostWindow, GraphicsContext3DPrivate::ForUseOnThisThread);
m_hostImpl->initializeLayerRenderer(context);
- m_hostImpl->setViewport(IntSize(10, 10));
+ m_hostImpl->setViewportSize(IntSize(10, 10));
RefPtr<CCLayerImpl> root = CCLayerImpl::create(0);
root->setAnchorPoint(FloatPoint(0, 0));
@@ -263,7 +264,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
layer2->setOpacity(1);
layer2->setExpectation(false, false);
m_hostImpl->drawLayers();
- EXPECT_TRUE(layer1->drawn());
+ EXPECT_FALSE(layer1->drawn());
EXPECT_TRUE(layer2->drawn());
// Parent layer with translucent content, drawn with blending.
@@ -272,7 +273,7 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
layer1->setExpectation(true, false);
layer2->setExpectation(false, false);
m_hostImpl->drawLayers();
- EXPECT_TRUE(layer1->drawn());
+ EXPECT_FALSE(layer1->drawn());
EXPECT_TRUE(layer2->drawn());
// Parent layer with translucent opacity and opaque content. Since it has a
@@ -285,6 +286,29 @@ TEST_F(CCLayerTreeHostImplTest, blendingOffWhenDrawingOpaqueLayers)
layer1->setExpectation(false, true);
layer2->setExpectation(false, false);
m_hostImpl->drawLayers();
+ EXPECT_FALSE(layer1->drawn());
+ EXPECT_TRUE(layer2->drawn());
+
+ // Draw again, but with child non-opaque, to make sure
+ // layer1 not culled.
+ layer1->setOpaque(true);
+ layer1->setOpacity(1);
+ layer1->setExpectation(false, false);
+ layer2->setOpaque(true);
+ layer2->setOpacity(0.5);
+ layer2->setExpectation(true, false);
+ m_hostImpl->drawLayers();
+ EXPECT_TRUE(layer1->drawn());
+ EXPECT_TRUE(layer2->drawn());
+
+ // A second way of making the child non-opaque.
+ layer1->setOpaque(true);
+ layer1->setOpacity(1);
+ layer1->setExpectation(false, false);
+ layer2->setOpaque(false);
+ layer2->setOpacity(1);
+ layer2->setExpectation(true, false);
+ m_hostImpl->drawLayers();
EXPECT_TRUE(layer1->drawn());
EXPECT_TRUE(layer2->drawn());
}
@@ -321,7 +345,7 @@ TEST_F(CCLayerTreeHostImplTest, reshapeNotCalledUntilDraw)
ReshapeTrackerContext* reshapeTracker = new ReshapeTrackerContext();
RefPtr<GraphicsContext3D> context = GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(reshapeTracker), attrs, 0, GraphicsContext3D::RenderDirectlyToHostWindow, GraphicsContext3DPrivate::ForUseOnThisThread);
m_hostImpl->initializeLayerRenderer(context);
- m_hostImpl->setViewport(IntSize(10, 10));
+ m_hostImpl->setViewportSize(IntSize(10, 10));
RefPtr<CCLayerImpl> root = adoptRef(new FakeDrawableCCLayerImpl(1));
root->setAnchorPoint(FloatPoint(0, 0));
@@ -371,7 +395,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
settings.partialSwapEnabled = true;
OwnPtr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this);
layerTreeHostImpl->initializeLayerRenderer(context);
- layerTreeHostImpl->setViewport(IntSize(500, 500));
+ layerTreeHostImpl->setViewportSize(IntSize(500, 500));
RefPtr<CCLayerImpl> root = adoptRef(new FakeDrawableCCLayerImpl(1));
RefPtr<CCLayerImpl> child = adoptRef(new FakeDrawableCCLayerImpl(2));
@@ -412,7 +436,7 @@ TEST_F(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
// Make sure that partial swap is constrained to the viewport dimensions
// expected damage rect: IntRect(IntPoint::zero(), IntSize(500, 500));
// expected swap rect: flipped damage rect, but also clamped to viewport
- layerTreeHostImpl->setViewport(IntSize(10, 10));
+ layerTreeHostImpl->setViewportSize(IntSize(10, 10));
root->setOpacity(0.7); // this will damage everything
layerTreeHostImpl->drawLayers();
layerTreeHostImpl->swapBuffers();
diff --git a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
index e6ce8b066..bfa1b0822 100644
--- a/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
+++ b/Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
@@ -110,7 +110,7 @@ public:
layerTreeHost->setRootLayer(rootLayer);
// LayerTreeHostImpl won't draw if it has 1x1 viewport.
- layerTreeHost->setViewport(IntSize(1, 1));
+ layerTreeHost->setViewportSize(IntSize(1, 1));
return layerTreeHost.release();
}
@@ -988,7 +988,7 @@ public:
virtual void beginTest()
{
m_layerTreeHost->setRootLayer(m_updateCheckLayer);
- m_layerTreeHost->setViewport(IntSize(10, 10));
+ m_layerTreeHost->setViewportSize(IntSize(10, 10));
postSetNeedsCommitToMainThread();
}
@@ -1025,4 +1025,47 @@ TEST_F(CCLayerTreeHostTestOpacityChange, runMultiThread)
runTest(true);
}
+class CCLayerTreeHostTestSetViewportSize : public CCLayerTreeHostTest {
+public:
+
+ CCLayerTreeHostTestSetViewportSize()
+ : m_numCommits(0)
+ , m_numDraws(0)
+ {
+ }
+
+ virtual void beginTest()
+ {
+ IntSize viewportSize(10, 10);
+ layerTreeHost()->setViewportSize(viewportSize);
+ EXPECT_EQ(viewportSize, layerTreeHost()->viewportSize());
+ EXPECT_EQ(TextureManager::highLimitBytes(viewportSize), layerTreeHost()->contentsTextureManager()->maxMemoryLimitBytes());
+ EXPECT_EQ(TextureManager::reclaimLimitBytes(viewportSize), layerTreeHost()->contentsTextureManager()->preferredMemoryLimitBytes());
+
+ // setViewportSize() should not call TextureManager::setMaxMemoryLimitBytes() or TextureManager::setPreferredMemoryLimitBytes()
+ // if the viewport size is not changed.
+ IntSize fakeSize(5, 5);
+ layerTreeHost()->contentsTextureManager()->setMaxMemoryLimitBytes(TextureManager::highLimitBytes(fakeSize));
+ layerTreeHost()->contentsTextureManager()->setPreferredMemoryLimitBytes(TextureManager::reclaimLimitBytes(fakeSize));
+ layerTreeHost()->setViewportSize(viewportSize);
+ EXPECT_EQ(TextureManager::highLimitBytes(fakeSize), layerTreeHost()->contentsTextureManager()->maxMemoryLimitBytes());
+ EXPECT_EQ(TextureManager::reclaimLimitBytes(fakeSize), layerTreeHost()->contentsTextureManager()->preferredMemoryLimitBytes());
+
+ endTest();
+ }
+
+ virtual void afterTest()
+ {
+ }
+
+private:
+ int m_numCommits;
+ int m_numDraws;
+};
+
+TEST_F(CCLayerTreeHostTestSetViewportSize, runSingleThread)
+{
+ runTest(false);
+}
+
} // namespace
diff --git a/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
new file mode 100644
index 000000000..ed15e6c10
--- /dev/null
+++ b/Source/WebKit/chromium/tests/CCQuadCullerTest.cpp
@@ -0,0 +1,187 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "cc/CCQuadCuller.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+
+namespace {
+
+class CCQuadCullerTest : public testing::Test {
+};
+
+class TestDrawQuad : public CCDrawQuad {
+public:
+ TestDrawQuad(const CCSharedQuadState* state, Material m, const IntRect& rect)
+ : CCDrawQuad(state, m, rect)
+ {
+ }
+
+ static PassOwnPtr<TestDrawQuad> create(const CCSharedQuadState* state, Material m, const IntRect& rect)
+ {
+ return adoptPtr(new TestDrawQuad(state, m, rect));
+ }
+};
+
+void setQuads(CCSharedQuadState* rootState, CCSharedQuadState* childState, CCQuadList& quadList)
+{
+ quadList.clear();
+
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 0), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(200, 0), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(0, 100), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 100), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(200, 100), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(0, 200), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 200), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(rootState, CCDrawQuad::TiledContent, IntRect(IntPoint(200, 200), IntSize(100, 100))));
+
+ quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 0), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(0, 100), IntSize(100, 100))));
+ quadList.append(TestDrawQuad::create(childState, CCDrawQuad::TiledContent, IntRect(IntPoint(100, 100), IntSize(100, 100))));
+}
+
+#define DECLARE_AND_INITIALIZE_TEST_QUADS \
+ CCQuadList quadList; \
+ TransformationMatrix childTransform; \
+ IntSize rootSize = IntSize(300, 300); \
+ IntRect rootRect = IntRect(IntPoint(), rootSize); \
+ IntSize childSize = IntSize(200, 200); \
+ IntRect childRect = IntRect(IntPoint(), childSize);
+
+TEST(CCQuadCullerTest, verifyCullChildLinesUpTopLeft)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 9u);
+}
+
+TEST(CCQuadCullerTest, verifyCullWhenChildOpacityNotOne)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 0.9, true);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+}
+
+TEST(CCQuadCullerTest, verifyCullWhenChildOpaqueFlagFalse)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, false);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+}
+
+TEST(CCQuadCullerTest, verifyCullCenterTileOnly)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ childTransform.translate(50, 50);
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 12u);
+}
+
+TEST(CCQuadCullerTest, verifyCullChildLinesUpBottomRight)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ childTransform.translate(100, 100);
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 9u);
+}
+
+TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsDontOcclude)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ // Use a small rotation so as to not disturb the geometry significantly.
+ childTransform.rotate(1);
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(childTransform, TransformationMatrix(), childRect, IntRect(), 1.0, true);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+}
+
+// This test requires some explanation: here we are rotating the quads to be culled.
+// The 2x2 tile child layer remains in the top-left corner, unrotated, but the 3x3
+// tile parent layer is rotated by 1 degree. Of the four tiles the child would
+// normally occlude, three will move (slightly) out from under the child layer, and
+// one moves further under the child. Only this last tile should be culled.
+TEST(CCQuadCullerTest, verifyNonAxisAlignedQuadsSafelyCulled)
+{
+ DECLARE_AND_INITIALIZE_TEST_QUADS
+
+ // Use a small rotation so as to not disturb the geometry significantly.
+ TransformationMatrix parentTransform;
+ parentTransform.rotate(1);
+
+ OwnPtr<CCSharedQuadState> rootState = CCSharedQuadState::create(parentTransform, TransformationMatrix(), rootRect, IntRect(), 1.0, true);
+ OwnPtr<CCSharedQuadState> childState = CCSharedQuadState::create(TransformationMatrix(), TransformationMatrix(), childRect, IntRect(), 1.0, true);
+
+ setQuads(rootState.get(), childState.get(), quadList);
+ EXPECT_EQ(quadList.size(), 13u);
+ CCQuadCuller::cullOccludedQuads(quadList);
+ EXPECT_EQ(quadList.size(), 12u);
+}
+
+} // namespace
diff --git a/Source/WebKit/chromium/tests/TextureManagerTest.cpp b/Source/WebKit/chromium/tests/TextureManagerTest.cpp
new file mode 100644
index 000000000..7c088dabc
--- /dev/null
+++ b/Source/WebKit/chromium/tests/TextureManagerTest.cpp
@@ -0,0 +1,231 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "TextureManager.h"
+
+#include <gtest/gtest.h>
+
+using namespace WebCore;
+using namespace WTF;
+
+namespace {
+
+class FakeTextureAllocator : public TextureAllocator {
+public:
+ virtual unsigned createTexture(const IntSize&, GC3Denum) { return 1; }
+ virtual void deleteTexture(unsigned, const IntSize&, GC3Denum) { }
+};
+
+FakeTextureAllocator fakeTextureAllocator;
+const IntSize textureSize(256, 256);
+const GC3Denum textureFormat = GraphicsContext3D::RGBA;
+
+size_t texturesMemorySize(size_t textureCount)
+{
+ return TextureManager::memoryUseBytes(textureSize, textureFormat) * textureCount;
+}
+
+PassOwnPtr<TextureManager> createTextureManager(size_t maxTextures, size_t preferredTextures)
+{
+ return TextureManager::create(texturesMemorySize(maxTextures), texturesMemorySize(preferredTextures), 1024);
+}
+
+bool requestTexture(TextureManager* manager, TextureToken token)
+{
+ unsigned textureId;
+ bool result = manager->requestTexture(token, textureSize, textureFormat, textureId);
+ if (result)
+ manager->allocateTexture(&fakeTextureAllocator, token);
+ return result;
+}
+
+TEST(TextureManagerTest, requestTextureInPreferredLimit)
+{
+ const size_t preferredTextures = 8;
+ OwnPtr<TextureManager> textureManager = createTextureManager(preferredTextures * 2, preferredTextures);
+ TextureToken tokens[preferredTextures];
+ for (size_t i = 0; i < preferredTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ if (i)
+ EXPECT_GT(tokens[i], tokens[i - 1]);
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ EXPECT_TRUE(textureManager->hasTexture(tokens[i]));
+ EXPECT_TRUE(textureManager->isProtected(tokens[i]));
+ }
+
+ for (size_t i = 0; i < preferredTextures; ++i)
+ EXPECT_TRUE(textureManager->hasTexture(tokens[i]));
+
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->currentMemoryUseBytes());
+}
+
+TEST(TextureManagerTest, requestTextureExceedingPreferredLimit)
+{
+ const size_t maxTextures = 8;
+ const size_t preferredTextures = 4;
+ OwnPtr<TextureManager> textureManager = createTextureManager(maxTextures, preferredTextures);
+ TextureToken tokens[maxTextures];
+ for (size_t i = 0; i < preferredTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ EXPECT_TRUE(textureManager->hasTexture(tokens[i]));
+ }
+
+ textureManager->unprotectTexture(tokens[0]);
+ textureManager->unprotectTexture(tokens[2]);
+
+ for (size_t i = preferredTextures; i < maxTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ EXPECT_TRUE(textureManager->hasTexture(tokens[i]));
+ textureManager->unprotectTexture(tokens[i]);
+ }
+
+ EXPECT_FALSE(textureManager->hasTexture(tokens[0]));
+ EXPECT_TRUE(textureManager->hasTexture(tokens[1]));
+ EXPECT_TRUE(textureManager->isProtected(tokens[1]));
+ EXPECT_FALSE(textureManager->hasTexture(tokens[2]));
+ EXPECT_TRUE(textureManager->hasTexture(tokens[3]));
+ EXPECT_TRUE(textureManager->isProtected(tokens[3]));
+
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->currentMemoryUseBytes());
+}
+
+TEST(TextureManagerTest, requestTextureExceedingMaxLimit)
+{
+ const size_t maxTextures = 8;
+ const size_t preferredTextures = 4;
+ OwnPtr<TextureManager> textureManager = createTextureManager(maxTextures, preferredTextures);
+ TextureToken tokens[maxTextures];
+ for (size_t i = 0; i < maxTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ EXPECT_TRUE(textureManager->hasTexture(tokens[i]));
+ }
+
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+
+ for (size_t i = 0; i < maxTextures; ++i) {
+ TextureToken token = textureManager->getToken();
+ EXPECT_FALSE(requestTexture(textureManager.get(), token));
+ EXPECT_FALSE(textureManager->hasTexture(token));
+ }
+
+ EXPECT_EQ(textureManager->currentMemoryUseBytes(), texturesMemorySize(maxTextures));
+
+ textureManager->unprotectTexture(tokens[1]);
+ textureManager->unprotectTexture(tokens[3]);
+ EXPECT_TRUE(requestTexture(textureManager.get(), textureManager->getToken()));
+ EXPECT_TRUE(requestTexture(textureManager.get(), textureManager->getToken()));
+ EXPECT_FALSE(requestTexture(textureManager.get(), textureManager->getToken()));
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ EXPECT_FALSE(textureManager->hasTexture(tokens[1]));
+ EXPECT_FALSE(textureManager->hasTexture(tokens[3]));
+}
+
+TEST(TextureManagerTest, reduceMemoryToLimit)
+{
+ const size_t maxTextures = 8;
+ const size_t preferredTextures = 4;
+ OwnPtr<TextureManager> textureManager = createTextureManager(maxTextures, preferredTextures);
+ TextureToken tokens[maxTextures];
+ for (size_t i = 0; i < maxTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ }
+
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ textureManager->reduceMemoryToLimit(texturesMemorySize(maxTextures));
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ textureManager->reduceMemoryToLimit(texturesMemorySize(preferredTextures));
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+
+ const size_t unprotectedTextures = preferredTextures + 1;
+ for (size_t i = 0; i < preferredTextures + 1; ++i)
+ textureManager->unprotectTexture(tokens[i]);
+
+ textureManager->reduceMemoryToLimit(texturesMemorySize(maxTextures));
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ textureManager->reduceMemoryToLimit(texturesMemorySize(preferredTextures));
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->currentMemoryUseBytes());
+ textureManager->reduceMemoryToLimit(texturesMemorySize(1));
+ EXPECT_EQ(texturesMemorySize(maxTextures - unprotectedTextures), textureManager->currentMemoryUseBytes());
+
+ // reduceMemoryToLimit doesn't change the current memory limits.
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->maxMemoryLimitBytes());
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->preferredMemoryLimitBytes());
+}
+
+TEST(TextureManagerTest, setMaxMemoryLimitBytes)
+{
+ const size_t maxTextures = 8;
+ const size_t preferredTextures = 4;
+ OwnPtr<TextureManager> textureManager = createTextureManager(maxTextures, preferredTextures);
+ TextureToken tokens[maxTextures];
+ for (size_t i = 0; i < maxTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ }
+
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+
+ const size_t unprotectedTextures = preferredTextures + 1;
+ for (size_t i = 0; i < unprotectedTextures; ++i)
+ textureManager->unprotectTexture(tokens[i]);
+
+ textureManager->setMaxMemoryLimitBytes(texturesMemorySize(maxTextures));
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ textureManager->setMaxMemoryLimitBytes(texturesMemorySize(preferredTextures));
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->currentMemoryUseBytes());
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->maxMemoryLimitBytes());
+}
+
+TEST(TextureManagerTest, setPreferredMemoryLimitBytes)
+{
+ const size_t maxTextures = 8;
+ const size_t preferredTextures = 4;
+ OwnPtr<TextureManager> textureManager = createTextureManager(maxTextures, preferredTextures);
+ TextureToken tokens[maxTextures];
+ for (size_t i = 0; i < maxTextures; ++i) {
+ tokens[i] = textureManager->getToken();
+ EXPECT_TRUE(requestTexture(textureManager.get(), tokens[i]));
+ }
+
+ const size_t unprotectedTextures = preferredTextures + 1;
+ for (size_t i = 0; i < unprotectedTextures; ++i)
+ textureManager->unprotectTexture(tokens[i]);
+
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->maxMemoryLimitBytes());
+
+ // Setting preferred memory limit only won't force reduceMemoryToLimit.
+ textureManager->setPreferredMemoryLimitBytes(texturesMemorySize(preferredTextures));
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->currentMemoryUseBytes());
+ EXPECT_EQ(texturesMemorySize(maxTextures), textureManager->maxMemoryLimitBytes());
+ EXPECT_EQ(texturesMemorySize(preferredTextures), textureManager->preferredMemoryLimitBytes());
+}
+
+} // namespace
diff --git a/Source/WebKit/efl/ChangeLog b/Source/WebKit/efl/ChangeLog
index ffe7a10cf..9247d340f 100644
--- a/Source/WebKit/efl/ChangeLog
+++ b/Source/WebKit/efl/ChangeLog
@@ -1,3 +1,57 @@
+2012-01-11 KwangHyuk Kim <hyuki.kim@samsung.com>
+
+ [EFL] Fix page rendering issue on ewk_view_tiled.
+ https://bugs.webkit.org/show_bug.cgi?id=75686
+
+ Reviewed by Andreas Kling.
+
+ As for now the discard of ewk_tiled_backing_store doesn't reset its own contents size information
+ and ewk_tiled_backing_store just ignores the request if new contents size change request would contain
+ the same size compared to the one that it owns,
+ contents size change request coming from ChromeClientEfl::contentsSizeChanged() API can be skipped
+ and therefore web page can't be presented properly.
+ In order to resolve this, I just add code to reset contents size information which ewk_tiled_backing_store owns
+ when it discards its own data.
+
+ * ewk/ewk_tiled_backing_store.cpp:
+ (ewk_tiled_backing_store_flush):
+
+2012-01-10 Tomasz Morawski <t.morawski@samsung.com>
+
+ [EFL] Added smart pointers to Ewk_View_Paint_Context class and done minor refactoring.
+ https://bugs.webkit.org/show_bug.cgi?id=75837
+
+ Reviewed by Ryosuke Niwa.
+
+ Changed graphicContext raw pointer to OwnPtr smart pointer.
+ Renamed cr to cairo and made it a RefPtr.
+
+ * ewk/ewk_view.cpp:
+ (ewk_view_paint_context_new): Adjust to auto pointers use.
+ (ewk_view_paint_context_free): Removed explicit raw pointers delete.
+ Adjust to auto pointers use:
+ (ewk_view_paint_context_save):
+ (ewk_view_paint_context_restore):
+ (ewk_view_paint_context_clip):
+ (ewk_view_paint_context_paint):
+ (ewk_view_paint_context_paint_contents):
+
+2012-01-09 Raphael Kubo da Costa <kubo@profusion.mobi>
+
+ [EFL] Add getter for Ewk_JS_Object::view.
+ https://bugs.webkit.org/show_bug.cgi?id=75868
+
+ Reviewed by Andreas Kling.
+
+ So far the view associated with a given JS object was a private
+ property only accessible to ewk itself. This does not make much sense,
+ as one often needs to know which view a certain method was invoked
+ from, for example.
+
+ * ewk/ewk_js.cpp:
+ (ewk_js_object_view_get):
+ * ewk/ewk_js.h:
+
2012-01-06 JungJik Lee <jungjik.lee@samsung.com>
[EFL] Add new pre-rendering code.
diff --git a/Source/WebKit/efl/ewk/ewk_js.cpp b/Source/WebKit/efl/ewk/ewk_js.cpp
index 6940b3b3f..3e5817b9f 100644
--- a/Source/WebKit/efl/ewk/ewk_js.cpp
+++ b/Source/WebKit/efl/ewk/ewk_js.cpp
@@ -612,6 +612,13 @@ void ewk_js_object_free(Ewk_JS_Object* jsObject)
free(jsObject);
}
+Evas_Object* ewk_js_object_view_get(const Ewk_JS_Object* jsObject)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(jsObject, 0);
+ EINA_MAGIC_CHECK_OR_RETURN(jsObject, 0);
+ return jsObject->view;
+}
+
Eina_Hash* ewk_js_object_properties_get(const Ewk_JS_Object* jsObject)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(jsObject, 0);
@@ -708,6 +715,11 @@ const char* ewk_js_object_name_get(const Ewk_JS_Object* jsObject)
return 0;
}
+Evas_Object* ewk_js_object_view_get(const Ewk_JS_Object* jsObject)
+{
+ return 0;
+}
+
void ewk_js_variant_free(Ewk_JS_Variant* jsVariant)
{
}
diff --git a/Source/WebKit/efl/ewk/ewk_js.h b/Source/WebKit/efl/ewk/ewk_js.h
index 7331da289..6279357ec 100644
--- a/Source/WebKit/efl/ewk/ewk_js.h
+++ b/Source/WebKit/efl/ewk/ewk_js.h
@@ -119,6 +119,21 @@ EAPI Eina_Hash *ewk_js_object_properties_get(const Ewk_JS_Object *obj);
EAPI const char *ewk_js_object_name_get(const Ewk_JS_Object *obj);
/**
+ * Returns the view associated with an Ewk_JS_Object.
+ *
+ * The returned view is the one passed to ewk_view_js_object_add. Right now,
+ * the object is always added to the view's main frame.
+ *
+ * @param obj The object to be queried.
+ *
+ * @return The view whose main frame the object has been inserted into, or
+ * @c NULL if the object has not been added to a view yet.
+ *
+ * @sa ewk_view_js_object_add, ewk_view_frame_main_get
+ */
+EAPI Evas_Object *ewk_js_object_view_get(const Ewk_JS_Object *obj);
+
+/**
* Release resources allocated by @a var.
*
* @param var @a Ewk_JS_Variant to be release
diff --git a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
index be0513391..094767a0c 100644
--- a/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
+++ b/Source/WebKit/efl/ewk/ewk_tiled_backing_store.cpp
@@ -1821,6 +1821,8 @@ void ewk_tiled_backing_store_flush(Evas_Object* ewkBackingStore)
priv->model.current.rows = 1;
priv->model.old.columns = 0;
priv->model.old.rows = 0;
+ priv->model.width = 0;
+ priv->model.height = 0;
priv->changed.size = true;
#ifdef DEBUG_MEM_LEAKS
diff --git a/Source/WebKit/efl/ewk/ewk_view.cpp b/Source/WebKit/efl/ewk/ewk_view.cpp
index 53a2d0a3b..8e089e130 100644
--- a/Source/WebKit/efl/ewk/ewk_view.cpp
+++ b/Source/WebKit/efl/ewk/ewk_view.cpp
@@ -2562,57 +2562,54 @@ void ewk_view_scrolls_process(Ewk_View_Smart_Data* smartData)
* to define their own backing store.
*/
struct _Ewk_View_Paint_Context {
- WebCore::GraphicsContext* graphicContext;
WebCore::FrameView* view;
- cairo_t* cr;
+ OwnPtr<WebCore::GraphicsContext> graphicContext;
+ RefPtr<cairo_t> cairo;
};
-Ewk_View_Paint_Context* ewk_view_paint_context_new(Ewk_View_Private_Data* priv, cairo_t* cr)
+Ewk_View_Paint_Context* ewk_view_paint_context_new(Ewk_View_Private_Data* priv, cairo_t* cairo)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(priv, 0);
- EINA_SAFETY_ON_NULL_RETURN_VAL(cr, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(cairo, 0);
EINA_SAFETY_ON_NULL_RETURN_VAL(priv->mainFrame, 0);
- WebCore::FrameView* view = priv->mainFrame->view();
- EINA_SAFETY_ON_NULL_RETURN_VAL(view, 0);
- Ewk_View_Paint_Context* context = static_cast<Ewk_View_Paint_Context*>(malloc(sizeof(*context)));
- EINA_SAFETY_ON_NULL_RETURN_VAL(context, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(priv->mainFrame->view(), 0);
+
+ Ewk_View_Paint_Context* context = new Ewk_View_Paint_Context;
+ context->view = priv->mainFrame->view();
+ context->graphicContext = adoptPtr(new WebCore::GraphicsContext(cairo));
+ context->cairo = adoptRef(cairo_reference(cairo));
- context->graphicContext = new WebCore::GraphicsContext(cr);
- if (!context->graphicContext) {
- free(context);
- return 0;
- }
- context->view = view;
- context->cr = cairo_reference(cr);
return context;
}
void ewk_view_paint_context_free(Ewk_View_Paint_Context* context)
{
EINA_SAFETY_ON_NULL_RETURN(context);
- delete context->graphicContext;
- cairo_destroy(context->cr);
- free(context);
+
+ delete context;
}
void ewk_view_paint_context_save(Ewk_View_Paint_Context* context)
{
EINA_SAFETY_ON_NULL_RETURN(context);
- cairo_save(context->cr);
+
+ cairo_save(context->cairo.get());
context->graphicContext->save();
}
void ewk_view_paint_context_restore(Ewk_View_Paint_Context* context)
{
EINA_SAFETY_ON_NULL_RETURN(context);
+
context->graphicContext->restore();
- cairo_restore(context->cr);
+ cairo_restore(context->cairo.get());
}
void ewk_view_paint_context_clip(Ewk_View_Paint_Context* context, const Eina_Rectangle* area)
{
EINA_SAFETY_ON_NULL_RETURN(context);
EINA_SAFETY_ON_NULL_RETURN(area);
+
context->graphicContext->clip(WebCore::IntRect(area->x, area->y, area->w, area->h));
}
@@ -2625,7 +2622,7 @@ void ewk_view_paint_context_paint(Ewk_View_Paint_Context* context, const Eina_Re
if (context->view->isTransparent())
context->graphicContext->clearRect(rect);
- context->view->paint(context->graphicContext, rect);
+ context->view->paint(context->graphicContext.get(), rect);
}
void ewk_view_paint_context_paint_contents(Ewk_View_Paint_Context* context, const Eina_Rectangle* area)
@@ -2638,7 +2635,7 @@ void ewk_view_paint_context_paint_contents(Ewk_View_Paint_Context* context, cons
if (context->view->isTransparent())
context->graphicContext->clearRect(rect);
- context->view->paintContents(context->graphicContext, rect);
+ context->view->paintContents(context->graphicContext.get(), rect);
}
void ewk_view_paint_context_scale(Ewk_View_Paint_Context* context, float scaleX, float scaleY)
diff --git a/Source/WebKit/gtk/ChangeLog b/Source/WebKit/gtk/ChangeLog
index fcd3ec6ea..2c50a1bac 100644
--- a/Source/WebKit/gtk/ChangeLog
+++ b/Source/WebKit/gtk/ChangeLog
@@ -1,3 +1,35 @@
+2012-01-10 Mario Sanchez Prada <msanchez@igalia.com>
+
+ AX: support helpText() in DumpRenderTree
+ https://bugs.webkit.org/show_bug.cgi?id=40193
+
+ Reviewed by Chris Fleizach.
+
+ Add support for retrieving WebCore's AccessibilityObject's
+ helpText from the GTK DumpRenderTree.
+
+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
+ (DumpRenderTreeSupportGtk::accessibilityHelpText): Returns result
+ of calling to helpText() over the core accessibility object's.
+ * WebCoreSupport/DumpRenderTreeSupportGtk.h:
+
+2012-01-09 Mario Sanchez Prada <msanchez@igalia.com>
+
+ [Gtk] Regression: text-inserted events lack text inserted and current line
+ https://bugs.webkit.org/show_bug.cgi?id=72830
+
+ Reviewed by Martin Robinson.
+
+ Updated unit tests to check that both getting the current position
+ for the caret and the exposed text at, before or after a given
+ offset for an accessible object works as expected.
+
+ * tests/testatk.c:
+ (runGetTextTests): For objects implementing AtkEditableText, try
+ to change the exposed text and retrieve it again as a full line.
+ (testWebkitAtkCaretOffsets): For a text control (a text entry),
+ set the caret offset to a value greater than 1 and retrieve it.
+
2012-01-05 Martin Robinson <mrobinson@igalia.com>
[GTK] [AC] Introduce AcceleratedCompositingContext to isolate different accelerated compositing implementations
diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
index ff7dc1a39..19fc6fb6d 100644
--- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
+++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp
@@ -24,6 +24,7 @@
#include "APICast.h"
#include "AXObjectCache.h"
+#include "AccessibilityObject.h"
#include "AccessibilityObjectWrapperAtk.h"
#include "AnimationController.h"
#include "DOMWrapperWorld.h"
@@ -780,6 +781,18 @@ void DumpRenderTreeSupportGtk::decrementAccessibilityValue(AtkObject* axObject)
modifyAccessibilityValue(axObject, false);
}
+CString DumpRenderTreeSupportGtk::accessibilityHelpText(AtkObject* axObject)
+{
+ if (!axObject || !WEBKIT_IS_ACCESSIBLE(axObject))
+ return CString();
+
+ AccessibilityObject* coreObject = webkit_accessible_get_accessibility_object(WEBKIT_ACCESSIBLE(axObject));
+ if (!coreObject)
+ return CString();
+
+ return coreObject->helpText().utf8();
+}
+
void DumpRenderTreeSupportGtk::setAutofilled(JSContextRef context, JSValueRef nodeObject, bool autofilled)
{
JSC::ExecState* exec = toJS(context);
diff --git a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
index 9309a92fe..06d30070a 100644
--- a/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
+++ b/Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.h
@@ -101,6 +101,7 @@ public:
// Accessibility
static void incrementAccessibilityValue(AtkObject*);
static void decrementAccessibilityValue(AtkObject*);
+ static WTF::CString accessibilityHelpText(AtkObject*);
// TextInputController
static void setComposition(WebKitWebView*, const char*, int start, int length);
diff --git a/Source/WebKit/gtk/tests/testatk.c b/Source/WebKit/gtk/tests/testatk.c
index b46a242d1..e852deeed 100644
--- a/Source/WebKit/gtk/tests/testatk.c
+++ b/Source/WebKit/gtk/tests/testatk.c
@@ -63,7 +63,7 @@ static const char* linksWithInlineImages = "<html><head><style>a.http:before {co
static const char* listsOfItems = "<html><body><ul><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ul><ol><li>text only</li><li><a href='foo'>link only</a></li><li>text and a <a href='bar'>link</a></li></ol></body></html>";
-static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li></ol><select><option selected value='foo'>An option in a combo box</option></select></body></html>";
+static const char* textForCaretBrowsing = "<html><body><h1>A text header</h1><p>A paragraph <a href='http://foo.bar.baz/'>with a link</a> in the middle</p><ol><li>A list item</li></ol><select><option selected value='foo'>An option in a combo box</option></select><input type='text'' name='foo'' value='foo bar baz' /></body></html>";
static const char* textForSelections = "<html><body><p>A paragraph with plain text</p><p>A paragraph with <a href='http://webkit.org'>a link</a> in the middle</p><ol><li>A list item</li></ol><select></body></html>";
@@ -234,7 +234,7 @@ static void runGetTextTests(AtkText* textObject)
testGetTextFunction(textObject, atk_text_get_text_before_offset, ATK_TEXT_BOUNDARY_SENTENCE_END,
44, " This is the second sentence.", 15, 44);
- /* It's trick to test these properly right now, since our a11y
+ /* It's tricky to test these properly right now, since our a11y
implementation splits different lines in different a11y items. */
/* ATK_TEXT_BOUNDARY_LINE_START */
testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START,
@@ -243,6 +243,15 @@ static void runGetTextTests(AtkText* textObject)
/* ATK_TEXT_BOUNDARY_LINE_END */
testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END,
0, "This is a test. This is the second sentence. And this the third.", 0, 64);
+
+ /* For objects implementing AtkEditableText, try to change the
+ exposed text and retrieve it again as a full line.
+ (see https://bugs.webkit.org/show_bug.cgi?id=72830) */
+ if (ATK_IS_EDITABLE_TEXT(textObject)) {
+ atk_editable_text_set_text_contents(ATK_EDITABLE_TEXT(textObject), "foo bar baz");
+ testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_START, 0, "foo bar baz", 0, 11);
+ testGetTextFunction(textObject, atk_text_get_text_at_offset, ATK_TEXT_BOUNDARY_LINE_END, 0, "foo bar baz", 0, 11);
+ }
}
static void testWebkitAtkCaretOffsets()
@@ -334,6 +343,18 @@ static void testWebkitAtkCaretOffsets()
result = atk_text_set_caret_offset(ATK_TEXT(comboBoxOption), 1);
g_assert_cmpint(result, ==, FALSE);
+ AtkObject* textEntry = atk_object_ref_accessible_child(panel, 1);
+ g_assert(ATK_IS_OBJECT(textEntry));
+ g_assert(atk_object_get_role(textEntry) == ATK_ROLE_ENTRY);
+ g_assert(ATK_IS_TEXT(textEntry));
+ text = atk_text_get_text(ATK_TEXT(textEntry), 0, -1);
+ g_assert_cmpstr(text, ==, "foo bar baz");
+
+ result = atk_text_set_caret_offset(ATK_TEXT(textEntry), 5);
+ g_assert_cmpint(result, ==, TRUE);
+ offset = atk_text_get_caret_offset(ATK_TEXT(textEntry));
+ g_assert_cmpint(offset, ==, 5);
+
g_object_unref(header);
g_object_unref(paragraph);
g_object_unref(list);
@@ -342,6 +363,7 @@ static void testWebkitAtkCaretOffsets()
g_object_unref(comboBox);
g_object_unref(menuPopup);
g_object_unref(comboBoxOption);
+ g_object_unref(textEntry);
g_object_unref(webView);
}
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index 7f63b196e..c5e65fa52 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,64 @@
+2012-01-10 Dan Bernstein <mitz@apple.com>
+
+ Made -[WebHistoryItem copyWithZone:] allocate an object of the same class as the receiver.
+
+ Reviewed by Mark Rowe.
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem copyWithZone:]):
+
+2012-01-10 Chris Marrin <cmarrin@apple.com>
+
+ Wrapped allowedCompositingTriggers in ACCELERATED_COMPOSITING ifdef to make non-accelerated builds work
+
+ Unreviewed.
+
+ * WebCoreSupport/WebChromeClient.h:
+
+2012-01-10 Chris Marrin <cmarrin@apple.com>
+
+ Turn off the FilterTrigger in WebKit and WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=75914
+
+ Reviewed by Simon Fraser.
+
+ Implement allowedCompositingTriggers to turn on all compositing triggers except FilterTrigger.
+
+ * WebCoreSupport/WebChromeClient.h:
+ (WebChromeClient::allowedCompositingTriggers):
+
+2012-01-10 Dan Bernstein <mitz@apple.com>
+
+ Change -[WebHistoryItem copyWithZone:] to not use NSCopyObject()
+ https://bugs.webkit.org/show_bug.cgi?id=75980
+
+ Reviewed by Mark Rowe.
+
+ * History/WebHistoryItem.mm:
+ (-[WebHistoryItem copyWithZone:]): Replaced NSCopyObject() with
+ -alloc, -initWithWebCoreHistoryItem:.
+
+2012-01-06 Simon Fraser <simon.fraser@apple.com>
+
+ Mitigate scrollbar differences when running pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=67217
+
+ Reviewed by Dan Bernstein.
+
+ Make it possible to register a custom NSScroller class, which
+ the WebDynamicScrollBarsView will use when mock scrollbars are enabled.
+
+ Also ensure that the WebPreferences mock scrollbars preference is
+ migrated into Settings.
+
+ * WebView/WebDynamicScrollBarsView.h:
+ * WebView/WebDynamicScrollBarsView.mm:
+ (+[WebDynamicScrollBarsView _horizontalScrollerClass]):
+ (+[WebDynamicScrollBarsView _verticalScrollerClass]):
+ (+[WebDynamicScrollBarsView setCustomScrollerClass:]):
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChanged:]):
+
2012-01-05 Dan Bernstein <mitz@apple.com>
<rdar://problem/10633760> Update copyright strings
diff --git a/Source/WebKit/mac/History/WebHistoryItem.mm b/Source/WebKit/mac/History/WebHistoryItem.mm
index eef4346cd..653b1afae 100644
--- a/Source/WebKit/mac/History/WebHistoryItem.mm
+++ b/Source/WebKit/mac/History/WebHistoryItem.mm
@@ -141,11 +141,9 @@ void WKNotifyHistoryItemChanged(HistoryItem*)
- (id)copyWithZone:(NSZone *)zone
{
WebCoreThreadViolationCheckRoundOne();
- WebHistoryItem *copy = (WebHistoryItem *)NSCopyObject(self, 0, zone);
- RefPtr<HistoryItem> item = core(_private)->copy();
- copy->_private = kitPrivate(item.get());
- historyItemWrappers().set(item.release().leakRef(), copy);
-
+ WebHistoryItem *copy = [[[self class] alloc] initWithWebCoreHistoryItem:core(_private)->copy()];
+ historyItemWrappers().set(core(copy->_private), copy);
+
return copy;
}
diff --git a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
index 8961ba4fc..ce97ab042 100644
--- a/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
@@ -148,6 +148,16 @@ public:
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) OVERRIDE;
virtual void setNeedsOneShotDrawingSynchronization() OVERRIDE;
virtual void scheduleCompositingLayerSync() OVERRIDE;
+
+ virtual CompositingTriggerFlags allowedCompositingTriggers() const
+ {
+ return static_cast<CompositingTriggerFlags>(
+ ThreeDTransformTrigger |
+ VideoTrigger |
+ PluginTrigger|
+ CanvasTrigger |
+ AnimationTrigger);
+ }
#endif
#if ENABLE(VIDEO)
diff --git a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.h b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.h
index c289a0414..30b4daa0a 100644
--- a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.h
+++ b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.h
@@ -42,6 +42,9 @@ struct WebDynamicScrollBarsViewPrivate;
#endif
}
+// For use by DumpRenderTree only.
++ (void)setCustomScrollerClass:(Class)scrollerClass;
+
// This was originally added for Safari's benefit, but Safari has not used it for a long time.
// Perhaps it can be removed.
- (void)setAllowsHorizontalScrolling:(BOOL)flag;
diff --git a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
index 71ef492bf..801109473 100644
--- a/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
+++ b/Source/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
@@ -43,6 +43,11 @@ const int WebCoreScrollbarAlwaysOn = ScrollbarAlwaysOn;
COMPILE_ASSERT(sizeof(WebDynamicScrollBarsView) == 0x8c, WebDynamicScrollBarsView_is_expected_size);
#endif
+@interface NSScrollView(WebNSScrollViewDetails)
++ (Class)_horizontalScrollerClass;
++ (Class)_verticalScrollerClass;
+@end
+
struct WebDynamicScrollBarsViewPrivate {
unsigned inUpdateScrollersLayoutPass;
@@ -77,6 +82,29 @@ struct WebDynamicScrollBarsViewPrivate {
@implementation WebDynamicScrollBarsView
+static Class customScrollerClass;
+
++ (Class)_horizontalScrollerClass
+{
+ if (Settings::mockScrollbarsEnabled() && customScrollerClass)
+ return customScrollerClass;
+
+ return [super _horizontalScrollerClass];
+}
+
++ (Class)_verticalScrollerClass
+{
+ if (Settings::mockScrollbarsEnabled() && customScrollerClass)
+ return customScrollerClass;
+
+ return [super _horizontalScrollerClass];
+}
+
++ (void)setCustomScrollerClass:(Class)scrollerClass
+{
+ customScrollerClass = scrollerClass;
+}
+
- (id)initWithFrame:(NSRect)frame
{
if (!(self = [super initWithFrame:frame]))
diff --git a/Source/WebKit/mac/WebView/WebView.mm b/Source/WebKit/mac/WebView/WebView.mm
index 51a5b219a..7ded2aa70 100644
--- a/Source/WebKit/mac/WebView/WebView.mm
+++ b/Source/WebKit/mac/WebView/WebView.mm
@@ -1497,6 +1497,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
settings->setMediaPlaybackAllowsInline([preferences mediaPlaybackAllowsInline]);
settings->setSuppressIncrementalRendering([preferences suppressIncrementalRendering]);
settings->setBackspaceKeyNavigationEnabled([preferences backspaceKeyNavigationEnabled]);
+ settings->setMockScrollbarsEnabled([preferences mockScrollbarsEnabled]);
#if ENABLE(VIDEO_TRACK)
settings->setShouldDisplaySubtitles([preferences shouldDisplaySubtitles]);
diff --git a/Source/WebKit/qt/Api/qhttpheader.cpp b/Source/WebKit/qt/Api/qhttpheader.cpp
new file mode 100644
index 000000000..aaabb1849
--- /dev/null
+++ b/Source/WebKit/qt/Api/qhttpheader.cpp
@@ -0,0 +1,273 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ These were part of the QtNetwork module of the Qt Toolkit.
+
+ 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 "qhttpheader_p.h"
+
+using namespace WebKit;
+
+static QString contentLengthString = QLatin1String("content-length");
+static QString contentTypeString = QLatin1String("content-type");
+
+QHttpHeader::QHttpHeader()
+{
+ setValid(true);
+}
+
+QHttpHeader::QHttpHeader(const QString& str)
+{
+ setValid(true);
+ parse(str);
+}
+
+QHttpHeader::~QHttpHeader()
+{
+}
+
+bool QHttpHeader::parse(const QString& str)
+{
+ QStringList lst;
+ int pos = str.indexOf(QLatin1Char('\n'));
+ if (pos > 0 && str.at(pos - 1) == QLatin1Char('\r'))
+ lst = str.trimmed().split(QLatin1String("\r\n"));
+ else
+ lst = str.trimmed().split(QLatin1String("\n"));
+ lst.removeAll(QString());
+
+ if (lst.isEmpty())
+ return true;
+
+ QStringList lines;
+ QStringList::Iterator it = lst.begin();
+ for (; it != lst.end(); ++it) {
+ if (!(*it).isEmpty()) {
+ if ((*it)[0].isSpace()) {
+ if (!lines.isEmpty()) {
+ lines.last() += QLatin1Char(' ');
+ lines.last() += (*it).trimmed();
+ }
+ } else
+ lines.append((*it));
+ }
+ }
+
+ int number = 0;
+ for (it = lines.begin(); it != lines.end(); ++it) {
+ if (!parseLine(*it, number++)) {
+ setValid(false);
+ return false;
+ }
+ }
+ return true;
+}
+
+QString QHttpHeader::value(const QString& key) const
+{
+ QString lowercaseKey = key.toLower();
+ QList<QPair<QString, QString> >::ConstIterator it = m_values.constBegin();
+ while (it != m_values.constEnd()) {
+ if ((*it).first.toLower() == lowercaseKey)
+ return (*it).second;
+ ++it;
+ }
+ return QString();
+}
+
+bool QHttpHeader::hasKey(const QString& key) const
+{
+ QString lowercaseKey = key.toLower();
+ QList<QPair<QString, QString> >::ConstIterator it = m_values.constBegin();
+ while (it != m_values.constEnd()) {
+ if ((*it).first.toLower() == lowercaseKey)
+ return true;
+ ++it;
+ }
+ return false;
+}
+
+void QHttpHeader::setValue(const QString& key, const QString& value)
+{
+ QString lowercaseKey = key.toLower();
+ QList<QPair<QString, QString> >::Iterator it = m_values.begin();
+ while (it != m_values.end()) {
+ if ((*it).first.toLower() == lowercaseKey) {
+ (*it).second = value;
+ return;
+ }
+ ++it;
+ }
+ addValue(key, value);
+}
+
+void QHttpHeader::addValue(const QString& key, const QString& value)
+{
+ m_values.append(qMakePair(key, value));
+}
+
+bool QHttpHeader::parseLine(const QString& line, int)
+{
+ int i = line.indexOf(QLatin1Char(':'));
+ if (i == -1)
+ return false;
+
+ addValue(line.left(i).trimmed(), line.mid(i + 1).trimmed());
+ return true;
+}
+
+QString QHttpHeader::toString() const
+{
+ if (!isValid())
+ return QLatin1String("");
+
+ QString ret = QLatin1String("");
+
+ QList<QPair<QString, QString> >::ConstIterator it = m_values.constBegin();
+ while (it != m_values.constEnd()) {
+ ret += (*it).first + QLatin1String(": ") + (*it).second + QLatin1String("\r\n");
+ ++it;
+ }
+ return ret;
+}
+
+bool QHttpHeader::hasContentLength() const
+{
+ return hasKey(contentLengthString);
+}
+
+uint QHttpHeader::contentLength() const
+{
+ return value(contentLengthString).toUInt();
+}
+
+void QHttpHeader::setContentLength(int len)
+{
+ setValue(contentLengthString, QString::number(len));
+}
+
+bool QHttpHeader::hasContentType() const
+{
+ return hasKey(contentTypeString);
+}
+
+QString QHttpHeader::contentType() const
+{
+ QString type = value(contentTypeString);
+ if (type.isEmpty())
+ return QString();
+
+ int pos = type.indexOf(QLatin1Char(';'));
+ if (pos == -1)
+ return type;
+
+ return type.left(pos).trimmed();
+}
+
+void QHttpHeader::setContentType(const QString &type)
+{
+ setValue(contentTypeString, type);
+}
+
+QHttpResponseHeader::QHttpResponseHeader(int code, const QString &text, int majorVer, int minorVer)
+ : QHttpHeader()
+ , m_statusCode(code)
+ , m_reasonPhrase(text)
+ , m_majorVersion(majorVer)
+ , m_minorVersion(minorVer)
+{
+}
+
+bool QHttpResponseHeader::parseLine(const QString& line, int number)
+{
+ if (number)
+ return QHttpHeader::parseLine(line, number);
+
+ QString l = line.simplified();
+ if (l.length() < 10)
+ return false;
+
+ if (l.left(5) == QLatin1String("HTTP/") && l[5].isDigit() && l[6] == QLatin1Char('.')
+ && l[7].isDigit() && l[8] == QLatin1Char(' ') && l[9].isDigit()) {
+ m_majorVersion = l[5].toLatin1() - '0';
+ m_minorVersion = l[7].toLatin1() - '0';
+
+ int pos = l.indexOf(QLatin1Char(' '), 9);
+ if (pos != -1) {
+ m_reasonPhrase = l.mid(pos + 1);
+ m_statusCode = l.mid(9, pos - 9).toInt();
+ } else {
+ m_statusCode = l.mid(9).toInt();
+ m_reasonPhrase.clear();
+ }
+ } else
+ return false;
+
+ return true;
+}
+
+QString QHttpResponseHeader::toString() const
+{
+ static QString ret(QLatin1String("HTTP/%1.%2 %3 %4\r\n%5\r\n"));
+ return ret.arg(m_majorVersion).arg(m_minorVersion).arg(m_statusCode).arg(m_reasonPhrase).arg(QHttpHeader::toString());
+}
+
+QHttpRequestHeader::QHttpRequestHeader()
+ : QHttpHeader()
+{
+ setValid(false);
+}
+
+QHttpRequestHeader::QHttpRequestHeader(const QString& str)
+{
+ parse(str);
+}
+
+bool QHttpRequestHeader::parseLine(const QString& line, int number)
+{
+ if (number)
+ return QHttpHeader::parseLine(line, number);
+
+ QStringList lst = line.simplified().split(QLatin1String(" "));
+ if (lst.count() > 0) {
+ m_method = lst[0];
+ if (lst.count() > 1) {
+ m_path = lst[1];
+ if (lst.count() > 2) {
+ QString v = lst[2];
+ if (v.length() >= 8 && v.left(5) == QLatin1String("HTTP/")
+ && v[5].isDigit() && v[6] == QLatin1Char('.') && v[7].isDigit()) {
+ m_majorVersion = v[5].toLatin1() - '0';
+ m_minorVersion = v[7].toLatin1() - '0';
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+QString QHttpRequestHeader::toString() const
+{
+ static QString first(QLatin1String("%1 %2"));
+ static QString last(QLatin1String(" HTTP/%3.%4\r\n%5\r\n"));
+ return first.arg(m_method).arg(m_path) + last.arg(m_majorVersion).arg(m_minorVersion).arg(QHttpHeader::toString());
+}
+
diff --git a/Source/WebKit/qt/Api/qhttpheader_p.h b/Source/WebKit/qt/Api/qhttpheader_p.h
new file mode 100644
index 000000000..0682952fd
--- /dev/null
+++ b/Source/WebKit/qt/Api/qhttpheader_p.h
@@ -0,0 +1,112 @@
+/*
+ Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
+
+ These were part of the QtNetwork module of the Qt Toolkit.
+
+ 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 qhttpheader_p_h
+#define qhttpheader_p_h
+
+#include <QPair>
+#include <QString>
+#include <QStringList>
+
+namespace WebKit {
+
+class QHttpHeader {
+public:
+ QHttpHeader();
+ QHttpHeader(const QString&);
+ virtual ~QHttpHeader();
+
+ void setValue(const QString& key, const QString& value);
+ void addValue(const QString& key, const QString& value);
+ QString value(const QString& key) const;
+ bool hasKey(const QString&) const;
+
+ // ### Qt 5: change to qint64
+ bool hasContentLength() const;
+ uint contentLength() const;
+ void setContentLength(int);
+
+ bool hasContentType() const;
+ QString contentType() const;
+ void setContentType(const QString&);
+
+ virtual QString toString() const;
+ bool isValid() const { return m_valid; }
+
+ virtual int majorVersion() const = 0;
+ virtual int minorVersion() const = 0;
+
+protected:
+ virtual bool parseLine(const QString& line, int number);
+ bool parse(const QString&);
+ void setValid(bool v) { m_valid = v; }
+
+private:
+ bool m_valid;
+ QList<QPair<QString, QString> > m_values;
+};
+
+class QHttpResponseHeader : public QHttpHeader {
+public:
+ QHttpResponseHeader(int code, const QString& text = QString(), int majorVer = 1, int minorVer = 1);
+
+ int statusCode() const { return m_statusCode; }
+ QString reasonPhrase() const {return m_reasonPhrase; }
+ int majorVersion() const { return m_majorVersion; }
+ int minorVersion() const { return m_minorVersion; }
+
+ QString toString() const;
+
+protected:
+ bool parseLine(const QString& line, int number);
+
+private:
+ int m_statusCode;
+ QString m_reasonPhrase;
+ int m_majorVersion;
+ int m_minorVersion;
+};
+
+class QHttpRequestHeader : public QHttpHeader {
+public:
+ QHttpRequestHeader();
+ QHttpRequestHeader(const QString&);
+
+ QString method() const { return m_method; }
+ QString path() const { return m_path; }
+ int majorVersion() const { return m_majorVersion; }
+ int minorVersion() const { return m_minorVersion; }
+
+ QString toString() const;
+
+protected:
+ bool parseLine(const QString& line, int number);
+
+private:
+ QString m_method;
+ QString m_path;
+ int m_majorVersion;
+ int m_minorVersion;
+};
+
+}
+
+#endif
diff --git a/Source/WebKit/qt/Api/qwebpage.cpp b/Source/WebKit/qt/Api/qwebpage.cpp
index 78de8126e..91de6f53c 100644
--- a/Source/WebKit/qt/Api/qwebpage.cpp
+++ b/Source/WebKit/qt/Api/qwebpage.cpp
@@ -125,7 +125,6 @@
#include <QDragMoveEvent>
#include <QDropEvent>
#include <QFileDialog>
-#include <QHttpRequestHeader>
#include <QInputDialog>
#include <QMessageBox>
#include <QNetworkProxy>
diff --git a/Source/WebKit/qt/ChangeLog b/Source/WebKit/qt/ChangeLog
index 09da8ab79..95f374866 100644
--- a/Source/WebKit/qt/ChangeLog
+++ b/Source/WebKit/qt/ChangeLog
@@ -1,3 +1,119 @@
+2012-01-11 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed trivial build fix: Removed unnecessary QHttpRequestHeader
+ inclusion (and the file is removed in newer Qt 5 versions).
+
+ * Api/qwebpage.cpp:
+
+2012-01-11 Rafael Brandao <rafael.lobo@openbossa.org>
+
+ [Qt][WK2] Fix the build for newer Qt5
+ https://bugs.webkit.org/show_bug.cgi?id=75964
+
+ Reviewed by Simon Hausmann.
+
+ Added QHttpHeader, QHttpResponseHeader and QHttpRequestHeader
+ that were removed from Qt. They are now kept under a private header
+ and only the relevant code is present.
+
+ * Api/qhttpheader.cpp: Added.
+ (QHttpHeader::QHttpHeader):
+ (QHttpHeader::~QHttpHeader):
+ (QHttpHeader::parse):
+ (QHttpHeader::value):
+ (QHttpHeader::hasKey):
+ (QHttpHeader::setValue):
+ (QHttpHeader::addValue):
+ (QHttpHeader::parseLine):
+ (QHttpHeader::toString):
+ (QHttpHeader::hasContentLength):
+ (QHttpHeader::contentLength):
+ (QHttpHeader::setContentLength):
+ (QHttpHeader::hasContentType):
+ (QHttpHeader::contentType):
+ (QHttpHeader::setContentType):
+ (QHttpResponseHeader::QHttpResponseHeader):
+ (QHttpResponseHeader::parseLine):
+ (QHttpResponseHeader::toString):
+ (QHttpRequestHeader::QHttpRequestHeader):
+ (QHttpRequestHeader::parseLine):
+ (QHttpRequestHeader::toString):
+ * Api/qhttpheader_p.h: Added.
+ (QHttpHeader::isValid):
+ (QHttpHeader::setValid):
+ (QHttpResponseHeader::statusCode):
+ (QHttpResponseHeader::reasonPhrase):
+ (QHttpResponseHeader::majorVersion):
+ (QHttpResponseHeader::minorVersion):
+ (QHttpRequestHeader::method):
+ (QHttpRequestHeader::path):
+ (QHttpRequestHeader::majorVersion):
+ (QHttpRequestHeader::minorVersion):
+ * WebCoreSupport/InspectorServerQt.cpp:
+
+2012-01-10 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Enable CSS_FILTERS in Qt build
+ https://bugs.webkit.org/show_bug.cgi?id=75777
+
+ For now, disallow compositing for filters. We will change that trigger when
+ https://bugs.webkit.org/show_bug.cgi?id=75778 is implemented.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::allowedCompositingTriggers):
+
+2012-01-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104421.
+ http://trac.webkit.org/changeset/104421
+ https://bugs.webkit.org/show_bug.cgi?id=75816
+
+ Need to rebaseline some tests on Linux (Requested by noamr on
+ #webkit).
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::allowedCompositingTriggers):
+
+2012-01-08 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Enable CSS_FILTERS in Qt build
+ https://bugs.webkit.org/show_bug.cgi?id=75777
+
+ For now, disallow compositing for filters. We will change that trigger when
+ https://bugs.webkit.org/show_bug.cgi?id=75778 is implemented.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::allowedCompositingTriggers):
+
+2012-01-08 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r104403.
+ http://trac.webkit.org/changeset/104403
+ https://bugs.webkit.org/show_bug.cgi?id=75803
+
+ It broke all tests on Qt5 (Requested by Ossy_weekend on
+ #webkit).
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::allowedCompositingTriggers):
+
+2012-01-08 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ [Qt] Enable CSS_FILTERS in Qt build
+ https://bugs.webkit.org/show_bug.cgi?id=75777
+
+ For now, disallow compositing for filters. We will change that trigger when
+ https://bugs.webkit.org/show_bug.cgi?id=75778 is implemented.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::allowedCompositingTriggers):
+
2012-01-05 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r104231.
diff --git a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index eed89dc30..f129b5871 100644
--- a/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -630,7 +630,7 @@ void ChromeClientQt::scheduleCompositingLayerSync()
ChromeClient::CompositingTriggerFlags ChromeClientQt::allowedCompositingTriggers() const
{
if (platformPageClient() && platformPageClient()->allowsAcceleratedCompositing())
- return AllTriggers;
+ return ThreeDTransformTrigger | VideoTrigger | CanvasTrigger | AnimationTrigger;
return 0;
}
diff --git a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
index f502f01a5..fdc14f533 100644
--- a/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/InspectorServerQt.cpp
@@ -24,12 +24,10 @@
#include "InspectorController.h"
#include "MD5.h"
#include "Page.h"
+#include "qhttpheader_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include <QFile>
-#include <QHttpHeader>
-#include <QHttpRequestHeader>
-#include <QHttpResponseHeader>
#include <QString>
#include <QStringList>
#include <QTcpServer>
@@ -176,7 +174,7 @@ InspectorServerRequestHandlerQt::~InspectorServerRequestHandlerQt()
void InspectorServerRequestHandlerQt::tcpReadyRead()
{
- QHttpRequestHeader header;
+ WebKit::QHttpRequestHeader header;
bool isWebSocket = false;
if (!m_tcpConnection)
return;
@@ -189,7 +187,7 @@ void InspectorServerRequestHandlerQt::tcpReadyRead()
m_endOfHeaders = true;
}
if (m_endOfHeaders) {
- header = QHttpRequestHeader(QString::fromLatin1(m_data));
+ header = WebKit::QHttpRequestHeader(QString::fromLatin1(m_data));
if (header.isValid()) {
m_path = header.path();
m_contentType = header.contentType().toLatin1();
@@ -222,7 +220,7 @@ void InspectorServerRequestHandlerQt::tcpReadyRead()
generateWebSocketChallengeResponse(number1, number2, (unsigned char*)key3.data(), (unsigned char*)responseData);
QByteArray response(responseData, sizeof(responseData));
- QHttpResponseHeader responseHeader(101, QLatin1String("WebSocket Protocol Handshake"), 1, 1);
+ WebKit::QHttpResponseHeader responseHeader(101, QLatin1String("WebSocket Protocol Handshake"), 1, 1);
responseHeader.setValue(QLatin1String("Upgrade"), header.value(QLatin1String("Upgrade")));
responseHeader.setValue(QLatin1String("Connection"), header.value(QLatin1String("Connection")));
responseHeader.setValue(QLatin1String("Sec-WebSocket-Origin"), header.value(QLatin1String("Origin")));
@@ -284,7 +282,7 @@ void InspectorServerRequestHandlerQt::tcpReadyRead()
}
}
- QHttpResponseHeader responseHeader(code, text, 1, 0);
+ WebKit::QHttpResponseHeader responseHeader(code, text, 1, 0);
responseHeader.setContentLength(response.size());
if (!m_contentType.isEmpty())
responseHeader.setContentType(QString::fromLatin1(m_contentType));
diff --git a/Source/WebKit/win/ChangeLog b/Source/WebKit/win/ChangeLog
index f7d6b5f64..384faa5d0 100644
--- a/Source/WebKit/win/ChangeLog
+++ b/Source/WebKit/win/ChangeLog
@@ -1,3 +1,17 @@
+2012-01-07 Andreas Kling <awesomekling@apple.com>
+
+ Windows build fix.
+
+ * DOMHTMLClasses.cpp:
+ (DOMHTMLDocument::forms):
+ (DOMHTMLSelectElement::options):
+
+2012-01-06 Jessie Berlin <jberlin@apple.com>
+
+ Windows build fix.
+
+ * Interfaces/IWebViewPrivate.idl:
+
2012-01-05 Adam Roben <aroben@apple.com>
Add WebKitTestRunnerLauncher to WebKit.sln.
diff --git a/Source/WebKit/win/DOMHTMLClasses.cpp b/Source/WebKit/win/DOMHTMLClasses.cpp
index 6b29fa93f..5f156b7a5 100644
--- a/Source/WebKit/win/DOMHTMLClasses.cpp
+++ b/Source/WebKit/win/DOMHTMLClasses.cpp
@@ -305,7 +305,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLDocument::forms(
return E_FAIL;
HTMLDocument* htmlDoc = static_cast<HTMLDocument*>(m_document);
- *collection = DOMHTMLCollection::createInstance(htmlDoc->forms().get());
+ *collection = DOMHTMLCollection::createInstance(htmlDoc->forms());
return S_OK;
}
@@ -709,7 +709,7 @@ HRESULT STDMETHODCALLTYPE DOMHTMLSelectElement::options(
if (!selectElement->options())
return E_FAIL;
- *result = DOMHTMLOptionsCollection::createInstance(selectElement->options().get());
+ *result = DOMHTMLOptionsCollection::createInstance(selectElement->options());
return S_OK;
}
diff --git a/Source/WebKit/win/Interfaces/IWebViewPrivate.idl b/Source/WebKit/win/Interfaces/IWebViewPrivate.idl
index 46bd4197f..b4619494f 100644
--- a/Source/WebKit/win/Interfaces/IWebViewPrivate.idl
+++ b/Source/WebKit/win/Interfaces/IWebViewPrivate.idl
@@ -274,4 +274,7 @@ interface IWebViewPrivate : IUnknown
HRESULT setUsesLayeredWindow([in] BOOL usesLayeredWindow);
HRESULT usesLayeredWindow([out, retval] BOOL* usesLayeredWindow);
+
+ HRESULT registerURLSchemeAsAllowingLocalStorageAccessInPrivateBrowsing([in] BSTR scheme);
+ HRESULT registerURLSchemeAsAllowingDatabaseAccessInPrivateBrowsing([in] BSTR scheme);
}
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index bc6f54d50..064d7ff76 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,630 @@
+2012-01-10 Mark Rowe <mrowe@apple.com>
+
+ REGRESSION (r104377): All pages print blank on Snow Leopard
+ <http://webkit.org/b/75879> / <rdar://problem/10674335>
+
+ We need to explicitly load PDFKit.framework before using PDFDocument and friends.
+ On SnowLeopard the framework is not necessarily loaded by anything else before we
+ print, which would lead to us failing to allocate the PDFDocument that we use for
+ drawing the content from the web process.
+
+ Reviewed by Dan Bernstein.
+
+ * UIProcess/API/mac/WKPrintingView.mm:
+ (pdfKitFrameworkPath): Construct the path to the PDFKit framework.
+ (classFromPDFKit): Ensure that the PDFKit framework is loaded, and then retrieve the
+ given class from it.
+ (pdfAnnotationLinkClass): ASSERT that we found the class.
+ (pdfDocumentClass): Ditto.
+
+2012-01-10 Chris Marrin <cmarrin@apple.com>
+
+ Wrapped allowedCompositingTriggers in ACCELERATED_COMPOSITING ifdef to make non-accelerated builds work
+
+ Unreviewed.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+
+2012-01-10 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ [Qt][WK2]REGRESSION(r102435): It made tst_QQuickWebView::show() crash
+ https://bugs.webkit.org/show_bug.cgi?id=74176
+
+ Reviewed by Noam Rosenthal.
+
+ Check texture mapper exists already in ensureRootLayer to avoid recrecation.
+ Check if root layer was deleted already in purgeGLResources.
+ Added multipleWebViewWindows and multipleWebViews API tests.
+
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ (tst_QQuickWebView::multipleWebViewWindows):
+ (tst_QQuickWebView::multipleWebViews):
+ * UIProcess/qt/LayerTreeHostProxyQt.cpp:
+ (WebKit::LayerTreeHostProxy::ensureRootLayer):
+ (WebKit::LayerTreeHostProxy::purgeGLResources):
+
+2012-01-10 Ryosuke Niwa <rniwa@webkit.org>
+
+ Snow Leopard build fix.
+
+ * UIProcess/API/mac/PageClientImpl.h:
+ * UIProcess/API/mac/PageClientImpl.mm:
+
+2012-01-10 Anders Carlsson <andersca@apple.com>
+
+ Hang opening movie that requires authentication
+ https://bugs.webkit.org/show_bug.cgi?id=75989
+
+ Reviewed by Sam Weinig.
+
+ Change the way the keychain calls are processed to avoid deadlocks:
+
+ 1. When a keychain call is made, the web process sends an asynchronous request message to the UI process,
+ avoiding the need to bounce calls to the main thread (since CoreIPC only allows sending
+ synchronous messages from the main thread). Incidentally, this fixes <rdar://problem/9428041>.
+ 2. The Web Process now waits on the calling thread, (for a condition variable to be signalled) for a reply message.
+ 3. The UI process handles the incoming message request message on the connection work queue and uses
+ dispatch_async to a global dispatch queue where the keychain call is made.
+ We use a global queue to prevent the connection work queue from blocking on the call.
+ 4. The UI process then sends an asynchronous reply message back to the web process. This message is sent from
+ the global dispatch queue.
+ 5. The Web Process handles the reply message on the connection queue, adds the reply to a map and signals
+ the condition variable that the web process is waiting on and the thread that made the keychain call
+ can resume execution.
+
+ * Shared/mac/SecItemRequestData.cpp:
+ (WebKit::SecItemRequestData::SecItemRequestData):
+ (WebKit::SecItemRequestData::encode):
+ (WebKit::SecItemRequestData::decode):
+ * Shared/mac/SecItemRequestData.h:
+ (WebKit::SecItemRequestData::type):
+ Add a type to SecItemRequestData and encode/decode it.
+
+ * Shared/mac/SecItemResponseData.h:
+ (WebKit::SecItemResponseData::resultObject):
+ Make this return a reference so we can call leakRef() on it.
+
+ * Shared/mac/SecKeychainItemRequestData.cpp:
+ (WebKit::SecKeychainItemRequestData::SecKeychainItemRequestData):
+ (WebKit::SecKeychainItemRequestData::~SecKeychainItemRequestData):
+ (WebKit::SecKeychainItemRequestData::attributeList):
+ (WebKit::SecKeychainItemRequestData::encode):
+ (WebKit::SecKeychainItemRequestData::decode):
+ * Shared/mac/SecKeychainItemRequestData.h:
+ (WebKit::SecKeychainItemRequestData::type):
+ Add a type, and put the OwnPtr and OwnArrayPtr in a RefCounted struct so we can
+ correctly copy this object.
+
+ * UIProcess/WebConnectionToWebProcess.cpp:
+ (WebKit::WebConnectionToWebProcess::WebConnectionToWebProcess):
+ Don't open the connection here, the WebProcessProxy object needs to add itself as a queue client before opening.
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::disconnect):
+ Remove the WebProcessProxy object from the list of connection queue clients.
+
+ (WebKit::WebProcessProxy::didReceiveMessageOnConnectionWorkQueue):
+ Call didReceiveWebProcessProxyMessageOnConnectionWorkQueue.
+
+ (WebKit::WebProcessProxy::didFinishLaunching):
+ Add the WebProcessProxy as a queue client and open the connection.
+
+ * UIProcess/WebProcessProxy.h:
+ WebProcessProxy should inherit from CoreIPC::Connection::QueueClient. Replace all individual keychain
+ handler functions with two generic functions, secItemRequest and secKeychainItemRequest.
+
+ * UIProcess/WebProcessProxy.messages.in:
+ Replace individual keychain messages with SecItemRequest and SecKeychainItemRequest messages.
+
+ * UIProcess/mac/WebProcessProxyMac.mm:
+ (WebKit::handleSecItemRequest):
+ Call the right SecItem function depending on the request type and send back the result.
+
+ (WebKit::WebProcessProxy::secItemRequest):
+ Dispatch handleSecItemRequest on a global dispatch queue.
+
+ (WebKit::handleSecKeychainItemRequest):
+ Call the right SecKeychainItem function depending on the request type and send back the result.
+
+ (WebKit::WebProcessProxy::secKeychainItemRequest):
+ Dispatch handleSecKeychainItemRequest on a global dispatch queue.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+ Update for added/removed files.
+
+ * WebProcess/WebProcess.h:
+ Add secItemResponse and secKeychainItemResponse message handlers.
+
+ * WebProcess/WebProcess.messages.in:
+ Add SecItemResponse and SecKeychainItemResponse messages.
+
+ * WebProcess/mac/CoreIPCClientRunLoop.h:
+ * WebProcess/mac/CoreIPCClientRunLoop.mm:
+ This is no longer needed.
+
+ * WebProcess/mac/KeychainItemShimMethods.h:
+ * WebProcess/mac/KeychainItemShimMethods.mm:
+ (WebKit::managedAttributeLists):
+ Make this an atomically initialized static.
+
+ (WebKit::managedAttributeListsMutex):
+ Add an atomically initialized mutex.
+
+ (WebKit::allocateAttributeListContents):
+ Use the managedAttributeListsMutex to make this function callable from any thread.
+
+ (WebKit::managedKeychainItemContents):
+ Make this an atomically initialized static.
+
+ (WebKit::managedKeychainItemContentsMutex):
+ Add an atomically initialized mutex.
+
+ (WebKit::allocateKeychainItemContentData):
+ Use the managedAttributeListsMutex to make this function callable from any thread.
+
+ (WebKit::webFreeAttributeListContent):
+ Use locking so this can be called from any thread.
+
+ (WebKit::webFreeKeychainItemContent):
+ Ditto.
+
+ (WebKit::responseMap):
+ Add responseMap thread-safe singleton for holding incoming responses.
+
+ (WebKit::generateSecKeychainItemRequestID):
+ Return a unique item request id, using OSAtomicIncrement64Barrier for atomicity.
+
+ (WebKit::didReceiveSecKeychainItemResponse):
+ Pass the response over the response map.
+
+ (WebKit::sendSeqKeychainItemRequest):
+ Send a request message and wait for a response using ResponseMap::waitForResponse.
+
+ (WebKit::webSecKeychainItemCopyContent):
+ Send a request using sendSeqKeychainItemRequest.
+
+ (WebKit::webSecKeychainItemCreateFromContent):
+ Ditto.
+
+ (WebKit::webSecKeychainItemModifyContent):
+ Ditto.
+
+ * WebProcess/mac/KeychainShimResponseMap.h:
+ New thread-safe helper class that stores a map of responses and lets client wait for a response
+ with a given ID.
+
+ (KeychainShimResponseMap::waitForResponse):
+ Wait until the response is available in the hash map, then return it.
+
+ (KeychainShimResponseMap::didReceiveResponse):
+ Add the response to the hash map and signal the condition variable.
+
+ * WebProcess/mac/SecItemShimMethods.h:
+ * WebProcess/mac/SecItemShimMethods.mm:
+ (WebKit::responseMap):
+ Add responseMap thread-safe singleton for holding incoming responses.
+
+ (WebKit::generateSecItemRequestID):
+ Return a unique item request id, using OSAtomicIncrement64Barrier for atomicity.
+
+ (WebKit::didReceiveSecItemResponse):
+ Pass the response over the response map.
+
+ (WebKit::sendSeqItemRequest):
+ Send a request message and wait for a response using ResponseMap::waitForResponse.
+
+ (WebKit::webSecItemCopyMatching):
+ Send a request using sendSeqItemRequest.
+
+ (WebKit::webSecItemAdd):
+ Ditto.
+
+ (WebKit::webSecItemUpdate):
+ Ditto.
+
+ (WebKit::webSecItemDelete):
+ Ditto.
+
+ * WebProcess/mac/WebProcessMac.mm:
+ (WebKit::WebProcess::secItemResponse):
+ Call didReceiveSecItemResponse.
+
+ (WebKit::WebProcess::secKeychainItemResponse):
+ Call didReceiveSecKeychainItemResponse.
+
+2012-01-10 Anders Carlsson <andersca@apple.com>
+
+ DispatchOnConnectionQueue messages should have a Connection parameter
+ https://bugs.webkit.org/show_bug.cgi?id=75986
+
+ Reviewed by Adam Roben.
+
+ Message handlers for messages with the DispatchOnConnectionQueue should have a CoreIPC::Connection
+ parameter, making it easier to send messages back over that connection.
+
+ * Platform/CoreIPC/HandleMessage.h:
+ (CoreIPC::callMemberFunction):
+ (CoreIPC::handleMessageOnConnectionQueue):
+ * Scripts/webkit2/messages.py:
+ (async_case_statement):
+ (generate_message_handler):
+ * Scripts/webkit2/messages_unittest.py:
+ * WebProcess/WebPage/EventDispatcher.cpp:
+ (WebKit::EventDispatcher::wheelEvent):
+ (WebKit::EventDispatcher::gestureEvent):
+ * WebProcess/WebPage/EventDispatcher.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::pluginProcessCrashed):
+ * WebProcess/WebProcess.h:
+
+2012-01-10 Chris Marrin <cmarrin@apple.com>
+
+ Turn off the FilterTrigger in WebKit and WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=75914
+
+ Reviewed by Simon Fraser.
+
+ Implement allowedCompositingTriggers to turn on all compositing triggers except FilterTrigger.
+
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ (WebKit::WebChromeClient::allowedCompositingTriggers):
+
+2012-01-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed potential Mac WK2 build fix.
+
+ * UIProcess/PageClient.h: forward declare WebGestureEvent.
+
+2012-01-10 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed, rolling out an accidental commit r104569.
+
+ * Shared/EditorState.cpp:
+ (WebKit::EditorState::encode):
+ (WebKit::EditorState::decode):
+ * Shared/EditorState.h:
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebView::inputMethodQuery):
+ * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+ (WebKit::WebEditorClient::respondToChangedSelection):
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::editorState):
+
+2012-01-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed potential Mac WK2 build fix.
+
+ * UIProcess/API/mac/PageClientImpl.h:
+ * UIProcess/API/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::doneWithGestureEvent):
+
+2012-01-10 Rafael Brandao <rafael.lobo@openbossa.org>
+
+ [Qt][WK2] Add font-related API tests for QWebPreferences
+ https://bugs.webkit.org/show_bug.cgi?id=75739
+
+ Reviewed by Zoltan Herczeg.
+
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml:
+ * UIProcess/API/qt/tests/qmltests/common/font-preferences.html: Added.
+
+2012-01-10 Simon Hausmann <simon.hausmann@nokia.com>
+
+ [Qt] Fix failing WK2 layout tests after r104557
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::didReceiveEvent): Add missing break to not
+ handle mouseDown as gesture event.
+
+2012-01-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Unreviewed buildfix.
+
+ * UIProcess/WebPageProxy.h:
+
+2012-01-10 Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Implement the input panel request/close handling
+
+ Reviewed by Simon Hausmann.
+
+ With the current patch we only request the input panel as a
+ response to a user tap. Close requests, on the other hand,
+ is always respected.
+
+ As multiple show/hide requests can happen while processing
+ the tap gesture, input panel visibility changes are postponed
+ until the tap gesture ends.
+
+ The input panel will become visible if the WebCore editor is
+ in canEdit mode and thus work for content-editable, meaning
+ that it won't close the input panel if you click on a link
+ (eg. editCommand) while in content-editable mode.
+
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::handleGestureEvent):
+ (WebKit::WebPageProxy::editorStateChanged):
+ (WebKit::WebPageProxy::didReceiveEvent):
+
+ Add a new doneWithGestureEvent method to the PageClient
+ as well as add a updateTextInputState similar to that of mac.
+
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/qt/QtPageClient.cpp:
+ (QtPageClient::updateTextInputState):
+ (QtPageClient::doneWithGestureEvent):
+
+ Propagate the new events to the Qt EventHandler.
+
+ * UIProcess/qt/QtPageClient.h:
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ * UIProcess/qt/QtWebPageEventHandler.h:
+ (QtWebPageEventHandler::QtWebPageEventHandler):
+ (QtWebPageEventHandler::handleSingleTapEvent):
+ (setInputPanelVisible):
+ (QtWebPageEventHandler::updateTextInputState):
+ (QtWebPageEventHandler::doneWithGestureEvent):
+
+ Handle postponing of the input method visibility change
+ and the actual showing/hiding.
+
+2012-01-10 Eunmi Lee <eunmi15.lee@samsung.com>
+
+ [EFL][WK2] Remove codes to move and resize the clip.
+ https://bugs.webkit.org/show_bug.cgi?id=75428
+
+ Reviewed by Andreas Kling.
+
+ Remove codes to move and resize the clip because clip is not used now.
+ We have to show whole area of evas_object_image so we don't have to
+ clip any area.
+ In the WebKit1 Efl, the clip is used to clip the area to show during
+ weak zoom, so we can use codes to manipulate the clip when we want to
+ implement weak zoom for WebKit2 Efl.
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ (_ewk_view_smart_calculate):
+
+2012-01-09 Andras Becsi <andras.becsi@nokia.com>
+
+ [Qt][WK2] Pinch zoom should affect the page size
+ https://bugs.webkit.org/show_bug.cgi?id=74601
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ The current implementation uses the scale property of the QQuickWebPage
+ to scale the page in response to pinch gestures.
+ However for layout and anchoring to work correctly in QML, pinching needs
+ to change the page size.
+ This patch applies the pinch scale to the page size and to the transformation
+ matrix of the drawing area.
+ Thus the page item's coordinate system is no longer a direct representation
+ of the WebCore::Page coordinate system and it is no longer suitable as
+ an inertial frame of reference for input events. The event propagation had
+ to be moved to the QQuickWebView and the positions translated to content
+ coordinates when NativeWebEvents are created.
+ Re-landing with fixed event delivery for the test infrastructure.
+
+ * Shared/NativeWebMouseEvent.h:
+ * Shared/NativeWebTouchEvent.h:
+ * Shared/NativeWebWheelEvent.h:
+ * Shared/qt/NativeWebMouseEventQt.cpp:
+ (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
+ * Shared/qt/NativeWebTouchEventQt.cpp:
+ (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
+ * Shared/qt/NativeWebWheelEventQt.cpp:
+ (WebKit::NativeWebWheelEvent::NativeWebWheelEvent):
+ * Shared/qt/WebEventFactoryQt.cpp:
+ (WebKit::WebEventFactory::createWebMouseEvent):
+ (WebKit::WebEventFactory::createWebWheelEvent):
+ (WebKit::WebEventFactory::createWebTouchEvent):
+ * Shared/qt/WebEventFactoryQt.h:
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ (QQuickWebPage::geometryChanged):
+ (QQuickWebPagePrivate::QQuickWebPagePrivate):
+ (QQuickWebPagePrivate::paintToCurrentGLContext):
+ (QQuickWebPage::usesTraditionalDesktopBehaviour):
+ (QQuickWebPage::setUsesTraditionalDesktopBehaviour):
+ (QQuickWebPage::eventHandler):
+ (QQuickWebPage::setContentSize):
+ (QQuickWebPage::contentSize):
+ (QQuickWebPage::setContentScale):
+ (QQuickWebPage::contentScale):
+ (QQuickWebPage::transformFromItem):
+ (QQuickWebPage::transformToItem):
+ (QQuickWebPagePrivate::updateSize):
+ * UIProcess/API/qt/qquickwebpage_p.h:
+ * UIProcess/API/qt/qquickwebpage_p_p.h:
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::enableMouseEvents):
+ (QQuickWebViewPrivate::disableMouseEvents):
+ (QQuickWebViewPrivate::loadDidCommit):
+ (QQuickWebViewPrivate::didFinishFirstNonEmptyLayout):
+ (QQuickWebViewPrivate::didChangeContentsSize):
+ (QQuickWebViewPrivate::didChangeViewportProperties):
+ (QQuickWebViewPrivate::pageDidRequestScroll):
+ (QQuickWebViewPrivate::updateVisibleContentRectAndScale):
+ (QQuickWebViewPrivate::PostTransitionState::apply):
+ (QQuickWebViewPrivate::setUseTraditionalDesktopBehaviour):
+ (QQuickWebViewExperimental::setUseTraditionalDesktopBehaviour):
+ (QQuickWebViewExperimental::useTraditionalDesktopBehaviour):
+ (QQuickWebView::mapToWebContent):
+ (QQuickWebView::mapRectToWebContent):
+ (QQuickWebView::mapFromWebContent):
+ (QQuickWebView::mapRectFromWebContent):
+ (QQuickWebView::geometryChanged):
+ (QQuickWebView::keyPressEvent):
+ (QQuickWebView::keyReleaseEvent):
+ (QQuickWebView::inputMethodEvent):
+ (QQuickWebView::focusInEvent):
+ (QQuickWebView::focusOutEvent):
+ (QQuickWebView::touchEvent):
+ (QQuickWebView::mousePressEvent):
+ (QQuickWebView::mouseMoveEvent):
+ (QQuickWebView::mouseReleaseEvent):
+ (QQuickWebView::mouseDoubleClickEvent):
+ (QQuickWebView::wheelEvent):
+ (QQuickWebView::hoverEnterEvent):
+ (QQuickWebView::hoverMoveEvent):
+ (QQuickWebView::hoverLeaveEvent):
+ (QQuickWebView::dragMoveEvent):
+ (QQuickWebView::dragEnterEvent):
+ (QQuickWebView::dragLeaveEvent):
+ (QQuickWebView::dropEvent):
+ (QQuickWebView::event):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ * UIProcess/API/qt/qwebviewportinfo.cpp:
+ (QWebViewportInfo::contentsSize):
+ * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+ (tst_QQuickWebView::scrollRequest):
+ * UIProcess/qt/QtPinchGestureRecognizer.cpp:
+ (WebKit::QtPinchGestureRecognizer::recognize):
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+ (WebKit::QtViewportInteractionEngine::setItemRectVisible):
+ (WebKit::QtViewportInteractionEngine::animateItemRectVisible):
+ (WebKit::QtViewportInteractionEngine::event):
+ (WebKit::QtViewportInteractionEngine::wheelEvent):
+ (WebKit::QtViewportInteractionEngine::pagePositionRequest):
+ (WebKit::QtViewportInteractionEngine::computePosRangeForItemAtScale):
+ (WebKit::QtViewportInteractionEngine::ensureContentWithinViewportBoundary):
+ (WebKit::QtViewportInteractionEngine::applyConstraints):
+ (WebKit::QtViewportInteractionEngine::currentCSSScale):
+ (WebKit::QtViewportInteractionEngine::panGestureStarted):
+ (WebKit::QtViewportInteractionEngine::panGestureRequestUpdate):
+ (WebKit::QtViewportInteractionEngine::panGestureEnded):
+ (WebKit::QtViewportInteractionEngine::pinchGestureStarted):
+ (WebKit::QtViewportInteractionEngine::pinchGestureRequestUpdate):
+ (WebKit::QtViewportInteractionEngine::scaleContent):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ * UIProcess/qt/QtWebPageEventHandler.cpp:
+ (QtWebPageEventHandler::handleEvent):
+ (QtWebPageEventHandler::handleMouseMoveEvent):
+ (QtWebPageEventHandler::handleMousePressEvent):
+ (QtWebPageEventHandler::handleMouseReleaseEvent):
+ (QtWebPageEventHandler::handleWheelEvent):
+ (QtWebPageEventHandler::handleHoverLeaveEvent):
+ (QtWebPageEventHandler::handleHoverMoveEvent):
+ (QtWebPageEventHandler::handleDragEnterEvent):
+ (QtWebPageEventHandler::handleDragMoveEvent):
+ (QtWebPageEventHandler::handleDropEvent):
+ (QtWebPageEventHandler::handleSingleTapEvent):
+ (QtWebPageEventHandler::handleDoubleTapEvent):
+ (QtWebPageEventHandler::touchEvent):
+ * UIProcess/qt/QtWebPageEventHandler.h:
+
+2012-01-09 Eunmi Lee <eunmi15.lee@samsung.com>
+
+ [EFL][WK2] Set color_set function to the clipped smart class.
+ https://bugs.webkit.org/show_bug.cgi?id=75286
+
+ Reviewed by Andreas Kling.
+
+ Set _ewk_view_smart_color_set() function to the clipped smart class's color_set,
+ so application can set webpage's background color using evas_object_color_set() API.
+
+ * UIProcess/API/efl/ewk_view.cpp:
+ (_ewk_view_smart_color_set):
+ (ewk_view_smart_class_init):
+
+2012-01-08 Dan Bernstein <mitz@apple.com>
+
+ REGRESSION (r103859): WKViews leak
+ https://bugs.webkit.org/show_bug.cgi?id=75805
+
+ The flags changed event monitor added in r103859 was retaining the WKView (as it references
+ self in the handler block), causing it to leak.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView dealloc]): Moved call to remove the flags changed event monitor from here...
+ (-[WKView viewDidMoveToWindow]): ...to here. Moved call to add the flags changed event
+ monitor to here from...
+ (-[WKView initWithFrame:contextRef:pageGroupRef:]): ...here.
+
+2012-01-06 Mark Rowe <mrowe@apple.com>
+
+ REGRESSION (WebKit2): Save as PDF no longer generates links to URLs
+ <http://webkit.org/b/65076> / <rdar://problem/9606246>
+
+ WebKit2 printing works by having the web process render the page content to a PDF. The PDF
+ data is then shipped to the UI process which will render it in to the printing graphics context.
+ Links were being lost because the API used to do the rendering of the PDF in to the printing
+ graphics context, CGContextDrawPDFPage, did not preserve the links that were present in the
+ PDF content received from the web process.
+
+ To fix this we switch to using PDFKit for drawing the PDF in to the printing graphics context.
+ PDFKit provides the ability for us to iterate over the links in the PDF content ourselves and
+ add links in to the printing graphics context.
+
+ Reviewed by Alexey Proskuryakov.
+
+ * UIProcess/API/mac/WKPrintingView.h:
+ * UIProcess/API/mac/WKPrintingView.mm:
+ (pdfAnnotationLinkClass): Look up the PDFAnnotationLink class from PDFKit as WebKit2 loads PDFKit lazily.
+ (pdfDocumentClass): Ditto.
+ (-[WKPrintingView _drawPDFDocument:page:atPoint:]): Switch to using the PDFKit equivalents of several types.
+ Iterate over the annotations present in the PDFPage, calling CGPDFContextSetURLForRect for each PDFAnnotationLink
+ that we find.
+ (-[WKPrintingView _drawPreview:]): Create an NSData to feed to PDFDocument.
+ (-[WKPrintingView drawRect:]): Ditto.
+ * WebKit2Prefix.h: Add the usual workaround to make Objective-C exceptions compile when C++ exception handling is disabled.
+
+2012-01-06 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ [Qt] [WK2] Minibrowser leaks memory ~6-7Mb per reload
+ https://bugs.webkit.org/show_bug.cgi?id=75746
+
+ Reset WebGraphicsLayer::m_layerTreeTileClient of all dependent
+ layers from ~LayerTreeHostQt(). This replaces r103760 which
+ causes leaks of GraphicsLayerTextureMapper objects on UI side.
+
+ Reviewed by Noam Rosenthal.
+
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.cpp:
+ (WebCore::WebGraphicsLayer::syncCompositingStateForThisLayerOnly):
+ (WebCore::WebGraphicsLayer::setLayerTreeTileClient):
+ * WebProcess/WebCoreSupport/WebGraphicsLayer.h:
+ * WebProcess/WebPage/qt/LayerTreeHostQt.cpp:
+ (WebKit::LayerTreeHostQt::~LayerTreeHostQt):
+
+2012-01-06 Alexey Proskuryakov <ap@apple.com>
+
+ [Mac] Thread verifier assertions when printing
+ https://bugs.webkit.org/show_bug.cgi?id=75738
+
+ Reviewed by Sam Weinig.
+
+ * UIProcess/API/mac/WKPrintingView.mm:
+ (-[WKPrintingView dealloc]): Dealloc in main thread, so that WebFrameProxy doesn't get
+ deref'ed from a secondary one.
+ (-[WKPrintingView _adjustPrintingMarginsForHeaderAndFooter]): This method calls out to client,
+ which only expects that on main thread.
+ (-[WKPrintingView knowsPageRange:]): Call _adjustPrintingMarginsForHeaderAndFooter on main
+ thread.
+
+2012-01-06 Alexey Proskuryakov <ap@apple.com>
+
+ Need to allow SCNetworkReachability service in sandbox profile
+ https://bugs.webkit.org/show_bug.cgi?id=75724
+ <rdar://problem/10652415>
+
+ Reviewed by Mark Rowe.
+
+ * WebProcess/com.apple.WebProcess.sb:
+
+2012-01-06 Benjamin Poulain <bpoulain@apple.com>
+
+ [Mac] Sort the resources of WebKit2.xcodeproj
+ https://bugs.webkit.org/show_bug.cgi?id=75636
+
+ Reviewed by Andreas Kling.
+
+ * WebKit2.xcodeproj/project.pbxproj:
+
2012-01-06 Rafael Brandao <rafael.lobo@openbossa.org>
[Qt][WK2] QQuickWebView breaks when an empty url is loaded
diff --git a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
index d57a552be..5634a6b1e 100644
--- a/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
+++ b/Source/WebKit2/Platform/CoreIPC/HandleMessage.h
@@ -196,6 +196,19 @@ void callMemberFunction(const Arguments1<P1>& args, PassRefPtr<R> delayedReply,
(object->*function)(args.argument1, delayedReply);
}
+// Dispatch functions with connection parameter.
+template<typename C, typename MF, typename P1>
+void callMemberFunction(Connection* connection, const Arguments1<P1>& args, C* object, MF function)
+{
+ (object->*function)(connection, args.argument1);
+}
+
+template<typename C, typename MF, typename P1, typename P2>
+void callMemberFunction(Connection* connection, const Arguments2<P1, P2>& args, C* object, MF function)
+{
+ (object->*function)(connection, args.argument1, args.argument2);
+}
+
// Variadic dispatch functions.
template<typename C, typename MF>
@@ -290,6 +303,15 @@ void handleMessage(ArgumentDecoder* argumentDecoder, ArgumentEncoder* replyEncod
}
template<typename T, typename C, typename MF>
+void handleMessageOnConnectionQueue(Connection* connection, ArgumentDecoder* argumentDecoder, C* object, MF function)
+{
+ typename T::DecodeType::ValueType arguments;
+ if (!argumentDecoder->decode(arguments))
+ return;
+ callMemberFunction(connection, arguments, object, function);
+}
+
+template<typename T, typename C, typename MF>
void handleMessageVariadic(ArgumentDecoder* argumentDecoder, C* object, MF function)
{
typename T::DecodeType::ValueType arguments;
diff --git a/Source/WebKit2/Scripts/webkit2/messages.py b/Source/WebKit2/Scripts/webkit2/messages.py
index cf9d5ec01..456cb100a 100644
--- a/Source/WebKit2/Scripts/webkit2/messages.py
+++ b/Source/WebKit2/Scripts/webkit2/messages.py
@@ -311,16 +311,21 @@ def handler_function(receiver, message):
return '%s::%s' % (receiver.name, message.name[0].lower() + message.name[1:])
-def async_case_statement(receiver, message, statement_before_return=None):
+def async_case_statement(receiver, message):
+ dispatch_function_args = ['arguments', 'this', '&%s' % handler_function(receiver, message)]
dispatch_function = 'handleMessage'
if message_is_variadic(message):
dispatch_function += 'Variadic'
-
+ if message.has_attribute(DISPATCH_ON_CONNECTION_QUEUE_ATTRIBUTE):
+ dispatch_function += 'OnConnectionQueue'
+ dispatch_function_args.insert(0, 'connection')
+
result = []
result.append(' case Messages::%s::%s:\n' % (receiver.name, message.id()))
- result.append(' CoreIPC::%s<Messages::%s::%s>(arguments, this, &%s);\n' % (dispatch_function, receiver.name, message.name, handler_function(receiver, message)))
- if statement_before_return:
- result.append(' %s\n' % statement_before_return)
+
+ result.append(' CoreIPC::%s<Messages::%s::%s>(%s);\n' % (dispatch_function, receiver.name, message.name, ', '.join(dispatch_function_args)))
+ if message.has_attribute(DISPATCH_ON_CONNECTION_QUEUE_ATTRIBUTE):
+ result.append(' didHandleMessage = true;\n')
result.append(' return;\n')
return surround_in_condition(''.join(result), message.condition)
@@ -533,14 +538,14 @@ def generate_message_handler(file):
async_messages.append(message)
if async_dispatch_on_connection_queue_messages:
- result.append('void %s::didReceive%sMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)\n' % (receiver.name, receiver.name))
+ result.append('void %s::didReceive%sMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)\n' % (receiver.name, receiver.name))
result.append('{\n')
result.append('#if COMPILER(MSVC)\n')
result.append('#pragma warning(push)\n')
result.append('#pragma warning(disable: 4065)\n')
result.append('#endif\n')
result.append(' switch (messageID.get<Messages::%s::Kind>()) {\n' % receiver.name)
- result += [async_case_statement(receiver, message, 'didHandleMessage = true;') for message in async_dispatch_on_connection_queue_messages]
+ result += [async_case_statement(receiver, message) for message in async_dispatch_on_connection_queue_messages]
result.append(' default:\n')
result.append(' return;\n')
result.append(' }\n')
diff --git a/Source/WebKit2/Scripts/webkit2/messages_unittest.py b/Source/WebKit2/Scripts/webkit2/messages_unittest.py
index dc6b3aff9..dd9fbecc3 100644
--- a/Source/WebKit2/Scripts/webkit2/messages_unittest.py
+++ b/Source/WebKit2/Scripts/webkit2/messages_unittest.py
@@ -685,7 +685,7 @@ bool TestMultipleAttributes::DelayedReply::send()
namespace WebKit {
-void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
+void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
{
#if COMPILER(MSVC)
#pragma warning(push)
@@ -693,7 +693,7 @@ void WebPage::didReceiveWebPageMessageOnConnectionWorkQueue(CoreIPC::Connection*
#endif
switch (messageID.get<Messages::WebPage::Kind>()) {
case Messages::WebPage::TestConnectionQueueID:
- CoreIPC::handleMessage<Messages::WebPage::TestConnectionQueue>(arguments, this, &WebPage::testConnectionQueue);
+ CoreIPC::handleMessageOnConnectionQueue<Messages::WebPage::TestConnectionQueue>(connection, arguments, this, &WebPage::testConnectionQueue);
didHandleMessage = true;
return;
default:
diff --git a/Source/WebKit2/Shared/NativeWebMouseEvent.h b/Source/WebKit2/Shared/NativeWebMouseEvent.h
index a73f95824..b7bbadbd0 100644
--- a/Source/WebKit2/Shared/NativeWebMouseEvent.h
+++ b/Source/WebKit2/Shared/NativeWebMouseEvent.h
@@ -49,7 +49,7 @@ public:
#elif PLATFORM(WIN)
NativeWebMouseEvent(HWND, UINT message, WPARAM, LPARAM, bool);
#elif PLATFORM(QT)
- explicit NativeWebMouseEvent(QMouseEvent*, int);
+ explicit NativeWebMouseEvent(QMouseEvent*, const QTransform& fromItemTransform, int eventClickCount);
#elif PLATFORM(GTK)
NativeWebMouseEvent(const NativeWebMouseEvent&);
NativeWebMouseEvent(GdkEvent*, int);
diff --git a/Source/WebKit2/Shared/NativeWebTouchEvent.h b/Source/WebKit2/Shared/NativeWebTouchEvent.h
index 3652dd736..f20214a8f 100644
--- a/Source/WebKit2/Shared/NativeWebTouchEvent.h
+++ b/Source/WebKit2/Shared/NativeWebTouchEvent.h
@@ -37,7 +37,7 @@ namespace WebKit {
class NativeWebTouchEvent : public WebTouchEvent {
public:
#if PLATFORM(QT)
- explicit NativeWebTouchEvent(const QTouchEvent*);
+ explicit NativeWebTouchEvent(const QTouchEvent*, const QTransform& fromItemTransform);
#endif
#if PLATFORM(QT)
diff --git a/Source/WebKit2/Shared/NativeWebWheelEvent.h b/Source/WebKit2/Shared/NativeWebWheelEvent.h
index 033ab8082..f0cfa6581 100644
--- a/Source/WebKit2/Shared/NativeWebWheelEvent.h
+++ b/Source/WebKit2/Shared/NativeWebWheelEvent.h
@@ -49,7 +49,7 @@ public:
#elif PLATFORM(WIN)
NativeWebWheelEvent(HWND, UINT message, WPARAM, LPARAM);
#elif PLATFORM(QT)
- explicit NativeWebWheelEvent(QWheelEvent*);
+ explicit NativeWebWheelEvent(QWheelEvent*, const QTransform& fromItemTransform);
#elif PLATFORM(GTK)
NativeWebWheelEvent(const NativeWebWheelEvent&);
NativeWebWheelEvent(GdkEvent*);
diff --git a/Source/WebKit2/Shared/mac/SecItemRequestData.cpp b/Source/WebKit2/Shared/mac/SecItemRequestData.cpp
index 4aa4066a7..aa1c45932 100644
--- a/Source/WebKit2/Shared/mac/SecItemRequestData.cpp
+++ b/Source/WebKit2/Shared/mac/SecItemRequestData.cpp
@@ -32,22 +32,27 @@
namespace WebKit {
SecItemRequestData::SecItemRequestData()
+ : m_type(Invalid)
{
}
-SecItemRequestData::SecItemRequestData(CFDictionaryRef query)
- : m_queryDictionary(query)
+SecItemRequestData::SecItemRequestData(Type type, CFDictionaryRef query)
+ : m_type(type)
+ , m_queryDictionary(query)
{
}
-SecItemRequestData::SecItemRequestData(CFDictionaryRef query, CFDictionaryRef attributesToMatch)
- : m_queryDictionary(query)
+SecItemRequestData::SecItemRequestData(Type type, CFDictionaryRef query, CFDictionaryRef attributesToMatch)
+ : m_type(type)
+ , m_queryDictionary(query)
, m_attributesToMatch(attributesToMatch)
{
}
void SecItemRequestData::encode(CoreIPC::ArgumentEncoder* encoder) const
{
+ encoder->encodeEnum(m_type);
+
CoreIPC::encode(encoder, m_queryDictionary.get());
encoder->encodeBool(m_attributesToMatch.get());
@@ -57,6 +62,9 @@ void SecItemRequestData::encode(CoreIPC::ArgumentEncoder* encoder) const
bool SecItemRequestData::decode(CoreIPC::ArgumentDecoder* decoder, SecItemRequestData& secItemRequestData)
{
+ if (!decoder->decodeEnum(secItemRequestData.m_type))
+ return false;
+
if (!CoreIPC::decode(decoder, secItemRequestData.m_queryDictionary))
return false;
diff --git a/Source/WebKit2/Shared/mac/SecItemRequestData.h b/Source/WebKit2/Shared/mac/SecItemRequestData.h
index 1e21d583f..57b18cfc6 100644
--- a/Source/WebKit2/Shared/mac/SecItemRequestData.h
+++ b/Source/WebKit2/Shared/mac/SecItemRequestData.h
@@ -37,17 +37,29 @@ namespace WebKit {
class SecItemRequestData {
public:
+ enum Type {
+ Invalid,
+ CopyMatching,
+ Add,
+ Update,
+ Delete,
+ CopyContent,
+ };
+
SecItemRequestData();
- SecItemRequestData(CFDictionaryRef query);
- SecItemRequestData(CFDictionaryRef query, CFDictionaryRef attributesToMatch);
+ SecItemRequestData(Type, CFDictionaryRef query);
+ SecItemRequestData(Type, CFDictionaryRef query, CFDictionaryRef attributesToMatch);
void encode(CoreIPC::ArgumentEncoder*) const;
static bool decode(CoreIPC::ArgumentDecoder*, SecItemRequestData&);
+ Type type() const { return m_type; }
+
CFDictionaryRef query() const { return m_queryDictionary.get(); }
CFDictionaryRef attributesToMatch() const { return m_attributesToMatch.get(); }
private:
+ Type m_type;
RetainPtr<CFDictionaryRef> m_queryDictionary;
RetainPtr<CFDictionaryRef> m_attributesToMatch;
};
diff --git a/Source/WebKit2/Shared/mac/SecItemResponseData.h b/Source/WebKit2/Shared/mac/SecItemResponseData.h
index 7d7fb9549..5c9433692 100644
--- a/Source/WebKit2/Shared/mac/SecItemResponseData.h
+++ b/Source/WebKit2/Shared/mac/SecItemResponseData.h
@@ -43,7 +43,7 @@ public:
void encode(CoreIPC::ArgumentEncoder*) const;
static bool decode(CoreIPC::ArgumentDecoder*, SecItemResponseData&);
- RetainPtr<CFTypeRef> resultObject() { return m_resultObject; }
+ RetainPtr<CFTypeRef>& resultObject() { return m_resultObject; }
OSStatus resultCode() const { return m_resultCode; }
private:
diff --git a/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp b/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp
index 7f988ffbe..1b6a3c25c 100644
--- a/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp
+++ b/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.cpp
@@ -32,29 +32,36 @@
namespace WebKit {
SecKeychainItemRequestData::SecKeychainItemRequestData()
- : m_itemClass(0)
+ : m_type(Invalid)
+ , m_itemClass(0)
+ , m_attrs(adoptRef(new Attributes))
{
}
-SecKeychainItemRequestData::SecKeychainItemRequestData(SecKeychainItemRef item, SecKeychainAttributeList* attrList)
- : m_keychainItem(item)
+SecKeychainItemRequestData::SecKeychainItemRequestData(Type type, SecKeychainItemRef item, SecKeychainAttributeList* attrList)
+ : m_type(type)
+ , m_keychainItem(item)
, m_itemClass(0)
+ , m_attrs(adoptRef(new Attributes))
{
initializeWithAttributeList(attrList);
}
-SecKeychainItemRequestData::SecKeychainItemRequestData(SecKeychainItemRef item, SecKeychainAttributeList* attrList, UInt32 length, const void* data)
- : m_keychainItem(item)
+SecKeychainItemRequestData::SecKeychainItemRequestData(Type type, SecKeychainItemRef item, SecKeychainAttributeList* attrList, UInt32 length, const void* data)
+ : m_type(type)
+ , m_keychainItem(item)
, m_itemClass(0)
, m_dataReference(static_cast<const uint8_t*>(data), length)
+ , m_attrs(adoptRef(new Attributes))
{
initializeWithAttributeList(attrList);
}
-
-SecKeychainItemRequestData::SecKeychainItemRequestData(SecItemClass itemClass, SecKeychainAttributeList* attrList, UInt32 length, const void* data)
- : m_itemClass(itemClass)
+SecKeychainItemRequestData::SecKeychainItemRequestData(Type type, SecItemClass itemClass, SecKeychainAttributeList* attrList, UInt32 length, const void* data)
+ : m_type(type)
+ , m_itemClass(itemClass)
, m_dataReference(static_cast<const uint8_t*>(data), length)
+ , m_attrs(adoptRef(new Attributes))
{
initializeWithAttributeList(attrList);
}
@@ -71,7 +78,7 @@ void SecKeychainItemRequestData::initializeWithAttributeList(SecKeychainAttribut
SecKeychainItemRequestData::~SecKeychainItemRequestData()
{
#ifndef NDEBUG
- if (!m_attributeList)
+ if (!m_attrs->m_attributeList)
return;
// If this request was for SecKeychainItemModifyContent:
@@ -80,42 +87,44 @@ SecKeychainItemRequestData::~SecKeychainItemRequestData()
// If this request was for SecKeychainItemCopyContent:
// - Security APIs should've filled in the data in the AttributeList and that data
// should've been freed by SecKeychainItemFreeContent.
- for (size_t i = 0; i < m_attributeList->count; ++i) {
+ for (size_t i = 0; i < m_attrs->m_attributeList->count; ++i) {
if (m_keychainAttributes[i].data)
- ASSERT(m_attributeList->attr[i].data == CFDataGetBytePtr(m_keychainAttributes[i].data.get()));
+ ASSERT(m_attrs->m_attributeList->attr[i].data == CFDataGetBytePtr(m_keychainAttributes[i].data.get()));
else
- ASSERT(!m_attributeList->attr[i].data);
+ ASSERT(!m_attrs->m_attributeList->attr[i].data);
}
#endif
}
SecKeychainAttributeList* SecKeychainItemRequestData::attributeList() const
{
- if (m_attributeList || m_keychainAttributes.isEmpty())
- return m_attributeList.get();
+ if (m_attrs->m_attributeList || m_keychainAttributes.isEmpty())
+ return m_attrs->m_attributeList.get();
- m_attributeList = adoptPtr(new SecKeychainAttributeList);
- m_attributeList->count = m_keychainAttributes.size();
- m_attributes = adoptArrayPtr(new SecKeychainAttribute[m_attributeList->count]);
- m_attributeList->attr = m_attributes.get();
+ m_attrs->m_attributeList = adoptPtr(new SecKeychainAttributeList);
+ m_attrs->m_attributeList->count = m_keychainAttributes.size();
+ m_attrs->m_attributes = adoptArrayPtr(new SecKeychainAttribute[m_attrs->m_attributeList->count]);
+ m_attrs->m_attributeList->attr = m_attrs->m_attributes.get();
- for (size_t i = 0; i < m_attributeList->count; ++i) {
- m_attributeList->attr[i].tag = m_keychainAttributes[i].tag;
+ for (size_t i = 0; i < m_attrs->m_attributeList->count; ++i) {
+ m_attrs->m_attributeList->attr[i].tag = m_keychainAttributes[i].tag;
if (!m_keychainAttributes[i].data) {
- m_attributeList->attr[i].length = 0;
- m_attributeList->attr[i].data = 0;
+ m_attrs->m_attributeList->attr[i].length = 0;
+ m_attrs->m_attributeList->attr[i].data = 0;
continue;
}
- m_attributeList->attr[i].length = CFDataGetLength(m_keychainAttributes[i].data.get());
- m_attributeList->attr[i].data = const_cast<void*>(static_cast<const void*>(CFDataGetBytePtr(m_keychainAttributes[i].data.get())));
+ m_attrs->m_attributeList->attr[i].length = CFDataGetLength(m_keychainAttributes[i].data.get());
+ m_attrs->m_attributeList->attr[i].data = const_cast<void*>(static_cast<const void*>(CFDataGetBytePtr(m_keychainAttributes[i].data.get())));
}
- return m_attributeList.get();
+ return m_attrs->m_attributeList.get();
}
void SecKeychainItemRequestData::encode(CoreIPC::ArgumentEncoder* encoder) const
{
+ encoder->encodeEnum(m_type);
+
encoder->encodeBool(m_keychainItem);
if (m_keychainItem)
CoreIPC::encode(encoder, m_keychainItem.get());
@@ -130,6 +139,9 @@ void SecKeychainItemRequestData::encode(CoreIPC::ArgumentEncoder* encoder) const
bool SecKeychainItemRequestData::decode(CoreIPC::ArgumentDecoder* decoder, SecKeychainItemRequestData& secKeychainItemRequestData)
{
+ if (!decoder->decodeEnum(secKeychainItemRequestData.m_type))
+ return false;
+
bool hasKeychainItem;
if (!decoder->decodeBool(hasKeychainItem))
return false;
diff --git a/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.h b/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.h
index ca72b36fb..67a8109ab 100644
--- a/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.h
+++ b/Source/WebKit2/Shared/mac/SecKeychainItemRequestData.h
@@ -31,6 +31,7 @@
#include <Security/Security.h>
#include <wtf/OwnArrayPtr.h>
#include <wtf/RetainPtr.h>
+#include <wtf/ThreadSafeRefCounted.h>
#include <wtf/Vector.h>
namespace CoreIPC {
@@ -42,15 +43,24 @@ namespace WebKit {
class SecKeychainItemRequestData {
public:
+ enum Type {
+ Invalid,
+ CopyContent,
+ CreateFromContent,
+ ModifyContent,
+ };
+
SecKeychainItemRequestData();
- SecKeychainItemRequestData(SecKeychainItemRef, SecKeychainAttributeList*);
- SecKeychainItemRequestData(SecKeychainItemRef, SecKeychainAttributeList*, UInt32 length, const void* data);
- SecKeychainItemRequestData(SecItemClass, SecKeychainAttributeList*, UInt32 length, const void* data);
+ SecKeychainItemRequestData(Type, SecKeychainItemRef, SecKeychainAttributeList*);
+ SecKeychainItemRequestData(Type, SecKeychainItemRef, SecKeychainAttributeList*, UInt32 length, const void* data);
+ SecKeychainItemRequestData(Type, SecItemClass, SecKeychainAttributeList*, UInt32 length, const void* data);
~SecKeychainItemRequestData();
void encode(CoreIPC::ArgumentEncoder*) const;
static bool decode(CoreIPC::ArgumentDecoder*, SecKeychainItemRequestData&);
+ Type type() const { return m_type; }
+
SecKeychainItemRef keychainItem() const { return m_keychainItem.get(); }
SecItemClass itemClass() const { return m_itemClass; }
UInt32 length() const { return m_dataReference.size(); }
@@ -60,14 +70,19 @@ public:
private:
void initializeWithAttributeList(SecKeychainAttributeList*);
-
+
+ Type m_type;
RetainPtr<SecKeychainItemRef> m_keychainItem;
SecItemClass m_itemClass;
CoreIPC::DataReference m_dataReference;
Vector<KeychainAttribute> m_keychainAttributes;
- mutable OwnPtr<SecKeychainAttributeList> m_attributeList;
- mutable OwnArrayPtr<SecKeychainAttribute> m_attributes;
+
+ struct Attributes : public ThreadSafeRefCounted<Attributes> {
+ mutable OwnPtr<SecKeychainAttributeList> m_attributeList;
+ mutable OwnArrayPtr<SecKeychainAttribute> m_attributes;
+ };
+ RefPtr<Attributes> m_attrs;
};
} // namespace WebKit
diff --git a/Source/WebKit2/Shared/qt/NativeWebMouseEventQt.cpp b/Source/WebKit2/Shared/qt/NativeWebMouseEventQt.cpp
index ee731dece..e8fd39ce7 100644
--- a/Source/WebKit2/Shared/qt/NativeWebMouseEventQt.cpp
+++ b/Source/WebKit2/Shared/qt/NativeWebMouseEventQt.cpp
@@ -30,8 +30,8 @@
namespace WebKit {
-NativeWebMouseEvent::NativeWebMouseEvent(QMouseEvent* event, int eventClickCount)
- : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, eventClickCount))
+NativeWebMouseEvent::NativeWebMouseEvent(QMouseEvent* event, const QTransform& fromItemTransform, int eventClickCount)
+ : WebMouseEvent(WebEventFactory::createWebMouseEvent(event, fromItemTransform, eventClickCount))
, m_nativeEvent(event)
{
}
diff --git a/Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp b/Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp
index 0660bba27..78c0883d6 100644
--- a/Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp
+++ b/Source/WebKit2/Shared/qt/NativeWebTouchEventQt.cpp
@@ -30,8 +30,8 @@
namespace WebKit {
-NativeWebTouchEvent::NativeWebTouchEvent(const QTouchEvent* event)
- : WebTouchEvent(WebEventFactory::createWebTouchEvent(event))
+NativeWebTouchEvent::NativeWebTouchEvent(const QTouchEvent* event, const QTransform& fromItemTransform)
+ : WebTouchEvent(WebEventFactory::createWebTouchEvent(event, fromItemTransform))
, m_nativeEvent(*event)
{
}
diff --git a/Source/WebKit2/Shared/qt/NativeWebWheelEventQt.cpp b/Source/WebKit2/Shared/qt/NativeWebWheelEventQt.cpp
index 5ff224acb..3c1ba9f8f 100644
--- a/Source/WebKit2/Shared/qt/NativeWebWheelEventQt.cpp
+++ b/Source/WebKit2/Shared/qt/NativeWebWheelEventQt.cpp
@@ -30,8 +30,8 @@
namespace WebKit {
-NativeWebWheelEvent::NativeWebWheelEvent(QWheelEvent* event)
- : WebWheelEvent(WebEventFactory::createWebWheelEvent(event))
+NativeWebWheelEvent::NativeWebWheelEvent(QWheelEvent* event, const QTransform& fromItemTransform)
+ : WebWheelEvent(WebEventFactory::createWebWheelEvent(event, fromItemTransform))
, m_nativeEvent(event)
{
}
diff --git a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
index 3dc5970f9..b6ac2f5e1 100644
--- a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
+++ b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
@@ -29,6 +29,7 @@
#include <qgraphicssceneevent.h>
#include <QApplication>
#include <QKeyEvent>
+#include <QTransform>
#include <WebCore/IntPoint.h>
#include <WebCore/FloatPoint.h>
#include <WebCore/PlatformKeyboardEvent.h>
@@ -106,7 +107,7 @@ static inline WebEvent::Modifiers modifiersForEvent(Qt::KeyboardModifiers modifi
return (WebEvent::Modifiers)result;
}
-WebMouseEvent WebEventFactory::createWebMouseEvent(QMouseEvent* event, int eventClickCount)
+WebMouseEvent WebEventFactory::createWebMouseEvent(QMouseEvent* event, const QTransform& fromItemTransform, int eventClickCount)
{
static FloatPoint lastPos = FloatPoint(0, 0);
@@ -119,10 +120,10 @@ WebMouseEvent WebEventFactory::createWebMouseEvent(QMouseEvent* event, int event
double timestamp = currentTimeForEvent(event);
lastPos.set(event->localPos().x(), event->localPos().y());
- return WebMouseEvent(type, button, event->localPos().toPoint(), event->screenPos().toPoint(), deltaX, deltaY, 0.0f, clickCount, modifiers, timestamp);
+ return WebMouseEvent(type, button, fromItemTransform.map(event->localPos()).toPoint(), event->screenPos().toPoint(), deltaX, deltaY, 0.0f, clickCount, modifiers, timestamp);
}
-WebWheelEvent WebEventFactory::createWebWheelEvent(QWheelEvent* e)
+WebWheelEvent WebEventFactory::createWebWheelEvent(QWheelEvent* e, const QTransform& fromItemTransform)
{
float deltaX = 0;
float deltaY = 0;
@@ -151,7 +152,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(QWheelEvent* e)
deltaX *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
deltaY *= (fullTick) ? QApplication::wheelScrollLines() * cDefaultQtScrollStep : 1;
- return WebWheelEvent(WebEvent::Wheel, e->posF().toPoint(), e->globalPosF().toPoint(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
+ return WebWheelEvent(WebEvent::Wheel, fromItemTransform.map(e->posF()).toPoint(), e->globalPosF().toPoint(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
}
WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(QKeyEvent* event)
@@ -174,7 +175,7 @@ WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(QKeyEvent* event)
}
#if ENABLE(TOUCH_EVENTS)
-WebTouchEvent WebEventFactory::createWebTouchEvent(const QTouchEvent* event)
+WebTouchEvent WebEventFactory::createWebTouchEvent(const QTouchEvent* event, const QTransform& fromItemTransform)
{
WebEvent::Type type = webEventTypeForEvent(event);
WebPlatformTouchPoint::TouchPointState state = static_cast<WebPlatformTouchPoint::TouchPointState>(0);
@@ -184,10 +185,11 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(const QTouchEvent* event)
const QList<QTouchEvent::TouchPoint>& points = event->touchPoints();
- Vector<WebPlatformTouchPoint> m_touchPoints;
+ Vector<WebPlatformTouchPoint, 6> m_touchPoints;
for (int i = 0; i < points.count(); ++i) {
- id = static_cast<unsigned>(points.at(i).id());
- switch (points.at(i).state()) {
+ const QTouchEvent::TouchPoint& touchPoint = points.at(i);
+ id = static_cast<unsigned>(touchPoint.id());
+ switch (touchPoint.state()) {
case Qt::TouchPointReleased:
state = WebPlatformTouchPoint::TouchReleased;
break;
@@ -205,7 +207,7 @@ WebTouchEvent WebEventFactory::createWebTouchEvent(const QTouchEvent* event)
break;
}
- m_touchPoints.append(WebPlatformTouchPoint(id, state, points.at(i).screenPos().toPoint(), points.at(i).pos().toPoint()));
+ m_touchPoints.append(WebPlatformTouchPoint(id, state, touchPoint.screenPos().toPoint(), fromItemTransform.map(touchPoint.pos()).toPoint()));
}
return WebTouchEvent(type, m_touchPoints, modifiers, timestamp);
diff --git a/Source/WebKit2/Shared/qt/WebEventFactoryQt.h b/Source/WebKit2/Shared/qt/WebEventFactoryQt.h
index 4ce648e26..deecc25d4 100644
--- a/Source/WebKit2/Shared/qt/WebEventFactoryQt.h
+++ b/Source/WebKit2/Shared/qt/WebEventFactoryQt.h
@@ -41,11 +41,11 @@ namespace WebKit {
class WebEventFactory {
public:
- static WebMouseEvent createWebMouseEvent(QMouseEvent*, int eventClickCount);
- static WebWheelEvent createWebWheelEvent(QWheelEvent*);
+ static WebMouseEvent createWebMouseEvent(QMouseEvent*, const QTransform& fromItemTransform, int eventClickCount);
+ static WebWheelEvent createWebWheelEvent(QWheelEvent*, const QTransform& fromItemTransform);
static WebKeyboardEvent createWebKeyboardEvent(QKeyEvent*);
#if ENABLE(TOUCH_EVENTS)
- static WebTouchEvent createWebTouchEvent(const QTouchEvent*);
+ static WebTouchEvent createWebTouchEvent(const QTouchEvent*, const QTransform& fromItemTransform);
#endif
};
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
index c5bca11b4..592f58034 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
@@ -348,20 +348,17 @@ static void _ewk_view_smart_calculate(Evas_Object* ewkView)
smartData->changed.any = false;
evas_object_geometry_get(ewkView, &x, &y, &width, &height);
- Evas_Object* clip = evas_object_clip_get(smartData->image);
if (smartData->changed.size) {
if (priv->pageClient->page()->drawingArea())
priv->pageClient->page()->drawingArea()->setSize(IntSize(width, height), IntSize());
smartData->view.w = width;
smartData->view.h = height;
- evas_object_resize(clip, width, height);
smartData->changed.size = false;
}
if (smartData->changed.position) {
evas_object_move(smartData->image, x, y);
- evas_object_move(clip, x, y);
smartData->view.x = x;
smartData->view.y = y;
smartData->changed.position = false;
@@ -385,6 +382,33 @@ static void _ewk_view_smart_hide(Evas_Object* ewkView)
evas_object_hide(smartData->image);
}
+static void _ewk_view_smart_color_set(Evas_Object* ewkView, int red, int green, int blue, int alpha)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
+
+ if (alpha < 0)
+ alpha = 0;
+ else if (alpha > 255)
+ alpha = 255;
+
+#define CHECK_COLOR(color, alpha) \
+ if (color < 0) \
+ color = 0; \
+ else if (color > alpha) \
+ color = alpha;
+ CHECK_COLOR(red, alpha);
+ CHECK_COLOR(green, alpha);
+ CHECK_COLOR(blue, alpha);
+#undef CHECK_COLOR
+
+ evas_object_image_alpha_set(smartData->image, alpha < 255);
+ priv->pageClient->page()->setDrawsBackground(red || green || blue);
+ priv->pageClient->page()->setDrawsTransparentBackground(alpha < 255);
+
+ g_parentSmartClass.color_set(ewkView, red, green, blue, alpha);
+}
+
Eina_Bool ewk_view_smart_class_init(Ewk_View_Smart_Class* api)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(api, false);
@@ -407,6 +431,7 @@ Eina_Bool ewk_view_smart_class_init(Ewk_View_Smart_Class* api)
api->sc.resize = _ewk_view_smart_resize;
api->sc.show = _ewk_view_smart_show;
api->sc.hide = _ewk_view_smart_hide;
+ api->sc.color_set = _ewk_view_smart_color_set;
api->sc.calculate = _ewk_view_smart_calculate;
api->sc.data = EWK_VIEW_TYPE_STR; // It is used by type checking.
diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
index 8e3c5b7aa..953c378e1 100644
--- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
+++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
@@ -82,7 +82,10 @@ private:
virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
-
+
+#if ENABLE(GESTURE_EVENTS)
+ virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);
+#endif
virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
index c1ae66643..35e0e2e70 100644
--- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
+++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
@@ -298,6 +298,13 @@ IntRect PageClientImpl::windowToScreen(const IntRect& rect)
return enclosingIntRect(tempRect);
}
+#if ENABLE(GESTURE_EVENTS)
+void PageClientImpl::doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled)
+{
+ notImplemented();
+}
+#endif
+
void PageClientImpl::doneWithKeyEvent(const NativeWebKeyboardEvent& event, bool eventWasHandled)
{
[m_wkView _doneWithKeyEvent:event.nativeEvent() eventWasHandled:eventWasHandled];
diff --git a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h
index 87d81f4d3..cd3b1f984 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h
+++ b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h
@@ -27,6 +27,7 @@
#import <wtf/RetainPtr.h>
@class WKPrintingViewData;
+@class PDFDocument;
namespace WebKit {
class WebFrameProxy;
@@ -43,7 +44,7 @@ namespace WebKit {
HashMap<WebCore::IntRect, Vector<uint8_t> > _pagePreviews;
Vector<uint8_t> _printedPagesData;
- RetainPtr<CGPDFDocumentRef> _printedPagesPDFDocument;
+ RetainPtr<PDFDocument> _printedPagesPDFDocument;
uint64_t _expectedComputedPagesCallback;
HashMap<uint64_t, WebCore::IntRect> _expectedPreviewCallbacks;
diff --git a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
index 14fe79add..13aefb82b 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm
@@ -30,6 +30,8 @@
#import "PrintInfo.h"
#import "WebData.h"
#import "WebPageProxy.h"
+#import <PDFKit/PDFKit.h>
+#import <WebCore/WebCoreObjCExtras.h>
#import <wtf/MainThread.h>
using namespace WebKit;
@@ -56,6 +58,14 @@ static BOOL isForcingPreviewUpdate;
return self;
}
+- (void)dealloc
+{
+ if (WebCoreObjCScheduleDeallocateOnMainThread([WKPrintingView class], self))
+ return;
+
+ [super dealloc];
+}
+
- (BOOL)isFlipped
{
return YES;
@@ -110,6 +120,8 @@ static BOOL isForcingPreviewUpdate;
- (void)_adjustPrintingMarginsForHeaderAndFooter
{
+ ASSERT(isMainThread()); // This funciton calls the client, which should only be done on main thread.
+
NSPrintInfo *info = [_printOperation printInfo];
NSMutableDictionary *infoDictionary = [info dictionary];
@@ -364,7 +376,7 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
[self _suspendAutodisplay];
- [self _adjustPrintingMarginsForHeaderAndFooter];
+ [self performSelectorOnMainThread:@selector(_adjustPrintingMarginsForHeaderAndFooter) withObject:nil waitUntilDone:YES];
if ([self _hasPageRects])
*range = NSMakeRange(1, _printingPageRects.size());
@@ -399,16 +411,45 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
return 0; // Invalid page number.
}
-- (void)_drawPDFDocument:(CGPDFDocumentRef)pdfDocument page:(unsigned)page atPoint:(NSPoint)point
+static NSString *pdfKitFrameworkPath()
+{
+ NSString *systemLibraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSSystemDomainMask, NO) objectAtIndex:0];
+ return [systemLibraryPath stringByAppendingPathComponent:@"Frameworks/Quartz.framework/Frameworks/PDFKit.framework"];
+}
+
+static Class classFromPDFKit(NSString *className)
+{
+ static NSBundle *pdfKitBundle = [NSBundle bundleWithPath:pdfKitFrameworkPath()];
+ [pdfKitBundle load];
+ return [pdfKitBundle classNamed:className];
+}
+
+static Class pdfAnnotationLinkClass()
+{
+ static Class pdfAnnotationLinkClass = classFromPDFKit(@"PDFAnnotationLink");
+ ASSERT(pdfAnnotationLinkClass);
+ return pdfAnnotationLinkClass;
+}
+
+static Class pdfDocumentClass()
+{
+ static Class pdfDocumentClass = classFromPDFKit(@"PDFDocument");
+ ASSERT(pdfDocumentClass);
+ return pdfDocumentClass;
+}
+
+- (void)_drawPDFDocument:(PDFDocument *)pdfDocument page:(unsigned)page atPoint:(NSPoint)point
{
if (!pdfDocument) {
LOG_ERROR("Couldn't create a PDF document with data passed for preview");
return;
}
- CGPDFPageRef pdfPage = CGPDFDocumentGetPage(pdfDocument, page);
- if (!pdfPage) {
- LOG_ERROR("Preview data doesn't have page %d", page);
+ PDFPage *pdfPage;
+ @try {
+ pdfPage = [pdfDocument pageAtIndex:page];
+ } @catch (id exception) {
+ LOG_ERROR("Preview data doesn't have page %d: %@", page, exception);
return;
}
@@ -418,8 +459,25 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
CGContextSaveGState(context);
CGContextTranslateCTM(context, point.x, point.y);
CGContextScaleCTM(context, _totalScaleFactorForPrinting, -_totalScaleFactorForPrinting);
- CGContextTranslateCTM(context, 0, -CGPDFPageGetBoxRect(pdfPage, kCGPDFMediaBox).size.height);
- CGContextDrawPDFPage(context, pdfPage);
+ CGContextTranslateCTM(context, 0, -[pdfPage boundsForBox:kPDFDisplayBoxMediaBox].size.height);
+ [pdfPage drawWithBox:kPDFDisplayBoxMediaBox];
+
+ CGAffineTransform transform = CGContextGetCTM(context);
+
+ for (PDFAnnotation *annotation in [pdfPage annotations]) {
+ if (![annotation isKindOfClass:pdfAnnotationLinkClass()])
+ continue;
+
+ PDFAnnotationLink *linkAnnotation = (PDFAnnotationLink *)annotation;
+ NSURL *url = [linkAnnotation URL];
+ if (!url)
+ continue;
+
+ CGRect urlRect = NSRectToCGRect([linkAnnotation bounds]);
+ CGRect transformedRect = CGRectApplyAffineTransform(urlRect, transform);
+ CGPDFContextSetURLForRect(context, (CFURLRef)url, transformedRect);
+ }
+
CGContextRestoreGState(context);
}
@@ -462,11 +520,11 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
return;
}
- const Vector<uint8_t>& pdfData = pagePreviewIterator->second;
- RetainPtr<CGDataProviderRef> pdfDataProvider(AdoptCF, CGDataProviderCreateWithData(0, pdfData.data(), pdfData.size(), 0));
- RetainPtr<CGPDFDocumentRef> pdfDocument(AdoptCF, CGPDFDocumentCreateWithProvider(pdfDataProvider.get()));
+ const Vector<uint8_t>& pdfDataBytes = pagePreviewIterator->second;
+ RetainPtr<NSData> pdfData(AdoptNS, [[NSData alloc] initWithBytes:pdfDataBytes.data() length:pdfDataBytes.size()]);
+ RetainPtr<PDFDocument> pdfDocument(AdoptNS, [[pdfDocumentClass() alloc] initWithData:pdfData.get()]);
- [self _drawPDFDocument:pdfDocument.get() page:1 atPoint:NSMakePoint(nsRect.origin.x, nsRect.origin.y)];
+ [self _drawPDFDocument:pdfDocument.get() page:0 atPoint:NSMakePoint(nsRect.origin.x, nsRect.origin.y)];
}
- (void)drawRect:(NSRect)nsRect
@@ -487,11 +545,11 @@ static void prepareDataForPrintingOnSecondaryThread(void* untypedContext)
ASSERT(!_printedPagesData.isEmpty()); // Prepared by knowsPageRange:
if (!_printedPagesPDFDocument) {
- RetainPtr<CGDataProviderRef> pdfDataProvider(AdoptCF, CGDataProviderCreateWithData(0, _printedPagesData.data(), _printedPagesData.size(), 0));
- _printedPagesPDFDocument.adoptCF(CGPDFDocumentCreateWithProvider(pdfDataProvider.get()));
+ RetainPtr<NSData> pdfData(AdoptNS, [[NSData alloc] initWithBytes:_printedPagesData.data() length:_printedPagesData.size()]);
+ _printedPagesPDFDocument.adoptNS([[pdfDocumentClass() alloc] initWithData:pdfData.get()]);
}
- unsigned printedPageNumber = [self _pageForRect:nsRect] - [self _firstPrintedPageNumber] + 1;
+ unsigned printedPageNumber = [self _pageForRect:nsRect] - [self _firstPrintedPageNumber];
[self _drawPDFDocument:_printedPagesPDFDocument.get() page:printedPageNumber atPoint:NSMakePoint(nsRect.origin.x, nsRect.origin.y)];
}
diff --git a/Source/WebKit2/UIProcess/API/mac/WKView.mm b/Source/WebKit2/UIProcess/API/mac/WKView.mm
index 0bb174337..1e2509ba6 100644
--- a/Source/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/Source/WebKit2/UIProcess/API/mac/WKView.mm
@@ -225,7 +225,6 @@ struct WKViewInterpretKeyEventsParameters {
- (void)dealloc
{
_data->_page->close();
- [NSEvent removeMonitor:_data->_flagsChangedEventMonitor];
ASSERT(!_data->_inSecureInputState);
@@ -1823,12 +1822,20 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible | WebPageProxy::ViewIsInWindow);
[self _updateWindowVisibility];
[self _updateWindowAndViewFrames];
-
- [self _accessibilityRegisterUIProcessTokens];
+
+ _data->_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) {
+ [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent];
+ return flagsChangedEvent;
+ }];
+
+ [self _accessibilityRegisterUIProcessTokens];
} else {
_data->_page->viewStateDidChange(WebPageProxy::ViewIsVisible);
_data->_page->viewStateDidChange(WebPageProxy::ViewWindowIsActive | WebPageProxy::ViewIsInWindow);
+ [NSEvent removeMonitor:_data->_flagsChangedEventMonitor];
+ _data->_flagsChangedEventMonitor = nil;
+
#if ENABLE(GESTURE_EVENTS)
if (_data->_endGestureMonitor) {
[NSEvent removeMonitor:_data->_endGestureMonitor];
@@ -2703,10 +2710,6 @@ static void drawPageBackground(CGContextRef context, WebPageProxy* page, const I
#endif
_data->_mouseDownEvent = nil;
_data->_ignoringMouseDraggedEvents = NO;
- _data->_flagsChangedEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSFlagsChangedMask handler:^(NSEvent *flagsChangedEvent) {
- [self _postFakeMouseMovedEventForFlagsChangedEvent:flagsChangedEvent];
- return flagsChangedEvent;
- }];
[self _registerDraggedTypes];
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
index 7d3b2d6a6..b5db3938f 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
@@ -25,6 +25,7 @@
#include "QtWebPageEventHandler.h"
#include "TransformationMatrix.h"
#include "qquickwebpage_p_p.h"
+#include "qquickwebview_p.h"
#include <QtQuick/QQuickCanvas>
#include <QtQuick/QSGGeometryNode>
#include <QtQuick/QSGMaterial>
@@ -50,112 +51,15 @@ QtSGUpdateQueue *QQuickWebPage::sceneGraphUpdateQueue() const
return &d->sgUpdateQueue;
}
-void QQuickWebPage::keyPressEvent(QKeyEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::keyReleaseEvent(QKeyEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::inputMethodEvent(QInputMethodEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::focusInEvent(QFocusEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::focusOutEvent(QFocusEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::mousePressEvent(QMouseEvent* event)
-{
- forceActiveFocus();
- this->event(event);
-}
-
-void QQuickWebPage::mouseMoveEvent(QMouseEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::mouseReleaseEvent(QMouseEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::mouseDoubleClickEvent(QMouseEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::wheelEvent(QWheelEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::hoverEnterEvent(QHoverEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::hoverMoveEvent(QHoverEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::hoverLeaveEvent(QHoverEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::dragMoveEvent(QDragMoveEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::dragEnterEvent(QDragEnterEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::dragLeaveEvent(QDragLeaveEvent* event)
-{
- this->event(event);
-}
-
-void QQuickWebPage::dropEvent(QDropEvent* event)
-{
- this->event(event);
-}
-
void QQuickWebPage::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
{
QQuickItem::geometryChanged(newGeometry, oldGeometry);
- if (newGeometry.size() != oldGeometry.size())
- d->setDrawingAreaSize(newGeometry.size().toSize());
-}
-bool QQuickWebPage::event(QEvent* ev)
-{
- if (d->eventHandler.data()->handleEvent(ev))
- return true;
- if (ev->type() == QEvent::InputMethod)
- return false; // This is necessary to avoid an endless loop in connection with QQuickItem::event().
- return QQuickItem::event(ev);
-}
+ if (!d->useTraditionalDesktopBehaviour)
+ return;
-void QQuickWebPage::touchEvent(QTouchEvent* event)
-{
- forceActiveFocus();
- this->event(event);
+ if (newGeometry.size() != oldGeometry.size())
+ d->setDrawingAreaSize(newGeometry.size().toSize());
}
QQuickWebPagePrivate::QQuickWebPagePrivate(QQuickWebPage* q)
@@ -164,6 +68,8 @@ QQuickWebPagePrivate::QQuickWebPagePrivate(QQuickWebPage* q)
, sgUpdateQueue(q)
, paintingIsInitialized(false)
, m_paintNode(0)
+ , contentScale(1)
+ , useTraditionalDesktopBehaviour(false)
{
}
@@ -199,6 +105,7 @@ void QQuickWebPagePrivate::paintToCurrentGLContext()
return;
QTransform transform = q->itemTransform(0, 0);
+ transform.scale(contentScale, contentScale);
float opacity = computeEffectiveOpacity(q);
QRectF clipRect = q->parentItem()->mapRectToScene(q->parentItem()->boundingRect());
@@ -322,6 +229,65 @@ QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*)
return proxyNode;
}
+bool QQuickWebPage::usesTraditionalDesktopBehaviour() const
+{
+ return d->useTraditionalDesktopBehaviour;
+}
+
+void QQuickWebPage::setUsesTraditionalDesktopBehaviour(bool enable)
+{
+ d->useTraditionalDesktopBehaviour = enable;
+}
+
+QtWebPageEventHandler* QQuickWebPage::eventHandler() const
+{
+ return d->eventHandler.data();
+}
+
+void QQuickWebPage::setContentSize(const QSizeF& size)
+{
+ if (size.isEmpty() || d->contentSize == size)
+ return;
+
+ d->contentSize = size;
+ d->updateSize();
+ d->setDrawingAreaSize(d->contentSize.toSize());
+}
+
+const QSizeF& QQuickWebPage::contentSize() const
+{
+ return d->contentSize;
+}
+
+void QQuickWebPage::setContentScale(qreal scale)
+{
+ ASSERT(scale > 0);
+ d->contentScale = scale;
+ d->updateSize();
+}
+
+qreal QQuickWebPage::contentScale() const
+{
+ ASSERT(d->contentScale > 0);
+ return d->contentScale;
+}
+
+QTransform QQuickWebPage::transformFromItem() const
+{
+ return transformToItem().inverted();
+}
+
+QTransform QQuickWebPage::transformToItem() const
+{
+ return QTransform(d->contentScale, 0, 0, 0, d->contentScale, 0, x(), y(), 1);
+}
+
+void QQuickWebPagePrivate::updateSize()
+{
+ QSizeF scaledSize = contentSize * contentScale;
+ q->setSize(scaledSize);
+}
+
void QQuickWebPagePrivate::resetPaintNode()
{
m_paintNode = 0;
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
index f7c35064e..f797810f6 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h
@@ -27,6 +27,7 @@
#include <QtQuick/QQuickItem>
class QQuickWebPagePrivate;
+class QtWebPageEventHandler;
class QWebPreferences;
namespace WebKit {
@@ -39,29 +40,23 @@ public:
QQuickWebPage(QQuickItem* parent = 0);
virtual ~QQuickWebPage();
+ void setContentSize(const QSizeF& size);
+ const QSizeF& contentSize() const;
+ void setContentScale(qreal);
+ qreal contentScale() const;
+
+ QTransform transformFromItem() const;
+ QTransform transformToItem() const;
+
+ bool usesTraditionalDesktopBehaviour() const;
+ void setUsesTraditionalDesktopBehaviour(bool enable);
+
+ QtWebPageEventHandler* eventHandler() const;
+
// Internal. To be removed soon.
WebKit::QtSGUpdateQueue* sceneGraphUpdateQueue() const;
protected:
- virtual void keyPressEvent(QKeyEvent*);
- virtual void keyReleaseEvent(QKeyEvent*);
- virtual void inputMethodEvent(QInputMethodEvent*);
- virtual void focusInEvent(QFocusEvent*);
- virtual void focusOutEvent(QFocusEvent*);
- virtual void mousePressEvent(QMouseEvent*);
- virtual void mouseMoveEvent(QMouseEvent*);
- virtual void mouseReleaseEvent(QMouseEvent *);
- virtual void mouseDoubleClickEvent(QMouseEvent*);
- virtual void wheelEvent(QWheelEvent*);
- virtual void hoverEnterEvent(QHoverEvent*);
- virtual void hoverMoveEvent(QHoverEvent*);
- virtual void hoverLeaveEvent(QHoverEvent*);
- virtual void dragMoveEvent(QDragMoveEvent*);
- virtual void dragEnterEvent(QDragEnterEvent*);
- virtual void dragLeaveEvent(QDragLeaveEvent*);
- virtual void dropEvent(QDropEvent*);
- virtual void touchEvent(QTouchEvent*);
- virtual bool event(QEvent*);
virtual void geometryChanged(const QRectF&, const QRectF&);
virtual QSGNode* updatePaintNode(QSGNode*, UpdatePaintNodeData*);
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
index 7224f3975..3b58eb510 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h
@@ -23,6 +23,7 @@
#include "QtSGUpdateQueue.h"
#include "qquickwebpage_p.h"
+#include <QTransform>
namespace WebKit {
class WebPageProxy;
@@ -39,6 +40,8 @@ public:
void initialize(WebKit::WebPageProxy*);
void setDrawingAreaSize(const QSize&);
+ void updateSize();
+
void paintToCurrentGLContext();
void resetPaintNode();
@@ -48,6 +51,10 @@ public:
WebKit::QtSGUpdateQueue sgUpdateQueue;
bool paintingIsInitialized;
QSGNode* m_paintNode;
+
+ QSizeF contentSize;
+ qreal contentScale;
+ bool useTraditionalDesktopBehaviour;
};
#endif // qquickwebpage_p_p_h
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index 264cbb044..187b9b4ca 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -113,8 +113,6 @@ void QQuickWebViewPrivate::enableMouseEvents()
Q_Q(QQuickWebView);
q->setAcceptedMouseButtons(Qt::MouseButtonMask);
q->setAcceptHoverEvents(true);
- pageView->setAcceptedMouseButtons(Qt::MouseButtonMask);
- pageView->setAcceptHoverEvents(true);
}
void QQuickWebViewPrivate::disableMouseEvents()
@@ -122,8 +120,6 @@ void QQuickWebViewPrivate::disableMouseEvents()
Q_Q(QQuickWebView);
q->setAcceptedMouseButtons(Qt::NoButton);
q->setAcceptHoverEvents(false);
- pageView->setAcceptedMouseButtons(Qt::NoButton);
- pageView->setAcceptHoverEvents(false);
}
void QQuickWebViewPrivate::initializeDesktop(QQuickWebView* viewport)
@@ -154,7 +150,7 @@ void QQuickWebViewPrivate::loadDidCommit()
// Due to entering provisional load before committing, we
// might actually be suspended here.
- if (useTraditionalDesktopBehaviour)
+ if (pageView->usesTraditionalDesktopBehaviour())
return;
isTransitioningToNewPage = true;
@@ -162,7 +158,7 @@ void QQuickWebViewPrivate::loadDidCommit()
void QQuickWebViewPrivate::didFinishFirstNonEmptyLayout()
{
- if (useTraditionalDesktopBehaviour)
+ if (pageView->usesTraditionalDesktopBehaviour())
return;
if (!pageIsSuspended) {
@@ -200,7 +196,7 @@ void QQuickWebViewPrivate::_q_resume()
void QQuickWebViewPrivate::didChangeContentsSize(const QSize& newSize)
{
Q_Q(QQuickWebView);
- if (useTraditionalDesktopBehaviour)
+ if (pageView->usesTraditionalDesktopBehaviour())
return;
// FIXME: We probably want to handle suspend here as well
@@ -209,15 +205,13 @@ void QQuickWebViewPrivate::didChangeContentsSize(const QSize& newSize)
return;
}
- pageView->setWidth(newSize.width());
- pageView->setHeight(newSize.height());
-
+ pageView->setContentSize(newSize);
q->m_experimental->viewportInfo()->didUpdateContentsSize();
}
void QQuickWebViewPrivate::didChangeViewportProperties(const WebCore::ViewportArguments& args)
{
- if (useTraditionalDesktopBehaviour)
+ if (pageView->usesTraditionalDesktopBehaviour())
return;
viewportArguments = args;
@@ -235,7 +229,7 @@ void QQuickWebViewPrivate::didChangeBackForwardList()
void QQuickWebViewPrivate::pageDidRequestScroll(const QPoint& pos)
{
- if (useTraditionalDesktopBehaviour)
+ if (pageView->usesTraditionalDesktopBehaviour())
return;
if (isTransitioningToNewPage) {
@@ -287,10 +281,10 @@ void QQuickWebViewPrivate::updateVisibleContentRectAndScale()
return;
Q_Q(QQuickWebView);
- const QRectF visibleRectInPageViewCoordinates = q->mapRectToItem(pageView.data(), q->boundingRect()).intersected(pageView->boundingRect());
- float scale = pageView->scale();
+ const QRectF visibleRectInCSSCoordinates = q->mapRectToWebContent(q->boundingRect()).intersected(pageView->boundingRect());
+ float scale = pageView->contentScale();
- QRect alignedVisibleContentRect = visibleRectInPageViewCoordinates.toAlignedRect();
+ QRect alignedVisibleContentRect = visibleRectInCSSCoordinates.toAlignedRect();
drawingArea->setVisibleContentsRectAndScale(alignedVisibleContentRect, scale);
// FIXME: Once we support suspend and resume, this should be delayed until the page is active if the page is suspended.
@@ -345,8 +339,7 @@ void QQuickWebViewPrivate::PostTransitionState::apply()
p->interactionEngine->pagePositionRequest(position);
if (contentsSize.isValid()) {
- p->pageView->setWidth(contentsSize.width());
- p->pageView->setHeight(contentsSize.height());
+ p->pageView->setContentSize(contentsSize);
p->q_ptr->experimental()->viewportInfo()->didUpdateContentsSize();
}
@@ -502,9 +495,8 @@ void QQuickWebViewPrivate::setUseTraditionalDesktopBehaviour(bool enable)
// Do not guard, testing for the same value, as we call this from the constructor.
webPageProxy->setUseFixedLayout(!enable);
-
- useTraditionalDesktopBehaviour = enable;
- if (useTraditionalDesktopBehaviour)
+ pageView->setUsesTraditionalDesktopBehaviour(enable);
+ if (enable)
initializeDesktop(q);
else
initializeTouch(q);
@@ -609,7 +601,7 @@ void QQuickWebViewExperimental::setUseTraditionalDesktopBehaviour(bool enable)
{
Q_D(QQuickWebView);
- if (enable == d->useTraditionalDesktopBehaviour)
+ if (enable == d->pageView->usesTraditionalDesktopBehaviour())
return;
d->setUseTraditionalDesktopBehaviour(enable);
@@ -697,7 +689,7 @@ void QQuickWebViewExperimental::setItemSelector(QDeclarativeComponent* itemSelec
bool QQuickWebViewExperimental::useTraditionalDesktopBehaviour() const
{
Q_D(const QQuickWebView);
- return d->useTraditionalDesktopBehaviour;
+ return d->pageView->usesTraditionalDesktopBehaviour();
}
QQuickUrlSchemeDelegate* QQuickWebViewExperimental::schemeDelegates_At(QDeclarativeListProperty<QQuickUrlSchemeDelegate>* property, int index)
@@ -895,6 +887,30 @@ bool QQuickWebView::canReload() const
return d->webPageProxy->backForwardList()->currentItem();
}
+QPointF QQuickWebView::mapToWebContent(const QPointF& pointInViewCoordinates) const
+{
+ Q_D(const QQuickWebView);
+ return d->pageView->transformFromItem().map(pointInViewCoordinates);
+}
+
+QRectF QQuickWebView::mapRectToWebContent(const QRectF& rectInViewCoordinates) const
+{
+ Q_D(const QQuickWebView);
+ return d->pageView->transformFromItem().mapRect(rectInViewCoordinates);
+}
+
+QPointF QQuickWebView::mapFromWebContent(const QPointF& pointInCSSCoordinates) const
+{
+ Q_D(const QQuickWebView);
+ return d->pageView->transformToItem().map(pointInCSSCoordinates);
+}
+
+QRectF QQuickWebView::mapRectFromWebContent(const QRectF& rectInCSSCoordinates) const
+{
+ Q_D(const QQuickWebView);
+ return d->pageView->transformToItem().mapRect(rectInCSSCoordinates);
+}
+
QString QQuickWebView::title() const
{
Q_D(const QQuickWebView);
@@ -948,7 +964,7 @@ void QQuickWebView::geometryChanged(const QRectF& newGeometry, const QRectF& old
Q_D(QQuickWebView);
QQuickItem::geometryChanged(newGeometry, oldGeometry);
if (newGeometry.size() != oldGeometry.size()) {
- if (d->useTraditionalDesktopBehaviour) {
+ if (d->pageView->usesTraditionalDesktopBehaviour()) {
d->pageView->setWidth(newGeometry.width());
d->pageView->setHeight(newGeometry.height());
} else
@@ -956,16 +972,130 @@ void QQuickWebView::geometryChanged(const QRectF& newGeometry, const QRectF& old
}
}
+void QQuickWebView::keyPressEvent(QKeyEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::keyReleaseEvent(QKeyEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::inputMethodEvent(QInputMethodEvent* event)
+{
+ this->event(event);
+}
+
void QQuickWebView::focusInEvent(QFocusEvent* event)
{
- Q_D(QQuickWebView);
- d->pageView->event(event);
+ this->event(event);
}
void QQuickWebView::focusOutEvent(QFocusEvent* event)
{
+ this->event(event);
+}
+
+void QQuickWebView::touchEvent(QTouchEvent* event)
+{
+ forceActiveFocus();
+ this->event(event);
+}
+
+void QQuickWebView::mousePressEvent(QMouseEvent* event)
+{
+ forceActiveFocus();
+ this->event(event);
+}
+
+void QQuickWebView::mouseMoveEvent(QMouseEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::mouseReleaseEvent(QMouseEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::mouseDoubleClickEvent(QMouseEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::wheelEvent(QWheelEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::hoverEnterEvent(QHoverEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::hoverMoveEvent(QHoverEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::hoverLeaveEvent(QHoverEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::dragMoveEvent(QDragMoveEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::dragEnterEvent(QDragEnterEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::dragLeaveEvent(QDragLeaveEvent* event)
+{
+ this->event(event);
+}
+
+void QQuickWebView::dropEvent(QDropEvent* event)
+{
+ this->event(event);
+}
+
+bool QQuickWebView::event(QEvent* ev)
+{
Q_D(QQuickWebView);
- d->pageView->event(event);
+
+ switch (ev->type()) {
+ case QEvent::MouseMove:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::Wheel:
+ case QEvent::HoverLeave:
+ case QEvent::HoverEnter:
+ case QEvent::HoverMove:
+ case QEvent::DragEnter:
+ case QEvent::DragLeave:
+ case QEvent::DragMove:
+ case QEvent::Drop:
+ case QEvent::KeyPress:
+ case QEvent::KeyRelease:
+ case QEvent::FocusIn:
+ case QEvent::FocusOut:
+ case QEvent::TouchBegin:
+ case QEvent::TouchEnd:
+ case QEvent::TouchUpdate:
+ if (d->pageView->eventHandler()->handleEvent(ev))
+ return true;
+ }
+
+ if (ev->type() == QEvent::InputMethod)
+ return false; // This is necessary to avoid an endless loop in connection with QQuickItem::event().
+
+ return QQuickItem::event(ev);
}
WKPageRef QQuickWebView::pageRef() const
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
index e5d3f1e5a..0fa0791cf 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h
@@ -100,6 +100,11 @@ public:
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
+ QPointF mapToWebContent(const QPointF&) const;
+ QRectF mapRectToWebContent(const QRectF&) const;
+ QPointF mapFromWebContent(const QPointF&) const;
+ QRectF mapRectFromWebContent(const QRectF&) const;
+
QQuickWebPage* page();
QQuickWebViewExperimental* experimental() const;
@@ -130,8 +135,26 @@ Q_SIGNALS:
protected:
virtual void geometryChanged(const QRectF&, const QRectF&);
+
+ virtual void keyPressEvent(QKeyEvent*);
+ virtual void keyReleaseEvent(QKeyEvent*);
+ virtual void inputMethodEvent(QInputMethodEvent*);
virtual void focusInEvent(QFocusEvent*);
virtual void focusOutEvent(QFocusEvent*);
+ virtual void touchEvent(QTouchEvent*);
+ virtual void mousePressEvent(QMouseEvent*);
+ virtual void mouseMoveEvent(QMouseEvent*);
+ virtual void mouseReleaseEvent(QMouseEvent *);
+ virtual void mouseDoubleClickEvent(QMouseEvent*);
+ virtual void wheelEvent(QWheelEvent*);
+ virtual void hoverEnterEvent(QHoverEvent*);
+ virtual void hoverMoveEvent(QHoverEvent*);
+ virtual void hoverLeaveEvent(QHoverEvent*);
+ virtual void dragMoveEvent(QDragMoveEvent*);
+ virtual void dragEnterEvent(QDragEnterEvent*);
+ virtual void dragLeaveEvent(QDragLeaveEvent*);
+ virtual void dropEvent(QDropEvent*);
+ virtual bool event(QEvent*);
private:
Q_DECLARE_PRIVATE(QQuickWebView)
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
index 3b999282b..4be71707c 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h
@@ -159,8 +159,6 @@ private:
bool isTransitioningToNewPage;
bool pageIsSuspended;
-
- bool useTraditionalDesktopBehaviour;
bool m_navigatorQtObjectEnabled;
QUrl m_iconURL;
};
diff --git a/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp b/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
index 8b6fb418b..735196f86 100644
--- a/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qwebviewportinfo.cpp
@@ -38,7 +38,7 @@ QWebViewportInfo::~QWebViewportInfo()
QSize QWebViewportInfo::contentsSize() const
{
- return QSize(m_webViewPrivate->pageView->width(), m_webViewPrivate->pageView->height());
+ return QSize(m_webViewPrivate->pageView->contentSize().toSize());
}
QVariant QWebViewportInfo::currentScale() const
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml
index 0554abb2d..8bec01418 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml
@@ -26,6 +26,66 @@ Item {
}
SignalSpy {
+ id: titleSpy
+ target: webView
+ signalName: "titleChanged"
+ }
+
+ SignalSpy {
+ id: standardFontFamilySpy
+ target: webView.experimental.preferences
+ signalName: "standardFontFamilyChanged"
+ }
+
+ SignalSpy {
+ id: fixedFontFamilySpy
+ target: webView.experimental.preferences
+ signalName: "fixedFontFamilyChanged"
+ }
+
+ SignalSpy {
+ id: serifFontFamilySpy
+ target: webView.experimental.preferences
+ signalName: "serifFontFamilyChanged"
+ }
+
+ SignalSpy {
+ id: sansSerifFontFamilySpy
+ target: webView.experimental.preferences
+ signalName: "sansSerifFontFamilyChanged"
+ }
+
+ SignalSpy {
+ id: cursiveFontFamilySpy
+ target: webView.experimental.preferences
+ signalName: "cursiveFontFamilyChanged"
+ }
+
+ SignalSpy {
+ id: fantasyFontFamilySpy
+ target: webView.experimental.preferences
+ signalName: "fantasyFontFamilyChanged"
+ }
+
+ SignalSpy {
+ id: minimumFontSizeSpy
+ target: webView.experimental.preferences
+ signalName: "minimumFontSizeChanged"
+ }
+
+ SignalSpy {
+ id: defaultFontSizeSpy
+ target: webView.experimental.preferences
+ signalName: "defaultFontSizeChanged"
+ }
+
+ SignalSpy {
+ id: defaultFixedFontSizeSpy
+ target: webView.experimental.preferences
+ signalName: "defaultFixedFontSizeChanged"
+ }
+
+ SignalSpy {
id: otherSpy
target: webView2
signalName: "loadSucceeded"
@@ -34,11 +94,65 @@ Item {
TestCase {
name: "WebViewPreferences"
+ property bool shouldSetupFonts: true
+ property string defaultStandardFontFamily
+ property string defaultFixedFontFamily
+ property string defaultSerifFontFamily
+ property string defaultSansSerifFontFamily
+ property string defaultCursiveFontFamily
+ property string defaultFantasyFontFamily
+ property int defaultMinimumFontSize
+ property int defaultFontSize
+ property int defaultFixedFontSize
+
function init() {
+ if (shouldSetupFonts) {
+ // Setup initial values (may be different per platform).
+ shouldSetupFonts = false
+ defaultStandardFontFamily = webView.experimental.preferences.standardFontFamily
+ defaultFixedFontFamily = webView.experimental.preferences.fixedFontFamily
+ defaultSerifFontFamily = webView.experimental.preferences.serifFontFamily
+ defaultSansSerifFontFamily = webView.experimental.preferences.sansSerifFontFamily
+ defaultCursiveFontFamily = webView.experimental.preferences.cursiveFontFamily
+ defaultFantasyFontFamily = webView.experimental.preferences.fantasyFontFamily
+ defaultMinimumFontSize = webView.experimental.preferences.minimumFontSize
+ defaultFontSize = webView.experimental.preferences.defaultFontSize
+ defaultFixedFontSize = webView.experimental.preferences.defaultFixedFontSize
+ }
+ else {
+ // Restore default values before starting a new test case.
+ webView.experimental.preferences.standardFontFamily = defaultStandardFontFamily
+ webView.experimental.preferences.fixedFontFamily = defaultFixedFontFamily
+ webView.experimental.preferences.serifFontFamily = defaultSerifFontFamily
+ webView.experimental.preferences.sansSerifFontFamily = defaultSansSerifFontFamily
+ webView.experimental.preferences.cursiveFontFamily = defaultCursiveFontFamily
+ webView.experimental.preferences.fantasyFontFamily = defaultFantasyFontFamily
+ webView.experimental.preferences.minimumFontSize = defaultMinimumFontSize
+ webView.experimental.preferences.defaultFontSize = defaultFontSize
+ webView.experimental.preferences.defaultFixedFontSize = defaultFixedFontSize
+
+ if (webView.url != '' && webView.url != 'about:blank') {
+ spy.clear()
+ webView.load('about:blank')
+ spy.wait()
+ }
+
+ standardFontFamilySpy.clear()
+ fixedFontFamilySpy.clear()
+ serifFontFamilySpy.clear()
+ sansSerifFontFamilySpy.clear()
+ cursiveFontFamilySpy.clear()
+ fantasyFontFamilySpy.clear()
+ minimumFontSizeSpy.clear()
+ defaultFontSizeSpy.clear()
+ defaultFixedFontSizeSpy.clear()
+ }
+
webView.experimental.preferences.javascriptEnabled = true
webView.experimental.preferences.localStorageEnabled = true
webView.experimental.preferences.pluginsEnabled = true
spy.clear()
+ titleSpy.clear()
}
function test_javascriptEnabled() {
@@ -96,6 +210,122 @@ Item {
compare(webView.title, "Original Title")
compare(webView2.title, "New Title")
}
+
+ function test_standardFontFamilyChanged() {
+ var url = Qt.resolvedUrl("../common/font-preferences.html?standard#font-family")
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, defaultStandardFontFamily)
+
+ webView.experimental.preferences.standardFontFamily = "foobar"
+ standardFontFamilySpy.wait()
+ compare(standardFontFamilySpy.count, 1)
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, "foobar")
+ }
+
+ function test_fontSizeChanged() {
+ var url = Qt.resolvedUrl("../common/font-preferences.html?standard#font-size")
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, defaultFontSize.toString() + "px")
+
+ webView.experimental.preferences.defaultFontSize = defaultFontSize + 1
+ defaultFontSizeSpy.wait()
+ compare(defaultFontSizeSpy.count, 1)
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, (defaultFontSize + 1).toString() + "px")
+ }
+
+ function test_fixedFontSizeChanged() {
+ var url = Qt.resolvedUrl("../common/font-preferences.html?fixed#font-size")
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, defaultFixedFontSize.toString() + "px")
+
+ webView.experimental.preferences.defaultFixedFontSize = defaultFixedFontSize + 1
+ defaultFixedFontSizeSpy.wait()
+ compare(defaultFixedFontSizeSpy.count, 1)
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, (defaultFixedFontSize + 1).toString() + "px")
+
+ webView.load(Qt.resolvedUrl("../common/font-preferences.html?standard#font-size"))
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, defaultFontSize.toString() + "px")
+ }
+
+ function test_minimumFontSizeChanged() {
+ verify(defaultMinimumFontSize < defaultFontSize)
+ var url = Qt.resolvedUrl("../common/font-preferences.html?minimum#font-size")
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ var smallerFontSize = webView.title
+ smallerFontSize = smallerFontSize.substring(0, smallerFontSize.length - 2)
+ smallerFontSize = parseInt(smallerFontSize)
+ verify(smallerFontSize < defaultFontSize)
+
+ webView.experimental.preferences.minimumFontSize = defaultFontSize
+ minimumFontSizeSpy.wait()
+ compare(minimumFontSizeSpy.count, 1)
+ webView.load(url)
+ titleSpy.wait()
+ compare(webView.title, "Original Title")
+ titleSpy.wait()
+ compare(webView.title, defaultFontSize.toString() + "px")
+ }
+
+ function test_defaultFontsChanged() {
+ // As there's currently no way to test through JS if a generic font was indeed changed
+ // we keep this test for really basic coverage.
+
+ webView.experimental.preferences.standardFontFamily = "foobar0"
+ standardFontFamilySpy.wait()
+ webView.experimental.preferences.fixedFontFamily = "foobar1"
+ fixedFontFamilySpy.wait()
+ webView.experimental.preferences.serifFontFamily = "foobar2"
+ serifFontFamilySpy.wait()
+ webView.experimental.preferences.sansSerifFontFamily = "foobar3"
+ sansSerifFontFamilySpy.wait()
+ webView.experimental.preferences.cursiveFontFamily = "foobar4"
+ cursiveFontFamilySpy.wait()
+ webView.experimental.preferences.fantasyFontFamily = "foobar5"
+ fantasyFontFamilySpy.wait()
+
+ compare(standardFontFamilySpy.count, 1)
+ compare(fixedFontFamilySpy.count, 1)
+ compare(serifFontFamilySpy.count, 1)
+ compare(sansSerifFontFamilySpy.count, 1)
+ compare(cursiveFontFamilySpy.count, 1)
+ compare(fantasyFontFamilySpy.count, 1)
+
+ compare(webView.experimental.preferences.standardFontFamily, "foobar0")
+ compare(webView.experimental.preferences.fixedFontFamily, "foobar1")
+ compare(webView.experimental.preferences.serifFontFamily, "foobar2")
+ compare(webView.experimental.preferences.sansSerifFontFamily, "foobar3")
+ compare(webView.experimental.preferences.cursiveFontFamily, "foobar4")
+ compare(webView.experimental.preferences.fantasyFontFamily, "foobar5")
+ }
+
+
}
}
}
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/font-preferences.html b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/font-preferences.html
new file mode 100644
index 000000000..cbc11432d
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/font-preferences.html
@@ -0,0 +1,31 @@
+<html>
+<head>
+<title>Original Title</title>
+</head>
+<script type="text/javascript">
+function getTestId() {
+ url = document.location.href
+ var i, j = 0;
+ for (i = url.length - 1; i >= 0; --i) {
+ if (url[i] == '?')
+ break
+ else if (url[i] == '#')
+ j = i - 1
+ }
+ return url.substr(i + 1, j - i)
+}
+
+function getStyleForId(id, styleProp) {
+ return document.defaultView.getComputedStyle(document.getElementById(id), null).getPropertyValue(styleProp);
+}
+
+function changeTitle() {
+ document.title = getStyleForId(getTestId(), window.location.hash.substr(1))
+}
+</script>
+<body onload='setTimeout("changeTitle()", 100)'>
+<p id="standard">hello</p>
+<code id="fixed">hello</code>
+<p id="minimum" style="font-size: smaller">hello</p>
+</body>
+</html>
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
index 57b7ec14a..1d14d1844 100644
--- a/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp
@@ -51,6 +51,8 @@ private slots:
void show();
void showWebView();
void removeFromCanvas();
+ void multipleWebViewWindows();
+ void multipleWebViews();
private:
inline QQuickWebView* webView() const;
@@ -270,6 +272,52 @@ void tst_QQuickWebView::removeFromCanvas()
QTest::qWait(200);
}
+void tst_QQuickWebView::multipleWebViewWindows()
+{
+ showWebView();
+
+ // This should not crash.
+ QQuickWebView* webView1 = new QQuickWebView();
+ QScopedPointer<TestWindow> window1(new TestWindow(webView1));
+ QQuickWebView* webView2 = new QQuickWebView();
+ QScopedPointer<TestWindow> window2(new TestWindow(webView2));
+
+ webView1->setSize(QSizeF(300, 400));
+ webView1->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/scroll.html")));
+ QVERIFY(waitForSignal(webView1, SIGNAL(loadSucceeded())));
+ window1->show();
+ webView1->setVisible(true);
+
+ webView2->setSize(QSizeF(300, 400));
+ webView2->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html")));
+ QVERIFY(waitForSignal(webView2, SIGNAL(loadSucceeded())));
+ window2->show();
+ webView2->setVisible(true);
+ QTest::qWait(200);
+}
+
+void tst_QQuickWebView::multipleWebViews()
+{
+ showWebView();
+
+ // This should not crash.
+ QScopedPointer<QQuickWebView> webView1(new QQuickWebView());
+ webView1->setParentItem(m_window->rootItem());
+ QScopedPointer<QQuickWebView> webView2(new QQuickWebView());
+ webView2->setParentItem(m_window->rootItem());
+
+ webView1->setSize(QSizeF(300, 400));
+ webView1->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/scroll.html")));
+ QVERIFY(waitForSignal(webView1.data(), SIGNAL(loadSucceeded())));
+ webView1->setVisible(true);
+
+ webView2->setSize(QSizeF(300, 400));
+ webView2->load(QUrl::fromLocalFile(QLatin1String(TESTS_SOURCE_DIR "/html/basic_page.html")));
+ QVERIFY(waitForSignal(webView2.data(), SIGNAL(loadSucceeded())));
+ webView2->setVisible(true);
+ QTest::qWait(200);
+}
+
void tst_QQuickWebView::scrollRequest()
{
webView()->setSize(QSizeF(300, 400));
@@ -280,7 +328,7 @@ void tst_QQuickWebView::scrollRequest()
// COMPARE with the position requested in the html
// Use qRound as that is also used when calculating the position
// in WebKit.
- int y = -qRound(50 * webView()->page()->scale());
+ int y = -qRound(50 * webView()->page()->contentScale());
QVERIFY(webView()->page()->pos().y() == y);
}
diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h
index 1db4eaa9b..c94ea1a13 100644
--- a/Source/WebKit2/UIProcess/PageClient.h
+++ b/Source/WebKit2/UIProcess/PageClient.h
@@ -52,6 +52,9 @@ class NativeWebKeyboardEvent;
#if ENABLE(TOUCH_EVENTS)
class NativeWebTouchEvent;
#endif
+#if ENABLE(GESTURE_EVENTS)
+class WebGestureEvent;
+#endif
class WebContextMenuProxy;
class WebEditCommandProxy;
class WebPopupMenuProxy;
@@ -106,6 +109,7 @@ public:
virtual void focusEditableArea(const WebCore::IntRect&, const WebCore::IntRect&) = 0;
virtual void didReceiveMessageFromNavigatorQtObject(const String&) = 0;
virtual void handleDownloadRequest(DownloadProxy*) = 0;
+ virtual void updateTextInputState() = 0;
#endif
#if PLATFORM(QT) || PLATFORM(GTK)
@@ -141,6 +145,9 @@ public:
virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) = 0;
virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) = 0;
+#if ENABLE(GESTURE_EVENTS)
+ virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled) = 0;
+#endif
#if ENABLE(TOUCH_EVENTS)
virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) = 0;
#endif
diff --git a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
index 18f74a99f..b1d103fbc 100644
--- a/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
+++ b/Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp
@@ -46,8 +46,6 @@ WebConnectionToWebProcess::WebConnectionToWebProcess(WebProcessProxy* process, C
#elif PLATFORM(QT)
m_connection->setShouldCloseConnectionOnProcessTermination(process->processIdentifier());
#endif
-
- m_connection->open();
}
void WebConnectionToWebProcess::invalidate()
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 15abf9ccc..7e08cecd8 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -968,6 +968,8 @@ void WebPageProxy::handleGestureEvent(const WebGestureEvent& event)
if (!isValid())
return;
+ m_gestureEventQueue.append(event);
+
process()->responsivenessTimer()->start();
process()->send(Messages::EventDispatcher::GestureEvent(m_pageID, event), 0);
}
@@ -2427,6 +2429,8 @@ void WebPageProxy::editorStateChanged(const EditorState& editorState)
#if PLATFORM(MAC)
m_pageClient->updateTextInputState(couldChangeSecureInputState);
+#elif PLATFORM(QT)
+ m_pageClient->updateTextInputState();
#endif
}
@@ -2908,12 +2912,19 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
}
break;
case WebEvent::MouseDown:
+ break;
#if ENABLE(GESTURE_EVENTS)
case WebEvent::GestureScrollBegin:
case WebEvent::GestureScrollEnd:
- case WebEvent::GestureSingleTap:
-#endif
+ case WebEvent::GestureSingleTap: {
+ WebGestureEvent event = m_gestureEventQueue.first();
+ MESSAGE_CHECK(type == event.type());
+
+ m_gestureEventQueue.removeFirst();
+ m_pageClient->doneWithGestureEvent(event, handled);
break;
+ }
+#endif
case WebEvent::MouseUp:
m_currentlyProcessedMouseDownEvent = nullptr;
break;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.h b/Source/WebKit2/UIProcess/WebPageProxy.h
index 42a18f3e1..cf5130419 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.h
+++ b/Source/WebKit2/UIProcess/WebPageProxy.h
@@ -952,6 +952,9 @@ private:
WebCore::PolicyAction m_syncNavigationActionPolicyAction;
uint64_t m_syncNavigationActionPolicyDownloadID;
+#if ENABLE(GESTURE_EVENTS)
+ Deque<WebGestureEvent> m_gestureEventQueue;
+#endif
Deque<NativeWebKeyboardEvent> m_keyEventQueue;
Deque<NativeWebWheelEvent> m_wheelEventQueue;
Vector<NativeWebWheelEvent> m_currentlyProcessedWheelEvents;
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.cpp b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
index 0c11caa5b..8c99b4efa 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.cpp
@@ -117,6 +117,7 @@ void WebProcessProxy::connect()
void WebProcessProxy::disconnect()
{
if (m_connection) {
+ m_connection->connection()->removeQueueClient(this);
m_connection->invalidate();
m_connection = nullptr;
}
@@ -349,6 +350,12 @@ void WebProcessProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, Cor
pageProxy->didReceiveSyncMessage(connection, messageID, arguments, reply);
}
+void WebProcessProxy::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage)
+{
+ if (messageID.is<CoreIPC::MessageClassWebProcessProxy>())
+ didReceiveWebProcessProxyMessageOnConnectionWorkQueue(connection, messageID, arguments, didHandleMessage);
+}
+
void WebProcessProxy::didClose(CoreIPC::Connection*)
{
// Protect ourselves, as the call to disconnect() below may otherwise cause us
@@ -409,7 +416,9 @@ void WebProcessProxy::didFinishLaunching(CoreIPC::Connection::Identifier connect
ASSERT(!m_connection);
m_connection = WebConnectionToWebProcess::create(this, connectionIdentifier, RunLoop::main());
-
+ m_connection->connection()->addQueueClient(this);
+ m_connection->connection()->open();
+
for (size_t i = 0; i < m_pendingMessages.size(); ++i) {
CoreIPC::Connection::OutgoingMessage& outgoingMessage = m_pendingMessages[i].first;
unsigned messageSendFlags = m_pendingMessages[i].second;
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.h b/Source/WebKit2/UIProcess/WebProcessProxy.h
index 129e0ea1b..11cfa5b27 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.h
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.h
@@ -57,7 +57,7 @@ class WebContext;
class WebPageGroup;
struct WebNavigationDataStore;
-class WebProcessProxy : public RefCounted<WebProcessProxy>, CoreIPC::Connection::Client, ResponsivenessTimer::Client, ProcessLauncher::Client, ThreadLauncher::Client {
+class WebProcessProxy : public RefCounted<WebProcessProxy>, CoreIPC::Connection::Client, ResponsivenessTimer::Client, ProcessLauncher::Client, ThreadLauncher::Client, CoreIPC::Connection::QueueClient {
public:
typedef HashMap<uint64_t, RefPtr<WebFrameProxy> > WebFrameProxyMap;
typedef HashMap<uint64_t, RefPtr<WebBackForwardListItem> > WebBackForwardListItemMap;
@@ -139,13 +139,8 @@ private:
void pluginSyncMessageSendTimedOut(const String& pluginPath);
#endif
#if PLATFORM(MAC)
- void secItemCopyMatching(const SecItemRequestData&, SecItemResponseData&);
- void secItemAdd(const SecItemRequestData&, SecItemResponseData&);
- void secItemUpdate(const SecItemRequestData&, SecItemResponseData&);
- void secItemDelete(const SecItemRequestData&, SecItemResponseData&);
- void secKeychainItemCopyContent(const SecKeychainItemRequestData&, SecKeychainItemResponseData&);
- void secKeychainItemCreateFromContent(const SecKeychainItemRequestData&, SecKeychainItemResponseData&);
- void secKeychainItemModifyContent(const SecKeychainItemRequestData&, SecKeychainItemResponseData&);
+ void secItemRequest(CoreIPC::Connection*, uint64_t requestID, const SecItemRequestData&);
+ void secKeychainItemRequest(CoreIPC::Connection*, uint64_t requestID, const SecKeychainItemRequestData&);
#endif
// CoreIPC::Connection::Client
@@ -159,6 +154,9 @@ private:
virtual Vector<HWND> windowsToReceiveSentMessagesWhileWaitingForSyncReply();
#endif
+ // CoreIPC::Connection::QueueClient
+ virtual void didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*, bool& didHandleMessage);
+
// ResponsivenessTimer::Client
void didBecomeUnresponsive(ResponsivenessTimer*);
void didBecomeResponsive(ResponsivenessTimer*);
@@ -174,6 +172,7 @@ private:
// Implemented in generated WebProcessProxyMessageReceiver.cpp
void didReceiveWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
void didReceiveSyncWebProcessProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, OwnPtr<CoreIPC::ArgumentEncoder>& reply);
+ void didReceiveWebProcessProxyMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage);
ResponsivenessTimer m_responsivenessTimer;
diff --git a/Source/WebKit2/UIProcess/WebProcessProxy.messages.in b/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
index 8943ffc70..93961da44 100644
--- a/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
+++ b/Source/WebKit2/UIProcess/WebProcessProxy.messages.in
@@ -33,14 +33,8 @@ messages -> WebProcessProxy {
#endif
#if PLATFORM(MAC)
- SecItemCopyMatching(WebKit::SecItemRequestData query) -> (WebKit::SecItemResponseData result)
- SecItemAdd(WebKit::SecItemRequestData query) -> (WebKit::SecItemResponseData result)
- SecItemUpdate(WebKit::SecItemRequestData query) -> (WebKit::SecItemResponseData result)
- SecItemDelete(WebKit::SecItemRequestData query) -> (WebKit::SecItemResponseData result)
-
- SecKeychainItemCopyContent(WebKit::SecKeychainItemRequestData query) -> (WebKit::SecKeychainItemResponseData result)
- SecKeychainItemCreateFromContent(WebKit::SecKeychainItemRequestData query) -> (WebKit::SecKeychainItemResponseData result)
- SecKeychainItemModifyContent(WebKit::SecKeychainItemRequestData query) -> (WebKit::SecKeychainItemResponseData result)
+ SecItemRequest(uint64_t requestID, WebKit::SecItemRequestData request) DispatchOnConnectionQueue
+ SecKeychainItemRequest(uint64_t requestID, WebKit::SecKeychainItemRequestData request) DispatchOnConnectionQueue
#endif
}
diff --git a/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm b/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
index 467155e92..37e8caae0 100644
--- a/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
+++ b/Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm
@@ -30,82 +30,105 @@
#import "SecItemResponseData.h"
#import "SecKeychainItemRequestData.h"
#import "SecKeychainItemResponseData.h"
+#import "WebProcessMessages.h"
#import "WKFullKeyboardAccessWatcher.h"
#import <Security/SecItem.h>
namespace WebKit {
-void WebProcessProxy::secItemCopyMatching(const SecItemRequestData& queryData, SecItemResponseData& result)
+static void handleSecItemRequest(CoreIPC::Connection* connection, uint64_t requestID, const SecItemRequestData& request)
{
- CFDictionaryRef query = queryData.query();
- CFTypeRef resultObjectRef;
- OSStatus resultCode = SecItemCopyMatching(query, &resultObjectRef);
-
- RetainPtr<CFTypeRef> resultObject(AdoptCF, resultObjectRef);
- result = SecItemResponseData(resultCode, resultObject.get());
-}
-
-void WebProcessProxy::secItemAdd(const SecItemRequestData& queryData, SecItemResponseData& result)
-{
- CFDictionaryRef query = queryData.query();
- CFTypeRef resultObjectRef;
- OSStatus resultCode = SecItemAdd(query, &resultObjectRef);
-
- RetainPtr<CFTypeRef> resultObject(AdoptCF, resultObjectRef);
- result = SecItemResponseData(resultCode, resultObject.get());
-}
-
-void WebProcessProxy::secItemUpdate(const SecItemRequestData& queryData, SecItemResponseData& result)
-{
- CFDictionaryRef query = queryData.query();
- CFDictionaryRef attributesToMatch = queryData.attributesToMatch();
- OSStatus resultCode;
-
- resultCode = SecItemUpdate(query, attributesToMatch);
-
- result = SecItemResponseData(resultCode, 0);
-}
-
-void WebProcessProxy::secItemDelete(const SecItemRequestData& queryData, SecItemResponseData& result)
-{
- CFDictionaryRef query = queryData.query();
- OSStatus resultCode;
-
- resultCode = SecItemDelete(query);
-
- result = SecItemResponseData(resultCode, 0);
+ SecItemResponseData response;
+
+ switch (request.type()) {
+ case SecItemRequestData::CopyMatching: {
+ CFTypeRef resultObject = 0;
+ OSStatus resultCode = SecItemCopyMatching(request.query(), &resultObject);
+ response = SecItemResponseData(resultCode, adoptCF(resultObject).get());
+ break;
+ }
+
+ case SecItemRequestData::Add: {
+ CFTypeRef resultObject = 0;
+ OSStatus resultCode = SecItemAdd(request.query(), &resultObject);
+ response = SecItemResponseData(resultCode, adoptCF(resultObject).get());
+ break;
+ }
+
+ case SecItemRequestData::Update: {
+ OSStatus resultCode = SecItemUpdate(request.query(), request.attributesToMatch());
+ response = SecItemResponseData(resultCode, 0);
+ break;
+ }
+
+ case SecItemRequestData::Delete: {
+ OSStatus resultCode = SecItemDelete(request.query());
+ response = SecItemResponseData(resultCode, 0);
+ break;
+ }
+
+ default:
+ return;
+ }
+
+ connection->send(Messages::WebProcess::SecItemResponse(requestID, response), 0);
}
-void WebProcessProxy::secKeychainItemCopyContent(const SecKeychainItemRequestData& request, SecKeychainItemResponseData& response)
+void WebProcessProxy::secItemRequest(CoreIPC::Connection* connection, uint64_t requestID, const SecItemRequestData& request)
{
- SecKeychainItemRef item = request.keychainItem();
- SecItemClass itemClass;
- SecKeychainAttributeList* attrList = request.attributeList();
- UInt32 length = 0;
- void* outData = 0;
-
- OSStatus resultCode = SecKeychainItemCopyContent(item, &itemClass, attrList, &length, &outData);
-
- RetainPtr<CFDataRef> data(AdoptCF, CFDataCreate(0, static_cast<const UInt8*>(outData), length));
- response = SecKeychainItemResponseData(resultCode, itemClass, attrList, data.get());
-
- SecKeychainItemFreeContent(attrList, outData);
+ // Since we don't want the connection work queue to be held up, we do all
+ // keychain interaction work on a global dispatch queue.
+ dispatch_queue_t keychainWorkQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+ dispatch_async(keychainWorkQueue, bind(handleSecItemRequest, RefPtr<CoreIPC::Connection>(connection), requestID, request));
}
-void WebProcessProxy::secKeychainItemCreateFromContent(const SecKeychainItemRequestData& request, SecKeychainItemResponseData& response)
+static void handleSecKeychainItemRequest(CoreIPC::Connection* connection, uint64_t requestID, const SecKeychainItemRequestData& request)
{
- SecKeychainItemRef keychainItem;
-
- OSStatus resultCode = SecKeychainItemCreateFromContent(request.itemClass(), request.attributeList(), request.length(), request.data(), 0, 0, &keychainItem);
-
- response = SecKeychainItemResponseData(resultCode, RetainPtr<SecKeychainItemRef>(AdoptCF, keychainItem));
+ SecKeychainItemResponseData response;
+
+ switch (request.type()) {
+ case SecKeychainItemRequestData::CopyContent: {
+ SecKeychainItemRef item = request.keychainItem();
+ SecItemClass itemClass;
+ SecKeychainAttributeList* attrList = request.attributeList();
+ UInt32 length = 0;
+ void* outData = 0;
+
+ OSStatus resultCode = SecKeychainItemCopyContent(item, &itemClass, attrList, &length, &outData);
+ RetainPtr<CFDataRef> data(AdoptCF, CFDataCreate(0, static_cast<const UInt8*>(outData), length));
+ response = SecKeychainItemResponseData(resultCode, itemClass, attrList, data.get());
+
+ SecKeychainItemFreeContent(attrList, outData);
+ break;
+ }
+
+ case SecKeychainItemRequestData::CreateFromContent: {
+ SecKeychainItemRef keychainItem;
+
+ OSStatus resultCode = SecKeychainItemCreateFromContent(request.itemClass(), request.attributeList(), request.length(), request.data(), 0, 0, &keychainItem);
+ response = SecKeychainItemResponseData(resultCode, adoptCF(keychainItem));
+ break;
+ }
+
+ case SecKeychainItemRequestData::ModifyContent: {
+ OSStatus resultCode = SecKeychainItemModifyContent(request.keychainItem(), request.attributeList(), request.length(), request.data());
+ response = resultCode;
+ break;
+ }
+
+ default:
+ return;
+ }
+
+ connection->send(Messages::WebProcess::SecKeychainItemResponse(requestID, response), 0);
}
-void WebProcessProxy::secKeychainItemModifyContent(const SecKeychainItemRequestData& request, SecKeychainItemResponseData& response)
+void WebProcessProxy::secKeychainItemRequest(CoreIPC::Connection* connection, uint64_t requestID, const SecKeychainItemRequestData& request)
{
- OSStatus resultCode = SecKeychainItemModifyContent(request.keychainItem(), request.attributeList(), request.length(), request.data());
-
- response = resultCode;
+ // Since we don't want the connection work queue to be held up, we do all
+ // keychain interaction work on a global dispatch queue.
+ dispatch_queue_t keychainWorkQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+ dispatch_async(keychainWorkQueue, bind(handleSecKeychainItemRequest, RefPtr<CoreIPC::Connection>(connection), requestID, request));
}
bool WebProcessProxy::fullKeyboardAccessEnabled()
diff --git a/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp b/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
index a1dd272a7..60736b1df 100644
--- a/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
@@ -460,7 +460,8 @@ void LayerTreeHostProxy::ensureRootLayer()
// The root layer should not have zero size, or it would be optimized out.
m_rootLayer->setSize(FloatSize(1.0, 1.0));
- m_textureMapper = TextureMapperGL::create();
+ if (!m_textureMapper)
+ m_textureMapper = TextureMapperGL::create();
toTextureMapperNode(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
}
@@ -623,7 +624,9 @@ void LayerTreeHostProxy::purgeGLResources()
{
TextureMapperNode* node = toTextureMapperNode(rootLayer());
- node->purgeNodeTexturesRecursive();
+ if (node)
+ node->purgeNodeTexturesRecursive();
+
m_directlyCompositedImages.clear();
m_textureMapper.clear();
diff --git a/Source/WebKit2/UIProcess/qt/QtPageClient.cpp b/Source/WebKit2/UIProcess/qt/QtPageClient.cpp
index b173776d8..cc96876be 100644
--- a/Source/WebKit2/UIProcess/qt/QtPageClient.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtPageClient.cpp
@@ -195,6 +195,20 @@ void QtPageClient::didReceiveMessageFromNavigatorQtObject(const String& message)
QQuickWebViewPrivate::get(m_webView)->didReceiveMessageFromNavigatorQtObject(message);
}
+void QtPageClient::updateTextInputState()
+{
+ ASSERT(m_eventHandler);
+ m_eventHandler->updateTextInputState();
+}
+
+#if ENABLE(GESTURE_EVENTS)
+void QtPageClient::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled)
+{
+ ASSERT(m_eventHandler);
+ m_eventHandler->doneWithGestureEvent(event, wasEventHandled);
+}
+#endif
+
#if ENABLE(TOUCH_EVENTS)
void QtPageClient::doneWithTouchEvent(const NativeWebTouchEvent& event, bool wasEventHandled)
{
diff --git a/Source/WebKit2/UIProcess/qt/QtPageClient.h b/Source/WebKit2/UIProcess/qt/QtPageClient.h
index a3149b631..7715026f8 100644
--- a/Source/WebKit2/UIProcess/qt/QtPageClient.h
+++ b/Source/WebKit2/UIProcess/qt/QtPageClient.h
@@ -93,10 +93,9 @@ public:
virtual void countStringMatchesInCustomRepresentation(const String&, WebKit::FindOptions, unsigned maxMatchCount) { }
virtual void didFindZoomableArea(const WebCore::IntPoint&, const WebCore::IntRect&);
virtual void focusEditableArea(const WebCore::IntRect&, const WebCore::IntRect&);
-
-#if ENABLE(TOUCH_EVENTS)
+ virtual void updateTextInputState();
+ virtual void doneWithGestureEvent(const WebGestureEvent&, bool wasEventHandled);
virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
-#endif
private:
QQuickWebView* m_webView;
diff --git a/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp b/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp
index 9167792c4..7699ad366 100644
--- a/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtPinchGestureRecognizer.cpp
@@ -112,8 +112,8 @@ bool QtPinchGestureRecognizer::recognize(const QTouchEvent* event)
const qreal currentSpanDistance = QLineF(point1.screenPos(), point2.screenPos()).length();
const qreal initialSpanDistance = QLineF(m_point1.initialScreenPosition, m_point2.initialScreenPosition).length();
const qreal totalScaleFactor = currentSpanDistance / initialSpanDistance;
- const QPointF touchCenterInPageViewCoordinates = computePinchCenter(point1, point2);
- interactionEngine()->pinchGestureRequestUpdate(touchCenterInPageViewCoordinates, totalScaleFactor);
+ const QPointF touchCenterInViewCoordinates = computePinchCenter(point1, point2);
+ interactionEngine()->pinchGestureRequestUpdate(touchCenterInViewCoordinates, totalScaleFactor);
return true;
break;
}
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
index 788349ae0..d12eb0bbd 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp
@@ -23,10 +23,13 @@
#include "QtViewportInteractionEngine.h"
#include "PassOwnPtr.h"
+#include "qquickwebpage_p.h"
+#include "qquickwebview_p.h"
#include <QPointF>
#include <QScrollEvent>
#include <QScrollPrepareEvent>
#include <QScrollerProperties>
+#include <QTransform>
#include <QWheelEvent>
#include <QtQuick/qquickitem.h>
@@ -111,7 +114,7 @@ inline QRectF QtViewportInteractionEngine::itemRectFromCSS(const QRectF& cssRect
return itemRect;
}
-QtViewportInteractionEngine::QtViewportInteractionEngine(const QQuickItem* viewport, QQuickItem* content)
+QtViewportInteractionEngine::QtViewportInteractionEngine(const QQuickWebView* viewport, QQuickWebPage* content)
: m_viewport(viewport)
, m_content(content)
, m_suspendCount(0)
@@ -174,7 +177,7 @@ void QtViewportInteractionEngine::setItemRectVisible(const QRectF& itemRect)
qreal itemScale = m_viewport->width() / itemRect.width();
- m_content->setScale(itemScale);
+ m_content->setContentScale(itemScale);
// We need to animate the content but the position represents the viewport hence we need to invert the position here.
// To animate the position together with the scale we multiply the position with the current scale;
@@ -183,7 +186,7 @@ void QtViewportInteractionEngine::setItemRectVisible(const QRectF& itemRect)
bool QtViewportInteractionEngine::animateItemRectVisible(const QRectF& itemRect)
{
- QRectF currentItemRectVisible = m_content->mapRectFromItem(m_viewport, m_viewport->boundingRect());
+ QRectF currentItemRectVisible = m_viewport->mapRectToWebContent(m_viewport->boundingRect());
if (itemRect == currentItemRectVisible)
return false;
@@ -238,7 +241,7 @@ bool QtViewportInteractionEngine::event(QEvent* event)
QScrollPrepareEvent* prepareEvent = static_cast<QScrollPrepareEvent*>(event);
const QRectF viewportRect = m_viewport->boundingRect();
const QRectF contentRect = m_viewport->mapRectFromItem(m_content, m_content->boundingRect());
- const QRectF posRange = computePosRangeForItemAtScale(m_content->scale());
+ const QRectF posRange = computePosRangeForItemAtScale(m_content->contentScale());
prepareEvent->setContentPosRange(posRange);
prepareEvent->setViewportSize(viewportRect.size());
@@ -251,11 +254,11 @@ bool QtViewportInteractionEngine::event(QEvent* event)
QScrollEvent* scrollEvent = static_cast<QScrollEvent*>(event);
QPointF newPos = -scrollEvent->contentPos() - scrollEvent->overshootDistance();
if (m_content->pos() != newPos) {
- QPointF currentPosInContentCoordinates = m_content->mapToItem(m_content->parentItem(), m_content->pos());
- QPointF newPosInContentCoordinates = m_content->mapToItem(m_content->parentItem(), newPos);
+ QPointF currentPosInCSSCoordinates = m_viewport->mapToWebContent(m_content->pos());
+ QPointF newPosInCSSCoordinates = m_viewport->mapToWebContent(newPos);
// This must be emitted before viewportUpdateRequested so that the web process knows where to look for tiles.
- emit viewportTrajectoryVectorChanged(currentPosInContentCoordinates- newPosInContentCoordinates);
+ emit viewportTrajectoryVectorChanged(currentPosInCSSCoordinates - newPosInCSSCoordinates);
m_content->setPos(newPos);
}
return true;
@@ -297,7 +300,7 @@ void QtViewportInteractionEngine::wheelEvent(QWheelEvent* ev)
else
newPos.ry() += delta;
- QRectF endPosRange = computePosRangeForItemAtScale(m_content->scale());
+ QRectF endPosRange = computePosRangeForItemAtScale(m_content->contentScale());
m_content->setPos(-boundPosition(endPosRange.topLeft(), newPos, endPosRange.bottomRight()));
}
@@ -307,7 +310,7 @@ void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition
if (m_suspendCount)
return;
- qreal endItemScale = m_content->scale(); // Stay at same scale.
+ qreal endItemScale = m_content->contentScale(); // Stay at same scale.
QRectF endPosRange = computePosRangeForItemAtScale(endItemScale);
QPointF endPosition = boundPosition(endPosRange.topLeft(), pagePosition * endItemScale, endPosRange.bottomRight());
@@ -319,7 +322,7 @@ void QtViewportInteractionEngine::pagePositionRequest(const QPoint& pagePosition
QRectF QtViewportInteractionEngine::computePosRangeForItemAtScale(qreal itemScale) const
{
- const QSizeF contentItemSize = m_content->boundingRect().size() * itemScale;
+ const QSizeF contentItemSize = m_content->contentSize() * itemScale;
const QSizeF viewportItemSize = m_viewport->boundingRect().size();
const qreal horizontalRange = contentItemSize.width() - viewportItemSize.width();
@@ -406,7 +409,7 @@ bool QtViewportInteractionEngine::ensureContentWithinViewportBoundary(bool immed
const QRectF viewportRect = m_viewport->boundingRect();
QPointF viewportHotspot = viewportRect.center();
- QPointF endPosition = m_content->mapFromItem(m_viewport, viewportHotspot) * endItemScale - viewportHotspot;
+ QPointF endPosition = m_viewport->mapToWebContent(viewportHotspot) * endItemScale - viewportHotspot;
QRectF endPosRange = computePosRangeForItemAtScale(endItemScale);
endPosition = boundPosition(endPosRange.topLeft(), endPosition, endPosRange.bottomRight());
@@ -441,7 +444,7 @@ void QtViewportInteractionEngine::applyConstraints(const Constraints& constraint
if (!m_hadUserInteraction) {
qreal initialScale = innerBoundedCSSScale(m_constraints.initialScale);
- m_content->setScale(itemScaleFromCSS(initialScale));
+ m_content->setContentScale(itemScaleFromCSS(initialScale));
}
// If the web app changes successively changes the viewport on purpose
@@ -451,7 +454,7 @@ void QtViewportInteractionEngine::applyConstraints(const Constraints& constraint
qreal QtViewportInteractionEngine::currentCSSScale()
{
- return cssScaleFromItem(m_content->scale());
+ return cssScaleFromItem(m_content->contentScale());
}
bool QtViewportInteractionEngine::scrollAnimationActive() const
@@ -473,15 +476,15 @@ bool QtViewportInteractionEngine::panGestureActive() const
return scroller->state() == QScroller::Pressed || scroller->state() == QScroller::Dragging;
}
-void QtViewportInteractionEngine::panGestureStarted(const QPointF& touchPoint, qint64 eventTimestampMillis)
+void QtViewportInteractionEngine::panGestureStarted(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis)
{
m_hadUserInteraction = true;
- scroller()->handleInput(QScroller::InputPress, m_viewport->mapFromItem(m_content, touchPoint), eventTimestampMillis);
+ scroller()->handleInput(QScroller::InputPress, viewportTouchPoint, eventTimestampMillis);
}
-void QtViewportInteractionEngine::panGestureRequestUpdate(const QPointF& touchPoint, qint64 eventTimestampMillis)
+void QtViewportInteractionEngine::panGestureRequestUpdate(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis)
{
- scroller()->handleInput(QScroller::InputMove, m_viewport->mapFromItem(m_content, touchPoint), eventTimestampMillis);
+ scroller()->handleInput(QScroller::InputMove, viewportTouchPoint, eventTimestampMillis);
}
void QtViewportInteractionEngine::panGestureCancelled()
@@ -491,9 +494,9 @@ void QtViewportInteractionEngine::panGestureCancelled()
scroller()->stop();
}
-void QtViewportInteractionEngine::panGestureEnded(const QPointF& touchPoint, qint64 eventTimestampMillis)
+void QtViewportInteractionEngine::panGestureEnded(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis)
{
- scroller()->handleInput(QScroller::InputRelease, m_viewport->mapFromItem(m_content, touchPoint), eventTimestampMillis);
+ scroller()->handleInput(QScroller::InputRelease, viewportTouchPoint, eventTimestampMillis);
}
bool QtViewportInteractionEngine::scaleAnimationActive() const
@@ -512,7 +515,7 @@ bool QtViewportInteractionEngine::pinchGestureActive() const
return m_pinchStartScale > 0;
}
-void QtViewportInteractionEngine::pinchGestureStarted(const QPointF& pinchCenterInContentCoordinates)
+void QtViewportInteractionEngine::pinchGestureStarted(const QPointF& pinchCenterInViewportCoordinates)
{
ASSERT(!m_suspendCount);
@@ -523,14 +526,14 @@ void QtViewportInteractionEngine::pinchGestureStarted(const QPointF& pinchCenter
m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this));
- m_lastPinchCenterInViewportCoordinates = m_viewport->mapFromItem(m_content, pinchCenterInContentCoordinates);
- m_pinchStartScale = m_content->scale();
+ m_lastPinchCenterInViewportCoordinates = pinchCenterInViewportCoordinates;
+ m_pinchStartScale = m_content->contentScale();
// Reset the tiling look-ahead vector so that tiles all around the viewport will be requested on pinch-end.
emit viewportTrajectoryVectorChanged(QPointF());
}
-void QtViewportInteractionEngine::pinchGestureRequestUpdate(const QPointF& pinchCenterInContentCoordinates, qreal totalScaleFactor)
+void QtViewportInteractionEngine::pinchGestureRequestUpdate(const QPointF& pinchCenterInViewportCoordinates, qreal totalScaleFactor)
{
ASSERT(m_suspendCount);
@@ -544,12 +547,11 @@ void QtViewportInteractionEngine::pinchGestureRequestUpdate(const QPointF& pinch
// Allow zooming out beyond mimimum scale on pages that do not explicitly disallow it.
const qreal targetCSSScale = outerBoundedCSSScale(cssScale);
- QPointF pinchCenterInViewportCoordinates = m_viewport->mapFromItem(m_content, pinchCenterInContentCoordinates);
-
- scaleContent(pinchCenterInContentCoordinates, targetCSSScale);
+ scaleContent(m_viewport->mapToWebContent(pinchCenterInViewportCoordinates), targetCSSScale);
const QPointF positionDiff = pinchCenterInViewportCoordinates - m_lastPinchCenterInViewportCoordinates;
m_lastPinchCenterInViewportCoordinates = pinchCenterInViewportCoordinates;
+
m_content->setPos(m_content->pos() + positionDiff);
}
@@ -576,12 +578,12 @@ void QtViewportInteractionEngine::itemSizeChanged()
ensureContentWithinViewportBoundary();
}
-void QtViewportInteractionEngine::scaleContent(const QPointF& centerInContentCoordinates, qreal cssScale)
+void QtViewportInteractionEngine::scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale)
{
- QPointF oldPinchCenterOnParent = m_content->mapToItem(m_content->parentItem(), centerInContentCoordinates);
- m_content->setScale(itemScaleFromCSS(cssScale));
- QPointF newPinchCenterOnParent = m_content->mapToItem(m_content->parentItem(), centerInContentCoordinates);
- m_content->setPos(m_content->pos() - (newPinchCenterOnParent - oldPinchCenterOnParent));
+ QPointF oldPinchCenterOnViewport = m_viewport->mapFromWebContent(centerInCSSCoordinates);
+ m_content->setContentScale(itemScaleFromCSS(cssScale));
+ QPointF newPinchCenterOnViewport = m_viewport->mapFromWebContent(centerInCSSCoordinates);
+ m_content->setPos(m_content->pos() - (newPinchCenterOnViewport - oldPinchCenterOnViewport));
}
#include "moc_QtViewportInteractionEngine.cpp"
diff --git a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
index 68377a41c..1790c72ed 100644
--- a/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
+++ b/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h
@@ -33,6 +33,8 @@
QT_BEGIN_NAMESPACE
class QPointF;
class QQuickItem;
+class QQuickWebPage;
+class QQuickWebView;
class QWheelEvent;
QT_END_NAMESPACE
@@ -44,7 +46,7 @@ class QtViewportInteractionEngine : public QObject {
Q_OBJECT
public:
- QtViewportInteractionEngine(const QQuickItem*, QQuickItem*);
+ QtViewportInteractionEngine(const QQuickWebView*, QQuickWebPage*);
~QtViewportInteractionEngine();
struct Constraints {
@@ -80,17 +82,17 @@ public:
void interruptScrollAnimation();
bool panGestureActive() const;
- void panGestureStarted(const QPointF& touchPoint, qint64 eventTimestampMillis);
- void panGestureRequestUpdate(const QPointF& touchPoint, qint64 eventTimestampMillis);
+ void panGestureStarted(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis);
+ void panGestureRequestUpdate(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis);
void panGestureCancelled();
- void panGestureEnded(const QPointF& touchPoint, qint64 eventTimestampMillis);
+ void panGestureEnded(const QPointF& viewportTouchPoint, qint64 eventTimestampMillis);
bool scaleAnimationActive() const;
void interruptScaleAnimation();
bool pinchGestureActive() const;
- void pinchGestureStarted(const QPointF& pinchCenterInContentCoordinates);
- void pinchGestureRequestUpdate(const QPointF& pinchCenterInContentCoordinates, qreal totalScaleFactor);
+ void pinchGestureStarted(const QPointF& pinchCenterInViewportCoordinates);
+ void pinchGestureRequestUpdate(const QPointF& pinchCenterInViewportCoordinates, qreal totalScaleFactor);
void pinchGestureEnded();
void zoomToAreaGestureEnded(const QPointF& touchPoint, const QRectF& targetArea);
@@ -127,14 +129,14 @@ private:
QRectF computePosRangeForItemAtScale(qreal itemScale) const;
bool ensureContentWithinViewportBoundary(bool immediate = false);
- void scaleContent(const QPointF& centerInContentCoordinates, qreal scale);
+ void scaleContent(const QPointF& centerInCSSCoordinates, qreal cssScale);
// As long as the object exists this function will always return the same QScroller instance.
QScroller* scroller() { return QScroller::scroller(this); }
- const QQuickItem* const m_viewport;
- QQuickItem* const m_content;
+ const QQuickWebView* const m_viewport;
+ QQuickWebPage* const m_content;
Constraints m_constraints;
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
index d0196880d..e5175201a 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
@@ -29,11 +29,13 @@
#include <QDrag>
#include <QGraphicsSceneMouseEvent>
#include <QGuiApplication>
+#include <QInputPanel>
#include <QMimeData>
#include <QtQuick/QQuickCanvas>
#include <QStyleHints>
#include <QTextFormat>
#include <QTouchEvent>
+#include <QTransform>
#include <WebCore/DragData.h>
#include <WebCore/Editor.h>
@@ -90,6 +92,7 @@ QtWebPageEventHandler::QtWebPageEventHandler(WKPageRef pageRef, QQuickWebPage* q
, m_webPage(qmlWebPage)
, m_previousClickButton(Qt::NoButton)
, m_clickCount(0)
+ , m_postponeTextInputStateChanged(false)
{
}
@@ -139,7 +142,7 @@ bool QtWebPageEventHandler::handleEvent(QEvent* ev)
return true;
case QEvent::InputMethod:
inputMethodEvent(static_cast<QInputMethodEvent*>(ev));
- return false; // Look at comment in qquickwebpage.cpp
+ return false; // This is necessary to avoid an endless loop in connection with QQuickItem::event().
}
// FIXME: Move all common event handling here.
@@ -154,42 +157,50 @@ bool QtWebPageEventHandler::handleMouseMoveEvent(QMouseEvent* ev)
// NOTE: lastPos from the event always comes empty, so we work
// around that here.
static QPointF lastPos = QPointF();
- if (lastPos == ev->pos())
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ QPointF webPagePoint = fromItemTransform.map(ev->localPos());
+ if (lastPos == webPagePoint)
return ev->isAccepted();
- lastPos = ev->pos();
+ lastPos = webPagePoint;
- m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount*/ 0));
+ m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, fromItemTransform, /*eventClickCount*/ 0));
return ev->isAccepted();
}
bool QtWebPageEventHandler::handleMousePressEvent(QMouseEvent* ev)
{
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ QPointF webPagePoint = fromItemTransform.map(ev->localPos());
+
if (m_clickTimer.isActive()
&& m_previousClickButton == ev->button()
- && (ev->pos() - m_lastClick).manhattanLength() < qApp->styleHints()->startDragDistance()) {
+ && (webPagePoint - m_lastClick).manhattanLength() < qApp->styleHints()->startDragDistance()) {
m_clickCount++;
} else {
m_clickCount = 1;
m_previousClickButton = ev->button();
}
- m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, m_clickCount));
+ m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, fromItemTransform, m_clickCount));
- m_lastClick = ev->pos();
+ m_lastClick = webPagePoint;
m_clickTimer.start(qApp->styleHints()->mouseDoubleClickInterval(), this);
+
return ev->isAccepted();
}
bool QtWebPageEventHandler::handleMouseReleaseEvent(QMouseEvent* ev)
{
- m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, /*eventClickCount*/ 0));
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ m_webPageProxy->handleMouseEvent(NativeWebMouseEvent(ev, fromItemTransform, /*eventClickCount*/ 0));
return ev->isAccepted();
}
bool QtWebPageEventHandler::handleWheelEvent(QWheelEvent* ev)
{
- m_webPageProxy->handleWheelEvent(NativeWebWheelEvent(ev));
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ m_webPageProxy->handleWheelEvent(NativeWebWheelEvent(ev, fromItemTransform));
// FIXME: Handle whether the page used the wheel event or not.
if (m_interactionEngine)
m_interactionEngine->wheelEvent(ev);
@@ -200,14 +211,16 @@ bool QtWebPageEventHandler::handleHoverLeaveEvent(QHoverEvent* ev)
{
// To get the correct behavior of mouseout, we need to turn the Leave event of our webview into a mouse move
// to a very far region.
- QHoverEvent fakeEvent(QEvent::HoverMove, QPoint(INT_MIN, INT_MIN), ev->oldPos());
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ QHoverEvent fakeEvent(QEvent::HoverMove, QPoint(INT_MIN, INT_MIN), fromItemTransform.map(ev->oldPosF()));
fakeEvent.setTimestamp(ev->timestamp());
return handleHoverMoveEvent(&fakeEvent);
}
bool QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev)
{
- QMouseEvent me(QEvent::MouseMove, ev->pos(), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ QMouseEvent me(QEvent::MouseMove, fromItemTransform.map(ev->posF()), Qt::NoButton, Qt::NoButton, Qt::NoModifier);
me.setAccepted(ev->isAccepted());
me.setTimestamp(ev->timestamp());
@@ -217,8 +230,9 @@ bool QtWebPageEventHandler::handleHoverMoveEvent(QHoverEvent* ev)
bool QtWebPageEventHandler::handleDragEnterEvent(QDragEnterEvent* ev)
{
m_webPageProxy->resetDragOperation();
+ QTransform fromItemTransform = m_webPage->transformFromItem();
// FIXME: Should not use QCursor::pos()
- DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
+ DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
m_webPageProxy->dragEntered(&dragData);
ev->acceptProposedAction();
return true;
@@ -241,8 +255,9 @@ bool QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev)
{
bool accepted = ev->isAccepted();
+ QTransform fromItemTransform = m_webPage->transformFromItem();
// FIXME: Should not use QCursor::pos()
- DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
+ DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
m_webPageProxy->dragUpdated(&dragData);
ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation));
if (m_webPageProxy->dragSession().operation != DragOperationNone)
@@ -255,9 +270,9 @@ bool QtWebPageEventHandler::handleDragMoveEvent(QDragMoveEvent* ev)
bool QtWebPageEventHandler::handleDropEvent(QDropEvent* ev)
{
bool accepted = ev->isAccepted();
-
+ QTransform fromItemTransform = m_webPage->transformFromItem();
// FIXME: Should not use QCursor::pos()
- DragData dragData(ev->mimeData(), ev->pos(), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
+ DragData dragData(ev->mimeData(), fromItemTransform.map(ev->pos()), QCursor::pos(), dropActionToDragOperation(ev->possibleActions()));
SandboxExtension::Handle handle;
m_webPageProxy->performDrag(&dragData, String(), handle);
ev->setDropAction(dragOperationToDropAction(m_webPageProxy->dragSession().operation));
@@ -269,13 +284,17 @@ bool QtWebPageEventHandler::handleDropEvent(QDropEvent* ev)
void QtWebPageEventHandler::handleSingleTapEvent(const QTouchEvent::TouchPoint& point)
{
- WebGestureEvent gesture(WebEvent::GestureSingleTap, point.pos().toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0);
+ m_postponeTextInputStateChanged = true;
+
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ WebGestureEvent gesture(WebEvent::GestureSingleTap, fromItemTransform.map(point.pos()).toPoint(), point.screenPos().toPoint(), WebEvent::Modifiers(0), 0);
m_webPageProxy->handleGestureEvent(gesture);
}
void QtWebPageEventHandler::handleDoubleTapEvent(const QTouchEvent::TouchPoint& point)
{
- m_webPageProxy->findZoomableAreaForPoint(point.pos().toPoint());
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ m_webPageProxy->findZoomableAreaForPoint(fromItemTransform.map(point.pos()).toPoint());
}
void QtWebPageEventHandler::timerEvent(QTimerEvent* ev)
@@ -386,11 +405,12 @@ void QtWebPageEventHandler::inputMethodEvent(QInputMethodEvent* ev)
void QtWebPageEventHandler::touchEvent(QTouchEvent* event)
{
#if ENABLE(TOUCH_EVENTS)
- m_webPageProxy->handleTouchEvent(NativeWebTouchEvent(event));
+ QTransform fromItemTransform = m_webPage->transformFromItem();
+ m_webPageProxy->handleTouchEvent(NativeWebTouchEvent(event, fromItemTransform));
event->accept();
#else
ASSERT_NOT_REACHED();
- ev->ignore();
+ event->ignore();
#endif
}
@@ -401,6 +421,42 @@ void QtWebPageEventHandler::resetGestureRecognizers()
m_tapGestureRecognizer.reset();
}
+static void setInputPanelVisible(bool visible)
+{
+ if (qApp->inputPanel()->visible() == visible)
+ return;
+
+ qApp->inputPanel()->setVisible(visible);
+}
+
+void QtWebPageEventHandler::updateTextInputState()
+{
+ if (m_postponeTextInputStateChanged)
+ return;
+
+ const EditorState& editor = m_webPageProxy->editorState();
+
+ // Ignore input method requests not due to a tap gesture.
+ if (!editor.isContentEditable)
+ setInputPanelVisible(false);
+}
+
+void QtWebPageEventHandler::doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled)
+{
+ if (event.type() != WebEvent::GestureSingleTap)
+ return;
+
+ m_postponeTextInputStateChanged = false;
+
+ if (!wasEventHandled)
+ return;
+
+ const EditorState& editor = m_webPageProxy->editorState();
+ bool newVisible = editor.isContentEditable;
+
+ setInputPanelVisible(newVisible);
+}
+
void QtWebPageEventHandler::doneWithTouchEvent(const NativeWebTouchEvent& event, bool wasEventHandled)
{
if (!m_interactionEngine)
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
index dfab4c8b9..f5b7fb317 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.h
@@ -52,6 +52,8 @@ public:
void didFindZoomableArea(const WebCore::IntPoint& target, const WebCore::IntRect& area);
void focusEditableArea(const WebCore::IntRect& caret, const WebCore::IntRect& area);
+ void updateTextInputState();
+ void doneWithGestureEvent(const WebGestureEvent& event, bool wasEventHandled);
void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
void resetGestureRecognizers();
@@ -88,10 +90,11 @@ private:
void touchEvent(QTouchEvent*);
void inputMethodEvent(QInputMethodEvent*);
- QPoint m_lastClick;
+ QPointF m_lastClick;
QBasicTimer m_clickTimer;
Qt::MouseButton m_previousClickButton;
int m_clickCount;
+ bool m_postponeTextInputStateChanged;
};
#endif /* QtWebPageEventHandler_h */
diff --git a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 8aff50214..f851edc74 100644
--- a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -204,6 +204,7 @@
1AAF0C4B12B16334008E49E2 /* ArgumentCodersCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF0C4912B16334008E49E2 /* ArgumentCodersCF.cpp */; };
1AAF263814687C39004A1E8A /* TiledCoreAnimationDrawingArea.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AAF263614687C39004A1E8A /* TiledCoreAnimationDrawingArea.mm */; };
1AAF263914687C39004A1E8A /* TiledCoreAnimationDrawingArea.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF263714687C39004A1E8A /* TiledCoreAnimationDrawingArea.h */; };
+ 1AB42E8714BBBBB2004272F7 /* KeychainShimResponseMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB42E8614BBBBB2004272F7 /* KeychainShimResponseMap.h */; };
1AB7D4CA1288AAA700CFD08C /* DownloadProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB7D4C81288AAA700CFD08C /* DownloadProxy.h */; };
1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D4C91288AAA700CFD08C /* DownloadProxy.cpp */; };
1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7D6171288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp */; };
@@ -455,8 +456,6 @@
9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */; };
9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */; };
939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */; };
- 93C01DAC139AC91700ED51D7 /* CoreIPCClientRunLoop.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C01DAA139AC91700ED51D7 /* CoreIPCClientRunLoop.h */; };
- 93C01DAD139AC91700ED51D7 /* CoreIPCClientRunLoop.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C01DAB139AC91700ED51D7 /* CoreIPCClientRunLoop.mm */; };
93FC67BD12D3CCF200A60610 /* DecoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */; };
93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FC679E12D3CC7400A60610 /* DecoderAdapter.h */; };
93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */; };
@@ -980,8 +979,8 @@
dstPath = WebKit2.framework;
dstSubfolderSpec = 1;
files = (
- 1A50DB66110A3D57000D3FE5 /* WebProcess.app in CopyFiles */,
BCDE0ABF13272708001259FB /* PluginProcess.app in CopyFiles */,
+ 1A50DB66110A3D57000D3FE5 /* WebProcess.app in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1197,6 +1196,7 @@
1AAF0C4912B16334008E49E2 /* ArgumentCodersCF.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = ArgumentCodersCF.cpp; sourceTree = "<group>"; };
1AAF263614687C39004A1E8A /* TiledCoreAnimationDrawingArea.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TiledCoreAnimationDrawingArea.mm; sourceTree = "<group>"; };
1AAF263714687C39004A1E8A /* TiledCoreAnimationDrawingArea.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TiledCoreAnimationDrawingArea.h; sourceTree = "<group>"; };
+ 1AB42E8614BBBBB2004272F7 /* KeychainShimResponseMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KeychainShimResponseMap.h; sourceTree = "<group>"; };
1AB7D4C81288AAA700CFD08C /* DownloadProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DownloadProxy.h; sourceTree = "<group>"; };
1AB7D4C91288AAA700CFD08C /* DownloadProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DownloadProxy.cpp; sourceTree = "<group>"; };
1AB7D5E91288B8C000CFD08C /* DownloadProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DownloadProxy.messages.in; sourceTree = "<group>"; };
@@ -1472,8 +1472,6 @@
9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameNetworkingContext.h; sourceTree = "<group>"; };
9391F284121B38F500EBF7E8 /* WebFrameNetworkingContext.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameNetworkingContext.mm; sourceTree = "<group>"; };
939AE7651316E99C00AE06A6 /* WebCoreArgumentCoders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCoreArgumentCoders.cpp; sourceTree = "<group>"; };
- 93C01DAA139AC91700ED51D7 /* CoreIPCClientRunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreIPCClientRunLoop.h; sourceTree = "<group>"; };
- 93C01DAB139AC91700ED51D7 /* CoreIPCClientRunLoop.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CoreIPCClientRunLoop.mm; sourceTree = "<group>"; };
93FC679D12D3CC7400A60610 /* DecoderAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DecoderAdapter.cpp; sourceTree = "<group>"; };
93FC679E12D3CC7400A60610 /* DecoderAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecoderAdapter.h; sourceTree = "<group>"; };
93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EncoderAdapter.cpp; sourceTree = "<group>"; };
@@ -1997,12 +1995,12 @@
1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */,
8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
BCD0042D110C1E27003B8A67 /* CoreServices.framework in Frameworks */,
+ CDCA85D5132AC2B300E961DF /* IOKit.framework in Frameworks */,
BC617EE8104CB34700FB3FE1 /* JavaScriptCore.framework in Frameworks */,
BC87DFAA1018101400564216 /* libicucore.dylib in Frameworks */,
1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */,
- 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */,
BCF5068512431861005955AE /* Security.framework in Frameworks */,
- CDCA85D5132AC2B300E961DF /* IOKit.framework in Frameworks */,
+ 1A1C4EC810D06099005E67E7 /* WebCore.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2012,10 +2010,10 @@
034768DFFF38A50411DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
+ BCDE094213272496001259FB /* PluginProcess.app */,
+ 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */,
8DC2EF5B0486A6940098B216 /* WebKit2.framework */,
1A50DB1E110A3BDC000D3FE5 /* WebProcess.app */,
- 1AC25FB012A48EA700BD2671 /* PluginProcessShim.dylib */,
- BCDE094213272496001259FB /* PluginProcess.app */,
510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */,
);
name = Products;
@@ -2081,8 +2079,8 @@
1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */,
BC87DFA91018101400564216 /* libicucore.dylib */,
1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */,
- 1AA1C79A100E7FC50078DEBC /* WebCore.framework */,
BCF5068412431861005955AE /* Security.framework */,
+ 1AA1C79A100E7FC50078DEBC /* WebCore.framework */,
);
name = "Linked Frameworks";
sourceTree = "<group>";
@@ -2120,10 +2118,10 @@
isa = PBXGroup;
children = (
1A2D91A51281D739001EB962 /* PluginControllerProxyMac.mm */,
- 1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */,
1AA4792212A59FD9008236C3 /* PluginProcessMac.mm */,
- 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */,
+ 1A0EC802124BD41E007EF4A5 /* PluginProcessMainMac.mm */,
1AC25F8912A48E0300BD2671 /* PluginProcessShim.h */,
+ 1AC25F8A12A48E0300BD2671 /* PluginProcessShim.mm */,
);
path = mac;
sourceTree = "<group>";
@@ -2149,12 +2147,12 @@
1A4F9769100E7B6600637A18 /* Configurations */ = {
isa = PBXGroup;
children = (
- 5183B3931379F85C00E8754E /* Shim.xcconfig */,
1A4F976A100E7B6600637A18 /* Base.xcconfig */,
5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */,
1A4F976B100E7B6600637A18 /* DebugRelease.xcconfig */,
1A4F976C100E7B6600637A18 /* FeatureDefines.xcconfig */,
BC122FA3132707F300F7EAC1 /* PluginProcess.xcconfig */,
+ 5183B3931379F85C00E8754E /* Shim.xcconfig */,
1A4F976E100E7B6600637A18 /* Version.xcconfig */,
BCB86F4B116AAACD00CE20B7 /* WebKit2.xcconfig */,
5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */,
@@ -2187,10 +2185,9 @@
1A6FA01C11E1526300DB1371 /* mac */ = {
isa = PBXGroup;
children = (
- 93C01DAA139AC91700ED51D7 /* CoreIPCClientRunLoop.h */,
- 93C01DAB139AC91700ED51D7 /* CoreIPCClientRunLoop.mm */,
512DF6D6138C181A00A22FC6 /* KeychainItemShimMethods.h */,
512DF6D7138C181A00A22FC6 /* KeychainItemShimMethods.mm */,
+ 1AB42E8614BBBBB2004272F7 /* KeychainShimResponseMap.h */,
511F8A7D138B46FE00A95F44 /* SecItemShimMethods.h */,
511F8A7E138B46FE00A95F44 /* SecItemShimMethods.mm */,
BC3065C312592F8900E71278 /* WebProcessMac.mm */,
@@ -2204,8 +2201,8 @@
1A6FB7AA11E64B4900DB1371 /* Plugins */ = {
isa = PBXGroup;
children = (
- E199875B142BF9CF00BB2DE7 /* PDF */,
1A6FB90811E66FB100DB1371 /* Netscape */,
+ E199875B142BF9CF00BB2DE7 /* PDF */,
1A6FB7D011E651E200DB1371 /* Plugin.cpp */,
1A6FB7D111E651E200DB1371 /* Plugin.h */,
1AA56F2811E92BC80061B882 /* PluginController.h */,
@@ -2231,18 +2228,18 @@
1AE49A4711FFA8CE0048B464 /* JSNPMethod.h */,
1AE4987711FF7FAA0048B464 /* JSNPObject.cpp */,
1AE4987611FF7FAA0048B464 /* JSNPObject.h */,
- 1AE4976711FF658E0048B464 /* NPJSObject.cpp */,
- 1AE4976611FF658E0048B464 /* NPJSObject.h */,
- 1A2161AF11F37664008AD0F5 /* NPRuntimeObjectMap.cpp */,
- 1A2161AE11F37664008AD0F5 /* NPRuntimeObjectMap.h */,
- 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */,
- 1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */,
1A6FBA2911E6862700DB1371 /* NetscapeBrowserFuncs.cpp */,
1A6FBA2811E6862700DB1371 /* NetscapeBrowserFuncs.h */,
1A6FBD2711E69BC200DB1371 /* NetscapePlugin.cpp */,
1A6FBD2611E69BC200DB1371 /* NetscapePlugin.h */,
1AA5889111EE70400061B882 /* NetscapePluginStream.cpp */,
1AA5889011EE70400061B882 /* NetscapePluginStream.h */,
+ 1AE4976711FF658E0048B464 /* NPJSObject.cpp */,
+ 1AE4976611FF658E0048B464 /* NPJSObject.h */,
+ 1A2161AF11F37664008AD0F5 /* NPRuntimeObjectMap.cpp */,
+ 1A2161AE11F37664008AD0F5 /* NPRuntimeObjectMap.h */,
+ 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */,
+ 1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */,
);
path = Netscape;
sourceTree = "<group>";
@@ -2311,6 +2308,9 @@
C517388012DF8F4F00EE3F47 /* DragControllerAction.h */,
0FB659221208B4DB0044816C /* DrawingAreaInfo.h */,
8CFECE931490F140002AAA32 /* EditorState.cpp */,
+ 1AA41AB412C02EC4002BE67B /* EditorState.h */,
+ BCE81D8A1319F7EF00241910 /* FontInfo.cpp */,
+ BCE81D8B1319F7EF00241910 /* FontInfo.h */,
762B7481120BBA0100819339 /* FontSmoothingLevel.h */,
F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */,
BCCF6B2312C93E7A008F9C35 /* ImageOptions.h */,
@@ -2332,14 +2332,11 @@
BCC43AB9127B95DC00317F16 /* PlatformPopupMenuData.h */,
E18C92F312DB9E7100CF2AEB /* PrintInfo.cpp */,
E1CC1B8E12D7EADF00625838 /* PrintInfo.h */,
- BCE81D8A1319F7EF00241910 /* FontInfo.cpp */,
- BCE81D8B1319F7EF00241910 /* FontInfo.h */,
F6A0C13F13281E6E0070430F /* ResourceCachesToClear.h */,
BC2D021612AC41CB00E732A3 /* SameDocumentNavigationType.h */,
1AAB4A8C1296F0A20023952F /* SandboxExtension.h */,
33152973130D0CB200ED2483 /* SecurityOriginData.cpp */,
33152974130D0CB200ED2483 /* SecurityOriginData.h */,
- 1AA41AB412C02EC4002BE67B /* EditorState.h */,
518D2CC812D51DFB003BB93B /* SessionState.cpp */,
518D2CC912D51DFB003BB93B /* SessionState.h */,
1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */,
@@ -2374,9 +2371,10 @@
BC032DB010F4380F0058C15A /* WebEventConversion.cpp */,
BC032DB110F4380F0058C15A /* WebEventConversion.h */,
1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */,
- 0F174AA2142A4CB60039250F /* WebGeometry.h */,
BC0E607212D6BC200012A72A /* WebGeolocationPosition.cpp */,
BC0E607112D6BC200012A72A /* WebGeolocationPosition.h */,
+ 0F174AA2142A4CB60039250F /* WebGeometry.h */,
+ BC9585C712F095B800755821 /* WebGestureEvent.cpp */,
BCA56A1B12F9028E00C566C7 /* WebGraphicsContext.cpp */,
BCA56A1A12F9028E00C566C7 /* WebGraphicsContext.h */,
7801C095142290C400FAF9AF /* WebHitTestResult.cpp */,
@@ -2413,7 +2411,6 @@
BC90A1D0122DD55E00CC8C50 /* WebURLResponse.h */,
F6113E24126CE1820057D0A7 /* WebUserContentURLPattern.h */,
C0337DD0127A2980008FF4F4 /* WebWheelEvent.cpp */,
- BC9585C712F095B800755821 /* WebGestureEvent.cpp */,
);
path = Shared;
sourceTree = "<group>";
@@ -2425,11 +2422,6 @@
children = (
1A9FBA8B13FF04E600DEED67 /* mac */,
1A4A9C5212B816CF008FE984 /* Netscape */,
- 1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */,
- 1A3D610013A7CC2A00F95D4E /* PluginModuleInfo.h */,
- 1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */,
- 1A2D90D01281C966001EB962 /* PluginProcessCreationParameters.h */,
- 1A4A9F3112B844E2008FE984 /* PluginQuirks.h */,
1A2D848A127F6A49001EB962 /* NPIdentifierData.cpp */,
1A2D8489127F6A49001EB962 /* NPIdentifierData.h */,
1A1FA35C127A45BF0050E709 /* NPObjectMessageReceiver.cpp */,
@@ -2441,6 +2433,11 @@
1A1FA251127A0E4F0050E709 /* NPRemoteObjectMap.h */,
1A2D84A2127F6AD1001EB962 /* NPVariantData.cpp */,
1A2D84A1127F6AD1001EB962 /* NPVariantData.h */,
+ 1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */,
+ 1A3D610013A7CC2A00F95D4E /* PluginModuleInfo.h */,
+ 1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */,
+ 1A2D90D01281C966001EB962 /* PluginProcessCreationParameters.h */,
+ 1A4A9F3112B844E2008FE984 /* PluginQuirks.h */,
);
path = Plugins;
sourceTree = "<group>";
@@ -2472,9 +2469,9 @@
1AC41AC51263C88300054E94 /* BinarySemaphore.h */,
BC032DA210F437D10058C15A /* Connection.cpp */,
BC032DA310F437D10058C15A /* Connection.h */,
+ BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */,
1A8EFDFD1253CB6E00F7067F /* DataReference.cpp */,
1A8EFDF91253CAA200F7067F /* DataReference.h */,
- BC131BC811726C2800B69727 /* CoreIPCMessageKinds.h */,
C0CE72AC1247E78D00BC0EC4 /* HandleMessage.h */,
BC032DA410F437D10058C15A /* MessageID.h */,
1A119A94127B796200A9ECB1 /* MessageSender.h */,
@@ -2534,10 +2531,10 @@
31A2EC401489973700810D71 /* Notifications */ = {
isa = PBXGroup;
children = (
- 31A2EC4F1489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp */,
- 31A2EC511489981500810D71 /* NotificationPermissionRequestManagerProxy.h */,
31A2EC541489982E00810D71 /* NotificationPermissionRequest.cpp */,
31A2EC531489982500810D71 /* NotificationPermissionRequest.h */,
+ 31A2EC4F1489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp */,
+ 31A2EC511489981500810D71 /* NotificationPermissionRequestManagerProxy.h */,
31A2EC41148997BE00810D71 /* WebNotification.cpp */,
31A2EC42148997BE00810D71 /* WebNotification.h */,
31A2EC43148997BE00810D71 /* WebNotificationManagerProxy.cpp */,
@@ -2705,11 +2702,11 @@
BC032D5C10F436D50058C15A /* WebProcess */ = {
isa = PBXGroup;
children = (
- CD73BA3D131A2A2100EEDED2 /* FullScreen */,
512E352A130B559900ABD19A /* ApplicationCache */,
512F588612A8834700629530 /* Authentication */,
3309344B1315B93A0097A7BC /* Cookies */,
1A61614C127798B5003ACD86 /* Downloads */,
+ CD73BA3D131A2A2100EEDED2 /* FullScreen */,
BC0E5FCB12D696DD0012A72A /* Geolocation */,
51FBB9C1132E079200F327B4 /* IconDatabase */,
BC204EDF11C83E72008F3375 /* InjectedBundle */,
@@ -2721,9 +2718,9 @@
3336762B130C9978006C9DE2 /* ResourceCache */,
BC032D5D10F437220058C15A /* WebCoreSupport */,
BC032D5E10F4372B0058C15A /* WebPage */,
- 1A6FA31511E3923600DB1371 /* WebKitMain.cpp */,
BCE9C0CF1485965D00E33D61 /* WebConnectionToUIProcess.cpp */,
BCE9C0D01485965D00E33D61 /* WebConnectionToUIProcess.h */,
+ 1A6FA31511E3923600DB1371 /* WebKitMain.cpp */,
BC111AE3112F5C2600337BAB /* WebProcess.cpp */,
BC032D9110F437AF0058C15A /* WebProcess.h */,
BC3066B9125A436300E71278 /* WebProcess.messages.in */,
@@ -2784,9 +2781,9 @@
1A6421F412DCFBAB00CAAE2C /* DrawingAreaImpl.h */,
93FC679F12D3CC7400A60610 /* EncoderAdapter.cpp */,
93FC67A012D3CC7400A60610 /* EncoderAdapter.h */,
- 1AA575FD1496B6F300A4EE06 /* EventDispatcher.messages.in */,
1AA575F81496B52600A4EE06 /* EventDispatcher.cpp */,
1AA575F91496B52600A4EE06 /* EventDispatcher.h */,
+ 1AA575FD1496B6F300A4EE06 /* EventDispatcher.messages.in */,
1A90C1F31264FD71003E44D4 /* FindController.cpp */,
1A90C1F21264FD71003E44D4 /* FindController.h */,
1A186EE912EF7618008E5F37 /* LayerTreeHost.cpp */,
@@ -2797,8 +2794,6 @@
BC72B9F911E6476B001EB4EA /* WebBackForwardListProxy.h */,
51871B59127CB89D00F76232 /* WebContextMenu.cpp */,
51871B5A127CB89D00F76232 /* WebContextMenu.h */,
- BCA0EF7E12331E78007D3CFB /* WebUndoStep.cpp */,
- BCA0EF7D12331E78007D3CFB /* WebUndoStep.h */,
BC111ADC112F5B9300337BAB /* WebFrame.cpp */,
BC032D8910F437A00058C15A /* WebFrame.h */,
1C8E281F1275D15400BC7BD0 /* WebInspector.cpp */,
@@ -2811,6 +2806,8 @@
C0CE72581247E4DA00BC0EC4 /* WebPage.messages.in */,
BC7B621412A4219A00D174A4 /* WebPageGroupProxy.cpp */,
BC7B621312A4219A00D174A4 /* WebPageGroupProxy.h */,
+ BCA0EF7E12331E78007D3CFB /* WebUndoStep.cpp */,
+ BCA0EF7D12331E78007D3CFB /* WebUndoStep.h */,
);
path = WebPage;
sourceTree = "<group>";
@@ -2852,11 +2849,13 @@
512E35F0130B638C00ABD19A /* WebApplicationCacheManagerProxy.messages.in */,
BC72BA1B11E64907001EB4EA /* WebBackForwardList.cpp */,
BC72BA1C11E64907001EB4EA /* WebBackForwardList.h */,
- BC09B8F6147460F7005F5625 /* WebContextConnectionClient.cpp */,
- BC09B8F7147460F7005F5625 /* WebContextConnectionClient.h */,
+ BC4A62A514744EC6006C681A /* WebConnectionToWebProcess.cpp */,
+ BC4A62A614744EC6006C681A /* WebConnectionToWebProcess.h */,
BCB9E2421120DACA00A137E0 /* WebContext.cpp */,
BCB9E2411120DACA00A137E0 /* WebContext.h */,
BCEE7D0912846AED009827DA /* WebContext.messages.in */,
+ BC09B8F6147460F7005F5625 /* WebContextConnectionClient.cpp */,
+ BC09B8F7147460F7005F5625 /* WebContextConnectionClient.h */,
BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */,
BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */,
51A84CE2127F386B00CA6EA4 /* WebContextMenuProxy.cpp */,
@@ -2933,8 +2932,6 @@
BC111B0D112F5E4F00337BAB /* WebProcessProxy.cpp */,
BC032DCF10F4389F0058C15A /* WebProcessProxy.h */,
BCEE7AB312817095009827DA /* WebProcessProxy.messages.in */,
- BC4A62A514744EC6006C681A /* WebConnectionToWebProcess.cpp */,
- BC4A62A614744EC6006C681A /* WebConnectionToWebProcess.h */,
33367632130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp */,
33367633130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h */,
33367634130C99B2006C9DE2 /* WebResourceCacheManagerProxy.messages.in */,
@@ -3016,6 +3013,8 @@
318BE17814743E6A00A8FBB2 /* WKNotification.h */,
318BE17414743DD600A8FBB2 /* WKNotificationManager.cpp */,
318BE17014743DB100A8FBB2 /* WKNotificationManager.h */,
+ 31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */,
+ 31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */,
312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */,
BC857FE512B843D800EDEB2E /* WKOpenPanelParameters.cpp */,
BC857FE412B843D800EDEB2E /* WKOpenPanelParameters.h */,
@@ -3036,8 +3035,6 @@
518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */,
33367638130C99DC006C9DE2 /* WKResourceCacheManager.cpp */,
33367639130C99DC006C9DE2 /* WKResourceCacheManager.h */,
- 31A2EC72148D59BB00810D71 /* WKNotificationPermissionRequest.h */,
- 31A2EC75148D65BB00810D71 /* WKNotificationPermissionRequest.cpp */,
);
path = C;
sourceTree = "<group>";
@@ -3057,8 +3054,8 @@
BC111ADE112F5B9A00337BAB /* mac */ = {
isa = PBXGroup;
children = (
- C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */,
51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */,
+ C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */,
C5237F5F12441CA300780472 /* WebEditorClientMac.mm */,
BC111ADF112F5BC200337BAB /* WebErrorsMac.mm */,
9391F283121B38F500EBF7E8 /* WebFrameNetworkingContext.h */,
@@ -3132,8 +3129,8 @@
5112CB071385B97B0030867D /* KeychainAttribute.cpp */,
5112CB051385B8D90030867D /* KeychainAttribute.h */,
1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */,
- 31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */,
C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */,
+ 31EA25D0134F78B2005B1452 /* NativeWebMouseEventMac.mm */,
DF58C6351371ACA000F9A37C /* NativeWebWheelEventMac.mm */,
C574A57F12E66681002DFE98 /* PasteboardTypes.h */,
C574A58012E66681002DFE98 /* PasteboardTypes.mm */,
@@ -3201,6 +3198,8 @@
E1EE53DC11F8CF9F00CCBEE4 /* InjectedBundlePageEditorClient.h */,
BC14E107120B905E00826C0C /* InjectedBundlePageFormClient.cpp */,
BC14E108120B905E00826C0C /* InjectedBundlePageFormClient.h */,
+ CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */,
+ CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */,
BCA8C6A611E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp */,
BCA8C6A711E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h */,
BC8147A812F64CDA007B2C32 /* InjectedBundlePagePolicyClient.cpp */,
@@ -3212,8 +3211,6 @@
BC14DF76120B5B7900826C0C /* InjectedBundleScriptWorld.cpp */,
BC14DF75120B5B7900826C0C /* InjectedBundleScriptWorld.h */,
BCB0B0DD12305A8C00B1341E /* InjectedBundleUserMessageCoders.h */,
- CD5C669E134B9D36004FE2A8 /* InjectedBundlePageFullScreenClient.cpp */,
- CD5C669F134B9D37004FE2A8 /* InjectedBundlePageFullScreenClient.h */,
);
path = InjectedBundle;
sourceTree = "<group>";
@@ -3526,8 +3523,8 @@
isa = PBXGroup;
children = (
C03A136A133BEBF900D767D1 /* mac */,
- C098A053133BE1C500B199A4 /* LayerTreeHostCA.h */,
C098A054133BE1C500B199A4 /* LayerTreeHostCA.cpp */,
+ C098A053133BE1C500B199A4 /* LayerTreeHostCA.h */,
);
path = ca;
sourceTree = "<group>";
@@ -3623,9 +3620,9 @@
C0CE73351247F70E00BC0EC4 /* Scripts */ = {
isa = PBXGroup;
children = (
- C0CE73371247F70E00BC0EC4 /* generate-messages-header.py */,
- C0CE73361247F70E00BC0EC4 /* generate-message-receiver.py */,
C0CE73381247F70E00BC0EC4 /* webkit2 */,
+ C0CE73361247F70E00BC0EC4 /* generate-message-receiver.py */,
+ C0CE73371247F70E00BC0EC4 /* generate-messages-header.py */,
);
path = Scripts;
sourceTree = "<group>";
@@ -3704,442 +3701,442 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1A3DD206125E5A2F004515E6 /* APIClient.h in Headers */,
+ 5D51845613BCF9CC00C7FF4A /* APIClientTraits.h in Headers */,
1AEFD27911D16C81008219D3 /* ArgumentCoder.h in Headers */,
1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */,
+ 1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */,
+ E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */,
BC032DA610F437D10058C15A /* ArgumentDecoder.h in Headers */,
BC032DA810F437D10058C15A /* ArgumentEncoder.h in Headers */,
- BC8699B5116AADAA002A925B /* WKView.h in Headers */,
BC032DA910F437D10058C15A /* Arguments.h in Headers */,
BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */,
+ E1A31732134CEA6C007C9A4F /* AttributedString.h in Headers */,
+ 512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */,
+ 512F589912A8838800629530 /* AuthenticationDecisionListener.h in Headers */,
+ 512F588B12A8836600629530 /* AuthenticationManager.h in Headers */,
+ 512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
+ 1A64256812DE42EC00CAAE2C /* BackingStore.h in Headers */,
+ 1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */,
+ BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
+ 1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */,
+ 1A2D956F12848564001EB962 /* ChildProcess.h in Headers */,
1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */,
+ 37C4E9F6131C6E7E0029BD5A /* config.h in Headers */,
BC032DAB10F437D10058C15A /* Connection.h in Headers */,
+ 1A2C307112D555450063DAA2 /* ContextMenuState.h in Headers */,
BC131BC911726C2800B69727 /* CoreIPCMessageKinds.h in Headers */,
+ B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
+ 1A8EFDFA1253CAA200F7067F /* DataReference.h in Headers */,
+ 93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */,
+ BCE81D99131AE02100241910 /* DictionaryPopupInfo.h in Headers */,
+ 1A6161D41278981C003ACD86 /* Download.h in Headers */,
+ 1A616150127798B5003ACD86 /* DownloadManager.h in Headers */,
+ 1AB7D4CA1288AAA700CFD08C /* DownloadProxy.h in Headers */,
+ 1AB7D61A1288B9D900CFD08C /* DownloadProxyMessages.h in Headers */,
+ C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */,
BC8452A81162C80900CAB9B5 /* DrawingArea.h in Headers */,
+ 1A6421F612DCFBAB00CAAE2C /* DrawingAreaImpl.h in Headers */,
+ 0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */,
+ 1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */,
BC2652171182608100243E12 /* DrawingAreaProxy.h in Headers */,
+ 1A64218612DCF49200CAAE2C /* DrawingAreaProxyImpl.h in Headers */,
+ 1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */,
+ 5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */,
+ 1AA41AB512C02EC4002BE67B /* EditorState.h in Headers */,
+ 93FC67C012D3CCF200A60610 /* EncoderAdapter.h in Headers */,
+ 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */,
+ 1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */,
+ 1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
+ 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
+ 1A910071126675C4001842F5 /* FindIndicator.h in Headers */,
+ 1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */,
+ BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
BC17753F118BABF0007D9E9A /* GenericCallback.h in Headers */,
+ BC06F42F12DBB9B6002D78DE /* GeolocationPermissionRequestManager.h in Headers */,
+ BC06F44A12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h in Headers */,
+ BC06F43A12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h in Headers */,
+ C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */,
+ 37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */,
+ BCCF6B2512C93E7A008F9C35 /* ImageOptions.h in Headers */,
BC64697011DBE603006455B0 /* ImmutableArray.h in Headers */,
+ BCBCB0CB1215E32100DE59CA /* ImmutableDictionary.h in Headers */,
BC204EE311C83E98008F3375 /* InjectedBundle.h in Headers */,
+ 935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */,
+ 935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */,
+ BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */,
+ BC498618124D10E200D834E1 /* InjectedBundleHitTestResult.h in Headers */,
+ BCB28CC0120233D9007D99BC /* InjectedBundleMessageKinds.h in Headers */,
+ BC8147D512F66D31007B2C32 /* InjectedBundleNavigationAction.h in Headers */,
+ BC4BEEAB120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.h in Headers */,
+ 512935E41288D97800A4B695 /* InjectedBundlePageContextMenuClient.h in Headers */,
+ E1EE53E311F8CFC000CCBEE4 /* InjectedBundlePageEditorClient.h in Headers */,
+ BC14E10A120B905E00826C0C /* InjectedBundlePageFormClient.h in Headers */,
+ CD5C66A1134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.h in Headers */,
BCA8C6A911E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.h in Headers */,
+ BC8147A912F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h in Headers */,
BCA8C6B011E3C08700812FB7 /* InjectedBundlePageUIClient.h in Headers */,
+ BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
+ BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
+ BCB0B0DE12305A8C00B1341E /* InjectedBundleUserMessageCoders.h in Headers */,
+ 1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
+ 1AE4987811FF7FAA0048B464 /* JSNPObject.h in Headers */,
+ 512DF70B138C26C700A22FC6 /* KeychainAttribute.h in Headers */,
+ 512DF6D8138C181A00A22FC6 /* KeychainItemShimMethods.h in Headers */,
+ 1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */,
+ 1A186EEA12EF7618008E5F37 /* LayerTreeHost.h in Headers */,
+ C064504A133BE709003470E2 /* LayerTreeHostCA.h in Headers */,
+ C0FA52431345694A0028E8C2 /* LayerTreeHostCAMac.h in Headers */,
+ 51A7F2F3125BF820008AEB1D /* Logging.h in Headers */,
BCC56F791159957D001CCAF9 /* MachPort.h in Headers */,
+ 1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */,
BC032DAC10F437D10058C15A /* MessageID.h in Headers */,
+ 1A119A95127B796200A9ECB1 /* MessageSender.h in Headers */,
+ C0D04E9013EC759E0041EFD6 /* model.py in Headers */,
+ C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */,
+ BCB0AD34122F285800B1341E /* MutableArray.h in Headers */,
+ BCB0AEE9122F53E300B1341E /* MutableDictionary.h in Headers */,
1A6FBA2A11E6862700DB1371 /* NetscapeBrowserFuncs.h in Headers */,
1A6FBD2811E69BC200DB1371 /* NetscapePlugin.h in Headers */,
+ 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */,
1AA5889211EE70400061B882 /* NetscapePluginStream.h in Headers */,
+ 31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */,
+ 3131261F148FF82C00BA2A39 /* NotificationPermissionRequestManager.h in Headers */,
+ 31A2EC521489981900810D71 /* NotificationPermissionRequestManagerProxy.h in Headers */,
+ 1A2D848B127F6A49001EB962 /* NPIdentifierData.h in Headers */,
+ 1AE4976811FF658E0048B464 /* NPJSObject.h in Headers */,
+ 1A2D82A5127F4EAB001EB962 /* NPObjectMessageReceiver.h in Headers */,
+ 1A2D843A127F65D5001EB962 /* NPObjectMessageReceiverMessages.h in Headers */,
+ 1A2D82A7127F4EAB001EB962 /* NPObjectProxy.h in Headers */,
+ 1A2D82A9127F4EAB001EB962 /* NPRemoteObjectMap.h in Headers */,
+ 1A2161B011F37664008AD0F5 /* NPRuntimeObjectMap.h in Headers */,
+ 1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */,
+ 1A2D84A3127F6AD1001EB962 /* NPVariantData.h in Headers */,
+ BCCF672D12C7EDF7008F9C35 /* OriginAndDatabases.h in Headers */,
BC6EDAA6111271C600E7678B /* PageClient.h in Headers */,
BC111B50112F619200337BAB /* PageClientImpl.h in Headers */,
+ 1A90C23712650717003E44D4 /* PageOverlay.h in Headers */,
+ C0D04E9113EC759E0041EFD6 /* parser.py in Headers */,
+ C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */,
+ 1AAF061412B01131008E49E2 /* PDFViewController.h in Headers */,
+ BCF505E71243047B005955AE /* PlatformCertificateInfo.h in Headers */,
+ BCC43ABB127B95DC00317F16 /* PlatformPopupMenuData.h in Headers */,
BC8780FC1161C2B800CC2768 /* PlatformProcessIdentifier.h in Headers */,
1A6FB7D311E651E200DB1371 /* Plugin.h in Headers */,
+ 1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */,
1AA56F2911E92BC80061B882 /* PluginController.h in Headers */,
+ 1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */,
+ 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
+ 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
+ 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
+ 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */,
+ 1A0EC906124C0AB8007EF4A5 /* PluginProcessConnection.h in Headers */,
+ 1A0EC90F124C0AF5007EF4A5 /* PluginProcessConnectionManager.h in Headers */,
+ 1A2BB6D114117B4D000F35D4 /* PluginProcessConnectionMessages.h in Headers */,
+ 1A2D90D21281C966001EB962 /* PluginProcessCreationParameters.h in Headers */,
+ 1A0EC7FB124BD3B6007EF4A5 /* PluginProcessMain.h in Headers */,
+ 1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */,
+ 1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */,
+ 1A0EC75E124BC7B2007EF4A5 /* PluginProcessProxy.h in Headers */,
+ 1A043B5E124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h in Headers */,
+ 1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */,
+ 1A8EFA711252B84100F7067F /* PluginProxyMessages.h in Headers */,
+ 1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */,
1A6FB7AF11E64B6800DB1371 /* PluginView.h in Headers */,
+ E1CC1B9012D7EADF00625838 /* PrintInfo.h in Headers */,
BC1A7C581136E19C00FB7167 /* ProcessLauncher.h in Headers */,
BC597075116591D000551FCA /* ProcessModel.h in Headers */,
1A30066E1110F4F70031937C /* ResponsivenessTimer.h in Headers */,
BC2E6E881141971500A63B1E /* RunLoop.h in Headers */,
+ BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */,
+ 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */,
+ 51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */,
+ 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */,
+ 511F8A7F138B46FE00A95F44 /* SecItemShimMethods.h in Headers */,
+ 512DF6FF138C254600A22FC6 /* SecKeychainItemRequestData.h in Headers */,
+ 512DF701138C254600A22FC6 /* SecKeychainItemResponseData.h in Headers */,
+ 33152976130D0CB200ED2483 /* SecurityOriginData.h in Headers */,
+ 518D2CCB12D51DFB003BB93B /* SessionState.h in Headers */,
+ 1A6420E512DCE2FF00CAAE2C /* ShareableBitmap.h in Headers */,
+ 1A24BED5120894D100FBB059 /* SharedMemory.h in Headers */,
+ 5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */,
+ BCBD3C3B125BFA7A00D2C29F /* StringPairVector.h in Headers */,
+ 1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */,
+ 1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */,
+ BCF50121123ED3B3005955AE /* ThreadLauncher.h in Headers */,
+ 1AAF263914687C39004A1E8A /* TiledCoreAnimationDrawingArea.h in Headers */,
+ 1AF05D8714688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h in Headers */,
+ 1A64245E12DE29A100CAAE2C /* UpdateInfo.h in Headers */,
+ BCB0B0E012305AB100B1341E /* UserMessageCoders.h in Headers */,
+ 1A0F29E4120B44420053D1B9 /* VisitedLinkProvider.h in Headers */,
+ 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */,
+ 512E352F130B55AF00ABD19A /* WebApplicationCacheManager.h in Headers */,
+ 512E356B130B57F000ABD19A /* WebApplicationCacheManagerMessages.h in Headers */,
+ 512E3525130B550600ABD19A /* WebApplicationCacheManagerProxy.h in Headers */,
+ 512E35F9130B642E00ABD19A /* WebApplicationCacheManagerProxyMessages.h in Headers */,
BC72BA1E11E64907001EB4EA /* WebBackForwardList.h in Headers */,
+ 518D2CAE12D5153B003BB93B /* WebBackForwardListItem.h in Headers */,
BC72B9FB11E6476B001EB4EA /* WebBackForwardListProxy.h in Headers */,
+ BCF50728124329AA005955AE /* WebCertificateInfo.h in Headers */,
BC032D7510F4378D0058C15A /* WebChromeClient.h in Headers */,
+ BC4A6290147312BE006C681A /* WebConnection.h in Headers */,
+ BC4A6292147312BE006C681A /* WebConnectionClient.h in Headers */,
+ BCE9C0B71484714700E33D61 /* WebConnectionMessageKinds.h in Headers */,
+ BC4A62A814744EC7006C681A /* WebConnectionToWebProcess.h in Headers */,
BCB9E2431120DACA00A137E0 /* WebContext.h in Headers */,
+ BC09B8F9147460F7005F5625 /* WebContextConnectionClient.h in Headers */,
BCDE059B11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h in Headers */,
+ 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */,
BC032D7710F4378D0058C15A /* WebContextMenuClient.h in Headers */,
+ 512935D81288D19400A4B695 /* WebContextMenuItem.h in Headers */,
+ 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */,
+ 51ACBB82127A8BAD00D203B9 /* WebContextMenuProxy.h in Headers */,
+ 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */,
+ BCCB75C61203A1CE00222D1B /* WebContextMessageKinds.h in Headers */,
+ BCEE7D0E12846F69009827DA /* WebContextMessages.h in Headers */,
+ BCB0B0DC12305A2500B1341E /* WebContextUserMessageCoders.h in Headers */,
+ 330934501315B94D0097A7BC /* WebCookieManager.h in Headers */,
+ 330934481315B9220097A7BC /* WebCookieManagerMessages.h in Headers */,
+ 330934561315B9750097A7BC /* WebCookieManagerProxy.h in Headers */,
+ 33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */,
+ 3309344A1315B9220097A7BC /* WebCookieManagerProxyMessages.h in Headers */,
BC1DD7B2114DC396005ADAF3 /* WebCoreArgumentCoders.h in Headers */,
+ 512F589B12A8838800629530 /* WebCredential.h in Headers */,
+ 51578B831209ECEF00A37C4A /* WebData.h in Headers */,
+ F6A25FDD12ADC6CC00DC40CC /* WebDatabaseManager.h in Headers */,
+ F62A76B712B1B25F0005F1B6 /* WebDatabaseManagerMessages.h in Headers */,
+ F62A765D12B1ABC30005F1B6 /* WebDatabaseManagerProxy.h in Headers */,
+ BCAC111F12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.h in Headers */,
+ F62A76B912B1B25F0005F1B6 /* WebDatabaseManagerProxyMessages.h in Headers */,
+ 1AB7D72C1288CAAD00CFD08C /* WebDownloadClient.h in Headers */,
BC032D7B10F4378D0058C15A /* WebDragClient.h in Headers */,
+ BCA0EF9F12332642007D3CFB /* WebEditCommandProxy.h in Headers */,
BC032D7D10F4378D0058C15A /* WebEditorClient.h in Headers */,
+ 516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */,
1A433F0D113C53DD00FACDE9 /* WebErrors.h in Headers */,
BC032DB910F4380F0058C15A /* WebEvent.h in Headers */,
BC032DBB10F4380F0058C15A /* WebEventConversion.h in Headers */,
BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */,
+ 1A3DD202125E5A1F004515E6 /* WebFindClient.h in Headers */,
+ 1A90C1EE1264FD50003E44D4 /* WebFindOptions.h in Headers */,
+ BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */,
+ BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */,
BC032D8D10F437A00058C15A /* WebFrame.h in Headers */,
+ BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */,
BC032D7F10F4378D0058C15A /* WebFrameLoaderClient.h in Headers */,
+ 9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
BCB9F6A01123A84B00A137E0 /* WebFramePolicyListenerProxy.h in Headers */,
BC9B38A110F538BE00443A15 /* WebFrameProxy.h in Headers */,
+ BC1BE1E012D54A410004A228 /* WebGeolocationClient.h in Headers */,
+ BC0E5FE512D697160012A72A /* WebGeolocationManager.h in Headers */,
+ BC0E606212D6BA910012A72A /* WebGeolocationManagerMessages.h in Headers */,
+ BC54CACB12D64291005C67B0 /* WebGeolocationManagerProxy.h in Headers */,
+ BC0E618312D6CB1D0012A72A /* WebGeolocationManagerProxyMessages.h in Headers */,
+ BC0E607312D6BC200012A72A /* WebGeolocationPosition.h in Headers */,
+ BC1BE1F212D54DBD0004A228 /* WebGeolocationProvider.h in Headers */,
+ 0F174AA3142A4CB70039250F /* WebGeometry.h in Headers */,
+ BCA56A1C12F9028E00C566C7 /* WebGraphicsContext.h in Headers */,
BCF69F871176CD6F00471A52 /* WebHistoryClient.h in Headers */,
+ 7801C09A142290C400FAF9AF /* WebHitTestResult.h in Headers */,
+ 511B24AB132E097200065A0C /* WebIconDatabase.h in Headers */,
+ 51834593134532E90092B696 /* WebIconDatabaseClient.h in Headers */,
+ 51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */,
+ 511B24A7132E095700065A0C /* WebIconDatabaseProxy.h in Headers */,
+ 51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */,
+ BCCF6ABD12C91EF9008F9C35 /* WebImage.h in Headers */,
+ 1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */,
BC032D8210F4378D0058C15A /* WebInspectorClient.h in Headers */,
+ 1C8E25A91270E3BC00BC7BD0 /* WebInspectorFrontendClient.h in Headers */,
+ 1C8E2A361277852400BC7BD0 /* WebInspectorMessages.h in Headers */,
+ 1C8E28341275D73800BC7BD0 /* WebInspectorProxy.h in Headers */,
+ 1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */,
+ 51A9E1001315CCDE009E7031 /* WebKeyValueStorageManager.h in Headers */,
+ 51A9E1291315ED35009E7031 /* WebKeyValueStorageManagerMessages.h in Headers */,
+ 51A9E1061315CCFC009E7031 /* WebKeyValueStorageManagerProxy.h in Headers */,
+ 51A9E12B1315ED35009E7031 /* WebKeyValueStorageManagerProxyMessages.h in Headers */,
BCB63478116BF10600603215 /* WebKit2.h in Headers */,
BC59534210FC04520098F82D /* WebLoaderClient.h in Headers */,
+ 33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */,
+ 33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */,
+ 33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */,
+ 33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */,
+ 909854ED12BC4E18000AD080 /* WebMemorySampler.h in Headers */,
BCF69FA21176D01400471A52 /* WebNavigationData.h in Headers */,
BCF69F9A1176CED600471A52 /* WebNavigationDataStore.h in Headers */,
+ 31A2EC49148997C200810D71 /* WebNotification.h in Headers */,
+ 310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */,
+ 31312621148FF82C00BA2A39 /* WebNotificationManager.h in Headers */,
+ 31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */,
+ 31A2EC4B148997C200810D71 /* WebNotificationManagerProxy.h in Headers */,
+ 318BE1681473433700A8FBB2 /* WebNotificationManagerProxyMessages.h in Headers */,
+ 31A2EC4E148997C200810D71 /* WebNotificationProvider.h in Headers */,
+ BC33DD681238464600360F3F /* WebNumber.h in Headers */,
+ BC857FB512B830E600EDEB2E /* WebOpenPanelParameters.h in Headers */,
+ BC857F8512B82D0B00EDEB2E /* WebOpenPanelResultListener.h in Headers */,
+ BC1DFEA412B31F87005DF730 /* WebOpenPanelResultListenerProxy.h in Headers */,
BC032D8F10F437A00058C15A /* WebPage.h in Headers */,
+ 5153569D1291B1D2000749DC /* WebPageContextMenuClient.h in Headers */,
+ BC7B6206129A0A6700D174A4 /* WebPageGroup.h in Headers */,
+ BC7B625212A43C9600D174A4 /* WebPageGroupData.h in Headers */,
+ BC7B621512A4219A00D174A4 /* WebPageGroupProxy.h in Headers */,
+ C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
BC032DD110F4389F0058C15A /* WebPageProxy.h in Headers */,
+ BCBD3915125BB1A800D2C29F /* WebPageProxyMessages.h in Headers */,
1A3E736111CC2659007BD539 /* WebPlatformStrategies.h in Headers */,
+ 1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */,
BCB9F8B01124E07700A137E0 /* WebPolicyClient.h in Headers */,
+ BC5744F012638FB3006F0F12 /* WebPopupItem.h in Headers */,
+ D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */,
+ BC574E631267D080006F0F12 /* WebPopupMenuProxy.h in Headers */,
+ BC5750971268F3C6006F0F12 /* WebPopupMenuProxyMac.h in Headers */,
BCD597FF112B57BE00EC8C23 /* WebPreferences.h in Headers */,
BCD598AC112B7FDF00EC8C23 /* WebPreferencesStore.h in Headers */,
BC032D9710F437AF0058C15A /* WebProcess.h in Headers */,
+ 1A043A09124D11A900FFBFB5 /* WebProcessConnection.h in Headers */,
+ 1A043F6A12514D8B00FFBFB5 /* WebProcessConnectionMessages.h in Headers */,
+ BC306824125A6B9400E71278 /* WebProcessCreationParameters.h in Headers */,
1A6FA02011E1528700DB1371 /* WebProcessMain.h in Headers */,
+ BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */,
BC032DD510F4389F0058C15A /* WebProcessProxy.h in Headers */,
+ BCEE7AD112817988009827DA /* WebProcessProxyMessages.h in Headers */,
+ 511F8A7B138B460900A95F44 /* WebProcessShim.h in Headers */,
+ 512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */,
+ 33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */,
+ 33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */,
+ 33367636130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h in Headers */,
+ 33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */,
+ BC858A2012C0357B00EDEB2E /* WebResourceLoadClient.h in Headers */,
+ D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
+ F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */,
BCC5715B115ADAEF001CCAF9 /* WebSystemInterface.h in Headers */,
1A594ABB112A1FB6009DE7C7 /* WebUIClient.h in Headers */,
- BC204EF011C83EC8008F3375 /* WKBundleAPICast.h in Headers */,
- BC1B419811D41D570011E8DD /* WKBundlePagePrivate.h in Headers */,
- BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */,
- BCE17B7E1381F1170012A641 /* WKPagePrivateMac.h in Headers */,
- 51A9E10B1315CD18009E7031 /* WKKeyValueStorageManager.h in Headers */,
+ BCA0EF7F12331E78007D3CFB /* WebUndoStep.h in Headers */,
+ BCDB86C11200FB97007254BE /* WebURL.h in Headers */,
+ BCE2315D122C30CA00D5C35A /* WebURLRequest.h in Headers */,
+ BC90A1D2122DD55E00CC8C50 /* WebURLResponse.h in Headers */,
+ F6113E25126CE1820057D0A7 /* WebUserContentURLPattern.h in Headers */,
+ 29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObject.h in Headers */,
+ BCDDB32D124EC2E10048D13C /* WKAPICast.h in Headers */,
+ 512E34E5130B4D0500ABD19A /* WKApplicationCacheManager.h in Headers */,
+ BC4075F4124FF0270068F20A /* WKArray.h in Headers */,
+ 512F58F612A88A5400629530 /* WKAuthenticationChallenge.h in Headers */,
+ 512F58F812A88A5400629530 /* WKAuthenticationDecisionListener.h in Headers */,
BC646C1B11DD399F006455B0 /* WKBackForwardList.h in Headers */,
BC646C1D11DD399F006455B0 /* WKBackForwardListItem.h in Headers */,
+ BCDDB317124EBD130048D13C /* WKBase.h in Headers */,
+ BCBAAC73144E619E0053F82F /* WKBrowsingContextController.h in Headers */,
+ BCBAAC74144E61A50053F82F /* WKBrowsingContextControllerInternal.h in Headers */,
+ 3788A05C14743C90006319E5 /* WKBrowsingContextControllerPrivate.h in Headers */,
+ BCBAACF41452324F0053F82F /* WKBrowsingContextGroup.h in Headers */,
+ BCBAACF61452324F0053F82F /* WKBrowsingContextGroupInternal.h in Headers */,
+ BCBAAD0B14560A430053F82F /* WKBrowsingContextLoadDelegate.h in Headers */,
BC204EEF11C83EC8008F3375 /* WKBundle.h in Headers */,
+ BC204EF011C83EC8008F3375 /* WKBundleAPICast.h in Headers */,
+ 935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */,
+ 935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */,
BCD25F1711D6BDE100169B0E /* WKBundleFrame.h in Headers */,
+ BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */,
+ BC49862F124D18C100D834E1 /* WKBundleHitTestResult.h in Headers */,
BC204EF211C83EC8008F3375 /* WKBundleInitialize.h in Headers */,
65B86F1E12F11DE300B7DD8A /* WKBundleInspector.h in Headers */,
- BC20528111C94284008F3375 /* WKBundlePage.h in Headers */,
- BCB9E24B1120E15C00A137E0 /* WKContext.h in Headers */,
- BCD0139B110FA420003B8A67 /* WKFrame.h in Headers */,
- BCB9F6A51123DD0D00A137E0 /* WKFramePolicyListener.h in Headers */,
- BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */,
- BCD597D7112B56DC00EC8C23 /* WKPage.h in Headers */,
- BCD597D0112B56AC00EC8C23 /* WKPreferences.h in Headers */,
+ BC7043CC12F75EE0006472B9 /* WKBundleNavigationAction.h in Headers */,
BC4BEFE1120A1A4C00FBA0C7 /* WKBundleNodeHandle.h in Headers */,
- BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */,
- BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */,
+ BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */,
+ BC20528111C94284008F3375 /* WKBundlePage.h in Headers */,
+ BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */,
+ ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,
+ BC1B419811D41D570011E8DD /* WKBundlePagePrivate.h in Headers */,
+ BCF049E711FE20F600F86A58 /* WKBundlePrivate.h in Headers */,
BC60C5791240A546008C5E29 /* WKBundleRangeHandle.h in Headers */,
- BC49862F124D18C100D834E1 /* WKBundleHitTestResult.h in Headers */,
- BC4075F4124FF0270068F20A /* WKArray.h in Headers */,
+ BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */,
BC4075F6124FF0270068F20A /* WKCertificateInfo.h in Headers */,
- BC4075F8124FF0270068F20A /* WKData.h in Headers */,
- BC4075FA124FF0270068F20A /* WKDictionary.h in Headers */,
- BC4075FC124FF0270068F20A /* WKError.h in Headers */,
- BC4075FE124FF0270068F20A /* WKMutableArray.h in Headers */,
- BC407600124FF0270068F20A /* WKMutableDictionary.h in Headers */,
- BC407602124FF0270068F20A /* WKNumber.h in Headers */,
- BC407604124FF0270068F20A /* WKSerializedScriptValue.h in Headers */,
- BC407606124FF0270068F20A /* WKString.h in Headers */,
- BC407608124FF0270068F20A /* WKType.h in Headers */,
- BC40760A124FF0270068F20A /* WKURL.h in Headers */,
- BC40760C124FF0270068F20A /* WKURLRequest.h in Headers */,
- BC40760E124FF0270068F20A /* WKURLResponse.h in Headers */,
- BC40761A124FF0370068F20A /* WKStringCF.h in Headers */,
- BC40761C124FF0370068F20A /* WKURLCF.h in Headers */,
BC407627124FF0400068F20A /* WKCertificateInfoMac.h in Headers */,
- BC407629124FF0400068F20A /* WKURLRequestNS.h in Headers */,
- BC40762B124FF0400068F20A /* WKURLResponseNS.h in Headers */,
- BC40783D1250FADD0068F20A /* WKEvent.h in Headers */,
- C09AE5E9125257C20025825D /* WKNativeEvent.h in Headers */,
- BCC8B374125FB69000DE46A4 /* WKGeometry.h in Headers */,
- F6113E29126CE19B0057D0A7 /* WKUserContentURLPattern.h in Headers */,
- 1C8E293912761E5B00BC7BD0 /* WKInspector.h in Headers */,
- 1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */,
+ BCA284D71492F2C7001F9042 /* WKConnection.h in Headers */,
+ BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */,
+ BC4A6297147313A0006C681A /* WKConnectionRef.h in Headers */,
+ BCB9E24B1120E15C00A137E0 /* WKContext.h in Headers */,
51A555F6128C6C47009ABCEC /* WKContextMenuItem.h in Headers */,
51A55601128C6D92009ABCEC /* WKContextMenuItemTypes.h in Headers */,
- ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */,
- BC7B633712A45ABA00D174A4 /* WKPageGroup.h in Headers */,
- BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */,
- 37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */,
- 512F58F612A88A5400629530 /* WKAuthenticationChallenge.h in Headers */,
- 512F58F812A88A5400629530 /* WKAuthenticationDecisionListener.h in Headers */,
+ BCC938E11180DE440085E5FE /* WKContextPrivate.h in Headers */,
+ 3309345B1315B9980097A7BC /* WKCookieManager.h in Headers */,
512F58FA12A88A5400629530 /* WKCredential.h in Headers */,
- 512F58FC12A88A5400629530 /* WKProtectionSpace.h in Headers */,
- F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */,
- 518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */,
518ACF1112B015F800B04B83 /* WKCredentialTypes.h in Headers */,
- BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */,
+ BC4075F8124FF0270068F20A /* WKData.h in Headers */,
F62A766212B1ABED0005F1B6 /* WKDatabaseManager.h in Headers */,
- BC1DFE8F12B31CA8005DF730 /* WKOpenPanelResultListener.h in Headers */,
- BC857FE612B843D800EDEB2E /* WKOpenPanelParameters.h in Headers */,
- BCCF6AC312C91F34008F9C35 /* WKImage.h in Headers */,
- BCCF6ACA12C91F59008F9C35 /* WKImageCG.h in Headers */,
+ BC4075FA124FF0270068F20A /* WKDictionary.h in Headers */,
+ 1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */,
+ BC4075FC124FF0270068F20A /* WKError.h in Headers */,
+ BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */,
+ BC40783D1250FADD0068F20A /* WKEvent.h in Headers */,
+ 37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */,
+ BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */,
+ BCD0139B110FA420003B8A67 /* WKFrame.h in Headers */,
+ BCB9F6A51123DD0D00A137E0 /* WKFramePolicyListener.h in Headers */,
+ E1AEA22F14687BDB00804569 /* WKFullKeyboardAccessWatcher.h in Headers */,
+ CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */,
BC54CC1212D674EE005C67B0 /* WKGeolocationManager.h in Headers */,
- BC0E619812D6CD120012A72A /* WKGeolocationPosition.h in Headers */,
BC06F44E12DBDF3F002D78DE /* WKGeolocationPermissionRequest.h in Headers */,
- BC7043CC12F75EE0006472B9 /* WKBundleNavigationAction.h in Headers */,
+ BC0E619812D6CD120012A72A /* WKGeolocationPosition.h in Headers */,
+ BCC8B374125FB69000DE46A4 /* WKGeometry.h in Headers */,
BCA56A6512F9C8F900C566C7 /* WKGraphicsContext.h in Headers */,
BCA56A6912F9C9AD00C566C7 /* WKGraphicsContextCG.h in Headers */,
- 512E34E5130B4D0500ABD19A /* WKApplicationCacheManager.h in Headers */,
- 1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */,
- 3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */,
- 3309345B1315B9980097A7BC /* WKCookieManager.h in Headers */,
- BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */,
+ B62E7312143047B00069EC35 /* WKHitTestResult.h in Headers */,
5110AE0D133C16CB0072717A /* WKIconDatabase.h in Headers */,
5123CF1C133D260A0056F800 /* WKIconDatabaseCG.h in Headers */,
+ BCCF6AC312C91F34008F9C35 /* WKImage.h in Headers */,
+ BCCF6ACA12C91F59008F9C35 /* WKImageCG.h in Headers */,
+ 1C8E293912761E5B00BC7BD0 /* WKInspector.h in Headers */,
6EE849C81368D9390038D481 /* WKInspectorMac.h in Headers */,
- B62E7312143047B00069EC35 /* WKHitTestResult.h in Headers */,
+ 51A9E10B1315CD18009E7031 /* WKKeyValueStorageManager.h in Headers */,
+ 33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */,
+ BC4075FE124FF0270068F20A /* WKMutableArray.h in Headers */,
+ BC407600124FF0270068F20A /* WKMutableDictionary.h in Headers */,
+ C09AE5E9125257C20025825D /* WKNativeEvent.h in Headers */,
+ BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */,
+ 318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */,
+ 318BE17114743DB100A8FBB2 /* WKNotificationManager.h in Headers */,
+ 31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */,
+ 312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */,
+ BC407602124FF0270068F20A /* WKNumber.h in Headers */,
+ BC857FE612B843D800EDEB2E /* WKOpenPanelParameters.h in Headers */,
+ BC1DFE8F12B31CA8005DF730 /* WKOpenPanelResultListener.h in Headers */,
+ BCD597D7112B56DC00EC8C23 /* WKPage.h in Headers */,
+ BC7B633712A45ABA00D174A4 /* WKPageGroup.h in Headers */,
+ BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */,
BC177465118B9FF4007D9E9A /* WKPagePrivate.h in Headers */,
+ BCE17B7E1381F1170012A641 /* WKPagePrivateMac.h in Headers */,
+ 1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */,
+ BCD597D0112B56AC00EC8C23 /* WKPreferences.h in Headers */,
762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */,
+ E134F01712EA5D33004EC58D /* WKPrintingView.h in Headers */,
+ BCBAACEB145225E30053F82F /* WKProcessGroup.h in Headers */,
+ BCBAACED145225E30053F82F /* WKProcessGroupInternal.h in Headers */,
+ 512F58FC12A88A5400629530 /* WKProtectionSpace.h in Headers */,
+ 518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */,
+ 3336763B130C99DC006C9DE2 /* WKResourceCacheManager.h in Headers */,
BC8A501511765F5600757573 /* WKRetainPtr.h in Headers */,
+ F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */,
+ BC407604124FF0270068F20A /* WKSerializedScriptValue.h in Headers */,
F67DD7BA125E40D9007BDCB8 /* WKSerializedScriptValuePrivate.h in Headers */,
- BC8699B7116AADAA002A925B /* WKViewInternal.h in Headers */,
- BC2E6E8E1141971500A63B1E /* WorkQueue.h in Headers */,
- 1A2161B011F37664008AD0F5 /* NPRuntimeObjectMap.h in Headers */,
- 1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */,
- 1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */,
- C0D04E9113EC759E0041EFD6 /* parser.py in Headers */,
- C0D04E9013EC759E0041EFD6 /* model.py in Headers */,
- E1EE53E311F8CFC000CCBEE4 /* InjectedBundlePageEditorClient.h in Headers */,
- BCF049E611FE20F600F86A58 /* WKBundleFramePrivate.h in Headers */,
- BCF049E711FE20F600F86A58 /* WKBundlePrivate.h in Headers */,
- 1AE4976811FF658E0048B464 /* NPJSObject.h in Headers */,
- 1AE4987811FF7FAA0048B464 /* JSNPObject.h in Headers */,
- 1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
- BCDB86C11200FB97007254BE /* WebURL.h in Headers */,
- BCB28CC0120233D9007D99BC /* InjectedBundleMessageKinds.h in Headers */,
- BCCB75C61203A1CE00222D1B /* WebContextMessageKinds.h in Headers */,
- D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */,
- D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
- 0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */,
- 51578B831209ECEF00A37C4A /* WebData.h in Headers */,
- C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */,
- 516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */,
- 1A24BED5120894D100FBB059 /* SharedMemory.h in Headers */,
- 1A0F29CC120B37160053D1B9 /* VisitedLinkTable.h in Headers */,
- 1A0F29E4120B44420053D1B9 /* VisitedLinkProvider.h in Headers */,
- BC4BEEAB120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.h in Headers */,
- BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
- BC14E10A120B905E00826C0C /* InjectedBundlePageFormClient.h in Headers */,
- BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */,
- BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */,
- BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */,
- BCBCB0CB1215E32100DE59CA /* ImmutableDictionary.h in Headers */,
- 9391F2CB121B67AD00EBF7E8 /* WebFrameNetworkingContext.h in Headers */,
- BCE2315D122C30CA00D5C35A /* WebURLRequest.h in Headers */,
- BC90A1D2122DD55E00CC8C50 /* WebURLResponse.h in Headers */,
- BCB0AD34122F285800B1341E /* MutableArray.h in Headers */,
- BCB0AEE9122F53E300B1341E /* MutableDictionary.h in Headers */,
- BCB0B0DC12305A2500B1341E /* WebContextUserMessageCoders.h in Headers */,
- BCB0B0DE12305A8C00B1341E /* InjectedBundleUserMessageCoders.h in Headers */,
- BCB0B0E012305AB100B1341E /* UserMessageCoders.h in Headers */,
- BCA0EF7F12331E78007D3CFB /* WebUndoStep.h in Headers */,
- BCA0EF9F12332642007D3CFB /* WebEditCommandProxy.h in Headers */,
- BC33DD681238464600360F3F /* WebNumber.h in Headers */,
- BCF50121123ED3B3005955AE /* ThreadLauncher.h in Headers */,
- BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
- BCF505E71243047B005955AE /* PlatformCertificateInfo.h in Headers */,
- BCF50728124329AA005955AE /* WebCertificateInfo.h in Headers */,
- C0CE72A11247E71D00BC0EC4 /* WebPageMessages.h in Headers */,
- C0CE72AD1247E78D00BC0EC4 /* HandleMessage.h in Headers */,
- 1A0EC603124A9F2C007EF4A5 /* PluginProcessManager.h in Headers */,
- 1A0EC6C0124BBD9B007EF4A5 /* PluginProcessMessages.h in Headers */,
- 1A0EC75E124BC7B2007EF4A5 /* PluginProcessProxy.h in Headers */,
- 1A0EC7FB124BD3B6007EF4A5 /* PluginProcessMain.h in Headers */,
- 1A0EC906124C0AB8007EF4A5 /* PluginProcessConnection.h in Headers */,
- 1A0EC90F124C0AF5007EF4A5 /* PluginProcessConnectionManager.h in Headers */,
- BC498618124D10E200D834E1 /* InjectedBundleHitTestResult.h in Headers */,
- 1A043976124D034800FFBFB5 /* PluginProcess.h in Headers */,
- 1A043A09124D11A900FFBFB5 /* WebProcessConnection.h in Headers */,
- 1A043B5E124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h in Headers */,
- BCDDB317124EBD130048D13C /* WKBase.h in Headers */,
BCDDB32B124EC2AB0048D13C /* WKSharedAPICast.h in Headers */,
- BCDDB32D124EC2E10048D13C /* WKAPICast.h in Headers */,
- 1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */,
- 1A043F6A12514D8B00FFBFB5 /* WebProcessConnectionMessages.h in Headers */,
- 1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */,
- 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
- 1A8EFA711252B84100F7067F /* PluginProxyMessages.h in Headers */,
- 1A8EFDFA1253CAA200F7067F /* DataReference.h in Headers */,
+ BC407606124FF0270068F20A /* WKString.h in Headers */,
+ BC40761A124FF0370068F20A /* WKStringCF.h in Headers */,
BC9099801256A98200083756 /* WKStringPrivate.h in Headers */,
- BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
- BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */,
- BC306824125A6B9400E71278 /* WebProcessCreationParameters.h in Headers */,
- 51A7F2F3125BF820008AEB1D /* Logging.h in Headers */,
- BCBD3915125BB1A800D2C29F /* WebPageProxyMessages.h in Headers */,
- BCBD3C3B125BFA7A00D2C29F /* StringPairVector.h in Headers */,
- 1A3DD202125E5A1F004515E6 /* WebFindClient.h in Headers */,
- 1A3DD206125E5A2F004515E6 /* APIClient.h in Headers */,
- BC5744F012638FB3006F0F12 /* WebPopupItem.h in Headers */,
- BC57450C1263B155006F0F12 /* WKBundleNodeHandlePrivate.h in Headers */,
- 1AC41AC71263C88300054E94 /* BinarySemaphore.h in Headers */,
- 1A90C1EE1264FD50003E44D4 /* WebFindOptions.h in Headers */,
- 1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
- 1A90C23712650717003E44D4 /* PageOverlay.h in Headers */,
- BC574E631267D080006F0F12 /* WebPopupMenuProxy.h in Headers */,
- BC5750971268F3C6006F0F12 /* WebPopupMenuProxyMac.h in Headers */,
- 1A910071126675C4001842F5 /* FindIndicator.h in Headers */,
- 1A91010A1268C8CA001842F5 /* FindIndicatorWindow.h in Headers */,
- F6113E25126CE1820057D0A7 /* WebUserContentURLPattern.h in Headers */,
- 1C8E25A91270E3BC00BC7BD0 /* WebInspectorFrontendClient.h in Headers */,
- 1C8E28201275D15400BC7BD0 /* WebInspector.h in Headers */,
- 1C8E28341275D73800BC7BD0 /* WebInspectorProxy.h in Headers */,
- 935EEB9B1277617C003322B8 /* WKBundleBackForwardListItem.h in Headers */,
- 935EEB9F127761AC003322B8 /* WKBundleBackForwardList.h in Headers */,
- 935EEBA2127761D0003322B8 /* InjectedBundleBackForwardList.h in Headers */,
- 935EEBA4127761D6003322B8 /* InjectedBundleBackForwardListItem.h in Headers */,
- 1A616150127798B5003ACD86 /* DownloadManager.h in Headers */,
- 1A6161D41278981C003ACD86 /* Download.h in Headers */,
- 51ACBB82127A8BAD00D203B9 /* WebContextMenuProxy.h in Headers */,
- 51ACBBA0127A8F2C00D203B9 /* WebContextMenuProxyMac.h in Headers */,
- 1A119A95127B796200A9ECB1 /* MessageSender.h in Headers */,
- BCC43ABB127B95DC00317F16 /* PlatformPopupMenuData.h in Headers */,
- 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */,
- 1A2D82A5127F4EAB001EB962 /* NPObjectMessageReceiver.h in Headers */,
- 1A2D82A7127F4EAB001EB962 /* NPObjectProxy.h in Headers */,
- 1A2D82A9127F4EAB001EB962 /* NPRemoteObjectMap.h in Headers */,
- 1A2D843A127F65D5001EB962 /* NPObjectMessageReceiverMessages.h in Headers */,
- 1A2D848B127F6A49001EB962 /* NPIdentifierData.h in Headers */,
- 1A2D84A3127F6AD1001EB962 /* NPVariantData.h in Headers */,
- 1C8E2A361277852400BC7BD0 /* WebInspectorMessages.h in Headers */,
- 1A2D90D21281C966001EB962 /* PluginProcessCreationParameters.h in Headers */,
- BCEE7AD112817988009827DA /* WebProcessProxyMessages.h in Headers */,
- 1A2D956F12848564001EB962 /* ChildProcess.h in Headers */,
- BCEE7D0E12846F69009827DA /* WebContextMessages.h in Headers */,
- 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */,
- 1AB7D4CA1288AAA700CFD08C /* DownloadProxy.h in Headers */,
- 1AB7D61A1288B9D900CFD08C /* DownloadProxyMessages.h in Headers */,
- 512935D81288D19400A4B695 /* WebContextMenuItem.h in Headers */,
- 512935E41288D97800A4B695 /* InjectedBundlePageContextMenuClient.h in Headers */,
- 1AB7D72C1288CAAD00CFD08C /* WebDownloadClient.h in Headers */,
- BCEE7DC5128B645D009827DA /* InjectedBundleClient.h in Headers */,
- 1CA8B946127C882A00576C2B /* WebInspectorProxyMessages.h in Headers */,
- 29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObject.h in Headers */,
- 5153569D1291B1D2000749DC /* WebPageContextMenuClient.h in Headers */,
- 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */,
- BC7B6206129A0A6700D174A4 /* WebPageGroup.h in Headers */,
- BC7B621512A4219A00D174A4 /* WebPageGroupProxy.h in Headers */,
- BC7B625212A43C9600D174A4 /* WebPageGroupData.h in Headers */,
- 512F588B12A8836600629530 /* AuthenticationManager.h in Headers */,
- 512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */,
- 512F589912A8838800629530 /* AuthenticationDecisionListener.h in Headers */,
- 512F589B12A8838800629530 /* WebCredential.h in Headers */,
- 512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */,
- 512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
- F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */,
- BC2D021712AC41CB00E732A3 /* SameDocumentNavigationType.h in Headers */,
- F6A25FDD12ADC6CC00DC40CC /* WebDatabaseManager.h in Headers */,
- 1AAF061412B01131008E49E2 /* PDFViewController.h in Headers */,
- 1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */,
- F62A765D12B1ABC30005F1B6 /* WebDatabaseManagerProxy.h in Headers */,
- F62A76B712B1B25F0005F1B6 /* WebDatabaseManagerMessages.h in Headers */,
- F62A76B912B1B25F0005F1B6 /* WebDatabaseManagerProxyMessages.h in Headers */,
- BC1DFEA412B31F87005DF730 /* WebOpenPanelResultListenerProxy.h in Headers */,
- BC857F8512B82D0B00EDEB2E /* WebOpenPanelResultListener.h in Headers */,
- BC857FB512B830E600EDEB2E /* WebOpenPanelParameters.h in Headers */,
1A4A9AA812B7E796008FE984 /* WKTextInputWindowController.h in Headers */,
- 1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */,
- 1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */,
- BC858A2012C0357B00EDEB2E /* WebResourceLoadClient.h in Headers */,
- 1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */,
- 909854ED12BC4E18000AD080 /* WebMemorySampler.h in Headers */,
- 1AA41AB512C02EC4002BE67B /* EditorState.h in Headers */,
- BCCF672D12C7EDF7008F9C35 /* OriginAndDatabases.h in Headers */,
- BCCF6ABD12C91EF9008F9C35 /* WebImage.h in Headers */,
- BCAC111F12C92C1F00B08EEE /* WebDatabaseManagerProxyClient.h in Headers */,
- BCCF6B2512C93E7A008F9C35 /* ImageOptions.h in Headers */,
- 93FC67BE12D3CCF200A60610 /* DecoderAdapter.h in Headers */,
- 93FC67C012D3CCF200A60610 /* EncoderAdapter.h in Headers */,
- 1A5E4DA412D3BD3D0099A2BB /* TextCheckerState.h in Headers */,
- 518D2CAE12D5153B003BB93B /* WebBackForwardListItem.h in Headers */,
- BC1BE1E012D54A410004A228 /* WebGeolocationClient.h in Headers */,
- BC1BE1F212D54DBD0004A228 /* WebGeolocationProvider.h in Headers */,
- 1A2C307112D555450063DAA2 /* ContextMenuState.h in Headers */,
- 518D2CCB12D51DFB003BB93B /* SessionState.h in Headers */,
- E1CC1B9012D7EADF00625838 /* PrintInfo.h in Headers */,
- BC54CACB12D64291005C67B0 /* WebGeolocationManagerProxy.h in Headers */,
- BC0E5FE512D697160012A72A /* WebGeolocationManager.h in Headers */,
- BC0E606212D6BA910012A72A /* WebGeolocationManagerMessages.h in Headers */,
- BC0E607312D6BC200012A72A /* WebGeolocationPosition.h in Headers */,
- BC0E618312D6CB1D0012A72A /* WebGeolocationManagerProxyMessages.h in Headers */,
- BC06F42F12DBB9B6002D78DE /* GeolocationPermissionRequestManager.h in Headers */,
- BC06F43A12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h in Headers */,
- BC06F44A12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h in Headers */,
- 1A6420E512DCE2FF00CAAE2C /* ShareableBitmap.h in Headers */,
- 1A64218612DCF49200CAAE2C /* DrawingAreaProxyImpl.h in Headers */,
- 1A6421F612DCFBAB00CAAE2C /* DrawingAreaImpl.h in Headers */,
- 1A64229A12DD029200CAAE2C /* DrawingAreaMessages.h in Headers */,
- 1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */,
- 1A64245E12DE29A100CAAE2C /* UpdateInfo.h in Headers */,
- 1A64256812DE42EC00CAAE2C /* BackingStore.h in Headers */,
- C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */,
- 1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */,
- C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */,
- E134F01712EA5D33004EC58D /* WKPrintingView.h in Headers */,
- 1A186EEA12EF7618008E5F37 /* LayerTreeHost.h in Headers */,
+ BC407608124FF0270068F20A /* WKType.h in Headers */,
+ BC40760A124FF0270068F20A /* WKURL.h in Headers */,
+ BC40761C124FF0370068F20A /* WKURLCF.h in Headers */,
+ BC40760C124FF0270068F20A /* WKURLRequest.h in Headers */,
+ BC407629124FF0400068F20A /* WKURLRequestNS.h in Headers */,
+ BC40760E124FF0270068F20A /* WKURLResponse.h in Headers */,
+ BC40762B124FF0400068F20A /* WKURLResponseNS.h in Headers */,
+ F6113E29126CE19B0057D0A7 /* WKUserContentURLPattern.h in Headers */,
+ BC8699B5116AADAA002A925B /* WKView.h in Headers */,
+ BC8699B7116AADAA002A925B /* WKViewInternal.h in Headers */,
BFA6179F12F0B99D0033E0CA /* WKViewPrivate.h in Headers */,
- BC8147A912F64CDA007B2C32 /* InjectedBundlePagePolicyClient.h in Headers */,
- BC8147D512F66D31007B2C32 /* InjectedBundleNavigationAction.h in Headers */,
- 1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */,
- BCA56A1C12F9028E00C566C7 /* WebGraphicsContext.h in Headers */,
- 512E3525130B550600ABD19A /* WebApplicationCacheManagerProxy.h in Headers */,
- 512E352F130B55AF00ABD19A /* WebApplicationCacheManager.h in Headers */,
- 512E356B130B57F000ABD19A /* WebApplicationCacheManagerMessages.h in Headers */,
- 512E35F9130B642E00ABD19A /* WebApplicationCacheManagerProxyMessages.h in Headers */,
- 1AC8702D130B49A2002C1257 /* WebPluginSiteDataManager.h in Headers */,
- 33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */,
- 33367636130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h in Headers */,
- 33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */,
- 33367658130C9ECB006C9DE2 /* WebResourceCacheManagerProxyMessages.h in Headers */,
- 33152976130D0CB200ED2483 /* SecurityOriginData.h in Headers */,
- 51A9E1001315CCDE009E7031 /* WebKeyValueStorageManager.h in Headers */,
- 51A9E1061315CCFC009E7031 /* WebKeyValueStorageManagerProxy.h in Headers */,
- 51A9E1291315ED35009E7031 /* WebKeyValueStorageManagerMessages.h in Headers */,
- 51A9E12B1315ED35009E7031 /* WebKeyValueStorageManagerProxyMessages.h in Headers */,
- 330934481315B9220097A7BC /* WebCookieManagerMessages.h in Headers */,
- 3309344A1315B9220097A7BC /* WebCookieManagerProxyMessages.h in Headers */,
- 330934501315B94D0097A7BC /* WebCookieManager.h in Headers */,
- 330934561315B9750097A7BC /* WebCookieManagerProxy.h in Headers */,
- BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
- BCE81D99131AE02100241910 /* DictionaryPopupInfo.h in Headers */,
- 37C4E9F6131C6E7E0029BD5A /* config.h in Headers */,
- 33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */,
- CDCA85C9132ABA4E00E961DF /* WKFullScreenWindowController.h in Headers */,
- 511B24A7132E095700065A0C /* WebIconDatabaseProxy.h in Headers */,
- 511B24AB132E097200065A0C /* WebIconDatabase.h in Headers */,
- 51D02F6A132EC73700BEAA96 /* WebIconDatabaseMessages.h in Headers */,
- 51D02F6C132EC73700BEAA96 /* WebIconDatabaseProxyMessages.h in Headers */,
- B878B615133428DC006888E9 /* CorrectionPanel.h in Headers */,
- 33D3A3B61339600B00709BE4 /* WKMediaCacheManager.h in Headers */,
- 33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */,
- 33D3A3C2133960B000709BE4 /* WebMediaCacheManager.h in Headers */,
- 33D3A3C91339617900709BE4 /* WebMediaCacheManagerMessages.h in Headers */,
- 33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */,
- C064504A133BE709003470E2 /* LayerTreeHostCA.h in Headers */,
- 51834593134532E90092B696 /* WebIconDatabaseClient.h in Headers */,
- C0FA52431345694A0028E8C2 /* LayerTreeHostCAMac.h in Headers */,
- E1A31732134CEA6C007C9A4F /* AttributedString.h in Headers */,
- E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */,
- CD5C66A1134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.h in Headers */,
- 37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */,
- 1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */,
- 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
- 51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */,
- 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */,
- 51B15A8513843A3900321AD8 /* EnvironmentUtilities.h in Headers */,
- 511F8A7B138B460900A95F44 /* WebProcessShim.h in Headers */,
- 511F8A7F138B46FE00A95F44 /* SecItemShimMethods.h in Headers */,
- 512DF6D8138C181A00A22FC6 /* KeychainItemShimMethods.h in Headers */,
- 512DF6FF138C254600A22FC6 /* SecKeychainItemRequestData.h in Headers */,
- 512DF701138C254600A22FC6 /* SecKeychainItemResponseData.h in Headers */,
- 512DF70B138C26C700A22FC6 /* KeychainAttribute.h in Headers */,
- 93C01DAC139AC91700ED51D7 /* CoreIPCClientRunLoop.h in Headers */,
- 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
- 5D51845613BCF9CC00C7FF4A /* APIClientTraits.h in Headers */,
- 1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */,
- 5272B28B1406985D0096A5D0 /* StatisticsData.h in Headers */,
- 1A2BB6D114117B4D000F35D4 /* PluginProcessConnectionMessages.h in Headers */,
- 7801C09A142290C400FAF9AF /* WebHitTestResult.h in Headers */,
- 0F174AA3142A4CB70039250F /* WebGeometry.h in Headers */,
- BCBAAC73144E619E0053F82F /* WKBrowsingContextController.h in Headers */,
- BCBAAC74144E61A50053F82F /* WKBrowsingContextControllerInternal.h in Headers */,
- BCBAACEB145225E30053F82F /* WKProcessGroup.h in Headers */,
- BCBAACED145225E30053F82F /* WKProcessGroupInternal.h in Headers */,
- BCBAACF41452324F0053F82F /* WKBrowsingContextGroup.h in Headers */,
- BCBAACF61452324F0053F82F /* WKBrowsingContextGroupInternal.h in Headers */,
- BCBAAD0B14560A430053F82F /* WKBrowsingContextLoadDelegate.h in Headers */,
- E1AEA22F14687BDB00804569 /* WKFullKeyboardAccessWatcher.h in Headers */,
- 1AAF263914687C39004A1E8A /* TiledCoreAnimationDrawingArea.h in Headers */,
- 1AF05D8714688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.h in Headers */,
- BC4A6290147312BE006C681A /* WebConnection.h in Headers */,
- BC4A6292147312BE006C681A /* WebConnectionClient.h in Headers */,
- BC4A6297147313A0006C681A /* WKConnectionRef.h in Headers */,
- BC4A62A814744EC7006C681A /* WebConnectionToWebProcess.h in Headers */,
- BC09B8F9147460F7005F5625 /* WebContextConnectionClient.h in Headers */,
- 3788A05C14743C90006319E5 /* WKBrowsingContextControllerPrivate.h in Headers */,
- BCE9C0B71484714700E33D61 /* WebConnectionMessageKinds.h in Headers */,
- 310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */,
- 312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */,
- 318BE1681473433700A8FBB2 /* WebNotificationManagerProxyMessages.h in Headers */,
- 318BE17114743DB100A8FBB2 /* WKNotificationManager.h in Headers */,
- 318BE17914743E6F00A8FBB2 /* WKNotification.h in Headers */,
- 31BA924E148831260062EDB5 /* WebNotificationManagerMessages.h in Headers */,
- 31A2EC49148997C200810D71 /* WebNotification.h in Headers */,
- 31A2EC4B148997C200810D71 /* WebNotificationManagerProxy.h in Headers */,
- 31A2EC4E148997C200810D71 /* WebNotificationProvider.h in Headers */,
- 31A2EC521489981900810D71 /* NotificationPermissionRequestManagerProxy.h in Headers */,
- 31A2EC5614899C0900810D71 /* NotificationPermissionRequest.h in Headers */,
- 31A2EC74148D59CA00810D71 /* WKNotificationPermissionRequest.h in Headers */,
- 3131261F148FF82C00BA2A39 /* NotificationPermissionRequestManager.h in Headers */,
- 31312621148FF82C00BA2A39 /* WebNotificationManager.h in Headers */,
- BCA284D71492F2C7001F9042 /* WKConnection.h in Headers */,
- BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */,
- 5DA6ED0A1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h in Headers */,
- 1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
+ BC2E6E8E1141971500A63B1E /* WorkQueue.h in Headers */,
+ 1AB42E8714BBBBB2004272F7 /* KeychainShimResponseMap.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -4284,8 +4281,8 @@
buildActionMask = 2147483647;
files = (
6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */,
- E133FD8A1423DD7F00FC7BFB /* WebKit.icns in Resources */,
1AA575FE1496B6F300A4EE06 /* EventDispatcher.messages.in in Resources */,
+ E133FD8A1423DD7F00FC7BFB /* WebKit.icns in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -4440,429 +4437,428 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 5D51845513BCF9CC00C7FF4A /* APIClientTraits.cpp in Sources */,
+ B63403F914910D57001070B5 /* APIObject.cpp in Sources */,
+ 1A3D610513A7F03A00F95D4E /* ArgumentCoders.cpp in Sources */,
+ 1AAF0C4B12B16334008E49E2 /* ArgumentCodersCF.cpp in Sources */,
+ E179FD9F134D38250015B883 /* ArgumentCodersMac.mm in Sources */,
BC032DA510F437D10058C15A /* ArgumentDecoder.cpp in Sources */,
BC032DA710F437D10058C15A /* ArgumentEncoder.cpp in Sources */,
BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */,
+ E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */,
+ 512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */,
+ 512F589812A8838800629530 /* AuthenticationDecisionListener.cpp in Sources */,
+ 512F588A12A8836600629530 /* AuthenticationManager.cpp in Sources */,
+ 51C4032C136749D800DC972D /* AuthenticationManager.mac.mm in Sources */,
+ 512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */,
+ 1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */,
+ 1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */,
+ 1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */,
+ E199875E142C045400BB2DE7 /* BuiltInPDFView.cpp in Sources */,
+ 1AA2E51E12E4C05E00BC4966 /* CGUtilities.cpp in Sources */,
+ 1A2D957012848564001EB962 /* ChildProcess.cpp in Sources */,
1A6F9FB711E1408500DB1371 /* CommandLineMac.cpp in Sources */,
BC032DAA10F437D10058C15A /* Connection.cpp in Sources */,
1A30EAC6115D7DA30053E937 /* ConnectionMac.cpp in Sources */,
+ B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */,
+ 1A8EFDFE1253CB6E00F7067F /* DataReference.cpp in Sources */,
+ 93FC67BD12D3CCF200A60610 /* DecoderAdapter.cpp in Sources */,
+ BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */,
+ 1A6161D51278981C003ACD86 /* Download.cpp in Sources */,
+ 1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */,
+ 1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */,
+ 1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */,
+ 1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */,
BC8452A71162C80900CAB9B5 /* DrawingArea.cpp in Sources */,
+ 1A6421F712DCFBAB00CAAE2C /* DrawingAreaImpl.cpp in Sources */,
+ 1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */,
BC2652161182608100243E12 /* DrawingAreaProxy.cpp in Sources */,
+ 1A64218712DCF49200CAAE2C /* DrawingAreaProxyImpl.cpp in Sources */,
+ 1A64230812DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp in Sources */,
+ 5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */,
+ 8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */,
+ 93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */,
+ 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */,
+ 1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */,
+ 1AA575FA1496B52600A4EE06 /* EventDispatcher.cpp in Sources */,
+ 1AA576021496B97900A4EE06 /* EventDispatcherMessageReceiver.cpp in Sources */,
+ 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
+ 1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
+ 1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */,
+ BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
+ BC06F43012DBB9B6002D78DE /* GeolocationPermissionRequestManager.cpp in Sources */,
+ BC06F44B12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp in Sources */,
+ BC06F43B12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp in Sources */,
BC64696F11DBE603006455B0 /* ImmutableArray.cpp in Sources */,
+ BCBCB0CD1215E33A00DE59CA /* ImmutableDictionary.cpp in Sources */,
BC204EE211C83E98008F3375 /* InjectedBundle.cpp in Sources */,
+ 935EEBA1127761CC003322B8 /* InjectedBundleBackForwardList.cpp in Sources */,
+ 935EEBA3127761D3003322B8 /* InjectedBundleBackForwardListItem.cpp in Sources */,
+ BCEE7DC6128B645D009827DA /* InjectedBundleClient.cpp in Sources */,
+ BC498619124D10E200D834E1 /* InjectedBundleHitTestResult.cpp in Sources */,
BC204EE611C83EA9008F3375 /* InjectedBundleMac.cpp in Sources */,
+ BC8147D612F66D31007B2C32 /* InjectedBundleNavigationAction.cpp in Sources */,
+ BC4BEEAC120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp in Sources */,
+ 512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */,
+ E1EE53E711F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp in Sources */,
+ BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */,
+ CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */,
BCA8C6A811E3BA5F00812FB7 /* InjectedBundlePageLoaderClient.cpp in Sources */,
+ BC8147AA12F64CDA007B2C32 /* InjectedBundlePagePolicyClient.cpp in Sources */,
+ 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
BCA8C6AF11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp in Sources */,
+ BC33E0D212408E8600360F3F /* InjectedBundleRangeHandle.cpp in Sources */,
+ BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
+ 1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */,
+ 1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */,
+ 512DF70A138C26C700A22FC6 /* KeychainAttribute.cpp in Sources */,
+ 512DF6D9138C181A00A22FC6 /* KeychainItemShimMethods.mm in Sources */,
+ 1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */,
+ 1A186EEB12EF7618008E5F37 /* LayerTreeHost.cpp in Sources */,
+ C0D74DDE133BE2D90089CD44 /* LayerTreeHostCA.cpp in Sources */,
+ C03A136C133BEBF900D767D1 /* LayerTreeHostCAMac.mm in Sources */,
+ 51A7F2F5125BF8D4008AEB1D /* Logging.cpp in Sources */,
+ 5160BFE113381DF900918999 /* Logging.mac.mm in Sources */,
+ 1A24B5F211F531E800C38269 /* MachUtilities.cpp in Sources */,
+ C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */,
+ C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */,
+ BCB0AD33122F285800B1341E /* MutableArray.cpp in Sources */,
+ BCB0AEEA122F53E300B1341E /* MutableDictionary.cpp in Sources */,
+ C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */,
+ 31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */,
+ DF58C6361371ACA000F9A37C /* NativeWebWheelEventMac.mm in Sources */,
1A6FBA2B11E6862700DB1371 /* NetscapeBrowserFuncs.cpp in Sources */,
1A6FBD2911E69BC200DB1371 /* NetscapePlugin.cpp in Sources */,
1AE5B7FB11E7AED200BA6767 /* NetscapePluginMac.mm in Sources */,
+ 1A4A9C5512B816CF008FE984 /* NetscapePluginModule.cpp in Sources */,
+ 1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */,
1AA5889311EE70400061B882 /* NetscapePluginStream.cpp in Sources */,
+ 31A2EC551489982E00810D71 /* NotificationPermissionRequest.cpp in Sources */,
+ 3131261E148FF82C00BA2A39 /* NotificationPermissionRequestManager.cpp in Sources */,
+ 31A2EC501489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp in Sources */,
+ 1A2D848C127F6A49001EB962 /* NPIdentifierData.cpp in Sources */,
+ 1AE4976911FF658E0048B464 /* NPJSObject.cpp in Sources */,
+ 1A2D82A4127F4EAB001EB962 /* NPObjectMessageReceiver.cpp in Sources */,
+ 1A2D8439127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp in Sources */,
+ 1A2D82A6127F4EAB001EB962 /* NPObjectProxy.cpp in Sources */,
+ 1A2D82A8127F4EAB001EB962 /* NPRemoteObjectMap.cpp in Sources */,
+ 1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */,
+ 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */,
+ 1A2D84A4127F6AD1001EB962 /* NPVariantData.cpp in Sources */,
+ BCCF673312C7F15C008F9C35 /* OriginAndDatabases.cpp in Sources */,
BC111B51112F619200337BAB /* PageClientImpl.mm in Sources */,
+ 1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */,
+ C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */,
+ 1AAF061512B01131008E49E2 /* PDFViewController.mm in Sources */,
+ BCF505E81243047B005955AE /* PlatformCertificateInfo.mm in Sources */,
+ BCC43ABA127B95DC00317F16 /* PlatformPopupMenuData.cpp in Sources */,
1A6FB7D211E651E200DB1371 /* Plugin.cpp in Sources */,
+ 1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
+ 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */,
+ 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */,
+ 1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */,
1AEFCC1311D01F96008219D3 /* PluginInfoStore.cpp in Sources */,
1AEFCCBD11D02C5E008219D3 /* PluginInfoStoreMac.mm in Sources */,
+ 1A3D610113A7CC2A00F95D4E /* PluginModuleInfo.cpp in Sources */,
+ 1A043977124D034800FFBFB5 /* PluginProcess.cpp in Sources */,
+ 1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */,
+ 1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */,
+ 1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */,
+ 1A2D90D31281C966001EB962 /* PluginProcessCreationParameters.cpp in Sources */,
+ 1AA4792312A59FD9008236C3 /* PluginProcessMac.mm in Sources */,
+ 1A0EC803124BD41E007EF4A5 /* PluginProcessMainMac.mm in Sources */,
+ 1A0EC604124A9F2C007EF4A5 /* PluginProcessManager.cpp in Sources */,
+ 1A043CEB124FE38F00FFBFB5 /* PluginProcessMessageReceiver.cpp in Sources */,
+ 1A0EC75F124BC7B2007EF4A5 /* PluginProcessProxy.cpp in Sources */,
+ 1A2D90BB1281C931001EB962 /* PluginProcessProxyMac.mm in Sources */,
+ 1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */,
+ 1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */,
+ 1A2D92211281DC1B001EB962 /* PluginProxyMac.mm in Sources */,
+ 1A8EFA701252B84100F7067F /* PluginProxyMessageReceiver.cpp in Sources */,
1A6FB7AE11E64B6800DB1371 /* PluginView.cpp in Sources */,
+ E18C92F412DB9E7100CF2AEB /* PrintInfo.cpp in Sources */,
+ E1CC1B9112D7EADF00625838 /* PrintInfoMac.mm in Sources */,
1AE117F611DBB30900981615 /* ProcessLauncher.cpp in Sources */,
BC111B1D112F5FE600337BAB /* ProcessLauncherMac.mm in Sources */,
BC111B09112F5E3C00337BAB /* ResponsivenessTimer.cpp in Sources */,
BC2E6E871141971500A63B1E /* RunLoop.cpp in Sources */,
BC0092F7115837A300E0AE2A /* RunLoopMac.mm in Sources */,
+ 1AAB4AAA1296F1540023952F /* SandboxExtensionMac.mm in Sources */,
+ 51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */,
+ 51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */,
+ 511F8A80138B46FE00A95F44 /* SecItemShimMethods.mm in Sources */,
+ 512DF6FE138C254600A22FC6 /* SecKeychainItemRequestData.cpp in Sources */,
+ 512DF700138C254600A22FC6 /* SecKeychainItemResponseData.cpp in Sources */,
+ 33152975130D0CB200ED2483 /* SecurityOriginData.cpp in Sources */,
+ 518D2CCA12D51DFB003BB93B /* SessionState.cpp in Sources */,
+ 1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */,
+ C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */,
+ 1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */,
+ 5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */,
+ 1AA417EF12C00D87002BE67B /* TextCheckerMac.mm in Sources */,
+ BCF50122123ED3B3005955AE /* ThreadLauncher.cpp in Sources */,
+ BCF501B4123EF602005955AE /* ThreadLauncherMac.mm in Sources */,
+ 1AAF263814687C39004A1E8A /* TiledCoreAnimationDrawingArea.mm in Sources */,
+ 1AF05D8614688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm in Sources */,
+ 1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */,
+ 1A0F29E3120B44420053D1B9 /* VisitedLinkProvider.cpp in Sources */,
+ 1A0F29CB120B37160053D1B9 /* VisitedLinkTable.cpp in Sources */,
+ 512E352E130B55AF00ABD19A /* WebApplicationCacheManager.cpp in Sources */,
+ 512E356A130B57F000ABD19A /* WebApplicationCacheManagerMessageReceiver.cpp in Sources */,
+ 512E3524130B550600ABD19A /* WebApplicationCacheManagerProxy.cpp in Sources */,
+ 512E35F8130B642E00ABD19A /* WebApplicationCacheManagerProxyMessageReceiver.cpp in Sources */,
BC72BA1D11E64907001EB4EA /* WebBackForwardList.cpp in Sources */,
+ 51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */,
+ 518D2CAD12D5153B003BB93B /* WebBackForwardListItem.cpp in Sources */,
BC72B9FA11E6476B001EB4EA /* WebBackForwardListProxy.cpp in Sources */,
BC111A5A112F4FBB00337BAB /* WebChromeClient.cpp in Sources */,
+ BC4A628F147312BE006C681A /* WebConnection.cpp in Sources */,
+ BC4A6291147312BE006C681A /* WebConnectionClient.cpp in Sources */,
+ BCD3675C148C26C000447E87 /* WebConnectionToUIProcess.cpp in Sources */,
+ BC4A62A714744EC7006C681A /* WebConnectionToWebProcess.cpp in Sources */,
BCB9E2441120DACA00A137E0 /* WebContext.cpp in Sources */,
+ BC09B8F8147460F7005F5625 /* WebContextConnectionClient.cpp in Sources */,
BCDE059C11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp in Sources */,
+ 1A1C649B11F4174200553C19 /* WebContextMac.mm in Sources */,
+ 51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */,
BC111A5B112F4FBB00337BAB /* WebContextMenuClient.cpp in Sources */,
+ 51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */,
+ 512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */,
+ 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */,
+ 51A84CE3127F386B00CA6EA4 /* WebContextMenuProxy.cpp in Sources */,
+ 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */,
+ BCEE7D0D12846F69009827DA /* WebContextMessageReceiver.cpp in Sources */,
+ 3309344F1315B94D0097A7BC /* WebCookieManager.cpp in Sources */,
+ F6A90813133C20510082C3F4 /* WebCookieManagerMac.mm in Sources */,
+ 330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */,
+ 330934551315B9750097A7BC /* WebCookieManagerProxy.cpp in Sources */,
+ 33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */,
+ F6D632BC133D198200743D77 /* WebCookieManagerProxyMac.mm in Sources */,
+ 330934491315B9220097A7BC /* WebCookieManagerProxyMessageReceiver.cpp in Sources */,
+ 939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */,
+ BCE23263122C6CF300D5C35A /* WebCoreArgumentCodersMac.mm in Sources */,
+ 512F589A12A8838800629530 /* WebCredential.cpp in Sources */,
+ F6A25FDC12ADC6CC00DC40CC /* WebDatabaseManager.cpp in Sources */,
+ F62A76B612B1B25F0005F1B6 /* WebDatabaseManagerMessageReceiver.cpp in Sources */,
+ F62A765C12B1ABC30005F1B6 /* WebDatabaseManagerProxy.cpp in Sources */,
+ BCAC112012C92C1F00B08EEE /* WebDatabaseManagerProxyClient.cpp in Sources */,
+ F62A76B812B1B25F0005F1B6 /* WebDatabaseManagerProxyMessageReceiver.cpp in Sources */,
+ 1AB7D72D1288CAAD00CFD08C /* WebDownloadClient.cpp in Sources */,
BC111A5D112F4FBB00337BAB /* WebDragClient.cpp in Sources */,
+ C574A37712E6099D002DFE98 /* WebDragClientMac.mm in Sources */,
+ BCA0EFA012332642007D3CFB /* WebEditCommandProxy.cpp in Sources */,
BC111A5E112F4FBB00337BAB /* WebEditorClient.cpp in Sources */,
+ C5237F6012441CA300780472 /* WebEditorClientMac.mm in Sources */,
+ BC575613126E0138006F0F12 /* WebError.cpp in Sources */,
BC111AE0112F5BC200337BAB /* WebErrorsMac.mm in Sources */,
+ C0337DAE127A24FE008FF4F4 /* WebEvent.cpp in Sources */,
BC032DBA10F4380F0058C15A /* WebEventConversion.cpp in Sources */,
BC111B5E112F629800337BAB /* WebEventFactory.mm in Sources */,
+ 1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */,
+ BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */,
+ BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
BC111ADD112F5B9300337BAB /* WebFrame.cpp in Sources */,
+ BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
BC111A5F112F4FBB00337BAB /* WebFrameLoaderClient.cpp in Sources */,
+ 9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,
BCB9F6A11123A84B00A137E0 /* WebFramePolicyListenerProxy.cpp in Sources */,
BC111B0E112F5E4F00337BAB /* WebFrameProxy.cpp in Sources */,
+ CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,
+ CDCA8603132ADC0500E961DF /* WebFullScreenManagerMac.mm in Sources */,
+ CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
+ CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
+ CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */,
+ CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
+ BC1BE1E112D54A410004A228 /* WebGeolocationClient.cpp in Sources */,
+ BC0E5FE612D697160012A72A /* WebGeolocationManager.cpp in Sources */,
+ BC0E606112D6BA910012A72A /* WebGeolocationManagerMessageReceiver.cpp in Sources */,
+ BC54CACC12D64291005C67B0 /* WebGeolocationManagerProxy.cpp in Sources */,
+ BC0E618212D6CB1D0012A72A /* WebGeolocationManagerProxyMessageReceiver.cpp in Sources */,
+ BC0E607412D6BC200012A72A /* WebGeolocationPosition.cpp in Sources */,
+ BC1BE1F312D54DBD0004A228 /* WebGeolocationProvider.cpp in Sources */,
+ BC9585C812F095B800755821 /* WebGestureEvent.cpp in Sources */,
+ BCA56A1D12F9028E00C566C7 /* WebGraphicsContext.cpp in Sources */,
BCF69F861176CD6F00471A52 /* WebHistoryClient.cpp in Sources */,
+ 7801C099142290C400FAF9AF /* WebHitTestResult.cpp in Sources */,
+ 511B24AA132E097200065A0C /* WebIconDatabase.cpp in Sources */,
+ 51834592134532E90092B696 /* WebIconDatabaseClient.cpp in Sources */,
+ 51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */,
+ 511B24A6132E095700065A0C /* WebIconDatabaseProxy.cpp in Sources */,
+ 51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */,
+ BCCF6ABC12C91EF9008F9C35 /* WebImage.cpp in Sources */,
+ 1C8E28211275D15400BC7BD0 /* WebInspector.cpp in Sources */,
BC111A60112F4FBB00337BAB /* WebInspectorClient.cpp in Sources */,
+ 1C8E25A81270E3BB00BC7BD0 /* WebInspectorFrontendClient.cpp in Sources */,
+ 1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */,
+ 1C8E2A351277852400BC7BD0 /* WebInspectorMessageReceiver.cpp in Sources */,
+ 1C8E28351275D73800BC7BD0 /* WebInspectorProxy.cpp in Sources */,
+ 1CA8B936127C774E00576C2B /* WebInspectorProxyMac.mm in Sources */,
+ 1CA8B945127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp in Sources */,
+ C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */,
+ 51A9E0FF1315CCDE009E7031 /* WebKeyValueStorageManager.cpp in Sources */,
+ 51A9E1281315ED35009E7031 /* WebKeyValueStorageManagerMessageReceiver.cpp in Sources */,
+ 51A9E1051315CCFC009E7031 /* WebKeyValueStorageManagerProxy.cpp in Sources */,
+ 51A9E12A1315ED35009E7031 /* WebKeyValueStorageManagerProxyMessageReceiver.cpp in Sources */,
1A6FA31611E3923600DB1371 /* WebKitMain.cpp in Sources */,
BCB9E76211232B9E00A137E0 /* WebLoaderClient.cpp in Sources */,
+ 33D3A3C1133960B000709BE4 /* WebMediaCacheManager.cpp in Sources */,
+ 33D3A3C81339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp in Sources */,
+ 33D3A3BA1339606200709BE4 /* WebMediaCacheManagerProxy.cpp in Sources */,
+ 33D3A3CA1339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp in Sources */,
+ 909854EC12BC4E17000AD080 /* WebMemorySampler.cpp in Sources */,
+ 909854EE12BC4E18000AD080 /* WebMemorySampler.mac.mm in Sources */,
+ C0337DB0127A28D0008FF4F4 /* WebMouseEvent.cpp in Sources */,
BCF69FA31176D01400471A52 /* WebNavigationData.cpp in Sources */,
+ 31A2EC48148997C200810D71 /* WebNotification.cpp in Sources */,
+ 31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */,
+ 31312620148FF82C00BA2A39 /* WebNotificationManager.cpp in Sources */,
+ 31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
+ 31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */,
+ 318BE1671473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp in Sources */,
+ 31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */,
+ BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */,
+ BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */,
+ BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */,
BC963D6B113DD19200574BE2 /* WebPage.cpp in Sources */,
+ 5153569C1291B1D2000749DC /* WebPageContextMenuClient.cpp in Sources */,
+ C06C6095124C144B0001682F /* WebPageCreationParameters.cpp in Sources */,
+ BC7B6207129A0A6700D174A4 /* WebPageGroup.cpp in Sources */,
+ BC7B625312A43C9600D174A4 /* WebPageGroupData.cpp in Sources */,
+ BC7B621612A4219A00D174A4 /* WebPageGroupProxy.cpp in Sources */,
BC963D6E113DD1A500574BE2 /* WebPageMac.mm in Sources */,
+ C0CE72A01247E71D00BC0EC4 /* WebPageMessageReceiver.cpp in Sources */,
BC111B0F112F5E4F00337BAB /* WebPageProxy.cpp in Sources */,
+ 51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */,
+ BC857E8712B71EBB00EDEB2E /* WebPageProxyMac.mm in Sources */,
+ BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */,
1A3E736211CC2659007BD539 /* WebPlatformStrategies.cpp in Sources */,
+ C0337DDD127A521C008FF4F4 /* WebPlatformTouchPoint.cpp in Sources */,
+ 1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */,
BCB9F8AF1124E07700A137E0 /* WebPolicyClient.cpp in Sources */,
+ BC5744EF12638FB3006F0F12 /* WebPopupItem.cpp in Sources */,
+ D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */,
+ BCC43AC7127B99DE00317F16 /* WebPopupMenuMac.mm in Sources */,
+ BC5750981268F3C6006F0F12 /* WebPopupMenuProxyMac.mm in Sources */,
BCD59800112B57BE00EC8C23 /* WebPreferences.cpp in Sources */,
+ BC2DFBA312A761A500E732A3 /* WebPreferencesCF.cpp in Sources */,
+ BC84EB1812A7100C0083F2DA /* WebPreferencesMac.mm in Sources */,
BCD598AD112B7FDF00EC8C23 /* WebPreferencesStore.cpp in Sources */,
BC111AE4112F5C2600337BAB /* WebProcess.cpp in Sources */,
+ 1A043A0A124D11A900FFBFB5 /* WebProcessConnection.cpp in Sources */,
+ 1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */,
+ BC306825125A6B9400E71278 /* WebProcessCreationParameters.cpp in Sources */,
+ BC3065C412592F8900E71278 /* WebProcessMac.mm in Sources */,
1A6FA01E11E1526300DB1371 /* WebProcessMainMac.mm in Sources */,
+ BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */,
BC111B11112F5E4F00337BAB /* WebProcessProxy.cpp in Sources */,
+ 51D130581382F10500351EDD /* WebProcessProxyMac.mm in Sources */,
+ BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */,
+ 512F589C12A8838800629530 /* WebProtectionSpace.cpp in Sources */,
+ 3336762F130C9998006C9DE2 /* WebResourceCacheManager.cpp in Sources */,
+ 33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */,
+ 33367655130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp in Sources */,
+ 33367635130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp in Sources */,
+ 33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */,
+ BC858A2112C0357B00EDEB2E /* WebResourceLoadClient.cpp in Sources */,
+ D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */,
BCC5715C115ADAEF001CCAF9 /* WebSystemInterface.mm in Sources */,
+ C0337DD8127A51B6008FF4F4 /* WebTouchEvent.cpp in Sources */,
1A594ABA112A1FB6009DE7C7 /* WebUIClient.cpp in Sources */,
+ BCA0EF8012331E78007D3CFB /* WebUndoStep.cpp in Sources */,
+ BCE2315E122C30CA00D5C35A /* WebURLRequest.cpp in Sources */,
+ BCE231C2122C466E00D5C35A /* WebURLRequestMac.mm in Sources */,
+ BC90A1D3122DD55E00CC8C50 /* WebURLResponse.cpp in Sources */,
+ BC90A1D7122DD66A00CC8C50 /* WebURLResponseMac.mm in Sources */,
+ C0337DD1127A2980008FF4F4 /* WebWheelEvent.cpp in Sources */,
+ 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObject.mm in Sources */,
+ 512E34E4130B4D0500ABD19A /* WKApplicationCacheManager.cpp in Sources */,
+ BC4075F3124FF0270068F20A /* WKArray.cpp in Sources */,
+ 512F58F512A88A5400629530 /* WKAuthenticationChallenge.cpp in Sources */,
+ 512F58F712A88A5400629530 /* WKAuthenticationDecisionListener.cpp in Sources */,
BC646C1A11DD399F006455B0 /* WKBackForwardList.cpp in Sources */,
BC646C1C11DD399F006455B0 /* WKBackForwardListItem.cpp in Sources */,
+ BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
+ BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
BC204EEE11C83EC8008F3375 /* WKBundle.cpp in Sources */,
+ 935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,
+ 935EEBA0127761AC003322B8 /* WKBundleBackForwardListItem.cpp in Sources */,
BCD25F1811D6BDE100169B0E /* WKBundleFrame.cpp in Sources */,
- BC20528211C94284008F3375 /* WKBundlePage.cpp in Sources */,
- BCB9E24C1120E15C00A137E0 /* WKContext.cpp in Sources */,
- BCD0139C110FA420003B8A67 /* WKFrame.cpp in Sources */,
- BCB9F6A61123DD0D00A137E0 /* WKFramePolicyListener.cpp in Sources */,
- BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */,
- BCD597D6112B56DC00EC8C23 /* WKPage.cpp in Sources */,
- BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */,
- BC8699B6116AADAA002A925B /* WKView.mm in Sources */,
- BC2E6E8D1141971500A63B1E /* WorkQueue.cpp in Sources */,
- BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */,
- 1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */,
- 1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */,
- 1A1C649B11F4174200553C19 /* WebContextMac.mm in Sources */,
- 1A24B5F211F531E800C38269 /* MachUtilities.cpp in Sources */,
- E1EE53E711F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp in Sources */,
- 1AE4976911FF658E0048B464 /* NPJSObject.cpp in Sources */,
- 1AE4987911FF7FAA0048B464 /* JSNPObject.cpp in Sources */,
- 1AE49A4A11FFA8CE0048B464 /* JSNPMethod.cpp in Sources */,
- D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */,
- D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */,
- C0E3AA7A1209E83000A49D01 /* ModuleMac.mm in Sources */,
- C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */,
- 1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */,
- 1A0F29CB120B37160053D1B9 /* VisitedLinkTable.cpp in Sources */,
- 1A0F29E3120B44420053D1B9 /* VisitedLinkProvider.cpp in Sources */,
- BC4BEEAC120A0A5F00FBA0C7 /* InjectedBundleNodeHandle.cpp in Sources */,
+ BC498630124D18C100D834E1 /* WKBundleHitTestResult.cpp in Sources */,
+ 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */,
+ BC7043CD12F75EE0006472B9 /* WKBundleNavigationAction.cpp in Sources */,
BC4BEFE2120A1A4C00FBA0C7 /* WKBundleNodeHandle.cpp in Sources */,
- BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
- BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */,
- BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */,
- BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */,
- BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
- BCE469591214EDF4000B98EB /* WKFormSubmissionListener.cpp in Sources */,
- BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
- BCBCB0CD1215E33A00DE59CA /* ImmutableDictionary.cpp in Sources */,
- 9391F2CA121B679A00EBF7E8 /* WebFrameNetworkingContext.mm in Sources */,
- BCE2315E122C30CA00D5C35A /* WebURLRequest.cpp in Sources */,
- BCE231C2122C466E00D5C35A /* WebURLRequestMac.mm in Sources */,
- BCE23263122C6CF300D5C35A /* WebCoreArgumentCodersMac.mm in Sources */,
- BC90A1D3122DD55E00CC8C50 /* WebURLResponse.cpp in Sources */,
- BC90A1D7122DD66A00CC8C50 /* WebURLResponseMac.mm in Sources */,
- BCB0AD33122F285800B1341E /* MutableArray.cpp in Sources */,
- BCB0AEEA122F53E300B1341E /* MutableDictionary.cpp in Sources */,
- BCA0EF8012331E78007D3CFB /* WebUndoStep.cpp in Sources */,
- BCA0EFA012332642007D3CFB /* WebEditCommandProxy.cpp in Sources */,
- BCF50122123ED3B3005955AE /* ThreadLauncher.cpp in Sources */,
- BCF501B4123EF602005955AE /* ThreadLauncherMac.mm in Sources */,
- C5237F6012441CA300780472 /* WebEditorClientMac.mm in Sources */,
- BC33E0D212408E8600360F3F /* InjectedBundleRangeHandle.cpp in Sources */,
+ BC20528211C94284008F3375 /* WKBundlePage.cpp in Sources */,
+ BC7B633E12A45D1200D174A4 /* WKBundlePageGroup.cpp in Sources */,
+ EDCA71B7128DDA8C00201B26 /* WKBundlePageOverlay.cpp in Sources */,
BC60C57A1240A546008C5E29 /* WKBundleRangeHandle.cpp in Sources */,
- BCF505E81243047B005955AE /* PlatformCertificateInfo.mm in Sources */,
- C0CE72A01247E71D00BC0EC4 /* WebPageMessageReceiver.cpp in Sources */,
- 1A0EC604124A9F2C007EF4A5 /* PluginProcessManager.cpp in Sources */,
- 1A0EC75F124BC7B2007EF4A5 /* PluginProcessProxy.cpp in Sources */,
- 1A0EC803124BD41E007EF4A5 /* PluginProcessMainMac.mm in Sources */,
- 1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */,
- 1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */,
- BC498619124D10E200D834E1 /* InjectedBundleHitTestResult.cpp in Sources */,
- BC498630124D18C100D834E1 /* WKBundleHitTestResult.cpp in Sources */,
- 1A043977124D034800FFBFB5 /* PluginProcess.cpp in Sources */,
- 1A043A0A124D11A900FFBFB5 /* WebProcessConnection.cpp in Sources */,
- C06C6095124C144B0001682F /* WebPageCreationParameters.cpp in Sources */,
- 1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */,
- BC4075F3124FF0270068F20A /* WKArray.cpp in Sources */,
+ BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */,
BC4075F5124FF0270068F20A /* WKCertificateInfo.cpp in Sources */,
+ BC407628124FF0400068F20A /* WKCertificateInfoMac.mm in Sources */,
+ BCA284D61492F2C7001F9042 /* WKConnection.mm in Sources */,
+ BC4A6296147313A0006C681A /* WKConnectionRef.cpp in Sources */,
+ BCB9E24C1120E15C00A137E0 /* WKContext.cpp in Sources */,
+ 51A555F5128C6C47009ABCEC /* WKContextMenuItem.cpp in Sources */,
+ 3309345A1315B9980097A7BC /* WKCookieManager.cpp in Sources */,
+ 512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
BC4075F7124FF0270068F20A /* WKData.cpp in Sources */,
+ F62A766112B1ABED0005F1B6 /* WKDatabaseManager.cpp in Sources */,
BC4075F9124FF0270068F20A /* WKDictionary.cpp in Sources */,
+ 1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */,
BC4075FB124FF0270068F20A /* WKError.cpp in Sources */,
+ BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */,
+ BCE469591214EDF4000B98EB /* WKFormSubmissionListener.cpp in Sources */,
+ BCD0139C110FA420003B8A67 /* WKFrame.cpp in Sources */,
+ BCB9F6A61123DD0D00A137E0 /* WKFramePolicyListener.cpp in Sources */,
+ E1AEA23014687BDB00804569 /* WKFullKeyboardAccessWatcher.mm in Sources */,
+ CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */,
+ BC54CC1312D674EE005C67B0 /* WKGeolocationManager.cpp in Sources */,
+ BC06F44F12DBDF3F002D78DE /* WKGeolocationPermissionRequest.cpp in Sources */,
+ BC0E619912D6CD120012A72A /* WKGeolocationPosition.cpp in Sources */,
+ 0F174AA7142AAC610039250F /* WKGeometry.cpp in Sources */,
+ BCA56A6612F9C8F900C566C7 /* WKGraphicsContext.cpp in Sources */,
+ BCA56A6A12F9C9AD00C566C7 /* WKGraphicsContextCG.cpp in Sources */,
+ B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */,
+ 5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */,
+ 5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */,
+ BCCF6AC212C91F34008F9C35 /* WKImage.cpp in Sources */,
+ BCCF6AC912C91F59008F9C35 /* WKImageCG.cpp in Sources */,
+ 1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */,
+ 51A9E10A1315CD18009E7031 /* WKKeyValueStorageManager.cpp in Sources */,
+ 33D3A3B51339600B00709BE4 /* WKMediaCacheManager.cpp in Sources */,
BC4075FD124FF0270068F20A /* WKMutableArray.cpp in Sources */,
BC4075FF124FF0270068F20A /* WKMutableDictionary.cpp in Sources */,
+ BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */,
+ 318BE17714743E6000A8FBB2 /* WKNotification.cpp in Sources */,
+ 318BE17514743DD700A8FBB2 /* WKNotificationManager.cpp in Sources */,
+ 31A2EC77148D662E00810D71 /* WKNotificationPermissionRequest.cpp in Sources */,
BC407601124FF0270068F20A /* WKNumber.cpp in Sources */,
+ BC85806312B8505700EDEB2E /* WKOpenPanelParameters.cpp in Sources */,
+ BC85806212B8505700EDEB2E /* WKOpenPanelResultListener.cpp in Sources */,
+ BCD597D6112B56DC00EC8C23 /* WKPage.cpp in Sources */,
+ BC7B633812A45ABA00D174A4 /* WKPageGroup.cpp in Sources */,
+ BCE17B7D1381F1170012A641 /* WKPagePrivateMac.cpp in Sources */,
+ 1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */,
+ BCD597D1112B56AC00EC8C23 /* WKPreferences.cpp in Sources */,
+ E134F01A12EA5D99004EC58D /* WKPrintingView.mm in Sources */,
+ BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */,
+ 512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,
+ 3336763A130C99DC006C9DE2 /* WKResourceCacheManager.cpp in Sources */,
+ F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */,
BC407603124FF0270068F20A /* WKSerializedScriptValue.cpp in Sources */,
BC407605124FF0270068F20A /* WKString.cpp in Sources */,
+ BC407619124FF0370068F20A /* WKStringCF.cpp in Sources */,
+ 1A4A9AA912B7E796008FE984 /* WKTextInputWindowController.mm in Sources */,
BC407607124FF0270068F20A /* WKType.cpp in Sources */,
BC407609124FF0270068F20A /* WKURL.cpp in Sources */,
- BC40760B124FF0270068F20A /* WKURLRequest.cpp in Sources */,
- BC40760D124FF0270068F20A /* WKURLResponse.cpp in Sources */,
- BC407619124FF0370068F20A /* WKStringCF.cpp in Sources */,
BC40761B124FF0370068F20A /* WKURLCF.cpp in Sources */,
- BC407628124FF0400068F20A /* WKCertificateInfoMac.mm in Sources */,
+ BC40760B124FF0270068F20A /* WKURLRequest.cpp in Sources */,
BC40762A124FF0400068F20A /* WKURLRequestNS.mm in Sources */,
+ BC40760D124FF0270068F20A /* WKURLResponse.cpp in Sources */,
BC40762C124FF0400068F20A /* WKURLResponseNS.mm in Sources */,
- 1A043CEB124FE38F00FFBFB5 /* PluginProcessMessageReceiver.cpp in Sources */,
- 1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */,
- 1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */,
- 1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
- C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */,
- 51B3005012529D0E000B5CA0 /* WebBackForwardListCF.cpp in Sources */,
- 51B3005112529D0E000B5CA0 /* WebPageProxyCF.cpp in Sources */,
- 1A8EF96E1252AF6B00F7067F /* PluginControllerProxyMessageReceiver.cpp in Sources */,
- 1A8EFA701252B84100F7067F /* PluginProxyMessageReceiver.cpp in Sources */,
- 1A8EFDFE1253CB6E00F7067F /* DataReference.cpp in Sources */,
- BC3065C412592F8900E71278 /* WebProcessMac.mm in Sources */,
- BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */,
- BC306825125A6B9400E71278 /* WebProcessCreationParameters.cpp in Sources */,
- 51A7F2F5125BF8D4008AEB1D /* Logging.cpp in Sources */,
- BCBD3914125BB1A800D2C29F /* WebPageProxyMessageReceiver.cpp in Sources */,
- 1A3DD1FD125E59F3004515E6 /* WebFindClient.cpp in Sources */,
- BC5744EF12638FB3006F0F12 /* WebPopupItem.cpp in Sources */,
- 1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */,
- 1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
- 1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */,
- C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */,
- BC5750981268F3C6006F0F12 /* WebPopupMenuProxyMac.mm in Sources */,
- 1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
- 1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */,
F6113E28126CE19B0057D0A7 /* WKUserContentURLPattern.cpp in Sources */,
- BC575613126E0138006F0F12 /* WebError.cpp in Sources */,
- 1C8E25A81270E3BB00BC7BD0 /* WebInspectorFrontendClient.cpp in Sources */,
- 1C8E28211275D15400BC7BD0 /* WebInspector.cpp in Sources */,
- 1C8E28351275D73800BC7BD0 /* WebInspectorProxy.cpp in Sources */,
- 1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */,
- 935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,
- 935EEBA0127761AC003322B8 /* WKBundleBackForwardListItem.cpp in Sources */,
- 935EEBA1127761CC003322B8 /* InjectedBundleBackForwardList.cpp in Sources */,
- 935EEBA3127761D3003322B8 /* InjectedBundleBackForwardListItem.cpp in Sources */,
- 1A61614F127798B5003ACD86 /* DownloadManager.cpp in Sources */,
- 1A6161D51278981C003ACD86 /* Download.cpp in Sources */,
- 1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */,
- 51ACBBA1127A8F2C00D203B9 /* WebContextMenuProxyMac.mm in Sources */,
- C0337DAE127A24FE008FF4F4 /* WebEvent.cpp in Sources */,
- C0337DB0127A28D0008FF4F4 /* WebMouseEvent.cpp in Sources */,
- C0337DD1127A2980008FF4F4 /* WebWheelEvent.cpp in Sources */,
- C0337DD3127A2A0E008FF4F4 /* WebKeyboardEvent.cpp in Sources */,
- C0337DD8127A51B6008FF4F4 /* WebTouchEvent.cpp in Sources */,
- C0337DDD127A521C008FF4F4 /* WebPlatformTouchPoint.cpp in Sources */,
- BCC43ABA127B95DC00317F16 /* PlatformPopupMenuData.cpp in Sources */,
- BCC43AC7127B99DE00317F16 /* WebPopupMenuMac.mm in Sources */,
- 51871B5B127CB89D00F76232 /* WebContextMenu.cpp in Sources */,
- 51A84CE3127F386B00CA6EA4 /* WebContextMenuProxy.cpp in Sources */,
- 1A2D82A4127F4EAB001EB962 /* NPObjectMessageReceiver.cpp in Sources */,
- 1A2D82A6127F4EAB001EB962 /* NPObjectProxy.cpp in Sources */,
- 1A2D82A8127F4EAB001EB962 /* NPRemoteObjectMap.cpp in Sources */,
- 1A2D8439127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp in Sources */,
- 1A2D848C127F6A49001EB962 /* NPIdentifierData.cpp in Sources */,
- 1A2D84A4127F6AD1001EB962 /* NPVariantData.cpp in Sources */,
- 1C8E2A351277852400BC7BD0 /* WebInspectorMessageReceiver.cpp in Sources */,
- 1A2D90BB1281C931001EB962 /* PluginProcessProxyMac.mm in Sources */,
- 1A2D90D31281C966001EB962 /* PluginProcessCreationParameters.cpp in Sources */,
- 1A2D91A61281D739001EB962 /* PluginControllerProxyMac.mm in Sources */,
- 1A2D92211281DC1B001EB962 /* PluginProxyMac.mm in Sources */,
- BCEE7AD012817988009827DA /* WebProcessProxyMessageReceiver.cpp in Sources */,
- 1A2D957012848564001EB962 /* ChildProcess.cpp in Sources */,
- BCEE7D0D12846F69009827DA /* WebContextMessageReceiver.cpp in Sources */,
- 510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */,
- 1AB7D4CB1288AAA700CFD08C /* DownloadProxy.cpp in Sources */,
- 1AB7D6191288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp in Sources */,
- 512935D71288D19400A4B695 /* WebContextMenuItem.cpp in Sources */,
- 512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */,
- 1AB7D72D1288CAAD00CFD08C /* WebDownloadClient.cpp in Sources */,
- 1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */,
- 51A555F5128C6C47009ABCEC /* WKContextMenuItem.cpp in Sources */,
- BCEE7DC6128B645D009827DA /* InjectedBundleClient.cpp in Sources */,
- 1CA8B936127C774E00576C2B /* WebInspectorProxyMac.mm in Sources */,
- 1CA8B945127C882A00576C2B /* WebInspectorProxyMessageReceiver.cpp in Sources */,
- 1CA8B954127C891500576C2B /* WebInspectorMac.mm in Sources */,
- EDCA71B7128DDA8C00201B26 /* WKBundlePageOverlay.cpp in Sources */,
- 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObject.mm in Sources */,
- 5153569C1291B1D2000749DC /* WebPageContextMenuClient.cpp in Sources */,
- 1AAB4AAA1296F1540023952F /* SandboxExtensionMac.mm in Sources */,
- BC7B6207129A0A6700D174A4 /* WebPageGroup.cpp in Sources */,
- BC7B621612A4219A00D174A4 /* WebPageGroupProxy.cpp in Sources */,
- BC7B625312A43C9600D174A4 /* WebPageGroupData.cpp in Sources */,
- BC7B633812A45ABA00D174A4 /* WKPageGroup.cpp in Sources */,
- BC7B633E12A45D1200D174A4 /* WKBundlePageGroup.cpp in Sources */,
- 1AA4792312A59FD9008236C3 /* PluginProcessMac.mm in Sources */,
- BC84EB1812A7100C0083F2DA /* WebPreferencesMac.mm in Sources */,
- BC2DFBA312A761A500E732A3 /* WebPreferencesCF.cpp in Sources */,
- 512F588A12A8836600629530 /* AuthenticationManager.cpp in Sources */,
- 512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */,
- 512F589812A8838800629530 /* AuthenticationDecisionListener.cpp in Sources */,
- 512F589A12A8838800629530 /* WebCredential.cpp in Sources */,
- 512F589C12A8838800629530 /* WebProtectionSpace.cpp in Sources */,
- 512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */,
- 512F58F512A88A5400629530 /* WKAuthenticationChallenge.cpp in Sources */,
- 512F58F712A88A5400629530 /* WKAuthenticationDecisionListener.cpp in Sources */,
- 512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
- 512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,
- F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */,
- F6A25FDC12ADC6CC00DC40CC /* WebDatabaseManager.cpp in Sources */,
- 51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */,
- 1AAF061512B01131008E49E2 /* PDFViewController.mm in Sources */,
- 1AAF0C4B12B16334008E49E2 /* ArgumentCodersCF.cpp in Sources */,
- F62A765C12B1ABC30005F1B6 /* WebDatabaseManagerProxy.cpp in Sources */,
- F62A766112B1ABED0005F1B6 /* WKDatabaseManager.cpp in Sources */,
- F62A76B612B1B25F0005F1B6 /* WebDatabaseManagerMessageReceiver.cpp in Sources */,
- F62A76B812B1B25F0005F1B6 /* WebDatabaseManagerProxyMessageReceiver.cpp in Sources */,
- BC857E8712B71EBB00EDEB2E /* WebPageProxyMac.mm in Sources */,
- BC857F7E12B82CEE00EDEB2E /* WebOpenPanelResultListenerProxy.cpp in Sources */,
- BC857F8612B82D0B00EDEB2E /* WebOpenPanelResultListener.cpp in Sources */,
- BC857FB612B830E600EDEB2E /* WebOpenPanelParameters.cpp in Sources */,
- BC85806212B8505700EDEB2E /* WKOpenPanelResultListener.cpp in Sources */,
- BC85806312B8505700EDEB2E /* WKOpenPanelParameters.cpp in Sources */,
- 1A4A9AA912B7E796008FE984 /* WKTextInputWindowController.mm in Sources */,
- 1A4A9C5512B816CF008FE984 /* NetscapePluginModule.cpp in Sources */,
- 1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */,
- BC858A2112C0357B00EDEB2E /* WebResourceLoadClient.cpp in Sources */,
- 1AA417EF12C00D87002BE67B /* TextCheckerMac.mm in Sources */,
- 909854EC12BC4E17000AD080 /* WebMemorySampler.cpp in Sources */,
- 909854EE12BC4E18000AD080 /* WebMemorySampler.mac.mm in Sources */,
- BCCF673312C7F15C008F9C35 /* OriginAndDatabases.cpp in Sources */,
- BCCF6ABC12C91EF9008F9C35 /* WebImage.cpp in Sources */,
- BCCF6AC212C91F34008F9C35 /* WKImage.cpp in Sources */,
- BCCF6AC912C91F59008F9C35 /* WKImageCG.cpp in Sources */,
- BCAC112012C92C1F00B08EEE /* WebDatabaseManagerProxyClient.cpp in Sources */,
- 93FC67BD12D3CCF200A60610 /* DecoderAdapter.cpp in Sources */,
- 93FC67BF12D3CCF200A60610 /* EncoderAdapter.cpp in Sources */,
- 518D2CAD12D5153B003BB93B /* WebBackForwardListItem.cpp in Sources */,
- BC1BE1E112D54A410004A228 /* WebGeolocationClient.cpp in Sources */,
- BC1BE1F312D54DBD0004A228 /* WebGeolocationProvider.cpp in Sources */,
- 518D2CCA12D51DFB003BB93B /* SessionState.cpp in Sources */,
- E1CC1B9112D7EADF00625838 /* PrintInfoMac.mm in Sources */,
- E18C92F412DB9E7100CF2AEB /* PrintInfo.cpp in Sources */,
- BC54CACC12D64291005C67B0 /* WebGeolocationManagerProxy.cpp in Sources */,
- BC54CC1312D674EE005C67B0 /* WKGeolocationManager.cpp in Sources */,
- BC0E5FE612D697160012A72A /* WebGeolocationManager.cpp in Sources */,
- BC0E606112D6BA910012A72A /* WebGeolocationManagerMessageReceiver.cpp in Sources */,
- BC0E607412D6BC200012A72A /* WebGeolocationPosition.cpp in Sources */,
- BC0E618212D6CB1D0012A72A /* WebGeolocationManagerProxyMessageReceiver.cpp in Sources */,
- BC0E619912D6CD120012A72A /* WKGeolocationPosition.cpp in Sources */,
- BC06F43012DBB9B6002D78DE /* GeolocationPermissionRequestManager.cpp in Sources */,
- BC06F43B12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp in Sources */,
- BC06F44B12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp in Sources */,
- BC06F44F12DBDF3F002D78DE /* WKGeolocationPermissionRequest.cpp in Sources */,
- 1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */,
- 1A64218712DCF49200CAAE2C /* DrawingAreaProxyImpl.cpp in Sources */,
- 1A6421F712DCFBAB00CAAE2C /* DrawingAreaImpl.cpp in Sources */,
- 1A64229912DD029200CAAE2C /* DrawingAreaMessageReceiver.cpp in Sources */,
- 1A64230812DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp in Sources */,
- 1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */,
- 1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */,
- 1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */,
- 1AA2E51E12E4C05E00BC4966 /* CGUtilities.cpp in Sources */,
- C574A37712E6099D002DFE98 /* WebDragClientMac.mm in Sources */,
- C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */,
- E134F01A12EA5D99004EC58D /* WKPrintingView.mm in Sources */,
- BC9585C812F095B800755821 /* WebGestureEvent.cpp in Sources */,
- 1A186EEB12EF7618008E5F37 /* LayerTreeHost.cpp in Sources */,
- 6501BD1A12F1243400E9F248 /* WKBundleInspector.cpp in Sources */,
- BC8147AA12F64CDA007B2C32 /* InjectedBundlePagePolicyClient.cpp in Sources */,
- BC8147D612F66D31007B2C32 /* InjectedBundleNavigationAction.cpp in Sources */,
- BC7043CD12F75EE0006472B9 /* WKBundleNavigationAction.cpp in Sources */,
- 1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */,
- BCA56A1D12F9028E00C566C7 /* WebGraphicsContext.cpp in Sources */,
- BCA56A6612F9C8F900C566C7 /* WKGraphicsContext.cpp in Sources */,
- BCA56A6A12F9C9AD00C566C7 /* WKGraphicsContextCG.cpp in Sources */,
- 659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
- 512E34E4130B4D0500ABD19A /* WKApplicationCacheManager.cpp in Sources */,
- 512E3524130B550600ABD19A /* WebApplicationCacheManagerProxy.cpp in Sources */,
- 512E352E130B55AF00ABD19A /* WebApplicationCacheManager.cpp in Sources */,
- 512E356A130B57F000ABD19A /* WebApplicationCacheManagerMessageReceiver.cpp in Sources */,
- 512E35F8130B642E00ABD19A /* WebApplicationCacheManagerProxyMessageReceiver.cpp in Sources */,
- 1AC86FF3130B46D3002C1257 /* WKPluginSiteDataManager.cpp in Sources */,
- 1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */,
- 3336762F130C9998006C9DE2 /* WebResourceCacheManager.cpp in Sources */,
- 33367635130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp in Sources */,
- 3336763A130C99DC006C9DE2 /* WKResourceCacheManager.cpp in Sources */,
- 33367655130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp in Sources */,
- 33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */,
- 33152975130D0CB200ED2483 /* SecurityOriginData.cpp in Sources */,
- 33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */,
- 51A9E0FF1315CCDE009E7031 /* WebKeyValueStorageManager.cpp in Sources */,
- 51A9E1051315CCFC009E7031 /* WebKeyValueStorageManagerProxy.cpp in Sources */,
- 51A9E10A1315CD18009E7031 /* WKKeyValueStorageManager.cpp in Sources */,
- 51A9E1281315ED35009E7031 /* WebKeyValueStorageManagerMessageReceiver.cpp in Sources */,
- 51A9E12A1315ED35009E7031 /* WebKeyValueStorageManagerProxyMessageReceiver.cpp in Sources */,
- 939AE7661316E99C00AE06A6 /* WebCoreArgumentCoders.cpp in Sources */,
- 330934471315B9220097A7BC /* WebCookieManagerMessageReceiver.cpp in Sources */,
- 330934491315B9220097A7BC /* WebCookieManagerProxyMessageReceiver.cpp in Sources */,
- 3309344F1315B94D0097A7BC /* WebCookieManager.cpp in Sources */,
- 330934551315B9750097A7BC /* WebCookieManagerProxy.cpp in Sources */,
- 3309345A1315B9980097A7BC /* WKCookieManager.cpp in Sources */,
- BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
- BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */,
- 33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */,
- CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
- CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
- CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,
- CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
- CDCA85C8132ABA4E00E961DF /* WKFullScreenWindowController.mm in Sources */,
- CDCA85EE132AD70100E961DF /* WebFullScreenManagerProxyMac.mm in Sources */,
- CDCA8603132ADC0500E961DF /* WebFullScreenManagerMac.mm in Sources */,
- BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */,
- 511B24A6132E095700065A0C /* WebIconDatabaseProxy.cpp in Sources */,
- 511B24AA132E097200065A0C /* WebIconDatabase.cpp in Sources */,
- 51D02F64132EC5B900BEAA96 /* WebIconDatabaseMessageReceiver.cpp in Sources */,
- 51D02F6B132EC73700BEAA96 /* WebIconDatabaseProxyMessageReceiver.cpp in Sources */,
- B878B616133428DC006888E9 /* CorrectionPanel.mm in Sources */,
- 33D3A3B51339600B00709BE4 /* WKMediaCacheManager.cpp in Sources */,
- 33D3A3BA1339606200709BE4 /* WebMediaCacheManagerProxy.cpp in Sources */,
- 33D3A3C1133960B000709BE4 /* WebMediaCacheManager.cpp in Sources */,
- 33D3A3C81339617900709BE4 /* WebMediaCacheManagerMessageReceiver.cpp in Sources */,
- 33D3A3CA1339617900709BE4 /* WebMediaCacheManagerProxyMessageReceiver.cpp in Sources */,
- 5160BFE113381DF900918999 /* Logging.mac.mm in Sources */,
- C0D74DDE133BE2D90089CD44 /* LayerTreeHostCA.cpp in Sources */,
- C03A136C133BEBF900D767D1 /* LayerTreeHostCAMac.mm in Sources */,
- 5110AE0C133C16CB0072717A /* WKIconDatabase.cpp in Sources */,
- 5123CF1B133D260A0056F800 /* WKIconDatabaseCG.cpp in Sources */,
- F6A90813133C20510082C3F4 /* WebCookieManagerMac.mm in Sources */,
- F6D632BC133D198200743D77 /* WebCookieManagerProxyMac.mm in Sources */,
- 51834592134532E90092B696 /* WebIconDatabaseClient.cpp in Sources */,
- E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */,
- E179FD9F134D38250015B883 /* ArgumentCodersMac.mm in Sources */,
- 31EA25D2134F78C0005B1452 /* NativeWebMouseEventMac.mm in Sources */,
- CD5C66A0134B9D38004FE2A8 /* InjectedBundlePageFullScreenClient.cpp in Sources */,
- 51C4032C136749D800DC972D /* AuthenticationManager.mac.mm in Sources */,
- DF58C6361371ACA000F9A37C /* NativeWebWheelEventMac.mm in Sources */,
- 1A7C6CDA1378950800B9C04D /* EnvironmentVariables.cpp in Sources */,
- 1A17977F137EE82C00F97D45 /* PluginCreationParameters.cpp in Sources */,
- BCE17B7D1381F1170012A641 /* WKPagePrivateMac.cpp in Sources */,
- 51D130531382EAC000351EDD /* SecItemRequestData.cpp in Sources */,
- 51D130551382EAC000351EDD /* SecItemResponseData.cpp in Sources */,
- 51D130581382F10500351EDD /* WebProcessProxyMac.mm in Sources */,
- 51B15A8413843A3900321AD8 /* EnvironmentUtilities.cpp in Sources */,
- 511F8A80138B46FE00A95F44 /* SecItemShimMethods.mm in Sources */,
- 512DF6D9138C181A00A22FC6 /* KeychainItemShimMethods.mm in Sources */,
- 512DF6FE138C254600A22FC6 /* SecKeychainItemRequestData.cpp in Sources */,
- 512DF700138C254600A22FC6 /* SecKeychainItemResponseData.cpp in Sources */,
- 512DF70A138C26C700A22FC6 /* KeychainAttribute.cpp in Sources */,
- 93C01DAD139AC91700ED51D7 /* CoreIPCClientRunLoop.mm in Sources */,
- 1A3D610113A7CC2A00F95D4E /* PluginModuleInfo.cpp in Sources */,
- 1A3D610513A7F03A00F95D4E /* ArgumentCoders.cpp in Sources */,
- 5D51845513BCF9CC00C7FF4A /* APIClientTraits.cpp in Sources */,
- 5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */,
- 1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */,
- 7801C099142290C400FAF9AF /* WebHitTestResult.cpp in Sources */,
- E199875E142C045400BB2DE7 /* BuiltInPDFView.cpp in Sources */,
- 0F174AA7142AAC610039250F /* WKGeometry.cpp in Sources */,
- B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */,
- BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
- BCBAACEC145225E30053F82F /* WKProcessGroup.mm in Sources */,
- BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
- E1AEA23014687BDB00804569 /* WKFullKeyboardAccessWatcher.mm in Sources */,
- 1AAF263814687C39004A1E8A /* TiledCoreAnimationDrawingArea.mm in Sources */,
- 1AF05D8614688348008B1E81 /* TiledCoreAnimationDrawingAreaProxy.mm in Sources */,
- BC4A628F147312BE006C681A /* WebConnection.cpp in Sources */,
- BC4A6291147312BE006C681A /* WebConnectionClient.cpp in Sources */,
- BC4A6296147313A0006C681A /* WKConnectionRef.cpp in Sources */,
- BC4A62A714744EC7006C681A /* WebConnectionToWebProcess.cpp in Sources */,
- BC09B8F8147460F7005F5625 /* WebContextConnectionClient.cpp in Sources */,
- 31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */,
- 318BE1671473433700A8FBB2 /* WebNotificationManagerProxyMessageReceiver.cpp in Sources */,
- 318BE17514743DD700A8FBB2 /* WKNotificationManager.cpp in Sources */,
- 318BE17714743E6000A8FBB2 /* WKNotification.cpp in Sources */,
- 31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
- BCD3675C148C26C000447E87 /* WebConnectionToUIProcess.cpp in Sources */,
- 8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */,
- B63403F914910D57001070B5 /* APIObject.cpp in Sources */,
- 31A2EC48148997C200810D71 /* WebNotification.cpp in Sources */,
- 31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */,
- 31A2EC4D148997C200810D71 /* WebNotificationProvider.cpp in Sources */,
- 31A2EC501489980500810D71 /* NotificationPermissionRequestManagerProxy.cpp in Sources */,
- 31A2EC551489982E00810D71 /* NotificationPermissionRequest.cpp in Sources */,
- 31A2EC77148D662E00810D71 /* WKNotificationPermissionRequest.cpp in Sources */,
- 3131261E148FF82C00BA2A39 /* NotificationPermissionRequestManager.cpp in Sources */,
- 31312620148FF82C00BA2A39 /* WebNotificationManager.cpp in Sources */,
- BCA284D61492F2C7001F9042 /* WKConnection.mm in Sources */,
- 5DA6ED0B1490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm in Sources */,
- 1AA575FA1496B52600A4EE06 /* EventDispatcher.cpp in Sources */,
- 1AA576021496B97900A4EE06 /* EventDispatcherMessageReceiver.cpp in Sources */,
+ BC8699B6116AADAA002A925B /* WKView.mm in Sources */,
+ BC2E6E8D1141971500A63B1E /* WorkQueue.cpp in Sources */,
+ BC0092F8115837A300E0AE2A /* WorkQueueMac.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/Source/WebKit2/WebKit2Prefix.h b/Source/WebKit2/WebKit2Prefix.h
index a96014f02..59a1378d7 100644
--- a/Source/WebKit2/WebKit2Prefix.h
+++ b/Source/WebKit2/WebKit2Prefix.h
@@ -28,6 +28,20 @@
#import <Cocoa/Cocoa.h>
#endif
+/* When C++ exceptions are disabled, the C++ library defines |try| and |catch|
+* to allow C++ code that expects exceptions to build. These definitions
+* interfere with Objective-C++ uses of Objective-C exception handlers, which
+* use |@try| and |@catch|. As a workaround, undefine these macros. */
+
+#ifdef __cplusplus
+#include <algorithm> // needed for exception_defines.h
+#endif
+
+#ifdef __OBJC__
+#undef try
+#undef catch
+#endif
+
#ifdef __cplusplus
#define new ("if you use new/delete make sure to include config.h at the top of the file"())
#define delete ("if you use new/delete make sure to include config.h at the top of the file"())
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
index fa364cd72..dd68e1f9b 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
@@ -182,6 +182,16 @@ private:
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer*) OVERRIDE;
virtual void setNeedsOneShotDrawingSynchronization() OVERRIDE;
virtual void scheduleCompositingLayerSync() OVERRIDE;
+
+ virtual CompositingTriggerFlags allowedCompositingTriggers() const
+ {
+ return static_cast<CompositingTriggerFlags>(
+ ThreeDTransformTrigger |
+ VideoTrigger |
+ PluginTrigger|
+ CanvasTrigger |
+ AnimationTrigger);
+ }
#endif
#if ENABLE(TOUCH_EVENTS)
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
index c0f612801..907d20c5c 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.cpp
@@ -401,6 +401,9 @@ WebGraphicsLayer* toWebGraphicsLayer(GraphicsLayer* layer)
void WebGraphicsLayer::syncCompositingStateForThisLayerOnly()
{
+ if (!m_layerTreeTileClient)
+ m_layerTreeTileClient = layerTreeTileClient();
+
updateContentBuffers();
if (!m_modified)
@@ -431,12 +434,11 @@ void WebGraphicsLayer::syncCompositingStateForThisLayerOnly()
for (size_t i = 0; i < children().size(); ++i)
m_layerInfo.children.append(toWebLayerID(children()[i]));
- WebLayerTreeTileClient* tileClient = layerTreeTileClient();
- ASSERT(tileClient);
+ ASSERT(m_layerTreeTileClient);
if (m_layerInfo.imageIsUpdated && m_image && !m_layerInfo.imageBackingStoreID)
- m_layerInfo.imageBackingStoreID = tileClient->adoptImageBackingStore(m_image.get());
+ m_layerInfo.imageBackingStoreID = m_layerTreeTileClient->adoptImageBackingStore(m_image.get());
- tileClient->didSyncCompositingStateForLayer(m_layerInfo);
+ m_layerTreeTileClient->didSyncCompositingStateForLayer(m_layerInfo);
m_modified = false;
m_layerInfo.imageIsUpdated = false;
if (m_hasPendingAnimations)
@@ -612,6 +614,22 @@ void WebGraphicsLayer::recreateBackingStoreIfNeeded()
if (m_image)
setContentsNeedsDisplay();
}
+
+void WebGraphicsLayer::setLayerTreeTileClient(WebKit::WebLayerTreeTileClient* client)
+{
+ if (m_layerTreeTileClient == client)
+ return;
+
+ for (size_t i = 0; i < children().size(); ++i) {
+ WebGraphicsLayer* layer = toWebGraphicsLayer(this->children()[i]);
+ layer->setLayerTreeTileClient(client);
+ }
+
+ // Have to force detach from remote layer here if layer tile client changes.
+ if (m_layerTreeTileClient)
+ m_layerTreeTileClient->didDeleteLayer(id());
+ m_layerTreeTileClient = client;
+}
#endif
static PassOwnPtr<GraphicsLayer> createWebGraphicsLayer(GraphicsLayerClient* client)
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
index 52955de1e..361fcb286 100644
--- a/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebGraphicsLayer.h
@@ -124,7 +124,7 @@ public:
virtual void updateTile(int tileID, const WebKit::UpdateInfo&);
virtual void removeTile(int tileID);
- void setLayerTreeTileClient(WebKit::WebLayerTreeTileClient* client) { m_layerTreeTileClient = client; }
+ void setLayerTreeTileClient(WebKit::WebLayerTreeTileClient*);
WebKit::WebLayerTreeTileClient* layerTreeTileClient() const;
bool isReadyForTileBufferSwap() const;
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
index 6486587d0..1a91d8e3c 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp
@@ -78,7 +78,7 @@ void EventDispatcher::didReceiveMessageOnConnectionWorkQueue(CoreIPC::Connection
}
}
-void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEvent)
+void EventDispatcher::wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent& wheelEvent)
{
#if ENABLE(THREADED_SCROLLING)
MutexLocker locker(m_scrollingCoordinatorsMutex);
@@ -96,7 +96,7 @@ void EventDispatcher::wheelEvent(uint64_t pageID, const WebWheelEvent& wheelEven
}
#if ENABLE(GESTURE_EVENTS)
-void EventDispatcher::gestureEvent(uint64_t pageID, const WebGestureEvent& gestureEvent)
+void EventDispatcher::gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent& gestureEvent)
{
#if ENABLE(THREADED_SCROLLING)
MutexLocker locker(m_scrollingCoordinatorsMutex);
diff --git a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
index 7cd2f9550..f8c459af5 100644
--- a/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
+++ b/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h
@@ -66,9 +66,9 @@ private:
void didReceiveEventDispatcherMessageOnConnectionWorkQueue(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, bool& didHandleMessage);
// Message handlers
- void wheelEvent(uint64_t pageID, const WebWheelEvent&);
+ void wheelEvent(CoreIPC::Connection*, uint64_t pageID, const WebWheelEvent&);
#if ENABLE(GESTURE_EVENTS)
- void gestureEvent(uint64_t pageID, const WebGestureEvent&);
+ void gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent&);
#endif
// This is called on the main thread.
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
index 266a3a95d..341fb69e4 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/qt/LayerTreeHostQt.cpp
@@ -52,6 +52,8 @@ PassRefPtr<LayerTreeHostQt> LayerTreeHostQt::create(WebPage* webPage)
LayerTreeHostQt::~LayerTreeHostQt()
{
+ if (m_rootLayer)
+ toWebGraphicsLayer(m_rootLayer.get())->setLayerTreeTileClient(0);
}
LayerTreeHostQt::LayerTreeHostQt(WebPage* webPage)
diff --git a/Source/WebKit2/WebProcess/WebProcess.cpp b/Source/WebKit2/WebProcess/WebProcess.cpp
index 9fdca9051..39b3bc8e5 100644
--- a/Source/WebKit2/WebProcess/WebProcess.cpp
+++ b/Source/WebKit2/WebProcess/WebProcess.cpp
@@ -949,7 +949,7 @@ void WebProcess::garbageCollectJavaScriptObjects()
}
#if ENABLE(PLUGIN_PROCESS)
-void WebProcess::pluginProcessCrashed(const String& pluginPath)
+void WebProcess::pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath)
{
m_pluginProcessConnectionManager.pluginProcessCrashed(pluginPath);
}
diff --git a/Source/WebKit2/WebProcess/WebProcess.h b/Source/WebKit2/WebProcess/WebProcess.h
index b6fff7f2f..1e50284c0 100644
--- a/Source/WebKit2/WebProcess/WebProcess.h
+++ b/Source/WebKit2/WebProcess/WebProcess.h
@@ -73,6 +73,11 @@ struct WebPageGroupData;
struct WebPreferencesStore;
struct WebProcessCreationParameters;
+#if PLATFORM(MAC)
+class SecItemResponseData;
+class SecKeychainItemResponseData;
+#endif
+
class WebProcess : public ChildProcess, private CoreIPC::Connection::QueueClient {
public:
static WebProcess& shared();
@@ -182,7 +187,7 @@ private:
#endif
#if ENABLE(PLUGIN_PROCESS)
- void pluginProcessCrashed(const String& pluginPath);
+ void pluginProcessCrashed(CoreIPC::Connection*, const String& pluginPath);
#endif
void startMemorySampler(const SandboxExtension::Handle&, const String&, const double);
@@ -199,6 +204,11 @@ private:
void getWebCoreStatistics(uint64_t callbackID);
void garbageCollectJavaScriptObjects();
+#if PLATFORM(MAC)
+ void secItemResponse(CoreIPC::Connection*, uint64_t requestID, const SecItemResponseData&);
+ void secKeychainItemResponse(CoreIPC::Connection*, uint64_t requestID, const SecKeychainItemResponseData&);
+#endif
+
// ChildProcess
virtual bool shouldTerminate();
virtual void terminate();
diff --git a/Source/WebKit2/WebProcess/WebProcess.messages.in b/Source/WebKit2/WebProcess/WebProcess.messages.in
index b991f44c5..641cc7df1 100644
--- a/Source/WebKit2/WebProcess/WebProcess.messages.in
+++ b/Source/WebKit2/WebProcess/WebProcess.messages.in
@@ -75,4 +75,9 @@ messages -> WebProcess {
GetWebCoreStatistics(uint64_t callbackID)
GarbageCollectJavaScriptObjects()
+
+#if PLATFORM(MAC)
+ SecItemResponse(uint64_t requestID, WebKit::SecItemResponseData response) DispatchOnConnectionQueue
+ SecKeychainItemResponse(uint64_t requestID, WebKit::SecKeychainItemResponseData response) DispatchOnConnectionQueue
+#endif
}
diff --git a/Source/WebKit2/WebProcess/com.apple.WebProcess.sb b/Source/WebKit2/WebProcess/com.apple.WebProcess.sb
index 80c707806..41c00ac2e 100644
--- a/Source/WebKit2/WebProcess/com.apple.WebProcess.sb
+++ b/Source/WebKit2/WebProcess/com.apple.WebProcess.sb
@@ -151,6 +151,7 @@
(global-name "com.apple.SecurityServer")
(global-name "com.apple.SystemConfiguration.configd")
(global-name "com.apple.SystemConfiguration.PPPController")
+ (global-name "com.apple.SystemConfiguration.SCNetworkReachability")
(global-name "com.apple.audio.VDCAssistant")
(global-name "com.apple.audio.audiohald")
(global-name "com.apple.audio.coreaudiod")
diff --git a/Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.mm b/Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.mm
deleted file mode 100644
index cb50465f9..000000000
--- a/Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.mm
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "CoreIPCClientRunLoop.h"
-
-#import <WebCore/ResourceHandle.h>
-#import <wtf/RetainPtr.h>
-
-using namespace WebCore;
-
-@interface WKFunctionAdapter : NSObject
-{
-@public
- WebKit::FunctionWithContext function;
- void* context;
-}
-- (void)perform;
-@end
-
-@implementation WKFunctionAdapter
-
-- (void)perform
-{
- function(context);
-}
-
-@end
-
-namespace WebKit {
-
-static CFArrayRef createCoreIPCRunLoopModesArray()
-{
- // Ideally we'd like to list all modes here that might be used for run loops while we are handling networking.
- // We have to explicitly include the run loop mode used for synchronous loads in WebCore so we don't get deadlock
- // when those loads call security functions that are shimmed.
- const void* values[2] = { kCFRunLoopCommonModes, ResourceHandle::synchronousLoadRunLoopMode() };
- return CFArrayCreate(0, values, 2, &kCFTypeArrayCallBacks);
-}
-
-static NSArray *coreIPCRunLoopModesArray()
-{
- static CFArrayRef modes = createCoreIPCRunLoopModesArray();
- return (NSArray *)modes;
-}
-
-void callOnCoreIPCClientRunLoopAndWait(FunctionWithContext function, void* context)
-{
- // FIXME: It would fit better with WebKit2 coding style to use a WTF Function here.
- // To do that we'd need to make dispatch have an overload that takes an array of run loop modes or find some
- // other way to specify that we want to include the synchronous load run loop mode.
- RetainPtr<WKFunctionAdapter> adapter(AdoptNS, [[WKFunctionAdapter alloc] init]);
- adapter->function = function;
- adapter->context = context;
- [adapter.get() performSelectorOnMainThread:@selector(perform) withObject:nil waitUntilDone:YES modes:coreIPCRunLoopModesArray()];
-}
-
-}
diff --git a/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.h b/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.h
index ae80130ad..1c7fe33c6 100644
--- a/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.h
+++ b/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.h
@@ -30,6 +30,9 @@ namespace WebKit {
void initializeKeychainItemShim();
+class SecKeychainItemResponseData;
+void didReceiveSecKeychainItemResponse(uint64_t requestID, const SecKeychainItemResponseData&);
+
}
#endif // KeychainItemShimMethods_h
diff --git a/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.mm b/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.mm
index 0f1ac9317..5f71ae46b 100644
--- a/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.mm
+++ b/Source/WebKit2/WebProcess/mac/KeychainItemShimMethods.mm
@@ -28,7 +28,7 @@
#if defined(BUILDING_ON_SNOW_LEOPARD)
-#import "CoreIPCClientRunLoop.h"
+#import "KeychainShimResponseMap.h"
#import "SecKeychainItemRequestData.h"
#import "SecKeychainItemResponseData.h"
#import "WebProcess.h"
@@ -40,34 +40,30 @@
namespace WebKit {
// Methods to allow the shim to manage memory for its own AttributeList contents.
-static HashSet<SecKeychainAttributeList*>& shimManagedAttributeLists()
+static HashSet<SecKeychainAttributeList*>& managedAttributeLists()
{
- DEFINE_STATIC_LOCAL(HashSet<SecKeychainAttributeList*>, set, ());
- return set;
+ AtomicallyInitializedStatic(HashSet<SecKeychainAttributeList*>&, managedAttributeLists = *new HashSet<SecKeychainAttributeList*>);
+
+ return managedAttributeLists;
}
-static void freeAttributeListContents(SecKeychainAttributeList* attrList)
+static Mutex& managedAttributeListsMutex()
{
- ASSERT(shimManagedAttributeLists().contains(attrList));
- ASSERT(attrList);
-
- for (size_t i = 0; i < attrList->count; ++i)
- free(attrList->attr[i].data);
-
- shimManagedAttributeLists().remove(attrList);
+ AtomicallyInitializedStatic(Mutex&, managedAttributeListsMutex = *new Mutex);
+ return managedAttributeListsMutex;
}
static void allocateAttributeListContents(const Vector<KeychainAttribute>& attributes, SecKeychainAttributeList* attrList)
{
- ASSERT(isMainThread());
-
if (!attrList)
return;
-
- ASSERT(!shimManagedAttributeLists().contains(attrList));
+
+ MutexLocker locker(managedAttributeListsMutex());
+
+ ASSERT(!managedAttributeLists().contains(attrList));
ASSERT(attributes.size() == attrList->count);
- shimManagedAttributeLists().add(attrList);
+ managedAttributeLists().add(attrList);
for (size_t i = 0; i < attrList->count; ++i) {
ASSERT(attributes[i].tag == attrList->attr[i].tag);
@@ -87,15 +83,20 @@ static void allocateAttributeListContents(const Vector<KeychainAttribute>& attri
}
// Methods to allow the shim to manage memory for its own KeychainItem content data.
-static HashSet<void*>& shimManagedKeychainItemContents()
+static HashSet<void*>& managedKeychainItemContents()
+{
+ AtomicallyInitializedStatic(HashSet<void*>&, managedKeychainItemContents = *new HashSet<void*>);
+ return managedKeychainItemContents;
+}
+
+static Mutex& managedKeychainItemContentsMutex()
{
- DEFINE_STATIC_LOCAL(HashSet<void*>, set, ());
- return set;
+ AtomicallyInitializedStatic(Mutex&, managedKeychainItemContentsMutex = *new Mutex);
+ return managedKeychainItemContentsMutex;
}
static void allocateKeychainItemContentData(CFDataRef cfData, UInt32* length, void** data)
{
- ASSERT(isMainThread());
ASSERT((length && data) || (!length && !data));
if (!data)
return;
@@ -109,184 +110,107 @@ static void allocateKeychainItemContentData(CFDataRef cfData, UInt32* length, vo
*length = CFDataGetLength(cfData);
*data = malloc(*length);
CFDataGetBytes(cfData, CFRangeMake(0, *length), (UInt8*)*data);
- shimManagedKeychainItemContents().add(*data);
+
+ MutexLocker locker(managedKeychainItemContentsMutex());
+ managedKeychainItemContents().add(*data);
}
-// FIXME (https://bugs.webkit.org/show_bug.cgi?id=60975) - Once CoreIPC supports sync messaging from a secondary thread,
-// we can remove FreeAttributeListContext, FreeKeychainItemDataContext, KeychainItemAPIContext, and these 5 main-thread methods,
-// and we can have the shim methods call out directly from whatever thread they're called on.
+static bool webFreeAttributeListContent(SecKeychainAttributeList* attrList)
+{
+ MutexLocker locker(managedAttributeListsMutex());
-struct FreeAttributeListContext {
- SecKeychainAttributeList* attrList;
- bool freed;
-};
+ if (!managedAttributeLists().contains(attrList))
+ return false;
-static void webFreeAttributeListContentOnMainThread(void* voidContext)
-{
- FreeAttributeListContext* context = (FreeAttributeListContext*)voidContext;
-
- if (!shimManagedAttributeLists().contains(context->attrList)) {
- context->freed = false;
- return;
- }
+ for (size_t i = 0; i < attrList->count; ++i)
+ free(attrList->attr[i].data);
- freeAttributeListContents(context->attrList);
- context->freed = true;
+ managedAttributeLists().remove(attrList);
+ return true;
}
-static bool webFreeAttributeListContent(SecKeychainAttributeList* attrList)
+static bool webFreeKeychainItemContent(void* data)
{
- FreeAttributeListContext context;
- context.attrList = attrList;
-
- callOnCoreIPCClientRunLoopAndWait(webFreeAttributeListContentOnMainThread, &context);
+ MutexLocker locker(managedKeychainItemContentsMutex());
- return context.freed;
-}
+ HashSet<void*>::iterator it = managedKeychainItemContents().find(data);
+ if (it == managedKeychainItemContents().end())
+ return false;
-struct FreeKeychainItemDataContext {
- void* data;
- bool freed;
-};
+ managedKeychainItemContents().remove(it);
+ return true;
+}
-static void webFreeKeychainItemContentOnMainThread(void* voidContext)
+static KeychainShimResponseMap<SecKeychainItemResponseData>& responseMap()
{
- FreeKeychainItemDataContext* context = (FreeKeychainItemDataContext*)voidContext;
-
- if (!shimManagedKeychainItemContents().contains(context->data)) {
- context->freed = false;
- return;
- }
-
- shimManagedKeychainItemContents().remove(context->data);
- free(context->data);
- context->freed = true;
+ AtomicallyInitializedStatic(KeychainShimResponseMap<SecKeychainItemResponseData>&, responseMap = *new KeychainShimResponseMap<SecKeychainItemResponseData>);
+ return responseMap;
}
-static bool webFreeKeychainItemContent(void* data)
+static uint64_t generateSecKeychainItemRequestID()
{
- FreeKeychainItemDataContext context;
- context.data = data;
-
- callOnCoreIPCClientRunLoopAndWait(webFreeKeychainItemContentOnMainThread, &context);
-
- return context.freed;
+ static int64_t uniqueSecKeychainItemRequestID;
+ return OSAtomicIncrement64Barrier(&uniqueSecKeychainItemRequestID);
}
-struct SecKeychainItemContext {
- SecKeychainItemRef item;
-
- SecKeychainAttributeList* attributeList;
- SecItemClass initialItemClass;
- UInt32 length;
- const void* data;
-
- SecItemClass* resultItemClass;
- UInt32* resultLength;
- void** resultData;
-
- OSStatus resultCode;
-};
+void didReceiveSecKeychainItemResponse(uint64_t requestID, const SecKeychainItemResponseData& response)
+{
+ responseMap().didReceiveResponse(requestID, adoptPtr(new SecKeychainItemResponseData(response)));
+}
-static void webSecKeychainItemCopyContentOnMainThread(void* voidContext)
+static PassOwnPtr<SecKeychainItemResponseData> sendSeqKeychainItemRequest(const SecKeychainItemRequestData& request)
{
- SecKeychainItemContext* context = (SecKeychainItemContext*)voidContext;
+ uint64_t requestID = generateSecKeychainItemRequestID();
+ if (!WebProcess::shared().connection()->send(Messages::WebProcessProxy::SecKeychainItemRequest(requestID, request), 0))
+ return nullptr;
- SecKeychainItemRequestData requestData(context->item, context->attributeList);
- SecKeychainItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecKeychainItemCopyContent(requestData), Messages::WebProcessProxy::SecKeychainItemCopyContent::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
- ASSERT_NOT_REACHED();
- return;
- }
-
- allocateAttributeListContents(response.attributes(), context->attributeList);
- allocateKeychainItemContentData(response.data(), context->resultLength, context->resultData);
- if (context->resultItemClass)
- *context->resultItemClass = response.itemClass();
- context->resultCode = response.resultCode();
+ return responseMap().waitForResponse(requestID);
}
static OSStatus webSecKeychainItemCopyContent(SecKeychainItemRef item, SecItemClass* itemClass, SecKeychainAttributeList* attrList, UInt32* length, void** outData)
{
- SecKeychainItemContext context;
- memset(&context, 0, sizeof(SecKeychainItemContext));
- context.item = item;
- context.resultItemClass = itemClass;
- context.attributeList = attrList;
- context.resultLength = length;
- context.resultData = outData;
+ SecKeychainItemRequestData request(SecKeychainItemRequestData::CopyContent, item, attrList);
+ OwnPtr<SecKeychainItemResponseData> response = sendSeqKeychainItemRequest(request);
+ if (!response) {
+ ASSERT_NOT_REACHED();
+ return errSecInteractionNotAllowed;
+ }
- callOnCoreIPCClientRunLoopAndWait(webSecKeychainItemCopyContentOnMainThread, &context);
+ if (itemClass)
+ *itemClass = response->itemClass();
+ allocateAttributeListContents(response->attributes(), attrList);
+ allocateKeychainItemContentData(response->data(), length, outData);
- // FIXME: should return context.resultCode. Returning noErr is a workaround for <rdar://problem/9520886>;
+ // FIXME: should return response->resultCode(). Returning noErr is a workaround for <rdar://problem/9520886>;
// the authentication should fail anyway, since on error no data will be returned.
return noErr;
}
-static void webSecKeychainItemCreateFromContentOnMainThread(void* voidContext)
+static OSStatus webSecKeychainItemCreateFromContent(SecItemClass itemClass, SecKeychainAttributeList* attrList, UInt32 length, const void* data, SecKeychainItemRef *item)
{
- SecKeychainItemContext* context = (SecKeychainItemContext*)voidContext;
-
- SecKeychainItemRequestData requestData(context->initialItemClass, context->attributeList, context->length, context->data);
- SecKeychainItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecKeychainItemCreateFromContent(requestData), Messages::WebProcessProxy::SecKeychainItemCreateFromContent::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
+ SecKeychainItemRequestData request(SecKeychainItemRequestData::CreateFromContent, itemClass, attrList, length, data);
+ OwnPtr<SecKeychainItemResponseData> response = sendSeqKeychainItemRequest(request);
+ if (!response) {
ASSERT_NOT_REACHED();
- return;
+ return errSecInteractionNotAllowed;
}
- if (response.keychainItem())
- CFRetain(response.keychainItem());
- context->item = response.keychainItem();
- context->resultCode = response.resultCode();
-}
-
-static OSStatus webSecKeychainItemCreateFromContent(SecItemClass itemClass, SecKeychainAttributeList* attrList, UInt32 length, const void* data, SecKeychainItemRef *item)
-{
- SecKeychainItemContext context;
- memset(&context, 0, sizeof(SecKeychainItemContext));
- context.initialItemClass = itemClass;
- context.attributeList = attrList;
- context.length = length;
- context.data = data;
-
- callOnCoreIPCClientRunLoopAndWait(webSecKeychainItemCreateFromContentOnMainThread, &context);
-
if (item)
- *item = context.item;
- else
- CFRelease(context.item);
+ *item = RetainPtr<SecKeychainItemRef>(response->keychainItem()).leakRef();
- return context.resultCode;
+ return response->resultCode();
}
-static void webSecKeychainItemModifyContentOnMainThread(void* voidContext)
+static OSStatus webSecKeychainItemModifyContent(SecKeychainItemRef itemRef, const SecKeychainAttributeList* attrList, UInt32 length, const void* data)
{
- SecKeychainItemContext* context = (SecKeychainItemContext*)voidContext;
-
- SecKeychainItemRequestData requestData(context->item, context->attributeList, context->length, context->data);
- SecKeychainItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecKeychainItemModifyContent(requestData), Messages::WebProcessProxy::SecKeychainItemModifyContent::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
+ SecKeychainItemRequestData request(SecKeychainItemRequestData::ModifyContent, itemRef, (SecKeychainAttributeList*)attrList, length, data);
+ OwnPtr<SecKeychainItemResponseData> response = sendSeqKeychainItemRequest(request);
+ if (!response) {
ASSERT_NOT_REACHED();
- return;
+ return errSecInteractionNotAllowed;
}
-
- context->resultCode = response.resultCode();
-}
-static OSStatus webSecKeychainItemModifyContent(SecKeychainItemRef itemRef, const SecKeychainAttributeList* attrList, UInt32 length, const void* data)
-{
- SecKeychainItemContext context;
- context.item = itemRef;
- context.attributeList = (SecKeychainAttributeList*)attrList;
- context.length = length;
- context.data = data;
-
- callOnCoreIPCClientRunLoopAndWait(webSecKeychainItemModifyContentOnMainThread, &context);
-
- return context.resultCode;
+ return response->resultCode();
}
void initializeKeychainItemShim()
diff --git a/Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.h b/Source/WebKit2/WebProcess/mac/KeychainShimResponseMap.h
index 28f3f4797..b4a78e648 100644
--- a/Source/WebKit2/WebProcess/mac/CoreIPCClientRunLoop.h
+++ b/Source/WebKit2/WebProcess/mac/KeychainShimResponseMap.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,12 +23,47 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
-namespace WebKit {
+#ifndef KeychainShimResponseMap_h
+#define KeychainShimResponseMap_h
-typedef void (*FunctionWithContext)(void* context);
+#include <wtf/HashMap.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/ThreadingPrimitives.h>
-// Call the function on a thread where it's safe to send a synchronous CoreIPC message.
-// We can't use WTF's callOnMainThreadAndWait because it doesn't support enough run loop modes.
-void callOnCoreIPCClientRunLoopAndWait(FunctionWithContext, void* context);
+template<typename T>
+class KeychainShimResponseMap {
+public:
+ PassOwnPtr<T> waitForResponse(uint64_t requestID)
+ {
+ while (true) {
+ MutexLocker locker(m_mutex);
-}
+ if (OwnPtr<T> response = m_responses.take(requestID))
+ return response.release();
+
+ m_condition.wait(m_mutex);
+ }
+
+ return nullptr;
+ }
+
+ void didReceiveResponse(uint64_t requestID, PassOwnPtr<T> response)
+ {
+ MutexLocker locker(m_mutex);
+ ASSERT(!m_responses.contains(requestID));
+
+ m_responses.set(requestID, response);
+ m_condition.signal();
+ }
+
+private:
+ Mutex m_mutex;
+ ThreadCondition m_condition;
+
+ HashMap<uint64_t, OwnPtr<T> > m_responses;
+};
+
+
+
+#endif // KeychainShimResponseMap_h
diff --git a/Source/WebKit2/WebProcess/mac/SecItemShimMethods.h b/Source/WebKit2/WebProcess/mac/SecItemShimMethods.h
index 9d67ed982..7c8d4791d 100644
--- a/Source/WebKit2/WebProcess/mac/SecItemShimMethods.h
+++ b/Source/WebKit2/WebProcess/mac/SecItemShimMethods.h
@@ -30,6 +30,9 @@ namespace WebKit {
void initializeSecItemShim();
+class SecItemResponseData;
+void didReceiveSecItemResponse(uint64_t requestID, const SecItemResponseData&);
+
}
#endif // SecItemShimMethods_h
diff --git a/Source/WebKit2/WebProcess/mac/SecItemShimMethods.mm b/Source/WebKit2/WebProcess/mac/SecItemShimMethods.mm
index 5b2b75ce8..c3575744f 100644
--- a/Source/WebKit2/WebProcess/mac/SecItemShimMethods.mm
+++ b/Source/WebKit2/WebProcess/mac/SecItemShimMethods.mm
@@ -28,7 +28,7 @@
#if !defined(BUILDING_ON_SNOW_LEOPARD)
-#import "CoreIPCClientRunLoop.h"
+#import "KeychainShimResponseMap.h"
#import "SecItemRequestData.h"
#import "SecItemResponseData.h"
#import "WebProcess.h"
@@ -39,122 +39,68 @@
namespace WebKit {
-// FIXME (https://bugs.webkit.org/show_bug.cgi?id=60975) - Once CoreIPC supports sync messaging from a secondary thread,
-// we can remove SecItemAPIContext and these 4 main-thread methods, and we can have the shim methods call out directly
-// from whatever thread they're on.
-
-struct SecItemAPIContext {
- CFDictionaryRef query;
- CFDictionaryRef attributesToUpdate;
- CFTypeRef resultObject;
- OSStatus resultCode;
-};
-
-static void webSecItemCopyMatchingMainThread(void* voidContext)
+static KeychainShimResponseMap<SecItemResponseData>& responseMap()
{
- SecItemAPIContext* context = (SecItemAPIContext*)voidContext;
-
- SecItemRequestData requestData(context->query);
- SecItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecItemCopyMatching(requestData), Messages::WebProcessProxy::SecItemCopyMatching::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
- ASSERT_NOT_REACHED();
- return;
- }
-
- context->resultObject = response.resultObject().leakRef();
- context->resultCode = response.resultCode();
+ AtomicallyInitializedStatic(KeychainShimResponseMap<SecItemResponseData>&, responseMap = *new KeychainShimResponseMap<SecItemResponseData>);
+ return responseMap;
}
-static OSStatus webSecItemCopyMatching(CFDictionaryRef query, CFTypeRef* result)
+static uint64_t generateSecItemRequestID()
{
- SecItemAPIContext context;
- context.query = query;
-
- callOnCoreIPCClientRunLoopAndWait(webSecItemCopyMatchingMainThread, &context);
-
- if (result)
- *result = context.resultObject;
- return context.resultCode;
+ static int64_t uniqueSecItemRequestID;
+ return OSAtomicIncrement64Barrier(&uniqueSecItemRequestID);
}
-static void webSecItemAddOnMainThread(void* voidContext)
+void didReceiveSecItemResponse(uint64_t requestID, const SecItemResponseData& response)
{
- SecItemAPIContext* context = (SecItemAPIContext*)voidContext;
-
- SecItemRequestData requestData(context->query);
- SecItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecItemAdd(requestData), Messages::WebProcessProxy::SecItemAdd::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
- ASSERT_NOT_REACHED();
- return;
- }
-
- context->resultObject = response.resultObject().leakRef();
- context->resultCode = response.resultCode();
+ responseMap().didReceiveResponse(requestID, adoptPtr(new SecItemResponseData(response)));
}
-static OSStatus webSecItemAdd(CFDictionaryRef query, CFTypeRef* result)
+static PassOwnPtr<SecItemResponseData> sendSeqItemRequest(SecItemRequestData::Type requestType, CFDictionaryRef query, CFDictionaryRef attributesToMatch = 0)
{
- SecItemAPIContext context;
- context.query = query;
-
- callOnCoreIPCClientRunLoopAndWait(webSecItemAddOnMainThread, &context);
-
- if (result)
- *result = context.resultObject;
- return context.resultCode;
+ uint64_t requestID = generateSecItemRequestID();
+ if (!WebProcess::shared().connection()->send(Messages::WebProcessProxy::SecItemRequest(requestID, SecItemRequestData(requestType, query, attributesToMatch)), 0))
+ return nullptr;
+
+ return responseMap().waitForResponse(requestID);
}
-static void webSecItemUpdateOnMainThread(void* voidContext)
+static OSStatus webSecItemCopyMatching(CFDictionaryRef query, CFTypeRef* result)
{
- SecItemAPIContext* context = (SecItemAPIContext*)voidContext;
-
- SecItemRequestData requestData(context->query, context->attributesToUpdate);
- SecItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecItemUpdate(requestData), Messages::WebProcessProxy::SecItemUpdate::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
- ASSERT_NOT_REACHED();
- return;
- }
-
- context->resultCode = response.resultCode();
+ OwnPtr<SecItemResponseData> response = sendSeqItemRequest(SecItemRequestData::CopyMatching, query);
+ if (!response)
+ return errSecInteractionNotAllowed;
+
+ *result = response->resultObject().leakRef();
+ return response->resultCode();
}
-static OSStatus webSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
+static OSStatus webSecItemAdd(CFDictionaryRef query, CFTypeRef* result)
{
- SecItemAPIContext context;
- context.query = query;
- context.attributesToUpdate = attributesToUpdate;
-
- callOnCoreIPCClientRunLoopAndWait(webSecItemUpdateOnMainThread, &context);
+ OwnPtr<SecItemResponseData> response = sendSeqItemRequest(SecItemRequestData::Add, query);
+ if (!response)
+ return errSecInteractionNotAllowed;
- return context.resultCode;
+ *result = response->resultObject().leakRef();
+ return response->resultCode();
}
-static void webSecItemDeleteOnMainThread(void* voidContext)
+static OSStatus webSecItemUpdate(CFDictionaryRef query, CFDictionaryRef attributesToUpdate)
{
- SecItemAPIContext* context = (SecItemAPIContext*)voidContext;
+ OwnPtr<SecItemResponseData> response = sendSeqItemRequest(SecItemRequestData::Update, query, attributesToUpdate);
+ if (!response)
+ return errSecInteractionNotAllowed;
- SecItemRequestData requestData(context->query);
- SecItemResponseData response;
- if (!WebProcess::shared().connection()->sendSync(Messages::WebProcessProxy::SecItemDelete(requestData), Messages::WebProcessProxy::SecItemDelete::Reply(response), 0)) {
- context->resultCode = errSecInteractionNotAllowed;
- ASSERT_NOT_REACHED();
- return;
- }
-
- context->resultCode = response.resultCode();
+ return response->resultCode();
}
static OSStatus webSecItemDelete(CFDictionaryRef query)
{
- SecItemAPIContext context;
- context.query = query;
+ OwnPtr<SecItemResponseData> response = sendSeqItemRequest(SecItemRequestData::Delete, query);
+ if (!response)
+ return errSecInteractionNotAllowed;
- callOnCoreIPCClientRunLoopAndWait(webSecItemDeleteOnMainThread, &context);
-
- return context.resultCode;
+ return response->resultCode();
}
void initializeSecItemShim()
diff --git a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
index e96ab4834..7d67e1e68 100644
--- a/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
+++ b/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
@@ -272,4 +272,18 @@ void WebProcess::platformTerminate()
{
}
+void WebProcess::secItemResponse(CoreIPC::Connection*, uint64_t requestID, const SecItemResponseData& response)
+{
+#if !defined(BUILDING_ON_SNOW_LEOPARD)
+ didReceiveSecItemResponse(requestID, response);
+#endif
+}
+
+void WebProcess::secKeychainItemResponse(CoreIPC::Connection*, uint64_t requestID, const SecKeychainItemResponseData& response)
+{
+#if defined(BUILDING_ON_SNOW_LEOPARD)
+ didReceiveSecKeychainItemResponse(requestID, response);
+#endif
+}
+
} // namespace WebKit