summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Monsen <kristianm@google.com>2010-06-28 16:42:48 +0100
committerKristian Monsen <kristianm@google.com>2010-07-02 10:29:56 +0100
commit06ea8e899e48f1f2f396b70e63fae369f2f23232 (patch)
tree20c1428cd05c76f32394ab354ea35ed99acd86d8
parent72aad67af14193199e29cdd5c4ddc095a8b9a8a8 (diff)
downloadexternal_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.zip
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.gz
external_webkit-06ea8e899e48f1f2f396b70e63fae369f2f23232.tar.bz2
Merge WebKit at r61871: Initial merge by git.
Change-Id: I6cff43abca9cc4782e088a469ad4f03f166a65d5
-rw-r--r--JavaScriptCore/API/JSClassRef.h1
-rw-r--r--JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp1
-rw-r--r--JavaScriptCore/CMakeLists.txt16
-rw-r--r--JavaScriptCore/ChangeLog954
-rw-r--r--JavaScriptCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--JavaScriptCore/Configurations/Version.xcconfig2
-rw-r--r--JavaScriptCore/GNUmakefile.am7
-rw-r--r--JavaScriptCore/JavaScriptCore.gypi7
-rw-r--r--JavaScriptCore/JavaScriptCore.pri24
-rw-r--r--JavaScriptCore/JavaScriptCore.pro4
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make2
-rw-r--r--JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj28
-rw-r--r--JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj28
-rw-r--r--JavaScriptCore/assembler/AssemblerBuffer.h3
-rw-r--r--JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h3
-rw-r--r--JavaScriptCore/bytecode/CodeBlock.cpp24
-rw-r--r--JavaScriptCore/bytecode/CodeBlock.h7
-rw-r--r--JavaScriptCore/bytecode/Opcode.h2
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.cpp6
-rw-r--r--JavaScriptCore/bytecompiler/BytecodeGenerator.h8
-rw-r--r--JavaScriptCore/bytecompiler/NodesCodegen.cpp3
-rw-r--r--JavaScriptCore/create_jit_stubs11
-rw-r--r--JavaScriptCore/interpreter/CallFrame.cpp6
-rw-r--r--JavaScriptCore/interpreter/CallFrame.h5
-rw-r--r--JavaScriptCore/interpreter/Interpreter.cpp67
-rw-r--r--JavaScriptCore/jit/ExecutableAllocator.h5
-rw-r--r--JavaScriptCore/jit/JITInlineMethods.h2
-rw-r--r--JavaScriptCore/jit/JITOpcodes.cpp51
-rw-r--r--JavaScriptCore/jit/JITOpcodes32_64.cpp94
-rw-r--r--JavaScriptCore/jit/JITPropertyAccess32_64.cpp34
-rw-r--r--JavaScriptCore/jit/JITStubs.cpp21
-rw-r--r--JavaScriptCore/jsc/CMakeLists.txt3
-rw-r--r--JavaScriptCore/parser/ASTBuilder.h925
-rw-r--r--JavaScriptCore/parser/JSParser.cpp1504
-rw-r--r--JavaScriptCore/parser/JSParser.h125
-rw-r--r--JavaScriptCore/parser/Lexer.cpp37
-rw-r--r--JavaScriptCore/parser/Lexer.h5
-rw-r--r--JavaScriptCore/parser/NodeConstructors.h4
-rw-r--r--JavaScriptCore/parser/Parser.cpp9
-rw-r--r--JavaScriptCore/parser/SyntaxChecker.h158
-rw-r--r--JavaScriptCore/qt/api/qscriptengine_p.cpp2
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue.cpp28
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue.h4
-rw-r--r--JavaScriptCore/qt/api/qscriptvalue_p.h193
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp40
-rw-r--r--JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h1
-rw-r--r--JavaScriptCore/runtime/ArrayPrototype.cpp8
-rw-r--r--JavaScriptCore/runtime/Executable.cpp18
-rw-r--r--JavaScriptCore/runtime/Executable.h12
-rw-r--r--JavaScriptCore/runtime/JSGlobalData.cpp5
-rw-r--r--JavaScriptCore/runtime/JSGlobalData.h7
-rw-r--r--JavaScriptCore/runtime/JSImmediate.h8
-rw-r--r--JavaScriptCore/runtime/JSString.cpp1
-rw-r--r--JavaScriptCore/runtime/JSValue.cpp6
-rw-r--r--JavaScriptCore/runtime/JSZombie.cpp2
-rw-r--r--JavaScriptCore/runtime/RegExpCache.cpp78
-rw-r--r--JavaScriptCore/runtime/RegExpCache.h (renamed from WebCore/bindings/js/JSXSLTProcessorConstructor.h)50
-rw-r--r--JavaScriptCore/runtime/RegExpConstructor.cpp3
-rw-r--r--JavaScriptCore/runtime/RegExpKey.h112
-rw-r--r--JavaScriptCore/runtime/RegExpPrototype.cpp3
-rw-r--r--JavaScriptCore/runtime/StringPrototype.cpp5
-rw-r--r--JavaScriptCore/runtime/SymbolTable.h7
-rw-r--r--JavaScriptCore/wtf/CMakeLists.txt1
-rw-r--r--JavaScriptCore/wtf/FastMalloc.h2
-rw-r--r--JavaScriptCore/wtf/Platform.h19
-rw-r--r--JavaScriptCore/wtf/RetainPtr.h24
-rw-r--r--JavaScriptCore/wtf/StringExtras.h1
-rw-r--r--JavaScriptCore/wtf/ThreadSafeShared.h10
-rw-r--r--JavaScriptCore/wtf/ThreadSpecific.h48
-rw-r--r--JavaScriptCore/wtf/Vector.h2
-rw-r--r--JavaScriptCore/yarr/RegexCompiler.cpp2
-rw-r--r--JavaScriptCore/yarr/RegexJIT.cpp24
-rw-r--r--JavaScriptGlue/Configurations/Version.xcconfig2
-rw-r--r--LayoutTests/fast/js/resources/bom-in-file-retains-correct-offset.js2
-rw-r--r--LayoutTests/fast/js/resources/script-line-number.js26
-rw-r--r--LayoutTests/storage/change-version.html76
-rw-r--r--LayoutTests/storage/domstorage/complex-values-expected.txt36
-rw-r--r--LayoutTests/storage/sql-error-codes-expected.txt11
-rw-r--r--LayoutTests/storage/sql-error-codes.html12
-rw-r--r--LayoutTests/storage/sql-error-codes.js121
-rw-r--r--WebCore/Android.derived.jscbindings.mk2
-rw-r--r--WebCore/Android.derived.v8bindings.mk5
-rw-r--r--WebCore/Android.jscbindings.mk8
-rw-r--r--WebCore/Android.mk40
-rw-r--r--WebCore/CMakeLists.txt64
-rw-r--r--WebCore/CMakeListsEfl.txt2
-rw-r--r--WebCore/ChangeLog8655
-rw-r--r--WebCore/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebCore/Configurations/Version.xcconfig2
-rw-r--r--WebCore/DerivedSources.cpp2
-rw-r--r--WebCore/DerivedSources.make2
-rw-r--r--WebCore/English.lproj/localizedStrings.jsbin40700 -> 41044 bytes
-rw-r--r--WebCore/GNUmakefile.am107
-rw-r--r--WebCore/WebCore.Video.exp1
-rw-r--r--WebCore/WebCore.base.exp23
-rw-r--r--WebCore/WebCore.gyp/WebCore.gyp9
-rw-r--r--WebCore/WebCore.gypi86
-rw-r--r--WebCore/WebCore.pri6
-rw-r--r--WebCore/WebCore.pro217
-rw-r--r--WebCore/WebCore.vcproj/WebCore.make2
-rw-r--r--WebCore/WebCore.vcproj/WebCore.vcproj622
-rw-r--r--WebCore/WebCore.xcodeproj/project.pbxproj567
-rw-r--r--WebCore/accessibility/AXObjectCache.cpp9
-rw-r--r--WebCore/accessibility/AXObjectCache.h8
-rw-r--r--WebCore/accessibility/AccessibilityObject.cpp4
-rw-r--r--WebCore/accessibility/AccessibilityObject.h6
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.cpp104
-rw-r--r--WebCore/accessibility/AccessibilityRenderObject.h13
-rw-r--r--WebCore/accessibility/AccessibilityTableCell.cpp2
-rw-r--r--WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp36
-rw-r--r--WebCore/accessibility/mac/AXObjectCacheMac.mm13
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectMac.mm5
-rw-r--r--WebCore/accessibility/mac/AccessibilityObjectWrapper.mm3
-rw-r--r--WebCore/bindings/cpp/WebDOMDOMWindowCustom.cpp43
-rw-r--r--WebCore/bindings/cpp/WebDOMEventTarget.cpp68
-rw-r--r--WebCore/bindings/cpp/WebDOMEventTarget.h30
-rw-r--r--WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp (renamed from WebCore/platform/graphics/efl/FloatRectEfl.cpp)29
-rw-r--r--WebCore/bindings/cpp/WebDOMHTMLOptionsCollectionCustom.cpp (renamed from WebCore/platform/graphics/efl/IntRectEfl.cpp)29
-rw-r--r--WebCore/bindings/cpp/WebDOMNodeFilterCustom.cpp (renamed from WebCore/bindings/js/JSWebKitPointConstructor.h)32
-rw-r--r--WebCore/bindings/cpp/WebNativeNodeFilterCondition.cpp40
-rw-r--r--WebCore/bindings/cpp/WebNativeNodeFilterCondition.h43
-rw-r--r--WebCore/bindings/generic/RuntimeEnabledFeatures.cpp7
-rw-r--r--WebCore/bindings/js/JSArrayBufferConstructor.h104
-rw-r--r--WebCore/bindings/js/JSArrayBufferCustom.cpp (renamed from WebCore/bindings/js/JSArrayBufferConstructor.cpp)42
-rw-r--r--WebCore/bindings/js/JSArrayBufferViewHelper.h69
-rw-r--r--WebCore/bindings/js/JSBindingsAllInOne.cpp13
-rw-r--r--WebCore/bindings/js/JSDOMBinding.cpp10
-rw-r--r--WebCore/bindings/js/JSDOMWindowCustom.cpp32
-rw-r--r--WebCore/bindings/js/JSEventSourceConstructor.h55
-rw-r--r--WebCore/bindings/js/JSEventSourceCustom.cpp (renamed from WebCore/bindings/js/JSEventSourceConstructor.cpp)26
-rw-r--r--WebCore/bindings/js/JSExceptionBase.cpp136
-rw-r--r--WebCore/bindings/js/JSFloat32ArrayConstructor.cpp86
-rw-r--r--WebCore/bindings/js/JSFloat32ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSFloat32ArrayCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSInt16ArrayConstructor.cpp87
-rw-r--r--WebCore/bindings/js/JSInt16ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSInt16ArrayCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSInt32ArrayConstructor.cpp86
-rw-r--r--WebCore/bindings/js/JSInt32ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSInt32ArrayCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSInt8ArrayConstructor.cpp86
-rw-r--r--WebCore/bindings/js/JSInt8ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSInt8ArrayCustom.cpp11
-rw-r--r--WebCore/bindings/js/JSMessageChannelConstructor.cpp67
-rw-r--r--WebCore/bindings/js/JSMessageChannelCustom.cpp11
-rw-r--r--WebCore/bindings/js/JSSharedWorkerConstructor.cpp89
-rw-r--r--WebCore/bindings/js/JSSharedWorkerCustom.cpp26
-rw-r--r--WebCore/bindings/js/JSUint16ArrayConstructor.cpp86
-rw-r--r--WebCore/bindings/js/JSUint16ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSUint16ArrayCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSUint32ArrayConstructor.cpp86
-rw-r--r--WebCore/bindings/js/JSUint32ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSUint32ArrayCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSUint8ArrayConstructor.cpp87
-rw-r--r--WebCore/bindings/js/JSUint8ArrayConstructor.h57
-rw-r--r--WebCore/bindings/js/JSUint8ArrayCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp (renamed from WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp)20
-rw-r--r--WebCore/bindings/js/JSWebKitPointCustom.cpp (renamed from WebCore/bindings/js/JSWebKitPointConstructor.cpp)30
-rw-r--r--WebCore/bindings/js/JSWebSocketConstructor.cpp93
-rw-r--r--WebCore/bindings/js/JSWebSocketCustom.cpp33
-rw-r--r--WebCore/bindings/js/JSWorkerConstructor.cpp84
-rw-r--r--WebCore/bindings/js/JSWorkerContextCustom.cpp10
-rw-r--r--WebCore/bindings/js/JSWorkerCustom.cpp26
-rw-r--r--WebCore/bindings/js/JSXSLTProcessorConstructor.cpp64
-rw-r--r--WebCore/bindings/js/JSXSLTProcessorCustom.cpp6
-rw-r--r--WebCore/bindings/js/ScriptController.cpp10
-rw-r--r--WebCore/bindings/js/ScriptController.h6
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.cpp31
-rw-r--r--WebCore/bindings/js/ScriptDebugServer.h3
-rw-r--r--WebCore/bindings/js/ScriptProfiler.h1
-rw-r--r--WebCore/bindings/scripts/CodeGenerator.pm81
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorCPP.pm60
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorGObject.pm150
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorJS.pm43
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorObjC.pm76
-rw-r--r--WebCore/bindings/scripts/CodeGeneratorV8.pm58
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp5
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h4
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp260
-rw-r--r--WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h36
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp37
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp3
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp729
-rw-r--r--WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h94
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestInterface.cpp62
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestInterface.h4
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.cpp297
-rw-r--r--WebCore/bindings/scripts/test/JS/JSTestObj.h32
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm5
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.h38
-rw-r--r--WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm178
-rw-r--r--WebCore/bindings/scripts/test/TestInterface.idl1
-rw-r--r--WebCore/bindings/scripts/test/TestObj.idl24
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestCallback.cpp1
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.cpp4
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestInterface.h4
-rw-r--r--WebCore/bindings/scripts/test/V8/V8TestObj.cpp301
-rw-r--r--WebCore/bindings/v8/JavaScriptCallFrame.cpp2
-rw-r--r--WebCore/bindings/v8/NPV8Object.cpp2
-rw-r--r--WebCore/bindings/v8/ScriptController.cpp14
-rw-r--r--WebCore/bindings/v8/ScriptController.h4
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.cpp16
-rw-r--r--WebCore/bindings/v8/ScriptDebugServer.h2
-rw-r--r--WebCore/bindings/v8/ScriptEventListener.cpp14
-rw-r--r--WebCore/bindings/v8/ScriptProfiler.cpp7
-rw-r--r--WebCore/bindings/v8/ScriptProfiler.h1
-rw-r--r--WebCore/bindings/v8/ScriptSourceCode.h5
-rwxr-xr-xWebCore/bindings/v8/ScriptValue.cpp2
-rw-r--r--WebCore/bindings/v8/V8Binding.cpp23
-rw-r--r--WebCore/bindings/v8/V8Binding.h22
-rw-r--r--WebCore/bindings/v8/V8GCController.cpp5
-rw-r--r--WebCore/bindings/v8/V8Proxy.cpp49
-rw-r--r--WebCore/bindings/v8/V8Proxy.h16
-rw-r--r--WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp27
-rw-r--r--WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h39
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp2
-rw-r--r--[-rwxr-xr-x]WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h0
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp2
-rw-r--r--[-rwxr-xr-x]WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h0
-rw-r--r--WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp2
-rw-r--r--[-rwxr-xr-x]WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h0
-rw-r--r--WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp2
-rw-r--r--WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp3
-rw-r--r--WebCore/bindings/v8/custom/V8WebSocketCustom.cpp18
-rw-r--r--WebCore/bindings/v8/npruntime.cpp1
-rw-r--r--WebCore/bridge/npapi.h292
-rw-r--r--WebCore/bridge/qt/qt_runtime.cpp34
-rw-r--r--WebCore/config.h4
-rw-r--r--WebCore/css/CSSComputedStyleDeclaration.cpp8
-rw-r--r--WebCore/css/CSSGrammar.y8
-rw-r--r--WebCore/css/CSSInitialValue.h9
-rw-r--r--WebCore/css/CSSMutableStyleDeclaration.cpp13
-rw-r--r--WebCore/css/CSSParser.cpp25
-rw-r--r--WebCore/css/CSSPrimitiveValue.cpp29
-rw-r--r--WebCore/css/CSSPrimitiveValue.h4
-rw-r--r--WebCore/css/CSSPrimitiveValueMappings.h39
-rw-r--r--WebCore/css/CSSPropertyNames.in2
-rw-r--r--WebCore/css/CSSSelector.cpp99
-rw-r--r--WebCore/css/CSSSelector.h18
-rw-r--r--WebCore/css/CSSStyleSelector.cpp280
-rw-r--r--WebCore/css/CSSStyleSelector.h13
-rw-r--r--WebCore/css/CSSStyleSheet.cpp6
-rw-r--r--WebCore/css/CSSStyleSheet.h2
-rw-r--r--WebCore/css/CSSValueKeywords.in6
-rw-r--r--WebCore/css/SVGCSSParser.cpp5
-rw-r--r--WebCore/css/WebKitCSSMatrix.idl9
-rw-r--r--WebCore/css/html.css53
-rw-r--r--WebCore/css/mathml.css24
-rw-r--r--WebCore/dom/DOMImplementation.cpp40
-rw-r--r--WebCore/dom/DOMImplementation.h3
-rw-r--r--WebCore/dom/Document.cpp75
-rw-r--r--WebCore/dom/Document.h17
-rw-r--r--WebCore/dom/DocumentFragment.cpp24
-rw-r--r--WebCore/dom/DocumentFragment.h6
-rw-r--r--WebCore/dom/DocumentParser.h133
-rw-r--r--WebCore/dom/Element.cpp55
-rw-r--r--WebCore/dom/Element.h12
-rw-r--r--WebCore/dom/ExceptionCode.cpp40
-rw-r--r--WebCore/dom/ExceptionCode.h7
-rw-r--r--WebCore/dom/FragmentScriptingPermission.h (renamed from WebCore/bindings/js/JSWebKitCSSMatrixConstructor.h)28
-rw-r--r--WebCore/dom/InputElement.h3
-rw-r--r--WebCore/dom/MappedAttributeEntry.h2
-rw-r--r--WebCore/dom/MessageChannel.idl10
-rw-r--r--WebCore/dom/Node.cpp15
-rw-r--r--WebCore/dom/Node.h5
-rw-r--r--WebCore/dom/NodeFilter.idl8
-rw-r--r--WebCore/dom/Position.cpp2
-rw-r--r--WebCore/dom/Position.h2
-rw-r--r--WebCore/dom/PositionIterator.cpp2
-rw-r--r--WebCore/dom/RawDataDocumentParser.h75
-rw-r--r--WebCore/dom/ScriptElement.cpp14
-rw-r--r--WebCore/dom/ScriptElement.h4
-rw-r--r--WebCore/dom/SelectElement.cpp9
-rw-r--r--WebCore/dom/StaticHashSetNodeList.cpp66
-rw-r--r--WebCore/dom/StaticHashSetNodeList.h70
-rw-r--r--WebCore/dom/Touch.h6
-rw-r--r--WebCore/dom/TouchList.h6
-rw-r--r--WebCore/dom/XMLDocumentParser.cpp26
-rw-r--r--WebCore/dom/XMLDocumentParser.h46
-rw-r--r--WebCore/dom/XMLDocumentParserLibxml2.cpp78
-rw-r--r--WebCore/dom/XMLDocumentParserQt.cpp60
-rw-r--r--WebCore/dom/XMLDocumentParserScope.h6
-rw-r--r--WebCore/editing/CompositeEditCommand.cpp2
-rw-r--r--WebCore/editing/DeleteButton.cpp2
-rw-r--r--WebCore/editing/Editor.cpp14
-rw-r--r--WebCore/editing/Editor.h2
-rw-r--r--WebCore/editing/EditorCommand.cpp7
-rw-r--r--WebCore/editing/InsertListCommand.cpp4
-rw-r--r--WebCore/editing/ModifySelectionListLevel.cpp16
-rw-r--r--WebCore/editing/ModifySelectionListLevel.h16
-rw-r--r--WebCore/editing/SelectionController.cpp2
-rw-r--r--WebCore/editing/markup.cpp37
-rw-r--r--WebCore/editing/markup.h7
-rw-r--r--WebCore/history/CachedFrame.cpp3
-rw-r--r--WebCore/history/HistoryItem.cpp17
-rw-r--r--WebCore/history/HistoryItem.h5
-rw-r--r--WebCore/history/PageCache.cpp9
-rw-r--r--WebCore/html/AsyncImageResizer.h1
-rw-r--r--WebCore/html/Blob.cpp24
-rw-r--r--WebCore/html/Blob.h9
-rw-r--r--WebCore/html/Blob.idl5
-rw-r--r--WebCore/html/BlobBuilder.cpp90
-rw-r--r--WebCore/html/BlobBuilder.h60
-rw-r--r--WebCore/html/BlobBuilder.idl43
-rw-r--r--WebCore/html/CSSPreloadScanner.cpp160
-rw-r--r--WebCore/html/CSSPreloadScanner.h71
-rw-r--r--WebCore/html/File.idl1
-rw-r--r--WebCore/html/HTML5DocumentParser.cpp310
-rw-r--r--WebCore/html/HTML5DocumentParser.h192
-rw-r--r--WebCore/html/HTML5Lexer.h232
-rw-r--r--WebCore/html/HTML5TreeBuilder.cpp220
-rw-r--r--WebCore/html/HTMLAnchorElement.cpp2
-rw-r--r--WebCore/html/HTMLAnchorElement.idl24
-rw-r--r--WebCore/html/HTMLAppletElement.idl28
-rw-r--r--WebCore/html/HTMLAreaElement.idl16
-rw-r--r--WebCore/html/HTMLAttributeNames.in2
-rw-r--r--WebCore/html/HTMLAudioElement.cpp4
-rw-r--r--WebCore/html/HTMLBRElement.cpp4
-rw-r--r--WebCore/html/HTMLBRElement.idl2
-rw-r--r--WebCore/html/HTMLBaseElement.cpp2
-rw-r--r--WebCore/html/HTMLBaseElement.idl4
-rw-r--r--WebCore/html/HTMLBaseFontElement.cpp2
-rw-r--r--WebCore/html/HTMLBaseFontElement.idl8
-rw-r--r--WebCore/html/HTMLBlockquoteElement.cpp4
-rw-r--r--WebCore/html/HTMLBlockquoteElement.idl2
-rw-r--r--WebCore/html/HTMLBodyElement.cpp4
-rw-r--r--WebCore/html/HTMLBodyElement.idl14
-rw-r--r--WebCore/html/HTMLButtonElement.cpp2
-rw-r--r--WebCore/html/HTMLButtonElement.idl33
-rw-r--r--WebCore/html/HTMLCanvasElement.cpp4
-rw-r--r--WebCore/html/HTMLDListElement.cpp2
-rw-r--r--WebCore/html/HTMLDListElement.idl4
-rw-r--r--WebCore/html/HTMLDataGridCellElement.cpp2
-rw-r--r--WebCore/html/HTMLDataGridColElement.cpp2
-rw-r--r--WebCore/html/HTMLDataGridElement.cpp2
-rw-r--r--WebCore/html/HTMLDataGridRowElement.cpp2
-rw-r--r--WebCore/html/HTMLDataListElement.cpp2
-rw-r--r--WebCore/html/HTMLDirectoryElement.idl4
-rw-r--r--WebCore/html/HTMLDivElement.cpp4
-rw-r--r--WebCore/html/HTMLDivElement.idl4
-rw-r--r--WebCore/html/HTMLDocument.cpp12
-rw-r--r--WebCore/html/HTMLDocument.h6
-rw-r--r--WebCore/html/HTMLDocumentParser.cpp1997
-rw-r--r--WebCore/html/HTMLDocumentParser.h513
-rw-r--r--WebCore/html/HTMLElement.cpp10
-rw-r--r--WebCore/html/HTMLElement.h6
-rw-r--r--WebCore/html/HTMLElement.idl15
-rw-r--r--WebCore/html/HTMLEmbedElement.idl21
-rw-r--r--WebCore/html/HTMLEntityParser.cpp (renamed from WebCore/html/HTML5EntityParser.cpp)4
-rw-r--r--WebCore/html/HTMLEntityParser.h (renamed from WebCore/html/HTML5EntityParser.h)6
-rw-r--r--WebCore/html/HTMLFieldSetElement.cpp2
-rw-r--r--WebCore/html/HTMLFontElement.cpp2
-rw-r--r--WebCore/html/HTMLFontElement.idl8
-rw-r--r--WebCore/html/HTMLFormControlElement.cpp20
-rw-r--r--WebCore/html/HTMLFormControlElement.h27
-rw-r--r--WebCore/html/HTMLFormElement.cpp144
-rw-r--r--WebCore/html/HTMLFormElement.h7
-rw-r--r--WebCore/html/HTMLFormElement.idl25
-rw-r--r--WebCore/html/HTMLFrameElement.idl27
-rw-r--r--WebCore/html/HTMLFrameElementBase.cpp2
-rw-r--r--WebCore/html/HTMLFrameOwnerElement.cpp2
-rw-r--r--WebCore/html/HTMLFrameSetElement.cpp2
-rw-r--r--WebCore/html/HTMLFrameSetElement.idl6
-rw-r--r--WebCore/html/HTMLHRElement.cpp4
-rw-r--r--WebCore/html/HTMLHRElement.idl10
-rw-r--r--WebCore/html/HTMLHeadElement.cpp4
-rw-r--r--WebCore/html/HTMLHeadElement.idl4
-rw-r--r--WebCore/html/HTMLHeadingElement.cpp2
-rw-r--r--WebCore/html/HTMLHeadingElement.idl4
-rw-r--r--WebCore/html/HTMLHtmlElement.cpp4
-rw-r--r--WebCore/html/HTMLHtmlElement.idl6
-rw-r--r--WebCore/html/HTMLIFrameElement.idl28
-rw-r--r--WebCore/html/HTMLImageElement.cpp6
-rw-r--r--WebCore/html/HTMLImageElement.idl28
-rw-r--r--WebCore/html/HTMLInputElement.cpp41
-rw-r--r--WebCore/html/HTMLInputElement.h8
-rw-r--r--WebCore/html/HTMLInputElement.idl95
-rw-r--r--WebCore/html/HTMLInputStream.h125
-rw-r--r--WebCore/html/HTMLIsIndexElement.cpp4
-rw-r--r--WebCore/html/HTMLIsIndexElement.idl4
-rw-r--r--WebCore/html/HTMLKeygenElement.cpp2
-rw-r--r--WebCore/html/HTMLLIElement.cpp4
-rw-r--r--WebCore/html/HTMLLIElement.idl6
-rw-r--r--WebCore/html/HTMLLabelElement.cpp2
-rw-r--r--WebCore/html/HTMLLabelElement.idl6
-rw-r--r--WebCore/html/HTMLLegendElement.cpp2
-rw-r--r--WebCore/html/HTMLLegendElement.idl6
-rw-r--r--WebCore/html/HTMLLinkElement.cpp34
-rw-r--r--WebCore/html/HTMLLinkElement.h12
-rw-r--r--WebCore/html/HTMLLinkElement.idl22
-rw-r--r--WebCore/html/HTMLMapElement.cpp4
-rw-r--r--WebCore/html/HTMLMapElement.idl4
-rw-r--r--WebCore/html/HTMLMarqueeElement.cpp2
-rw-r--r--WebCore/html/HTMLMediaElement.cpp7
-rw-r--r--WebCore/html/HTMLMediaElement.h1
-rw-r--r--WebCore/html/HTMLMediaElement.idl8
-rw-r--r--WebCore/html/HTMLMenuElement.cpp2
-rw-r--r--WebCore/html/HTMLMenuElement.idl4
-rw-r--r--WebCore/html/HTMLMetaElement.cpp2
-rw-r--r--WebCore/html/HTMLMetaElement.idl10
-rw-r--r--WebCore/html/HTMLMeterElement.cpp8
-rw-r--r--WebCore/html/HTMLModElement.cpp2
-rw-r--r--WebCore/html/HTMLModElement.idl6
-rw-r--r--WebCore/html/HTMLNoScriptElement.cpp2
-rw-r--r--WebCore/html/HTMLOListElement.cpp4
-rw-r--r--WebCore/html/HTMLOListElement.idl6
-rw-r--r--WebCore/html/HTMLObjectElement.cpp3
-rw-r--r--WebCore/html/HTMLObjectElement.idl43
-rw-r--r--WebCore/html/HTMLOptGroupElement.cpp2
-rw-r--r--WebCore/html/HTMLOptGroupElement.idl6
-rw-r--r--WebCore/html/HTMLOptionElement.cpp6
-rw-r--r--WebCore/html/HTMLOptionElement.idl21
-rw-r--r--WebCore/html/HTMLParagraphElement.cpp2
-rw-r--r--WebCore/html/HTMLParagraphElement.idl4
-rw-r--r--WebCore/html/HTMLParamElement.cpp2
-rw-r--r--WebCore/html/HTMLParamElement.idl10
-rw-r--r--WebCore/html/HTMLParserScheduler.cpp95
-rw-r--r--WebCore/html/HTMLParserScheduler.h84
-rw-r--r--WebCore/html/HTMLPreElement.cpp2
-rw-r--r--WebCore/html/HTMLPreElement.idl6
-rw-r--r--WebCore/html/HTMLPreloadScanner.cpp180
-rw-r--r--WebCore/html/HTMLPreloadScanner.h (renamed from WebCore/bindings/js/JSMessageChannelConstructor.h)47
-rw-r--r--WebCore/html/HTMLProgressElement.cpp4
-rw-r--r--WebCore/html/HTMLQuoteElement.cpp2
-rw-r--r--WebCore/html/HTMLQuoteElement.idl4
-rw-r--r--WebCore/html/HTMLScriptElement.cpp26
-rw-r--r--WebCore/html/HTMLScriptElement.h5
-rw-r--r--WebCore/html/HTMLScriptElement.idl15
-rw-r--r--WebCore/html/HTMLScriptRunner.cpp (renamed from WebCore/html/HTML5ScriptRunner.cpp)155
-rw-r--r--WebCore/html/HTMLScriptRunner.h (renamed from WebCore/html/HTML5ScriptRunner.h)40
-rw-r--r--WebCore/html/HTMLScriptRunnerHost.h (renamed from WebCore/html/HTML5ScriptRunnerHost.h)15
-rw-r--r--WebCore/html/HTMLSelectElement.cpp4
-rw-r--r--WebCore/html/HTMLSourceElement.cpp2
-rw-r--r--WebCore/html/HTMLStyleElement.cpp2
-rw-r--r--WebCore/html/HTMLStyleElement.idl8
-rw-r--r--WebCore/html/HTMLTableCaptionElement.cpp2
-rw-r--r--WebCore/html/HTMLTableCaptionElement.idl6
-rw-r--r--WebCore/html/HTMLTableCellElement.cpp7
-rw-r--r--WebCore/html/HTMLTableCellElement.idl34
-rw-r--r--WebCore/html/HTMLTableColElement.cpp2
-rw-r--r--WebCore/html/HTMLTableColElement.idl16
-rw-r--r--WebCore/html/HTMLTableElement.cpp4
-rw-r--r--WebCore/html/HTMLTableElement.idl50
-rw-r--r--WebCore/html/HTMLTableRowElement.cpp4
-rw-r--r--WebCore/html/HTMLTableRowElement.idl27
-rw-r--r--WebCore/html/HTMLTableSectionElement.cpp2
-rw-r--r--WebCore/html/HTMLTableSectionElement.idl21
-rw-r--r--WebCore/html/HTMLTextAreaElement.cpp2
-rw-r--r--WebCore/html/HTMLTextAreaElement.idl55
-rw-r--r--WebCore/html/HTMLTitleElement.cpp2
-rw-r--r--WebCore/html/HTMLToken.h (renamed from WebCore/html/HTML5Token.h)148
-rw-r--r--WebCore/html/HTMLTokenizer.cpp (renamed from WebCore/html/HTML5Lexer.cpp)83
-rw-r--r--WebCore/html/HTMLTokenizer.h233
-rw-r--r--WebCore/html/HTMLTreeBuilder.cpp593
-rw-r--r--WebCore/html/HTMLTreeBuilder.h (renamed from WebCore/html/HTML5TreeBuilder.h)102
-rw-r--r--WebCore/html/HTMLUListElement.cpp4
-rw-r--r--WebCore/html/HTMLUListElement.idl4
-rw-r--r--WebCore/html/HTMLVideoElement.cpp8
-rw-r--r--WebCore/html/HTMLVideoElement.idl15
-rw-r--r--WebCore/html/HTMLViewSourceDocument.cpp12
-rw-r--r--WebCore/html/HTMLViewSourceDocument.h10
-rw-r--r--WebCore/html/LegacyHTMLDocumentParser.cpp2106
-rw-r--r--WebCore/html/LegacyHTMLDocumentParser.h452
-rw-r--r--WebCore/html/LegacyHTMLTreeBuilder.cpp (renamed from WebCore/html/LegacyHTMLTreeConstructor.cpp)183
-rw-r--r--WebCore/html/LegacyHTMLTreeBuilder.h (renamed from WebCore/html/LegacyHTMLTreeConstructor.h)18
-rw-r--r--WebCore/html/LegacyPreloadScanner.cpp (renamed from WebCore/html/PreloadScanner.cpp)36
-rw-r--r--WebCore/html/LegacyPreloadScanner.h (renamed from WebCore/html/PreloadScanner.h)10
-rw-r--r--WebCore/html/StepRange.cpp2
-rw-r--r--WebCore/html/ValidityState.cpp2
-rw-r--r--WebCore/html/canvas/ArrayBuffer.idl11
-rw-r--r--WebCore/html/canvas/CanvasRenderingContext2D.cpp2
-rw-r--r--WebCore/html/canvas/Float32Array.idl6
-rw-r--r--WebCore/html/canvas/Int16Array.idl6
-rw-r--r--WebCore/html/canvas/Int32Array.idl6
-rw-r--r--WebCore/html/canvas/Int8Array.idl6
-rw-r--r--WebCore/html/canvas/TypedArrayBase.h7
-rw-r--r--WebCore/html/canvas/Uint16Array.idl6
-rw-r--r--WebCore/html/canvas/Uint32Array.idl6
-rw-r--r--WebCore/html/canvas/Uint8Array.idl6
-rw-r--r--WebCore/html/canvas/WebGLBuffer.cpp13
-rw-r--r--WebCore/html/canvas/WebGLBuffer.h7
-rw-r--r--WebCore/html/canvas/WebGLFramebuffer.cpp4
-rw-r--r--WebCore/html/canvas/WebGLRenderbuffer.cpp2
-rw-r--r--WebCore/html/canvas/WebGLRenderbuffer.h6
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.cpp251
-rw-r--r--WebCore/html/canvas/WebGLRenderingContext.h11
-rw-r--r--WebCore/html/canvas/WebGLTexture.cpp2
-rw-r--r--WebCore/html/canvas/WebGLTexture.h6
-rw-r--r--WebCore/inspector/InjectedScriptHost.cpp8
-rw-r--r--WebCore/inspector/InjectedScriptHost.h3
-rw-r--r--WebCore/inspector/InjectedScriptHost.idl3
-rw-r--r--WebCore/inspector/InspectorBackend.cpp57
-rw-r--r--WebCore/inspector/InspectorBackend.h13
-rw-r--r--WebCore/inspector/InspectorBackend.idl13
-rw-r--r--WebCore/inspector/InspectorCSSStore.cpp4
-rw-r--r--WebCore/inspector/InspectorClient.h8
-rw-r--r--WebCore/inspector/InspectorController.cpp189
-rw-r--r--WebCore/inspector/InspectorController.h20
-rw-r--r--WebCore/inspector/InspectorDOMAgent.cpp162
-rw-r--r--WebCore/inspector/InspectorDOMAgent.h10
-rw-r--r--WebCore/inspector/InspectorFrontend.cpp51
-rw-r--r--WebCore/inspector/InspectorFrontend.h8
-rw-r--r--WebCore/inspector/InspectorFrontendClientLocal.cpp2
-rw-r--r--WebCore/inspector/InspectorValues.cpp6
-rw-r--r--WebCore/inspector/InspectorValues.h2
-rw-r--r--WebCore/inspector/ScriptBreakpoint.cpp74
-rw-r--r--WebCore/inspector/ScriptBreakpoint.h10
-rw-r--r--WebCore/inspector/front-end/BreakpointManager.js35
-rw-r--r--WebCore/inspector/front-end/CSSCompletions.js102
-rw-r--r--WebCore/inspector/front-end/ConsoleView.js12
-rw-r--r--WebCore/inspector/front-end/DOMAgent.js3
-rw-r--r--WebCore/inspector/front-end/ElementsPanel.js9
-rw-r--r--WebCore/inspector/front-end/ElementsTreeOutline.js10
-rw-r--r--WebCore/inspector/front-end/InjectedScript.js395
-rw-r--r--WebCore/inspector/front-end/InjectedScriptAccess.js5
-rw-r--r--WebCore/inspector/front-end/InspectorBackendStub.js23
-rw-r--r--WebCore/inspector/front-end/InspectorFrontendHostStub.js8
-rw-r--r--WebCore/inspector/front-end/ProfilesPanel.js18
-rw-r--r--WebCore/inspector/front-end/ScriptView.js7
-rw-r--r--WebCore/inspector/front-end/ScriptsPanel.js2
-rw-r--r--WebCore/inspector/front-end/Section.js17
-rw-r--r--WebCore/inspector/front-end/StoragePanel.js37
-rw-r--r--WebCore/inspector/front-end/StylesSidebarPane.js77
-rw-r--r--WebCore/inspector/front-end/WebKit.qrc1
-rw-r--r--WebCore/inspector/front-end/inspector.css8
-rw-r--r--WebCore/inspector/front-end/inspector.html1
-rw-r--r--WebCore/inspector/front-end/inspector.js18
-rw-r--r--WebCore/inspector/front-end/utilities.js63
-rw-r--r--WebCore/loader/CachedFont.cpp2
-rw-r--r--WebCore/loader/CrossOriginPreflightResultCache.h4
-rw-r--r--WebCore/loader/DocumentWriter.cpp51
-rw-r--r--WebCore/loader/DocumentWriter.h5
-rw-r--r--WebCore/loader/FTPDirectoryDocument.cpp55
-rw-r--r--WebCore/loader/FTPDirectoryDocument.h6
-rw-r--r--WebCore/loader/FormSubmission.cpp88
-rw-r--r--WebCore/loader/FormSubmission.h88
-rw-r--r--WebCore/loader/FrameLoader.cpp488
-rw-r--r--WebCore/loader/FrameLoader.h59
-rw-r--r--WebCore/loader/FrameLoaderStateMachine.cpp73
-rw-r--r--WebCore/loader/FrameLoaderStateMachine.h67
-rw-r--r--WebCore/loader/HistoryController.cpp80
-rw-r--r--WebCore/loader/HistoryController.h5
-rw-r--r--WebCore/loader/ImageDocument.cpp84
-rw-r--r--WebCore/loader/ImageDocument.h6
-rw-r--r--WebCore/loader/MainResourceLoader.cpp2
-rw-r--r--WebCore/loader/MediaDocument.cpp61
-rw-r--r--WebCore/loader/MediaDocument.h6
-rw-r--r--WebCore/loader/PlaceholderDocument.h6
-rw-r--r--WebCore/loader/PluginDocument.cpp70
-rw-r--r--WebCore/loader/PluginDocument.h6
-rw-r--r--WebCore/loader/ProgressTracker.cpp3
-rw-r--r--WebCore/loader/RedirectScheduler.cpp35
-rw-r--r--WebCore/loader/RedirectScheduler.h3
-rw-r--r--WebCore/loader/ResourceLoader.cpp9
-rw-r--r--WebCore/loader/SinkDocument.cpp33
-rw-r--r--WebCore/loader/SinkDocument.h6
-rw-r--r--WebCore/loader/SubframeLoader.cpp352
-rw-r--r--WebCore/loader/SubframeLoader.h92
-rw-r--r--WebCore/loader/SubresourceLoader.cpp2
-rw-r--r--WebCore/loader/TextDocument.cpp40
-rw-r--r--WebCore/loader/TextDocument.h6
-rw-r--r--WebCore/loader/appcache/ApplicationCache.cpp2
-rw-r--r--WebCore/loader/archive/cf/LegacyWebArchive.cpp2
-rw-r--r--WebCore/loader/archive/cf/LegacyWebArchiveMac.mm2
-rw-r--r--WebCore/manual-tests/load-deferrer-script-element.html44
-rw-r--r--WebCore/manual-tests/localstorage-empty-database.html5
-rw-r--r--WebCore/manual-tests/no-listbox-rendering.html34
-rw-r--r--WebCore/manual-tests/resources/load-deferrer-script-element.js5
-rw-r--r--WebCore/manual-tests/xhr-failure-behind-alert.html10
-rw-r--r--WebCore/mathml/MathMLElement.cpp11
-rw-r--r--WebCore/mathml/MathMLElement.h13
-rw-r--r--WebCore/mathml/MathMLInlineContainerElement.cpp14
-rw-r--r--WebCore/mathml/MathMLInlineContainerElement.h5
-rw-r--r--WebCore/mathml/MathMLMathElement.cpp17
-rw-r--r--WebCore/mathml/MathMLMathElement.h10
-rw-r--r--WebCore/mathml/MathMLTextElement.cpp9
-rw-r--r--WebCore/mathml/MathMLTextElement.h8
-rw-r--r--WebCore/mathml/RenderMathMLBlock.cpp6
-rw-r--r--WebCore/mathml/RenderMathMLFraction.cpp24
-rw-r--r--WebCore/mathml/RenderMathMLFraction.h1
-rw-r--r--WebCore/mathml/RenderMathMLOperator.cpp36
-rw-r--r--WebCore/mathml/RenderMathMLOperator.h1
-rw-r--r--WebCore/mathml/RenderMathMLRoot.cpp14
-rw-r--r--WebCore/mathml/RenderMathMLRow.cpp21
-rw-r--r--WebCore/mathml/RenderMathMLRow.h1
-rw-r--r--WebCore/mathml/RenderMathMLSquareRoot.cpp5
-rw-r--r--WebCore/mathml/RenderMathMLSubSup.cpp42
-rw-r--r--WebCore/mathml/RenderMathMLUnderOver.cpp10
-rw-r--r--WebCore/notifications/Notification.cpp8
-rw-r--r--WebCore/notifications/Notification.h6
-rw-r--r--WebCore/notifications/NotificationCenter.h3
-rw-r--r--WebCore/page/DOMWindow.cpp74
-rw-r--r--WebCore/page/DOMWindow.h13
-rw-r--r--WebCore/page/DOMWindow.idl8
-rw-r--r--WebCore/page/EditorClient.h7
-rw-r--r--WebCore/page/EventHandler.cpp3
-rw-r--r--WebCore/page/EventSource.idl9
-rw-r--r--WebCore/page/FocusController.cpp189
-rw-r--r--WebCore/page/Frame.cpp36
-rw-r--r--WebCore/page/Frame.h38
-rw-r--r--WebCore/page/FrameView.cpp115
-rw-r--r--WebCore/page/FrameView.h19
-rw-r--r--WebCore/page/OriginAccessEntry.h6
-rw-r--r--WebCore/page/Page.cpp4
-rw-r--r--WebCore/page/PageGroupLoadDeferrer.cpp8
-rw-r--r--WebCore/page/PrintContext.cpp36
-rw-r--r--WebCore/page/PrintContext.h5
-rw-r--r--WebCore/page/Settings.cpp2
-rw-r--r--WebCore/page/SpatialNavigation.cpp25
-rw-r--r--WebCore/page/SpatialNavigation.h7
-rw-r--r--WebCore/page/WebKitPoint.idl9
-rw-r--r--WebCore/page/XSSAuditor.cpp4
-rw-r--r--WebCore/page/XSSAuditor.h6
-rw-r--r--WebCore/page/animation/AnimationBase.cpp19
-rw-r--r--WebCore/page/animation/AnimationBase.h2
-rw-r--r--WebCore/page/brew/ChromeClientBrew.h (renamed from WebCore/bindings/js/JSSharedWorkerConstructor.h)35
-rw-r--r--WebCore/page/mac/WebCoreViewFactory.h13
-rw-r--r--WebCore/page/win/FrameWin.h4
-rw-r--r--WebCore/platform/BlobItem.cpp19
-rw-r--r--WebCore/platform/BlobItem.h1
-rw-r--r--WebCore/platform/FileSystem.h9
-rw-r--r--WebCore/platform/LengthBox.h8
-rw-r--r--WebCore/platform/MIMETypeRegistry.cpp67
-rw-r--r--WebCore/platform/MIMETypeRegistry.h5
-rw-r--r--WebCore/platform/Pasteboard.h6
-rw-r--r--WebCore/platform/PlatformKeyboardEvent.h3
-rw-r--r--WebCore/platform/PlatformMouseEvent.h6
-rw-r--r--WebCore/platform/PlatformStrategies.cpp57
-rw-r--r--WebCore/platform/PlatformStrategies.h65
-rw-r--r--WebCore/platform/PlatformWheelEvent.h2
-rw-r--r--WebCore/platform/PopupMenu.h2
-rw-r--r--WebCore/platform/ScrollView.cpp9
-rw-r--r--WebCore/platform/ScrollView.h3
-rw-r--r--WebCore/platform/ThemeTypes.h2
-rw-r--r--WebCore/platform/ThreadTimers.h4
-rw-r--r--WebCore/platform/Widget.h5
-rw-r--r--WebCore/platform/brew/DragDataBrew.cpp5
-rw-r--r--WebCore/platform/brew/FileSystemBrew.cpp259
-rw-r--r--WebCore/platform/brew/PopupMenuBrew.cpp74
-rw-r--r--WebCore/platform/chromium/ChromiumBridge.h13
-rw-r--r--WebCore/platform/chromium/ChromiumDataObject.cpp3
-rw-r--r--WebCore/platform/chromium/ClipboardChromium.cpp3
-rw-r--r--WebCore/platform/chromium/KeyboardCodes.h4
-rw-r--r--WebCore/platform/chromium/PasteboardChromium.cpp2
-rw-r--r--WebCore/platform/chromium/ThemeChromiumMac.mm3
-rw-r--r--WebCore/platform/efl/FileChooserEfl.cpp10
-rw-r--r--WebCore/platform/efl/PlatformKeyboardEventEfl.cpp1
-rw-r--r--WebCore/platform/efl/PlatformMouseEventEfl.cpp2
-rw-r--r--WebCore/platform/efl/PlatformWheelEventEfl.cpp2
-rw-r--r--WebCore/platform/efl/RenderThemeEfl.cpp1
-rw-r--r--WebCore/platform/efl/RenderThemeEfl.h5
-rw-r--r--WebCore/platform/efl/ScrollbarEfl.cpp1
-rw-r--r--WebCore/platform/efl/ScrollbarEfl.h1
-rw-r--r--WebCore/platform/efl/WidgetEfl.cpp1
-rw-r--r--WebCore/platform/graphics/BitmapImage.h2
-rw-r--r--WebCore/platform/graphics/FloatRect.h9
-rw-r--r--WebCore/platform/graphics/Font.cpp4
-rw-r--r--WebCore/platform/graphics/Font.h17
-rw-r--r--WebCore/platform/graphics/FontCache.h1
-rw-r--r--WebCore/platform/graphics/FontFastPath.cpp13
-rw-r--r--WebCore/platform/graphics/GraphicsContext.cpp4
-rw-r--r--WebCore/platform/graphics/GraphicsContext.h13
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.cpp593
-rw-r--r--WebCore/platform/graphics/GraphicsContext3D.h151
-rw-r--r--WebCore/platform/graphics/GraphicsContextPrivate.h2
-rw-r--r--WebCore/platform/graphics/GraphicsLayer.h8
-rw-r--r--WebCore/platform/graphics/Icon.h2
-rw-r--r--WebCore/platform/graphics/IntRect.h5
-rw-r--r--WebCore/platform/graphics/TextRun.h7
-rw-r--r--WebCore/platform/graphics/WidthIterator.cpp19
-rw-r--r--WebCore/platform/graphics/cairo/FontCacheCairo.cpp6
-rw-r--r--WebCore/platform/graphics/cairo/FontCairo.cpp2
-rw-r--r--WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp10
-rw-r--r--WebCore/platform/graphics/cairo/ImageCairo.cpp2
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp55
-rw-r--r--WebCore/platform/graphics/cg/GraphicsContextCG.cpp2
-rw-r--r--WebCore/platform/graphics/chromium/FontChromiumWin.cpp16
-rw-r--r--WebCore/platform/graphics/chromium/FontLinux.cpp71
-rw-r--r--WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h6
-rw-r--r--WebCore/platform/graphics/chromium/FontUtilsChromiumWin.h6
-rw-r--r--WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp49
-rw-r--r--WebCore/platform/graphics/chromium/GraphicsLayerChromium.h5
-rw-r--r--WebCore/platform/graphics/chromium/ImageLayerChromium.cpp93
-rw-r--r--WebCore/platform/graphics/chromium/ImageLayerChromium.h57
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.cpp161
-rw-r--r--WebCore/platform/graphics/chromium/LayerChromium.h62
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.cpp190
-rw-r--r--WebCore/platform/graphics/chromium/LayerRendererChromium.h37
-rw-r--r--WebCore/platform/graphics/chromium/TransformLayerChromium.cpp50
-rw-r--r--WebCore/platform/graphics/chromium/TransformLayerChromium.h55
-rw-r--r--WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp65
-rw-r--r--WebCore/platform/graphics/chromium/WebGLLayerChromium.h69
-rw-r--r--WebCore/platform/graphics/efl/FontEfl.cpp4
-rw-r--r--WebCore/platform/graphics/filters/FEBlend.h6
-rw-r--r--WebCore/platform/graphics/filters/FEColorMatrix.h6
-rw-r--r--WebCore/platform/graphics/filters/FEComponentTransfer.h6
-rw-r--r--WebCore/platform/graphics/filters/FEComposite.h6
-rw-r--r--WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp67
-rw-r--r--WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h3
-rw-r--r--WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h4
-rw-r--r--WebCore/platform/graphics/gtk/FontGtk.cpp10
-rw-r--r--WebCore/platform/graphics/haiku/FontHaiku.cpp4
-rw-r--r--WebCore/platform/graphics/haiku/FontPlatformData.h4
-rw-r--r--WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp2
-rw-r--r--WebCore/platform/graphics/mac/ComplexTextController.cpp24
-rw-r--r--WebCore/platform/graphics/mac/ComplexTextController.h2
-rw-r--r--WebCore/platform/graphics/mac/FontComplexTextMac.cpp4
-rw-r--r--WebCore/platform/graphics/mac/FontMac.mm2
-rw-r--r--WebCore/platform/graphics/mac/FontPlatformData.h3
-rw-r--r--WebCore/platform/graphics/mac/FontPlatformDataMac.mm3
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm (renamed from WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp)12
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.h22
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.mm72
-rw-r--r--WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm28
-rw-r--r--WebCore/platform/graphics/mac/SimpleFontDataMac.mm3
-rw-r--r--WebCore/platform/graphics/mac/WebGLLayer.h (renamed from WebCore/platform/graphics/mac/Canvas3DLayer.h)14
-rw-r--r--WebCore/platform/graphics/mac/WebGLLayer.mm (renamed from WebCore/platform/graphics/mac/Canvas3DLayer.mm)20
-rw-r--r--WebCore/platform/graphics/mac/WebLayer.mm1
-rw-r--r--WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp2
-rw-r--r--WebCore/platform/graphics/qt/FontCustomPlatformData.h6
-rw-r--r--WebCore/platform/graphics/qt/FontQt.cpp14
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp55
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp94
-rw-r--r--WebCore/platform/graphics/qt/ImageDecoderQt.cpp24
-rw-r--r--WebCore/platform/graphics/qt/ImageQt.cpp16
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp21
-rw-r--r--WebCore/platform/graphics/skia/GraphicsContextSkia.cpp2
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.cpp2
-rw-r--r--WebCore/platform/graphics/skia/SkiaFontWin.h6
-rw-r--r--WebCore/platform/graphics/win/FontCGWin.cpp4
-rw-r--r--WebCore/platform/graphics/win/FontWin.cpp8
-rw-r--r--WebCore/platform/graphics/win/GraphicsLayerCACF.h6
-rw-r--r--WebCore/platform/graphics/win/QTMovieWinTimer.h4
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/win/RefCountedGDIHandle.h0
-rw-r--r--WebCore/platform/graphics/win/UniscribeController.cpp47
-rw-r--r--WebCore/platform/graphics/win/UniscribeController.h37
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/win/WebLayer.h0
-rw-r--r--[-rwxr-xr-x]WebCore/platform/graphics/win/WebTiledLayer.h0
-rw-r--r--WebCore/platform/graphics/wince/FontCacheWince.cpp2
-rw-r--r--WebCore/platform/graphics/wince/FontPlatformData.h4
-rw-r--r--WebCore/platform/graphics/wince/FontWince.cpp8
-rw-r--r--WebCore/platform/graphics/wince/GraphicsContextWince.cpp6
-rw-r--r--WebCore/platform/graphics/wince/MediaPlayerProxy.cpp2
-rw-r--r--WebCore/platform/graphics/wx/FontPlatformData.h4
-rw-r--r--WebCore/platform/graphics/wx/FontWx.cpp4
-rw-r--r--WebCore/platform/graphics/wx/GraphicsContextWx.cpp2
-rw-r--r--WebCore/platform/gtk/ClipboardGtk.cpp20
-rw-r--r--WebCore/platform/gtk/DataObjectGtk.cpp25
-rw-r--r--WebCore/platform/gtk/DataObjectGtk.h1
-rw-r--r--WebCore/platform/gtk/GtkVersioning.h22
-rw-r--r--WebCore/platform/gtk/PasteboardGtk.cpp9
-rw-r--r--WebCore/platform/gtk/PasteboardHelper.cpp7
-rw-r--r--WebCore/platform/gtk/PlatformScreenGtk.cpp4
-rw-r--r--WebCore/platform/gtk/PopupMenuGtk.cpp8
-rw-r--r--WebCore/platform/gtk/RenderThemeGtk.cpp102
-rw-r--r--WebCore/platform/gtk/ScrollbarGtk.cpp20
-rw-r--r--WebCore/platform/haiku/PasteboardHaiku.cpp2
-rw-r--r--WebCore/platform/image-decoders/ImageDecoder.h12
-rw-r--r--WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp10
-rw-r--r--WebCore/platform/image-decoders/bmp/BMPImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/bmp/BMPImageReader.cpp73
-rw-r--r--WebCore/platform/image-decoders/bmp/BMPImageReader.h24
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp9
-rw-r--r--WebCore/platform/image-decoders/gif/GIFImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp19
-rw-r--r--WebCore/platform/image-decoders/ico/ICOImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp17
-rw-r--r--WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h4
-rw-r--r--WebCore/platform/image-decoders/png/PNGImageDecoder.cpp33
-rw-r--r--WebCore/platform/image-decoders/png/PNGImageDecoder.h5
-rw-r--r--WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp31
-rw-r--r--WebCore/platform/mac/EventLoopMac.mm5
-rw-r--r--WebCore/platform/mac/KeyEventMac.mm16
-rw-r--r--WebCore/platform/mac/PasteboardHelper.h6
-rw-r--r--WebCore/platform/mac/PasteboardMac.mm4
-rw-r--r--WebCore/platform/mac/ThemeMac.mm90
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.h45
-rw-r--r--WebCore/platform/mac/WebCoreSystemInterface.mm4
-rw-r--r--WebCore/platform/network/CredentialStorage.cpp2
-rw-r--r--WebCore/platform/network/CredentialStorage.h6
-rw-r--r--WebCore/platform/network/FormData.cpp15
-rw-r--r--WebCore/platform/network/FormDataBuilder.cpp7
-rw-r--r--WebCore/platform/network/FormDataBuilder.h8
-rw-r--r--WebCore/platform/network/ResourceHandle.cpp28
-rw-r--r--WebCore/platform/network/ResourceHandle.h3
-rw-r--r--WebCore/platform/network/ResourceHandleInternal.h3
-rw-r--r--WebCore/platform/network/android/ResourceHandleAndroid.cpp4
-rw-r--r--WebCore/platform/network/brew/SocketStreamError.h (renamed from WebCore/bindings/js/JSWebSocketConstructor.h)26
-rw-r--r--WebCore/platform/network/brew/SocketStreamHandle.h72
-rw-r--r--WebCore/platform/network/brew/SocketStreamHandleBrew.cpp230
-rw-r--r--WebCore/platform/network/brew/SocketStreamHandlePrivate.h70
-rw-r--r--WebCore/platform/network/cf/AuthenticationCF.h3
-rw-r--r--WebCore/platform/network/cf/DNSCFNet.cpp35
-rw-r--r--WebCore/platform/network/cf/FormDataStreamCFNet.h6
-rw-r--r--WebCore/platform/network/cf/ResourceHandleCFNet.cpp2
-rw-r--r--WebCore/platform/network/chromium/ResourceResponse.h17
-rw-r--r--WebCore/platform/network/curl/FormDataStreamCurl.h4
-rw-r--r--WebCore/platform/network/curl/ResourceHandleCurl.cpp18
-rw-r--r--WebCore/platform/network/mac/ResourceHandleMac.mm5
-rw-r--r--WebCore/platform/network/qt/DnsPrefetchHelper.h6
-rw-r--r--WebCore/platform/network/qt/QNetworkReplyHandler.h6
-rw-r--r--WebCore/platform/network/qt/ResourceHandleQt.cpp4
-rw-r--r--WebCore/platform/network/soup/ResourceHandleSoup.cpp3
-rw-r--r--WebCore/platform/network/win/NetworkStateNotifierWin.cpp4
-rw-r--r--WebCore/platform/network/win/ResourceHandleWin.cpp49
-rw-r--r--WebCore/platform/qt/ClipboardQt.cpp2
-rw-r--r--WebCore/platform/qt/PasteboardQt.cpp2
-rw-r--r--WebCore/platform/qt/QWebPageClient.h6
-rw-r--r--WebCore/platform/sql/SQLiteStatement.cpp4
-rw-r--r--WebCore/platform/text/BidiContext.cpp33
-rw-r--r--WebCore/platform/text/BidiContext.h4
-rw-r--r--WebCore/platform/text/CharacterNames.h1
-rw-r--r--WebCore/platform/text/Hyphenation.cpp39
-rw-r--r--WebCore/platform/text/Hyphenation.h37
-rw-r--r--WebCore/platform/text/cf/HyphenationCF.cpp54
-rw-r--r--WebCore/platform/text/mac/HyphenationMac.mm49
-rw-r--r--WebCore/platform/text/wince/TextCodecWinCE.cpp483
-rw-r--r--WebCore/platform/text/wince/TextCodecWinCE.h (renamed from WebCore/bindings/js/JSWorkerConstructor.h)52
-rw-r--r--WebCore/platform/win/PlatformScrollBar.h6
-rw-r--r--WebCore/plugins/MimeType.cpp17
-rw-r--r--WebCore/plugins/MimeType.h2
-rw-r--r--WebCore/plugins/Plugin.cpp2
-rw-r--r--WebCore/plugins/PluginData.cpp25
-rw-r--r--WebCore/plugins/PluginData.h10
-rw-r--r--WebCore/plugins/PluginDatabase.h4
-rw-r--r--WebCore/plugins/PluginPackage.h4
-rw-r--r--WebCore/plugins/PluginStrategy.h48
-rw-r--r--WebCore/plugins/PluginStream.h4
-rw-r--r--WebCore/plugins/PluginViewNone.cpp23
-rw-r--r--WebCore/plugins/chromium/PluginDataChromium.cpp3
-rw-r--r--WebCore/plugins/gtk/PluginDataGtk.cpp11
-rw-r--r--WebCore/plugins/gtk/PluginViewGtk.cpp33
-rw-r--r--WebCore/plugins/gtk/gtk2xtbin.c15
-rw-r--r--WebCore/plugins/mac/PluginDataMac.mm78
-rw-r--r--WebCore/plugins/qt/PluginContainerQt.h6
-rw-r--r--WebCore/plugins/qt/PluginDataQt.cpp15
-rw-r--r--WebCore/plugins/qt/PluginPackageQt.cpp23
-rw-r--r--WebCore/plugins/qt/PluginViewQt.cpp8
-rw-r--r--WebCore/plugins/symbian/npinterface.h6
-rw-r--r--WebCore/plugins/win/PluginDataWin.cpp11
-rw-r--r--WebCore/plugins/wx/PluginDataWx.cpp11
-rw-r--r--WebCore/rendering/BidiRun.h2
-rw-r--r--WebCore/rendering/InlineBox.h28
-rw-r--r--WebCore/rendering/InlineFlowBox.h2
-rw-r--r--WebCore/rendering/InlineTextBox.cpp46
-rw-r--r--WebCore/rendering/InlineTextBox.h11
-rw-r--r--WebCore/rendering/MediaControlElements.cpp30
-rw-r--r--WebCore/rendering/RenderApplet.cpp2
-rw-r--r--WebCore/rendering/RenderBlock.h18
-rw-r--r--WebCore/rendering/RenderBlockLineLayout.cpp112
-rw-r--r--WebCore/rendering/RenderBoxModelObject.cpp178
-rw-r--r--WebCore/rendering/RenderBoxModelObject.h3
-rw-r--r--WebCore/rendering/RenderEmbeddedObject.cpp17
-rw-r--r--WebCore/rendering/RenderFileUploadControl.cpp1
-rw-r--r--WebCore/rendering/RenderImage.cpp131
-rw-r--r--WebCore/rendering/RenderIndicator.cpp81
-rw-r--r--WebCore/rendering/RenderIndicator.h53
-rw-r--r--WebCore/rendering/RenderLayer.cpp8
-rw-r--r--WebCore/rendering/RenderLayer.h1
-rw-r--r--WebCore/rendering/RenderLayerBacking.cpp25
-rw-r--r--WebCore/rendering/RenderLayerCompositor.cpp5
-rw-r--r--WebCore/rendering/RenderMenuList.cpp2
-rw-r--r--WebCore/rendering/RenderMeter.cpp131
-rw-r--r--WebCore/rendering/RenderMeter.h22
-rw-r--r--WebCore/rendering/RenderObject.cpp10
-rw-r--r--WebCore/rendering/RenderObject.h1
-rw-r--r--WebCore/rendering/RenderProgress.cpp128
-rw-r--r--WebCore/rendering/RenderProgress.h13
-rw-r--r--WebCore/rendering/RenderSVGBlock.cpp5
-rw-r--r--WebCore/rendering/RenderSVGBlock.h5
-rw-r--r--WebCore/rendering/RenderSVGHiddenContainer.cpp5
-rw-r--r--WebCore/rendering/RenderSVGHiddenContainer.h1
-rw-r--r--WebCore/rendering/RenderSVGImage.cpp12
-rw-r--r--WebCore/rendering/RenderSVGImage.h7
-rw-r--r--WebCore/rendering/RenderSVGInline.cpp53
-rw-r--r--WebCore/rendering/RenderSVGInline.h16
-rw-r--r--WebCore/rendering/RenderSVGInlineText.cpp132
-rw-r--r--WebCore/rendering/RenderSVGInlineText.h13
-rw-r--r--WebCore/rendering/RenderSVGModelObject.cpp7
-rw-r--r--WebCore/rendering/RenderSVGModelObject.h2
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.cpp4
-rw-r--r--WebCore/rendering/RenderSVGResourceFilter.h4
-rw-r--r--WebCore/rendering/RenderSVGRoot.cpp8
-rw-r--r--WebCore/rendering/RenderSVGText.cpp112
-rw-r--r--WebCore/rendering/RenderSVGText.h12
-rw-r--r--WebCore/rendering/RenderSelectionInfo.h6
-rw-r--r--WebCore/rendering/RenderSlider.cpp9
-rw-r--r--WebCore/rendering/RenderTable.h2
-rw-r--r--WebCore/rendering/RenderTableSection.cpp2
-rw-r--r--WebCore/rendering/RenderText.cpp6
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.cpp126
-rw-r--r--WebCore/rendering/RenderTextControlSingleLine.h9
-rw-r--r--WebCore/rendering/RenderTheme.cpp73
-rw-r--r--WebCore/rendering/RenderTheme.h1
-rw-r--r--WebCore/rendering/RenderThemeChromiumMac.mm2
-rw-r--r--WebCore/rendering/RenderThemeMac.h1
-rw-r--r--WebCore/rendering/RenderThemeMac.mm14
-rw-r--r--WebCore/rendering/RenderTreeAsText.cpp9
-rw-r--r--WebCore/rendering/RenderView.cpp23
-rw-r--r--WebCore/rendering/RootInlineBox.cpp24
-rw-r--r--WebCore/rendering/RootInlineBox.h11
-rw-r--r--WebCore/rendering/SVGCharacterData.h6
-rw-r--r--WebCore/rendering/SVGCharacterLayoutInfo.cpp3
-rw-r--r--WebCore/rendering/SVGCharacterLayoutInfo.h4
-rw-r--r--WebCore/rendering/SVGInlineFlowBox.cpp40
-rw-r--r--WebCore/rendering/SVGInlineFlowBox.h6
-rw-r--r--WebCore/rendering/SVGInlineTextBox.cpp866
-rw-r--r--WebCore/rendering/SVGInlineTextBox.h68
-rw-r--r--WebCore/rendering/SVGRenderSupport.h9
-rw-r--r--WebCore/rendering/SVGRenderTreeAsText.cpp2
-rw-r--r--WebCore/rendering/SVGRootInlineBox.cpp1218
-rw-r--r--WebCore/rendering/SVGRootInlineBox.h40
-rw-r--r--WebCore/rendering/SVGTextChunkLayoutInfo.cpp493
-rw-r--r--WebCore/rendering/SVGTextChunkLayoutInfo.h178
-rw-r--r--WebCore/rendering/SVGTextLayoutUtilities.cpp27
-rw-r--r--WebCore/rendering/SVGTextLayoutUtilities.h23
-rw-r--r--WebCore/rendering/SVGTextQuery.cpp467
-rw-r--r--WebCore/rendering/SVGTextQuery.h76
-rw-r--r--WebCore/rendering/ShadowElement.cpp72
-rw-r--r--WebCore/rendering/ShadowElement.h15
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp50
-rw-r--r--WebCore/rendering/TextControlInnerElements.h15
-rw-r--r--WebCore/rendering/style/RenderStyle.cpp19
-rw-r--r--WebCore/rendering/style/RenderStyle.h13
-rw-r--r--WebCore/rendering/style/RenderStyleConstants.h7
-rw-r--r--WebCore/rendering/style/StyleRareInheritedData.cpp9
-rw-r--r--WebCore/rendering/style/StyleRareInheritedData.h5
-rw-r--r--WebCore/rendering/style/StyleRareNonInheritedData.h5
-rw-r--r--WebCore/storage/AbstractDatabase.cpp16
-rw-r--r--WebCore/storage/AbstractDatabase.h23
-rw-r--r--WebCore/storage/Database.cpp21
-rw-r--r--WebCore/storage/Database.h23
-rw-r--r--WebCore/storage/DatabaseSync.cpp13
-rw-r--r--WebCore/storage/DatabaseSync.h3
-rw-r--r--WebCore/storage/DatabaseTracker.cpp14
-rw-r--r--WebCore/storage/DatabaseTracker.h14
-rw-r--r--[-rwxr-xr-x]WebCore/storage/IDBObjectStoreImpl.h0
-rw-r--r--WebCore/storage/IndexedDatabaseImpl.cpp2
-rw-r--r--WebCore/storage/LocalStorageTask.cpp5
-rw-r--r--WebCore/storage/LocalStorageTask.h3
-rw-r--r--WebCore/storage/OriginQuotaManager.cpp4
-rw-r--r--WebCore/storage/OriginQuotaManager.h4
-rw-r--r--WebCore/storage/SQLError.h11
-rw-r--r--WebCore/storage/SQLError.idl10
-rw-r--r--WebCore/storage/SQLException.h72
-rw-r--r--WebCore/storage/SQLException.idl50
-rw-r--r--WebCore/storage/SQLStatement.cpp18
-rw-r--r--WebCore/storage/SQLTransaction.cpp16
-rw-r--r--WebCore/storage/StorageAreaImpl.cpp22
-rw-r--r--WebCore/storage/StorageAreaSync.cpp34
-rw-r--r--WebCore/storage/StorageAreaSync.h1
-rw-r--r--WebCore/storage/StorageNamespaceImpl.cpp2
-rw-r--r--WebCore/storage/StorageSyncManager.cpp7
-rw-r--r--WebCore/storage/StorageSyncManager.h1
-rw-r--r--WebCore/storage/chromium/DatabaseObserver.h8
-rw-r--r--WebCore/storage/chromium/DatabaseTrackerChromium.cpp16
-rw-r--r--WebCore/svg/SVGDocument.cpp4
-rw-r--r--WebCore/svg/SVGDocument.h6
-rw-r--r--WebCore/svg/SVGElement.idl6
-rw-r--r--WebCore/svg/SVGFont.cpp4
-rw-r--r--WebCore/svg/SVGForeignObjectElement.cpp4
-rw-r--r--WebCore/svg/SVGPaint.cpp8
-rw-r--r--WebCore/svg/SVGSVGElement.cpp4
-rw-r--r--WebCore/svg/SVGScriptElement.cpp10
-rw-r--r--WebCore/svg/SVGScriptElement.h2
-rw-r--r--WebCore/svg/SVGStyledElement.cpp7
-rw-r--r--WebCore/svg/SVGTextContentElement.cpp344
-rw-r--r--WebCore/svg/SVGTextElement.cpp10
-rw-r--r--WebCore/svg/SVGTextElement.h1
-rw-r--r--WebCore/svg/animation/SMILTimeContainer.h4
-rw-r--r--WebCore/svg/graphics/filters/SVGFilterBuilder.h4
-rw-r--r--WebCore/svg/svgtags.in2
-rw-r--r--WebCore/websockets/WebSocket.idl9
-rw-r--r--WebCore/websockets/WebSocketChannel.cpp22
-rw-r--r--WebCore/websockets/WebSocketChannel.h2
-rw-r--r--WebCore/websockets/WebSocketHandshake.cpp183
-rw-r--r--WebCore/websockets/WebSocketHandshake.h12
-rw-r--r--WebCore/websockets/WebSocketHandshakeRequest.cpp62
-rw-r--r--WebCore/websockets/WebSocketHandshakeRequest.h36
-rw-r--r--WebCore/websockets/WebSocketHandshakeResponse.cpp110
-rw-r--r--WebCore/websockets/WebSocketHandshakeResponse.h76
-rw-r--r--WebCore/wml/WMLErrorHandling.h4
-rw-r--r--WebCore/workers/SharedWorker.idl6
-rw-r--r--WebCore/workers/Worker.idl7
-rw-r--r--WebCore/workers/WorkerContext.cpp13
-rw-r--r--WebCore/workers/WorkerContext.h5
-rw-r--r--WebCore/xml/DOMParser.cpp2
-rw-r--r--WebCore/xml/XMLHttpRequest.cpp13
-rw-r--r--WebCore/xml/XSLTProcessor.cpp15
-rw-r--r--WebCore/xml/XSLTProcessor.idl6
-rw-r--r--WebKit/CMakeListsEfl.txt9
-rw-r--r--WebKit/ChangeLog181
-rw-r--r--WebKit/WebKit.xcodeproj/project.pbxproj28
-rw-r--r--WebKit/chromium/ChangeLog832
-rw-r--r--WebKit/chromium/DEPS56
-rw-r--r--WebKit/chromium/WebKit.gyp9
-rw-r--r--WebKit/chromium/features.gypi8
-rw-r--r--WebKit/chromium/public/WebAccessibilityRole.h1
-rw-r--r--WebKit/chromium/public/WebApplicationCacheHostClient.h3
-rw-r--r--WebKit/chromium/public/WebCString.h10
-rw-r--r--WebKit/chromium/public/WebCompositionCommand.h1
-rw-r--r--WebKit/chromium/public/WebCompositionUnderline.h61
-rw-r--r--WebKit/chromium/public/WebDatabase.h8
-rw-r--r--WebKit/chromium/public/WebDevToolsAgent.h3
-rw-r--r--WebKit/chromium/public/WebDevToolsAgentClient.h2
-rw-r--r--WebKit/chromium/public/WebDevToolsMessageTransport.h48
-rw-r--r--WebKit/chromium/public/WebFrame.h17
-rw-r--r--WebKit/chromium/public/WebGLES2Context.h2
-rw-r--r--WebKit/chromium/public/WebHistoryItem.h6
-rw-r--r--WebKit/chromium/public/WebMediaPlayer.h2
-rw-r--r--WebKit/chromium/public/WebNotification.h5
-rw-r--r--WebKit/chromium/public/WebSharedWorker.h9
-rw-r--r--WebKit/chromium/public/WebTextInputType.h53
-rw-r--r--WebKit/chromium/public/WebURL.h5
-rw-r--r--WebKit/chromium/public/WebURLResponse.h5
-rw-r--r--WebKit/chromium/public/WebView.h5
-rw-r--r--WebKit/chromium/public/WebViewClient.h5
-rw-r--r--WebKit/chromium/public/WebWidget.h31
-rw-r--r--WebKit/chromium/public/WebWidgetClient.h4
-rw-r--r--WebKit/chromium/public/mac/WebSandboxSupport.h63
-rw-r--r--WebKit/chromium/src/ApplicationCacheHostInternal.h12
-rw-r--r--WebKit/chromium/src/AssertMatchingEnums.cpp1
-rw-r--r--WebKit/chromium/src/AutoFillPopupMenuClient.cpp8
-rw-r--r--WebKit/chromium/src/AutocompletePopupMenuClient.cpp4
-rw-r--r--WebKit/chromium/src/ChromeClientImpl.cpp2
-rw-r--r--WebKit/chromium/src/ChromiumBridge.cpp19
-rw-r--r--WebKit/chromium/src/CompositionUnderlineBuilder.h53
-rw-r--r--WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp49
-rw-r--r--WebKit/chromium/src/CompositionUnderlineVectorBuilder.h53
-rw-r--r--WebKit/chromium/src/DatabaseObserver.cpp8
-rw-r--r--WebKit/chromium/src/DebuggerAgentManager.cpp2
-rw-r--r--WebKit/chromium/src/DragScrollTimer.cpp126
-rw-r--r--WebKit/chromium/src/DragScrollTimer.h69
-rw-r--r--WebKit/chromium/src/EditorClientImpl.cpp7
-rw-r--r--WebKit/chromium/src/FrameLoaderClientImpl.cpp3
-rw-r--r--WebKit/chromium/src/GLES2Context.cpp21
-rw-r--r--WebKit/chromium/src/InspectorClientImpl.cpp80
-rw-r--r--WebKit/chromium/src/InspectorClientImpl.h7
-rw-r--r--WebKit/chromium/src/InspectorFrontendClientImpl.cpp6
-rw-r--r--WebKit/chromium/src/NotificationPresenterImpl.cpp5
-rw-r--r--WebKit/chromium/src/ToolsAgent.h3
-rw-r--r--WebKit/chromium/src/WebCString.cpp12
-rw-r--r--WebKit/chromium/src/WebDatabase.cpp27
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.cpp188
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentImpl.h23
-rw-r--r--WebKit/chromium/src/WebDevToolsAgentPrivate.h5
-rw-r--r--WebKit/chromium/src/WebDevToolsFrontendImpl.cpp4
-rw-r--r--WebKit/chromium/src/WebEntities.cpp2
-rw-r--r--WebKit/chromium/src/WebFrameImpl.cpp29
-rw-r--r--WebKit/chromium/src/WebFrameImpl.h5
-rw-r--r--WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp3
-rw-r--r--WebKit/chromium/src/WebHistoryItem.cpp11
-rw-r--r--WebKit/chromium/src/WebNotification.cpp9
-rw-r--r--WebKit/chromium/src/WebPluginListBuilderImpl.cpp5
-rw-r--r--WebKit/chromium/src/WebPopupMenuImpl.cpp24
-rw-r--r--WebKit/chromium/src/WebPopupMenuImpl.h11
-rw-r--r--WebKit/chromium/src/WebRuntimeFeatures.cpp6
-rw-r--r--WebKit/chromium/src/WebURLResponse.cpp10
-rw-r--r--WebKit/chromium/src/WebViewImpl.cpp272
-rw-r--r--WebKit/chromium/src/WebViewImpl.h29
-rw-r--r--WebKit/chromium/src/js/DebuggerAgent.js2
-rw-r--r--WebKit/chromium/src/js/DebuggerScript.js2
-rw-r--r--WebKit/chromium/src/js/DevTools.js71
-rw-r--r--WebKit/chromium/src/js/DevToolsHostStub.js277
-rw-r--r--WebKit/chromium/src/js/HeapProfilerPanel.js2
-rw-r--r--WebKit/chromium/src/js/InjectDispatch.js48
-rw-r--r--WebKit/chromium/src/js/InspectorControllerImpl.js39
-rw-r--r--WebKit/chromium/src/js/ProfilerAgent.js19
-rw-r--r--WebKit/chromium/src/js/Tests.js191
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp45
-rw-r--r--WebKit/efl/WebCoreSupport/ChromeClientEfl.h3
-rw-r--r--WebKit/efl/WebCoreSupport/EditorClientEfl.h3
-rw-r--r--WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp28
-rw-r--r--WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp2
-rw-r--r--WebKit/efl/ewebkit.pc.in1
-rw-r--r--WebKit/efl/ewk/EWebKit.h1
-rw-r--r--WebKit/efl/ewk/ewk_private.h5
-rw-r--r--WebKit/efl/ewk/ewk_view.cpp26
-rw-r--r--WebKit/efl/ewk/ewk_view.h6
-rw-r--r--WebKit/efl/ewk/ewk_window_features.cpp156
-rw-r--r--WebKit/efl/ewk/ewk_window_features.h43
-rw-r--r--WebKit/gtk/ChangeLog82
-rw-r--r--WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp17
-rw-r--r--WebKit/gtk/WebCoreSupport/DragClientGtk.cpp4
-rw-r--r--WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp14
-rw-r--r--WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp3
-rw-r--r--WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp7
-rw-r--r--WebKit/gtk/po/ChangeLog9
-rw-r--r--WebKit/gtk/po/gl.po1117
-rw-r--r--WebKit/gtk/webkit/webkitprivate.h6
-rw-r--r--WebKit/gtk/webkit/webkitwebview.cpp99
-rw-r--r--WebKit/mac/ChangeLog776
-rw-r--r--WebKit/mac/Configurations/FeatureDefines.xcconfig3
-rw-r--r--WebKit/mac/Configurations/Version.xcconfig2
-rw-r--r--WebKit/mac/DOM/WebDOMOperations.mm9
-rw-r--r--WebKit/mac/DOM/WebDOMOperationsPrivate.h1
-rw-r--r--WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m2
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.h4
-rw-r--r--WebKit/mac/Misc/WebCoreStatistics.mm19
-rw-r--r--WebKit/mac/Misc/WebNSAttributedStringExtras.mm4
-rw-r--r--WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm2
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h13
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm32
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h4
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm10
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h5
-rw-r--r--WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm9
-rw-r--r--WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm2
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm2
-rw-r--r--WebKit/mac/Plugins/WebBaseNetscapePluginView.mm21
-rw-r--r--WebKit/mac/Plugins/WebBasePluginPackage.h44
-rw-r--r--WebKit/mac/Plugins/WebBasePluginPackage.mm304
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginPackage.h2
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginPackage.mm107
-rw-r--r--WebKit/mac/Plugins/WebNetscapePluginView.mm8
-rw-r--r--WebKit/mac/Plugins/WebPluginDatabase.mm143
-rw-r--r--WebKit/mac/Plugins/WebPluginPackage.h4
-rw-r--r--WebKit/mac/Plugins/WebPluginPackage.mm (renamed from WebKit/mac/Plugins/WebPluginPackage.m)25
-rw-r--r--WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm10
-rw-r--r--WebKit/mac/WebCoreSupport/WebPasteboardHelper.h6
-rw-r--r--WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm6
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.h47
-rw-r--r--WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm75
-rw-r--r--WebKit/mac/WebCoreSupport/WebSystemInterface.h10
-rw-r--r--WebKit/mac/WebCoreSupport/WebSystemInterface.mm (renamed from WebKit/mac/WebCoreSupport/WebSystemInterface.m)12
-rw-r--r--WebKit/mac/WebCoreSupport/WebViewFactory.mm11
-rw-r--r--WebKit/mac/WebView/WebDynamicScrollBarsView.mm2
-rw-r--r--WebKit/mac/WebView/WebFrame.mm5
-rw-r--r--WebKit/mac/WebView/WebGeolocationPosition.mm6
-rw-r--r--WebKit/mac/WebView/WebHTMLRepresentation.mm1
-rw-r--r--WebKit/mac/WebView/WebHTMLView.mm36
-rw-r--r--WebKit/mac/WebView/WebNavigationData.mm2
-rw-r--r--WebKit/mac/WebView/WebPDFRepresentation.mm6
-rw-r--r--WebKit/mac/WebView/WebPreferences.mm1
-rw-r--r--WebKit/mac/WebView/WebResource.mm2
-rw-r--r--WebKit/mac/WebView/WebSerializedJSValue.mm2
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.h2
-rw-r--r--WebKit/mac/WebView/WebVideoFullscreenController.mm141
-rw-r--r--WebKit/mac/WebView/WebView.mm26
-rw-r--r--WebKit/qt/Api/DerivedSources.pro2
-rw-r--r--WebKit/qt/Api/headers.pri3
-rw-r--r--WebKit/qt/Api/qgraphicswebview.cpp6
-rw-r--r--WebKit/qt/Api/qwebframe.cpp22
-rw-r--r--WebKit/qt/Api/qwebframe.h2
-rw-r--r--WebKit/qt/Api/qwebframe_p.h2
-rw-r--r--WebKit/qt/Api/qwebhistory.cpp9
-rw-r--r--WebKit/qt/Api/qwebkitplatformplugin.h6
-rw-r--r--WebKit/qt/Api/qwebpage.cpp226
-rw-r--r--WebKit/qt/Api/qwebpage.h38
-rw-r--r--WebKit/qt/Api/qwebpage_p.h9
-rw-r--r--WebKit/qt/Api/qwebscriptworld.cpp49
-rw-r--r--WebKit/qt/Api/qwebscriptworld.h48
-rw-r--r--WebKit/qt/Api/qwebscriptworld_p.h44
-rw-r--r--WebKit/qt/Api/qwebsettings.cpp4
-rw-r--r--WebKit/qt/Api/qwebsettings.h4
-rw-r--r--WebKit/qt/ChangeLog629
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp51
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.h3
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp9
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h1
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.cpp1
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp10
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp59
-rw-r--r--WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h16
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.cpp18
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.h6
-rw-r--r--WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp12
-rw-r--r--WebKit/qt/WebCoreSupport/QtPlatformPlugin.h3
-rw-r--r--WebKit/qt/declarative/declarative.pro72
-rw-r--r--WebKit/qt/declarative/plugin.cpp43
-rw-r--r--WebKit/qt/declarative/qdeclarativewebview.cpp1022
-rw-r--r--WebKit/qt/declarative/qdeclarativewebview_p.h371
-rw-r--r--WebKit/qt/declarative/qmldir1
-rw-r--r--WebKit/qt/docs/qtwebkit-bridge.qdoc4
-rw-r--r--WebKit/qt/docs/qtwebkit.qdocconf4
-rw-r--r--WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp43
-rw-r--r--WebKit/qt/examples/platformplugin/WebPlugin.cpp2
-rw-r--r--WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h6
-rw-r--r--WebKit/qt/symbian/eabi/QtWebKitu.def8
-rw-r--r--WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp4
-rw-r--r--WebKit/win/ChangeLog79
-rwxr-xr-xWebKit/win/Interfaces/IWebFramePrivate.idl4
-rw-r--r--WebKit/win/Interfaces/WebKit.idl1
-rw-r--r--WebKit/win/WebFrame.cpp7
-rw-r--r--WebKit/win/WebFrame.h4
-rw-r--r--WebKit/win/WebKit.vcproj/WebKit.sln14
-rw-r--r--WebKit/win/WebKitGraphics.cpp2
-rw-r--r--WebKit/win/WebView.cpp6
-rw-r--r--WebKit/wx/ChangeLog29
-rw-r--r--WebKit/wx/WebFrame.cpp2
-rw-r--r--WebKit/wx/WebView.cpp10
-rw-r--r--WebKit/wx/wscript2
-rw-r--r--WebKitExamplePlugins/ChangeLog10
-rw-r--r--WebKitExamplePlugins/NetscapeCoreAnimationMoviePlugin/main.m18
-rw-r--r--WebKitLibraries/ChangeLog39
-rw-r--r--WebKitLibraries/WebKitSystemInterface.h12
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceLeopard.abin1574632 -> 1578704 bytes
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.abin1296060 -> 1300380 bytes
-rw-r--r--WebKitLibraries/libWebKitSystemInterfaceTiger.abin603488 -> 605208 bytes
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops7
-rw-r--r--WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops7
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json31
-rw-r--r--WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg7
-rw-r--r--WebKitTools/BuildSlaveSupport/test-result-archive4
-rw-r--r--WebKitTools/ChangeLog1022
-rw-r--r--WebKitTools/DumpRenderTree/DumpRenderTree.h3
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.cpp101
-rw-r--r--WebKitTools/DumpRenderTree/LayoutTestController.h14
-rw-r--r--WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp5
-rw-r--r--WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp8
-rw-r--r--WebKitTools/DumpRenderTree/chromium/EventSender.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.cpp6
-rw-r--r--WebKitTools/DumpRenderTree/chromium/TestShell.h18
-rw-r--r--[-rwxr-xr-x]WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h0
-rw-r--r--[-rwxr-xr-x]WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h0
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp14
-rw-r--r--WebKitTools/DumpRenderTree/chromium/WebViewHost.h3
-rw-r--r--WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp64
-rw-r--r--WebKitTools/DumpRenderTree/gtk/EventSender.cpp43
-rw-r--r--WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp24
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm14
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m2
-rw-r--r--WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm2
-rw-r--r--WebKitTools/DumpRenderTree/mac/EventSendingController.mm2
-rw-r--r--WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm34
-rw-r--r--WebKitTools/DumpRenderTree/mac/UIDelegate.mm14
-rw-r--r--WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp43
-rw-r--r--WebKitTools/DumpRenderTree/qt/EventSenderQt.h1
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp15
-rw-r--r--WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h7
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp25
-rw-r--r--WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h1
-rw-r--r--WebKitTools/DumpRenderTree/win/EventSender.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/win/ImageDiff.vcproj8
-rw-r--r--WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp24
-rw-r--r--WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp2
-rwxr-xr-xWebKitTools/DumpRenderTree/win/UIDelegate.cpp2
-rw-r--r--WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp10
-rw-r--r--WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp23
-rw-r--r--WebKitTools/GtkLauncher/main.c10
-rw-r--r--WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj134
-rw-r--r--WebKitTools/MiniBrowser/WebBundle-Info.plist22
-rw-r--r--WebKitTools/MiniBrowser/mac/AppDelegate.h8
-rw-r--r--WebKitTools/MiniBrowser/mac/AppDelegate.m49
-rw-r--r--WebKitTools/MiniBrowser/mac/BrowserWindowController.m47
-rw-r--r--WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch6
-rw-r--r--WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m124
-rw-r--r--WebKitTools/MiniBrowser/win/BrowserView.cpp9
-rw-r--r--WebKitTools/QtTestBrowser/fpstimer.h4
-rwxr-xr-xWebKitTools/Scripts/build-webkit5
-rwxr-xr-xWebKitTools/Scripts/do-webcore-rename3
-rwxr-xr-xWebKitTools/Scripts/update-webkit-chromium2
-rw-r--r--WebKitTools/Scripts/webkitdirs.pm21
-rw-r--r--WebKitTools/Scripts/webkitpy/common/config/committers.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/buildbot.py5
-rw-r--r--WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py9
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp.py28
-rw-r--r--WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py31
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py2
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py4
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/download.py13
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues.py25
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py22
-rw-r--r--WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py2
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig68
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig40
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig24
-rw-r--r--WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig26
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist22
-rw-r--r--WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp106
-rw-r--r--WebKitTools/WebKitTestRunner/Makefile21
-rw-r--r--WebKitTools/WebKitTestRunner/PlatformWebView.h61
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.cpp132
-rw-r--r--WebKitTools/WebKitTestRunner/TestController.h71
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.cpp170
-rw-r--r--WebKitTools/WebKitTestRunner/TestInvocation.h74
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj355
-rw-r--r--WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h30
-rw-r--r--WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm55
-rw-r--r--WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm51
-rw-r--r--WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm36
-rw-r--r--WebKitTools/WebKitTestRunner/mac/main.mm40
-rw-r--r--WebKitTools/wx/build/settings.py2
1285 files changed, 48152 insertions, 16325 deletions
diff --git a/JavaScriptCore/API/JSClassRef.h b/JavaScriptCore/API/JSClassRef.h
index ae60aad..5a3a17e 100644
--- a/JavaScriptCore/API/JSClassRef.h
+++ b/JavaScriptCore/API/JSClassRef.h
@@ -33,7 +33,6 @@
#include <runtime/UString.h>
#include <runtime/WeakGCPtr.h>
#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
struct StaticValueEntry : FastAllocBase {
StaticValueEntry(JSObjectGetPropertyCallback _getProperty, JSObjectSetPropertyCallback _setProperty, JSPropertyAttributes _attributes)
diff --git a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
index 9beeb82..8182075 100644
--- a/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
+++ b/JavaScriptCore/API/JSWeakObjectMapRefPrivate.cpp
@@ -32,7 +32,6 @@
#include "JSValue.h"
#include "JSWeakObjectMapRefInternal.h"
#include <wtf/HashMap.h>
-#include <wtf/RefCounted.h>
#include <wtf/text/StringHash.h>
using namespace WTF;
diff --git a/JavaScriptCore/CMakeLists.txt b/JavaScriptCore/CMakeLists.txt
index d4a85d0..c1946ff 100644
--- a/JavaScriptCore/CMakeLists.txt
+++ b/JavaScriptCore/CMakeLists.txt
@@ -54,16 +54,19 @@ SET(JavaScriptCore_SOURCES
jit/ExecutableAllocatorPosix.cpp
jit/ExecutableAllocatorSymbian.cpp
jit/ExecutableAllocatorWin.cpp
- jit/JITStubs.cpp
- jit/JITOpcodes.cpp
- jit/JITOpcodes32_64.cpp
- jit/JITPropertyAccess.cpp
- jit/JITPropertyAccess32_64.cpp
+ jit/JITArithmetic32_64.cpp
jit/JITArithmetic.cpp
- jit/JITCall.cpp
jit/JITCall32_64.cpp
+ jit/JITCall.cpp
jit/JIT.cpp
+ jit/JITOpcodes32_64.cpp
+ jit/JITOpcodes.cpp
+ jit/JITPropertyAccess32_64.cpp
+ jit/JITPropertyAccess.cpp
+ jit/JITStubs.cpp
+ jit/ThunkGenerators.cpp
+ parser/JSParser.cpp
parser/Lexer.cpp
parser/Nodes.cpp
parser/Parser.cpp
@@ -149,6 +152,7 @@ SET(JavaScriptCore_SOURCES
runtime/PropertySlot.cpp
runtime/PrototypeFunction.cpp
runtime/RegExp.cpp
+ runtime/RegExpCache.cpp
runtime/RegExpConstructor.cpp
runtime/RegExpObject.cpp
runtime/RegExpPrototype.cpp
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 8d5b59e..ff017ca 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,957 @@
+2010-06-25 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ New QtScript API; setPrototype() and prototype().
+
+ This patch implements QScriptValue's prototype accessors.
+
+ [Qt] QScriptValue should have accessors to a prototype.
+ https://bugs.webkit.org/show_bug.cgi?id=39356
+
+ * qt/api/qscriptvalue.cpp:
+ (QScriptValue::prototype):
+ (QScriptValue::setPrototype):
+ * qt/api/qscriptvalue.h:
+ * qt/api/qscriptvalue_p.h:
+ (QScriptValuePrivate::prototype):
+ (QScriptValuePrivate::setPrototype):
+ * qt/tests/qscriptvalue/tst_qscriptvalue.cpp:
+ (tst_QScriptValue::getSetPrototype):
+ * qt/tests/qscriptvalue/tst_qscriptvalue.h:
+
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [CMake] Add option to enable JIT.
+ JIT is disabled by default, but now it's possible to enable it through
+ an option to CMake: -DENABLE_JIT will enable it.
+ https://bugs.webkit.org/show_bug.cgi?id=40936
+
+ * CMakeLists.txt: Add missing files and re-sort.
+
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [CMake] Remove unused variable in EFL build system. It was previously
+ being used to set the flags of each port but it was superseded by
+ other flags.
+ https://bugs.webkit.org/show_bug.cgi?id=40931
+
+ * jsc/CMakeLists.txt:
+
+2010-06-25 Nathan Lawrence <nlawrence@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Aligning AssemblerBuffer to 128 bytes gives a 0.4% speedup on
+ sunspider.
+
+ * assembler/AssemblerBuffer.h:
+ (JSC::AssemblerBuffer::AssemblerBuffer):
+
+2010-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61842.
+ http://trac.webkit.org/changeset/61842
+ https://bugs.webkit.org/show_bug.cgi?id=41208
+
+ It broke Windows build (Requested by Ossy_ on #webkit).
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
+ * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+ * wtf/OwnPtrCommon.h:
+ * wtf/brew/OwnPtrBrew.h: Removed.
+ * wtf/win/OwnPtrWin.h: Removed.
+
+2010-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61833.
+ http://trac.webkit.org/changeset/61833
+ https://bugs.webkit.org/show_bug.cgi?id=41205
+
+ It broke Leopard and GTK (Requested by Ossy_ on #webkit).
+
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::RegExp):
+ (JSC::RegExp::create):
+ * runtime/RegExp.h:
+ * runtime/RegExpCache.cpp:
+ (JSC::RegExpCache::lookupOrCreate):
+ (JSC::RegExpCache::create):
+ * runtime/RegExpCache.h:
+
+2010-06-25 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Adam Barth.
+
+ Change OwnPtrCommon to include platform-specific headers
+ https://bugs.webkit.org/show_bug.cgi?id=40279
+
+ Adding new type to OwnPtrCommon needlessly causes all ports to do full rebuilds.
+ Change OwnPtrCommon to include platform-specific headers to avoid all ports rebuilds.
+
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
+ * JavaScriptCore.vcproj/WTF/WTF.vcproj:
+ * wtf/OwnPtrCommon.h:
+ * wtf/brew/OwnPtrBrew.h: Added.
+ * wtf/win/OwnPtrWin.h: Added.
+
+2010-06-25 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Add the possibility for a head and footer section to create_jit_stubs.
+ https://bugs.webkit.org/show_bug.cgi?id=36050
+
+ * create_jit_stubs:
+
+2010-06-24 Renata Hodovan <reni@inf.u-szeged.hu>
+
+ Reviewed by Geoffrey Garen.
+
+ Merge RegExp constructor and RegExp::create methods into one.
+ Both of function are called with tree parameters and check whether
+ flags (the third param) is given or not.
+ Simplify hash lookups in RegExpCache::create with giving them an extra
+ iterator parameter.
+ https://bugs.webkit.org/show_bug.cgi?id=41055
+
+ * runtime/RegExp.cpp:
+ (JSC::RegExp::RegExp):
+ * runtime/RegExp.h:
+ * runtime/RegExpCache.cpp:
+ (JSC::RegExpCache::lookupOrCreate):
+ (JSC::RegExpCache::create):
+ * runtime/RegExpCache.h:
+
+2010-06-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Incorrect use of '+ 4' and 0 instead of tag and payload offsets in JSValue32_64
+ https://bugs.webkit.org/show_bug.cgi?id=41193
+
+ I noticed a use of '+ 4' in some of the 32_64 code paths and realised there
+ were a few places where endianness was being hardcoded. This patch fixes
+ the errors i could find through code inspection.
+
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::emit_op_resolve_global):
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::emit_op_get_by_val):
+ (JSC::JIT::emit_op_put_by_val):
+ (JSC::JIT::compileGetDirectOffset):
+ (JSC::JIT::privateCompilePutByIdTransition):
+ (JSC::JIT::patchGetByIdSelf):
+ (JSC::JIT::patchPutByIdReplace):
+
+2010-06-24 Oliver Hunt <oliver@apple.com>
+
+ Build fix
+
+ Temporarily get the tiger bot working again by disabling the
+ new JS parser. GCC on tiger is miscompiling the parser and
+ I don't have access to a tiger machine right now.
+
+ * wtf/Platform.h:
+
+ 2010-06-21 Nathan Lawrence <nlawrence@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40128
+ Fixed broken debug functionality.
+
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::dumpRegisters):
+ Fixed to work with updated call frame.
+ * runtime/JSImmediate.h:
+ (JSC::JSValue::isCell):
+ Added assert for aligned cell.
+ * runtime/JSValue.cpp:
+ (JSC::JSValue::description):
+ Fixed to work with current JSValue implementation.
+ * runtime/JSZombie.cpp:
+ (JSC::JSZombie::leakedZombieStructure):
+ JSombies compile again.
+
+2010-06-24 Leandro Pereira <leandro@profusion.mobi>
+
+ Unreviewed build fix.
+
+ * CMakeLists.txt: Add JSParser.cpp.
+
+2010-06-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Maciej Stachowiak.
+
+ Single character string replacement may replace too many characters
+ https://bugs.webkit.org/show_bug.cgi?id=41138
+ <rdar://problem/8097496>
+
+ Simple fix to stop the rope path of single character replacement
+ once the first replacement occurs.
+
+ * runtime/JSString.cpp:
+ (JSC::JSString::replaceCharacter):
+
+2010-06-24 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Gavin Barraclough.
+
+ Fix the length of instruction stream controlled by constant pool
+ https://bugs.webkit.org/show_bug.cgi?id=40293
+
+ The initial/maximum length of instruction stream (m_maxDistance) should
+ be set when the first constant arrives to the constant pool. Otherwise
+ the constant pool could be placed into an uninterrupted sequence.
+
+ * assembler/AssemblerBufferWithConstantPool.h:
+ (JSC::):
+
+2010-06-24 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ We assume bytecodeOffset will always return a value > 1,
+ so we adjust the failure case to return 1 instead of 0.
+
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::bytecodeOffset):
+
+2010-06-23 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Gavin Barraclough.
+
+ Custom-written JavaScript parser
+ https://bugs.webkit.org/show_bug.cgi?id=34019
+
+ Implement a recursive descent parser similar to that used by V8 and
+ SpiderMonkey. Greater than 2x improvement in SunSpider parsing tests.
+
+ The parser consists of a JSParser class that uses a TreeBuilder to actually
+ build the AST. There are currently two builders -- the ASTBuilder and
+ SyntaxChecker which separate the job of building an AST for code generation
+ and simply checking syntactic correctness.
+
+ There's still some less than ideal code remaining in the parser to allow
+ us to retain the existing lexing code with minimal changes. We'll tidy
+ this up at a later date.
+
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.pro:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * parser/ASTBuilder.h: Added.
+ (JSC::ASTBuilder::BinaryOpInfo::BinaryOpInfo):
+ (JSC::ASTBuilder::AssignmentInfo::AssignmentInfo):
+ (JSC::ASTBuilder::ASTBuilder):
+ (JSC::ASTBuilder::createSourceElements):
+ (JSC::ASTBuilder::varDeclarations):
+ (JSC::ASTBuilder::funcDeclarations):
+ (JSC::ASTBuilder::features):
+ (JSC::ASTBuilder::numConstants):
+ (JSC::ASTBuilder::appendToComma):
+ (JSC::ASTBuilder::createCommaExpr):
+ (JSC::ASTBuilder::createLogicalNot):
+ (JSC::ASTBuilder::createUnaryPlus):
+ (JSC::ASTBuilder::createVoid):
+ (JSC::ASTBuilder::thisExpr):
+ (JSC::ASTBuilder::createResolve):
+ (JSC::ASTBuilder::createObjectLiteral):
+ (JSC::ASTBuilder::createArray):
+ (JSC::ASTBuilder::createNumberExpr):
+ (JSC::ASTBuilder::createString):
+ (JSC::ASTBuilder::createBoolean):
+ (JSC::ASTBuilder::createNull):
+ (JSC::ASTBuilder::createBracketAccess):
+ (JSC::ASTBuilder::createDotAccess):
+ (JSC::ASTBuilder::createRegex):
+ (JSC::ASTBuilder::createNewExpr):
+ (JSC::ASTBuilder::createConditionalExpr):
+ (JSC::ASTBuilder::createAssignResolve):
+ (JSC::ASTBuilder::createFunctionExpr):
+ (JSC::ASTBuilder::createFunctionBody):
+ (JSC::ASTBuilder::createGetterOrSetterProperty):
+ (JSC::ASTBuilder::createArguments):
+ (JSC::ASTBuilder::createArgumentsList):
+ (JSC::ASTBuilder::createProperty):
+ (JSC::ASTBuilder::createPropertyList):
+ (JSC::ASTBuilder::createElementList):
+ (JSC::ASTBuilder::createFormalParameterList):
+ (JSC::ASTBuilder::createClause):
+ (JSC::ASTBuilder::createClauseList):
+ (JSC::ASTBuilder::setUsesArguments):
+ (JSC::ASTBuilder::createFuncDeclStatement):
+ (JSC::ASTBuilder::createBlockStatement):
+ (JSC::ASTBuilder::createExprStatement):
+ (JSC::ASTBuilder::createIfStatement):
+ (JSC::ASTBuilder::createForLoop):
+ (JSC::ASTBuilder::createForInLoop):
+ (JSC::ASTBuilder::createEmptyStatement):
+ (JSC::ASTBuilder::createVarStatement):
+ (JSC::ASTBuilder::createReturnStatement):
+ (JSC::ASTBuilder::createBreakStatement):
+ (JSC::ASTBuilder::createContinueStatement):
+ (JSC::ASTBuilder::createTryStatement):
+ (JSC::ASTBuilder::createSwitchStatement):
+ (JSC::ASTBuilder::createWhileStatement):
+ (JSC::ASTBuilder::createDoWhileStatement):
+ (JSC::ASTBuilder::createLabelStatement):
+ (JSC::ASTBuilder::createWithStatement):
+ (JSC::ASTBuilder::createThrowStatement):
+ (JSC::ASTBuilder::createDebugger):
+ (JSC::ASTBuilder::createConstStatement):
+ (JSC::ASTBuilder::appendConstDecl):
+ (JSC::ASTBuilder::appendStatement):
+ (JSC::ASTBuilder::addVar):
+ (JSC::ASTBuilder::combineCommaNodes):
+ (JSC::ASTBuilder::evalCount):
+ (JSC::ASTBuilder::appendBinaryExpressionInfo):
+ (JSC::ASTBuilder::operatorStackPop):
+ (JSC::ASTBuilder::operatorStackHasHigherPrecedence):
+ (JSC::ASTBuilder::getFromOperandStack):
+ (JSC::ASTBuilder::shrinkOperandStackBy):
+ (JSC::ASTBuilder::appendBinaryOperation):
+ (JSC::ASTBuilder::operatorStackAppend):
+ (JSC::ASTBuilder::popOperandStack):
+ (JSC::ASTBuilder::appendUnaryToken):
+ (JSC::ASTBuilder::unaryTokenStackLastType):
+ (JSC::ASTBuilder::unaryTokenStackLastStart):
+ (JSC::ASTBuilder::unaryTokenStackRemoveLast):
+ (JSC::ASTBuilder::assignmentStackAppend):
+ (JSC::ASTBuilder::createAssignment):
+ (JSC::ASTBuilder::Scope::Scope):
+ (JSC::ASTBuilder::setExceptionLocation):
+ (JSC::ASTBuilder::incConstants):
+ (JSC::ASTBuilder::usesThis):
+ (JSC::ASTBuilder::usesCatch):
+ (JSC::ASTBuilder::usesClosures):
+ (JSC::ASTBuilder::usesArguments):
+ (JSC::ASTBuilder::usesAssignment):
+ (JSC::ASTBuilder::usesWith):
+ (JSC::ASTBuilder::usesEval):
+ (JSC::ASTBuilder::createNumber):
+ (JSC::ASTBuilder::makeTypeOfNode):
+ (JSC::ASTBuilder::makeDeleteNode):
+ (JSC::ASTBuilder::makeNegateNode):
+ (JSC::ASTBuilder::makeBitwiseNotNode):
+ (JSC::ASTBuilder::makeMultNode):
+ (JSC::ASTBuilder::makeDivNode):
+ (JSC::ASTBuilder::makeAddNode):
+ (JSC::ASTBuilder::makeSubNode):
+ (JSC::ASTBuilder::makeLeftShiftNode):
+ (JSC::ASTBuilder::makeRightShiftNode):
+ (JSC::ASTBuilder::makeFunctionCallNode):
+ (JSC::ASTBuilder::makeBinaryNode):
+ (JSC::ASTBuilder::makeAssignNode):
+ (JSC::ASTBuilder::makePrefixNode):
+ (JSC::ASTBuilder::makePostfixNode):
+ * parser/JSParser.cpp: Added.
+ (JSC::JSParser::AllowInOverride::AllowInOverride):
+ (JSC::JSParser::AllowInOverride::~AllowInOverride):
+ (JSC::JSParser::token):
+ (JSC::JSParser::next):
+ (JSC::JSParser::consume):
+ (JSC::JSParser::match):
+ (JSC::JSParser::tokenStart):
+ (JSC::JSParser::tokenLine):
+ (JSC::JSParser::tokenEnd):
+ (JSC::JSParser::):
+ (JSC::JSParser::autoSemiColon):
+ (JSC::JSParser::canRecurse):
+ (JSC::JSParser::lastTokenEnd):
+ (JSC::jsParse):
+ (JSC::JSParser::JSParser):
+ (JSC::JSParser::parseProgram):
+ (JSC::JSParser::allowAutomaticSemicolon):
+ (JSC::JSParser::parseSourceElements):
+ (JSC::JSParser::parseVarDeclaration):
+ (JSC::JSParser::parseConstDeclaration):
+ (JSC::JSParser::parseDoWhileStatement):
+ (JSC::JSParser::parseWhileStatement):
+ (JSC::JSParser::parseVarDeclarationList):
+ (JSC::JSParser::parseConstDeclarationList):
+ (JSC::JSParser::parseForStatement):
+ (JSC::JSParser::parseBreakStatement):
+ (JSC::JSParser::parseContinueStatement):
+ (JSC::JSParser::parseReturnStatement):
+ (JSC::JSParser::parseThrowStatement):
+ (JSC::JSParser::parseWithStatement):
+ (JSC::JSParser::parseSwitchStatement):
+ (JSC::JSParser::parseSwitchClauses):
+ (JSC::JSParser::parseSwitchDefaultClause):
+ (JSC::JSParser::parseTryStatement):
+ (JSC::JSParser::parseDebuggerStatement):
+ (JSC::JSParser::parseBlockStatement):
+ (JSC::JSParser::parseStatement):
+ (JSC::JSParser::parseFormalParameters):
+ (JSC::JSParser::parseFunctionBody):
+ (JSC::JSParser::parseFunctionInfo):
+ (JSC::JSParser::parseFunctionDeclaration):
+ (JSC::JSParser::parseExpressionOrLabelStatement):
+ (JSC::JSParser::parseExpressionStatement):
+ (JSC::JSParser::parseIfStatement):
+ (JSC::JSParser::parseExpression):
+ (JSC::JSParser::parseAssignmentExpression):
+ (JSC::JSParser::parseConditionalExpression):
+ (JSC::isUnaryOp):
+ (JSC::JSParser::isBinaryOperator):
+ (JSC::JSParser::parseBinaryExpression):
+ (JSC::JSParser::parseProperty):
+ (JSC::JSParser::parseObjectLiteral):
+ (JSC::JSParser::parseArrayLiteral):
+ (JSC::JSParser::parsePrimaryExpression):
+ (JSC::JSParser::parseArguments):
+ (JSC::JSParser::parseMemberExpression):
+ (JSC::JSParser::parseUnaryExpression):
+ * parser/JSParser.h: Added.
+ (JSC::):
+ (JSC::JSTokenInfo::JSTokenInfo):
+ * parser/Lexer.cpp:
+ (JSC::Lexer::lex):
+ * parser/Lexer.h:
+ (JSC::Lexer::setLastLineNumber):
+ (JSC::Lexer::lastLineNumber):
+ * parser/NodeConstructors.h:
+ (JSC::Node::Node):
+ * parser/Parser.cpp:
+ (JSC::Parser::parse):
+ * parser/SyntaxChecker.h: Added.
+ (JSC::SyntaxChecker::SyntaxChecker):
+ (JSC::SyntaxChecker::createSourceElements):
+ (JSC::SyntaxChecker::makeFunctionCallNode):
+ (JSC::SyntaxChecker::appendToComma):
+ (JSC::SyntaxChecker::createCommaExpr):
+ (JSC::SyntaxChecker::makeAssignNode):
+ (JSC::SyntaxChecker::makePrefixNode):
+ (JSC::SyntaxChecker::makePostfixNode):
+ (JSC::SyntaxChecker::makeTypeOfNode):
+ (JSC::SyntaxChecker::makeDeleteNode):
+ (JSC::SyntaxChecker::makeNegateNode):
+ (JSC::SyntaxChecker::makeBitwiseNotNode):
+ (JSC::SyntaxChecker::createLogicalNot):
+ (JSC::SyntaxChecker::createUnaryPlus):
+ (JSC::SyntaxChecker::createVoid):
+ (JSC::SyntaxChecker::thisExpr):
+ (JSC::SyntaxChecker::createResolve):
+ (JSC::SyntaxChecker::createObjectLiteral):
+ (JSC::SyntaxChecker::createArray):
+ (JSC::SyntaxChecker::createNumberExpr):
+ (JSC::SyntaxChecker::createString):
+ (JSC::SyntaxChecker::createBoolean):
+ (JSC::SyntaxChecker::createNull):
+ (JSC::SyntaxChecker::createBracketAccess):
+ (JSC::SyntaxChecker::createDotAccess):
+ (JSC::SyntaxChecker::createRegex):
+ (JSC::SyntaxChecker::createNewExpr):
+ (JSC::SyntaxChecker::createConditionalExpr):
+ (JSC::SyntaxChecker::createAssignResolve):
+ (JSC::SyntaxChecker::createFunctionExpr):
+ (JSC::SyntaxChecker::createFunctionBody):
+ (JSC::SyntaxChecker::createArguments):
+ (JSC::SyntaxChecker::createArgumentsList):
+ (JSC::SyntaxChecker::createProperty):
+ (JSC::SyntaxChecker::createPropertyList):
+ (JSC::SyntaxChecker::createElementList):
+ (JSC::SyntaxChecker::createFormalParameterList):
+ (JSC::SyntaxChecker::createClause):
+ (JSC::SyntaxChecker::createClauseList):
+ (JSC::SyntaxChecker::setUsesArguments):
+ (JSC::SyntaxChecker::createFuncDeclStatement):
+ (JSC::SyntaxChecker::createBlockStatement):
+ (JSC::SyntaxChecker::createExprStatement):
+ (JSC::SyntaxChecker::createIfStatement):
+ (JSC::SyntaxChecker::createForLoop):
+ (JSC::SyntaxChecker::createForInLoop):
+ (JSC::SyntaxChecker::createEmptyStatement):
+ (JSC::SyntaxChecker::createVarStatement):
+ (JSC::SyntaxChecker::createReturnStatement):
+ (JSC::SyntaxChecker::createBreakStatement):
+ (JSC::SyntaxChecker::createContinueStatement):
+ (JSC::SyntaxChecker::createTryStatement):
+ (JSC::SyntaxChecker::createSwitchStatement):
+ (JSC::SyntaxChecker::createWhileStatement):
+ (JSC::SyntaxChecker::createWithStatement):
+ (JSC::SyntaxChecker::createDoWhileStatement):
+ (JSC::SyntaxChecker::createLabelStatement):
+ (JSC::SyntaxChecker::createThrowStatement):
+ (JSC::SyntaxChecker::createDebugger):
+ (JSC::SyntaxChecker::createConstStatement):
+ (JSC::SyntaxChecker::appendConstDecl):
+ (JSC::SyntaxChecker::createGetterOrSetterProperty):
+ (JSC::SyntaxChecker::appendStatement):
+ (JSC::SyntaxChecker::addVar):
+ (JSC::SyntaxChecker::combineCommaNodes):
+ (JSC::SyntaxChecker::evalCount):
+ (JSC::SyntaxChecker::appendBinaryExpressionInfo):
+ (JSC::SyntaxChecker::operatorStackPop):
+ * runtime/JSGlobalData.h:
+ * wtf/Platform.h:
+ * wtf/ThreadSpecific.h:
+ (WTF::T):
+
+2010-06-23 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Optimization of the QScriptValuePrivate.
+
+ Patch change only internals of the QScriptValuePrivate.
+ Most of the QScriptValuePrivate's attributes were moved
+ into an union.
+
+ [Qt] Optimization of the QScriptVAluePrivate.
+ https://bugs.webkit.org/show_bug.cgi?id=40415
+
+ * qt/api/qscriptengine_p.cpp:
+ (QScriptEnginePrivate::globalObject):
+ * qt/api/qscriptvalue_p.h:
+ (QScriptValuePrivate::):
+ (QScriptValuePrivate::~QScriptValuePrivate):
+ (QScriptValuePrivate::QScriptValuePrivate):
+ (QScriptValuePrivate::toString):
+ (QScriptValuePrivate::toNumber):
+ (QScriptValuePrivate::toBool):
+ (QScriptValuePrivate::toObject):
+ (QScriptValuePrivate::equals):
+ (QScriptValuePrivate::strictlyEquals):
+ (QScriptValuePrivate::assignEngine):
+ (QScriptValuePrivate::operator JSValueRef):
+ (QScriptValuePrivate::operator JSObjectRef):
+ (QScriptValuePrivate::refinedJSValue):
+
+2010-06-23 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Oliver Hunt.
+
+ [GTK] Implement ThreadSpecific with glib
+ https://bugs.webkit.org/show_bug.cgi?id=39829
+
+ Implement ThreadSpecific with glib's GStaticPrivate.
+ This patch makes it possible to build GTK port without pthread.
+
+ * wtf/ThreadSpecific.h:
+ (WTF::::ThreadSpecific):
+ (WTF::::~ThreadSpecific):
+ (WTF::::get):
+ (WTF::::set):
+ (WTF::::destroy):
+
+2010-06-23 Leandro Pereira <leandro@profusion.mobi>
+
+ Unreviewed build fix.
+
+ * CMakeLists.txt: Add runtime/RegExpCache.cpp.
+
+2010-06-22 Renata Hodovan <hodovan@inf.u-szeged.hu>
+
+ Reviewed by Geoffrey Garen.
+
+ Adding regular expression caching to JavaScriptCore
+ https://bugs.webkit.org/show_bug.cgi?id=38142
+
+ The cache is based on Round Robin eviction policy, and
+ can cache at most 256 character long regular expressions,
+ and at most 256 of them. These values can be changed at compile time.
+
+ * GNUmakefile.am:
+ * JavaScriptCore.gypi:
+ * JavaScriptCore.pro:
+ * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+ * JavaScriptCore.xcodeproj/project.pbxproj:
+ * bytecompiler/NodesCodegen.cpp:
+ (JSC::RegExpNode::emitBytecode):
+ * runtime/JSGlobalData.cpp:
+ (JSC::JSGlobalData::JSGlobalData):
+ (JSC::JSGlobalData::~JSGlobalData):
+ * runtime/JSGlobalData.h:
+ (JSC::JSGlobalData::regExpCache):
+ * runtime/RegExpCache.cpp: Added.
+ (JSC::RegExpCache::lookupOrCreate):
+ (JSC::RegExpCache::create):
+ (JSC::RegExpCache::RegExpCache):
+ * runtime/RegExpCache.h: Added.
+ * runtime/RegExpConstructor.cpp:
+ (JSC::constructRegExp):
+ * runtime/RegExpKey.h: Added.
+ (JSC::RegExpKey::RegExpKey):
+ (JSC::RegExpKey::getFlagsValue):
+ (WTF::operator==):
+ (WTF::):
+ * runtime/RegExpPrototype.cpp:
+ (JSC::regExpProtoFuncCompile):
+ * runtime/StringPrototype.cpp:
+ (JSC::stringProtoFuncMatch):
+ (JSC::stringProtoFuncSearch):
+
+2010-06-22 Gabor Loki <loki@webkit.org>
+
+ Reviewed by Geoffrey Garen.
+
+ Add native call support for ARM and Thumb-2 JIT.
+ https://bugs.webkit.org/show_bug.cgi?id=40231
+
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::privateCompileCTINativeCall):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::privateCompileCTINativeCall):
+ * wtf/Platform.h:
+
+2010-06-21 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Make JSC more resilient in the face of parse failures
+ https://bugs.webkit.org/show_bug.cgi?id=40951
+
+ A number of recent bugs have occurred due to issues like miscounting
+ BOMs, etc which lead to interesting crashes later on. Adding this
+ logic hardens JSC in the face of these errors, and has no impact on
+ performance (32bit jit actually gets 0.7% faster but I put that down
+ to cache effects).
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
+ (JSC::CodeBlock::lineNumberForBytecodeOffset):
+ (JSC::CodeBlock::expressionRangeForBytecodeOffset):
+ (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
+ * bytecode/CodeBlock.h:
+ (JSC::CodeBlock::bytecodeOffset):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::execute):
+ (JSC::Interpreter::executeCall):
+ (JSC::Interpreter::executeConstruct):
+ (JSC::Interpreter::prepareForRepeatCall):
+ (JSC::Interpreter::privateExecute):
+ * jit/JITOpcodes.cpp:
+ (JSC::JIT::privateCompileCTIMachineTrampolines):
+ * jit/JITOpcodes32_64.cpp:
+ (JSC::JIT::privateCompileCTIMachineTrampolines):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+ * runtime/ArrayPrototype.cpp:
+ (JSC::isNumericCompareFunction):
+ * runtime/Executable.cpp:
+ (JSC::FunctionExecutable::compileForCall):
+ (JSC::FunctionExecutable::compileForConstruct):
+ (JSC::FunctionExecutable::generateJITCodeForCall):
+ (JSC::FunctionExecutable::generateJITCodeForConstruct):
+ (JSC::FunctionExecutable::reparseExceptionInfo):
+ (JSC::EvalExecutable::reparseExceptionInfo):
+ * runtime/Executable.h:
+ (JSC::FunctionExecutable::bytecodeForCall):
+ (JSC::FunctionExecutable::bytecodeForConstruct):
+ * runtime/JSGlobalData.cpp:
+ (JSC::JSGlobalData::numericCompareFunction):
+
+2010-06-21 John Sullivan <sullivan@apple.com>
+
+ Reviewed by Adam Roben.
+
+ RetainPtr can't be used in HashMaps or HashSets
+ <https://bugs.webkit.org/show_bug.cgi?id=40938>
+
+ Added hashing knowledge similar to that in COMPtr.h.
+
+ * wtf/RetainPtr.h:
+ (WTF::RetainPtr::RetainPtr):
+ New function, copied from COMPtr.h but for the type change.
+ (WTF::RetainPtr::isHashTableDeletedValue):
+ Ditto.
+ (WTF::RetainPtr::hashTableDeletedValue):
+ Ditto.
+ Added template code for HashTraits and PtrHash copied from COMPtr.h but for the type change.
+ The only difference is that constructDeletedValue() matches the RefPtr implementation (in HashTraits.h)
+ rather than the COMPtr implementation.
+
+2010-06-19 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Need to ensure that we grow the RegisterFile when creating a callframe for host code
+ https://bugs.webkit.org/show_bug.cgi?id=40858
+ <rdar://problem/8108986>
+
+ In the past the use of the callframe in hostcode was much more
+ limited. Now that we expect the callframe to always be valid
+ we need to grow the RegisterFile so that this is actually the
+ case. In this particular case the problem was failing to grow
+ the registerfile could lead to a callframe that extended beyond
+ RegisterFiler::end(), so vm re-entry would clobber the callframe
+ other scenarios could also lead to badness.
+
+ I was unable to construct a simple testcase to trigger badness,
+ and any such testcase would be so dependent on exact vm stack
+ layout that it would be unlikely to work as a testcase following
+ any callframe or register allocation changes anyway.
+
+ Thankfully the new assertion I added should help to catch these
+ failures in future, and triggers on a couple of tests currently.
+
+ * interpreter/CallFrame.cpp:
+ (JSC::CallFrame::registerFile):
+ * interpreter/CallFrame.h:
+ (JSC::ExecState::init):
+ * interpreter/Interpreter.cpp:
+ (JSC::Interpreter::privateExecute):
+ * jit/JITStubs.cpp:
+ (JSC::DEFINE_STUB_FUNCTION):
+
+2010-06-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-06-21 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Use global new/delete operator overloading with USE_SYSTEM_MALLOC=1
+ https://bugs.webkit.org/show_bug.cgi?id=40653
+
+ Currently, other ports do not use global new/delete operator overloading
+ when USE_SYSTEM_MALLOC=1. Brew MP uses system malloc, but it needs to enable
+ "global fastMalloc new" because the default new/delete causes crash on device.
+ We need to replace them with Brew MP's MALLOC/FREE.
+
+ * wtf/FastMalloc.h:
+
+2010-06-18 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Work around a build problem with libjscore on Symbian.
+ https://bugs.webkit.org/show_bug.cgi?id=40840
+
+ Sbsv2 sometimes have problems with debug/release configuration
+ determination causing QtWebKit in release to try linking with the debug
+ JavaScriptCore static library. This patch limit the jscore/jscored
+ r58306 fix necessary for mac builds only to the mac platform to prevent the
+ different name problem.
+
+ The real fix would be to fix qmake or the toolchain, this patch might
+ help meanwhile.
+
+ * JavaScriptCore.pri:
+
+2010-06-21 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kent Tamura.
+
+ Buildfix after r61338.
+ https://bugs.webkit.org/show_bug.cgi?id=40888
+
+ roundUpAllocationSize is needed in RegisterFile.h.
+
+ * jit/ExecutableAllocator.h:
+
+2010-06-19 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Darin Adler.
+
+ Include <string.h> in StringExtras.h
+ https://bugs.webkit.org/show_bug.cgi?id=40808
+
+ Without string.h, RVCT 2.2 can't compile StringExtras.h.
+ It can't find strlen and strncmp.
+
+ * wtf/StringExtras.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Don't use __attribute__((may_alias)) with the Intel compiler,
+ as it doesn't understand it.
+
+ * wtf/Vector.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Fix compilation with the Intel C++ compiler (11.1.072).
+
+ Like RVCT, label pointers must be void*, not const void*.
+
+ * bytecode/Opcode.h:
+
+2010-06-19 Thiago Macieira <thiago.macieira@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add the WTF_COMPILER_INTEL for when the Intel compiler is used
+ for building. Usually, the Intel compiler masquerades as
+ another compiler in the system and gets away with it, but some
+ times specific fixes are required (such as when using language
+ extensions).
+
+ * wtf/Platform.h:
+
+2010-06-18 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Geoffrey Garen.
+
+ Incorrect handling of multiple BOMs scattered through a file.
+ https://bugs.webkit.org/show_bug.cgi?id=40865
+
+ When determining the offset of open and close braces in a source
+ with BOMs we were finishing our count early as we failed to account
+ for BOMs prior to the open/close brace positions effecting those
+ positions.
+
+ * parser/Lexer.cpp:
+ (JSC::Lexer::sourceCode):
+
+2010-06-17 Oliver Hunt <oliver@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Don't throw away exception information for functions that use exceptions
+ https://bugs.webkit.org/show_bug.cgi?id=40786
+
+ Simple patch to stop JSC from throwing away the exception information
+ of a function that uses "exceptiony" features like try and throw. This
+ is a speed up for catching expressions but it's difficult to quantify as
+ the old cost of reparsing is amortised over all exceptions caught in the
+ effected function.
+
+ * bytecode/CodeBlock.cpp:
+ (JSC::CodeBlock::reparseForExceptionInfoIfNecessary):
+ * bytecompiler/BytecodeGenerator.cpp:
+ (JSC::BytecodeGenerator::generate):
+ (JSC::BytecodeGenerator::emitCatch):
+ * bytecompiler/BytecodeGenerator.h:
+ (JSC::BytecodeGenerator::emitThrow):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add PlatformStrategies and PluginStrategy classes.
+ https://bugs.webkit.org/show_bug.cgi?id=40850
+
+ * wtf/Platform.h:
+
+2010-06-18 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Unreviewed build fix.
+
+ * wtf/CMakeLists.txt: Add MD5.cpp.
+
+2010-06-17 Shu Chang <chang.shu@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix the link error on symbian with ENABLE_JIT=0.
+ 1. Add "#if ENABLE(JIT)" in the header file;
+ 2. Put feature enable/disable logic to a common.pri so
+ that both JavaScriptCore.pri and WebCore.pri can share.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40780
+
+ * JavaScriptCore.pri:
+ * jit/ExecutableAllocator.h:
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Use adoptRef and create functions in more code paths
+ https://bugs.webkit.org/show_bug.cgi?id=40760
+
+ * API/JSClassRef.h: Removed unneeded include of RefCounted.h.
+ * API/JSWeakObjectMapRefPrivate.cpp: Ditto.
+
+ * bytecode/CodeBlock.h:
+ (JSC::FunctionCodeBlock::FunctionCodeBlock): Use the
+ SharedSymbolTable::create function instead of calling new directly.
+
+ * runtime/SymbolTable.h: Added a create function to the SharedSymbolTable
+ class and made the constructor private.
+
+2010-06-17 Mark Brand <mabrand@mabrand.nl>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] use "win32-g++*" scope to match all MinGW makespecs
+
+ The scope "win32-g++" comes from the name of the makespec. However, it
+ is frequently used to check for MinGW. This works fine as long as
+ win32-g++ is the only makespec for MinGW. Now we need the wildcard
+ to cover "win32-g++-cross" as well.
+
+ * JavaScriptCore.pro:
+
+2010-06-16 Darin Adler <darin@apple.com>
+
+ Reviewed by David Levin.
+
+ Deploy adoptRef in more places, including all HTML and MathML elements
+ https://bugs.webkit.org/show_bug.cgi?id=39941
+
+ * wtf/ThreadSafeShared.h: Made the constructor protected and removed the
+ unneeded support for initial reference counts other than 1.
+
+2010-06-16 Peter Varga <pvarga@inf.u-szeged.hu>
+
+ Reviewed by Geoffrey Garen.
+
+ Store matchBegin directly in the array of output instead of the stack.
+ https://bugs.webkit.org/show_bug.cgi?id=38988
+
+ * yarr/RegexJIT.cpp:
+ (JSC::Yarr::RegexGenerator::generateDisjunction):
+ (JSC::Yarr::RegexGenerator::generate):
+
+2010-06-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Make JavaScriptCore build with clang++.
+
+ * jit/JITInlineMethods.h:
+ (JSC::JIT::emitPutVirtualRegister):
+ Explicitly cast to an int.
+
+ * yarr/RegexCompiler.cpp:
+ (JSC::Yarr::compileRegex):
+ Return 0 instead of false.
+
+2010-06-15 Adam Roben <aroben@apple.com>
+
+ Make WebCore's and JavaScriptCore's DerivedSources available for debugging in production builds
+
+ Fixes <http://webkit.org/b/40626> <rdar://problem/8094205>.
+
+ Reviewed by Sam Weinig.
+
+ * JavaScriptCore.vcproj/JavaScriptCore.make: Copy the contents of
+ JavaScriptCore's DerivedSources directory to
+ AppleInternal/Sources/JavaScriptCore.
+
+2010-06-15 Gabor Loki <loki@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Fix invalid access to non-static data member warning in JITPropertyAccess32_64 on ARM
+ https://bugs.webkit.org/show_bug.cgi?id=40423
+
+ Using OBJECT_OFFSETOF macro instead of objectof to bypass access to
+ non-static data member warning.
+
+ * jit/JITPropertyAccess32_64.cpp:
+ (JSC::JIT::privateCompilePutByIdTransition):
+
2010-06-11 Eric Seidel <eric@webkit.org>
Reviewed by Adam Barth.
diff --git a/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
index 5b52793..08d9ef9 100644
--- a/JavaScriptCore/Configurations/FeatureDefines.xcconfig
+++ b/JavaScriptCore/Configurations/FeatureDefines.xcconfig
@@ -57,6 +57,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
ENABLE_IMAGE_RESIZER = ;
ENABLE_INDEXED_DATABASE = ;
+ENABLE_INPUT_SPEECH = ;
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
ENABLE_MATHML = ;
ENABLE_METER_TAG = ENABLE_METER_TAG;
@@ -81,4 +82,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/JavaScriptCore/Configurations/Version.xcconfig b/JavaScriptCore/Configurations/Version.xcconfig
index 6f999af..f775a54 100644
--- a/JavaScriptCore/Configurations/Version.xcconfig
+++ b/JavaScriptCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 1;
+MINOR_VERSION = 2;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/JavaScriptCore/GNUmakefile.am b/JavaScriptCore/GNUmakefile.am
index a9c19c6..957c743 100644
--- a/JavaScriptCore/GNUmakefile.am
+++ b/JavaScriptCore/GNUmakefile.am
@@ -381,6 +381,9 @@ javascriptcore_sources += \
JavaScriptCore/bytecompiler/LabelScope.h \
JavaScriptCore/debugger/Debugger.cpp \
JavaScriptCore/debugger/Debugger.h \
+ JavaScriptCore/parser/ASTBuilder.h \
+ JavaScriptCore/parser/JSParser.cpp \
+ JavaScriptCore/parser/JSParser.h \
JavaScriptCore/parser/Lexer.cpp \
JavaScriptCore/parser/Lexer.h \
JavaScriptCore/parser/NodeConstructors.h \
@@ -394,6 +397,7 @@ javascriptcore_sources += \
JavaScriptCore/parser/ResultType.h \
JavaScriptCore/parser/SourceCode.h \
JavaScriptCore/parser/SourceProvider.h \
+ JavaScriptCore/parser/SyntaxChecker.h \
JavaScriptCore/runtime/ArgList.cpp \
JavaScriptCore/runtime/ArgList.h \
JavaScriptCore/runtime/Arguments.cpp \
@@ -515,8 +519,11 @@ javascriptcore_sources += \
JavaScriptCore/runtime/PutPropertySlot.h \
JavaScriptCore/runtime/RegExp.cpp \
JavaScriptCore/runtime/RegExp.h \
+ JavaScriptCore/runtime/RegExpCache.cpp \
+ JavaScriptCore/runtime/RegExpCache.h \
JavaScriptCore/runtime/RegExpConstructor.cpp \
JavaScriptCore/runtime/RegExpConstructor.h \
+ JavaScriptCore/runtime/RegExpKey.h \
JavaScriptCore/runtime/RegExpMatchesArray.h \
JavaScriptCore/runtime/RegExpObject.cpp \
JavaScriptCore/runtime/RegExpObject.h \
diff --git a/JavaScriptCore/JavaScriptCore.gypi b/JavaScriptCore/JavaScriptCore.gypi
index c54ff17..066e1ff 100644
--- a/JavaScriptCore/JavaScriptCore.gypi
+++ b/JavaScriptCore/JavaScriptCore.gypi
@@ -130,6 +130,9 @@
'jsc.cpp',
'os-win32/stdbool.h',
'os-win32/stdint.h',
+ 'parser/ASTBuilder.h',
+ 'parser/JSParser.cpp',
+ 'parser/JSParser.h',
'parser/Lexer.cpp',
'parser/Lexer.h',
'parser/NodeConstructors.h',
@@ -143,6 +146,7 @@
'parser/ResultType.h',
'parser/SourceCode.h',
'parser/SourceProvider.h',
+ 'parser/SyntaxChecker.h',
'pcre/pcre.h',
'pcre/pcre_compile.cpp',
'pcre/pcre_exec.cpp',
@@ -305,8 +309,11 @@
'runtime/PutPropertySlot.h',
'runtime/RegExp.cpp',
'runtime/RegExp.h',
+ 'runtime/RegExpCache.cpp',
+ 'runtime/RegExpCache.h',
'runtime/RegExpConstructor.cpp',
'runtime/RegExpConstructor.h',
+ 'runtime/RegExpKey.h',
'runtime/RegExpMatchesArray.h',
'runtime/RegExpObject.cpp',
'runtime/RegExpObject.h',
diff --git a/JavaScriptCore/JavaScriptCore.pri b/JavaScriptCore/JavaScriptCore.pri
index 09dba2f..8ef9b30 100644
--- a/JavaScriptCore/JavaScriptCore.pri
+++ b/JavaScriptCore/JavaScriptCore.pri
@@ -1,14 +1,17 @@
# JavaScriptCore - Qt4 build info
+
+include(../common.pri)
+
VPATH += $$PWD
-!CONFIG(release, debug|release) {
- # Output in JavaScriptCore/<config>
- JAVASCRIPTCORE_DESTDIR = debug
- # Use a config-specific target to prevent parallel builds file clashes on Mac
- JAVASCRIPTCORE_TARGET = jscored
-} else {
- JAVASCRIPTCORE_DESTDIR = release
- JAVASCRIPTCORE_TARGET = jscore
-}
+
+# Use a config-specific target to prevent parallel builds file clashes on Mac
+mac: CONFIG(debug, debug|release): JAVASCRIPTCORE_TARGET = jscored
+else: JAVASCRIPTCORE_TARGET = jscore
+
+# Output in JavaScriptCore/<config>
+CONFIG(debug, debug|release) : JAVASCRIPTCORE_DESTDIR = debug
+else: JAVASCRIPTCORE_DESTDIR = release
+
CONFIG(standalone_package) {
isEmpty(JSC_GENERATED_SOURCES_DIR):JSC_GENERATED_SOURCES_DIR = $$PWD/generated
} else {
@@ -51,9 +54,6 @@ win32-*: DEFINES += _HAS_TR1=0
DEFINES += BUILDING_QT__ BUILDING_JavaScriptCore BUILDING_WTF
-contains(JAVASCRIPTCORE_JIT,yes): DEFINES+=ENABLE_JIT=1
-contains(JAVASCRIPTCORE_JIT,no): DEFINES+=ENABLE_JIT=0
-
wince* {
INCLUDEPATH += $$QT_SOURCE_TREE/src/3rdparty/ce-compat
DEFINES += WINCEBASIC
diff --git a/JavaScriptCore/JavaScriptCore.pro b/JavaScriptCore/JavaScriptCore.pro
index a3d8358..8ee4f09 100644
--- a/JavaScriptCore/JavaScriptCore.pro
+++ b/JavaScriptCore/JavaScriptCore.pro
@@ -43,7 +43,7 @@ CONFIG(QTDIR_build) {
}
# Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
-win32-g++ {
+win32-g++* {
TMPPATH = $$quote($$(INCLUDE))
QMAKE_INCDIR_POST += $$split(TMPPATH,";")
TMPPATH = $$quote($$(LIB))
@@ -109,6 +109,7 @@ SOURCES += \
jit/JITPropertyAccess32_64.cpp \
jit/JITStubs.cpp \
jit/ThunkGenerators.cpp \
+ parser/JSParser.cpp \
parser/Lexer.cpp \
parser/Nodes.cpp \
parser/ParserArena.cpp \
@@ -191,6 +192,7 @@ SOURCES += \
runtime/RegExp.cpp \
runtime/RegExpObject.cpp \
runtime/RegExpPrototype.cpp \
+ runtime/RegExpCache.cpp \
runtime/RopeImpl.cpp \
runtime/ScopeChain.cpp \
runtime/SmallStrings.cpp \
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make
index 806894a..4c47ac6 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore.make
@@ -31,3 +31,5 @@ install:
xcopy "$(OBJROOT)\include\*" "$(DSTROOT)\AppleInternal\include\" /e/v/i/h/y
xcopy "$(OBJROOT)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\JavaScriptCore.resources\*" "$(DSTROOT)\AppleInternal\bin\JavaScriptCore.resources" /e/v/i/h/y
+ -mkdir "$(DSTROOT)\AppleInternal\Sources\JavaScriptCore"
+ xcopy "$(OBJROOT)\obj\JavaScriptCore\DerivedSources\*" "$(DSTROOT)\AppleInternal\Sources\WebCore" /e/v/i/h/y
diff --git a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
index effce51..8117f78 100644
--- a/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
+++ b/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
@@ -1089,6 +1089,14 @@
>
</File>
<File
+ RelativePath="..\..\runtime\RegExpCache.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\runtime\RegExpCache.h"
+ >
+ </File>
+ <File
RelativePath="..\..\runtime\RegExpConstructor.cpp"
>
</File>
@@ -1097,6 +1105,10 @@
>
</File>
<File
+ RelativePath="..\..\runtime\RegExpKey.h"
+ >
+ </File>
+ <File
RelativePath="..\..\runtime\RegExpMatchesArray.h"
>
</File>
@@ -1789,6 +1801,18 @@
Name="parser"
>
<File
+ RelativePath="..\..\parser\ASTBuilder.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\parser\JSParser.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\parser\JSParser.h"
+ >
+ </File>
+ <File
RelativePath="..\..\parser\Lexer.cpp"
>
</File>
@@ -1840,6 +1864,10 @@
RelativePath="..\..\parser\SourceProvider.h"
>
</File>
+ <File
+ RelativePath="..\..\parser\SyntaxChecker.h"
+ >
+ </File>
</Filter>
<Filter
Name="Derived Sources"
diff --git a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
index 3b448c5..bc58f5d 100644
--- a/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
+++ b/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
@@ -293,6 +293,9 @@
969A079B0ED1D3AE00F1F681 /* Opcode.h in Headers */ = {isa = PBXBuildFile; fileRef = 969A07950ED1D3AE00F1F681 /* Opcode.h */; settings = {ATTRIBUTES = (Private, ); }; };
96DD73790F9DA3100027FBCC /* VMTags.h in Headers */ = {isa = PBXBuildFile; fileRef = 96DD73780F9DA3100027FBCC /* VMTags.h */; settings = {ATTRIBUTES = (Private, ); }; };
971EDEA61169E0D3005E4262 /* Terminator.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F6903A1169DF7F00A6BB46 /* Terminator.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1712B3A11C7B212007A5315 /* RegExpCache.cpp */; };
+ A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B3E11C7B228007A5315 /* RegExpCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */ = {isa = PBXBuildFile; fileRef = A1712B4011C7B235007A5315 /* RegExpKey.h */; settings = {ATTRIBUTES = (Private, ); }; };
A71236E51195F33C00BD2174 /* JITOpcodes32_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */; };
A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; };
A72701B90DADE94900E548D7 /* ExceptionHelpers.h in Headers */ = {isa = PBXBuildFile; fileRef = A72701B30DADE94900E548D7 /* ExceptionHelpers.h */; };
@@ -313,6 +316,10 @@
A782F1A50EEC9FA20036273F /* ExecutableAllocatorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A782F1A40EEC9FA20036273F /* ExecutableAllocatorPosix.cpp */; };
A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A783A0D011A36DCA00563D20 /* JSObjectWithGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A783A2AA11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp */; };
+ A784A26111D16622005776AC /* ASTBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */; };
+ A784A26211D16622005776AC /* JSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A7EE7511B98B8D0065A14F /* JSParser.cpp */; };
+ A784A26311D16622005776AC /* JSParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7611B98B8D0065A14F /* JSParser.h */; };
+ A784A26411D16622005776AC /* SyntaxChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */; };
A791EF280F11E07900AE1F68 /* JSByteArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A791EF260F11E07900AE1F68 /* JSByteArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
A791EF290F11E07900AE1F68 /* JSByteArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A791EF270F11E07900AE1F68 /* JSByteArray.cpp */; };
A7A1F7AC0F252B3C00E184E2 /* ByteArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */; };
@@ -888,6 +895,9 @@
969A09220ED1E09C00F1F681 /* Completion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Completion.cpp; sourceTree = "<group>"; };
96DD73780F9DA3100027FBCC /* VMTags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VMTags.h; sourceTree = "<group>"; };
97F6903A1169DF7F00A6BB46 /* Terminator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Terminator.h; sourceTree = "<group>"; };
+ A1712B3A11C7B212007A5315 /* RegExpCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegExpCache.cpp; sourceTree = "<group>"; };
+ A1712B3E11C7B228007A5315 /* RegExpCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpCache.h; sourceTree = "<group>"; };
+ A1712B4011C7B235007A5315 /* RegExpKey.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpKey.h; sourceTree = "<group>"; };
A71236E41195F33C00BD2174 /* JITOpcodes32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITOpcodes32_64.cpp; sourceTree = "<group>"; };
A718F61A11754A21002465A7 /* RegExpJitTables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpJitTables.h; sourceTree = "<group>"; };
A718F8211178EB4B002465A7 /* create_regex_tables */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = create_regex_tables; sourceTree = "<group>"; };
@@ -915,6 +925,10 @@
A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSObjectRefPrivate.h; sourceTree = "<group>"; };
A7A1F7AA0F252B3C00E184E2 /* ByteArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ByteArray.cpp; sourceTree = "<group>"; };
A7A1F7AB0F252B3C00E184E2 /* ByteArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ByteArray.h; sourceTree = "<group>"; };
+ A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASTBuilder.h; sourceTree = "<group>"; };
+ A7A7EE7511B98B8D0065A14F /* JSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSParser.cpp; sourceTree = "<group>"; };
+ A7A7EE7611B98B8D0065A14F /* JSParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSParser.h; sourceTree = "<group>"; };
+ A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SyntaxChecker.h; sourceTree = "<group>"; };
A7B48DB50EE74CFC00DCBDB6 /* ExecutableAllocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecutableAllocator.h; sourceTree = "<group>"; };
A7B48DB60EE74CFC00DCBDB6 /* ExecutableAllocator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableAllocator.cpp; sourceTree = "<group>"; };
A7C1E8C8112E701C00A37F98 /* JITPropertyAccess32_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPropertyAccess32_64.cpp; sourceTree = "<group>"; };
@@ -1516,7 +1530,10 @@
7E39D8370EC3A388003AF11A /* parser */ = {
isa = PBXGroup;
children = (
+ A7A7EE7411B98B8D0065A14F /* ASTBuilder.h */,
933A3499038AE7C6008635CE /* Grammar.y */,
+ A7A7EE7511B98B8D0065A14F /* JSParser.cpp */,
+ A7A7EE7611B98B8D0065A14F /* JSParser.h */,
93F1981A08245AAE001E9ABC /* Keywords.table */,
F692A8650255597D01FF60F7 /* Lexer.cpp */,
F692A8660255597D01FF60F7 /* Lexer.h */,
@@ -1531,6 +1548,7 @@
869EBCB60E8C6D4A008722CC /* ResultType.h */,
65E866EE0DD59AFA00A2B2A1 /* SourceCode.h */,
65E866ED0DD59AFA00A2B2A1 /* SourceProvider.h */,
+ A7A7EE7711B98B8D0065A14F /* SyntaxChecker.h */,
);
path = parser;
sourceTree = "<group>";
@@ -1538,6 +1556,9 @@
7EF6E0BB0EB7A1EC0079AFAF /* runtime */ = {
isa = PBXGroup;
children = (
+ A1712B4011C7B235007A5315 /* RegExpKey.h */,
+ A1712B3E11C7B228007A5315 /* RegExpCache.h */,
+ A1712B3A11C7B212007A5315 /* RegExpCache.cpp */,
BCF605110E203EF800B9A64D /* ArgList.cpp */,
BCF605120E203EF800B9A64D /* ArgList.h */,
BC257DE50E1F51C50016B6C9 /* Arguments.cpp */,
@@ -2166,6 +2187,11 @@
86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */,
A783A0D111A36DCA00563D20 /* JSObjectWithGlobalObject.h in Headers */,
BC01D4F211A8F1FF00A54B2A /* JSZombie.h in Headers */,
+ A1712B3F11C7B228007A5315 /* RegExpCache.h in Headers */,
+ A1712B4111C7B235007A5315 /* RegExpKey.h in Headers */,
+ A784A26111D16622005776AC /* ASTBuilder.h in Headers */,
+ A784A26311D16622005776AC /* JSParser.h in Headers */,
+ A784A26411D16622005776AC /* SyntaxChecker.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2605,6 +2631,8 @@
146FE51211A710430087AE66 /* JITCall32_64.cpp in Sources */,
A783A2AB11A5BE8400563D20 /* JSObjectWithGlobalObject.cpp in Sources */,
BC01D4F111A8F1FF00A54B2A /* JSZombie.cpp in Sources */,
+ A1712B3B11C7B212007A5315 /* RegExpCache.cpp in Sources */,
+ A784A26211D16622005776AC /* JSParser.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/JavaScriptCore/assembler/AssemblerBuffer.h b/JavaScriptCore/assembler/AssemblerBuffer.h
index e2fb8a1..11e0df0 100644
--- a/JavaScriptCore/assembler/AssemblerBuffer.h
+++ b/JavaScriptCore/assembler/AssemblerBuffer.h
@@ -37,13 +37,14 @@
namespace JSC {
class AssemblerBuffer {
- static const int inlineCapacity = 256;
+ static const int inlineCapacity = 128 - sizeof(char*) - 2 * sizeof(int);
public:
AssemblerBuffer()
: m_buffer(m_inlineBuffer)
, m_capacity(inlineCapacity)
, m_size(0)
{
+ COMPILE_ASSERT(sizeof(AssemblerBuffer) == 128, AssemblerBuffer_should_be_128_bytes);
}
~AssemblerBuffer()
diff --git a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
index b1c537e..599be14 100644
--- a/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
+++ b/JavaScriptCore/assembler/AssemblerBufferWithConstantPool.h
@@ -190,6 +190,8 @@ public:
void putIntWithConstantInt(uint32_t insn, uint32_t constant, bool isReusable = false)
{
+ if (!m_numConsts)
+ m_maxDistance = maxPoolSize;
flushIfNoSpaceFor(4, 4);
m_loadOffsets.append(AssemblerBuffer::size());
@@ -279,7 +281,6 @@ private:
m_loadOffsets.clear();
m_numConsts = 0;
- m_maxDistance = maxPoolSize;
}
void flushIfNoSpaceFor(int nextInsnSize)
diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp
index df3ca7b..30d101c 100644
--- a/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1519,11 +1519,12 @@ void CodeBlock::markAggregate(MarkStack& markStack)
m_functionDecls[i]->markAggregate(markStack);
}
-void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame)
+bool CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame)
{
if (m_exceptionInfo)
- return;
+ return true;
+ ASSERT(!m_rareData || !m_rareData->m_exceptionHandlers.size());
ScopeChainNode* scopeChain = callFrame->scopeChain();
if (m_needsFullScopeChain) {
ScopeChain sc(scopeChain);
@@ -1538,6 +1539,7 @@ void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame)
}
m_exceptionInfo.set(m_ownerExecutable->reparseExceptionInfo(m_globalData, scopeChain, this));
+ return m_exceptionInfo;
}
HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
@@ -1562,11 +1564,8 @@ int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned byteco
{
ASSERT(bytecodeOffset < m_instructionCount);
- reparseForExceptionInfoIfNecessary(callFrame);
- ASSERT(m_exceptionInfo);
-
- if (!m_exceptionInfo->m_lineInfo.size())
- return m_ownerExecutable->source().firstLine(); // Empty function
+ if (!reparseForExceptionInfoIfNecessary(callFrame) || !m_exceptionInfo->m_lineInfo.size())
+ return m_ownerExecutable->source().firstLine(); // Empty function or unable to reparse
int low = 0;
int high = m_exceptionInfo->m_lineInfo.size();
@@ -1587,11 +1586,9 @@ int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned b
{
ASSERT(bytecodeOffset < m_instructionCount);
- reparseForExceptionInfoIfNecessary(callFrame);
- ASSERT(m_exceptionInfo);
-
- if (!m_exceptionInfo->m_expressionInfo.size()) {
+ if (!reparseForExceptionInfoIfNecessary(callFrame) || !m_exceptionInfo->m_expressionInfo.size()) {
// We didn't think anything could throw. Apparently we were wrong.
+ // Alternatively something went wrong when trying to reparse
startOffset = 0;
endOffset = 0;
divot = 0;
@@ -1626,10 +1623,7 @@ bool CodeBlock::getByIdExceptionInfoForBytecodeOffset(CallFrame* callFrame, unsi
{
ASSERT(bytecodeOffset < m_instructionCount);
- reparseForExceptionInfoIfNecessary(callFrame);
- ASSERT(m_exceptionInfo);
-
- if (!m_exceptionInfo->m_getByIdExceptionInfo.size())
+ if (!reparseForExceptionInfoIfNecessary(callFrame) || !m_exceptionInfo->m_getByIdExceptionInfo.size())
return false;
int low = 0;
diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h
index 27e56c6..590fe2e 100644
--- a/JavaScriptCore/bytecode/CodeBlock.h
+++ b/JavaScriptCore/bytecode/CodeBlock.h
@@ -351,7 +351,8 @@ namespace JSC {
unsigned bytecodeOffset(CallFrame* callFrame, ReturnAddressPtr returnAddress)
{
- reparseForExceptionInfoIfNecessary(callFrame);
+ if (!reparseForExceptionInfoIfNecessary(callFrame))
+ return 1;
return binaryChop<CallReturnOffsetToBytecodeOffset, unsigned, getCallReturnOffset>(callReturnIndexVector().begin(), callReturnIndexVector().size(), getJITCode().offsetOf(returnAddress.value()))->bytecodeOffset;
}
@@ -521,7 +522,7 @@ namespace JSC {
void printPutByIdOp(ExecState*, int location, Vector<Instruction>::const_iterator&, const char* op) const;
#endif
- void reparseForExceptionInfoIfNecessary(CallFrame*);
+ bool reparseForExceptionInfoIfNecessary(CallFrame*) WARN_UNUSED_RETURN;
void createRareDataIfNecessary()
{
@@ -655,7 +656,7 @@ namespace JSC {
// symbol table, so we just pass as a raw pointer with a ref count of 1. We then manually deref
// in the destructor.
FunctionCodeBlock(FunctionExecutable* ownerExecutable, CodeType codeType, PassRefPtr<SourceProvider> sourceProvider, unsigned sourceOffset, bool isConstructor)
- : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, new SharedSymbolTable, isConstructor)
+ : CodeBlock(ownerExecutable, codeType, sourceProvider, sourceOffset, SharedSymbolTable::create().releaseRef(), isConstructor)
{
}
~FunctionCodeBlock()
diff --git a/JavaScriptCore/bytecode/Opcode.h b/JavaScriptCore/bytecode/Opcode.h
index 81fff99..f845a34 100644
--- a/JavaScriptCore/bytecode/Opcode.h
+++ b/JavaScriptCore/bytecode/Opcode.h
@@ -211,7 +211,7 @@ namespace JSC {
#undef VERIFY_OPCODE_ID
#if HAVE(COMPUTED_GOTO)
-#if COMPILER(RVCT)
+#if COMPILER(RVCT) || COMPILER(INTEL)
typedef void* Opcode;
#else
typedef const void* Opcode;
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
index 777e1e6..16ef357 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
@@ -156,7 +156,7 @@ void BytecodeGenerator::generate()
m_codeBlock->setIsNumericCompareFunction(instructions() == m_globalData->numericCompareFunction(m_scopeChain->globalObject()->globalExec()));
#if !ENABLE(OPCODE_SAMPLING)
- if (!m_regeneratingForExceptionInfo && (m_codeType == FunctionCode || m_codeType == EvalCode))
+ if (!m_regeneratingForExceptionInfo && !m_usesExceptions && (m_codeType == FunctionCode || m_codeType == EvalCode))
m_codeBlock->clearExceptionInfo();
#endif
@@ -219,6 +219,7 @@ BytecodeGenerator::BytecodeGenerator(ProgramNode* programNode, const Debugger* d
, m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
, m_lastOpcodeID(op_end)
, m_emitNodeDepth(0)
+ , m_usesExceptions(false)
, m_regeneratingForExceptionInfo(false)
, m_codeBlockBeingRegeneratedFrom(0)
{
@@ -304,6 +305,7 @@ BytecodeGenerator::BytecodeGenerator(FunctionBodyNode* functionBody, const Debug
, m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
, m_lastOpcodeID(op_end)
, m_emitNodeDepth(0)
+ , m_usesExceptions(false)
, m_regeneratingForExceptionInfo(false)
, m_codeBlockBeingRegeneratedFrom(0)
{
@@ -405,6 +407,7 @@ BytecodeGenerator::BytecodeGenerator(EvalNode* evalNode, const Debugger* debugge
, m_globalData(&scopeChain.globalObject()->globalExec()->globalData())
, m_lastOpcodeID(op_end)
, m_emitNodeDepth(0)
+ , m_usesExceptions(false)
, m_regeneratingForExceptionInfo(false)
, m_codeBlockBeingRegeneratedFrom(0)
{
@@ -1842,6 +1845,7 @@ RegisterID* BytecodeGenerator::emitNextPropertyName(RegisterID* dst, RegisterID*
RegisterID* BytecodeGenerator::emitCatch(RegisterID* targetRegister, Label* start, Label* end)
{
+ m_usesExceptions = true;
#if ENABLE(JIT)
HandlerInfo info = { start->bind(0, 0), end->bind(0, 0), instructions().size(), m_dynamicScopeDepth + m_baseScopeDepth, CodeLocationLabel() };
#else
diff --git a/JavaScriptCore/bytecompiler/BytecodeGenerator.h b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
index 8f0ce34..8b6ab77 100644
--- a/JavaScriptCore/bytecompiler/BytecodeGenerator.h
+++ b/JavaScriptCore/bytecompiler/BytecodeGenerator.h
@@ -363,7 +363,12 @@ namespace JSC {
RegisterID* emitNextPropertyName(RegisterID* dst, RegisterID* base, RegisterID* i, RegisterID* size, RegisterID* iter, Label* target);
RegisterID* emitCatch(RegisterID*, Label* start, Label* end);
- void emitThrow(RegisterID* exc) { emitUnaryNoDstOp(op_throw, exc); }
+ void emitThrow(RegisterID* exc)
+ {
+ m_usesExceptions = true;
+ emitUnaryNoDstOp(op_throw, exc);
+ }
+
RegisterID* emitNewError(RegisterID* dst, bool isReferenceError, JSValue message);
void emitPushNewScope(RegisterID* dst, const Identifier& property, RegisterID* value);
@@ -552,6 +557,7 @@ namespace JSC {
unsigned m_emitNodeDepth;
+ bool m_usesExceptions;
bool m_regeneratingForExceptionInfo;
CodeBlock* m_codeBlockBeingRegeneratedFrom;
diff --git a/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index 765230e..cdf3e49 100644
--- a/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -39,6 +39,7 @@
#include "Operations.h"
#include "Parser.h"
#include "PropertyNameArray.h"
+#include "RegExpCache.h"
#include "RegExpObject.h"
#include "SamplingTool.h"
#include <wtf/Assertions.h>
@@ -144,7 +145,7 @@ RegisterID* StringNode::emitBytecode(BytecodeGenerator& generator, RegisterID* d
RegisterID* RegExpNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
{
- RefPtr<RegExp> regExp = RegExp::create(generator.globalData(), m_pattern.ustring(), m_flags.ustring());
+ RefPtr<RegExp> regExp = generator.globalData()->regExpCache()->lookupOrCreate(m_pattern.ustring(), m_flags.ustring());
if (!regExp->isValid())
return emitThrowError(generator, false, "Invalid regular expression: %s", regExp->errorMessage());
if (dst == generator.ignoredResult())
diff --git a/JavaScriptCore/create_jit_stubs b/JavaScriptCore/create_jit_stubs
index 4d510ea..9bb9ee5 100644
--- a/JavaScriptCore/create_jit_stubs
+++ b/JavaScriptCore/create_jit_stubs
@@ -42,6 +42,7 @@ $file = $ARGV[0];
die "$usage\n" unless ($prefix and $file);
my $stub_template = "";
+my $output_end = "";
my $stub = "";
my $rtype = "";
@@ -51,9 +52,17 @@ print STDERR "Creating JIT stubs for $file \n";
open(IN, $file) or die "No such file $file";
while ( $_ = <IN> ) {
+ if ( /^$prefix\_BEGIN\((.*)\)/ ) {
+ $stub = $1;
+ $stub =~ s/$offset_template/$offset/g;
+ print $stub . "\n";
+ }
if ( /^$prefix\((.*)\)/ ) {
$stub_template .= $1 . "\n";
}
+ if ( /^$prefix\_END\((.*)\)/ ) {
+ $output_end .= $1 . "\n";
+ }
if ( /^DEFINE_STUB_FUNCTION\((.*), (.*)\)/ ) {
$stub = $stub_template;
$rtype = quotemeta($1);
@@ -66,4 +75,6 @@ while ( $_ = <IN> ) {
}
}
+print $output_end;
+
close(IN);
diff --git a/JavaScriptCore/interpreter/CallFrame.cpp b/JavaScriptCore/interpreter/CallFrame.cpp
index f53e6f4..ff061db 100644
--- a/JavaScriptCore/interpreter/CallFrame.cpp
+++ b/JavaScriptCore/interpreter/CallFrame.cpp
@@ -42,6 +42,12 @@ void CallFrame::dumpCaller()
interpreter()->retrieveLastCaller(this, signedLineNumber, sourceID, urlString, function);
printf("Callpoint => %s:%d\n", urlString.ascii(), signedLineNumber);
}
+
+RegisterFile* CallFrame::registerFile()
+{
+ return &interpreter()->registerFile();
+}
+
#endif
}
diff --git a/JavaScriptCore/interpreter/CallFrame.h b/JavaScriptCore/interpreter/CallFrame.h
index 723d4ae..7ea59fb 100644
--- a/JavaScriptCore/interpreter/CallFrame.h
+++ b/JavaScriptCore/interpreter/CallFrame.h
@@ -117,6 +117,7 @@ namespace JSC {
CallFrame* callerFrame, int argc, JSObject* callee)
{
ASSERT(callerFrame); // Use noCaller() rather than 0 for the outer host call frame caller.
+ ASSERT(callerFrame == noCaller() || callerFrame->removeHostCallFrameFlag()->registerFile()->end() >= this);
setCodeBlock(codeBlock);
setScopeChain(scopeChain);
@@ -155,7 +156,9 @@ namespace JSC {
private:
static const intptr_t HostCallFrameFlag = 1;
-
+#ifndef NDEBUG
+ RegisterFile* registerFile();
+#endif
ExecState();
~ExecState();
};
diff --git a/JavaScriptCore/interpreter/Interpreter.cpp b/JavaScriptCore/interpreter/Interpreter.cpp
index 91f5c0a..7c5bc6f 100644
--- a/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/JavaScriptCore/interpreter/Interpreter.cpp
@@ -456,7 +456,6 @@ void Interpreter::dumpRegisters(CallFrame* callFrame)
printf("[ScopeChain] | %10p | %p \n", it, (*it).scopeChain()); ++it;
printf("[CallerRegisters] | %10p | %d \n", it, (*it).i()); ++it;
printf("[ReturnPC] | %10p | %p \n", it, (*it).vPC()); ++it;
- ++it;
printf("[ArgumentCount] | %10p | %d \n", it, (*it).i()); ++it;
printf("[Callee] | %10p | %p \n", it, (*it).function()); ++it;
printf("-----------------------------------------------------------------------------\n");
@@ -643,6 +642,10 @@ JSValue Interpreter::execute(ProgramExecutable* program, CallFrame* callFrame, S
}
CodeBlock* codeBlock = &program->bytecode(callFrame, scopeChain);
+ if (!codeBlock) {
+ *exception = createStackOverflowError(callFrame);
+ return jsNull();
+ }
Register* oldEnd = m_registerFile.end();
Register* newEnd = oldEnd + codeBlock->m_numParameters + RegisterFile::CallFrameHeaderSize + codeBlock->m_numCalleeRegisters;
@@ -722,9 +725,12 @@ JSValue Interpreter::executeCall(CallFrame* callFrame, JSObject* function, CallT
if (callType == CallTypeJS) {
ScopeChainNode* callDataScopeChain = callData.js.scopeChain;
- CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
+ CodeBlock* newCodeBlock = callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
- newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
+ if (newCodeBlock)
+ newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
+ else
+ newCallFrame = 0;
if (UNLIKELY(!newCallFrame)) {
*exception = createStackOverflowError(callFrame);
m_registerFile.shrink(oldEnd);
@@ -811,9 +817,12 @@ JSObject* Interpreter::executeConstruct(CallFrame* callFrame, JSObject* construc
if (constructType == ConstructTypeJS) {
ScopeChainNode* constructDataScopeChain = constructData.js.scopeChain;
- CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecodeForConstruct(callFrame, constructDataScopeChain);
+ CodeBlock* newCodeBlock = constructData.js.functionExecutable->bytecodeForConstruct(callFrame, constructDataScopeChain);
+ if (newCodeBlock)
+ newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
+ else
+ newCallFrame = 0;
- newCallFrame = slideRegisterWindowForCall(newCodeBlock, &m_registerFile, newCallFrame, registerOffset, argCount);
if (UNLIKELY(!newCallFrame)) {
*exception = createStackOverflowError(callFrame);
m_registerFile.shrink(oldEnd);
@@ -902,8 +911,11 @@ CallFrameClosure Interpreter::prepareForRepeatCall(FunctionExecutable* FunctionE
for (int i = 0; i < argc; ++i)
newCallFrame->r(++dst) = jsUndefined();
- CodeBlock* codeBlock = &FunctionExecutable->bytecodeForCall(callFrame, scopeChain);
- newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
+ CodeBlock* codeBlock = FunctionExecutable->bytecodeForCall(callFrame, scopeChain);
+ if (codeBlock)
+ newCallFrame = slideRegisterWindowForCall(codeBlock, &m_registerFile, newCallFrame, argc + RegisterFile::CallFrameHeaderSize, argc);
+ else
+ newCallFrame = 0;
if (UNLIKELY(!newCallFrame)) {
*exception = createStackOverflowError(callFrame);
m_registerFile.shrink(oldEnd);
@@ -968,6 +980,10 @@ JSValue Interpreter::execute(EvalExecutable* eval, CallFrame* callFrame, JSObjec
DynamicGlobalObjectScope globalObjectScope(callFrame, scopeChain->globalObject);
EvalCodeBlock* codeBlock = &eval->bytecode(callFrame, scopeChain);
+ if (!codeBlock) {
+ *exception = createStackOverflowError(callFrame);
+ return jsNull();
+ }
JSVariableObject* variableObject;
for (ScopeChainNode* node = scopeChain; ; node = node->next) {
@@ -3619,11 +3635,13 @@ skip_id_custom_self:
if (callType == CallTypeJS) {
ScopeChainNode* callDataScopeChain = callData.js.scopeChain;
- CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
+ CodeBlock* newCodeBlock = callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
CallFrame* previousCallFrame = callFrame;
-
- callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+ if (newCodeBlock)
+ callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+ else
+ callFrame = 0;
if (UNLIKELY(!callFrame)) {
callFrame = previousCallFrame;
exceptionValue = createStackOverflowError(callFrame);
@@ -3645,6 +3663,11 @@ skip_id_custom_self:
if (callType == CallTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+ if (!registerFile->grow(newCallFrame->registers())) {
+ exceptionValue = createStackOverflowError(callFrame);
+ goto vm_throw;
+ }
+
newCallFrame->init(0, vPC + OPCODE_LENGTH(op_call), scopeChain, callFrame, argCount, asObject(v));
JSValue returnValue;
@@ -3766,11 +3789,13 @@ skip_id_custom_self:
if (callType == CallTypeJS) {
ScopeChainNode* callDataScopeChain = callData.js.scopeChain;
- CodeBlock* newCodeBlock = &callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
+ CodeBlock* newCodeBlock = callData.js.functionExecutable->bytecodeForCall(callFrame, callDataScopeChain);
CallFrame* previousCallFrame = callFrame;
-
- callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+ if (newCodeBlock)
+ callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+ else
+ callFrame = 0;
if (UNLIKELY(!callFrame)) {
callFrame = previousCallFrame;
exceptionValue = createStackOverflowError(callFrame);
@@ -3792,6 +3817,10 @@ skip_id_custom_self:
if (callType == CallTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+ if (!registerFile->grow(newCallFrame->registers())) {
+ exceptionValue = createStackOverflowError(callFrame);
+ goto vm_throw;
+ }
newCallFrame->init(0, vPC + OPCODE_LENGTH(op_call_varargs), scopeChain, callFrame, argCount, asObject(v));
JSValue returnValue;
@@ -4085,11 +4114,15 @@ skip_id_custom_self:
if (constructType == ConstructTypeJS) {
ScopeChainNode* callDataScopeChain = constructData.js.scopeChain;
- CodeBlock* newCodeBlock = &constructData.js.functionExecutable->bytecodeForConstruct(callFrame, callDataScopeChain);
+ CodeBlock* newCodeBlock = constructData.js.functionExecutable->bytecodeForConstruct(callFrame, callDataScopeChain);
CallFrame* previousCallFrame = callFrame;
- callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+ if (newCodeBlock)
+ callFrame = slideRegisterWindowForCall(newCodeBlock, registerFile, callFrame, registerOffset, argCount);
+ else
+ callFrame = 0;
+
if (UNLIKELY(!callFrame)) {
callFrame = previousCallFrame;
exceptionValue = createStackOverflowError(callFrame);
@@ -4110,6 +4143,10 @@ skip_id_custom_self:
if (constructType == ConstructTypeHost) {
ScopeChainNode* scopeChain = callFrame->scopeChain();
CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + registerOffset);
+ if (!registerFile->grow(newCallFrame->registers())) {
+ exceptionValue = createStackOverflowError(callFrame);
+ goto vm_throw;
+ }
newCallFrame->init(0, vPC + OPCODE_LENGTH(op_construct), scopeChain, callFrame, argCount, asObject(v));
JSValue returnValue;
diff --git a/JavaScriptCore/jit/ExecutableAllocator.h b/JavaScriptCore/jit/ExecutableAllocator.h
index 610b788..703f63f 100644
--- a/JavaScriptCore/jit/ExecutableAllocator.h
+++ b/JavaScriptCore/jit/ExecutableAllocator.h
@@ -25,7 +25,6 @@
#ifndef ExecutableAllocator_h
#define ExecutableAllocator_h
-
#include <stddef.h> // for ptrdiff_t
#include <limits>
#include <wtf/Assertions.h>
@@ -80,7 +79,7 @@ inline size_t roundUpAllocationSize(size_t request, size_t granularity)
}
-#if ENABLE(ASSEMBLER)
+#if ENABLE(JIT) && ENABLE(ASSEMBLER)
namespace JSC {
@@ -316,6 +315,6 @@ inline void* ExecutablePool::poolAllocate(size_t n)
}
-#endif // ENABLE(ASSEMBLER)
+#endif // ENABLE(JIT) && ENABLE(ASSEMBLER)
#endif // !defined(ExecutableAllocator)
diff --git a/JavaScriptCore/jit/JITInlineMethods.h b/JavaScriptCore/jit/JITInlineMethods.h
index cba290b..04f7158 100644
--- a/JavaScriptCore/jit/JITInlineMethods.h
+++ b/JavaScriptCore/jit/JITInlineMethods.h
@@ -645,7 +645,7 @@ ALWAYS_INLINE bool JIT::isOperandConstantImmediateInt(unsigned src)
ALWAYS_INLINE void JIT::emitPutVirtualRegister(unsigned dst, RegisterID from)
{
storePtr(from, Address(callFrameRegister, dst * sizeof(Register)));
- m_lastResultBytecodeRegister = (from == cachedResultRegister) ? dst : std::numeric_limits<int>::max();
+ m_lastResultBytecodeRegister = (from == cachedResultRegister) ? static_cast<int>(dst) : std::numeric_limits<int>::max();
}
ALWAYS_INLINE void JIT::emitInitRegister(unsigned dst)
diff --git a/JavaScriptCore/jit/JITOpcodes.cpp b/JavaScriptCore/jit/JITOpcodes.cpp
index 0848348..9a34931 100644
--- a/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/JavaScriptCore/jit/JITOpcodes.cpp
@@ -73,12 +73,14 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
// VirtualCallLink Trampoline
// regT0 holds callee, regT1 holds argCount. regT2 will hold the FunctionExecutable.
+ JumpList callLazyLinkFailures;
Label virtualCallLinkBegin = align();
compileOpCallInitializeCallFrame();
preserveReturnAddressAfterCall(regT3);
emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC);
restoreArgumentReference();
Call callLazyLinkCall = call();
+ callLazyLinkFailures.append(branchTestPtr(Zero, regT0));
restoreReturnAddressBeforeReturn(regT3);
emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT1);
jump(regT0);
@@ -91,10 +93,24 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC);
restoreArgumentReference();
Call callLazyLinkConstruct = call();
+ callLazyLinkFailures.append(branchTestPtr(Zero, regT0));
restoreReturnAddressBeforeReturn(regT3);
emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT1);
jump(regT0);
+ // If the parser fails we want to be able to be able to keep going,
+ // So we handle this as a parse failure.
+ callLazyLinkFailures.link(this);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT1);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, callFrameRegister);
+ restoreReturnAddressBeforeReturn(regT1);
+ move(ImmPtr(&globalData->exceptionLocation), regT2);
+ storePtr(regT1, regT2);
+ poke(callFrameRegister, 1 + OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
+ poke(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()));
+ ret();
+
+
// VirtualCall Trampoline
// regT0 holds callee, regT1 holds argCount. regT2 will hold the FunctionExecutable.
Label virtualCallBegin = align();
@@ -181,6 +197,7 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
Label nativeCallThunk = align();
+#if CPU(X86_64)
// Load caller frame's scope chain into this callframe so that whatever we call can
// get to its global data.
emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0);
@@ -190,7 +207,6 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
peek(regT1);
emitPutToCallFrameHeader(regT1, RegisterFile::ReturnPC);
-#if CPU(X86_64)
// Calling convention: f(edi, esi, edx, ecx, ...);
// Host function signature: f(ExecState*);
move(callFrameRegister, X86Registers::edi);
@@ -204,6 +220,27 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
addPtr(Imm32(16 - sizeof(void*)), stackPointerRegister);
+#elif CPU(ARM)
+ // Load caller frame's scope chain into this callframe so that whatever we call can
+ // get to its global data.
+ emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT2);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT2);
+ emitPutToCallFrameHeader(regT1, RegisterFile::ScopeChain);
+
+ preserveReturnAddressAfterCall(regT3); // Callee preserved
+ emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC);
+
+ // Calling convention: f(r0 == regT0, r1 == regT1, ...);
+ // Host function signature: f(ExecState*);
+ move(callFrameRegister, ARMRegisters::r0);
+
+ emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, ARMRegisters::r1);
+ move(regT2, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack.
+ loadPtr(Address(ARMRegisters::r1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2);
+ call(Address(regT2, executableOffsetToFunction));
+
+ restoreReturnAddressBeforeReturn(regT3);
+
#elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
#error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform."
#else
@@ -220,12 +257,18 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
// Handle an exception
exceptionHandler.link(this);
+
// Grab the return address.
- peek(regT1);
+ preserveReturnAddressAfterCall(regT1);
+
move(ImmPtr(&globalData->exceptionLocation), regT2);
storePtr(regT1, regT2);
- poke(callFrameRegister, 1 + OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof (void*));
- poke(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()));
+ poke(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
+
+ // Set the return address.
+ move(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()), regT1);
+ restoreReturnAddressBeforeReturn(regT1);
+
ret();
return nativeCallThunk;
diff --git a/JavaScriptCore/jit/JITOpcodes32_64.cpp b/JavaScriptCore/jit/JITOpcodes32_64.cpp
index 239751f..a44a8a1 100644
--- a/JavaScriptCore/jit/JITOpcodes32_64.cpp
+++ b/JavaScriptCore/jit/JITOpcodes32_64.cpp
@@ -66,8 +66,8 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
#endif
// (2) Trampolines for the slow cases of op_call / op_call_eval / op_construct.
-
#if ENABLE(JIT_OPTIMIZE_CALL)
+ JumpList callLazyLinkFailures;
// VirtualCallLink Trampoline
// regT0 holds callee, regT1 holds argCount. regT2 will hold the FunctionExecutable.
Label virtualCallLinkBegin = align();
@@ -76,6 +76,7 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC);
restoreArgumentReference();
Call callLazyLinkCall = call();
+ callLazyLinkFailures.append(branchTestPtr(Zero, regT0));
restoreReturnAddressBeforeReturn(regT3);
emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT1);
jump(regT0);
@@ -89,8 +90,22 @@ void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executable
restoreArgumentReference();
Call callLazyLinkConstruct = call();
restoreReturnAddressBeforeReturn(regT3);
+ callLazyLinkFailures.append(branchTestPtr(Zero, regT0));
emitGetFromCallFrameHeader32(RegisterFile::ArgumentCount, regT1);
jump(regT0);
+
+ // If the parser fails we want to be able to be able to keep going,
+ // So we handle this as a parse failure.
+ callLazyLinkFailures.link(this);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::ReturnPC, regT1);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, callFrameRegister);
+ restoreReturnAddressBeforeReturn(regT1);
+ move(ImmPtr(&globalData->exceptionLocation), regT2);
+ storePtr(regT1, regT2);
+ poke(callFrameRegister, 1 + OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
+ poke(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()));
+ ret();
+
#endif // ENABLE(JIT_OPTIMIZE_CALL)
// VirtualCall Trampoline
@@ -181,6 +196,7 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
Label nativeCallThunk = align();
+#if CPU(X86)
// Load caller frame's scope chain into this callframe so that whatever we call can
// get to its global data.
emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT0);
@@ -190,7 +206,6 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
peek(regT1);
emitPutToCallFrameHeader(regT1, RegisterFile::ReturnPC);
-#if CPU(X86)
// Calling convention: f(ecx, edx, ...);
// Host function signature: f(ExecState*);
move(callFrameRegister, X86Registers::ecx);
@@ -205,6 +220,28 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
addPtr(Imm32(16 - sizeof(void*)), stackPointerRegister);
+#elif CPU(ARM)
+ // Load caller frame's scope chain into this callframe so that whatever we call can
+ // get to its global data.
+ emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT2);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT2);
+ emitPutToCallFrameHeader(regT1, RegisterFile::ScopeChain);
+
+ preserveReturnAddressAfterCall(regT3); // Callee preserved
+ emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC);
+
+ // Calling convention: f(r0 == regT0, r1 == regT1, ...);
+ // Host function signature: f(ExecState*);
+ move(callFrameRegister, ARMRegisters::r0);
+
+ // call the function
+ emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, ARMRegisters::r1);
+ move(regT2, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack.
+ loadPtr(Address(ARMRegisters::r1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2);
+ call(Address(regT2, executableOffsetToFunction));
+
+ restoreReturnAddressBeforeReturn(regT3);
+
#elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
#error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform."
#else
@@ -220,11 +257,18 @@ JIT::Label JIT::privateCompileCTINativeCall(JSGlobalData* globalData, bool isCon
// Handle an exception
sawException.link(this);
- peek(regT1);
+
+ // Grab the return address.
+ preserveReturnAddressAfterCall(regT1);
+
move(ImmPtr(&globalData->exceptionLocation), regT2);
storePtr(regT1, regT2);
- poke(callFrameRegister, 1 + OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
- poke(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()));
+ poke(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
+
+ // Set the return address.
+ move(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()), regT1);
+ restoreReturnAddressBeforeReturn(regT1);
+
ret();
return nativeCallThunk;
@@ -258,6 +302,29 @@ JIT::CodePtr JIT::privateCompileCTINativeCall(PassRefPtr<ExecutablePool> executa
addPtr(Imm32(16 - sizeof(void*)), stackPointerRegister);
+#elif CPU(ARM)
+ // Load caller frame's scope chain into this callframe so that whatever we call can
+ // get to its global data.
+ emitGetFromCallFrameHeaderPtr(RegisterFile::CallerFrame, regT2);
+ emitGetFromCallFrameHeaderPtr(RegisterFile::ScopeChain, regT1, regT2);
+ emitPutToCallFrameHeader(regT1, RegisterFile::ScopeChain);
+
+ preserveReturnAddressAfterCall(regT3); // Callee preserved
+ emitPutToCallFrameHeader(regT3, RegisterFile::ReturnPC);
+
+ // Calling convention: f(r0 == regT0, r1 == regT1, ...);
+ // Host function signature: f(ExecState*);
+ move(callFrameRegister, ARMRegisters::r0);
+
+ emitGetFromCallFrameHeaderPtr(RegisterFile::Callee, ARMRegisters::r1);
+ move(regT2, callFrameRegister); // Eagerly restore caller frame register to avoid loading from stack.
+ loadPtr(Address(ARMRegisters::r1, OBJECT_OFFSETOF(JSFunction, m_executable)), regT2);
+
+ // call the function
+ nativeCall = call();
+
+ restoreReturnAddressBeforeReturn(regT3);
+
#elif ENABLE(JIT_OPTIMIZE_NATIVE_CALL)
#error "JIT_OPTIMIZE_NATIVE_CALL not yet supported on this platform."
#else
@@ -272,11 +339,18 @@ JIT::CodePtr JIT::privateCompileCTINativeCall(PassRefPtr<ExecutablePool> executa
// Handle an exception
sawException.link(this);
- peek(regT1);
+
+ // Grab the return address.
+ preserveReturnAddressAfterCall(regT1);
+
move(ImmPtr(&globalData->exceptionLocation), regT2);
storePtr(regT1, regT2);
- poke(callFrameRegister, 1 + OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
- poke(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()));
+ poke(callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
+
+ // Set the return address.
+ move(ImmPtr(FunctionPtr(ctiVMThrowTrampoline).value()), regT1);
+ restoreReturnAddressBeforeReturn(regT1);
+
ret();
// All trampolines constructed! copy the code, link up calls, and set the pointers on the Machine object.
@@ -607,8 +681,8 @@ void JIT::emit_op_resolve_global(Instruction* currentInstruction, bool dynamic)
// Load property.
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSGlobalObject, m_externalStorage)), regT2);
load32(offsetAddr, regT3);
- load32(BaseIndex(regT2, regT3, TimesEight), regT0); // payload
- load32(BaseIndex(regT2, regT3, TimesEight, 4), regT1); // tag
+ load32(BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); // payload
+ load32(BaseIndex(regT2, regT3, TimesEight, OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); // tag
emitStore(dst, regT1, regT0);
map(m_bytecodeOffset + dynamic ? OPCODE_LENGTH(op_resolve_global_dynamic) : OPCODE_LENGTH(op_resolve_global), dst, regT1, regT0);
}
diff --git a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index 6b8af7c..16cf84a 100644
--- a/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -314,8 +314,8 @@ void JIT::emit_op_get_by_val(Instruction* currentInstruction)
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT3);
addSlowCase(branch32(AboveOrEqual, regT2, Address(regT0, OBJECT_OFFSETOF(JSArray, m_vectorLength))));
- load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), regT1); // tag
- load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0])), regT0); // payload
+ load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT1); // tag
+ load32(BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT0); // payload
addSlowCase(branch32(Equal, regT1, Imm32(JSValue::EmptyValueTag)));
emitStore(dst, regT1, regT0);
@@ -366,12 +366,12 @@ void JIT::emit_op_put_by_val(Instruction* currentInstruction)
loadPtr(Address(regT0, OBJECT_OFFSETOF(JSArray, m_storage)), regT3);
- Jump empty = branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4), Imm32(JSValue::EmptyValueTag));
+ Jump empty = branch32(Equal, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), Imm32(JSValue::EmptyValueTag));
Label storeResult(this);
emitLoad(value, regT1, regT0);
- store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]))); // payload
- store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + 4)); // tag
+ store32(regT0, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload))); // payload
+ store32(regT1, BaseIndex(regT3, regT2, TimesEight, OBJECT_OFFSETOF(ArrayStorage, m_vector[0]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag))); // tag
Jump end = jump();
empty.link(this);
@@ -571,8 +571,8 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, Register
void JIT::compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID resultTag, RegisterID resultPayload, size_t cachedOffset)
{
if (base->isUsingInlineStorage()) {
- load32(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]), resultPayload);
- load32(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]) + 4, resultTag);
+ load32(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.payload), resultPayload);
+ load32(reinterpret_cast<char*>(&base->m_inlineStorage[cachedOffset]) + OBJECT_OFFSETOF(JSValue, u.asBits.tag), resultTag);
return;
}
@@ -580,8 +580,8 @@ void JIT::compileGetDirectOffset(JSObject* base, RegisterID temp, RegisterID res
PropertyStorage* protoPropertyStorage = &base->m_externalStorage;
loadPtr(static_cast<void*>(protoPropertyStorage), temp);
- load32(Address(temp, offset), resultPayload);
- load32(Address(temp, offset + 4), resultTag);
+ load32(Address(temp, offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload);
+ load32(Address(temp, offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
}
void JIT::testPrototype(Structure* structure, JumpList& failureCases)
@@ -628,8 +628,8 @@ void JIT::privateCompilePutByIdTransition(StructureStubInfo* stubInfo, Structure
add32(Imm32(1), AbsoluteAddress(newStructure->addressOfCount()));
storePtr(ImmPtr(newStructure), Address(regT0, OBJECT_OFFSETOF(JSCell, m_structure)));
- load32(Address(stackPointerRegister, offsetof(struct JITStackFrame, args[2]) + sizeof(void*)), regT3);
- load32(Address(stackPointerRegister, offsetof(struct JITStackFrame, args[2]) + sizeof(void*) + 4), regT2);
+ load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), regT3);
+ load32(Address(stackPointerRegister, OBJECT_OFFSETOF(JITStackFrame, args[2]) + sizeof(void*) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), regT2);
// Write the value
compilePutDirectOffset(regT0, regT2, regT3, newStructure, cachedOffset);
@@ -673,8 +673,8 @@ void JIT::patchGetByIdSelf(CodeBlock* codeBlock, StructureStubInfo* stubInfo, St
// Patch the offset into the propoerty map to load from, then patch the Structure to look for.
repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetGetByIdStructure), structure);
- repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetGetByIdPropertyMapOffset1), offset); // payload
- repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetGetByIdPropertyMapOffset2), offset + 4); // tag
+ repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetGetByIdPropertyMapOffset1), offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)); // payload
+ repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetGetByIdPropertyMapOffset2), offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)); // tag
}
void JIT::patchMethodCallProto(CodeBlock* codeBlock, MethodCallLinkInfo& methodCallLinkInfo, JSFunction* callee, Structure* structure, JSObject* proto, ReturnAddressPtr returnAddress)
@@ -714,8 +714,8 @@ void JIT::patchPutByIdReplace(CodeBlock* codeBlock, StructureStubInfo* stubInfo,
// Patch the offset into the propoerty map to load from, then patch the Structure to look for.
repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabelPtrAtOffset(patchOffsetPutByIdStructure), structure);
- repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetPutByIdPropertyMapOffset1), offset); // payload
- repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetPutByIdPropertyMapOffset2), offset + 4); // tag
+ repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetPutByIdPropertyMapOffset1), offset + OBJECT_OFFSETOF(JSValue, u.asBits.payload)); // payload
+ repatchBuffer.repatch(stubInfo->hotPathBegin.dataLabel32AtOffset(patchOffsetPutByIdPropertyMapOffset2), offset + OBJECT_OFFSETOF(JSValue, u.asBits.tag)); // tag
}
void JIT::privateCompilePatchGetArrayLength(ReturnAddressPtr returnAddress)
@@ -1122,8 +1122,8 @@ void JIT::compileGetDirectOffset(RegisterID base, RegisterID resultTag, Register
ASSERT(sizeof(JSValue) == 8);
Jump notUsingInlineStorage = branch32(NotEqual, Address(structure, OBJECT_OFFSETOF(Structure, m_propertyStorageCapacity)), Imm32(JSObject::inlineStorageCapacity));
- loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSObject, m_inlineStorage)+OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload);
- loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSObject, m_inlineStorage)+OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
+ loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSObject, m_inlineStorage) + OBJECT_OFFSETOF(JSValue, u.asBits.payload)), resultPayload);
+ loadPtr(BaseIndex(base, offset, TimesEight, OBJECT_OFFSETOF(JSObject, m_inlineStorage) + OBJECT_OFFSETOF(JSValue, u.asBits.tag)), resultTag);
Jump finishedLoad = jump();
notUsingInlineStorage.link(this);
loadPtr(Address(base, OBJECT_OFFSETOF(JSObject, m_externalStorage)), base);
diff --git a/JavaScriptCore/jit/JITStubs.cpp b/JavaScriptCore/jit/JITStubs.cpp
index ff0dc3f..c4a6507 100644
--- a/JavaScriptCore/jit/JITStubs.cpp
+++ b/JavaScriptCore/jit/JITStubs.cpp
@@ -1967,7 +1967,11 @@ DEFINE_STUB_FUNCTION(void*, vm_lazyLinkCall)
codePtr = executable->generatedJITCodeForCall().addressForCall();
else {
FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable);
- codeBlock = &functionExecutable->bytecodeForCall(stackFrame.callFrame, callee->scope().node());
+ codeBlock = functionExecutable->bytecodeForCall(stackFrame.callFrame, callee->scope().node());
+ if (!codeBlock) {
+ stackFrame.callFrame->globalData().exception = createStackOverflowError(callFrame);
+ return 0;
+ }
functionExecutable->jitCodeForCall(callFrame, callee->scope().node());
if (callFrame->argumentCountIncludingThis() == static_cast<size_t>(codeBlock->m_numParameters))
codePtr = functionExecutable->generatedJITCodeForCall().addressForCall();
@@ -1997,7 +2001,11 @@ DEFINE_STUB_FUNCTION(void*, vm_lazyLinkConstruct)
codePtr = executable->generatedJITCodeForConstruct().addressForCall();
else {
FunctionExecutable* functionExecutable = static_cast<FunctionExecutable*>(executable);
- codeBlock = &functionExecutable->bytecodeForConstruct(stackFrame.callFrame, callee->scope().node());
+ codeBlock = functionExecutable->bytecodeForConstruct(stackFrame.callFrame, callee->scope().node());
+ if (!codeBlock) {
+ throwStackOverflowError(callFrame, stackFrame.globalData, ReturnAddressPtr(callFrame->returnPC()), STUB_RETURN_ADDRESS);
+ VM_THROW_EXCEPTION();
+ }
functionExecutable->jitCodeForConstruct(callFrame, callee->scope().node());
if (callFrame->argumentCountIncludingThis() == static_cast<size_t>(codeBlock->m_numParameters))
codePtr = functionExecutable->generatedJITCodeForConstruct().addressForCall();
@@ -2040,7 +2048,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_call_NotJSFunction)
int argCount = stackFrame.args[2].int32();
CallFrame* previousCallFrame = stackFrame.callFrame;
CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
-
+ if (!stackFrame.registerFile->grow(callFrame->registers())) {
+ throwStackOverflowError(previousCallFrame, stackFrame.globalData, callFrame->returnPC(), STUB_RETURN_ADDRESS);
+ VM_THROW_EXCEPTION();
+ }
callFrame->init(0, static_cast<Instruction*>((STUB_RETURN_ADDRESS).value()), previousCallFrame->scopeChain(), previousCallFrame, argCount, asObject(funcVal));
stackFrame.callFrame = callFrame;
@@ -2175,6 +2186,10 @@ DEFINE_STUB_FUNCTION(EncodedJSValue, op_construct_NotJSConstruct)
int argCount = stackFrame.args[2].int32();
CallFrame* previousCallFrame = stackFrame.callFrame;
CallFrame* callFrame = CallFrame::create(previousCallFrame->registers() + registerOffset);
+ if (!stackFrame.registerFile->grow(callFrame->registers())) {
+ throwStackOverflowError(previousCallFrame, stackFrame.globalData, callFrame->returnPC(), STUB_RETURN_ADDRESS);
+ VM_THROW_EXCEPTION();
+ }
callFrame->init(0, static_cast<Instruction*>((STUB_RETURN_ADDRESS).value()), previousCallFrame->scopeChain(), previousCallFrame, argCount, asObject(constrVal));
stackFrame.callFrame = callFrame;
diff --git a/JavaScriptCore/jsc/CMakeLists.txt b/JavaScriptCore/jsc/CMakeLists.txt
index cc39e14..970c20f 100644
--- a/JavaScriptCore/jsc/CMakeLists.txt
+++ b/JavaScriptCore/jsc/CMakeLists.txt
@@ -9,11 +9,8 @@ SET(JSC_LIBRARIES
${JavaScriptCore_LIBRARY_NAME}
)
-
-SET(JSC_PORT_FLAGS )
INCLUDE_IF_EXISTS(${JAVASCRIPTCORE_DIR}/jsc/CMakeLists${PORT}.txt)
-
WEBKIT_WRAP_SOURCELIST(${JSC_SOURCES})
INCLUDE_DIRECTORIES(./ ${JavaScriptCore_INCLUDE_DIRECTORIES})
ADD_EXECUTABLE(${JSC_EXECUTABLE_NAME} ${JSC_HEADERS} ${JSC_SOURCES})
diff --git a/JavaScriptCore/parser/ASTBuilder.h b/JavaScriptCore/parser/ASTBuilder.h
new file mode 100644
index 0000000..7dcdff0
--- /dev/null
+++ b/JavaScriptCore/parser/ASTBuilder.h
@@ -0,0 +1,925 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ASTBuilder_h
+#define ASTBuilder_h
+
+#include "NodeConstructors.h"
+#include "SyntaxChecker.h"
+#include <utility>
+
+namespace JSC {
+
+class ASTBuilder {
+ struct BinaryOpInfo {
+ BinaryOpInfo() {}
+ BinaryOpInfo(int s, int d, int e, bool r)
+ : start(s)
+ , divot(d)
+ , end(e)
+ , hasAssignment(r)
+ {
+ }
+ BinaryOpInfo(const BinaryOpInfo& lhs, const BinaryOpInfo& rhs)
+ : start(lhs.start)
+ , divot(rhs.start)
+ , end(rhs.end)
+ , hasAssignment(lhs.hasAssignment || rhs.hasAssignment)
+ {
+ }
+ int start;
+ int divot;
+ int end;
+ bool hasAssignment;
+ };
+
+
+ struct AssignmentInfo {
+ AssignmentInfo() {}
+ AssignmentInfo(ExpressionNode* node, int start, int divot, int initAssignments, Operator op)
+ : m_node(node)
+ , m_start(start)
+ , m_divot(divot)
+ , m_initAssignments(initAssignments)
+ , m_op(op)
+ {
+ }
+ ExpressionNode* m_node;
+ int m_start;
+ int m_divot;
+ int m_initAssignments;
+ Operator m_op;
+ };
+public:
+ ASTBuilder(JSGlobalData* globalData, Lexer* lexer)
+ : m_globalData(globalData)
+ , m_lexer(lexer)
+ , m_evalCount(0)
+ {
+ m_scopes.append(Scope(globalData));
+ }
+
+ typedef SyntaxChecker FunctionBodyBuilder;
+
+ typedef ExpressionNode* Expression;
+ typedef JSC::SourceElements* SourceElements;
+ typedef ArgumentsNode* Arguments;
+ typedef CommaNode* Comma;
+ typedef PropertyNode* Property;
+ typedef PropertyListNode* PropertyList;
+ typedef ElementNode* ElementList;
+ typedef ArgumentListNode* ArgumentsList;
+ typedef ParameterNode* FormalParameterList;
+ typedef FunctionBodyNode* FunctionBody;
+ typedef StatementNode* Statement;
+ typedef ClauseListNode* ClauseList;
+ typedef CaseClauseNode* Clause;
+ typedef ConstDeclNode* ConstDeclList;
+ typedef std::pair<ExpressionNode*, BinaryOpInfo> BinaryOperand;
+
+ static const bool CreatesAST = true;
+
+ ExpressionNode* makeBinaryNode(int token, std::pair<ExpressionNode*, BinaryOpInfo>, std::pair<ExpressionNode*, BinaryOpInfo>);
+ ExpressionNode* makeFunctionCallNode(ExpressionNode* func, ArgumentsNode* args, int start, int divot, int end);
+
+ JSC::SourceElements* createSourceElements() { return new (m_globalData) JSC::SourceElements(m_globalData); }
+
+ ParserArenaData<DeclarationStacks::VarStack>* varDeclarations() { return m_scopes.last().m_varDeclarations; }
+ ParserArenaData<DeclarationStacks::FunctionStack>* funcDeclarations() { return m_scopes.last().m_funcDeclarations; }
+ int features() const { return m_scopes.last().m_features; }
+ int numConstants() const { return m_scopes.last().m_numConstants; }
+
+ void appendToComma(CommaNode* commaNode, ExpressionNode* expr) { commaNode->append(expr); }
+
+ CommaNode* createCommaExpr(ExpressionNode* lhs, ExpressionNode* rhs) { return new (m_globalData) CommaNode(m_globalData, lhs, rhs); }
+
+ ExpressionNode* makeAssignNode(ExpressionNode* left, Operator, ExpressionNode* right, bool leftHasAssignments, bool rightHasAssignments, int start, int divot, int end);
+ ExpressionNode* makePrefixNode(ExpressionNode*, Operator, int start, int divot, int end);
+ ExpressionNode* makePostfixNode(ExpressionNode*, Operator, int start, int divot, int end);
+ ExpressionNode* makeTypeOfNode(ExpressionNode*);
+ ExpressionNode* makeDeleteNode(ExpressionNode*, int start, int divot, int end);
+ ExpressionNode* makeNegateNode(ExpressionNode*);
+ ExpressionNode* makeBitwiseNotNode(ExpressionNode*);
+ ExpressionNode* makeMultNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeDivNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeAddNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeSubNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeLeftShiftNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+ ExpressionNode* makeRightShiftNode(ExpressionNode* left, ExpressionNode* right, bool rightHasAssignments);
+
+ ExpressionNode* createLogicalNot(ExpressionNode* expr) { return new (m_globalData) LogicalNotNode(m_globalData, expr); }
+ ExpressionNode* createUnaryPlus(ExpressionNode* expr) { return new (m_globalData) UnaryPlusNode(m_globalData, expr); }
+ ExpressionNode* createVoid(ExpressionNode* expr)
+ {
+ incConstants();
+ return new (m_globalData) VoidNode(m_globalData, expr);
+ }
+ ExpressionNode* thisExpr()
+ {
+ usesThis();
+ return new (m_globalData) ThisNode(m_globalData);
+ }
+ ExpressionNode* createResolve(const Identifier* ident, int start)
+ {
+ if (m_globalData->propertyNames->arguments == *ident)
+ usesArguments();
+ return new (m_globalData) ResolveNode(m_globalData, *ident, start);
+ }
+ ExpressionNode* createObjectLiteral() { return new (m_globalData) ObjectLiteralNode(m_globalData); }
+ ExpressionNode* createObjectLiteral(PropertyListNode* properties) { return new (m_globalData) ObjectLiteralNode(m_globalData, properties); }
+
+ ExpressionNode* createArray(int elisions)
+ {
+ if (elisions)
+ incConstants();
+ return new (m_globalData) ArrayNode(m_globalData, elisions);
+ }
+
+ ExpressionNode* createArray(ElementNode* elems) { return new (m_globalData) ArrayNode(m_globalData, elems); }
+ ExpressionNode* createArray(int elisions, ElementNode* elems)
+ {
+ if (elisions)
+ incConstants();
+ return new (m_globalData) ArrayNode(m_globalData, elisions, elems);
+ }
+ ExpressionNode* createNumberExpr(double d)
+ {
+ incConstants();
+ return new (m_globalData) NumberNode(m_globalData, d);
+ }
+
+ ExpressionNode* createString(const Identifier* string)
+ {
+ incConstants();
+ return new (m_globalData) StringNode(m_globalData, *string);
+ }
+
+ ExpressionNode* createBoolean(bool b)
+ {
+ incConstants();
+ return new (m_globalData) BooleanNode(m_globalData, b);
+ }
+
+ ExpressionNode* createNull()
+ {
+ incConstants();
+ return new (m_globalData) NullNode(m_globalData);
+ }
+
+ ExpressionNode* createBracketAccess(ExpressionNode* base, ExpressionNode* property, bool propertyHasAssignments, int start, int divot, int end)
+ {
+ BracketAccessorNode* node = new (m_globalData) BracketAccessorNode(m_globalData, base, property, propertyHasAssignments);
+ setExceptionLocation(node, start, divot, end);
+ return node;
+ }
+
+ ExpressionNode* createDotAccess(ExpressionNode* base, const Identifier& property, int start, int divot, int end)
+ {
+ DotAccessorNode* node = new (m_globalData) DotAccessorNode(m_globalData, base, property);
+ setExceptionLocation(node, start, divot, end);
+ return node;
+ }
+
+ ExpressionNode* createRegex(const Identifier& pattern, const Identifier& flags, int start)
+ {
+ RegExpNode* node = new (m_globalData) RegExpNode(m_globalData, pattern, flags);
+ int size = pattern.size() + 2; // + 2 for the two /'s
+ setExceptionLocation(node, start, start + size, start + size);
+ return node;
+ }
+
+ ExpressionNode* createNewExpr(ExpressionNode* expr, ArgumentsNode* arguments, int start, int divot, int end)
+ {
+ NewExprNode* node = new (m_globalData) NewExprNode(m_globalData, expr, arguments);
+ setExceptionLocation(node, start, divot, end);
+ return node;
+ }
+
+ ExpressionNode* createNewExpr(ExpressionNode* expr, int start, int end)
+ {
+ NewExprNode* node = new (m_globalData) NewExprNode(m_globalData, expr);
+ setExceptionLocation(node, start, end, end);
+ return node;
+ }
+
+ ExpressionNode* createConditionalExpr(ExpressionNode* condition, ExpressionNode* lhs, ExpressionNode* rhs)
+ {
+ return new (m_globalData) ConditionalNode(m_globalData, condition, lhs, rhs);
+ }
+
+ ExpressionNode* createAssignResolve(const Identifier& ident, ExpressionNode* rhs, bool rhsHasAssignment, int start, int divot, int end)
+ {
+ AssignResolveNode* node = new (m_globalData) AssignResolveNode(m_globalData, ident, rhs, rhsHasAssignment);
+ setExceptionLocation(node, start, divot, end);
+ return node;
+ }
+
+ ExpressionNode* createFunctionExpr(const Identifier* name, FunctionBodyNode* body, ParameterNode* parameters, int openBracePos, int closeBracePos, int bodyStartLine, int bodyEndLine)
+ {
+ FuncExprNode* result = new (m_globalData) FuncExprNode(m_globalData, *name, body, m_lexer->sourceCode(openBracePos, closeBracePos, bodyStartLine), parameters);
+ body->setLoc(bodyStartLine, bodyEndLine);
+ return result;
+ }
+
+ FunctionBodyNode* createFunctionBody()
+ {
+ usesClosures();
+ return FunctionBodyNode::create(m_globalData);
+ }
+
+ PropertyNode* createGetterOrSetterProperty(const Identifier* getOrSet, const Identifier* name, ParameterNode* params, FunctionBodyNode* body, int openBracePos, int closeBracePos, int bodyStartLine, int bodyEndLine)
+ {
+ ASSERT(name);
+ PropertyNode::Type type;
+ if (*getOrSet == "get")
+ type = PropertyNode::Getter;
+ else if (*getOrSet == "set")
+ type = PropertyNode::Setter;
+ else
+ return 0;
+ body->setLoc(bodyStartLine, bodyEndLine);
+ return new (m_globalData) PropertyNode(m_globalData, *name, new (m_globalData) FuncExprNode(m_globalData, m_globalData->propertyNames->nullIdentifier, body, m_lexer->sourceCode(openBracePos, closeBracePos, bodyStartLine), params), type);
+ }
+
+
+ ArgumentsNode* createArguments() { return new (m_globalData) ArgumentsNode(m_globalData); }
+ ArgumentsNode* createArguments(ArgumentListNode* args) { return new (m_globalData) ArgumentsNode(m_globalData, args); }
+ ArgumentListNode* createArgumentsList(ExpressionNode* arg) { return new (m_globalData) ArgumentListNode(m_globalData, arg); }
+ ArgumentListNode* createArgumentsList(ArgumentListNode* args, ExpressionNode* arg) { return new (m_globalData) ArgumentListNode(m_globalData, args, arg); }
+
+ PropertyNode* createProperty(const Identifier* propertyName, ExpressionNode* node, PropertyNode::Type type) { return new (m_globalData) PropertyNode(m_globalData, *propertyName, node, type); }
+ PropertyNode* createProperty(double propertyName, ExpressionNode* node, PropertyNode::Type type) { return new (m_globalData) PropertyNode(m_globalData, propertyName, node, type); }
+ PropertyListNode* createPropertyList(PropertyNode* property) { return new (m_globalData) PropertyListNode(m_globalData, property); }
+ PropertyListNode* createPropertyList(PropertyNode* property, PropertyListNode* tail) { return new (m_globalData) PropertyListNode(m_globalData, property, tail); }
+
+ ElementNode* createElementList(int elisions, ExpressionNode* expr) { return new (m_globalData) ElementNode(m_globalData, elisions, expr); }
+ ElementNode* createElementList(ElementNode* elems, int elisions, ExpressionNode* expr) { return new (m_globalData) ElementNode(m_globalData, elems, elisions, expr); }
+
+ ParameterNode* createFormalParameterList(const Identifier& ident) { return new (m_globalData) ParameterNode(m_globalData, ident); }
+ ParameterNode* createFormalParameterList(ParameterNode* list, const Identifier& ident) { return new (m_globalData) ParameterNode(m_globalData, list, ident); }
+
+ CaseClauseNode* createClause(ExpressionNode* expr, JSC::SourceElements* statements) { return new (m_globalData) CaseClauseNode(m_globalData, expr, statements); }
+ ClauseListNode* createClauseList(CaseClauseNode* clause) { return new (m_globalData) ClauseListNode(m_globalData, clause); }
+ ClauseListNode* createClauseList(ClauseListNode* tail, CaseClauseNode* clause) { return new (m_globalData) ClauseListNode(m_globalData, tail, clause); }
+
+ void setUsesArguments(FunctionBodyNode* node) { node->setUsesArguments(); }
+
+ StatementNode* createFuncDeclStatement(const Identifier* name, FunctionBodyNode* body, ParameterNode* parameters, int openBracePos, int closeBracePos, int bodyStartLine, int bodyEndLine)
+ {
+ FuncDeclNode* decl = new (m_globalData) FuncDeclNode(m_globalData, *name, body, m_lexer->sourceCode(openBracePos, closeBracePos, bodyStartLine), parameters);
+ if (*name == m_globalData->propertyNames->arguments)
+ usesArguments();
+ m_scopes.last().m_funcDeclarations->data.append(decl->body());
+ body->setLoc(bodyStartLine, bodyEndLine);
+ return decl;
+ }
+
+ StatementNode* createBlockStatement(JSC::SourceElements* elements, int startLine, int endLine)
+ {
+ BlockNode* block = new (m_globalData) BlockNode(m_globalData, elements);
+ block->setLoc(startLine, endLine);
+ return block;
+ }
+
+ StatementNode* createExprStatement(ExpressionNode* expr, int start, int end)
+ {
+ ExprStatementNode* result = new (m_globalData) ExprStatementNode(m_globalData, expr);
+ result->setLoc(start, end);
+ return result;
+ }
+
+ StatementNode* createIfStatement(ExpressionNode* condition, StatementNode* trueBlock, int start, int end)
+ {
+ IfNode* result = new (m_globalData) IfNode(m_globalData, condition, trueBlock);
+ result->setLoc(start, end);
+ return result;
+ }
+
+ StatementNode* createIfStatement(ExpressionNode* condition, StatementNode* trueBlock, StatementNode* falseBlock, int start, int end)
+ {
+ IfNode* result = new (m_globalData) IfElseNode(m_globalData, condition, trueBlock, falseBlock);
+ result->setLoc(start, end);
+ return result;
+ }
+
+ StatementNode* createForLoop(ExpressionNode* initializer, ExpressionNode* condition, ExpressionNode* iter, StatementNode* statements, bool b, int start, int end)
+ {
+ ForNode* result = new (m_globalData) ForNode(m_globalData, initializer, condition, iter, statements, b);
+ result->setLoc(start, end);
+ return result;
+ }
+
+ StatementNode* createForInLoop(const Identifier* ident, ExpressionNode* initializer, ExpressionNode* iter, StatementNode* statements, int start, int divot, int end, int initStart, int initEnd, int startLine, int endLine)
+ {
+ ForInNode* result = new (m_globalData) ForInNode(m_globalData, *ident, initializer, iter, statements, initStart, initStart - start, initEnd - initStart);
+ result->setLoc(startLine, endLine);
+ setExceptionLocation(result, start, divot + 1, end);
+ return result;
+ }
+
+ StatementNode* createForInLoop(ExpressionNode* lhs, ExpressionNode* iter, StatementNode* statements, int eStart, int eDivot, int eEnd, int start, int end)
+ {
+ ForInNode* result = new (m_globalData) ForInNode(m_globalData, lhs, iter, statements);
+ result->setLoc(start, end);
+ setExceptionLocation(result, eStart, eDivot, eEnd);
+ return result;
+ }
+
+ StatementNode* createEmptyStatement() { return new (m_globalData) EmptyStatementNode(m_globalData); }
+
+ StatementNode* createVarStatement(ExpressionNode* expr, int start, int end)
+ {
+ StatementNode* result;
+ if (!expr)
+ result = new (m_globalData) EmptyStatementNode(m_globalData);
+ else
+ result = new (m_globalData) VarStatementNode(m_globalData, expr);
+ result->setLoc(start, end);
+ return result;
+ }
+
+ StatementNode* createReturnStatement(ExpressionNode* expression, int eStart, int eEnd, int startLine, int endLine)
+ {
+ ReturnNode* result = new (m_globalData) ReturnNode(m_globalData, expression);
+ setExceptionLocation(result, eStart, eEnd, eEnd);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createBreakStatement(int eStart, int eEnd, int startLine, int endLine)
+ {
+ BreakNode* result = new (m_globalData) BreakNode(m_globalData);
+ setExceptionLocation(result, eStart, eEnd, eEnd);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createBreakStatement(const Identifier* ident, int eStart, int eEnd, int startLine, int endLine)
+ {
+ BreakNode* result = new (m_globalData) BreakNode(m_globalData, *ident);
+ setExceptionLocation(result, eStart, eEnd, eEnd);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createContinueStatement(int eStart, int eEnd, int startLine, int endLine)
+ {
+ ContinueNode* result = new (m_globalData) ContinueNode(m_globalData);
+ setExceptionLocation(result, eStart, eEnd, eEnd);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createContinueStatement(const Identifier* ident, int eStart, int eEnd, int startLine, int endLine)
+ {
+ ContinueNode* result = new (m_globalData) ContinueNode(m_globalData, *ident);
+ setExceptionLocation(result, eStart, eEnd, eEnd);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createTryStatement(StatementNode* tryBlock, const Identifier* ident, bool catchHasEval, StatementNode* catchBlock, StatementNode* finallyBlock, int startLine, int endLine)
+ {
+ TryNode* result = new (m_globalData) TryNode(m_globalData, tryBlock, *ident, catchHasEval, catchBlock, finallyBlock);
+ if (catchBlock)
+ usesCatch();
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createSwitchStatement(ExpressionNode* expr, ClauseListNode* firstClauses, CaseClauseNode* defaultClause, ClauseListNode* secondClauses, int startLine, int endLine)
+ {
+ CaseBlockNode* cases = new (m_globalData) CaseBlockNode(m_globalData, firstClauses, defaultClause, secondClauses);
+ SwitchNode* result = new (m_globalData) SwitchNode(m_globalData, expr, cases);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createWhileStatement(ExpressionNode* expr, StatementNode* statement, int startLine, int endLine)
+ {
+ WhileNode* result = new (m_globalData) WhileNode(m_globalData, expr, statement);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createDoWhileStatement(StatementNode* statement, ExpressionNode* expr, int startLine, int endLine)
+ {
+ DoWhileNode* result = new (m_globalData) DoWhileNode(m_globalData, statement, expr);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createLabelStatement(const Identifier* ident, StatementNode* statement, int start, int end)
+ {
+ LabelNode* result = new (m_globalData) LabelNode(m_globalData, *ident, statement);
+ setExceptionLocation(result, start, end, end);
+ return result;
+ }
+
+ StatementNode* createWithStatement(ExpressionNode* expr, StatementNode* statement, int start, int end, int startLine, int endLine)
+ {
+ usesWith();
+ WithNode* result = new (m_globalData) WithNode(m_globalData, expr, statement, end, end - start);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createThrowStatement(ExpressionNode* expr, int start, int end, int startLine, int endLine)
+ {
+ ThrowNode* result = new (m_globalData) ThrowNode(m_globalData, expr);
+ result->setLoc(startLine, endLine);
+ setExceptionLocation(result, start, end, end);
+ return result;
+ }
+
+ StatementNode* createDebugger(int startLine, int endLine)
+ {
+ DebuggerStatementNode* result = new (m_globalData) DebuggerStatementNode(m_globalData);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ StatementNode* createConstStatement(ConstDeclNode* decls, int startLine, int endLine)
+ {
+ ConstStatementNode* result = new (m_globalData) ConstStatementNode(m_globalData, decls);
+ result->setLoc(startLine, endLine);
+ return result;
+ }
+
+ ConstDeclNode* appendConstDecl(ConstDeclNode* tail, const Identifier* name, ExpressionNode* initializer)
+ {
+ ConstDeclNode* result = new (m_globalData) ConstDeclNode(m_globalData, *name, initializer);
+ if (tail)
+ tail->m_next = result;
+ return result;
+ }
+
+ void appendStatement(JSC::SourceElements* elements, JSC::StatementNode* statement)
+ {
+ elements->append(statement);
+ }
+
+ void addVar(const Identifier* ident, int attrs)
+ {
+ if (m_globalData->propertyNames->arguments == *ident)
+ usesArguments();
+ m_scopes.last().m_varDeclarations->data.append(std::make_pair(ident, attrs));
+ }
+
+ ExpressionNode* combineCommaNodes(ExpressionNode* list, ExpressionNode* init)
+ {
+ if (!list)
+ return init;
+ if (list->isCommaNode()) {
+ static_cast<CommaNode*>(list)->append(init);
+ return list;
+ }
+ return new (m_globalData) CommaNode(m_globalData, list, init);
+ }
+
+ int evalCount() const { return m_evalCount; }
+
+ void appendBinaryExpressionInfo(int& operandStackDepth, ExpressionNode* current, int exprStart, int lhs, int rhs, bool hasAssignments)
+ {
+ operandStackDepth++;
+ m_binaryOperandStack.append(std::make_pair(current, BinaryOpInfo(exprStart, lhs, rhs, hasAssignments)));
+ }
+
+ // Logic to handle datastructures used during parsing of binary expressions
+ void operatorStackPop(int& operatorStackDepth)
+ {
+ operatorStackDepth--;
+ m_binaryOperatorStack.removeLast();
+ }
+ bool operatorStackHasHigherPrecedence(int&, int precedence)
+ {
+ return precedence <= m_binaryOperatorStack.last().second;
+ }
+ const BinaryOperand& getFromOperandStack(int i) { return m_binaryOperandStack[m_binaryOperandStack.size() + i]; }
+ void shrinkOperandStackBy(int& operandStackDepth, int amount)
+ {
+ operandStackDepth -= amount;
+ ASSERT(operandStackDepth >= 0);
+ m_binaryOperandStack.resize(m_binaryOperandStack.size() - amount);
+ }
+ void appendBinaryOperation(int& operandStackDepth, int&, const BinaryOperand& lhs, const BinaryOperand& rhs)
+ {
+ operandStackDepth++;
+ m_binaryOperandStack.append(std::make_pair(makeBinaryNode(m_binaryOperatorStack.last().first, lhs, rhs), BinaryOpInfo(lhs.second, rhs.second)));
+ }
+ void operatorStackAppend(int& operatorStackDepth, int op, int precedence)
+ {
+ operatorStackDepth++;
+ m_binaryOperatorStack.append(std::make_pair(op, precedence));
+ }
+ ExpressionNode* popOperandStack(int&)
+ {
+ ExpressionNode* result = m_binaryOperandStack.last().first;
+ m_binaryOperandStack.removeLast();
+ return result;
+ }
+
+ void appendUnaryToken(int& tokenStackDepth, int type, int start)
+ {
+ tokenStackDepth++;
+ m_unaryTokenStack.append(std::make_pair(type, start));
+ }
+
+ int unaryTokenStackLastType(int&)
+ {
+ return m_unaryTokenStack.last().first;
+ }
+
+ int unaryTokenStackLastStart(int&)
+ {
+ return m_unaryTokenStack.last().second;
+ }
+
+ void unaryTokenStackRemoveLast(int& tokenStackDepth)
+ {
+ tokenStackDepth--;
+ m_unaryTokenStack.removeLast();
+ }
+
+ void assignmentStackAppend(int& assignmentStackDepth, ExpressionNode* node, int start, int divot, int assignmentCount, Operator op)
+ {
+ assignmentStackDepth++;
+ m_assignmentInfoStack.append(AssignmentInfo(node, start, divot, assignmentCount, op));
+ }
+
+ ExpressionNode* createAssignment(int& assignmentStackDepth, ExpressionNode* rhs, int initialAssignmentCount, int currentAssignmentCount, int lastTokenEnd)
+ {
+ ExpressionNode* result = makeAssignNode(m_assignmentInfoStack.last().m_node, m_assignmentInfoStack.last().m_op, rhs, m_assignmentInfoStack.last().m_initAssignments != initialAssignmentCount, m_assignmentInfoStack.last().m_initAssignments != currentAssignmentCount, m_assignmentInfoStack.last().m_start, m_assignmentInfoStack.last().m_divot + 1, lastTokenEnd);
+ m_assignmentInfoStack.removeLast();
+ assignmentStackDepth--;
+ return result;
+ }
+
+private:
+ struct Scope {
+ Scope(JSGlobalData* globalData)
+ : m_varDeclarations(new (globalData) ParserArenaData<DeclarationStacks::VarStack>)
+ , m_funcDeclarations(new (globalData) ParserArenaData<DeclarationStacks::FunctionStack>)
+ , m_features(0)
+ , m_numConstants(0)
+ {
+ }
+ ParserArenaData<DeclarationStacks::VarStack>* m_varDeclarations;
+ ParserArenaData<DeclarationStacks::FunctionStack>* m_funcDeclarations;
+ int m_features;
+ int m_numConstants;
+ };
+
+ static void setExceptionLocation(ThrowableExpressionData* node, unsigned start, unsigned divot, unsigned end)
+ {
+ node->setExceptionSourceCode(divot, divot - start, end - divot);
+ }
+
+ void incConstants() { m_scopes.last().m_numConstants++; }
+ void usesThis() { m_scopes.last().m_features |= ThisFeature; }
+ void usesCatch() { m_scopes.last().m_features |= CatchFeature; }
+ void usesClosures() { m_scopes.last().m_features |= ClosureFeature; }
+ void usesArguments() { m_scopes.last().m_features |= ArgumentsFeature; }
+ void usesAssignment() { m_scopes.last().m_features |= AssignFeature; }
+ void usesWith() { m_scopes.last().m_features |= WithFeature; }
+ void usesEval()
+ {
+ m_evalCount++;
+ m_scopes.last().m_features |= EvalFeature;
+ }
+ ExpressionNode* createNumber(double d)
+ {
+ return new (m_globalData) NumberNode(m_globalData, d);
+ }
+
+ JSGlobalData* m_globalData;
+ Lexer* m_lexer;
+ Vector<Scope> m_scopes;
+ Vector<BinaryOperand, 10> m_binaryOperandStack;
+ Vector<AssignmentInfo, 10> m_assignmentInfoStack;
+ Vector<pair<int, int>, 10> m_binaryOperatorStack;
+ Vector<pair<int, int>, 10> m_unaryTokenStack;
+ int m_evalCount;
+};
+
+ExpressionNode* ASTBuilder::makeTypeOfNode(ExpressionNode* expr)
+{
+ if (expr->isResolveNode()) {
+ ResolveNode* resolve = static_cast<ResolveNode*>(expr);
+ return new (m_globalData) TypeOfResolveNode(m_globalData, resolve->identifier());
+ }
+ return new (m_globalData) TypeOfValueNode(m_globalData, expr);
+}
+
+ExpressionNode* ASTBuilder::makeDeleteNode(ExpressionNode* expr, int start, int divot, int end)
+{
+ if (!expr->isLocation())
+ return new (m_globalData) DeleteValueNode(m_globalData, expr);
+ if (expr->isResolveNode()) {
+ ResolveNode* resolve = static_cast<ResolveNode*>(expr);
+ return new (m_globalData) DeleteResolveNode(m_globalData, resolve->identifier(), divot, divot - start, end - divot);
+ }
+ if (expr->isBracketAccessorNode()) {
+ BracketAccessorNode* bracket = static_cast<BracketAccessorNode*>(expr);
+ return new (m_globalData) DeleteBracketNode(m_globalData, bracket->base(), bracket->subscript(), divot, divot - start, end - divot);
+ }
+ ASSERT(expr->isDotAccessorNode());
+ DotAccessorNode* dot = static_cast<DotAccessorNode*>(expr);
+ return new (m_globalData) DeleteDotNode(m_globalData, dot->base(), dot->identifier(), divot, divot - start, end - divot);
+}
+
+ExpressionNode* ASTBuilder::makeNegateNode(ExpressionNode* n)
+{
+ if (n->isNumber()) {
+ NumberNode* numberNode = static_cast<NumberNode*>(n);
+ numberNode->setValue(-numberNode->value());
+ return numberNode;
+ }
+
+ return new (m_globalData) NegateNode(m_globalData, n);
+}
+
+ExpressionNode* ASTBuilder::makeBitwiseNotNode(ExpressionNode* expr)
+{
+ if (expr->isNumber())
+ return createNumber(~toInt32(static_cast<NumberNode*>(expr)->value()));
+ return new (m_globalData) BitwiseNotNode(m_globalData, expr);
+}
+
+ExpressionNode* ASTBuilder::makeMultNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ expr1 = expr1->stripUnaryPlus();
+ expr2 = expr2->stripUnaryPlus();
+
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(static_cast<NumberNode*>(expr1)->value() * static_cast<NumberNode*>(expr2)->value());
+
+ if (expr1->isNumber() && static_cast<NumberNode*>(expr1)->value() == 1)
+ return new (m_globalData) UnaryPlusNode(m_globalData, expr2);
+
+ if (expr2->isNumber() && static_cast<NumberNode*>(expr2)->value() == 1)
+ return new (m_globalData) UnaryPlusNode(m_globalData, expr1);
+
+ return new (m_globalData) MultNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeDivNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ expr1 = expr1->stripUnaryPlus();
+ expr2 = expr2->stripUnaryPlus();
+
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(static_cast<NumberNode*>(expr1)->value() / static_cast<NumberNode*>(expr2)->value());
+ return new (m_globalData) DivNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeAddNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(static_cast<NumberNode*>(expr1)->value() + static_cast<NumberNode*>(expr2)->value());
+ return new (m_globalData) AddNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeSubNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ expr1 = expr1->stripUnaryPlus();
+ expr2 = expr2->stripUnaryPlus();
+
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(static_cast<NumberNode*>(expr1)->value() - static_cast<NumberNode*>(expr2)->value());
+ return new (m_globalData) SubNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeLeftShiftNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(toInt32(static_cast<NumberNode*>(expr1)->value()) << (toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
+ return new (m_globalData) LeftShiftNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeRightShiftNode(ExpressionNode* expr1, ExpressionNode* expr2, bool rightHasAssignments)
+{
+ if (expr1->isNumber() && expr2->isNumber())
+ return createNumber(toInt32(static_cast<NumberNode*>(expr1)->value()) >> (toUInt32(static_cast<NumberNode*>(expr2)->value()) & 0x1f));
+ return new (m_globalData) RightShiftNode(m_globalData, expr1, expr2, rightHasAssignments);
+}
+
+ExpressionNode* ASTBuilder::makeFunctionCallNode(ExpressionNode* func, ArgumentsNode* args, int start, int divot, int end)
+{
+ if (!func->isLocation())
+ return new (m_globalData) FunctionCallValueNode(m_globalData, func, args, divot, divot - start, end - divot);
+ if (func->isResolveNode()) {
+ ResolveNode* resolve = static_cast<ResolveNode*>(func);
+ const Identifier& identifier = resolve->identifier();
+ if (identifier == m_globalData->propertyNames->eval) {
+ usesEval();
+ return new (m_globalData) EvalFunctionCallNode(m_globalData, args, divot, divot - start, end - divot);
+ }
+ return new (m_globalData) FunctionCallResolveNode(m_globalData, identifier, args, divot, divot - start, end - divot);
+ }
+ if (func->isBracketAccessorNode()) {
+ BracketAccessorNode* bracket = static_cast<BracketAccessorNode*>(func);
+ FunctionCallBracketNode* node = new (m_globalData) FunctionCallBracketNode(m_globalData, bracket->base(), bracket->subscript(), args, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(bracket->divot(), bracket->endOffset());
+ return node;
+ }
+ ASSERT(func->isDotAccessorNode());
+ DotAccessorNode* dot = static_cast<DotAccessorNode*>(func);
+ FunctionCallDotNode* node;
+ if (dot->identifier() == m_globalData->propertyNames->call)
+ node = new (m_globalData) CallFunctionCallDotNode(m_globalData, dot->base(), dot->identifier(), args, divot, divot - start, end - divot);
+ else if (dot->identifier() == m_globalData->propertyNames->apply)
+ node = new (m_globalData) ApplyFunctionCallDotNode(m_globalData, dot->base(), dot->identifier(), args, divot, divot - start, end - divot);
+ else
+ node = new (m_globalData) FunctionCallDotNode(m_globalData, dot->base(), dot->identifier(), args, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(dot->divot(), dot->endOffset());
+ return node;
+}
+
+ExpressionNode* ASTBuilder::makeBinaryNode(int token, pair<ExpressionNode*, BinaryOpInfo> lhs, pair<ExpressionNode*, BinaryOpInfo> rhs)
+{
+ switch (token) {
+ case OR:
+ return new (m_globalData) LogicalOpNode(m_globalData, lhs.first, rhs.first, OpLogicalOr);
+
+ case AND:
+ return new (m_globalData) LogicalOpNode(m_globalData, lhs.first, rhs.first, OpLogicalAnd);
+
+ case '|':
+ return new (m_globalData) BitOrNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '^':
+ return new (m_globalData) BitXOrNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '&':
+ return new (m_globalData) BitAndNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case EQEQ:
+ return new (m_globalData) EqualNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case NE:
+ return new (m_globalData) NotEqualNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case STREQ:
+ return new (m_globalData) StrictEqualNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case STRNEQ:
+ return new (m_globalData) NotStrictEqualNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '<':
+ return new (m_globalData) LessNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '>':
+ return new (m_globalData) GreaterNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case LE:
+ return new (m_globalData) LessEqNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case GE:
+ return new (m_globalData) GreaterEqNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case INSTANCEOF: {
+ InstanceOfNode* node = new (m_globalData) InstanceOfNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ setExceptionLocation(node, lhs.second.start, rhs.second.start, rhs.second.end);
+ return node;
+ }
+
+ case INTOKEN: {
+ InNode* node = new (m_globalData) InNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ setExceptionLocation(node, lhs.second.start, rhs.second.start, rhs.second.end);
+ return node;
+ }
+
+ case LSHIFT:
+ return makeLeftShiftNode(lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case RSHIFT:
+ return makeRightShiftNode(lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case URSHIFT:
+ return new (m_globalData) UnsignedRightShiftNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '+':
+ return makeAddNode(lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '-':
+ return makeSubNode(lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '*':
+ return makeMultNode(lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '/':
+ return makeDivNode(lhs.first, rhs.first, rhs.second.hasAssignment);
+
+ case '%':
+ return new (m_globalData) ModNode(m_globalData, lhs.first, rhs.first, rhs.second.hasAssignment);
+ }
+ CRASH();
+ return 0;
+}
+
+ExpressionNode* ASTBuilder::makeAssignNode(ExpressionNode* loc, Operator op, ExpressionNode* expr, bool locHasAssignments, bool exprHasAssignments, int start, int divot, int end)
+{
+ usesAssignment();
+ if (!loc->isLocation())
+ return new (m_globalData) AssignErrorNode(m_globalData, loc, op, expr, divot, divot - start, end - divot);
+
+ if (loc->isResolveNode()) {
+ ResolveNode* resolve = static_cast<ResolveNode*>(loc);
+ if (op == OpEqual) {
+ AssignResolveNode* node = new (m_globalData) AssignResolveNode(m_globalData, resolve->identifier(), expr, exprHasAssignments);
+ setExceptionLocation(node, start, divot, end);
+ return node;
+ }
+ return new (m_globalData) ReadModifyResolveNode(m_globalData, resolve->identifier(), op, expr, exprHasAssignments, divot, divot - start, end - divot);
+ }
+ if (loc->isBracketAccessorNode()) {
+ BracketAccessorNode* bracket = static_cast<BracketAccessorNode*>(loc);
+ if (op == OpEqual)
+ return new (m_globalData) AssignBracketNode(m_globalData, bracket->base(), bracket->subscript(), expr, locHasAssignments, exprHasAssignments, bracket->divot(), bracket->divot() - start, end - bracket->divot());
+ ReadModifyBracketNode* node = new (m_globalData) ReadModifyBracketNode(m_globalData, bracket->base(), bracket->subscript(), op, expr, locHasAssignments, exprHasAssignments, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(bracket->divot(), bracket->endOffset());
+ return node;
+ }
+ ASSERT(loc->isDotAccessorNode());
+ DotAccessorNode* dot = static_cast<DotAccessorNode*>(loc);
+ if (op == OpEqual)
+ return new (m_globalData) AssignDotNode(m_globalData, dot->base(), dot->identifier(), expr, exprHasAssignments, dot->divot(), dot->divot() - start, end - dot->divot());
+
+ ReadModifyDotNode* node = new (m_globalData) ReadModifyDotNode(m_globalData, dot->base(), dot->identifier(), op, expr, exprHasAssignments, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(dot->divot(), dot->endOffset());
+ return node;
+}
+
+ExpressionNode* ASTBuilder::makePrefixNode(ExpressionNode* expr, Operator op, int start, int divot, int end)
+{
+ usesAssignment();
+ if (!expr->isLocation())
+ return new (m_globalData) PrefixErrorNode(m_globalData, expr, op, divot, divot - start, end - divot);
+
+ if (expr->isResolveNode()) {
+ ResolveNode* resolve = static_cast<ResolveNode*>(expr);
+ return new (m_globalData) PrefixResolveNode(m_globalData, resolve->identifier(), op, divot, divot - start, end - divot);
+ }
+ if (expr->isBracketAccessorNode()) {
+ BracketAccessorNode* bracket = static_cast<BracketAccessorNode*>(expr);
+ PrefixBracketNode* node = new (m_globalData) PrefixBracketNode(m_globalData, bracket->base(), bracket->subscript(), op, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(bracket->divot(), bracket->startOffset());
+ return node;
+ }
+ ASSERT(expr->isDotAccessorNode());
+ DotAccessorNode* dot = static_cast<DotAccessorNode*>(expr);
+ PrefixDotNode* node = new (m_globalData) PrefixDotNode(m_globalData, dot->base(), dot->identifier(), op, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(dot->divot(), dot->startOffset());
+ return node;
+}
+
+ExpressionNode* ASTBuilder::makePostfixNode(ExpressionNode* expr, Operator op, int start, int divot, int end)
+{
+ usesAssignment();
+ if (!expr->isLocation())
+ return new (m_globalData) PostfixErrorNode(m_globalData, expr, op, divot, divot - start, end - divot);
+
+ if (expr->isResolveNode()) {
+ ResolveNode* resolve = static_cast<ResolveNode*>(expr);
+ return new (m_globalData) PostfixResolveNode(m_globalData, resolve->identifier(), op, divot, divot - start, end - divot);
+ }
+ if (expr->isBracketAccessorNode()) {
+ BracketAccessorNode* bracket = static_cast<BracketAccessorNode*>(expr);
+ PostfixBracketNode* node = new (m_globalData) PostfixBracketNode(m_globalData, bracket->base(), bracket->subscript(), op, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(bracket->divot(), bracket->endOffset());
+ return node;
+
+ }
+ ASSERT(expr->isDotAccessorNode());
+ DotAccessorNode* dot = static_cast<DotAccessorNode*>(expr);
+ PostfixDotNode* node = new (m_globalData) PostfixDotNode(m_globalData, dot->base(), dot->identifier(), op, divot, divot - start, end - divot);
+ node->setSubexpressionInfo(dot->divot(), dot->endOffset());
+ return node;
+}
+
+}
+
+#endif
diff --git a/JavaScriptCore/parser/JSParser.cpp b/JavaScriptCore/parser/JSParser.cpp
new file mode 100644
index 0000000..1934c0c
--- /dev/null
+++ b/JavaScriptCore/parser/JSParser.cpp
@@ -0,0 +1,1504 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(RECURSIVE_PARSE)
+#include "JSParser.h"
+
+using namespace JSC;
+
+#include "JSGlobalData.h"
+#include "NodeInfo.h"
+#include "Grammar.h"
+#include "ASTBuilder.h"
+#include <utility>
+
+using namespace std;
+
+namespace JSC {
+#define fail() do { m_error = true; return 0; } while (0)
+#define failIfFalse(cond) do { if (!(cond)) fail(); } while (0)
+#define failIfTrue(cond) do { if ((cond)) fail(); } while (0)
+#define consumeOrFail(tokenType) do { if (!consume(tokenType)) fail(); } while (0)
+#define matchOrFail(tokenType) do { if (!match(tokenType)) fail(); } while (0)
+#define failIfStackOverflow() do { failIfFalse(canRecurse()); } while (0)
+
+// Macros to make the more common TreeBuilder types a little less verbose
+#define TreeStatement typename TreeBuilder::Statement
+#define TreeExpression typename TreeBuilder::Expression
+#define TreeFormalParameterList typename TreeBuilder::FormalParameterList
+#define TreeSourceElements typename TreeBuilder::SourceElements
+#define TreeClause typename TreeBuilder::Clause
+#define TreeClauseList typename TreeBuilder::ClauseList
+#define TreeConstDeclList typename TreeBuilder::ConstDeclList
+#define TreeArguments typename TreeBuilder::Arguments
+#define TreeArgumentsList typename TreeBuilder::ArgumentsList
+#define TreeFunctionBody typename TreeBuilder::FunctionBody
+#define TreeProperty typename TreeBuilder::Property
+#define TreePropertyList typename TreeBuilder::PropertyList
+
+// This matches v8
+static const ptrdiff_t kMaxParserStackUsage = 128 * sizeof(void*) * 1024;
+
+class JSParser {
+public:
+ JSParser(Lexer*, JSGlobalData*);
+ bool parseProgram();
+private:
+ struct AllowInOverride {
+ AllowInOverride(JSParser* parser)
+ : m_parser(parser)
+ , m_oldAllowsIn(parser->m_allowsIn)
+ {
+ parser->m_allowsIn = true;
+ }
+ ~AllowInOverride()
+ {
+ m_parser->m_allowsIn = m_oldAllowsIn;
+ }
+ JSParser* m_parser;
+ bool m_oldAllowsIn;
+ };
+
+ const JSToken& token() { return m_token; }
+ void next()
+ {
+ m_lastLine = token().m_info.last_line;
+ m_lastTokenEnd = token().m_info.last_column;
+ m_lexer->setLastLineNumber(m_lastLine);
+ m_token.m_type = m_lexer->lex(&m_token.m_data, &m_token.m_info);
+ m_tokenCount++;
+ }
+
+ bool consume(int expected)
+ {
+ bool result = m_token.m_type == expected;
+ failIfFalse(result);
+ next();
+ return result;
+ }
+
+ bool match(int expected)
+ {
+ return m_token.m_type == expected;
+ }
+
+ int tokenStart()
+ {
+ return token().m_info.first_column;
+ }
+
+ int tokenLine()
+ {
+ return token().m_info.first_line;
+ }
+
+ int tokenEnd()
+ {
+ return token().m_info.last_column;
+ }
+
+ template <class TreeBuilder> TreeSourceElements parseSourceElements(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseFunctionDeclaration(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseVarDeclaration(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseConstDeclaration(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseDoWhileStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseWhileStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseForStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseBreakStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseContinueStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseReturnStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseThrowStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseWithStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseSwitchStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeClauseList parseSwitchClauses(TreeBuilder&);
+ template <class TreeBuilder> TreeClause parseSwitchDefaultClause(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseTryStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseDebuggerStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseExpressionStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseExpressionOrLabelStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeStatement parseIfStatement(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeStatement parseBlockStatement(TreeBuilder&);
+ template <class TreeBuilder> TreeExpression parseExpression(TreeBuilder&);
+ template <class TreeBuilder> TreeExpression parseAssignmentExpression(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseConditionalExpression(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseBinaryExpression(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseUnaryExpression(TreeBuilder&);
+ template <class TreeBuilder> TreeExpression parseMemberExpression(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parsePrimaryExpression(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseArrayLiteral(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseObjectLiteral(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeArguments parseArguments(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeProperty parseProperty(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeFunctionBody parseFunctionBody(TreeBuilder&);
+ template <class TreeBuilder> ALWAYS_INLINE TreeFormalParameterList parseFormalParameters(TreeBuilder&, bool& usesArguments);
+ template <class TreeBuilder> ALWAYS_INLINE TreeExpression parseVarDeclarationList(TreeBuilder&, int& declarations, const Identifier*& lastIdent, TreeExpression& lastInitializer, int& identStart, int& initStart, int& initEnd);
+ template <class TreeBuilder> ALWAYS_INLINE TreeConstDeclList parseConstDeclarationList(TreeBuilder& context);
+ enum FunctionRequirements { FunctionNoRequirements, FunctionNeedsName };
+ template <FunctionRequirements, class TreeBuilder> bool parseFunctionInfo(TreeBuilder&, const Identifier*&, TreeFormalParameterList&, TreeFunctionBody&, int& openBrace, int& closeBrace, int& bodyStartLine);
+ int isBinaryOperator(int token);
+ bool allowAutomaticSemicolon();
+
+ bool autoSemiColon()
+ {
+ if (token().m_type == ';') {
+ next();
+ return true;
+ }
+ return allowAutomaticSemicolon();
+ }
+
+ bool canRecurse()
+ {
+ char sample = 0;
+ ASSERT(m_endAddress);
+ return &sample > m_endAddress;
+ }
+
+ int lastTokenEnd() const
+ {
+ return m_lastTokenEnd;
+ }
+
+ ParserArena m_arena;
+ Lexer* m_lexer;
+ char* m_endAddress;
+ bool m_error;
+ JSGlobalData* m_globalData;
+ JSToken m_token;
+ bool m_allowsIn;
+ int m_tokenCount;
+ int m_lastLine;
+ int m_lastTokenEnd;
+ int m_assignmentCount;
+ int m_nonLHSCount;
+};
+
+int jsParse(JSGlobalData* globalData)
+{
+ JSParser parser(globalData->lexer, globalData);
+ return parser.parseProgram();
+}
+
+JSParser::JSParser(Lexer* lexer, JSGlobalData* globalData)
+ : m_lexer(lexer)
+ , m_endAddress(0)
+ , m_error(false)
+ , m_globalData(globalData)
+ , m_allowsIn(true)
+ , m_tokenCount(0)
+ , m_lastLine(0)
+ , m_lastTokenEnd(0)
+ , m_assignmentCount(0)
+ , m_nonLHSCount(0)
+{
+ m_endAddress = *(globalData->stackGuards);
+ if (!m_endAddress) {
+ char sample = 0;
+ m_endAddress = &sample - kMaxParserStackUsage;
+ *(globalData->stackGuards) = m_endAddress;
+ }
+ next();
+ m_lexer->setLastLineNumber(tokenLine());
+}
+
+bool JSParser::parseProgram()
+{
+ ASTBuilder context(m_globalData, m_lexer);
+ SourceElements* sourceElements = parseSourceElements<ASTBuilder>(context);
+ if (!sourceElements || !consume(0))
+ return true;
+ m_globalData->parser->didFinishParsing(sourceElements, context.varDeclarations(), context.funcDeclarations(), context.features(),
+ m_lastLine, context.numConstants());
+ return false;
+}
+
+bool JSParser::allowAutomaticSemicolon()
+{
+ return match(CLOSEBRACE) || match(0) || m_lexer->prevTerminator();
+}
+
+template <class TreeBuilder> TreeSourceElements JSParser::parseSourceElements(TreeBuilder& context)
+{
+ TreeSourceElements sourceElements = context.createSourceElements();
+ while (TreeStatement statement = parseStatement(context))
+ context.appendStatement(sourceElements, statement);
+
+ if (m_error)
+ fail();
+ return sourceElements;
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseVarDeclaration(TreeBuilder& context)
+{
+ ASSERT(match(VAR));
+ int start = tokenLine();
+ int end = 0;
+ int scratch;
+ const Identifier* scratch1 = 0;
+ TreeExpression scratch2 = 0;
+ int scratch3 = 0;
+ TreeExpression varDecls = parseVarDeclarationList(context, scratch, scratch1, scratch2, scratch3, scratch3, scratch3);
+ failIfTrue(m_error);
+ failIfFalse(autoSemiColon());
+
+ return context.createVarStatement(varDecls, start, end);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseConstDeclaration(TreeBuilder& context)
+{
+ ASSERT(match(CONSTTOKEN));
+ int start = tokenLine();
+ int end = 0;
+ TreeConstDeclList constDecls = parseConstDeclarationList(context);
+ failIfTrue(m_error);
+ failIfFalse(autoSemiColon());
+
+ return context.createConstStatement(constDecls, start, end);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseDoWhileStatement(TreeBuilder& context)
+{
+ ASSERT(match(DO));
+ int startLine = tokenLine();
+ next();
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+ int endLine = tokenLine();
+ consumeOrFail(WHILE);
+ consumeOrFail('(');
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ consumeOrFail(')');
+ if (match(';'))
+ next(); // Always performs automatic semicolon insertion.
+ return context.createDoWhileStatement(statement, expr, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseWhileStatement(TreeBuilder& context)
+{
+ ASSERT(match(WHILE));
+ int startLine = tokenLine();
+ next();
+ consumeOrFail('(');
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ int endLine = tokenLine();
+ consumeOrFail(')');
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+ return context.createWhileStatement(expr, statement, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseVarDeclarationList(TreeBuilder& context, int& declarations, const Identifier*& lastIdent, TreeExpression& lastInitializer, int& identStart, int& initStart, int& initEnd)
+{
+ TreeExpression varDecls = 0;
+ do {
+ declarations++;
+ next();
+ matchOrFail(IDENT);
+
+ int varStart = tokenStart();
+ identStart = varStart;
+ const Identifier* name = token().m_data.ident;
+ lastIdent = name;
+ next();
+ bool hasInitializer = match('=');
+ context.addVar(name, (hasInitializer || (!m_allowsIn && match(INTOKEN))) ? DeclarationStacks::HasInitializer : 0);
+ if (hasInitializer) {
+ int varDivot = tokenStart() + 1;
+ initStart = tokenStart();
+ next(); // consume '='
+ int initialAssignments = m_assignmentCount;
+ TreeExpression initializer = parseAssignmentExpression(context);
+ initEnd = lastTokenEnd();
+ lastInitializer = initializer;
+ failIfFalse(initializer);
+
+ TreeExpression node = context.createAssignResolve(*name, initializer, initialAssignments != m_assignmentCount, varStart, varDivot, lastTokenEnd());
+ if (!varDecls)
+ varDecls = node;
+ else
+ varDecls = context.combineCommaNodes(varDecls, node);
+ }
+ } while (match(','));
+ return varDecls;
+}
+
+template <class TreeBuilder> TreeConstDeclList JSParser::parseConstDeclarationList(TreeBuilder& context)
+{
+ TreeConstDeclList constDecls = 0;
+ TreeConstDeclList tail = 0;
+ do {
+ next();
+ matchOrFail(IDENT);
+ const Identifier* name = token().m_data.ident;
+ next();
+ bool hasInitializer = match('=');
+ context.addVar(name, DeclarationStacks::IsConstant | (hasInitializer ? DeclarationStacks::HasInitializer : 0));
+ TreeExpression initializer = 0;
+ if (hasInitializer) {
+ next(); // consume '='
+ initializer = parseAssignmentExpression(context);
+ }
+ tail = context.appendConstDecl(tail, name, initializer);
+ if (!constDecls)
+ constDecls = tail;
+ } while (match(','));
+ return constDecls;
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseForStatement(TreeBuilder& context)
+{
+ ASSERT(match(FOR));
+ int startLine = tokenLine();
+ next();
+ consumeOrFail('(');
+ int nonLHSCount = m_nonLHSCount;
+ int declarations = 0;
+ int declsStart = 0;
+ int declsEnd = 0;
+ TreeExpression decls = 0;
+ bool hasDeclaration = false;
+ if (match(VAR)) {
+ /*
+ for (var IDENT in expression) statement
+ for (var IDENT = expression in expression) statement
+ for (var varDeclarationList; expressionOpt; expressionOpt)
+ */
+ hasDeclaration = true;
+ const Identifier* forInTarget = 0;
+ TreeExpression forInInitializer = 0;
+ m_allowsIn = false;
+ int initStart = 0;
+ int initEnd = 0;
+ decls = parseVarDeclarationList(context, declarations, forInTarget, forInInitializer, declsStart, initStart, initEnd);
+ m_allowsIn = true;
+ if (m_error)
+ fail();
+
+ // Remainder of a standard for loop is handled identically
+ if (declarations > 1 || match(';'))
+ goto standardForLoop;
+
+ // Handle for-in with var declaration
+ int inLocation = tokenStart();
+ if (!consume(INTOKEN))
+ fail();
+
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ int exprEnd = lastTokenEnd();
+
+ int endLine = tokenLine();
+ consumeOrFail(')');
+
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+
+ return context.createForInLoop(forInTarget, forInInitializer, expr, statement, declsStart, inLocation, exprEnd, initStart, initEnd, startLine, endLine);
+ }
+
+ if (!match(';')) {
+ m_allowsIn = false;
+ declsStart = tokenStart();
+ decls = parseExpression(context);
+ declsEnd = lastTokenEnd();
+ m_allowsIn = true;
+ failIfFalse(decls);
+ }
+
+ if (match(';')) {
+ standardForLoop:
+ // Standard for loop
+ next();
+ TreeExpression condition = 0;
+
+ if (!match(';')) {
+ condition = parseExpression(context);
+ failIfFalse(condition);
+ }
+ consumeOrFail(';');
+
+ TreeExpression increment = 0;
+ if (!match(')')) {
+ increment = parseExpression(context);
+ failIfFalse(increment);
+ }
+ int endLine = tokenLine();
+ consumeOrFail(')');
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+ return context.createForLoop(decls, condition, increment, statement, hasDeclaration, startLine, endLine);
+ }
+
+ // For-in loop
+ failIfFalse(nonLHSCount == m_nonLHSCount);
+ consumeOrFail(INTOKEN);
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ int exprEnd = lastTokenEnd();
+ int endLine = tokenLine();
+ consumeOrFail(')');
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+
+ return context.createForInLoop(decls, expr, statement, declsStart, declsEnd, exprEnd, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseBreakStatement(TreeBuilder& context)
+{
+ ASSERT(match(BREAK));
+ int startCol = tokenStart();
+ int endCol = tokenEnd();
+ int startLine = tokenLine();
+ int endLine = tokenLine();
+ next();
+
+ if (autoSemiColon())
+ return context.createBreakStatement(startCol, endCol, startLine, endLine);
+ matchOrFail(IDENT);
+ const Identifier* ident = token().m_data.ident;
+ endCol = tokenEnd();
+ endLine = tokenLine();
+ next();
+ failIfFalse(autoSemiColon());
+ return context.createBreakStatement(ident, startCol, endCol, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseContinueStatement(TreeBuilder& context)
+{
+ ASSERT(match(CONTINUE));
+ int startCol = tokenStart();
+ int endCol = tokenEnd();
+ int startLine = tokenLine();
+ int endLine = tokenLine();
+ next();
+
+ if (autoSemiColon())
+ return context.createContinueStatement(startCol, endCol, startLine, endLine);
+ matchOrFail(IDENT);
+ const Identifier* ident = token().m_data.ident;
+ endCol = tokenEnd();
+ endLine = tokenLine();
+ next();
+ failIfFalse(autoSemiColon());
+ return context.createContinueStatement(ident, startCol, endCol, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseReturnStatement(TreeBuilder& context)
+{
+ ASSERT(match(RETURN));
+ int startLine = tokenLine();
+ int endLine = startLine;
+ int start = tokenStart();
+ int end = tokenEnd();
+ next();
+ // We do the auto semicolon check before attempting to parse an expression
+ // as we need to ensure the a line break after the return correctly terminates
+ // the statement
+ if (match(';'))
+ endLine = tokenLine();
+ if (autoSemiColon())
+ return context.createReturnStatement(0, start, end, startLine, endLine);
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ end = lastTokenEnd();
+ if (match(';'))
+ endLine = tokenLine();
+ failIfFalse(autoSemiColon());
+ return context.createReturnStatement(expr, start, end, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseThrowStatement(TreeBuilder& context)
+{
+ ASSERT(match(THROW));
+ int eStart = tokenStart();
+ int startLine = tokenLine();
+ next();
+
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ int eEnd = lastTokenEnd();
+ int endLine = tokenLine();
+ failIfFalse(autoSemiColon());
+
+ return context.createThrowStatement(expr, eStart, eEnd, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseWithStatement(TreeBuilder& context)
+{
+ ASSERT(match(WITH));
+ int startLine = tokenLine();
+ next();
+ consumeOrFail('(');
+ int start = tokenStart();
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ int end = lastTokenEnd();
+
+ int endLine = tokenLine();
+ consumeOrFail(')');
+
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+
+ return context.createWithStatement(expr, statement, start, end, startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseSwitchStatement(TreeBuilder& context)
+{
+ ASSERT(match(SWITCH));
+ int startLine = tokenLine();
+ next();
+ consumeOrFail('(');
+ TreeExpression expr = parseExpression(context);
+ failIfFalse(expr);
+ int endLine = tokenLine();
+ consumeOrFail(')');
+ consumeOrFail(OPENBRACE);
+
+ TreeClauseList firstClauses = parseSwitchClauses(context);
+ failIfTrue(m_error);
+
+ TreeClause defaultClause = parseSwitchDefaultClause(context);
+ failIfTrue(m_error);
+
+ TreeClauseList secondClauses = parseSwitchClauses(context);
+ failIfTrue(m_error);
+ consumeOrFail(CLOSEBRACE);
+
+ return context.createSwitchStatement(expr, firstClauses, defaultClause, secondClauses, startLine, endLine);
+
+}
+
+template <class TreeBuilder> TreeClauseList JSParser::parseSwitchClauses(TreeBuilder& context)
+{
+ if (!match(CASE))
+ return 0;
+ next();
+ TreeExpression condition = parseExpression(context);
+ failIfFalse(condition);
+ consumeOrFail(':');
+ TreeSourceElements statements = parseSourceElements(context);
+ failIfFalse(statements);
+ TreeClause clause = context.createClause(condition, statements);
+ TreeClauseList clauseList = context.createClauseList(clause);
+ TreeClauseList tail = clauseList;
+
+ while (match(CASE)) {
+ next();
+ TreeExpression condition = parseExpression(context);
+ failIfFalse(condition);
+ consumeOrFail(':');
+ TreeSourceElements statements = parseSourceElements(context);
+ failIfFalse(statements);
+ clause = context.createClause(condition, statements);
+ tail = context.createClauseList(tail, clause);
+ }
+ return clauseList;
+}
+
+template <class TreeBuilder> TreeClause JSParser::parseSwitchDefaultClause(TreeBuilder& context)
+{
+ if (!match(DEFAULT))
+ return 0;
+ next();
+ consumeOrFail(':');
+ TreeSourceElements statements = parseSourceElements(context);
+ failIfFalse(statements);
+ return context.createClause(0, statements);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseTryStatement(TreeBuilder& context)
+{
+ ASSERT(match(TRY));
+ TreeStatement tryBlock = 0;
+ const Identifier* ident = &m_globalData->propertyNames->nullIdentifier;
+ bool catchHasEval = false;
+ TreeStatement catchBlock = 0;
+ TreeStatement finallyBlock = 0;
+ int firstLine = tokenLine();
+ next();
+ matchOrFail(OPENBRACE);
+
+ tryBlock = parseBlockStatement(context);
+ failIfFalse(tryBlock);
+ int lastLine = m_lastLine;
+
+ if (match(CATCH)) {
+ next();
+ consumeOrFail('(');
+ matchOrFail(IDENT);
+ ident = token().m_data.ident;
+ next();
+ consumeOrFail(')');
+ matchOrFail(OPENBRACE);
+ int initialEvalCount = context.evalCount();
+ catchBlock = parseBlockStatement(context);
+ failIfFalse(catchBlock);
+ catchHasEval = initialEvalCount != context.evalCount();
+ }
+
+ if (match(FINALLY)) {
+ next();
+ matchOrFail(OPENBRACE);
+ finallyBlock = parseBlockStatement(context);
+ failIfFalse(finallyBlock);
+ }
+ failIfFalse(catchBlock || finallyBlock);
+ return context.createTryStatement(tryBlock, ident, catchHasEval, catchBlock, finallyBlock, firstLine, lastLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseDebuggerStatement(TreeBuilder& context)
+{
+ ASSERT(match(DEBUGGER));
+ int startLine = tokenLine();
+ int endLine = startLine;
+ next();
+ if (match(';'))
+ startLine = tokenLine();
+ failIfFalse(autoSemiColon());
+ return context.createDebugger(startLine, endLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseBlockStatement(TreeBuilder& context)
+{
+ ASSERT(match(OPENBRACE));
+ int start = tokenLine();
+ next();
+ if (match(CLOSEBRACE)) {
+ next();
+ return context.createBlockStatement(0, start, m_lastLine);
+ }
+ TreeSourceElements subtree = parseSourceElements(context);
+ failIfFalse(subtree);
+ matchOrFail(CLOSEBRACE);
+ next();
+ return context.createBlockStatement(subtree, start, m_lastLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseStatement(TreeBuilder& context)
+{
+ failIfStackOverflow();
+ switch (token().m_type) {
+ case OPENBRACE:
+ return parseBlockStatement(context);
+ case VAR:
+ return parseVarDeclaration(context);
+ case CONSTTOKEN:
+ return parseConstDeclaration(context);
+ case FUNCTION:
+ return parseFunctionDeclaration(context);
+ case ';':
+ next();
+ return context.createEmptyStatement();
+ case IF:
+ return parseIfStatement(context);
+ case DO:
+ return parseDoWhileStatement(context);
+ case WHILE:
+ return parseWhileStatement(context);
+ case FOR:
+ return parseForStatement(context);
+ case CONTINUE:
+ return parseContinueStatement(context);
+ case BREAK:
+ return parseBreakStatement(context);
+ case RETURN:
+ return parseReturnStatement(context);
+ case WITH:
+ return parseWithStatement(context);
+ case SWITCH:
+ return parseSwitchStatement(context);
+ case THROW:
+ return parseThrowStatement(context);
+ case TRY:
+ return parseTryStatement(context);
+ case DEBUGGER:
+ return parseDebuggerStatement(context);
+ case 0:
+ case CASE:
+ case CLOSEBRACE:
+ case DEFAULT:
+ // These tokens imply the end of a set of source elements
+ return 0;
+ case IDENT:
+ return parseExpressionOrLabelStatement(context);
+ default:
+ return parseExpressionStatement(context);
+ }
+}
+
+template <class TreeBuilder> TreeFormalParameterList JSParser::parseFormalParameters(TreeBuilder& context, bool& usesArguments)
+{
+ matchOrFail(IDENT);
+ usesArguments = m_globalData->propertyNames->arguments == *token().m_data.ident;
+ TreeFormalParameterList list = context.createFormalParameterList(*token().m_data.ident);
+ TreeFormalParameterList tail = list;
+ next();
+ while (match(',')) {
+ next();
+ matchOrFail(IDENT);
+ const Identifier* ident = token().m_data.ident;
+ next();
+ usesArguments = usesArguments || m_globalData->propertyNames->arguments == *ident;
+ tail = context.createFormalParameterList(tail, *ident);
+ }
+ return list;
+}
+
+template <class TreeBuilder> TreeFunctionBody JSParser::parseFunctionBody(TreeBuilder& context)
+{
+ if (match(CLOSEBRACE))
+ return context.createFunctionBody();
+ typename TreeBuilder::FunctionBodyBuilder bodyBuilder(m_globalData, m_lexer);
+ failIfFalse(parseSourceElements(bodyBuilder));
+ return context.createFunctionBody();
+}
+
+template <JSParser::FunctionRequirements requirements, class TreeBuilder> bool JSParser::parseFunctionInfo(TreeBuilder& context, const Identifier*& name, TreeFormalParameterList& parameters, TreeFunctionBody& body, int& openBracePos, int& closeBracePos, int& bodyStartLine)
+{
+ if (match(IDENT)) {
+ name = token().m_data.ident;
+ next();
+ } else if (requirements == FunctionNeedsName)
+ return false;
+ consumeOrFail('(');
+ bool usesArguments = false;
+ if (!match(')')) {
+ parameters = parseFormalParameters(context, usesArguments);
+ failIfFalse(parameters);
+ }
+ consumeOrFail(')');
+ matchOrFail(OPENBRACE);
+
+ openBracePos = token().m_data.intValue;
+ bodyStartLine = tokenLine();
+ next();
+
+ body = parseFunctionBody(context);
+ failIfFalse(body);
+ if (usesArguments)
+ context.setUsesArguments(body);
+
+ matchOrFail(CLOSEBRACE);
+ closeBracePos = token().m_data.intValue;
+ next();
+ return true;
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseFunctionDeclaration(TreeBuilder& context)
+{
+ ASSERT(match(FUNCTION));
+ next();
+ const Identifier* name = 0;
+ TreeFormalParameterList parameters = 0;
+ TreeFunctionBody body = 0;
+ int openBracePos = 0;
+ int closeBracePos = 0;
+ int bodyStartLine = 0;
+ failIfFalse(parseFunctionInfo<FunctionNeedsName>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine));
+ failIfFalse(name);
+ return context.createFuncDeclStatement(name, body, parameters, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseExpressionOrLabelStatement(TreeBuilder& context)
+{
+
+ /* Expression and Label statements are ambiguous at LL(1), to avoid
+ * the cost of having a token buffer to support LL(2) we simply assume
+ * we have an expression statement, and then only look for a label if that
+ * parse fails.
+ */
+ int start = tokenStart();
+ int startLine = tokenLine();
+ const Identifier* ident = token().m_data.ident;
+ int currentToken = m_tokenCount;
+ TreeExpression expression = parseExpression(context);
+ failIfFalse(expression);
+ if (autoSemiColon())
+ return context.createExprStatement(expression, startLine, m_lastLine);
+ failIfFalse(currentToken + 1 == m_tokenCount);
+ int end = tokenEnd();
+ consumeOrFail(':');
+ TreeStatement statement = parseStatement(context);
+ failIfFalse(statement);
+ return context.createLabelStatement(ident, statement, start, end);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseExpressionStatement(TreeBuilder& context)
+{
+ int startLine = tokenLine();
+ TreeExpression expression = parseExpression(context);
+ failIfFalse(expression);
+ failIfFalse(autoSemiColon());
+ return context.createExprStatement(expression, startLine, m_lastLine);
+}
+
+template <class TreeBuilder> TreeStatement JSParser::parseIfStatement(TreeBuilder& context)
+{
+ ASSERT(match(IF));
+
+ int start = tokenLine();
+ next();
+
+ consumeOrFail('(');
+
+ TreeExpression condition = parseExpression(context);
+ failIfFalse(condition);
+ int end = tokenLine();
+ consumeOrFail(')');
+
+ TreeStatement trueBlock = parseStatement(context);
+ failIfFalse(trueBlock);
+
+ if (!match(ELSE))
+ return context.createIfStatement(condition, trueBlock, start, end);
+
+ Vector<TreeExpression> exprStack;
+ Vector<pair<int, int> > posStack;
+ Vector<TreeStatement> statementStack;
+ bool trailingElse = false;
+ do {
+ next();
+ if (!match(IF)) {
+ TreeStatement block = parseStatement(context);
+ failIfFalse(block);
+ statementStack.append(block);
+ trailingElse = true;
+ break;
+ }
+ int innerStart = tokenLine();
+ next();
+
+ consumeOrFail('(');
+
+ TreeExpression innerCondition = parseExpression(context);
+ failIfFalse(innerCondition);
+ int innerEnd = tokenLine();
+ consumeOrFail(')');
+
+ TreeStatement innerTrueBlock = parseStatement(context);
+ failIfFalse(innerTrueBlock);
+ exprStack.append(innerCondition);
+ posStack.append(make_pair(innerStart, innerEnd));
+ statementStack.append(innerTrueBlock);
+ } while (match(ELSE));
+
+ if (!trailingElse) {
+ TreeExpression condition = exprStack.last();
+ exprStack.removeLast();
+ TreeStatement trueBlock = statementStack.last();
+ statementStack.removeLast();
+ pair<int, int> pos = posStack.last();
+ posStack.removeLast();
+ statementStack.append(context.createIfStatement(condition, trueBlock, pos.first, pos.second));
+ }
+
+ while (!exprStack.isEmpty()) {
+ TreeExpression condition = exprStack.last();
+ exprStack.removeLast();
+ TreeStatement falseBlock = statementStack.last();
+ statementStack.removeLast();
+ TreeStatement trueBlock = statementStack.last();
+ statementStack.removeLast();
+ pair<int, int> pos = posStack.last();
+ posStack.removeLast();
+ statementStack.append(context.createIfStatement(condition, trueBlock, falseBlock, pos.first, pos.second));
+ }
+
+ return context.createIfStatement(condition, trueBlock, statementStack.last(), start, end);
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseExpression(TreeBuilder& context)
+{
+ failIfStackOverflow();
+ TreeExpression node = parseAssignmentExpression(context);
+ failIfFalse(node);
+ if (!match(','))
+ return node;
+ next();
+ m_nonLHSCount++;
+ TreeExpression right = parseAssignmentExpression(context);
+ failIfFalse(right);
+ typename TreeBuilder::Comma commaNode = context.createCommaExpr(node, right);
+ while (match(',')) {
+ next();
+ right = parseAssignmentExpression(context);
+ failIfFalse(right);
+ context.appendToComma(commaNode, right);
+ }
+ return commaNode;
+}
+
+
+template <typename TreeBuilder> TreeExpression JSParser::parseAssignmentExpression(TreeBuilder& context)
+{
+ failIfStackOverflow();
+ int start = tokenStart();
+ int initialAssignmentCount = m_assignmentCount;
+ int initialNonLHSCount = m_nonLHSCount;
+ TreeExpression lhs = parseConditionalExpression(context);
+ failIfFalse(lhs);
+ if (initialNonLHSCount != m_nonLHSCount)
+ return lhs;
+
+ int assignmentStack = 0;
+ Operator op;
+ bool hadAssignment = false;
+ while (true) {
+ switch (token().m_type) {
+ case '=': op = OpEqual; break;
+ case PLUSEQUAL: op = OpPlusEq; break;
+ case MINUSEQUAL: op = OpMinusEq; break;
+ case MULTEQUAL: op = OpMultEq; break;
+ case DIVEQUAL: op = OpDivEq; break;
+ case LSHIFTEQUAL: op = OpLShift; break;
+ case RSHIFTEQUAL: op = OpRShift; break;
+ case URSHIFTEQUAL: op = OpURShift; break;
+ case ANDEQUAL: op = OpAndEq; break;
+ case XOREQUAL: op = OpXOrEq; break;
+ case OREQUAL: op = OpOrEq; break;
+ case MODEQUAL: op = OpModEq; break;
+ default:
+ goto end;
+ }
+ hadAssignment = true;
+ context.assignmentStackAppend(assignmentStack, lhs, start, tokenStart(), m_assignmentCount, op);
+ start = tokenStart();
+ m_assignmentCount++;
+ next();
+ lhs = parseConditionalExpression(context);
+ failIfFalse(lhs);
+ if (initialNonLHSCount != m_nonLHSCount)
+ break;
+ }
+end:
+ if (hadAssignment)
+ m_nonLHSCount++;
+
+ if (!ASTBuilder::CreatesAST)
+ return lhs;
+
+ while (assignmentStack)
+ lhs = context.createAssignment(assignmentStack, lhs, initialAssignmentCount, m_assignmentCount, lastTokenEnd());
+
+ return lhs;
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseConditionalExpression(TreeBuilder& context)
+{
+ TreeExpression cond = parseBinaryExpression(context);
+ failIfFalse(cond);
+ if (!match('?'))
+ return cond;
+ m_nonLHSCount++;
+ next();
+ TreeExpression lhs = parseAssignmentExpression(context);
+ consumeOrFail(':');
+
+ TreeExpression rhs = parseAssignmentExpression(context);
+ failIfFalse(rhs);
+ return context.createConditionalExpr(cond, lhs, rhs);
+}
+
+static bool isUnaryOp(int token)
+{
+ switch (token) {
+ case '!':
+ case '~':
+ case '-':
+ case '+':
+ case PLUSPLUS:
+ case AUTOPLUSPLUS:
+ case MINUSMINUS:
+ case AUTOMINUSMINUS:
+ case TYPEOF:
+ case VOIDTOKEN:
+ case DELETETOKEN:
+ return true;
+ default:
+ return false;
+ }
+}
+
+int JSParser::isBinaryOperator(int token)
+{
+ switch (token) {
+ case OR:
+ return 1;
+
+ case AND:
+ return 2;
+
+ case '|':
+ return 3;
+
+ case '^':
+ return 4;
+
+ case '&':
+ return 5;
+
+ case EQEQ:
+ case NE:
+ case STREQ:
+ case STRNEQ:
+ return 6;
+
+ case '<':
+ case '>':
+ case LE:
+ case GE:
+ case INSTANCEOF:
+ return 7;
+
+ case INTOKEN:
+ // same precedence as the above but needs a validity check
+ if (m_allowsIn)
+ return 7;
+ return 0;
+
+ case LSHIFT:
+ case RSHIFT:
+ case URSHIFT:
+ return 8;
+
+ case '+':
+ case '-':
+ return 9;
+
+ case '*':
+ case '/':
+ case '%':
+ return 10;
+
+ default:
+ return 0;
+ }
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseBinaryExpression(TreeBuilder& context)
+{
+
+ int operandStackDepth = 0;
+ int operatorStackDepth = 0;
+ while (true) {
+ int exprStart = tokenStart();
+ int initialAssignments = m_assignmentCount;
+ TreeExpression current = parseUnaryExpression(context);
+ failIfFalse(current);
+
+ context.appendBinaryExpressionInfo(operandStackDepth, current, exprStart, lastTokenEnd(), lastTokenEnd(), initialAssignments != m_assignmentCount);
+ int precedence = isBinaryOperator(token().m_type);
+ if (!precedence)
+ break;
+ m_nonLHSCount++;
+ int operatorToken = token().m_type;
+ next();
+
+ while (operatorStackDepth && context.operatorStackHasHigherPrecedence(operatorStackDepth, precedence)) {
+ ASSERT(operandStackDepth > 1);
+
+ typename TreeBuilder::BinaryOperand rhs = context.getFromOperandStack(-1);
+ typename TreeBuilder::BinaryOperand lhs = context.getFromOperandStack(-2);
+ context.shrinkOperandStackBy(operandStackDepth, 2);
+ context.appendBinaryOperation(operandStackDepth, operatorStackDepth, lhs, rhs);
+ context.operatorStackPop(operatorStackDepth);
+ }
+ context.operatorStackAppend(operatorStackDepth, operatorToken, precedence);
+ }
+
+ while (operatorStackDepth) {
+ ASSERT(operandStackDepth > 1);
+
+ typename TreeBuilder::BinaryOperand rhs = context.getFromOperandStack(-1);
+ typename TreeBuilder::BinaryOperand lhs = context.getFromOperandStack(-2);
+ context.shrinkOperandStackBy(operandStackDepth, 2);
+ context.appendBinaryOperation(operandStackDepth, operatorStackDepth, lhs, rhs);
+ context.operatorStackPop(operatorStackDepth);
+ }
+ return context.popOperandStack(operandStackDepth);
+}
+
+
+template <class TreeBuilder> TreeProperty JSParser::parseProperty(TreeBuilder& context)
+{
+ bool wasIdent = false;
+ switch (token().m_type) {
+ case IDENT:
+ wasIdent = true;
+ case STRING: {
+ const Identifier* ident = token().m_data.ident;
+ next();
+ if (match(':')) {
+ next();
+ TreeExpression node = parseAssignmentExpression(context);
+ failIfFalse(node);
+ return context.createProperty(ident, node, PropertyNode::Constant);
+ }
+ failIfFalse(wasIdent);
+ matchOrFail(IDENT);
+ const Identifier* accessorName = 0;
+ TreeFormalParameterList parameters = 0;
+ TreeFunctionBody body = 0;
+ int openBracePos = 0;
+ int closeBracePos = 0;
+ int bodyStartLine = 0;
+ failIfFalse(parseFunctionInfo<FunctionNeedsName>(context, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine));
+ return context.createGetterOrSetterProperty(ident, accessorName, parameters, body, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
+ }
+ case NUMBER: {
+ double propertyName = token().m_data.doubleValue;
+ next();
+ consumeOrFail(':');
+ TreeExpression node = parseAssignmentExpression(context);
+ failIfFalse(node);
+ return context.createProperty(propertyName, node, PropertyNode::Constant);
+ }
+ }
+ fail();
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseObjectLiteral(TreeBuilder& context)
+{
+ consumeOrFail(OPENBRACE);
+
+ if (match(CLOSEBRACE)) {
+ next();
+ return context.createObjectLiteral();
+ }
+
+ TreeProperty property = parseProperty(context);
+ failIfFalse(property);
+
+ TreePropertyList propertyList = context.createPropertyList(property);
+ TreePropertyList tail = propertyList;
+
+ while (match(',')) {
+ next();
+ // allow extra comma, see http://bugs.webkit.org/show_bug.cgi?id=5939
+ if (match(CLOSEBRACE))
+ break;
+ property = parseProperty(context);
+ failIfFalse(property);
+
+ tail = context.createPropertyList(property, tail);
+ }
+
+ consumeOrFail(CLOSEBRACE);
+
+ return context.createObjectLiteral(propertyList);
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseArrayLiteral(TreeBuilder& context)
+{
+ consumeOrFail('[');
+
+ int elisions = 0;
+ while (match(',')) {
+ next();
+ elisions++;
+ }
+ if (match(']')) {
+ next();
+ return context.createArray(elisions);
+ }
+
+ TreeExpression elem = parseAssignmentExpression(context);
+ failIfFalse(elem);
+ typename TreeBuilder::ElementList elementList = context.createElementList(elisions, elem);
+ typename TreeBuilder::ElementList tail = elementList;
+ elisions = 0;
+ while (match(',')) {
+ next();
+ elisions = 0;
+
+ while (match(',')) {
+ next();
+ elisions++;
+ }
+
+ if (match(']')) {
+ next();
+ return context.createArray(elisions, elementList);
+ }
+ TreeExpression elem = parseAssignmentExpression(context);
+ failIfFalse(elem);
+ tail = context.createElementList(tail, elisions, elem);
+ }
+
+ consumeOrFail(']');
+
+ return context.createArray(elementList);
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parsePrimaryExpression(TreeBuilder& context)
+{
+ switch (token().m_type) {
+ case OPENBRACE:
+ return parseObjectLiteral(context);
+ case '[':
+ return parseArrayLiteral(context);
+ case '(': {
+ next();
+ int oldNonLHSCount = m_nonLHSCount;
+ TreeExpression result = parseExpression(context);
+ m_nonLHSCount = oldNonLHSCount;
+ consumeOrFail(')');
+
+ return result;
+ }
+ case THISTOKEN: {
+ next();
+ return context.thisExpr();
+ }
+ case IDENT: {
+ int start = tokenStart();
+ const Identifier* ident = token().m_data.ident;
+ next();
+ return context.createResolve(ident, start);
+ }
+ case STRING: {
+ const Identifier* ident = token().m_data.ident;
+ next();
+ return context.createString(ident);
+ }
+ case NUMBER: {
+ double d = token().m_data.doubleValue;
+ next();
+ return context.createNumberExpr(d);
+ }
+ case NULLTOKEN: {
+ next();
+ return context.createNull();
+ }
+ case TRUETOKEN: {
+ next();
+ return context.createBoolean(true);
+ }
+ case FALSETOKEN: {
+ next();
+ return context.createBoolean(false);
+ }
+ case DIVEQUAL:
+ case '/': {
+ /* regexp */
+ const Identifier* pattern;
+ const Identifier* flags;
+ if (match(DIVEQUAL))
+ failIfFalse(m_lexer->scanRegExp(pattern, flags, '='));
+ else
+ failIfFalse(m_lexer->scanRegExp(pattern, flags));
+
+ int start = tokenStart();
+ next();
+ return context.createRegex(*pattern, *flags, start);
+ }
+ }
+ fail();
+}
+
+template <class TreeBuilder> TreeArguments JSParser::parseArguments(TreeBuilder& context)
+{
+ consumeOrFail('(');
+ if (match(')')) {
+ next();
+ return context.createArguments();
+ }
+ TreeExpression firstArg = parseAssignmentExpression(context);
+ failIfFalse(firstArg);
+
+ TreeArgumentsList argList = context.createArgumentsList(firstArg);
+ TreeArgumentsList tail = argList;
+ while (match(',')) {
+ next();
+ TreeExpression arg = parseAssignmentExpression(context);
+ failIfFalse(arg);
+ tail = context.createArgumentsList(tail, arg);
+ }
+ consumeOrFail(')');
+ return context.createArguments(argList);
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseMemberExpression(TreeBuilder& context)
+{
+ TreeExpression base = 0;
+ int start = tokenStart();
+ int expressionStart = start;
+ int newCount = 0;
+ while (match(NEW)) {
+ next();
+ newCount++;
+ }
+ if (match(FUNCTION)) {
+ const Identifier* name = &m_globalData->propertyNames->nullIdentifier;
+ TreeFormalParameterList parameters = 0;
+ TreeFunctionBody body = 0;
+ int openBracePos = 0;
+ int closeBracePos = 0;
+ int bodyStartLine = 0;
+ next();
+ failIfFalse(parseFunctionInfo<FunctionNoRequirements>(context, name, parameters, body, openBracePos, closeBracePos, bodyStartLine));
+ base = context.createFunctionExpr(name, body, parameters, openBracePos, closeBracePos, bodyStartLine, m_lastLine);
+ } else
+ base = parsePrimaryExpression(context);
+
+ failIfFalse(base);
+ while (true) {
+ switch (token().m_type) {
+ case '[': {
+ int expressionEnd = lastTokenEnd();
+ next();
+ int nonLHSCount = m_nonLHSCount;
+ int initialAssignments = m_assignmentCount;
+ TreeExpression property = parseExpression(context);
+ failIfFalse(property);
+ base = context.createBracketAccess(base, property, initialAssignments != m_assignmentCount, expressionStart, expressionEnd, tokenEnd());
+ if (!consume(']'))
+ fail();
+ m_nonLHSCount = nonLHSCount;
+ break;
+ }
+ case '(': {
+ if (newCount) {
+ newCount--;
+ if (match('(')) {
+ int exprEnd = lastTokenEnd();
+ TreeArguments arguments = parseArguments(context);
+ failIfFalse(arguments);
+ base = context.createNewExpr(base, arguments, start, exprEnd, lastTokenEnd());
+ } else
+ base = context.createNewExpr(base, start, lastTokenEnd());
+ } else {
+ int nonLHSCount = m_nonLHSCount;
+ int expressionEnd = lastTokenEnd();
+ TreeArguments arguments = parseArguments(context);
+ failIfFalse(arguments);
+ base = context.makeFunctionCallNode(base, arguments, expressionStart, expressionEnd, lastTokenEnd());
+ m_nonLHSCount = nonLHSCount;
+ }
+ break;
+ }
+ case '.': {
+ int expressionEnd = lastTokenEnd();
+ next();
+ matchOrFail(IDENT);
+ base = context.createDotAccess(base, *token().m_data.ident, expressionStart, expressionEnd, tokenEnd());
+ next();
+ break;
+ }
+ default:
+ goto endMemberExpression;
+ }
+ }
+endMemberExpression:
+ while (newCount--)
+ base = context.createNewExpr(base, start, lastTokenEnd());
+ return base;
+}
+
+template <class TreeBuilder> TreeExpression JSParser::parseUnaryExpression(TreeBuilder& context)
+{
+ AllowInOverride allowInOverride(this);
+ int tokenStackDepth = 0;
+ while (isUnaryOp(token().m_type)) {
+ m_nonLHSCount++;
+ context.appendUnaryToken(tokenStackDepth, token().m_type, tokenStart());
+ next();
+ }
+ int subExprStart = tokenStart();
+ TreeExpression expr = parseMemberExpression(context);
+ failIfFalse(expr);
+ switch (token().m_type) {
+ case PLUSPLUS:
+ m_nonLHSCount++;
+ expr = context.makePostfixNode(expr, OpPlusPlus, subExprStart, lastTokenEnd(), tokenEnd());
+ m_assignmentCount++;
+ next();
+ break;
+ case MINUSMINUS:
+ m_nonLHSCount++;
+ expr = context.makePostfixNode(expr, OpMinusMinus, subExprStart, lastTokenEnd(), tokenEnd());
+ m_assignmentCount++;
+ next();
+ break;
+ }
+
+ int end = lastTokenEnd();
+
+ if (!TreeBuilder::CreatesAST)
+ return expr;
+
+ while (tokenStackDepth) {
+ switch (context.unaryTokenStackLastType(tokenStackDepth)) {
+ case '!':
+ expr = context.createLogicalNot(expr);
+ break;
+ case '~':
+ expr = context.makeBitwiseNotNode(expr);
+ break;
+ case '-':
+ expr = context.makeNegateNode(expr);
+ break;
+ case '+':
+ expr = context.createUnaryPlus(expr);
+ break;
+ case PLUSPLUS:
+ case AUTOPLUSPLUS:
+ expr = context.makePrefixNode(expr, OpPlusPlus, context.unaryTokenStackLastStart(tokenStackDepth), subExprStart + 1, end);
+ m_assignmentCount++;
+ break;
+ case MINUSMINUS:
+ case AUTOMINUSMINUS:
+ expr = context.makePrefixNode(expr, OpMinusMinus, context.unaryTokenStackLastStart(tokenStackDepth), subExprStart + 1, end);
+ m_assignmentCount++;
+ break;
+ case TYPEOF:
+ expr = context.makeTypeOfNode(expr);
+ break;
+ case VOIDTOKEN:
+ expr = context.createVoid(expr);
+ break;
+ case DELETETOKEN:
+ expr = context.makeDeleteNode(expr, context.unaryTokenStackLastStart(tokenStackDepth), end, end);
+ break;
+ default:
+ // If we get here something has gone horribly horribly wrong
+ CRASH();
+ }
+ subExprStart = context.unaryTokenStackLastStart(tokenStackDepth);
+ context.unaryTokenStackRemoveLast(tokenStackDepth);
+ }
+ return expr;
+}
+
+}
+
+#endif
+
diff --git a/JavaScriptCore/parser/JSParser.h b/JavaScriptCore/parser/JSParser.h
new file mode 100644
index 0000000..e212b2a
--- /dev/null
+++ b/JavaScriptCore/parser/JSParser.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef JSParser_h
+#define JSParser_h
+#if ENABLE(RECURSIVE_PARSE)
+
+namespace JSC {
+
+class Identifier;
+class JSGlobalData;
+
+enum JSTokenType {
+ NULLTOKEN = 258,
+ TRUETOKEN = 259,
+ FALSETOKEN = 260,
+ BREAK = 261,
+ CASE = 262,
+ DEFAULT = 263,
+ FOR = 264,
+ NEW = 265,
+ VAR = 266,
+ CONSTTOKEN = 267,
+ CONTINUE = 268,
+ FUNCTION = 269,
+ RETURN = 270,
+ VOIDTOKEN = 271,
+ DELETETOKEN = 272,
+ IF = 273,
+ THISTOKEN = 274,
+ DO = 275,
+ WHILE = 276,
+ INTOKEN = 277,
+ INSTANCEOF = 278,
+ TYPEOF = 279,
+ SWITCH = 280,
+ WITH = 281,
+ RESERVED = 282,
+ THROW = 283,
+ TRY = 284,
+ CATCH = 285,
+ FINALLY = 286,
+ DEBUGGER = 287,
+ IF_WITHOUT_ELSE = 288,
+ ELSE = 289,
+ EQEQ = 290,
+ NE = 291,
+ STREQ = 292,
+ STRNEQ = 293,
+ LE = 294,
+ GE = 295,
+ OR = 296,
+ AND = 297,
+ PLUSPLUS = 298,
+ MINUSMINUS = 299,
+ LSHIFT = 300,
+ RSHIFT = 301,
+ URSHIFT = 302,
+ PLUSEQUAL = 303,
+ MINUSEQUAL = 304,
+ MULTEQUAL = 305,
+ DIVEQUAL = 306,
+ LSHIFTEQUAL = 307,
+ RSHIFTEQUAL = 308,
+ URSHIFTEQUAL = 309,
+ ANDEQUAL = 310,
+ MODEQUAL = 311,
+ XOREQUAL = 312,
+ OREQUAL = 313,
+ OPENBRACE = 314,
+ CLOSEBRACE = 315,
+ NUMBER = 316,
+ IDENT = 317,
+ STRING = 318,
+ AUTOPLUSPLUS = 319,
+ AUTOMINUSMINUS = 320
+};
+
+union JSTokenData {
+ int intValue;
+ double doubleValue;
+ const Identifier* ident;
+};
+typedef JSTokenData YYSTYPE;
+
+struct JSTokenInfo {
+ JSTokenInfo() : last_line(0) {}
+ int first_line;
+ int last_line;
+ int first_column;
+ int last_column;
+};
+typedef JSTokenInfo YYLTYPE;
+struct JSToken {
+ int m_type;
+ JSTokenData m_data;
+ JSTokenInfo m_info;
+};
+
+int jsParse(JSGlobalData*);
+}
+#endif
+#endif // JSParser_h
diff --git a/JavaScriptCore/parser/Lexer.cpp b/JavaScriptCore/parser/Lexer.cpp
index 1af2d75..3a38273 100644
--- a/JavaScriptCore/parser/Lexer.cpp
+++ b/JavaScriptCore/parser/Lexer.cpp
@@ -24,7 +24,9 @@
#include "Lexer.h"
#include "JSFunction.h"
+
#include "JSGlobalObjectFunctions.h"
+#include "Identifier.h"
#include "NodeInfo.h"
#include "Nodes.h"
#include "dtoa.h"
@@ -36,10 +38,13 @@
using namespace WTF;
using namespace Unicode;
-// We can't specify the namespace in yacc's C output, so do it here instead.
+#if ENABLE(RECURSIVE_PARSE)
+#include "JSParser.h"
+#else
using namespace JSC;
-
#include "Grammar.h"
+#endif
+
#include "Lookup.h"
#include "Lexer.lut.h"
@@ -872,7 +877,7 @@ doneIdentifierOrKeyword: {
m_delimited = false;
m_buffer16.resize(0);
const HashEntry* entry = m_keywordTable.entry(m_globalData, *lvalp->ident);
- token = entry ? entry->lexerValue() : IDENT;
+ token = entry ? entry->lexerValue() : static_cast<int>(IDENT);
goto returnToken;
}
@@ -893,7 +898,6 @@ returnToken: {
llocp->last_line = lineNumber;
llocp->first_column = startOffset;
llocp->last_column = currentOffset();
-
m_lastToken = token;
return token;
}
@@ -1024,20 +1028,23 @@ SourceCode Lexer::sourceCode(int openBrace, int closeBrace, int firstLine)
return SourceCode(m_source->provider(), openBrace, closeBrace + 1, firstLine);
const UChar* data = m_source->provider()->data();
-
+
ASSERT(openBrace < closeBrace);
-
- int numBOMsBeforeOpenBrace = 0;
- int numBOMsBetweenBraces = 0;
-
int i;
- for (i = m_source->startOffset(); i < openBrace; ++i)
- numBOMsBeforeOpenBrace += data[i] == byteOrderMark;
- for (; i < closeBrace; ++i)
- numBOMsBetweenBraces += data[i] == byteOrderMark;
+ for (i = m_source->startOffset(); i < openBrace; ++i) {
+ if (data[i] == byteOrderMark) {
+ openBrace++;
+ closeBrace++;
+ }
+ }
+ for (; i < closeBrace; ++i) {
+ if (data[i] == byteOrderMark)
+ closeBrace++;
+ }
+
+ ASSERT(openBrace < closeBrace);
- return SourceCode(m_source->provider(), openBrace + numBOMsBeforeOpenBrace,
- closeBrace + numBOMsBeforeOpenBrace + numBOMsBetweenBraces + 1, firstLine);
+ return SourceCode(m_source->provider(), openBrace, closeBrace + 1, firstLine);
}
} // namespace JSC
diff --git a/JavaScriptCore/parser/Lexer.h b/JavaScriptCore/parser/Lexer.h
index c76696c..f197093 100644
--- a/JavaScriptCore/parser/Lexer.h
+++ b/JavaScriptCore/parser/Lexer.h
@@ -49,6 +49,8 @@ namespace JSC {
// Functions for the parser itself.
int lex(void* lvalp, void* llocp);
int lineNumber() const { return m_lineNumber; }
+ void setLastLineNumber(int lastLineNumber) { m_lastLineNumber = lastLineNumber; }
+ int lastLineNumber() const { return m_lastLineNumber; }
bool prevTerminator() const { return m_terminator; }
SourceCode sourceCode(int openBrace, int closeBrace, int firstLine);
bool scanRegExp(const Identifier*& pattern, const Identifier*& flags, UChar patternPrefix = 0);
@@ -84,8 +86,9 @@ namespace JSC {
bool lastTokenWasRestrKeyword() const;
static const size_t initialReadBufferCapacity = 32;
-
+
int m_lineNumber;
+ int m_lastLineNumber;
Vector<char> m_buffer8;
Vector<UChar> m_buffer16;
diff --git a/JavaScriptCore/parser/NodeConstructors.h b/JavaScriptCore/parser/NodeConstructors.h
index dd3b981..8b64e0f 100644
--- a/JavaScriptCore/parser/NodeConstructors.h
+++ b/JavaScriptCore/parser/NodeConstructors.h
@@ -43,7 +43,11 @@ namespace JSC {
}
inline Node::Node(JSGlobalData* globalData)
+#if ENABLE(RECURSIVE_PARSE)
+ : m_line(globalData->lexer->lastLineNumber())
+#else
: m_line(globalData->lexer->lineNumber())
+#endif
{
}
diff --git a/JavaScriptCore/parser/Parser.cpp b/JavaScriptCore/parser/Parser.cpp
index 48627df..fe92b40 100644
--- a/JavaScriptCore/parser/Parser.cpp
+++ b/JavaScriptCore/parser/Parser.cpp
@@ -24,6 +24,7 @@
#include "Parser.h"
#include "Debugger.h"
+#include "JSParser.h"
#include "Lexer.h"
#include <wtf/HashSet.h>
#include <wtf/Vector.h>
@@ -58,10 +59,14 @@ void Parser::parse(JSGlobalData* globalData, int* errLine, UString* errMsg)
Lexer& lexer = *globalData->lexer;
lexer.setCode(*m_source, m_arena);
-
+
+#if ENABLE(RECURSIVE_PARSE)
+ int parseError = jsParse(globalData);
+#else
int parseError = jscyyparse(globalData);
- bool lexError = lexer.sawError();
+#endif
int lineNumber = lexer.lineNumber();
+ bool lexError = lexer.sawError();
lexer.clear();
if (parseError || lexError) {
diff --git a/JavaScriptCore/parser/SyntaxChecker.h b/JavaScriptCore/parser/SyntaxChecker.h
new file mode 100644
index 0000000..cad89f6
--- /dev/null
+++ b/JavaScriptCore/parser/SyntaxChecker.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SyntaxChecker_h
+#define SyntaxChecker_h
+
+namespace JSC {
+class SyntaxChecker {
+public:
+ SyntaxChecker(JSGlobalData*, Lexer*)
+ {
+ }
+
+ typedef SyntaxChecker FunctionBodyBuilder;
+
+ typedef int Expression;
+ typedef int SourceElements;
+ typedef int Arguments;
+ typedef int Comma;
+ typedef int Property;
+ typedef int PropertyList;
+ typedef int ElementList;
+ typedef int ArgumentsList;
+ typedef int FormalParameterList;
+ typedef int FunctionBody;
+ typedef int Statement;
+ typedef int ClauseList;
+ typedef int Clause;
+ typedef int ConstDeclList;
+ typedef int BinaryOperand;
+
+ static const bool CreatesAST = false;
+
+ int createSourceElements() { return 1; }
+ int makeFunctionCallNode(int, int, int, int, int) { return 1; }
+ void appendToComma(int, int) { }
+ int createCommaExpr(int, int) { return 1; }
+ int makeAssignNode(int, Operator, int, bool, bool, int, int, int) { return 1; }
+ int makePrefixNode(int, Operator, int, int, int) { return 1; }
+ int makePostfixNode(int, Operator, int, int, int) { return 1; }
+ int makeTypeOfNode(int) { return 1; }
+ int makeDeleteNode(int, int, int, int) { return 1; }
+ int makeNegateNode(int) { return 1; }
+ int makeBitwiseNotNode(int) { return 1; }
+ int createLogicalNot(int) { return 1; }
+ int createUnaryPlus(int) { return 1; }
+ int createVoid(int) { return 1; }
+ int thisExpr() { return 1; }
+ int createResolve(const Identifier*, int) { return 1; }
+ int createObjectLiteral() { return 1; }
+ int createObjectLiteral(int) { return 1; }
+ int createArray(int) { return 1; }
+ int createArray(int, int) { return 1; }
+ int createNumberExpr(double) { return 1; }
+ int createString(const Identifier*) { return 1; }
+ int createBoolean(bool) { return 1; }
+ int createNull() { return 1; }
+ int createBracketAccess(int, int, bool, int, int, int) { return 1; }
+ int createDotAccess(int, const Identifier&, int, int, int) { return 1; }
+ int createRegex(const Identifier&, const Identifier&, int) { return 1; }
+ int createNewExpr(int, int, int, int, int) { return 1; }
+ int createNewExpr(int, int, int) { return 1; }
+ int createConditionalExpr(int, int, int) { return 1; }
+ int createAssignResolve(const Identifier&, int, bool, int, int, int) { return 1; }
+ int createFunctionExpr(const Identifier*, int, int, int, int, int, int) { return 1; }
+ int createFunctionBody() { return 1; }
+ int createArguments() { return 1; }
+ int createArguments(int) { return 1; }
+ int createArgumentsList(int) { return 1; }
+ int createArgumentsList(int, int) { return 1; }
+ int createProperty(const Identifier*, int, PropertyNode::Type) { return 1; }
+ int createProperty(double, int, PropertyNode::Type) { return 1; }
+ int createPropertyList(int) { return 1; }
+ int createPropertyList(int, int) { return 1; }
+ int createElementList(int, int) { return 1; }
+ int createElementList(int, int, int) { return 1; }
+ int createFormalParameterList(const Identifier&) { return 1; }
+ int createFormalParameterList(int, const Identifier&) { return 1; }
+ int createClause(int, int) { return 1; }
+ int createClauseList(int) { return 1; }
+ int createClauseList(int, int) { return 1; }
+ void setUsesArguments(int) { }
+ int createFuncDeclStatement(const Identifier*, int, int, int, int, int, int) { return 1; }
+ int createBlockStatement(int, int, int) { return 1; }
+ int createExprStatement(int, int, int) { return 1; }
+ int createIfStatement(int, int, int, int) { return 1; }
+ int createIfStatement(int, int, int, int, int) { return 1; }
+ int createForLoop(int, int, int, int, bool, int, int) { return 1; }
+ int createForInLoop(const Identifier*, int, int, int, int, int, int, int, int, int, int) { return 1; }
+ int createForInLoop(int, int, int, int, int, int, int, int) { return 1; }
+ int createEmptyStatement() { return 1; }
+ int createVarStatement(int, int, int) { return 1; }
+ int createReturnStatement(int, int, int, int, int) { return 1; }
+ int createBreakStatement(int, int, int, int) { return 1; }
+ int createBreakStatement(const Identifier*, int, int, int, int) { return 1; }
+ int createContinueStatement(int, int, int, int) { return 1; }
+ int createContinueStatement(const Identifier*, int, int, int, int) { return 1; }
+ int createTryStatement(int, const Identifier*, bool, int, int, int, int) { return 1; }
+ int createSwitchStatement(int, int, int, int, int, int) { return 1; }
+ int createWhileStatement(int, int, int, int) { return 1; }
+ int createWithStatement(int, int, int, int, int, int) { return 1; }
+ int createDoWhileStatement(int, int, int, int) { return 1; }
+ int createLabelStatement(const Identifier*, int, int, int) { return 1; }
+ int createThrowStatement(int, int, int, int, int) { return 1; }
+ int createDebugger(int, int) { return 1; }
+ int createConstStatement(int, int, int) { return 1; }
+ int appendConstDecl(int, const Identifier*, int) { return 1; }
+ int createGetterOrSetterProperty(const Identifier*, const Identifier*, int, int, int, int, int, int) { return 1; }
+
+ void appendStatement(int, int) { }
+ void addVar(const Identifier*, bool) { }
+ int combineCommaNodes(int, int) { return 1; }
+ int evalCount() const { return 0; }
+ void appendBinaryExpressionInfo(int& operandStackDepth, int, int, int, int, bool) { operandStackDepth++; }
+
+ // Logic to handle datastructures used during parsing of binary expressions
+ void operatorStackPop(int& operatorStackDepth) { operatorStackDepth--; }
+ bool operatorStackHasHigherPrecedence(int&, int) { return true; }
+ BinaryOperand getFromOperandStack(int) { return 1; }
+ void shrinkOperandStackBy(int& operandStackDepth, int amount) { operandStackDepth -= amount; }
+ void appendBinaryOperation(int& operandStackDepth, int&, BinaryOperand, BinaryOperand) { operandStackDepth++; }
+ void operatorStackAppend(int& operatorStackDepth, int, int) { operatorStackDepth++; }
+ int popOperandStack(int&) { return 1; }
+
+ void appendUnaryToken(int&, int, int) { }
+ int unaryTokenStackLastType(int&) { ASSERT_NOT_REACHED(); return 1; }
+ int unaryTokenStackLastStart(int&) { ASSERT_NOT_REACHED(); return 1; }
+ void unaryTokenStackRemoveLast(int&) { }
+
+ void assignmentStackAppend(int, int, int, int, int, Operator) { }
+ int createAssignment(int, int, int, int, int) { ASSERT_NOT_REACHED(); return 1; }
+};
+
+}
+
+#endif
diff --git a/JavaScriptCore/qt/api/qscriptengine_p.cpp b/JavaScriptCore/qt/api/qscriptengine_p.cpp
index a6cf4a4..fd7978b 100644
--- a/JavaScriptCore/qt/api/qscriptengine_p.cpp
+++ b/JavaScriptCore/qt/api/qscriptengine_p.cpp
@@ -85,5 +85,5 @@ QScriptValuePrivate* QScriptEnginePrivate::newObject() const
QScriptValuePrivate* QScriptEnginePrivate::globalObject() const
{
JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
- return new QScriptValuePrivate(this, globalObject, globalObject);
+ return new QScriptValuePrivate(this, globalObject);
}
diff --git a/JavaScriptCore/qt/api/qscriptvalue.cpp b/JavaScriptCore/qt/api/qscriptvalue.cpp
index 22ff8be..8ad76a5 100644
--- a/JavaScriptCore/qt/api/qscriptvalue.cpp
+++ b/JavaScriptCore/qt/api/qscriptvalue.cpp
@@ -518,6 +518,34 @@ QScriptEngine* QScriptValue::engine() const
}
/*!
+ If this QScriptValue is an object, returns the internal prototype
+ (\c{__proto__} property) of this object; otherwise returns an
+ invalid QScriptValue.
+
+ \sa setPrototype(), isObject()
+*/
+QScriptValue QScriptValue::prototype() const
+{
+ return QScriptValuePrivate::get(d_ptr->prototype());
+}
+
+/*!
+ If this QScriptValue is an object, sets the internal prototype
+ (\c{__proto__} property) of this object to be \a prototype;
+ otherwise does nothing.
+
+ The internal prototype should not be confused with the public
+ property with name "prototype"; the public prototype is usually
+ only set on functions that act as constructors.
+
+ \sa prototype(), isObject()
+*/
+void QScriptValue::setPrototype(const QScriptValue& prototype)
+{
+ d_ptr->setPrototype(QScriptValuePrivate::get(prototype));
+}
+
+/*!
Assigns the \a other value to this QScriptValue.
Note that if \a other is an object (isObject() returns true),
diff --git a/JavaScriptCore/qt/api/qscriptvalue.h b/JavaScriptCore/qt/api/qscriptvalue.h
index 6c42429..c82ef55 100644
--- a/JavaScriptCore/qt/api/qscriptvalue.h
+++ b/JavaScriptCore/qt/api/qscriptvalue.h
@@ -59,6 +59,10 @@ public:
~QScriptValue();
QScriptValue& operator=(const QScriptValue& other);
+
+ QScriptValue prototype() const;
+ void setPrototype(const QScriptValue& prototype);
+
bool equals(const QScriptValue& other) const;
bool strictlyEquals(const QScriptValue& other) const;
bool instanceOf(const QScriptValue& other) const;
diff --git a/JavaScriptCore/qt/api/qscriptvalue_p.h b/JavaScriptCore/qt/api/qscriptvalue_p.h
index 1bb8a77..f8a1e7a 100644
--- a/JavaScriptCore/qt/api/qscriptvalue_p.h
+++ b/JavaScriptCore/qt/api/qscriptvalue_p.h
@@ -25,6 +25,7 @@
#include "qscriptvalue.h"
#include <JavaScriptCore/JavaScript.h>
#include <JavaScriptCore/JSRetainPtr.h>
+#include <JSObjectRefPrivate.h>
#include <QtCore/qmath.h>
#include <QtCore/qnumeric.h>
#include <QtCore/qshareddata.h>
@@ -49,7 +50,7 @@ class QScriptValue;
CNumber -> QSVP is created from int, uint, double... and no JSC engine has been bind yet. Current
value is kept in m_number
CBool -> QSVP is created from bool and no JSC engine has been associated yet. Current value is kept
- in m_number
+ in m_bool
CNull -> QSVP is null, but a JSC engine hasn't been associated yet.
CUndefined -> QSVP is undefined, but a JSC engine hasn't been associated yet.
JSValue -> QSVP is associated with engine, but there is no information about real type, the state
@@ -89,7 +90,7 @@ public:
inline QScriptValuePrivate(const QScriptEnginePrivate* engine, QScriptValue::SpecialValue value);
inline QScriptValuePrivate(const QScriptEnginePrivate* engine, JSValueRef value);
- inline QScriptValuePrivate(const QScriptEnginePrivate* engine, JSValueRef value, JSObjectRef object);
+ inline QScriptValuePrivate(const QScriptEnginePrivate* engine, JSObjectRef object);
inline bool isValid() const;
inline bool isBool();
@@ -108,8 +109,11 @@ public:
inline qint32 toInt32() const;
inline quint32 toUInt32() const;
inline quint16 toUInt16() const;
+
inline QScriptValuePrivate* toObject(QScriptEnginePrivate* engine);
inline QScriptValuePrivate* toObject();
+ inline QScriptValuePrivate* prototype();
+ inline void setPrototype(QScriptValuePrivate* prototype);
inline bool equals(QScriptValuePrivate* other);
inline bool strictlyEquals(QScriptValuePrivate* other);
@@ -137,12 +141,23 @@ private:
JSObject
} m_state;
QScriptEnginePtr m_engine;
- QString m_string;
- qsreal m_number;
- JSValueRef m_value;
- JSObjectRef m_object;
-
- inline void setValue(JSValueRef);
+ union Value
+ {
+ bool m_bool;
+ qsreal m_number;
+ JSValueRef m_value;
+ JSObjectRef m_object;
+ QString* m_string;
+
+ Value() : m_number(0) {}
+ Value(bool value) : m_bool(value) {}
+ Value(int number) : m_number(number) {}
+ Value(uint number) : m_number(number) {}
+ Value(qsreal number) : m_number(number) {}
+ Value(JSValueRef value) : m_value(value) {}
+ Value(JSObjectRef object) : m_object(object) {}
+ Value(QString* string) : m_string(string) {}
+ } u;
inline bool inherits(const char*);
inline State refinedJSValue();
@@ -166,131 +181,124 @@ QScriptValue QScriptValuePrivate::get(QScriptValuePrivate* d)
QScriptValuePrivate::~QScriptValuePrivate()
{
- if (m_value)
- JSValueUnprotect(*m_engine, m_value);
+ if (isJSBased())
+ JSValueUnprotect(*m_engine, u.m_value);
+ else if (isStringBased())
+ delete u.m_string;
}
QScriptValuePrivate::QScriptValuePrivate()
: m_state(Invalid)
- , m_value(0)
{
}
QScriptValuePrivate::QScriptValuePrivate(const QString& string)
: m_state(CString)
- , m_string(string)
- , m_value(0)
+ , u(new QString(string))
{
}
QScriptValuePrivate::QScriptValuePrivate(bool value)
: m_state(CBool)
- , m_number(value)
- , m_value(0)
+ , u(value)
{
}
QScriptValuePrivate::QScriptValuePrivate(int number)
: m_state(CNumber)
- , m_number(number)
- , m_value(0)
+ , u(number)
{
}
QScriptValuePrivate::QScriptValuePrivate(uint number)
: m_state(CNumber)
- , m_number(number)
- , m_value(0)
+ , u(number)
{
}
QScriptValuePrivate::QScriptValuePrivate(qsreal number)
: m_state(CNumber)
- , m_number(number)
- , m_value(0)
+ , u(number)
{
}
QScriptValuePrivate::QScriptValuePrivate(QScriptValue::SpecialValue value)
: m_state(value == QScriptValue::NullValue ? CNull : CUndefined)
- , m_value(0)
{
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, bool value)
: m_state(JSPrimitive)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(engine->makeJSValue(value))
+ , u(engine->makeJSValue(value))
{
Q_ASSERT(engine);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, int value)
: m_state(JSPrimitive)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(m_engine->makeJSValue(value))
+ , u(m_engine->makeJSValue(value))
{
Q_ASSERT(engine);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, uint value)
: m_state(JSPrimitive)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(m_engine->makeJSValue(value))
+ , u(m_engine->makeJSValue(value))
{
Q_ASSERT(engine);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, qsreal value)
: m_state(JSPrimitive)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(m_engine->makeJSValue(value))
+ , u(m_engine->makeJSValue(value))
{
Q_ASSERT(engine);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, const QString& value)
: m_state(JSPrimitive)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(m_engine->makeJSValue(value))
+ , u(m_engine->makeJSValue(value))
{
Q_ASSERT(engine);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, QScriptValue::SpecialValue value)
: m_state(JSPrimitive)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(m_engine->makeJSValue(value))
+ , u(m_engine->makeJSValue(value))
{
Q_ASSERT(engine);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, JSValueRef value)
: m_state(JSValue)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(value)
+ , u(value)
{
Q_ASSERT(engine);
Q_ASSERT(value);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, u.m_value);
}
-QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, JSValueRef value, JSObjectRef object)
+QScriptValuePrivate::QScriptValuePrivate(const QScriptEnginePrivate* engine, JSObjectRef object)
: m_state(JSObject)
, m_engine(const_cast<QScriptEnginePrivate*>(engine))
- , m_value(value)
- , m_object(object)
+ , u(object)
{
Q_ASSERT(engine);
- Q_ASSERT(value);
Q_ASSERT(object);
- JSValueProtect(*m_engine, m_value);
+ JSValueProtect(*m_engine, object);
}
bool QScriptValuePrivate::isValid() const { return m_state != Invalid; }
@@ -422,11 +430,11 @@ QString QScriptValuePrivate::toString() const
case Invalid:
return QString();
case CBool:
- return m_number ? QString::fromLatin1("true") : QString::fromLatin1("false");
+ return u.m_bool ? QString::fromLatin1("true") : QString::fromLatin1("false");
case CString:
- return m_string;
+ return *u.m_string;
case CNumber:
- return QScriptConverter::toString(m_number);
+ return QScriptConverter::toString(u.m_number);
case CNull:
return QString::fromLatin1("null");
case CUndefined:
@@ -450,9 +458,9 @@ qsreal QScriptValuePrivate::toNumber() const
case JSObject:
return JSValueToNumber(*m_engine, *this, /* exception */ 0);
case CNumber:
- return m_number;
+ return u.m_number;
case CBool:
- return m_number ? 1 : 0;
+ return u.m_bool ? 1 : 0;
case CNull:
case Invalid:
return 0;
@@ -460,15 +468,15 @@ qsreal QScriptValuePrivate::toNumber() const
return qQNaN();
case CString:
bool ok;
- qsreal result = m_string.toDouble(&ok);
+ qsreal result = u.m_string->toDouble(&ok);
if (ok)
return result;
- result = m_string.toInt(&ok, 0); // Try other bases.
+ result = u.m_string->toInt(&ok, 0); // Try other bases.
if (ok)
return result;
- if (m_string == "Infinity" || m_string == "-Infinity")
+ if (*u.m_string == "Infinity" || *u.m_string == "-Infinity")
return qInf();
- return m_string.length() ? qQNaN() : 0;
+ return u.m_string->length() ? qQNaN() : 0;
}
Q_ASSERT_X(false, "toNumber()", "Not all states are included in the previous switch statement.");
@@ -484,15 +492,15 @@ bool QScriptValuePrivate::toBool() const
case JSObject:
return true;
case CNumber:
- return !(qIsNaN(m_number) || !m_number);
+ return !(qIsNaN(u.m_number) || !u.m_number);
case CBool:
- return m_number;
+ return u.m_bool;
case Invalid:
case CNull:
case CUndefined:
return false;
case CString:
- return m_string.length();
+ return u.m_string->length();
}
Q_ASSERT_X(false, "toBool()", "Not all states are included in the previous switch statement.");
@@ -551,23 +559,23 @@ QScriptValuePrivate* QScriptValuePrivate::toObject(QScriptEnginePrivate* engine)
case CString:
{
// Exception can't occur here.
- JSObjectRef object = JSValueToObject(*engine, engine->makeJSValue(m_string), /* exception */ 0);
+ JSObjectRef object = JSValueToObject(*engine, engine->makeJSValue(*u.m_string), /* exception */ 0);
Q_ASSERT(object);
- return new QScriptValuePrivate(engine, object, object);
+ return new QScriptValuePrivate(engine, object);
}
case CNumber:
{
// Exception can't occur here.
- JSObjectRef object = JSValueToObject(*engine, engine->makeJSValue(m_number), /* exception */ 0);
+ JSObjectRef object = JSValueToObject(*engine, engine->makeJSValue(u.m_number), /* exception */ 0);
Q_ASSERT(object);
- return new QScriptValuePrivate(engine, object, object);
+ return new QScriptValuePrivate(engine, object);
}
case CBool:
{
// Exception can't occure here.
- JSObjectRef object = JSValueToObject(*engine, engine->makeJSValue(static_cast<bool>(m_number)), /* exception */ 0);
+ JSObjectRef object = JSValueToObject(*engine, engine->makeJSValue(u.m_bool), /* exception */ 0);
Q_ASSERT(object);
- return new QScriptValuePrivate(engine, object, object);
+ return new QScriptValuePrivate(engine, object);
}
case JSValue:
if (refinedJSValue() != JSPrimitive)
@@ -605,6 +613,35 @@ QScriptValuePrivate* QScriptValuePrivate::toObject()
return new QScriptValuePrivate;
}
+inline QScriptValuePrivate* QScriptValuePrivate::prototype()
+{
+ if (isObject()) {
+ JSValueRef prototype = JSObjectGetPrototype(*m_engine, *this);
+ if (JSValueIsNull(*m_engine, prototype))
+ return new QScriptValuePrivate(engine(), prototype);
+ // The prototype could be either a null or a JSObject, so it is safe to cast the prototype
+ // to the JSObjectRef here.
+ return new QScriptValuePrivate(engine(), prototype, const_cast<JSObjectRef>(prototype));
+ }
+ return new QScriptValuePrivate;
+}
+
+inline void QScriptValuePrivate::setPrototype(QScriptValuePrivate* prototype)
+{
+ if (isObject() && prototype->isValid() && (prototype->isObject() || prototype->isNull())) {
+ if (engine() != prototype->engine()) {
+ qWarning("QScriptValue::setPrototype() failed: cannot set a prototype created in a different engine");
+ return;
+ }
+ // FIXME: This could be replaced by a new, faster API
+ // look at https://bugs.webkit.org/show_bug.cgi?id=40060
+ JSObjectSetPrototype(*m_engine, *this, *prototype);
+ JSValueRef proto = JSObjectGetPrototype(*m_engine, *this);
+ if (!JSValueIsStrictEqual(*m_engine, proto, *prototype))
+ qWarning("QScriptValue::setPrototype() failed: cyclic prototype value");
+ }
+}
+
bool QScriptValuePrivate::equals(QScriptValuePrivate* other)
{
if (!isValid())
@@ -615,9 +652,9 @@ bool QScriptValuePrivate::equals(QScriptValuePrivate* other)
if ((m_state == other->m_state) && !isJSBased()) {
if (isNumberBased())
- return m_number == other->m_number;
+ return u.m_number == other->u.m_number;
Q_ASSERT(isStringBased());
- return m_string == other->m_string;
+ return *u.m_string == *(other->u.m_string);
}
if (!isJSBased() && !other->isJSBased())
@@ -655,7 +692,7 @@ bool QScriptValuePrivate::strictlyEquals(QScriptValuePrivate* other)
}
if (isStringBased()) {
if (other->isStringBased())
- return m_string == other->m_string;
+ return *u.m_string == *(other->u.m_string);
if (other->isJSBased()) {
assignEngine(other->engine());
return JSValueIsStrictEqual(*m_engine, *this, *other);
@@ -663,7 +700,7 @@ bool QScriptValuePrivate::strictlyEquals(QScriptValuePrivate* other)
}
if (isNumberBased()) {
if (other->isNumberBased())
- return m_number == other->m_number;
+ return u.m_number == other->u.m_number;
if (other->isJSBased()) {
assignEngine(other->engine());
return JSValueIsStrictEqual(*m_engine, *this, *other);
@@ -690,13 +727,14 @@ bool QScriptValuePrivate::assignEngine(QScriptEnginePrivate* engine)
JSValueRef value;
switch (m_state) {
case CBool:
- value = engine->makeJSValue(static_cast<bool>(m_number));
+ value = engine->makeJSValue(u.m_bool);
break;
case CString:
- value = engine->makeJSValue(m_string);
+ value = engine->makeJSValue(*u.m_string);
+ delete u.m_string;
break;
case CNumber:
- value = engine->makeJSValue(m_number);
+ value = engine->makeJSValue(u.m_number);
break;
case CNull:
value = engine->makeJSValue(QScriptValue::NullValue);
@@ -713,7 +751,8 @@ bool QScriptValuePrivate::assignEngine(QScriptEnginePrivate* engine)
}
m_engine = engine;
m_state = JSPrimitive;
- setValue(value);
+ u.m_value = value;
+ JSValueProtect(*m_engine, value);
return true;
}
@@ -763,22 +802,15 @@ QScriptEnginePrivate* QScriptValuePrivate::engine() const
QScriptValuePrivate::operator JSValueRef() const
{
Q_ASSERT(isJSBased());
- return m_value;
+ Q_ASSERT(u.m_value);
+ return u.m_value;
}
QScriptValuePrivate::operator JSObjectRef() const
{
Q_ASSERT(m_state == JSObject);
- return m_object;
-}
-
-void QScriptValuePrivate::setValue(JSValueRef value)
-{
- if (m_value)
- JSValueUnprotect(*m_engine, m_value);
- if (value)
- JSValueProtect(*m_engine, value);
- m_value = value;
+ Q_ASSERT(u.m_object);
+ return u.m_object;
}
/*!
@@ -806,10 +838,9 @@ QScriptValuePrivate::State QScriptValuePrivate::refinedJSValue()
if (!JSValueIsObject(*m_engine, *this)) {
m_state = JSPrimitive;
} else {
+ // Difference between JSValueRef and JSObjectRef is only in their type, binarywise it is the same.
+ // As m_value and m_object are stored in the u union, it is enough to change the m_state only.
m_state = JSObject;
- // We are sure that value is an JSObject, so we can const_cast safely without
- // calling JSC C API (JSValueToObject(*m_engine, *this, /* exceptions */ 0)).
- m_object = const_cast<JSObjectRef>(m_value);
}
return m_state;
}
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
index 90730c3..27d6df2 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.cpp
@@ -431,6 +431,46 @@ void tst_QScriptValue::call()
QVERIFY(incr.call().isValid()); // Exception.
}
+void tst_QScriptValue::getSetPrototype()
+{
+ QScriptEngine engine;
+ QScriptValue object = engine.evaluate("new Object()");
+ QScriptValue object2 = engine.evaluate("new Object()");
+ object2.setPrototype(object);
+ QCOMPARE(object2.prototype().strictlyEquals(object), true);
+
+ QScriptValue inv;
+ inv.setPrototype(object);
+ QCOMPARE(inv.prototype().isValid(), false);
+
+ QScriptEngine otherEngine;
+ QScriptValue object3 = otherEngine.evaluate("new Object()");
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cannot set a prototype created in a different engine");
+ object2.setPrototype(object3);
+ QCOMPARE(object2.prototype().strictlyEquals(object), true);
+
+ // cyclic prototypes
+ {
+ QScriptValue ret = engine.evaluate("o = { }; p = { }; o.__proto__ = p; p.__proto__ = o");
+ QCOMPARE(ret.isError(), true);
+ QCOMPARE(ret.toString(), QLatin1String("Error: cyclic __proto__ value"));
+ }
+ {
+ QScriptValue ret = engine.evaluate("p.__proto__ = { }");
+ QCOMPARE(ret.isError(), false);
+ }
+
+ QScriptValue old = object.prototype();
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cyclic prototype value");
+ object.setPrototype(object);
+ QCOMPARE(object.prototype().strictlyEquals(old), true);
+
+ object2.setPrototype(object);
+ QTest::ignoreMessage(QtWarningMsg, "QScriptValue::setPrototype() failed: cyclic prototype value");
+ object.setPrototype(object2);
+ QCOMPARE(object.prototype().strictlyEquals(old), true);
+}
+
void tst_QScriptValue::toObjectSimple()
{
QScriptEngine eng;
diff --git a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
index 0565b6f..f9fcedb 100644
--- a/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
+++ b/JavaScriptCore/qt/tests/qscriptvalue/tst_qscriptvalue.h
@@ -47,6 +47,7 @@ private slots:
void dataSharing();
void constructors_data();
void constructors();
+ void getSetPrototype();
void call();
void ctor();
void toObjectSimple();
diff --git a/JavaScriptCore/runtime/ArrayPrototype.cpp b/JavaScriptCore/runtime/ArrayPrototype.cpp
index 699fbe6..9407be7 100644
--- a/JavaScriptCore/runtime/ArrayPrototype.cpp
+++ b/JavaScriptCore/runtime/ArrayPrototype.cpp
@@ -77,12 +77,14 @@ static inline bool isNumericCompareFunction(ExecState* exec, CallType callType,
// If the JIT is enabled then we need to preserve the invariant that every
// function with a CodeBlock also has JIT code.
callData.js.functionExecutable->jitCodeForCall(exec, callData.js.scopeChain);
- CodeBlock& codeBlock = callData.js.functionExecutable->generatedBytecodeForCall();
+ CodeBlock* codeBlock = &callData.js.functionExecutable->generatedBytecodeForCall();
#else
- CodeBlock& codeBlock = callData.js.functionExecutable->bytecodeForCall(exec, callData.js.scopeChain);
+ CodeBlock* codeBlock = callData.js.functionExecutable->bytecodeForCall(exec, callData.js.scopeChain);
#endif
+ if (!codeBlock)
+ return false;
- return codeBlock.isNumericCompareFunction();
+ return codeBlock->isNumericCompareFunction();
}
// ------------------------------ ArrayPrototype ----------------------------
diff --git a/JavaScriptCore/runtime/Executable.cpp b/JavaScriptCore/runtime/Executable.cpp
index a18e80c..f33f3b4 100644
--- a/JavaScriptCore/runtime/Executable.cpp
+++ b/JavaScriptCore/runtime/Executable.cpp
@@ -119,10 +119,12 @@ JSObject* ProgramExecutable::compile(ExecState* exec, ScopeChainNode* scopeChain
return 0;
}
-void FunctionExecutable::compileForCall(ExecState*, ScopeChainNode* scopeChainNode)
+bool FunctionExecutable::compileForCall(ExecState*, ScopeChainNode* scopeChainNode)
{
JSGlobalData* globalData = scopeChainNode->globalData;
RefPtr<FunctionBodyNode> body = globalData->parser->parse<FunctionBodyNode>(globalData, 0, 0, m_source);
+ if (!body)
+ return false;
if (m_forceUsesArguments)
body->setUsesArguments();
body->finishParsing(m_parameters, m_name);
@@ -141,12 +143,15 @@ void FunctionExecutable::compileForCall(ExecState*, ScopeChainNode* scopeChainNo
m_symbolTable = m_codeBlockForCall->sharedSymbolTable();
body->destroyData();
+ return true;
}
-void FunctionExecutable::compileForConstruct(ExecState*, ScopeChainNode* scopeChainNode)
+bool FunctionExecutable::compileForConstruct(ExecState*, ScopeChainNode* scopeChainNode)
{
JSGlobalData* globalData = scopeChainNode->globalData;
RefPtr<FunctionBodyNode> body = globalData->parser->parse<FunctionBodyNode>(globalData, 0, 0, m_source);
+ if (!body)
+ return false;
if (m_forceUsesArguments)
body->setUsesArguments();
body->finishParsing(m_parameters, m_name);
@@ -165,6 +170,7 @@ void FunctionExecutable::compileForConstruct(ExecState*, ScopeChainNode* scopeCh
m_symbolTable = m_codeBlockForConstruct->sharedSymbolTable();
body->destroyData();
+ return true;
}
#if ENABLE(JIT)
@@ -193,7 +199,7 @@ void ProgramExecutable::generateJITCode(ExecState* exec, ScopeChainNode* scopeCh
void FunctionExecutable::generateJITCodeForCall(ExecState* exec, ScopeChainNode* scopeChainNode)
{
- CodeBlock* codeBlock = &bytecodeForCall(exec, scopeChainNode);
+ CodeBlock* codeBlock = bytecodeForCall(exec, scopeChainNode);
m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, codeBlock, &m_jitCodeForCallWithArityCheck);
#if !ENABLE(OPCODE_SAMPLING)
@@ -204,7 +210,7 @@ void FunctionExecutable::generateJITCodeForCall(ExecState* exec, ScopeChainNode*
void FunctionExecutable::generateJITCodeForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
{
- CodeBlock* codeBlock = &bytecodeForConstruct(exec, scopeChainNode);
+ CodeBlock* codeBlock = bytecodeForConstruct(exec, scopeChainNode);
m_jitCodeForConstruct = JIT::compile(scopeChainNode->globalData, codeBlock, &m_jitCodeForConstructWithArityCheck);
#if !ENABLE(OPCODE_SAMPLING)
@@ -226,6 +232,8 @@ void FunctionExecutable::markAggregate(MarkStack& markStack)
ExceptionInfo* FunctionExecutable::reparseExceptionInfo(JSGlobalData* globalData, ScopeChainNode* scopeChainNode, CodeBlock* codeBlock)
{
RefPtr<FunctionBodyNode> newFunctionBody = globalData->parser->parse<FunctionBodyNode>(globalData, 0, 0, m_source);
+ if (!newFunctionBody)
+ return 0;
if (m_forceUsesArguments)
newFunctionBody->setUsesArguments();
newFunctionBody->finishParsing(m_parameters, m_name);
@@ -255,6 +263,8 @@ ExceptionInfo* FunctionExecutable::reparseExceptionInfo(JSGlobalData* globalData
ExceptionInfo* EvalExecutable::reparseExceptionInfo(JSGlobalData* globalData, ScopeChainNode* scopeChainNode, CodeBlock* codeBlock)
{
RefPtr<EvalNode> newEvalBody = globalData->parser->parse<EvalNode>(globalData, 0, 0, m_source);
+ if (!newEvalBody)
+ return 0;
ScopeChain scopeChain(scopeChainNode);
JSGlobalObject* globalObject = scopeChain.globalObject();
diff --git a/JavaScriptCore/runtime/Executable.h b/JavaScriptCore/runtime/Executable.h
index 39ddf49..3320fe1 100644
--- a/JavaScriptCore/runtime/Executable.h
+++ b/JavaScriptCore/runtime/Executable.h
@@ -305,12 +305,12 @@ namespace JSC {
return *m_codeBlockForConstruct;
}
- FunctionCodeBlock& bytecodeForCall(ExecState* exec, ScopeChainNode* scopeChainNode)
+ FunctionCodeBlock* bytecodeForCall(ExecState* exec, ScopeChainNode* scopeChainNode)
{
ASSERT(scopeChainNode);
if (!m_codeBlockForCall)
compileForCall(exec, scopeChainNode);
- return *m_codeBlockForCall;
+ return m_codeBlockForCall;
}
bool isGeneratedForCall() const
@@ -324,12 +324,12 @@ namespace JSC {
return *m_codeBlockForCall;
}
- FunctionCodeBlock& bytecodeForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
+ FunctionCodeBlock* bytecodeForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
{
ASSERT(scopeChainNode);
if (!m_codeBlockForConstruct)
compileForConstruct(exec, scopeChainNode);
- return *m_codeBlockForConstruct;
+ return m_codeBlockForConstruct;
}
bool isGeneratedForConstruct() const
@@ -383,8 +383,8 @@ namespace JSC {
m_lastLine = lastLine;
}
- void compileForCall(ExecState*, ScopeChainNode*);
- void compileForConstruct(ExecState*, ScopeChainNode*);
+ bool compileForCall(ExecState*, ScopeChainNode*);
+ bool compileForConstruct(ExecState*, ScopeChainNode*);
unsigned m_numVariables : 31;
bool m_forceUsesArguments : 1;
diff --git a/JavaScriptCore/runtime/JSGlobalData.cpp b/JavaScriptCore/runtime/JSGlobalData.cpp
index 3f24ea4..30a5ef9 100644
--- a/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -49,6 +49,7 @@
#include "Lookup.h"
#include "Nodes.h"
#include "Parser.h"
+#include "RegExpCache.h"
#include <wtf/WTFThreadData.h>
#if ENABLE(JSC_MULTIPLE_THREADS)
@@ -147,6 +148,7 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
, cachedUTCOffset(NaN)
, weakRandom(static_cast<int>(currentTime()))
, maxReentryDepth(threadStackType == ThreadStackTypeSmall ? MaxSmallThreadReentryDepth : MaxLargeThreadReentryDepth)
+ , m_regExpCache(new RegExpCache(this))
#ifndef NDEBUG
, exclusiveThread(0)
#endif
@@ -196,6 +198,7 @@ JSGlobalData::~JSGlobalData()
deleteIdentifierTable(identifierTable);
delete clientData;
+ delete m_regExpCache;
}
PassRefPtr<JSGlobalData> JSGlobalData::createContextGroup(ThreadStackType type)
@@ -246,7 +249,7 @@ const Vector<Instruction>& JSGlobalData::numericCompareFunction(ExecState* exec)
if (!lazyNumericCompareFunction.size() && !initializingLazyNumericCompareFunction) {
initializingLazyNumericCompareFunction = true;
RefPtr<FunctionExecutable> function = FunctionExecutable::fromGlobalCode(Identifier(exec, "numericCompare"), exec, 0, makeSource(UString("(function (v1, v2) { return v1 - v2; })")), 0, 0);
- lazyNumericCompareFunction = function->bytecodeForCall(exec, exec->scopeChain()).instructions();
+ lazyNumericCompareFunction = function->bytecodeForCall(exec, exec->scopeChain())->instructions();
initializingLazyNumericCompareFunction = false;
}
diff --git a/JavaScriptCore/runtime/JSGlobalData.h b/JavaScriptCore/runtime/JSGlobalData.h
index f48aec8..f99c8d6 100644
--- a/JavaScriptCore/runtime/JSGlobalData.h
+++ b/JavaScriptCore/runtime/JSGlobalData.h
@@ -44,6 +44,7 @@
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/RefCounted.h>
+#include <wtf/ThreadSpecific.h>
struct OpaqueJSClass;
struct OpaqueJSClassContextData;
@@ -58,6 +59,7 @@ namespace JSC {
class JSObject;
class Lexer;
class Parser;
+ class RegExpCache;
class Stringifier;
class Structure;
class UString;
@@ -211,17 +213,22 @@ namespace JSC {
WeakRandom weakRandom;
int maxReentryDepth;
+
+ RegExpCache* m_regExpCache;
+
#ifndef NDEBUG
ThreadIdentifier exclusiveThread;
#endif
CachedTranscendentalFunction<sin> cachedSin;
+ WTF::ThreadSpecific<char*> stackGuards;
void resetDateCache();
void startSampling();
void stopSampling();
void dumpSampleData(ExecState* exec);
+ RegExpCache* regExpCache() { return m_regExpCache; }
private:
JSGlobalData(GlobalDataType, ThreadStackType);
static JSGlobalData*& sharedInstanceInternal();
diff --git a/JavaScriptCore/runtime/JSImmediate.h b/JavaScriptCore/runtime/JSImmediate.h
index 9127b6a..f33d9fe 100644
--- a/JavaScriptCore/runtime/JSImmediate.h
+++ b/JavaScriptCore/runtime/JSImmediate.h
@@ -44,6 +44,8 @@ namespace JSC {
class JSObject;
class UString;
+ extern const size_t CELL_MASK;
+
#if USE(JSVALUE64)
inline intptr_t reinterpretDoubleToIntptr(double value)
{
@@ -595,7 +597,13 @@ namespace JSC {
inline bool JSValue::isCell() const
{
+#ifndef NDEBUG
+ bool r = !JSImmediate::isImmediate(asValue());
+ ASSERT(!r || !(JSImmediate::rawValue(asValue()) & CELL_MASK));
+ return r;
+#else
return !JSImmediate::isImmediate(asValue());
+#endif
}
inline bool JSValue::isInt32() const
diff --git a/JavaScriptCore/runtime/JSString.cpp b/JavaScriptCore/runtime/JSString.cpp
index 473eb77..1d5e639 100644
--- a/JavaScriptCore/runtime/JSString.cpp
+++ b/JavaScriptCore/runtime/JSString.cpp
@@ -150,6 +150,7 @@ JSValue JSString::replaceCharacter(ExecState* exec, UChar character, const UStri
if (replacement.size())
builder.append(replacement);
builder.append(UString(string).substr(matchPosition + 1));
+ matchString = 0;
}
JSGlobalData* globalData = &exec->globalData();
diff --git a/JavaScriptCore/runtime/JSValue.cpp b/JavaScriptCore/runtime/JSValue.cpp
index 728cbcf..e752d3f 100644
--- a/JavaScriptCore/runtime/JSValue.cpp
+++ b/JavaScriptCore/runtime/JSValue.cpp
@@ -126,10 +126,10 @@ char* JSValue::description()
snprintf(description, size, "False");
else if (isNull())
snprintf(description, size, "Null");
- else {
- ASSERT(isUndefined());
+ else if (isUndefined())
snprintf(description, size, "Undefined");
- }
+ else
+ snprintf(description, size, "INVALID");
return description;
}
diff --git a/JavaScriptCore/runtime/JSZombie.cpp b/JavaScriptCore/runtime/JSZombie.cpp
index 072d29b..22aabb9 100644
--- a/JavaScriptCore/runtime/JSZombie.cpp
+++ b/JavaScriptCore/runtime/JSZombie.cpp
@@ -37,7 +37,7 @@ Structure* JSZombie::leakedZombieStructure() {
static Structure* structure = 0;
if (!structure) {
Structure::startIgnoringLeaks();
- structure = Structure::create(jsNull(), TypeInfo(UnspecifiedType)).releaseRef();
+ structure = Structure::create(jsNull(), TypeInfo(UnspecifiedType), 0).releaseRef();
Structure::stopIgnoringLeaks();
}
return structure;
diff --git a/JavaScriptCore/runtime/RegExpCache.cpp b/JavaScriptCore/runtime/RegExpCache.cpp
new file mode 100644
index 0000000..192df4d
--- /dev/null
+++ b/JavaScriptCore/runtime/RegExpCache.cpp
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Renata Hodovan (hodovan@inf.u-szeged.hu)
+ * 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 UNIVERSITY OF SZEGED ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED 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 "RegExpCache.h"
+
+namespace JSC {
+
+PassRefPtr<RegExp> RegExpCache::lookupOrCreate(const UString& patternString, const UString& flags)
+{
+ if (patternString.size() < maxCacheablePatternLength) {
+ pair<HashMap<RegExpKey, RefPtr<RegExp> >::iterator, bool> result = m_cacheMap.add(RegExpKey(flags, patternString), 0);
+ if (!result.second)
+ return result.first->second;
+ }
+ return create(patternString, flags);
+}
+
+PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UString& flags)
+{
+ RefPtr<RegExp> regExp;
+
+ if (!flags.isNull())
+ regExp = RegExp::create(m_globalData, patternString, flags);
+ else
+ regExp = RegExp::create(m_globalData, patternString);
+
+ if (patternString.size() >= maxCacheablePatternLength)
+ return regExp;
+
+ ++m_nextKeyToEvict;
+ if (m_nextKeyToEvict == maxCacheableEntries) {
+ m_nextKeyToEvict = 0;
+ m_isFull = true;
+ }
+ if (m_isFull)
+ m_cacheMap.remove(RegExpKey(patternKeyArray[m_nextKeyToEvict].flagsValue, patternKeyArray[m_nextKeyToEvict].pattern));
+
+ RegExpKey key = RegExpKey(flags, patternString);
+ m_cacheMap.set(key, regExp);
+ patternKeyArray[m_nextKeyToEvict].flagsValue = key.flagsValue;
+ patternKeyArray[m_nextKeyToEvict].pattern = patternString.rep();
+ return regExp;
+}
+
+RegExpCache::RegExpCache(JSGlobalData* globalData)
+ : m_globalData(globalData)
+ , m_nextKeyToEvict(-1)
+ , m_isFull(false)
+{
+}
+
+}
diff --git a/WebCore/bindings/js/JSXSLTProcessorConstructor.h b/JavaScriptCore/runtime/RegExpCache.h
index 96fa607..03b73ac 100644
--- a/WebCore/bindings/js/JSXSLTProcessorConstructor.h
+++ b/JavaScriptCore/runtime/RegExpCache.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2005, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Renata Hodovan (hodovan@inf.u-szeged.hu)
+ * All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -10,40 +12,46 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED 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 JSXSLTProcessorConstructor_h
-#define JSXSLTProcessorConstructor_h
+#include "RegExp.h"
+#include "RegExpKey.h"
+#include "UString.h"
-#if ENABLE(XSLT)
+#ifndef RegExpCache_h
+#define RegExpCache_h
-#include "JSDOMBinding.h"
+namespace JSC {
-namespace WebCore {
+class RegExpCache {
+public:
+ PassRefPtr<RegExp> lookupOrCreate(const UString& patternString, const UString& flags);
+ PassRefPtr<RegExp> create(const UString& patternString, const UString& flags);
+ RegExpCache(JSGlobalData* globalData);
- class JSXSLTProcessorConstructor : public DOMConstructorObject {
- public:
- JSXSLTProcessorConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static const JSC::ClassInfo s_info;
+private:
+ static const unsigned maxCacheablePatternLength = 256;
+ static const int maxCacheableEntries = 256;
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- };
+ typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
+ RegExpKey patternKeyArray[maxCacheableEntries];
+ RegExpCacheMap m_cacheMap;
+ JSGlobalData* m_globalData;
+ int m_nextKeyToEvict;
+ bool m_isFull;
+};
-} // namespace WebCore
+} // namespace JSC
-#endif // ENABLE(XSLT)
-
-#endif // JSXSLTProcessorConstructor_h
+#endif // RegExpCache_h
diff --git a/JavaScriptCore/runtime/RegExpConstructor.cpp b/JavaScriptCore/runtime/RegExpConstructor.cpp
index 24476d6..166a021 100644
--- a/JavaScriptCore/runtime/RegExpConstructor.cpp
+++ b/JavaScriptCore/runtime/RegExpConstructor.cpp
@@ -34,6 +34,7 @@
#include "RegExpObject.h"
#include "RegExpPrototype.h"
#include "RegExp.h"
+#include "RegExpCache.h"
namespace JSC {
@@ -302,7 +303,7 @@ JSObject* constructRegExp(ExecState* exec, const ArgList& args)
UString pattern = arg0.isUndefined() ? UString("") : arg0.toString(exec);
UString flags = arg1.isUndefined() ? UString("") : arg1.toString(exec);
- RefPtr<RegExp> regExp = RegExp::create(&exec->globalData(), pattern, flags);
+ RefPtr<RegExp> regExp = exec->globalData().regExpCache()->lookupOrCreate(pattern, flags);
if (!regExp->isValid())
return throwError(exec, createSyntaxError(exec, makeString("Invalid regular expression: ", regExp->errorMessage())));
return new (exec) RegExpObject(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp.release());
diff --git a/JavaScriptCore/runtime/RegExpKey.h b/JavaScriptCore/runtime/RegExpKey.h
new file mode 100644
index 0000000..e5ab438
--- /dev/null
+++ b/JavaScriptCore/runtime/RegExpKey.h
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2010 University of Szeged
+ * Copyright (C) 2010 Renata Hodovan (hodovan@inf.u-szeged.hu)
+ * 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 UNIVERSITY OF SZEGED ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL UNIVERSITY OF SZEGED 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 "UString.h"
+
+#ifndef RegExpKey_h
+#define RegExpKey_h
+
+namespace JSC {
+
+struct RegExpKey {
+ int flagsValue;
+ RefPtr<UString::Rep> pattern;
+
+ RegExpKey()
+ : flagsValue(0)
+ {
+ }
+
+ RegExpKey(int flags)
+ : flagsValue(flags)
+ {
+ }
+
+ RegExpKey(int flags, const UString& pattern)
+ : flagsValue(flags)
+ , pattern(pattern.rep())
+ {
+ }
+
+ RegExpKey(int flags, const PassRefPtr<UString::Rep> pattern)
+ : flagsValue(flags)
+ , pattern(pattern)
+ {
+ }
+
+ RegExpKey(const UString& flags, const UString& pattern)
+ : pattern(pattern.rep())
+ {
+ flagsValue = getFlagsValue(flags);
+ }
+
+ int getFlagsValue(const UString flags)
+ {
+ flagsValue = 0;
+ if (flags.find('g') != UString::NotFound)
+ flagsValue += 4;
+ if (flags.find('i') != UString::NotFound)
+ flagsValue += 2;
+ if (flags.find('m') != UString::NotFound)
+ flagsValue += 1;
+ return flagsValue;
+ }
+};
+} // namespace JSC
+
+namespace WTF {
+template<typename T> struct DefaultHash;
+template<typename T> struct RegExpHash;
+
+inline bool operator==(const JSC::RegExpKey& a, const JSC::RegExpKey& b)
+{
+ if (a.flagsValue != b.flagsValue)
+ return false;
+ if (!a.pattern)
+ return !b.pattern;
+ if (!b.pattern)
+ return false;
+ return equal(a.pattern.get(), b.pattern.get());
+}
+
+template<> struct RegExpHash<JSC::RegExpKey> {
+ static unsigned hash(const JSC::RegExpKey& key) { return key.pattern->hash(); }
+ static bool equal(const JSC::RegExpKey& a, const JSC::RegExpKey& b) { return a == b; }
+ static const bool safeToCompareToEmptyOrDeleted = false;
+};
+
+template<> struct DefaultHash<JSC::RegExpKey> {
+ typedef RegExpHash<JSC::RegExpKey> Hash;
+};
+
+template<> struct HashTraits<JSC::RegExpKey> : GenericHashTraits<JSC::RegExpKey> {
+ static void constructDeletedValue(JSC::RegExpKey& slot) { slot.flagsValue = -1; }
+ static bool isDeletedValue(const JSC::RegExpKey& value) { return value.flagsValue == -1; }
+};
+} // namespace WTF
+
+#endif // RegExpKey_h
diff --git a/JavaScriptCore/runtime/RegExpPrototype.cpp b/JavaScriptCore/runtime/RegExpPrototype.cpp
index 9d78f59..834412b 100644
--- a/JavaScriptCore/runtime/RegExpPrototype.cpp
+++ b/JavaScriptCore/runtime/RegExpPrototype.cpp
@@ -33,6 +33,7 @@
#include "PrototypeFunction.h"
#include "RegExpObject.h"
#include "RegExp.h"
+#include "RegExpCache.h"
namespace JSC {
@@ -91,7 +92,7 @@ EncodedJSValue JSC_HOST_CALL regExpProtoFuncCompile(ExecState* exec)
} else {
UString pattern = !exec->argumentCount() ? UString("") : arg0.toString(exec);
UString flags = arg1.isUndefined() ? UString("") : arg1.toString(exec);
- regExp = RegExp::create(&exec->globalData(), pattern, flags);
+ regExp = exec->globalData().regExpCache()->lookupOrCreate(pattern, flags);
}
if (!regExp->isValid())
diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp
index 5b90456..8b56d53 100644
--- a/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/JavaScriptCore/runtime/StringPrototype.cpp
@@ -33,6 +33,7 @@
#include "ObjectPrototype.h"
#include "Operations.h"
#include "PropertyNameArray.h"
+#include "RegExpCache.h"
#include "RegExpConstructor.h"
#include "RegExpObject.h"
#include <wtf/ASCIICType.h>
@@ -585,7 +586,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncMatch(ExecState* exec)
* If regexp is not an object whose [[Class]] property is "RegExp", it is
* replaced with the result of the expression new RegExp(regexp).
*/
- reg = RegExp::create(&exec->globalData(), a0.toString(exec));
+ reg = exec->globalData().regExpCache()->lookupOrCreate(a0.toString(exec), UString::null());
}
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
@@ -636,7 +637,7 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncSearch(ExecState* exec)
* If regexp is not an object whose [[Class]] property is "RegExp", it is
* replaced with the result of the expression new RegExp(regexp).
*/
- reg = RegExp::create(&exec->globalData(), a0.toString(exec));
+ reg = exec->globalData().regExpCache()->lookupOrCreate(a0.toString(exec), UString::null());
}
RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
int pos;
diff --git a/JavaScriptCore/runtime/SymbolTable.h b/JavaScriptCore/runtime/SymbolTable.h
index f5e2669..2717075 100644
--- a/JavaScriptCore/runtime/SymbolTable.h
+++ b/JavaScriptCore/runtime/SymbolTable.h
@@ -121,8 +121,11 @@ namespace JSC {
typedef HashMap<RefPtr<UString::Rep>, SymbolTableEntry, IdentifierRepHash, HashTraits<RefPtr<UString::Rep> >, SymbolTableIndexHashTraits> SymbolTable;
- class SharedSymbolTable : public SymbolTable, public RefCounted<SharedSymbolTable>
- {
+ class SharedSymbolTable : public SymbolTable, public RefCounted<SharedSymbolTable> {
+ public:
+ static PassRefPtr<SharedSymbolTable> create() { return adoptRef(new SharedSymbolTable); }
+ private:
+ SharedSymbolTable() { }
};
} // namespace JSC
diff --git a/JavaScriptCore/wtf/CMakeLists.txt b/JavaScriptCore/wtf/CMakeLists.txt
index db69117..1119b3c 100644
--- a/JavaScriptCore/wtf/CMakeLists.txt
+++ b/JavaScriptCore/wtf/CMakeLists.txt
@@ -5,6 +5,7 @@ SET(WTF_SOURCES
FastMalloc.cpp
HashTable.cpp
MainThread.cpp
+ MD5.cpp
RandomNumber.cpp
RefCountedLeakCounter.cpp
StringExtras.cpp
diff --git a/JavaScriptCore/wtf/FastMalloc.h b/JavaScriptCore/wtf/FastMalloc.h
index 1ccd6a6..9729bc3 100644
--- a/JavaScriptCore/wtf/FastMalloc.h
+++ b/JavaScriptCore/wtf/FastMalloc.h
@@ -207,7 +207,7 @@ using WTF::fastMallocAllow;
#define WTF_PRIVATE_INLINE inline
#endif
-#if !defined(_CRTDBG_MAP_ALLOC) && !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC)
+#if !defined(_CRTDBG_MAP_ALLOC) && !(defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC && !PLATFORM(BREWMP))
// The nothrow functions here are actually not all that helpful, because fastMalloc will
// call CRASH() rather than returning 0, and returning 0 is what nothrow is all about.
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index 8c125c1..b92d267 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -100,7 +100,10 @@
#undef _WIN32
#endif
-
+/* COMPILER(INTEL) - Intel C++ Compiler */
+#if defined(__INTEL_COMPILER)
+#define WTF_COMPILER_INTEL 1
+#endif
/* ==== CPU() - the target CPU architecture ==== */
@@ -982,9 +985,12 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define ENABLE_JIT_OPTIMIZE_MOD 1
#endif
#endif
-#if (CPU(X86) && USE(JSVALUE32_64)) || (CPU(X86_64) && USE(JSVALUE64))
+#if (CPU(X86) && USE(JSVALUE32_64)) || (CPU(X86_64) && USE(JSVALUE64)) \
+ || CPU(ARM)
+#if ENABLE(JIT) && !defined(ENABLE_JIT_OPTIMIZE_NATIVE_CALL)
#define ENABLE_JIT_OPTIMIZE_NATIVE_CALL 1
#endif
+#endif
#if ENABLE(JIT)
#ifndef ENABLE_JIT_OPTIMIZE_CALL
@@ -1099,4 +1105,13 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define ENABLE_JSC_ZOMBIES 0
+#if !defined(BUILDING_ON_TIGER)
+#define ENABLE_RECURSIVE_PARSE 1
+#endif
+
+/* FIXME: Eventually we should enable this for all platforms and get rid of the define. */
+#if PLATFORM(MAC)
+#define WTF_USE_PLATFORM_STRATEGIES 1
+#endif
+
#endif /* WTF_Platform_h */
diff --git a/JavaScriptCore/wtf/RetainPtr.h b/JavaScriptCore/wtf/RetainPtr.h
index 77f25e0..f5a027e 100644
--- a/JavaScriptCore/wtf/RetainPtr.h
+++ b/JavaScriptCore/wtf/RetainPtr.h
@@ -21,6 +21,7 @@
#ifndef RetainPtr_h
#define RetainPtr_h
+#include "HashTraits.h"
#include "TypeTraits.h"
#include <algorithm>
#include <CoreFoundation/CoreFoundation.h>
@@ -60,6 +61,10 @@ namespace WTF {
RetainPtr(const RetainPtr& o) : m_ptr(o.m_ptr) { if (PtrType ptr = m_ptr) CFRetain(ptr); }
+ // Hash table deleted values, which are only constructed and never copied or destroyed.
+ RetainPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { }
+ bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); }
+
~RetainPtr() { if (PtrType ptr = m_ptr) CFRelease(ptr); }
template <typename U> RetainPtr(const RetainPtr<U>& o) : m_ptr(o.get()) { if (PtrType ptr = m_ptr) CFRetain(ptr); }
@@ -87,6 +92,8 @@ namespace WTF {
void swap(RetainPtr&);
private:
+ static T* hashTableDeletedValue() { return reinterpret_cast<T*>(-1); }
+
PtrType m_ptr;
};
@@ -193,6 +200,23 @@ namespace WTF {
{
return a != b.get();
}
+
+ template<typename P> struct HashTraits<RetainPtr<P> > : GenericHashTraits<RetainPtr<P> > {
+ static const bool emptyValueIsZero = true;
+ static void constructDeletedValue(RetainPtr<P>& slot) { new (&slot) RetainPtr<P>(HashTableDeletedValue); }
+ static bool isDeletedValue(const RetainPtr<P>& value) { return value == reinterpret_cast<P*>(-1); }
+ };
+
+ template<typename P> struct PtrHash<RetainPtr<P> > : PtrHash<P*> {
+ using PtrHash<P*>::hash;
+ static unsigned hash(const RetainPtr<P>& key) { return hash(key.get()); }
+ using PtrHash<P*>::equal;
+ static bool equal(const RetainPtr<P>& a, const RetainPtr<P>& b) { return a == b; }
+ static bool equal(P* a, const RetainPtr<P>& b) { return a == b; }
+ static bool equal(const RetainPtr<P>& a, P* b) { return a == b; }
+ };
+
+ template<typename P> struct DefaultHash<RetainPtr<P> > { typedef PtrHash<RetainPtr<P> > Hash; };
} // namespace WTF
diff --git a/JavaScriptCore/wtf/StringExtras.h b/JavaScriptCore/wtf/StringExtras.h
index e8f2878..8156580 100644
--- a/JavaScriptCore/wtf/StringExtras.h
+++ b/JavaScriptCore/wtf/StringExtras.h
@@ -28,6 +28,7 @@
#include <stdarg.h>
#include <stdio.h>
+#include <string.h>
#if HAVE(STRINGS_H)
#include <strings.h>
diff --git a/JavaScriptCore/wtf/ThreadSafeShared.h b/JavaScriptCore/wtf/ThreadSafeShared.h
index 688747e..33c6612 100644
--- a/JavaScriptCore/wtf/ThreadSafeShared.h
+++ b/JavaScriptCore/wtf/ThreadSafeShared.h
@@ -129,16 +129,16 @@ private:
template<class T> class ThreadSafeShared : public ThreadSafeSharedBase {
public:
- ThreadSafeShared(int initialRefCount = 1)
- : ThreadSafeSharedBase(initialRefCount)
- {
- }
-
void deref()
{
if (derefBase())
delete static_cast<T*>(this);
}
+
+protected:
+ ThreadSafeShared()
+ {
+ }
};
} // namespace WTF
diff --git a/JavaScriptCore/wtf/ThreadSpecific.h b/JavaScriptCore/wtf/ThreadSpecific.h
index 7e5679f..893f561 100644
--- a/JavaScriptCore/wtf/ThreadSpecific.h
+++ b/JavaScriptCore/wtf/ThreadSpecific.h
@@ -47,13 +47,15 @@
#include <pthread.h>
#elif PLATFORM(QT)
#include <QThreadStorage>
+#elif PLATFORM(GTK)
+#include <glib.h>
#elif OS(WINDOWS)
#include <windows.h>
#endif
namespace WTF {
-#if !USE(PTHREADS) && !PLATFORM(QT) && OS(WINDOWS)
+#if !USE(PTHREADS) && !PLATFORM(QT) && !PLATFORM(GTK) && OS(WINDOWS)
// ThreadSpecificThreadExit should be called each time when a thread is detached.
// This is done automatically for threads created with WTF::createThread.
void ThreadSpecificThreadExit();
@@ -68,7 +70,7 @@ public:
~ThreadSpecific();
private:
-#if !USE(PTHREADS) && !PLATFORM(QT) && OS(WINDOWS)
+#if !USE(PTHREADS) && !PLATFORM(QT) && !PLATFORM(GTK) && OS(WINDOWS)
friend void ThreadSpecificThreadExit();
#endif
@@ -76,7 +78,7 @@ private:
void set(T*);
void static destroy(void* ptr);
-#if USE(PTHREADS) || PLATFORM(QT) || OS(WINDOWS)
+#if USE(PTHREADS) || PLATFORM(QT) || PLATFORM(GTK) || OS(WINDOWS)
struct Data : Noncopyable {
Data(T* value, ThreadSpecific<T>* owner) : value(value), owner(owner) {}
#if PLATFORM(QT)
@@ -85,7 +87,7 @@ private:
T* value;
ThreadSpecific<T>* owner;
-#if !USE(PTHREADS) && !PLATFORM(QT)
+#if !USE(PTHREADS) && !PLATFORM(QT) && !PLATFORM(GTK)
void (*destructor)(void*);
#endif
};
@@ -98,6 +100,8 @@ private:
pthread_key_t m_key;
#elif PLATFORM(QT)
QThreadStorage<Data*> m_key;
+#elif PLATFORM(GTK)
+ GStaticPrivate m_key;
#elif OS(WINDOWS)
int m_index;
#endif
@@ -186,6 +190,35 @@ inline void ThreadSpecific<T>::set(T* ptr)
m_key.setLocalData(data);
}
+#elif PLATFORM(GTK)
+
+template<typename T>
+inline ThreadSpecific<T>::ThreadSpecific()
+{
+ g_static_private_init(&m_key);
+}
+
+template<typename T>
+inline ThreadSpecific<T>::~ThreadSpecific()
+{
+ g_static_private_free(&m_key);
+}
+
+template<typename T>
+inline T* ThreadSpecific<T>::get()
+{
+ Data* data = static_cast<Data*>(g_static_private_get(&m_key));
+ return data ? data->value : 0;
+}
+
+template<typename T>
+inline void ThreadSpecific<T>::set(T* ptr)
+{
+ ASSERT(!get());
+ Data* data = new Data(ptr, this);
+ g_static_private_set(&m_key, data, destroy);
+}
+
#elif OS(WINDOWS)
// TLS_OUT_OF_INDEXES is not defined on WinCE.
@@ -253,6 +286,9 @@ inline void ThreadSpecific<T>::destroy(void* ptr)
// We want get() to keep working while data destructor works, because it can be called indirectly by the destructor.
// Some pthreads implementations zero out the pointer before calling destroy(), so we temporarily reset it.
pthread_setspecific(data->owner->m_key, ptr);
+#elif PLATFORM(GTK)
+ // See comment as above
+ g_static_private_set(&data->owner->m_key, data, 0);
#endif
#if PLATFORM(QT)
// See comment as above
@@ -266,6 +302,8 @@ inline void ThreadSpecific<T>::destroy(void* ptr)
pthread_setspecific(data->owner->m_key, 0);
#elif PLATFORM(QT)
// Do nothing here
+#elif PLATFORM(GTK)
+ g_static_private_set(&data->owner->m_key, 0, 0);
#elif OS(WINDOWS)
TlsSetValue(tlsKeys()[data->owner->m_index], 0);
#else
@@ -285,7 +323,7 @@ inline ThreadSpecific<T>::operator T*()
if (!ptr) {
// Set up thread-specific value's memory pointer before invoking constructor, in case any function it calls
// needs to access the value, to avoid recursion.
- ptr = static_cast<T*>(fastMalloc(sizeof(T)));
+ ptr = static_cast<T*>(fastZeroedMalloc(sizeof(T)));
set(ptr);
new (ptr) T;
}
diff --git a/JavaScriptCore/wtf/Vector.h b/JavaScriptCore/wtf/Vector.h
index b653001..c833eeb 100644
--- a/JavaScriptCore/wtf/Vector.h
+++ b/JavaScriptCore/wtf/Vector.h
@@ -49,7 +49,7 @@ namespace WTF {
#error WTF_ALIGN macros need alignment control.
#endif
- #if COMPILER(GCC) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
+ #if COMPILER(GCC) && !COMPILER(INTEL) && (((__GNUC__ * 100) + __GNUC_MINOR__) >= 303)
typedef char __attribute__((__may_alias__)) AlignedBufferChar;
#else
typedef char AlignedBufferChar;
diff --git a/JavaScriptCore/yarr/RegexCompiler.cpp b/JavaScriptCore/yarr/RegexCompiler.cpp
index bcfc188..fa87186 100644
--- a/JavaScriptCore/yarr/RegexCompiler.cpp
+++ b/JavaScriptCore/yarr/RegexCompiler.cpp
@@ -623,7 +623,7 @@ const char* compileRegex(const UString& patternString, RegexPattern& pattern)
constructor.setupOffsets();
- return false;
+ return 0;
};
diff --git a/JavaScriptCore/yarr/RegexJIT.cpp b/JavaScriptCore/yarr/RegexJIT.cpp
index 768a53d..68d3803 100644
--- a/JavaScriptCore/yarr/RegexJIT.cpp
+++ b/JavaScriptCore/yarr/RegexJIT.cpp
@@ -1241,16 +1241,18 @@ class RegexGenerator : private MacroAssembler {
// If we get here, the alternative matched.
if (m_pattern.m_body->m_callFrameSize)
addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
-
+
ASSERT(index != returnRegister);
if (m_pattern.m_body->m_hasFixedSize) {
move(index, returnRegister);
if (alternative->m_minimumSize)
sub32(Imm32(alternative->m_minimumSize), returnRegister);
+
+ store32(returnRegister, output);
} else
- pop(returnRegister);
+ load32(Address(output), returnRegister);
+
store32(index, Address(output, 4));
- store32(returnRegister, output);
generateReturn();
@@ -1334,7 +1336,7 @@ class RegexGenerator : private MacroAssembler {
if (!m_pattern.m_body->m_hasFixedSize) {
move(index, regT0);
sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
- poke(regT0, m_pattern.m_body->m_callFrameSize);
+ store32(regT0, Address(output));
}
// Update index if necessary, and loop (without checking).
@@ -1349,9 +1351,9 @@ class RegexGenerator : private MacroAssembler {
if (countCheckedForCurrentAlternative - 1) {
move(index, regT0);
sub32(Imm32(countCheckedForCurrentAlternative - 1), regT0);
- poke(regT0, m_pattern.m_body->m_callFrameSize);
+ store32(regT0, Address(output));
} else
- poke(index, m_pattern.m_body->m_callFrameSize);
+ store32(index, Address(output));
}
// Check if there is sufficent input to run the first alternative again.
jumpIfAvailableInput(incrementForNextIter).linkTo(firstAlternativeInputChecked, this);
@@ -1377,11 +1379,8 @@ class RegexGenerator : private MacroAssembler {
// it has either been incremented by 1 or by (countToCheckForFirstAlternative + 1) ...
// but since we're about to return a failure this doesn't really matter!)
- unsigned frameSize = m_pattern.m_body->m_callFrameSize;
- if (!m_pattern.m_body->m_hasFixedSize)
- ++frameSize;
- if (frameSize)
- addPtr(Imm32(frameSize * sizeof(void*)), stackPointerRegister);
+ if (m_pattern.m_body->m_callFrameSize)
+ addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
move(Imm32(-1), returnRegister);
@@ -1451,9 +1450,8 @@ public:
{
generateEnter();
- // TODO: do I really want this on the stack?
if (!m_pattern.m_body->m_hasFixedSize)
- push(index);
+ store32(index, Address(output));
if (m_pattern.m_body->m_callFrameSize)
subPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
diff --git a/JavaScriptGlue/Configurations/Version.xcconfig b/JavaScriptGlue/Configurations/Version.xcconfig
index 6f999af..f775a54 100644
--- a/JavaScriptGlue/Configurations/Version.xcconfig
+++ b/JavaScriptGlue/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 1;
+MINOR_VERSION = 2;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/LayoutTests/fast/js/resources/bom-in-file-retains-correct-offset.js b/LayoutTests/fast/js/resources/bom-in-file-retains-correct-offset.js
index b62a250..c4870d2 100644
--- a/LayoutTests/fast/js/resources/bom-in-file-retains-correct-offset.js
+++ b/LayoutTests/fast/js/resources/bom-in-file-retains-correct-offset.js
@@ -1,2 +1,2 @@
description("This ensures that BOM's scattered through a source file do not break parsing");
-function f(){successfullyReparsed=true;shouldBeTrue('successfullyReparsed');successfullyParsed=true}f();
+function g(){function f(){successfullyReparsed=true;shouldBeTrue('successfullyReparsed');successfullyParsed=true}f();} g()
diff --git a/LayoutTests/fast/js/resources/script-line-number.js b/LayoutTests/fast/js/resources/script-line-number.js
new file mode 100644
index 0000000..09d9b1a
--- /dev/null
+++ b/LayoutTests/fast/js/resources/script-line-number.js
@@ -0,0 +1,26 @@
+description(
+"This test checks that line numbers are correctly reported for both inline scripts and inline event handlers."
+);
+
+function getLineFromError(e)
+{
+ // JSC
+ if (e.line)
+ return e.line;
+
+ // V8
+ if (e.stack) {
+ // ErrorName: ErrorDescription at FileName:LineNumber:ColumnNumber
+ parts = e.stack.split(":");
+ return parts[parts.length - 2];
+ }
+
+ return -1;
+}
+
+function assertErrorOnLine(error, expectedLine)
+{
+ shouldBe(stringify(getLineFromError(error)), stringify(expectedLine));
+}
+
+var successfullyParsed = true;
diff --git a/LayoutTests/storage/change-version.html b/LayoutTests/storage/change-version.html
index d81c6b5..9b6876c 100644
--- a/LayoutTests/storage/change-version.html
+++ b/LayoutTests/storage/change-version.html
@@ -1,26 +1,26 @@
-<html>
+<html>
<head>
<title>Test database.changeVersion</title>
-<script>
-var db;
+<script>
+var db1;
var EXPECTED_VERSION_AFTER_HIXIE_TEST = '2';
var EXPECTED_VERSION_AFTER_RELOAD = '3';
-
+
function emptyFunction() { }
-
+
function changeVersionCallback(tx)
{
tx.executeSql("DROP table if exists info;", [], emptyFunction, emptyFunction);
tx.executeSql("CREATE table if not exists info (version INTEGER);", [], emptyFunction, emptyFunction);
tx.executeSql("INSERT into info values(?);", [EXPECTED_VERSION_AFTER_RELOAD], emptyFunction, emptyFunction);
}
-
+
function changeVersionSuccess()
{
- log("Successfully changed version to ' + db.version + '. Reloading.");
+ log("Successfully changed version to " + db1.version + ". Reloading.");
window.location.href = window.location + '?2';
}
-
+
function changeVersionError(error)
{
log("Error: " + error.message);
@@ -42,8 +42,8 @@ function log(message)
function runTest()
{
if (window.location.search == "?2") {
- db = window.openDatabase("changeversion-test", "", "Test for the database.changeVersion() function", 1024);
- log("Finished tests with version " + db.version + "; expected version: " + EXPECTED_VERSION_AFTER_RELOAD);
+ db1 = window.openDatabase("changeversion-test", "", "Test for the database.changeVersion() function", 1024);
+ log("Finished tests with version " + db1.version + "; expected version: " + EXPECTED_VERSION_AFTER_RELOAD);
finishTest();
} else
testPart1();
@@ -55,31 +55,43 @@ function testPart1() {
layoutTestController.dumpAsText();
layoutTestController.waitUntilDone();
}
-
- db = window.openDatabase("changeversion-test", "", "Test for the database.changeVersion() function", 1024);
- if (db.version != EXPECTED_VERSION_AFTER_RELOAD) {
- // First run Hixie's test to ensure basic changeVersion functionality works (see bug 28418).
- db.changeVersion("", EXPECTED_VERSION_AFTER_HIXIE_TEST, emptyFunction, function (e) {
- log('FAIL in changeVersion:' + e);
- finishTest();
- }, function () {
- try {
- var db2 = openDatabase("change-version-test", EXPECTED_VERSION_AFTER_HIXIE_TEST, "", 0);
- } catch (e) {
- log('FAIL in openDatabase: ' + e);
- finishTest();
- }
- // The two database versions should match.
- if (db.version == db2.version)
- log("PASS: db.version(" + db.version + ") matches db2.version(" + db2.version +") as expected.");
- else
- log("FAIL: db.version(" + db.version + ") does not match db2.version(" + db2.version +")");
+ db1 = window.openDatabase("changeversion-test", "1", "Test for the database.changeVersion() function", 1024);
+ var db2 = window.openDatabase("changeversion-test", "1", "Test for the database.changeVersion() function", 1024);
- // Now try a test to ensure the version persists after reloading (see bug 27836)
- db.changeVersion(EXPECTED_VERSION_AFTER_HIXIE_TEST, EXPECTED_VERSION_AFTER_RELOAD, changeVersionCallback, changeVersionError, changeVersionSuccess);
+ // First run Hixie's test to ensure basic changeVersion functionality works (see bug 28418).
+ db1.changeVersion("1", EXPECTED_VERSION_AFTER_HIXIE_TEST, emptyFunction, function (e) {
+ log("FAIL in changeVersion:" + e);
+ finishTest();
+ }, function () {
+ // Make sure the version change has propagated to db2 too.
+ // All transactions on db2 should fail.
+ if (db2.version != db1.version) {
+ log("FAIL: changing db1's version (" + db1.version + ") did not change db2's version (" + db2.version + ") as expected.");
+ finishTest();
+ }
+ db2.transaction(function(tx) {
+ tx.executeSql("CREATE TABLE IF NOT EXISTS Test (Foo INT)");
+ }, function(error) { }, function() {
+ log("FAIL: The DB version changed, all transactions on db2 should fail.");
+ finishTest();
});
- }
+
+ // Make sure any new handle to the same DB sees the new version
+ try {
+ var db3 = openDatabase("change-version-test", EXPECTED_VERSION_AFTER_HIXIE_TEST, "", 0);
+ } catch (e) {
+ log("FAIL in openDatabase: " + e);
+ finishTest();
+ }
+ if (db1.version != db3.version) {
+ log("FAIL: db.version(" + db1.version + ") does not match db3.version(" + db3.version +")");
+ finishTest();
+ }
+
+ // Now try a test to ensure the version persists after reloading (see bug 27836)
+ db1.changeVersion(EXPECTED_VERSION_AFTER_HIXIE_TEST, EXPECTED_VERSION_AFTER_RELOAD, changeVersionCallback, changeVersionError, changeVersionSuccess);
+ });
}
</script>
</head>
diff --git a/LayoutTests/storage/domstorage/complex-values-expected.txt b/LayoutTests/storage/domstorage/complex-values-expected.txt
index 69d7644..9a75e42 100644
--- a/LayoutTests/storage/domstorage/complex-values-expected.txt
+++ b/LayoutTests/storage/domstorage/complex-values-expected.txt
@@ -82,25 +82,25 @@ PASS storage.getItem('foo9') is "2"
storage.foo10 = k
PASS typeof storage['foo10'] is "string"
-PASS storage['foo10'] is "ÿ찡hello"
+PASS storage['foo10'] is "ÿ찡�hello"
PASS typeof storage.foo10 is "string"
-PASS storage.foo10 is "ÿ찡hello"
+PASS storage.foo10 is "ÿ찡�hello"
PASS typeof storage.getItem('foo10') is "string"
-PASS storage.getItem('foo10') is "ÿ찡hello"
+PASS storage.getItem('foo10') is "ÿ찡�hello"
storage['foo11'] = k
PASS typeof storage['foo11'] is "string"
-PASS storage['foo11'] is "ÿ찡hello"
+PASS storage['foo11'] is "ÿ찡�hello"
PASS typeof storage.foo11 is "string"
-PASS storage.foo11 is "ÿ찡hello"
+PASS storage.foo11 is "ÿ찡�hello"
PASS typeof storage.getItem('foo11') is "string"
-PASS storage.getItem('foo11') is "ÿ찡hello"
+PASS storage.getItem('foo11') is "ÿ찡�hello"
storage.setItem('foo12', k)
PASS typeof storage['foo12'] is "string"
-PASS storage['foo12'] is "ÿ찡hello"
+PASS storage['foo12'] is "ÿ찡�hello"
PASS typeof storage.foo12 is "string"
-PASS storage.foo12 is "ÿ찡hello"
+PASS storage.foo12 is "ÿ찡�hello"
PASS typeof storage.getItem('foo12') is "string"
-PASS storage.getItem('foo12') is "ÿ찡hello"
+PASS storage.getItem('foo12') is "ÿ찡�hello"
Testing localStorage
@@ -182,25 +182,25 @@ PASS storage.getItem('foo9') is "2"
storage.foo10 = k
PASS typeof storage['foo10'] is "string"
-PASS storage['foo10'] is "ÿ찡hello"
+PASS storage['foo10'] is "ÿ찡�hello"
PASS typeof storage.foo10 is "string"
-PASS storage.foo10 is "ÿ찡hello"
+PASS storage.foo10 is "ÿ찡�hello"
PASS typeof storage.getItem('foo10') is "string"
-PASS storage.getItem('foo10') is "ÿ찡hello"
+PASS storage.getItem('foo10') is "ÿ찡�hello"
storage['foo11'] = k
PASS typeof storage['foo11'] is "string"
-PASS storage['foo11'] is "ÿ찡hello"
+PASS storage['foo11'] is "ÿ찡�hello"
PASS typeof storage.foo11 is "string"
-PASS storage.foo11 is "ÿ찡hello"
+PASS storage.foo11 is "ÿ찡�hello"
PASS typeof storage.getItem('foo11') is "string"
-PASS storage.getItem('foo11') is "ÿ찡hello"
+PASS storage.getItem('foo11') is "ÿ찡�hello"
storage.setItem('foo12', k)
PASS typeof storage['foo12'] is "string"
-PASS storage['foo12'] is "ÿ찡hello"
+PASS storage['foo12'] is "ÿ찡�hello"
PASS typeof storage.foo12 is "string"
-PASS storage.foo12 is "ÿ찡hello"
+PASS storage.foo12 is "ÿ찡�hello"
PASS typeof storage.getItem('foo12') is "string"
-PASS storage.getItem('foo12') is "ÿ찡hello"
+PASS storage.getItem('foo12') is "ÿ찡�hello"
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/sql-error-codes-expected.txt b/LayoutTests/storage/sql-error-codes-expected.txt
new file mode 100644
index 0000000..1a9caa7
--- /dev/null
+++ b/LayoutTests/storage/sql-error-codes-expected.txt
@@ -0,0 +1,11 @@
+CONSOLE MESSAGE: line 0: Exception thrown in transaction callback.
+CONSOLE MESSAGE: line 0: Cannot call toString() on this object.
+This test tests the error codes reported in exceptional situations.
+PASS: expected and got error code UNKNOWN_ERR
+PASS: expected and got error code UNKNOWN_ERR
+PASS: expected and got error code SYNTAX_ERR
+PASS: expected and got error code SYNTAX_ERR
+PASS: expected and got error code UNKNOWN_ERR
+PASS: expected and got error code QUOTA_ERR
+PASS: expected and got error code VERSION_ERR
+
diff --git a/LayoutTests/storage/sql-error-codes.html b/LayoutTests/storage/sql-error-codes.html
new file mode 100644
index 0000000..dc70c6c
--- /dev/null
+++ b/LayoutTests/storage/sql-error-codes.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<script src="resources/database-common.js"></script>
+<script src="sql-error-codes.js"></script>
+</head>
+<body onload="setupAndRunTest();">
+This test tests the error codes reported in exceptional situations.<br>
+<pre id="console">
+FAILURE: test didn't run.
+</pre>
+</body>
+</html>
diff --git a/LayoutTests/storage/sql-error-codes.js b/LayoutTests/storage/sql-error-codes.js
new file mode 100644
index 0000000..9d6f6d3
--- /dev/null
+++ b/LayoutTests/storage/sql-error-codes.js
@@ -0,0 +1,121 @@
+function finishTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+var TOTAL_TESTS = 7;
+var testsRun = 0;
+function transactionErrorCallback(error, expectedErrorCodeName)
+{
+ if (error.code == error[expectedErrorCodeName]) {
+ log("PASS: expected and got error code " + expectedErrorCodeName);
+ if (++testsRun == TOTAL_TESTS)
+ finishTest();
+ } else {
+ log("FAIL: expected error code " + expectedErrorCodeName + " (" + error[expectedErrorCodeName] + "); got " + error.code);
+ finishTest();
+ }
+}
+
+function transactionSuccessCallback()
+{
+ log("FAIL: a transaction has completed successfully.");
+ finishTest();
+}
+
+function testTransaction(db, transactionCallback, expectedErrorCodeName)
+{
+ db.transaction(transactionCallback,
+ function(error) {
+ transactionErrorCallback(error, expectedErrorCodeName);
+ }, transactionSuccessCallback);
+}
+
+function testTransactionThrowsException(db)
+{
+ testTransaction(db, function(tx) { throw "Exception thrown in transaction callback."; }, "UNKNOWN_ERR");
+}
+
+function testTransactionFailureBecauseOfStatementFailure(db)
+{
+ testTransaction(db,
+ function(tx) {
+ tx.executeSql("BAD STATEMENT", [], null, function(tx, error) { return true; });
+ }, "UNKNOWN_ERR");
+}
+
+function testInvalidStatement(db)
+{
+ testTransaction(db, function(tx) { tx.executeSql("BAD STATEMENT"); }, "SYNTAX_ERR");
+}
+
+function testIncorrectNumberOfBindParameters(db)
+{
+ testTransaction(db,
+ function(tx) {
+ tx.executeSql("CREATE TABLE IF NOT EXISTS BadBindNumberTest (Foo INT, Bar INT)");
+ tx.executeSql("INSERT INTO BadBindNumberTest VALUES (?, ?)", [1]);
+ }, "SYNTAX_ERR");
+}
+
+function testBindParameterOfWrongType(db)
+{
+ var badString = { };
+ badString.toString = function() { throw "Cannot call toString() on this object." };
+
+ // JSC will throw an exception when calling badString.toString(). V8 will catch it.
+ // So we run this transaction using a custom success callback.
+ db.transaction(function(tx) {
+ tx.executeSql("CREATE TABLE IF NOT EXISTS BadBindTypeTest (Foo TEXT)");
+ tx.executeSql("INSERT INTO BadBindTypeTest VALUES (?)", [badString]);
+ }, function(error) {
+ transactionErrorCallback(error, "UNKNOWN_ERR");
+ }, function() {
+ log("The transaction in testBindParameterOfWrongType() was successful.");
+ testsRun++;
+ });
+}
+
+function testQuotaExceeded(db)
+{
+ testTransaction(db,
+ function(tx) {
+ tx.executeSql("CREATE TABLE IF NOT EXISTS QuotaTest (Foo BLOB)");
+ tx.executeSql("INSERT INTO QuotaTest VALUES (ZEROBLOB(10 * 1024 * 1024))");
+ }, "QUOTA_ERR");
+}
+
+function testVersionMismatch(db)
+{
+ // Use another DB handle to change the version. However, in order to make sure that the DB version is not
+ // changed before the transactions in the other tests have run, we need to do it in a transaction on 'db'.
+ db.transaction(function(tx) {
+ var db2 = openDatabaseWithSuffix("SQLErrorCodesTest", "1.0", "Tests the error codes.", 1);
+ db2.changeVersion("1.0", "2.0", function(tx) { },
+ function(error) {
+ log("FAIL: could not change the DB version.");
+ finishTest();
+ }, function() { });
+ });
+
+ testTransaction(db,
+ function(tx) {
+ tx.executeSql("THIS STATEMENT SHOULD NEVER GET EXECUTED");
+ }, "VERSION_ERR");
+}
+
+function runTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.clearAllDatabases();
+
+ var db = openDatabaseWithSuffix("SQLErrorCodesTest", "1.0", "Tests the error codes.", 1);
+ testTransactionThrowsException(db);
+ testTransactionFailureBecauseOfStatementFailure(db);
+ testInvalidStatement(db);
+ testIncorrectNumberOfBindParameters(db);
+ testBindParameterOfWrongType(db);
+ testQuotaExceeded(db);
+ testVersionMismatch(db);
+}
diff --git a/WebCore/Android.derived.jscbindings.mk b/WebCore/Android.derived.jscbindings.mk
index 318d8ae..a2a5c8c 100644
--- a/WebCore/Android.derived.jscbindings.mk
+++ b/WebCore/Android.derived.jscbindings.mk
@@ -157,6 +157,7 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/dom/%.cpp : $(intermediates)/dom/
# HTML
GEN := \
$(intermediates)/html/JSBlob.h \
+ $(intermediates)/html/JSBlobBuilder.h \
$(intermediates)/html/JSDOMFormData.h \
$(intermediates)/html/JSDataGridColumn.h \
$(intermediates)/html/JSDataGridColumnList.h \
@@ -345,6 +346,7 @@ GEN := \
$(intermediates)/storage/JSDatabaseCallback.h \
$(intermediates)/storage/JSDatabaseSync.h \
$(intermediates)/storage/JSSQLError.h \
+ $(intermediates)/storage/JSSQLException.h \
$(intermediates)/storage/JSSQLResultSet.h \
$(intermediates)/storage/JSSQLResultSetRowList.h \
$(intermediates)/storage/JSSQLStatementCallback.h \
diff --git a/WebCore/Android.derived.v8bindings.mk b/WebCore/Android.derived.v8bindings.mk
index 7cfc963..d852246 100644
--- a/WebCore/Android.derived.v8bindings.mk
+++ b/WebCore/Android.derived.v8bindings.mk
@@ -142,7 +142,11 @@ $(patsubst %.h,%.cpp,$(GEN)): $(intermediates)/bindings/%.cpp : $(intermediates)
# HTML
GEN := \
$(intermediates)/bindings/V8Blob.h \
+<<<<<<< HEAD
$(intermediates)/bindings/V8DOMFormData.h \
+=======
+ $(intermediates)/bindings/V8BlobBuilder.h \
+>>>>>>> webkit.org at r61871
$(intermediates)/bindings/V8DataGridColumn.h \
$(intermediates)/bindings/V8DataGridColumnList.h \
$(intermediates)/bindings/V8File.h \
@@ -340,6 +344,7 @@ GEN := \
$(intermediates)/bindings/V8DatabaseCallback.h \
$(intermediates)/bindings/V8DatabaseSync.h \
$(intermediates)/bindings/V8SQLError.h \
+ $(intermediates)/bindings/V8SQLException.h \
$(intermediates)/bindings/V8SQLResultSet.h \
$(intermediates)/bindings/V8SQLResultSetRowList.h \
$(intermediates)/bindings/V8SQLStatementCallback.h \
diff --git a/WebCore/Android.jscbindings.mk b/WebCore/Android.jscbindings.mk
index 43d09c4..2236452 100644
--- a/WebCore/Android.jscbindings.mk
+++ b/WebCore/Android.jscbindings.mk
@@ -125,7 +125,6 @@ LOCAL_SRC_FILES += \
bindings/js/JSLazyEventListener.cpp \
bindings/js/JSLocationCustom.cpp \
bindings/js/JSMainThreadExecState.cpp \
- bindings/js/JSMessageChannelConstructor.cpp \
bindings/js/JSMessageChannelCustom.cpp \
bindings/js/JSMessageEventCustom.cpp \
bindings/js/JSMessagePortCustom.cpp \
@@ -150,23 +149,20 @@ LOCAL_SRC_FILES += \
bindings/js/JSSVGMatrixCustom.cpp \
bindings/js/JSSVGPathSegCustom.cpp \
bindings/js/JSSVGPathSegListCustom.cpp \
- bindings/js/JSSharedWorkerConstructor.cpp \
bindings/js/JSSharedWorkerCustom.cpp \
bindings/js/JSStorageCustom.cpp \
bindings/js/JSStyleSheetCustom.cpp \
bindings/js/JSStyleSheetListCustom.cpp \
bindings/js/JSTextCustom.cpp \
bindings/js/JSTreeWalkerCustom.cpp \
- bindings/js/JSWebKitCSSMatrixConstructor.cpp \
- bindings/js/JSWebKitPointConstructor.cpp \
- bindings/js/JSWorkerConstructor.cpp \
+ bindings/js/JSWebKitCSSMatrixCustom.cpp \
+ bindings/js/JSWebKitPointCustom.cpp \
bindings/js/JSWorkerContextBase.cpp \
bindings/js/JSWorkerContextCustom.cpp \
bindings/js/JSWorkerContextErrorHandler.cpp \
bindings/js/JSWorkerCustom.cpp \
bindings/js/JSXMLHttpRequestCustom.cpp \
bindings/js/JSXMLHttpRequestUploadCustom.cpp \
- bindings/js/JSXSLTProcessorConstructor.cpp \
bindings/js/JSXSLTProcessorCustom.cpp \
bindings/js/ScheduledAction.cpp \
bindings/js/ScriptArray.cpp \
diff --git a/WebCore/Android.mk b/WebCore/Android.mk
index 4b283dc..1b02cc4 100644
--- a/WebCore/Android.mk
+++ b/WebCore/Android.mk
@@ -168,6 +168,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
dom/SelectElement.cpp \
dom/SelectorNodeList.cpp \
dom/SpaceSplitString.cpp \
+ dom/StaticHashSetNodeList.cpp \
dom/StaticNodeList.cpp \
dom/StyleElement.cpp \
dom/StyledElement.cpp \
@@ -250,7 +251,11 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/AsyncImageResizer.cpp \
html/Blob.cpp \
html/CollectionCache.cpp \
+<<<<<<< HEAD
html/DateComponents.cpp \
+=======
+ html/CSSPreloadScanner.cpp \
+>>>>>>> webkit.org at r61871
html/DOMFormData.cpp \
html/File.cpp \
html/FileList.cpp \
@@ -259,11 +264,12 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/FileStreamProxy.cpp \
html/FileThread.cpp \
html/FormDataList.cpp \
- html/HTML5EntityParser.cpp \
- html/HTML5Lexer.cpp \
- html/HTML5DocumentParser.cpp \
- html/HTML5TreeBuilder.cpp \
- html/HTML5ScriptRunner.cpp \
+ html/HTMLEntityParser.cpp \
+ html/HTMLTokenizer.cpp \
+ html/HTMLDocumentParser.cpp \
+ html/HTMLPreloadScanner.cpp \
+ html/HTMLScriptRunner.cpp \
+ html/HTMLTreeBuilder.cpp \
html/HTMLAllCollection.cpp \
html/HTMLCollection.cpp \
html/HTMLDataListElement.cpp \
@@ -274,8 +280,14 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/HTMLImageLoader.cpp \
html/HTMLNameCollection.cpp \
html/HTMLOptionsCollection.cpp \
+<<<<<<< HEAD
+=======
+ html/LegacyHTMLTreeBuilder.cpp \
+>>>>>>> webkit.org at r61871
html/HTMLParserErrorCodes.cpp \
+ html/HTMLParserScheduler.cpp \
html/HTMLTableRowsCollection.cpp \
+<<<<<<< HEAD
html/HTMLViewSourceDocument.cpp \
html/ImageData.cpp \
html/ImageResizerThread.cpp \
@@ -283,6 +295,13 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
html/LegacyHTMLTreeConstructor.cpp \
html/PreloadScanner.cpp \
html/StepRange.cpp \
+=======
+ html/LegacyHTMLDocumentParser.cpp \
+ html/HTMLViewSourceDocument.cpp \
+ html/ImageData.cpp \
+ html/ImageResizerThread.cpp \
+ html/LegacyPreloadScanner.cpp \
+>>>>>>> webkit.org at r61871
html/TimeRanges.cpp \
html/ValidityState.cpp \
\
@@ -311,7 +330,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
loader/DocumentThreadableLoader.cpp \
loader/DocumentWriter.cpp \
loader/FormState.cpp \
+ loader/FormSubmission.cpp \
loader/FrameLoader.cpp \
+ loader/FrameLoaderStateMachine.cpp \
loader/HistoryController.cpp \
loader/ImageDocument.cpp \
loader/ImageLoader.cpp \
@@ -328,7 +349,11 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
loader/Request.cpp \
loader/ResourceLoadNotifier.cpp \
loader/ResourceLoader.cpp \
+<<<<<<< HEAD
loader/SinkDocument.cpp \
+=======
+ loader/SubframeLoader.cpp \
+>>>>>>> webkit.org at r61871
loader/SubresourceLoader.cpp \
loader/TextDocument.cpp \
loader/TextResourceDecoder.cpp \
@@ -572,6 +597,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
\
platform/text/Base64.cpp \
platform/text/BidiContext.cpp \
+ platform/text/Hyphenation.cpp \
platform/text/RegularExpression.cpp \
platform/text/SegmentedString.cpp \
platform/text/String.cpp \
@@ -727,7 +753,9 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
rendering/SVGRenderTreeAsText.cpp \
rendering/SVGRootInlineBox.cpp \
rendering/SVGShadowTreeElements.cpp \
- rendering/SVGTextLayoutUtilities.cpp
+ rendering/SVGTextChunkLayoutInfo.cpp \
+ rendering/SVGTextLayoutUtilities.cpp \
+ rendering/SVGTextQuery.cpp
endif
LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 2c0e6e0..ad93634 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -182,6 +182,7 @@ SET(WebCore_IDL_FILES
dom/WheelEvent.idl
html/Blob.idl
+ html/BlobBuilder.idl
html/DataGridColumn.idl
html/DataGridColumnList.idl
html/DOMFormData.idl
@@ -335,6 +336,7 @@ SET(WebCore_IDL_FILES
storage/IDBSuccessEvent.idl
storage/IndexedDatabaseRequest.idl
storage/SQLError.idl
+ storage/SQLException.idl
storage/SQLResultSet.idl
storage/SQLResultSetRowList.idl
storage/SQLStatementCallback.idl
@@ -347,6 +349,8 @@ SET(WebCore_IDL_FILES
storage/Storage.idl
storage/StorageEvent.idl
+ websockets/WebSocket.idl
+
workers/AbstractWorker.idl
workers/DedicatedWorkerContext.idl
workers/SharedWorker.idl
@@ -511,7 +515,7 @@ ENDIF()
SET(WebCore_SOURCES
${DERIVED_SOURCES_DIR}/CSSGrammar.cpp
${DERIVED_SOURCES_DIR}/HTMLElementFactory.cpp
- ${DERIVED_SOURCES_DIR}/HTMLEntityNames.c
+ ${DERIVED_SOURCES_DIR}/HTMLEntityNames.cpp
${DERIVED_SOURCES_DIR}/HTMLNames.cpp
${DERIVED_SOURCES_DIR}/JSHTMLElementWrapperFactory.cpp
${DERIVED_SOURCES_DIR}/UserAgentStyleSheetsData.cpp
@@ -583,7 +587,7 @@ SET(WebCore_SOURCES
bindings/js/JSElementCustom.cpp
bindings/js/JSEventCustom.cpp
bindings/js/JSEventListener.cpp
- bindings/js/JSEventSourceConstructor.cpp
+ bindings/js/JSEventSourceCustom.cpp
bindings/js/JSEventTarget.cpp
bindings/js/JSExceptionBase.cpp
bindings/js/JSGeolocationCustom.cpp
@@ -612,7 +616,6 @@ SET(WebCore_SOURCES
bindings/js/JSLazyEventListener.cpp
bindings/js/JSLocationCustom.cpp
bindings/js/JSMainThreadExecState.cpp
- bindings/js/JSMessageChannelConstructor.cpp
bindings/js/JSMessageChannelCustom.cpp
bindings/js/JSMessageEventCustom.cpp
bindings/js/JSMessagePortCustom.cpp
@@ -630,7 +633,6 @@ SET(WebCore_SOURCES
bindings/js/JSPluginElementFunctions.cpp
bindings/js/JSPopStateEventCustom.cpp
bindings/js/JSScriptProfileNodeCustom.cpp
- bindings/js/JSSharedWorkerConstructor.cpp
bindings/js/JSSharedWorkerCustom.cpp
bindings/js/JSSQLResultSetRowListCustom.cpp
bindings/js/JSSQLTransactionCustom.cpp
@@ -640,16 +642,14 @@ SET(WebCore_SOURCES
bindings/js/JSStyleSheetListCustom.cpp
bindings/js/JSTextCustom.cpp
bindings/js/JSTreeWalkerCustom.cpp
- bindings/js/JSWebKitCSSMatrixConstructor.cpp
- bindings/js/JSWebKitPointConstructor.cpp
- bindings/js/JSWorkerConstructor.cpp
+ bindings/js/JSWebKitCSSMatrixCustom.cpp
+ bindings/js/JSWebKitPointCustom.cpp
bindings/js/JSWorkerContextBase.cpp
bindings/js/JSWorkerContextCustom.cpp
bindings/js/JSWorkerContextErrorHandler.cpp
bindings/js/JSWorkerCustom.cpp
bindings/js/JSXMLHttpRequestCustom.cpp
bindings/js/JSXMLHttpRequestUploadCustom.cpp
- bindings/js/JSXSLTProcessorConstructor.cpp
bindings/js/JSXSLTProcessorCustom.cpp
bindings/js/ScheduledAction.cpp
bindings/js/ScriptArray.cpp
@@ -818,6 +818,7 @@ SET(WebCore_SOURCES
dom/SelectElement.cpp
dom/SelectorNodeList.cpp
dom/SpaceSplitString.cpp
+ dom/StaticHashSetNodeList.cpp
dom/StaticNodeList.cpp
dom/StyleElement.cpp
dom/StyledElement.cpp
@@ -895,7 +896,9 @@ SET(WebCore_SOURCES
html/AsyncImageResizer.cpp
html/Blob.cpp
+ html/BlobBuilder.cpp
html/CollectionCache.cpp
+ html/CSSPreloadScanner.cpp
html/DOMDataGridDataSource.cpp
html/DOMFormData.cpp
html/DataGridColumn.cpp
@@ -904,11 +907,12 @@ SET(WebCore_SOURCES
html/File.cpp
html/FileList.cpp
html/FormDataList.cpp
- html/HTML5EntityParser.cpp
- html/HTML5Lexer.cpp
- html/HTML5DocumentParser.cpp
- html/HTML5TreeBuilder.cpp
- html/HTML5ScriptRunner.cpp
+ html/HTMLEntityParser.cpp
+ html/HTMLTokenizer.cpp
+ html/HTMLDocumentParser.cpp
+ html/HTMLPreloadScanner.cpp
+ html/HTMLScriptRunner.cpp
+ html/HTMLTreeBuilder.cpp
html/HTMLAllCollection.cpp
html/HTMLAnchorElement.cpp
html/HTMLAppletElement.cpp
@@ -969,8 +973,9 @@ SET(WebCore_SOURCES
html/HTMLOptionsCollection.cpp
html/HTMLParagraphElement.cpp
html/HTMLParamElement.cpp
- html/LegacyHTMLTreeConstructor.cpp
+ html/LegacyHTMLTreeBuilder.cpp
html/HTMLParserErrorCodes.cpp
+ html/HTMLParserScheduler.cpp
html/HTMLPlugInElement.cpp
html/HTMLPlugInImageElement.cpp
html/HTMLPreElement.cpp
@@ -989,13 +994,13 @@ SET(WebCore_SOURCES
html/HTMLTableSectionElement.cpp
html/HTMLTextAreaElement.cpp
html/HTMLTitleElement.cpp
- html/HTMLDocumentParser.cpp
+ html/LegacyHTMLDocumentParser.cpp
html/HTMLUListElement.cpp
html/HTMLViewSourceDocument.cpp
html/ImageData.cpp
html/ImageResizerThread.cpp
html/LabelsNodeList.cpp
- html/PreloadScanner.cpp
+ html/LegacyPreloadScanner.cpp
html/StepRange.cpp
html/ValidityState.cpp
html/canvas/CanvasGradient.cpp
@@ -1018,7 +1023,9 @@ SET(WebCore_SOURCES
inspector/InspectorFrontendClientLocal.cpp
inspector/InspectorFrontendHost.cpp
inspector/InspectorResource.cpp
+ inspector/InspectorValues.cpp
inspector/InspectorTimelineAgent.cpp
+ inspector/ScriptBreakpoint.cpp
inspector/TimelineRecordFactory.cpp
loader/Cache.cpp
@@ -1039,7 +1046,9 @@ SET(WebCore_SOURCES
loader/FTPDirectoryDocument.cpp
loader/FTPDirectoryParser.cpp
loader/FormState.cpp
+ loader/FormSubmission.cpp
loader/FrameLoader.cpp
+ loader/FrameLoaderStateMachine.cpp
loader/HistoryController.cpp
loader/ImageDocument.cpp
loader/ImageLoader.cpp
@@ -1057,6 +1066,7 @@ SET(WebCore_SOURCES
loader/ResourceLoadNotifier.cpp
loader/ResourceLoader.cpp
loader/SinkDocument.cpp
+ loader/SubframeLoader.cpp
loader/SubresourceLoader.cpp
loader/TextDocument.cpp
loader/TextResourceDecoder.cpp
@@ -1241,6 +1251,7 @@ SET(WebCore_SOURCES
platform/text/Base64.cpp
platform/text/BidiContext.cpp
+ platform/text/Hyphenation.cpp
platform/text/RegularExpression.cpp
platform/text/SegmentedString.cpp
platform/text/String.cpp
@@ -1297,6 +1308,7 @@ SET(WebCore_SOURCES
rendering/RenderIFrame.cpp
rendering/RenderImage.cpp
rendering/RenderImageGeneratedContent.cpp
+ rendering/RenderIndicator.cpp
rendering/RenderInline.cpp
rendering/RenderLayer.cpp
rendering/RenderLineBoxList.cpp
@@ -1405,6 +1417,13 @@ SET(WebCore_SOURCES
storage/StorageNamespaceImpl.cpp
storage/StorageSyncManager.cpp
+ websockets/ThreadableWebSocketChannel.cpp
+ websockets/WebSocket.cpp
+ websockets/WebSocketChannel.cpp
+ websockets/WebSocketHandshake.cpp
+ websockets/WebSocketHandshakeRequest.cpp
+ websockets/WorkerThreadableWebSocketChannel.cpp
+
workers/AbstractWorker.cpp
workers/DedicatedWorkerContext.cpp
workers/DedicatedWorkerThread.cpp
@@ -1500,7 +1519,9 @@ IF (ENABLE_SVG)
rendering/SVGRenderTreeAsText.cpp
rendering/SVGRootInlineBox.cpp
rendering/SVGShadowTreeElements.cpp
+ rendering/SVGTextChunkLayoutInfo.cpp
rendering/SVGTextLayoutUtilities.cpp
+ rendering/SVGTextQuery.cpp
rendering/style/SVGRenderStyle.cpp
rendering/style/SVGRenderStyleDefs.cpp
svg/ColorDistance.cpp
@@ -1672,9 +1693,9 @@ ENDFOREACH ()
LIST(APPEND WebCore_SOURCES ${JS_IDL_FILES})
-GENERATE_GPERF("c" ${WEBCORE_DIR}/html/HTMLEntityNames.gperf findEntity "-c")
-GENERATE_GPERF("c" ${WEBCORE_DIR}/platform/ColorData.gperf findColor "")
-GENERATE_GPERF("cpp" ${WEBCORE_DIR}/html/DocTypeStrings.gperf findDoctypeEntry "-F,PubIDInfo::eAlmostStandards,PubIDInfo::eAlmostStandards")
+GENERATE_GPERF(${WEBCORE_DIR}/html/HTMLEntityNames.gperf)
+GENERATE_GPERF(${WEBCORE_DIR}/platform/ColorData.gperf)
+GENERATE_GPERF(${WEBCORE_DIR}/html/DocTypeStrings.gperf)
GENERATE_TOKENIZER()
GENERATE_USER_AGENT_STYLES()
@@ -1689,9 +1710,10 @@ ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSValueKe
ADD_SOURCE_DERIVED_DEPENDENCIES(${DERIVED_SOURCES_DIR}/CSSGrammar.cpp CSSPropertyNames.h)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSPrimitiveValueMappings.h CSSValueKeywords.h)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLDocument.cpp DocTypeStrings.cpp)
-ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.c)
+ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/platform/graphics/Color.cpp ColorData.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSParser.cpp tokenizer.cpp)
-ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/PreloadScanner.cpp HTMLEntityNames.c)
+ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/LegacyPreloadScanner.cpp HTMLEntityNames.cpp)
+ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/html/HTMLEntityParser.cpp HTMLEntityNames.cpp)
ADD_SOURCE_DERIVED_DEPENDENCIES(${WEBCORE_DIR}/css/CSSStyleSelector.cpp UserAgentStyleSheetsData.cpp UserAgentStyleSheets.h)
GENERATE_DOM_NAMES_FACTORY(HTML ${WEBCORE_DIR}/html/HTMLTagNames.in ${WEBCORE_DIR}/html/HTMLAttributeNames.in "${HTML_FEATURES}")
diff --git a/WebCore/CMakeListsEfl.txt b/WebCore/CMakeListsEfl.txt
index 1cb6e44..da1f27a 100644
--- a/WebCore/CMakeListsEfl.txt
+++ b/WebCore/CMakeListsEfl.txt
@@ -51,12 +51,10 @@ LIST(APPEND WebCore_SOURCES
platform/efl/SystemTimeEfl.cpp
platform/efl/TemporaryLinkStubs.cpp
platform/efl/WidgetEfl.cpp
- platform/graphics/efl/FloatRectEfl.cpp
platform/graphics/efl/FontEfl.cpp
platform/graphics/efl/IconEfl.cpp
platform/graphics/efl/ImageEfl.cpp
platform/graphics/efl/IntPointEfl.cpp
- platform/graphics/efl/IntRectEfl.cpp
platform/posix/FileSystemPOSIX.cpp
platform/text/efl/TextBreakIteratorInternalICUEfl.cpp
)
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 7ba9026..8ab39c5 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,8613 @@
+2010-06-25 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Take a KURL parameter in Document's constructor.
+ This will remove the one case where Document::url()
+ and FrameLoader::url() are not equal, allowing us to
+ remove FrameLoader::url().
+
+ https://bugs.webkit.org/show_bug.cgi?id=41166
+
+ Refactor only, no new tests.
+
+ * dom/DOMImplementation.cpp:
+ (WebCore::DOMImplementation::createDocument): Take a KURL and pass it through to Document.
+ (WebCore::DOMImplementation::createHTMLDocument):
+ * dom/DOMImplementation.h:
+ * dom/Document.cpp:
+ (WebCore::Document::Document): Call setURL() if a frame or a non-empty KURL is specified.
+ (WebCore::Document::initSecurityContext): m_url is now initialized, so use it instead
+ of m_frame->loader()->url() for initializing the SecurityOrigin.
+ * dom/Document.h:
+ (WebCore::Document::create):
+ (WebCore::Document::createXHTML):
+ * html/HTMLDocument.cpp:
+ * html/HTMLDocument.h: Add KURL parameter to create() and constructor.
+ * html/HTMLViewSourceDocument.cpp:
+ * html/HTMLViewSourceDocument.h: Add KURL parameter to create() and constructor.
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::ensureSVGFontData):
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::createDocument): Take a KURL and pass it through to Document.
+ (WebCore::DocumentWriter::begin): Pass existing url parameter to constructors, and remove
+ redundant Document::setURL() call.
+ * loader/DocumentWriter.h:
+ * loader/FTPDirectoryDocument.cpp:
+ * loader/FTPDirectoryDocument.h: Add KURL parameter to create() and constructor.
+ * loader/ImageDocument.cpp:
+ * loader/ImageDocument.h: Add KURL parameter to create() and constructor.
+ * loader/MediaDocument.cpp:
+ * loader/MediaDocument.h: Add KURL parameter to create() and constructor.
+ * loader/PlaceholderDocument.h: Add KURL parameter to create() and constructor.
+ * loader/PluginDocument.cpp:
+ * loader/PluginDocument.h: Add KURL parameter to create() and constructor.
+ * loader/SinkDocument.cpp:
+ * loader/SinkDocument.h: Add KURL parameter to create() and constructor.
+ * loader/TextDocument.cpp:
+ * loader/TextDocument.h: Add KURL parameter to create() and constructor.
+ * svg/SVGDocument.cpp:
+ * svg/SVGDocument.h: Add KURL parameter to create() and constructor.
+ * xml/DOMParser.cpp:
+ (WebCore::DOMParser::parseFromString):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::responseXML):
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+
+2010-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61812.
+ http://trac.webkit.org/changeset/61812
+ https://bugs.webkit.org/show_bug.cgi?id=41216
+
+ breaks Chromium workers tests (Requested by mnaganov on
+ #webkit).
+
+ * storage/AbstractDatabase.cpp:
+ * storage/AbstractDatabase.h:
+ * storage/Database.cpp:
+ (WebCore::Database::databaseInfoTableName):
+ (WebCore::guidMutex):
+ (WebCore::guidToVersionMap):
+ (WebCore::updateGuidVersionMap):
+ (WebCore::guidToDatabaseMap):
+ (WebCore::databaseVersionKey):
+ (WebCore::DatabaseCreationCallbackTask::create):
+ (WebCore::DatabaseCreationCallbackTask::performTask):
+ (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
+ (WebCore::Database::openDatabase):
+ (WebCore::Database::Database):
+ (WebCore::Database::openAndVerifyVersion):
+ (WebCore::retrieveTextResultFromDatabase):
+ (WebCore::Database::getVersionFromDatabase):
+ (WebCore::setTextValueInDatabase):
+ (WebCore::Database::setVersionInDatabase):
+ (WebCore::Database::versionMatchesExpected):
+ (WebCore::Database::close):
+ (WebCore::Database::disableAuthorizer):
+ (WebCore::Database::enableAuthorizer):
+ (WebCore::Database::setAuthorizerReadOnly):
+ (WebCore::Database::lastActionChangedDatabase):
+ (WebCore::Database::lastActionWasInsert):
+ (WebCore::Database::resetDeletes):
+ (WebCore::Database::hadDeletes):
+ (WebCore::guidForOriginAndName):
+ (WebCore::Database::resetAuthorizer):
+ (WebCore::Database::performOpenAndVerify):
+ (WebCore::Database::performCreationCallback):
+ (WebCore::Database::version):
+ (WebCore::Database::setExpectedVersion):
+ (WebCore::Database::stringIdentifier):
+ (WebCore::Database::displayName):
+ (WebCore::Database::estimatedSize):
+ (WebCore::Database::fileName):
+ * storage/Database.h:
+ (WebCore::Database::scriptExecutionContext):
+ (WebCore::Database::opened):
+ (WebCore::Database::isNew):
+ (WebCore::Database::databaseDebugName):
+ * storage/DatabaseAuthorizer.cpp:
+ (WebCore::DatabaseAuthorizer::DatabaseAuthorizer):
+ (WebCore::DatabaseAuthorizer::denyBasedOnTableName):
+ * storage/DatabaseAuthorizer.h:
+ (WebCore::DatabaseAuthorizer::create):
+ * storage/DatabaseSync.cpp:
+ (WebCore::DatabaseSync::databaseInfoTableName):
+ (WebCore::DatabaseSync::openDatabaseSync):
+ (WebCore::DatabaseSync::DatabaseSync):
+ (WebCore::DatabaseSync::~DatabaseSync):
+ (WebCore::DatabaseSync::version):
+ (WebCore::DatabaseSync::changeVersion):
+ (WebCore::DatabaseSync::transaction):
+ (WebCore::DatabaseSync::scriptExecutionContext):
+ * storage/DatabaseSync.h:
+ (WebCore::DatabaseSync::databaseDebugName):
+ * storage/DatabaseTask.cpp:
+ (WebCore::DatabaseOpenTask::DatabaseOpenTask):
+ (WebCore::DatabaseOpenTask::doPerformTask):
+ * storage/DatabaseTask.h:
+ (WebCore::DatabaseOpenTask::create):
+
+2010-06-25 Lei Zheng <lzheng@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add a flag to the ResourceResponse for tracking if a request was fetched when
+ Alternate-protocol is available.
+ https://bugs.webkit.org/show_bug.cgi?id=41001
+
+ No new tests. (This is just a setter and getter.)
+
+ * platform/network/chromium/ResourceResponse.h:
+ (WebCore::ResourceResponse::ResourceResponse):
+ (WebCore::ResourceResponse::wasAlternateProtocolAvailable):
+ (WebCore::ResourceResponse::setWasAlternateProtocolAvailable):
+
+2010-06-25 Lyon Chen <liachen@rim.com>
+
+ Reviewed by Darin Adler.
+
+ InspectorCSSStore.cpp is not surrounded with ENABLE(INSPECTOR)
+ https://bugs.webkit.org/show_bug.cgi?id=41004
+
+ Surround InspectorCSSStore.cpp code with ENABLE(INSPECTOR) so it will not
+ break the build when INSPECTOR is disabled.
+
+ * inspector/InspectorCSSStore.cpp:
+
+2010-06-25 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] WebGL: missing file
+ https://bugs.webkit.org/show_bug.cgi?id=40998
+
+ Added a missing file to WebCore.pro
+
+ No new tests; build fix
+
+ * WebCore.pro:
+
+2010-06-25 Adam Roben <aroben@apple.com>
+
+ Windows build fix
+
+ * WebCore.vcproj/WebCore.vcproj: Added a missing </File> tag.
+
+2010-06-25 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ This patch changes the vertical alignment to rely upon baseline
+ alignment for all MathML rendering. This fixes a number of layout
+ issues and the implementation is much more clean.
+
+ Also, this patch adds a horizontal green line in the debug layout
+ so you can see the top padding of any RenderMathMLBlock instance.
+
+ Test: mathml/presentation/row-alignment.xhtml
+
+ * css/mathml.css:
+ * mathml/RenderMathMLBlock.cpp:
+ * mathml/RenderMathMLFraction.cpp:
+ * mathml/RenderMathMLFraction.h:
+ * mathml/RenderMathMLOperator.cpp:
+ * mathml/RenderMathMLOperator.h:
+ * mathml/RenderMathMLRoot.cpp:
+ * mathml/RenderMathMLRow.cpp:
+ * mathml/RenderMathMLRow.h:
+ * mathml/RenderMathMLSquareRoot.cpp:
+ * mathml/RenderMathMLSubSup.cpp:
+ * mathml/RenderMathMLUnderOver.cpp:
+
+2010-06-25 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Can't see source when hitting debugger statement in evaled source
+ https://bugs.webkit.org/show_bug.cgi?id=41058
+
+ Test: inspector/debugger-pause-in-eval-script.html
+
+ * bindings/js/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::sourceParsed): use lexical global object to figure out
+ where the script is compiled. Otherwise scripts typed in Web Inspector console will
+ be treated as ones evaluated in the context of Web Inspector and won't appear in the
+ scripts list.
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::didParseSource): cache script sources for eval's too.
+
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Use a descriptive string in FileChooser when multiple files can
+ be selected.
+ https://bugs.webkit.org/show_bug.cgi?id=40943
+
+ EFL port has no tests yet, so no new tests.
+
+ * platform/efl/FileChooserEfl.cpp:
+ (WebCore::FileChooser::basenameForWidth):
+
+2010-06-25 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ SVG Text Highlighting not yet supported (in Safari)
+ https://bugs.webkit.org/show_bug.cgi?id=41200
+
+ Add text match marker highlighting support for SVG text - searching for SVG text in Safari now paints the nice yellow highlighting rect, and the
+ white rectangles for all text matches. Behaves exactly like HTML text, but respecting SVGs per-character/per-chunk transformations,
+ allowing to highlight textPaths, tspans with absolute per-character positions etc..
+
+ Only manually testable, thus no new tests.
+
+ * rendering/InlineBox.h: Expose calculateBoundaries() in non-SVG builds as well, now used by InlineTextBox too.
+ * rendering/InlineTextBox.h: Add calculateBoundaries(), which will be used to refactor some code in RenderText, see below.
+ (WebCore::InlineTextBox::calculateBoundaries): Just return a IntRect(x(), y(), width(), height()) here.
+ (WebCore::RenderObject::isSVGInlineText):
+ * rendering/RenderSVGInlineText.h:
+ (WebCore::RenderSVGInlineText::isSVGInlineText): Return true for isSVGInlineText(), return false for isSVGText() (default in RenderObject.h)
+ * rendering/RenderSVGRoot.cpp:
+ (WebCore::RenderSVGRoot::paint): Only paint box decorations in PaintPhase(Child)BlockBackground, exit afterwards just like RenderBlock does.
+ Otherwise the white text match marker rectangle gets drawn over the yellow highlight that Safari draws.
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::paint): Accept a new painting phase: PaintPhaseSelection, used by Safari when drawing the yellow highlight rect.
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::absoluteQuads): Use calculateBoundaries() instead of IntRect(x(), y(), width(), height()). SVG provides different boundaries here.
+ (WebCore::RenderText::absoluteQuadsForRange): Ditto. This is the main change, leading to correct text highlight placement.
+ * rendering/SVGInlineFlowBox.cpp: Add assertion that painting is not disabled, for consistency. Change paint phase assertion to include PaintPhaseSelection.
+ (WebCore::SVGInlineFlowBox::paint):
+ * rendering/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::selectionRectForTextChunkPart): Refactored from selectionRect(), to share code between selectionRect/computeTextMatchMarkerRect.
+ (WebCore::SVGInlineTextBox::selectionRect): Use new helper function selectionRectForTextChunkPart().
+ (WebCore::SVGInlineTextBox::paint): Ditto. Call new computeTextMatchMarkerRect() function.
+ (WebCore::SVGInlineTextBox::computeTextMatchMarkerRect): Implemented similar to HTML, but respecting SVGs concept of text chunk parts.
+ (WebCore::SVGInlineTextBox::paintText): In PaintPhaseSelection, only paint selected text, not anything before/after the selection start/end.
+ (WebCore::SVGInlineTextBox::calculateBoundaries): Early exit, if m_chunkTransformation is identity.
+ * rendering/SVGInlineTextBox.h: Added "bool paintSelectedTextOnly" to paintText() and add new computeTextMatchMarkerRect(RenderStyle*) function.
+ * rendering/SVGRootInlineBox.cpp:
+ (WebCore::SVGRootInlineBox::paint): Change paint phase assertion to include PaintPhaseSelection.
+
+2010-06-25 John Gregg <johnnyg@google.com>
+
+ Reviewed by Darin Fisher.
+
+ Notification should expose ltr/rtl as TextDirection, not String
+ https://bugs.webkit.org/show_bug.cgi?id=40871
+
+ No new tests; existing test covers this, just renaming a method.
+
+ * notifications/Notification.h:
+ (WebCore::Notification::direction):
+
+2010-06-25 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61842.
+ http://trac.webkit.org/changeset/61842
+ https://bugs.webkit.org/show_bug.cgi?id=41208
+
+ It broke Windows build (Requested by Ossy_ on #webkit).
+
+ * ForwardingHeaders/wtf/win/OwnPtrWin.h: Removed.
+
+2010-06-25 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Darin Adler.
+
+ Remove unneeded whitespace from svgtags.in.
+ https://bugs.webkit.org/show_bug.cgi?id=40912
+
+ make_names.pl throws an error at non-empty lines
+ when using cl.exe as preprocessor.
+
+ * svg/svgtags.in:
+
+2010-06-25 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Rob Buis.
+
+ Split up isSVGText() in isSVGText() / isSVGInlineText()
+ https://bugs.webkit.org/show_bug.cgi?id=41204
+
+ Introduce isSVGInlineText(), to provide a safe mechanism to differentiate between RenderSVGText / RenderSVGInlineText.
+ No change in functionality, thus no new tests.
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::shouldPreserveNewline): s/isSVGText/isSVGInlineText/
+ (WebCore::RenderBlock::findNextLineBreak): Ditto.
+ * rendering/RenderObject.h:
+ (WebCore::RenderObject::isSVGInlineText): Return false, by default.
+ * rendering/RenderSVGInlineText.h:
+ (WebCore::RenderSVGInlineText::isSVGInlineText): Return true here, don't return true anymore for isSVGText().
+ * rendering/RenderText.cpp:
+ (WebCore::RenderText::setTextInternal): s/isSVGText/isSVGInlineText/
+ * rendering/RenderTreeAsText.cpp: Remove hack, now that we can properly differentiate between RenderSVGText / RenderSVGInlineText.
+ (WebCore::write):
+
+2010-06-25 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Adam Barth.
+
+ Change OwnPtrCommon to include platform-specific headers
+ https://bugs.webkit.org/show_bug.cgi?id=40279
+
+ Adding new type to OwnPtrCommon needlessly causes all ports to do full rebuilds.
+ Change OwnPtrCommon to include platform-specific headers to avoid all ports rebuilds.
+
+ * ForwardingHeaders/wtf/win: Added.
+ * ForwardingHeaders/wtf/win/OwnPtrWin.h: Added.
+
+2010-06-25 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Adam Barth.
+
+ Implement TextCodecs for WinCE port.
+ https://bugs.webkit.org/show_bug.cgi?id=32169
+ Originally written by Yong Li <yong.li@torchmobile.com>
+
+ * platform/graphics/FontCache.h:
+ * platform/graphics/wince/FontCacheWince.cpp:
+ (WebCore::FontCache::getMultiLanguageInterface):
+ * platform/text/wince/TextCodecWinCE.cpp: Added.
+ (WebCore::codePageCharsets):
+ (WebCore::knownCharsets):
+ (WebCore::supportedCharsets):
+ (WebCore::languageManager):
+ (WebCore::addCharset):
+ (WebCore::LanguageManager::LanguageManager):
+ (WebCore::getCodePage):
+ (WebCore::newTextCodecWinCE):
+ (WebCore::TextCodecWinCE::TextCodecWinCE):
+ (WebCore::TextCodecWinCE::~TextCodecWinCE):
+ (WebCore::TextCodecWinCE::registerBaseEncodingNames):
+ (WebCore::TextCodecWinCE::registerBaseCodecs):
+ (WebCore::TextCodecWinCE::registerExtendedEncodingNames):
+ (WebCore::TextCodecWinCE::registerExtendedCodecs):
+ (WebCore::getCodePageFlags):
+ (WebCore::findFirstNonAsciiCharacter):
+ (WebCore::decode):
+ (WebCore::TextCodecWinCE::decode):
+ (WebCore::TextCodecWinCE::encode):
+ (WebCore::TextCodecWinCE::enumerateSupportedEncodings):
+ * platform/text/wince/TextCodecWinCE.h: Added.
+
+2010-06-24 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Dirk Schulze.
+
+ Bug 40880 - SVG properties fill and stroke do not accept system colors
+ https://bugs.webkit.org/show_bug.cgi?id=40880
+
+ Handle css system colors in fill and stroke properties.
+
+ Test: svg/css/rect-system-color.xhtml
+
+ * css/CSSParser.cpp: Remove comment and unneeded if condition
+ (WebCore::CSSParser::parseValue):
+ * css/SVGCSSParser.cpp: Allow css system colors
+ (WebCore::CSSParser::parseSVGValue):
+
+2010-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Make DocumentParser API private on subclasses to catch misuse bugs
+ https://bugs.webkit.org/show_bug.cgi?id=41186
+
+ This already found one bug:
+ https://bugs.webkit.org/show_bug.cgi?id=41187
+
+ Added a new HTMLDocumentParaser::parseDocumentFragment so that
+ DocumentFragment.cpp does not need to use private methods.
+
+ * dom/DocumentFragment.cpp:
+ (WebCore::DocumentFragment::parseHTML):
+ * dom/XMLDocumentParser.h:
+ (WebCore::XMLDocumentParser::setIsXHTMLDocument):
+ (WebCore::XMLDocumentParser::isXHTMLDocument):
+ (WebCore::XMLDocumentParser::setIsXHTMLMPDocument):
+ (WebCore::XMLDocumentParser::isXHTMLMPDocument):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::parseDocumentFragment):
+ * html/HTMLDocumentParser.h:
+ * html/LegacyHTMLDocumentParser.cpp:
+ (WebCore::LegacyHTMLDocumentParser::parseDocumentFragment):
+ * html/LegacyHTMLDocumentParser.h:
+ (WebCore::LegacyHTMLDocumentParser::forceSynchronous):
+ (WebCore::LegacyHTMLDocumentParser::processingContentWrittenByScript):
+ * html/LegacyHTMLTreeBuilder.cpp:
+ (WebCore::LegacyHTMLTreeBuilder::reportErrorToConsole):
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::replaceDocument):
+ * loader/TextDocument.cpp:
+
+2010-05-28 Philippe Normand <pnormand@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [GStreamer] multiple video sink support
+ https://bugs.webkit.org/show_bug.cgi?id=39472
+
+ Playbin2 video-sink is now a bin containing a tee element capable
+ of dispatching the buffers to multiple video sinks. By default
+ only our webkit video sink is used. This will allow
+ GStreamerGWorld to add support for autovideosink in the future.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
+ (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
+ (WebCore::MediaPlayerPrivateGStreamer::naturalSize):
+ (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out AfterHeadMode for tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=41191
+
+ This mode is fairly similar to the others. I needed to change some of
+ the types around w.r.t. Nodes/Elements.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::processToken):
+ (WebCore::HTMLTreeBuilder::insertElement):
+ * html/HTMLTreeBuilder.h:
+ (WebCore::HTMLTreeBuilder::ElementStack::push):
+ (WebCore::HTMLTreeBuilder::ElementStack::remove):
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out InHeadNoscriptMode for tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=41189
+
+ Lots of notImplemented() calls in this state. I need to figure how to
+ delegate handling of a token from one state to another.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processToken):
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out InHeadMode for tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=41184
+
+ This state is relatively straightforward. We introduce the stack of
+ open elements to track that notion in the spec. The old tree builder
+ has a nice data structure for that, which we'll probably steal, but I'd
+ like to see what the full API is first.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processToken):
+ (WebCore::HTMLTreeBuilder::insertCharacter):
+ (WebCore::HTMLTreeBuilder::insertGenericRCDATAElement):
+ (WebCore::HTMLTreeBuilder::insertGenericRawTextElement):
+ (WebCore::HTMLTreeBuilder::insertScriptElement):
+ * html/HTMLTreeBuilder.h:
+ (WebCore::HTMLTreeBuilder::ElementStack::pop):
+ (WebCore::HTMLTreeBuilder::ElementStack::top):
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out BeforeHeadMode tree builder state
+ https://bugs.webkit.org/show_bug.cgi?id=41183
+
+ This makes procesToken recursive, which might not be the best idea.
+ Also, we can now make fake AtomicHTMLTokens for use by the algorithm.
+
+ * html/HTMLToken.h:
+ (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processToken):
+ (WebCore::HTMLTreeBuilder::insertElement):
+ * html/HTMLTreeBuilder.h:
+
+2010-06-22 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by David Hyatt.
+
+ Add a NodeList-derivated wrapper class for a ListHashSet.
+ https://bugs.webkit.org/show_bug.cgi?id=41081
+
+ StaticHashSetList will work as a wrapper to ListHashSet objects that are
+ aimed to be exposed to the DOM.
+
+ As a use case, the rect based HitTest (bug 40197) will store the retrieved nodes
+ in a ListHashSet. It is going to be exposed to the DOM through are nodesFromRect
+ of Document returning a NodeList (i.e. StatisHashSetList) wrapping a ListHashSet.
+
+ No new tests.
+
+2010-06-24 Cris Neckar <cdn@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Out of bounds write in WebCore::PNGImageDecoder::rowAvailable
+ https://bugs.webkit.org/show_bug.cgi?id=40798
+
+ Catches error in row callback for libPNG when extra rows are returned.
+
+ Test: fast/images/png-extra-row-crash.html
+
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageDecoder::rowAvailable):
+
+2010-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Clean up and document DocumentWriter::replaceDocument code path
+ https://bugs.webkit.org/show_bug.cgi?id=41182
+
+ No functional changes, thus no tests.
+
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::replaceDocument):
+ - Remove comment which could be misleading.
+
+2010-06-23 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Implementing DatabaseSync::openDatabaseSync().
+ https://bugs.webkit.org/show_bug.cgi?id=40607
+
+ Moved some common code from Database to AbstractDatabase. Made
+ performOpenAndVerify() virtual, since DatabaseSync doesn't need to
+ interact with DatabaseThread. Removed the m_creationCallback
+ field, since it's only needed in the openDatabase{Sync} methods.
+
+ * storage/AbstractDatabase.cpp:
+ (WebCore::retrieveTextResultFromDatabase):
+ (WebCore::setTextValueInDatabase):
+ (WebCore::guidMutex):
+ (WebCore::guidToVersionMap):
+ (WebCore::updateGuidVersionMap):
+ (WebCore::guidToDatabaseMap):
+ (WebCore::guidForOriginAndName):
+ (WebCore::AbstractDatabase::databaseInfoTableName):
+ (WebCore::AbstractDatabase::AbstractDatabase):
+ (WebCore::AbstractDatabase::closeDatabase):
+ (WebCore::AbstractDatabase::version):
+ (WebCore::AbstractDatabase::performOpenAndVerify):
+ (WebCore::AbstractDatabase::scriptExecutionContext):
+ (WebCore::AbstractDatabase::securityOrigin):
+ (WebCore::AbstractDatabase::stringIdentifier):
+ (WebCore::AbstractDatabase::displayName):
+ (WebCore::AbstractDatabase::estimatedSize):
+ (WebCore::AbstractDatabase::fileName):
+ (WebCore::AbstractDatabase::databaseVersionKey):
+ (WebCore::AbstractDatabase::getVersionFromDatabase):
+ (WebCore::AbstractDatabase::setVersionInDatabase):
+ (WebCore::AbstractDatabase::versionMatchesExpected):
+ (WebCore::AbstractDatabase::setExpectedVersion):
+ (WebCore::AbstractDatabase::disableAuthorizer):
+ (WebCore::AbstractDatabase::enableAuthorizer):
+ (WebCore::AbstractDatabase::setAuthorizerReadOnly):
+ (WebCore::AbstractDatabase::lastActionChangedDatabase):
+ (WebCore::AbstractDatabase::lastActionWasInsert):
+ (WebCore::AbstractDatabase::resetDeletes):
+ (WebCore::AbstractDatabase::hadDeletes):
+ (WebCore::AbstractDatabase::resetAuthorizer):
+ * storage/AbstractDatabase.h:
+ (WebCore::AbstractDatabase::opened):
+ (WebCore::AbstractDatabase::isNew):
+ (WebCore::AbstractDatabase::databaseDebugName):
+ * storage/Database.cpp:
+ (WebCore::DatabaseCreationCallbackTask::create):
+ (WebCore::DatabaseCreationCallbackTask::performTask):
+ (WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
+ (WebCore::Database::openDatabase):
+ (WebCore::Database::Database):
+ (WebCore::Database::version):
+ (WebCore::Database::openAndVerifyVersion):
+ (WebCore::Database::close):
+ (WebCore::Database::stop):
+ (WebCore::Database::performOpenAndVerify):
+ * storage/Database.h:
+ (WebCore::Database::sqliteDatabase):
+ * storage/DatabaseAuthorizer.cpp:
+ (WebCore::DatabaseAuthorizer::create):
+ (WebCore::DatabaseAuthorizer::DatabaseAuthorizer):
+ (WebCore::DatabaseAuthorizer::denyBasedOnTableName):
+ * storage/DatabaseAuthorizer.h:
+ * storage/DatabaseSync.cpp:
+ (WebCore::DatabaseSync::openDatabaseSync):
+ (WebCore::DatabaseSync::DatabaseSync):
+ (WebCore::DatabaseSync::changeVersion):
+ (WebCore::DatabaseSync::transaction):
+ (WebCore::DatabaseSync::markAsDeletedAndClose):
+ (WebCore::CloseSyncDatabaseOnContextThreadTask::create):
+ (WebCore::CloseSyncDatabaseOnContextThreadTask::performTask):
+ (WebCore::CloseSyncDatabaseOnContextThreadTask::CloseSyncDatabaseOnContextThreadTask):
+ (WebCore::DatabaseSync::closeImmediately):
+ * storage/DatabaseSync.h:
+ * storage/DatabaseTask.cpp:
+ (WebCore::DatabaseOpenTask::DatabaseOpenTask):
+ (WebCore::DatabaseOpenTask::doPerformTask):
+ * storage/DatabaseTask.h:
+ (WebCore::DatabaseOpenTask::create):
+
+2010-06-24 Steve Falkenburg <sfalken@apple.com>
+
+ Windows build fix.
+
+ * platform/network/cf/AuthenticationCF.h:
+
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
+
+ Unreviewed. Build fix.
+
+ Fix the build after r61798.
+
+ * platform/gtk/PasteboardHelper.cpp:
+ (WebCore::PasteboardHelper::getClipboardContents):
+
+2010-06-24 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41178
+ Timed refresh in subframes isn't stopped when going into b/f cache
+
+ Test: fast/history/timed-refresh-in-cached-frame.html
+
+ * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): Top frame's stopLoading()
+ won't help cached subframes; stop loading from here.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::stopLoading): Don't stop loading in child frames. This didn't work
+ for cached frames due to frame tree having been already desonstructed, and it's not necessary
+ in non-cached case because stopLoading() will be called for subframes via
+ FrameLoader::detachFromParent() and closeURL().
+ (WebCore::FrameLoader::pageHidden): This was a second code path that dispatched pagehide
+ event - it's no longer needed, because everything goes through FrameLoader::stopLoading().
+ (WebCore::FrameLoader::commitProvisionalLoad): Don't call pageHidden(), the code for adding
+ frame to b/f cache will do everything.
+
+ * loader/FrameLoader.h: Removed pageHidden().
+
+2010-06-24 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fix the build. I am a bad man.
+
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::replaceDocument):
+
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Build fix for building against GTK+ 3.x.
+
+ No new tests as functionality has not changed.
+
+ * platform/gtk/GtkVersioning.h:
+ * platform/gtk/PasteboardHelper.cpp:
+ (WebCore::PasteboardHelper::getClipboardContents):
+ (WebCore::PasteboardHelper::fillSelectionData):
+
+2010-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Clean up and document DocumentWriter::replaceDocument code path
+ https://bugs.webkit.org/show_bug.cgi?id=41182
+
+ No functional change, thus no test.
+
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::replaceDocument):
+ * loader/DocumentWriter.h:
+
+2010-06-24 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Full-screened content doesn't keep the display on: Safari not grabbing a power assertion?
+ https://bugs.webkit.org/show_bug.cgi?id=40939
+ rdar://problem/7996172
+
+ Export -[MediaElement playbackRate];
+
+ * WebCore.Video.exp:
+
+2010-06-21 Evan Martin <evan@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [chromium] overlapping characters in complex text
+ https://bugs.webkit.org/show_bug.cgi?id=40966
+
+ We need to clear all the buffers we hand to Harfbuzz before we use them.
+ While I'm here, refactor the code slightly to make its behavior more
+ clear and correct (previously, we would repeatedly double our buffer
+ size when we could have just sized it correctly on the second try).
+
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::TextRunWalker::TextRunWalker):
+ (WebCore::TextRunWalker::nextScriptRun):
+ (WebCore::TextRunWalker::createGlyphArrays):
+ (WebCore::TextRunWalker::shapeGlyphs):
+
+2010-06-24 Adele Peterson <adele@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Updated fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events
+ https://bugs.webkit.org/show_bug.cgi?id=41085
+
+ Covered by existing tests.
+
+ * editing/EditorCommand.cpp:
+ (WebCore::executePasteAsPlainText): Added.
+ (WebCore::createCommandMap): Added pasteAsPlainText command.
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out BeforeHTMLMode state
+ https://bugs.webkit.org/show_bug.cgi?id=41133
+
+ In this patch, we switch the TreeBuidler over to using AtomicHTMLTokens
+ and sketch out another state. These states don't actually do anything
+ yet, I'm still just getting the structure of the spec into the code so
+ we can implement the details incrementally.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::constructTreeFromToken):
+ (WebCore::HTMLTreeBuilder::processToken):
+ (WebCore::HTMLTreeBuilder::insertDoctype):
+ (WebCore::HTMLTreeBuilder::insertComment):
+ * html/HTMLTreeBuilder.h:
+ (WebCore::HTMLTreeBuilder::parseError):
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add AtomicHTMLToken
+ https://bugs.webkit.org/show_bug.cgi?id=41131
+
+ We need an atomized version of the token for use in the tree builder.
+ Eventually, we should make the existing HTMLToken an internal detail of
+ the HTMLTokenizer. This new AtomicHTMLToken should be also be more
+ easily cached between the preload scanner and the tree builder.
+
+ * html/HTMLToken.h:
+ (WebCore::AtomicHTMLToken::AtomicHTMLToken):
+ (WebCore::AtomicHTMLToken::type):
+ (WebCore::AtomicHTMLToken::name):
+ (WebCore::AtomicHTMLToken::selfClosing):
+ (WebCore::AtomicHTMLToken::attributes):
+ (WebCore::AtomicHTMLToken::characters):
+ (WebCore::AtomicHTMLToken::comment):
+ (WebCore::AtomicHTMLToken::publicIdentifier):
+ (WebCore::AtomicHTMLToken::systemIdentifier):
+ (WebCore::AtomicHTMLToken::forceQuirks):
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::convertToOldStyle):
+ (WebCore::HTMLTreeBuilder::passTokenToLegacyParser):
+
+2010-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add RawDataDocumentParser to get rid of a bunch of copy/paste code in DocumentParser subclasses
+ https://bugs.webkit.org/show_bug.cgi?id=41136
+
+ I think this is likely far from the final design,
+ however this is almost entirely minus lines which is a
+ good thing.
+
+ The original authors of these DocumentParser subclasses
+ seem to have just copied the files whole, as they all
+ had the same includes, many of which were unnecessary for
+ some of the files.
+
+ I think eventually the FrameLoader will call a virtual
+ DocumentParser::appendData which will in turn decode
+ and call another write/appendData call. In the case
+ of these RawDataDocumentParsers, they will just override
+ the low-level appendData call instead of needing
+ DocumentWriter to have a special if based on
+ DocumentParser::wantsRawData.
+
+ No functional change, thus no tests.
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::writeRawData):
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageDocumentParser::ImageDocumentParser):
+ (WebCore::ImageDocumentParser::finish):
+ * loader/MediaDocument.cpp:
+ (WebCore::MediaDocumentParser::MediaDocumentParser):
+ (WebCore::MediaDocumentParser::writeRawData):
+ * loader/PluginDocument.cpp:
+ (WebCore::PluginDocumentParser::PluginDocumentParser):
+ * loader/SinkDocument.cpp:
+ (WebCore::SinkDocument::createParser):
+
+2010-06-23 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION (r61619): Memory corruption in open-source ICO decoder
+ https://bugs.webkit.org/show_bug.cgi?id=41107
+
+ * platform/image-decoders/bmp/BMPImageReader.cpp:
+ (WebCore::BMPImageReader::processInfoHeader): Fix memory corruption.
+ * platform/image-decoders/ico/ICOImageDecoder.cpp:
+ (WebCore::ICOImageDecoder::processDirectoryEntries): Handle sizing failure correctly (though failure should be impossible).
+
+2010-06-24 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61783.
+ http://trac.webkit.org/changeset/61783
+ https://bugs.webkit.org/show_bug.cgi?id=41179
+
+ Caused a couple of test failures (Requested by japhet on
+ #webkit).
+
+ * dom/DOMImplementation.cpp:
+ (WebCore::DOMImplementation::createDocument):
+ (WebCore::DOMImplementation::createHTMLDocument):
+ * dom/DOMImplementation.h:
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::initSecurityContext):
+ * dom/Document.h:
+ (WebCore::Document::create):
+ (WebCore::Document::createXHTML):
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::HTMLDocument):
+ * html/HTMLDocument.h:
+ (WebCore::HTMLDocument::create):
+ * html/HTMLViewSourceDocument.cpp:
+ (WebCore::HTMLViewSourceDocument::HTMLViewSourceDocument):
+ * html/HTMLViewSourceDocument.h:
+ (WebCore::HTMLViewSourceDocument::create):
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::ensureSVGFontData):
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::createDocument):
+ (WebCore::DocumentWriter::begin):
+ * loader/DocumentWriter.h:
+ * loader/FTPDirectoryDocument.cpp:
+ (WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
+ * loader/FTPDirectoryDocument.h:
+ (WebCore::FTPDirectoryDocument::create):
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageDocument::ImageDocument):
+ * loader/ImageDocument.h:
+ (WebCore::ImageDocument::create):
+ * loader/MediaDocument.cpp:
+ (WebCore::MediaDocument::MediaDocument):
+ * loader/MediaDocument.h:
+ (WebCore::MediaDocument::create):
+ * loader/PlaceholderDocument.h:
+ (WebCore::PlaceholderDocument::create):
+ (WebCore::PlaceholderDocument::PlaceholderDocument):
+ * loader/PluginDocument.cpp:
+ (WebCore::PluginDocument::PluginDocument):
+ * loader/PluginDocument.h:
+ (WebCore::PluginDocument::create):
+ * loader/SinkDocument.cpp:
+ (WebCore::SinkDocument::SinkDocument):
+ * loader/SinkDocument.h:
+ (WebCore::SinkDocument::create):
+ * loader/TextDocument.cpp:
+ (WebCore::TextDocument::TextDocument):
+ * loader/TextDocument.h:
+ (WebCore::TextDocument::create):
+ * svg/SVGDocument.cpp:
+ (WebCore::SVGDocument::SVGDocument):
+ * svg/SVGDocument.h:
+ (WebCore::SVGDocument::create):
+ * xml/DOMParser.cpp:
+ (WebCore::DOMParser::parseFromString):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::responseXML):
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Small code cleanup in RenderThemeGtk
+ https://bugs.webkit.org/show_bug.cgi?id=40989
+
+ Reduce the amount of duplicated code slightly and prepare this section for
+ future improvements, such as sharing the clipping rectangle calculation with
+ the slow path.
+
+ No new tests as functionality has not changed.
+
+ * platform/gtk/RenderThemeGtk.cpp:
+ (WebCore::paintMozillaGtkWidget): Small code cleanup.
+
+2010-06-24 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Take a KURL parameter in Document's constructor.
+ This will remove the one case where Document::url()
+ and FrameLoader::url() are not equal, allowing us to
+ remove FrameLoader::url().
+
+ https://bugs.webkit.org/show_bug.cgi?id=41166
+
+ Refactor only, no new tests.
+
+ * dom/DOMImplementation.cpp:
+ (WebCore::DOMImplementation::createDocument): Take a KURL and pass it through to Document.
+ (WebCore::DOMImplementation::createHTMLDocument):
+ * dom/DOMImplementation.h:
+ * dom/Document.cpp:
+ (WebCore::Document::Document): Call setURL() for non-empty KURL input parameters.
+ (WebCore::Document::initSecurityContext): m_url is now initialized, so use it instead
+ of m_frame->loader()->url() for initializing the SecurityOrigin.
+ * dom/Document.h:
+ (WebCore::Document::create):
+ (WebCore::Document::createXHTML):
+ * html/HTMLDocument.cpp:
+ * html/HTMLDocument.h: Add KURL parameter to create() and constructor.
+ * html/HTMLViewSourceDocument.cpp:
+ * html/HTMLViewSourceDocument.h: Add KURL parameter to create() and constructor.
+ * loader/CachedFont.cpp:
+ (WebCore::CachedFont::ensureSVGFontData):
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::createDocument): Take a KURL and pass it through to Document.
+ (WebCore::DocumentWriter::begin): Pass existing url parameter to constructors, and remove
+ redundant Document::setURL() call.
+ * loader/DocumentWriter.h:
+ * loader/FTPDirectoryDocument.cpp:
+ * loader/FTPDirectoryDocument.h: Add KURL parameter to create() and constructor.
+ * loader/ImageDocument.cpp:
+ * loader/ImageDocument.h: Add KURL parameter to create() and constructor.
+ * loader/MediaDocument.cpp:
+ * loader/MediaDocument.h: Add KURL parameter to create() and constructor.
+ * loader/PlaceholderDocument.h: Add KURL parameter to create() and constructor.
+ * loader/PluginDocument.cpp:
+ * loader/PluginDocument.h: Add KURL parameter to create() and constructor.
+ * loader/SinkDocument.cpp:
+ * loader/SinkDocument.h: Add KURL parameter to create() and constructor.
+ * loader/TextDocument.cpp:
+ * loader/TextDocument.h: Add KURL parameter to create() and constructor.
+ * svg/SVGDocument.cpp:
+ * svg/SVGDocument.h: Add KURL parameter to create() and constructor.
+ * xml/DOMParser.cpp:
+ (WebCore::DOMParser::parseFromString):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::responseXML):
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+
+2010-06-24 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ <rdar://problem/8044645> and https://bugs.webkit.org/show_bug.cgi?id=41082
+
+ Webarchives will null main resource cause a repro crash.
+
+ Test: webarchive/loading/mainresource-null-mimetype-crash.html
+
+ * loader/archive/cf/LegacyWebArchive.cpp:
+ (WebCore::LegacyWebArchive::createResource): Fail to create the archive resource if the main resource's
+ mime type is null.
+
+2010-06-24 Damian Kaleta <dkaleta@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Provide a way to obtain the rendered rectangle for box elements.
+
+ * WebCore.base.exp: Export the symbol so we can see it in WebKit.
+ * dom/Node.cpp:
+ (WebCore::Node::renderRect): Added new ethod that will return a rendered rectangle for box elements.
+ * dom/Node.h: Ditto.
+
+2010-06-24 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Create specialized classes for Transform,
+ Image and WebGL layers to replace the rather monolithic LayerChromium class.
+ Layers can now own the GL texture they use for backing store and a different
+ shading program can be used by the compositor for each layer type. WebGL layers
+ are not yet hooked up to GraphicsContext3D.
+ https://bugs.webkit.org/show_bug.cgi?id=41106
+
+ * WebCore.gypi:
+ * platform/graphics/chromium/GraphicsLayerChromium.cpp:
+ (WebCore::GraphicsLayerChromium::GraphicsLayerChromium):
+ (WebCore::GraphicsLayerChromium::setContentsToImage):
+ (WebCore::GraphicsLayerChromium::updateLayerPreserves3D):
+ * platform/graphics/chromium/GraphicsLayerChromium.h:
+ (WebCore::GraphicsLayerChromium::):
+ * platform/graphics/chromium/ImageLayerChromium.cpp: Added.
+ (WebCore::ImageLayerChromium::create):
+ (WebCore::ImageLayerChromium::ImageLayerChromium):
+ (WebCore::ImageLayerChromium::setContents):
+ (WebCore::ImageLayerChromium::updateTextureContents):
+ * platform/graphics/chromium/ImageLayerChromium.h: Added.
+ (WebCore::ImageLayerChromium::drawsContent):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::create):
+ (WebCore::LayerChromium::LayerChromium):
+ (WebCore::LayerChromium::updateTextureContents):
+ (WebCore::LayerChromium::updateTextureRect):
+ * platform/graphics/chromium/LayerChromium.h:
+ (WebCore::LayerChromium::drawsContent):
+ (WebCore::LayerChromium::ownsTexture):
+ (WebCore::LayerChromium::textureId):
+ (WebCore::LayerChromium::setShaderProgramId):
+ (WebCore::LayerChromium::shaderProgramId):
+ * platform/graphics/chromium/LayerRendererChromium.cpp:
+ (WebCore::LayerRendererChromium::createLayerShader):
+ (WebCore::ShaderProgram::ShaderProgram):
+ (WebCore::LayerRendererChromium::LayerRendererChromium):
+ (WebCore::LayerRendererChromium::~LayerRendererChromium):
+ (WebCore::LayerRendererChromium::useShaderProgram):
+ (WebCore::LayerRendererChromium::drawTexturedQuad):
+ (WebCore::LayerRendererChromium::drawLayers):
+ (WebCore::LayerRendererChromium::drawDebugBorder):
+ (WebCore::LayerRendererChromium::updateLayersRecursive):
+ (WebCore::LayerRendererChromium::drawLayer):
+ (WebCore::LayerRendererChromium::bindCommonAttribLocations):
+ (WebCore::LayerRendererChromium::initializeSharedGLObjects):
+ * platform/graphics/chromium/LayerRendererChromium.h:
+ (WebCore::LayerRendererChromium::):
+ * platform/graphics/chromium/TransformLayerChromium.cpp: Added.
+ (WebCore::TransformLayerChromium::create):
+ (WebCore::TransformLayerChromium::TransformLayerChromium):
+ * platform/graphics/chromium/TransformLayerChromium.h: Added.
+ (WebCore::TransformLayerChromium::drawsContent):
+ * platform/graphics/chromium/WebGLLayerChromium.cpp: Added.
+ (WebCore::WebGLLayerChromium::WebGLLayerChromium):
+ (WebCore::WebGLLayerChromium::textureId):
+ (WebCore::WebGLLayerChromium::updateTextureContents):
+ (WebCore::WebGLLayerChromium::setContext):
+ * platform/graphics/chromium/WebGLLayerChromium.h: Added.
+ (WebCore::WebGLLayerChromium::drawsContent):
+ (WebCore::WebGLLayerChromium::ownsTexture):
+ (WebCore::WebGLLayerChromium::shaderProgramId):
+ (WebCore::WebGLLayerChromium::setShaderProgramId):
+
+2010-06-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Inspector cleanup + better DevTools alignment with Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41094
+
+ - Removed a bunch of unused methods from all over the place
+ - Added client callbacks for states surviving navigation
+ - Implemented more user-friendly stub for InspectorFrontendHost.platform
+
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::resourceTrackingWasEnabled):
+ (WebCore::InspectorClient::resourceTrackingWasDisabled):
+ (WebCore::InspectorClient::timelineProfilerWasStarted):
+ (WebCore::InspectorClient::timelineProfilerWasStopped):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::enableResourceTracking):
+ (WebCore::InspectorController::disableResourceTracking):
+ (WebCore::InspectorController::ensureSettingsLoaded):
+ (WebCore::InspectorController::startTimelineProfiler):
+ (WebCore::InspectorController::stopTimelineProfiler):
+ * inspector/InspectorFrontend.cpp:
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/InspectorBackendStub.js:
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.platform):
+
+2010-06-23 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41099
+ Assertion failure: !m_suspended when XMLHttpRequest fails
+
+ This was a general problem with load failure timer not being deferred.
+
+ Test: manual-tests/xhr-failure-behind-alert.html
+
+ * manual-tests/xhr-failure-behind-alert.html: Added.
+
+ * platform/network/ResourceHandle.cpp:
+ (WebCore::ResourceHandle::fireFailure): Added an empty case for NoFailure. Reset
+ m_scheduledFailureType to NoFailure when firing.
+ (WebCore::ResourceHandle::setDefersLoading): Stop failure timer when deferring, restart when
+ un-deferring loads.
+
+ * platform/network/ResourceHandle.h: Renamed m_failureType to m_scheduledFailureType to
+ make it clear that it is only set when a timer is scheduled.
+
+ * platform/network/ResourceHandleInternal.h:
+ (WebCore::ResourceHandleInternal::ResourceHandleInternal): Initialize m_scheduledFailureType
+ to NoFailure, so that we can look at it when un-deferring loads.
+
+ * platform/network/android/ResourceHandleAndroid.cpp:
+ (WebCore::ResourceHandle::platformSetDefersLoading):
+ * platform/network/cf/ResourceHandleCFNet.cpp:
+ (WebCore::ResourceHandle::platformSetDefersLoading):
+ * platform/network/curl/ResourceHandleCurl.cpp:
+ (WebCore::ResourceHandle::platformSetDefersLoading):
+ * platform/network/mac/ResourceHandleMac.mm:
+ (WebCore::ResourceHandle::platformSetDefersLoading):
+ * platform/network/qt/ResourceHandleQt.cpp:
+ (WebCore::ResourceHandle::platformSetDefersLoading):
+ * platform/network/soup/ResourceHandleSoup.cpp:
+ Platform specific parts of setDefersLoading() are now in a separate function.
+
+2010-06-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: revert 61766.
+
+ * inspector/InspectorClient.h:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::enableResourceTracking):
+ (WebCore::InspectorController::disableResourceTracking):
+ (WebCore::InspectorController::ensureSettingsLoaded):
+ (WebCore::InspectorController::startTimelineProfiler):
+ (WebCore::InspectorController::stopTimelineProfiler):
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::setAttachedWindow):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/InspectorBackendStub.js:
+ (.WebInspector.InspectorBackendStub.prototype.setAttachedWindowHeight):
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.platform):
+
+2010-06-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Inspector cleanup + better DevTools alignment with Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41094
+
+ - Removed a bunch of unused methods from all over the place
+ - Added client callbacks for states surviving navigation
+ - Implemented more user-friendly stub for InspectorFrontendHost.platform
+
+ * inspector/InspectorClient.h:
+ (WebCore::InspectorClient::resourceTrackingWasEnabled):
+ (WebCore::InspectorClient::resourceTrackingWasDisabled):
+ (WebCore::InspectorClient::timelineProfilerWasStarted):
+ (WebCore::InspectorClient::timelineProfilerWasStopped):
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::enableResourceTracking):
+ (WebCore::InspectorController::disableResourceTracking):
+ (WebCore::InspectorController::ensureSettingsLoaded):
+ (WebCore::InspectorController::startTimelineProfiler):
+ (WebCore::InspectorController::stopTimelineProfiler):
+ * inspector/InspectorFrontend.cpp:
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/InspectorBackendStub.js:
+ * inspector/front-end/InspectorFrontendHostStub.js:
+ (.WebInspector.InspectorFrontendHostStub.prototype.platform):
+
+2010-06-24 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Inspector & SVG Text have problems, kids of RenderSVGText are not properly placed.
+ https://bugs.webkit.org/show_bug.cgi?id=41143
+
+ Simplify code path taken for SVG text in InspectorController, take the code path currently only used for RenderInline,
+ that just calls absoluteQuads(), and displays the result. Refactored code that all SVG renderers (except RenderSVGRoot)
+ take this code path -> highlighting now works as expected.
+
+ Don't use absoluteClippedOverlowRect() in the various RenderSVG*::absoluteQuads() methods, as we're loosing floating-point precision.
+ Instead use localToAbsoluteQuad(strokeBoundingBox()) in order to highlight the unclipped, unfiltered, etc.. region that this renderer would paint.
+
+ No new tests, as this is only manual testable - at least I didn't find any Inspector-Highlighting tests, if someone knows please mail me.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::drawHighlightForLineBoxesOrSVGRenderer):
+ (WebCore::InspectorController::drawNodeHighlight):
+ * rendering/RenderSVGBlock.cpp:
+ (WebCore::RenderSVGBlock::absoluteRects): ASSERT_NOT_REACHED() here. SVG should only be inspected through absoluteQuads().
+ * rendering/RenderSVGBlock.h: Add absoluteRects() in this base class for RenderForeignObject/RenderSVGText.
+ * rendering/RenderSVGHiddenContainer.cpp: Remove absoluteRects() - RenderSVGModelObject already has it.
+ * rendering/RenderSVGHiddenContainer.h: Ditto.
+ * rendering/RenderSVGImage.cpp:
+ (WebCore::RenderSVGImage::absoluteRects): ASSERT_NOT_REACHED() here.
+ (WebCore::RenderSVGImage::absoluteQuads): Don't use absoluteClippedOverlowRect() but localToAbsoluteQuad(repaintRectInLocalCoordinates()).
+ * rendering/RenderSVGImage.h:
+ (WebCore::RenderSVGImage::objectBoundingBox): Inlined
+ * rendering/RenderSVGInline.cpp:
+ (WebCore::RenderSVGInline::absoluteQuads): Take RenderSVGText translation into account, allows inspecting <tspan>/<tref> etc.
+ * rendering/RenderSVGInline.h:
+ * rendering/RenderSVGModelObject.cpp:
+ (WebCore::RenderSVGModelObject::absoluteRects): ASSERT_NOT_REACHED() here.
+ (WebCore::RenderSVGModelObject::absoluteQuads): Don't use absoluteClippedOverlowRect() but localToAbsoluteQuad(repaintRectInLocalCoordinates()).
+ * rendering/RenderSVGModelObject.h:
+ * rendering/RenderSVGRoot.cpp: Fix typo in license s/aint/along. Need to touch this file in order to let Mac build.
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::mapLocalToContainer): Remove hack, which moved the transformState by x()/y(). Not needed anymore.
+ (WebCore::RenderSVGText::absoluteQuads): Proper implementation, respecting x/y translation.
+ * rendering/RenderSVGText.h: Reorder some functions.
+ * rendering/SVGRenderSupport.h: Removed last virtual function strokeBoundingBox().
+
+2010-06-24 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Build fix for Tiger.
+
+ * platform/mac/ThemeMac.mm:
+ (WebCore::setControlSize):
+
+2010-06-24 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Build fix for Tiger.
+
+ * platform/mac/ThemeMac.mm:
+ (WebCore::setControlSize):
+ (WebCore::ThemeMac::inflateControlPaintRect):
+
+2010-06-24 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Build fix for Chromium Mac.
+
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isSpeechEnabled):
+
+2010-06-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ The QML WebKit integration needs to be part of QtWebKit.sis
+
+ * WebCore.pro: Deploy qmlwebkitplugin.dll.
+
+2010-06-24 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Add a speech button to input elements, no rendering or actions yet.
+
+ Speech Input: Add a speech button to text input element (no rendering or actions yet)
+ https://bugs.webkit.org/show_bug.cgi?id=40925
+
+ No new tests. Will create a layout test in a subsequent patch.
+
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId):
+ (WebCore::nameToPseudoTypeMap):
+ (WebCore::CSSSelector::extractPseudoType):
+ * css/CSSSelector.h:
+ (WebCore::CSSSelector::):
+ * css/CSSValueKeywords.in:
+ * css/html.css:
+ (input::-webkit-input-speech-button):
+ * dom/InputElement.h:
+ * html/HTMLAttributeNames.in:
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::isSpeechEnabled):
+ * html/HTMLInputElement.h:
+ * platform/ThemeTypes.h:
+ (WebCore::):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::nodeAtPoint):
+ (WebCore::RenderTextControlSingleLine::forwardEvent):
+ (WebCore::RenderTextControlSingleLine::styleDidChange):
+ (WebCore::RenderTextControlSingleLine::hasControlClip):
+ (WebCore::RenderTextControlSingleLine::controlClipRect):
+ (WebCore::RenderTextControlSingleLine::textBlockWidth):
+ (WebCore::RenderTextControlSingleLine::preferredContentWidth):
+ (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
+ (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
+ (WebCore::RenderTextControlSingleLine::createSpeechButtonStyle):
+ (WebCore::RenderTextControlSingleLine::clientPaddingRight):
+ * rendering/RenderTextControlSingleLine.h:
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::adjustStyle):
+ (WebCore::RenderTheme::paint):
+ (WebCore::RenderTheme::paintBorderOnly):
+ (WebCore::RenderTheme::paintDecorations):
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::InputFieldSpeechButtonElement::InputFieldSpeechButtonElement):
+ (WebCore::InputFieldSpeechButtonElement::create):
+ (WebCore::InputFieldSpeechButtonElement::defaultEventHandler):
+ * rendering/TextControlInnerElements.h:
+ * rendering/style/RenderStyleConstants.h:
+ (WebCore::):
+
+2010-06-24 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ [Mac] The upper button of <input type=number> has no visual effect on click
+ https://bugs.webkit.org/show_bug.cgi?id=38380
+
+ Because we have no ways to draw an NSStepperCell with its up button
+ highlighted, use HIThemeDrawButton() instead.
+
+ Test: platform/mac/fast/forms/input-appearance-spinbutton-up.html
+
+ * platform/mac/ThemeMac.mm:
+ (WebCore::controlSizeFromPixelSize):
+ New function. Made from a part of setControlSize().
+ (WebCore::setControlSize):
+ (WebCore::convertControlStatesToThemeDrawState):
+ (WebCore::paintStepper): Use HITheme API instead of NSStepperCell.
+ (WebCore::ThemeMac::inflateControlPaintRect):
+ Use controlSizeFromPixelSize().
+
+2010-06-24 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: implement layout tests for debugger
+ https://bugs.webkit.org/show_bug.cgi?id=40774
+
+ Test: inspector/debugger-pause-on-debugger-statement.html
+
+ * bindings/js/ScriptDebugServer.cpp: remove unused obsolete code that deals with global listeners.
+ (WebCore::ScriptDebugServer::ScriptDebugServer):
+ (WebCore::ScriptDebugServer::removeListener):
+ (WebCore::ScriptDebugServer::dispatchFunctionToListeners):
+ (WebCore::ScriptDebugServer::pauseIfNeeded):
+ (WebCore::ScriptDebugServer::didAddListener):
+ (WebCore::ScriptDebugServer::didRemoveListener):
+ * bindings/js/ScriptDebugServer.h:
+ * platform/mac/EventLoopMac.mm:
+ (WebCore::EventLoop::cycle): wait at most 10ms for new event, otherwise layout tests would
+ hang because in their case there may be no events ever.
+
+2010-06-24 Andrey Kosyakov <caseq@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Fixed evaluation & logging of null values in console.
+ Changed handling of null and undefined in ScriptValue::toString()
+ to match JSC bindings (i.e. "null" and "undefined" instead of "").
+ https://bugs.webkit.org/show_bug.cgi?id=40980
+
+ * bindings/v8/ScriptValue.cpp:
+ (WebCore::ScriptValue::toString):
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-06-24 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: live edit doesn't work when resource tracking is off
+ https://bugs.webkit.org/show_bug.cgi?id=41076
+
+ * inspector/front-end/ScriptView.js:
+ (WebInspector.ScriptView.prototype._sourceIDForLine): implement this method for ScriptView,
+ it's needed for editLine to work.
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Sketch out InitialMode of HTML5 tree builder
+ https://bugs.webkit.org/show_bug.cgi?id=41126
+
+ Transliterated from the spec. Currently doesn't do anything. Mostly
+ an experiment to see where this goes.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::processToken):
+ (WebCore::HTMLTreeBuilder::insertDoctype):
+ (WebCore::HTMLTreeBuilder::insertComment):
+ * html/HTMLTreeBuilder.h:
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add all the HTML5 tree builder insertion modes
+ https://bugs.webkit.org/show_bug.cgi?id=41124
+
+ These are just copied verbatim from the spec. No tests because these
+ don't do anything yet.
+
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::passTokenToLegacyParser):
+ * html/HTMLTreeBuilder.h:
+ (WebCore::HTMLTreeBuilder::):
+
+2010-06-23 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Fix namespace indent. Just whitespace changes.
+
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::~DocumentParser):
+ (WebCore::DocumentParser::isExecutingScript):
+ (WebCore::DocumentParser::stopParsing):
+ (WebCore::DocumentParser::processingData):
+ (WebCore::DocumentParser::wantsRawData):
+ (WebCore::DocumentParser::writeRawData):
+ (WebCore::DocumentParser::wellFormed):
+ (WebCore::DocumentParser::lineNumber):
+ (WebCore::DocumentParser::columnNumber):
+ (WebCore::DocumentParser::executeScriptsWaitingForStylesheets):
+ (WebCore::DocumentParser::htmlTreeBuilder):
+ (WebCore::DocumentParser::asHTMLDocumentParser):
+ (WebCore::DocumentParser::inViewSourceMode):
+ (WebCore::DocumentParser::setInViewSourceMode):
+ (WebCore::DocumentParser::document):
+ (WebCore::DocumentParser::xssAuditor):
+ (WebCore::DocumentParser::setXSSAuditor):
+ (WebCore::DocumentParser::DocumentParser):
+
+2010-06-23 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Speculative build fix for Qt.
+
+ Move Document* down onto DocumentParser, since every DocumentParser needs one.
+ https://bugs.webkit.org/show_bug.cgi?id=41117
+
+ XMLDocumentParserQt is a huge pile of donkey barf.
+ I can't believe I ever r+'d the creation of this pile of
+ copy/paste code.
+
+ I clearly missed removing m_doc from this code as well and thus
+ broke Qt.
+
+ We really need to fix both XMLDocumentParserLibxml2 and
+ XMLDocumentParserQt not to be so poorly abstracted so
+ that if we're going to have two of them they can at least
+ share some code.
+
+ * dom/XMLDocumentParserQt.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::~XMLDocumentParser):
+ (WebCore::XMLDocumentParser::doWrite):
+ (WebCore::XMLDocumentParser::doEnd):
+ (WebCore::XMLDocumentParser::parse):
+ (WebCore::XMLDocumentParser::startDocument):
+ (WebCore::XMLDocumentParser::parseStartElement):
+ (WebCore::XMLDocumentParser::parseEndElement):
+ (WebCore::XMLDocumentParser::parseProcessingInstruction):
+ (WebCore::XMLDocumentParser::parseCdata):
+ (WebCore::XMLDocumentParser::parseComment):
+ (WebCore::XMLDocumentParser::parseDtd):
+
+2010-06-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Move Document* down onto DocumentParser, since every DocumentParser needs one.
+ https://bugs.webkit.org/show_bug.cgi?id=41117
+
+ This eliminated the need for document() on HTMLDocumentParser.
+ This paves the way for more code sharing between various
+ DocumentParser subclasses.
+
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::inViewSourceMode):
+ (WebCore::DocumentParser::setInViewSourceMode):
+ (WebCore::DocumentParser::document):
+ (WebCore::DocumentParser::DocumentParser):
+ * dom/XMLDocumentParser.cpp:
+ (WebCore::XMLDocumentParser::isWMLDocument):
+ (WebCore::XMLDocumentParser::pushCurrentNode):
+ (WebCore::XMLDocumentParser::popCurrentNode):
+ (WebCore::XMLDocumentParser::clearCurrentNodeStack):
+ (WebCore::XMLDocumentParser::enterText):
+ (WebCore::XMLDocumentParser::end):
+ (WebCore::XMLDocumentParser::insertErrorMessageBlock):
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::XMLDocumentParser):
+ (WebCore::XMLDocumentParser::~XMLDocumentParser):
+ (WebCore::XMLDocumentParser::doWrite):
+ (WebCore::XMLDocumentParser::startElementNs):
+ (WebCore::XMLDocumentParser::endElementNs):
+ (WebCore::XMLDocumentParser::processingInstruction):
+ (WebCore::XMLDocumentParser::cdataBlock):
+ (WebCore::XMLDocumentParser::comment):
+ (WebCore::XMLDocumentParser::startDocument):
+ (WebCore::XMLDocumentParser::internalSubset):
+ (WebCore::XMLDocumentParser::initializeParserContext):
+ (WebCore::XMLDocumentParser::doEnd):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::HTMLDocumentParser):
+ * html/HTMLDocumentParser.h:
+ * html/LegacyHTMLDocumentParser.cpp:
+ (WebCore::LegacyHTMLDocumentParser::LegacyHTMLDocumentParser):
+ (WebCore::LegacyHTMLDocumentParser::begin):
+ (WebCore::LegacyHTMLDocumentParser::scriptHandler):
+ (WebCore::LegacyHTMLDocumentParser::scriptExecution):
+ (WebCore::LegacyHTMLDocumentParser::parseTag):
+ (WebCore::LegacyHTMLDocumentParser::continueProcessing):
+ (WebCore::LegacyHTMLDocumentParser::willWriteHTML):
+ (WebCore::LegacyHTMLDocumentParser::didWriteHTML):
+ (WebCore::LegacyHTMLDocumentParser::write):
+ (WebCore::LegacyHTMLDocumentParser::stopParsing):
+ (WebCore::LegacyHTMLDocumentParser::timerFired):
+ (WebCore::LegacyHTMLDocumentParser::end):
+ (WebCore::LegacyHTMLDocumentParser::processToken):
+ (WebCore::LegacyHTMLDocumentParser::processDoctypeToken):
+ (WebCore::LegacyHTMLDocumentParser::executeScriptsWaitingForStylesheets):
+ (WebCore::LegacyHTMLDocumentParser::executeExternalScriptsIfReady):
+ (WebCore::LegacyHTMLDocumentParser::executeExternalScriptsTimerFired):
+ * html/LegacyHTMLDocumentParser.h:
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageDocumentParser::ImageDocumentParser):
+ (WebCore::ImageDocumentParser::imageDocument):
+ (WebCore::ImageDocumentParser::write):
+ (WebCore::ImageDocumentParser::writeRawData):
+ (WebCore::ImageDocumentParser::finish):
+ (WebCore::ImageDocumentParser::finishWasCalled):
+ (WebCore::ImageDocumentParser::isWaitingForScripts):
+ (WebCore::ImageDocument::createParser):
+ * loader/MediaDocument.cpp:
+ (WebCore::MediaDocumentParser::MediaDocumentParser):
+ (WebCore::MediaDocumentParser::createDocumentStructure):
+ (WebCore::MediaDocumentParser::finish):
+ (WebCore::MediaDocumentParser::finishWasCalled):
+ * loader/PluginDocument.cpp:
+ (WebCore::PluginDocumentParser::PluginDocumentParser):
+ (WebCore::PluginDocumentParser::createDocumentStructure):
+ (WebCore::PluginDocumentParser::writeRawData):
+ (WebCore::PluginDocumentParser::finish):
+ (WebCore::PluginDocumentParser::finishWasCalled):
+ * loader/SinkDocument.cpp:
+ (WebCore::SinkDocumentParser::SinkDocumentParser):
+ * loader/TextDocument.cpp:
+ (WebCore::TextDocumentParser::TextDocumentParser):
+ (WebCore::TextDocumentParser::write):
+ (WebCore::TextDocumentParser::finish):
+ (WebCore::TextDocumentParser::finishWasCalled):
+
+2010-06-23 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Start to clean up DocumentParser interface
+ https://bugs.webkit.org/show_bug.cgi?id=41114
+
+ The first of many cleanups needed to the DocumentParser
+ interface. Rename executingScript() to isExecutingScript()
+ and make it return a bool instead of an int. Also added a
+ FIXME to XMLDocumentParser about implementing it and did
+ some minor other cleanup to the XMLDocumentParser header.
+
+ No functional change, thus no tests.
+
+ * dom/Document.cpp:
+ (WebCore::Document::open):
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::isExecutingScript):
+ * dom/XMLDocumentParser.h:
+ (WebCore::XMLDocumentParser::wellFormed):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::attemptToEnd):
+ (WebCore::HTMLDocumentParser::endIfDelayed):
+ (WebCore::HTMLDocumentParser::isExecutingScript):
+ * html/HTMLDocumentParser.h:
+ * html/LegacyHTMLDocumentParser.h:
+ (WebCore::LegacyHTMLDocumentParser::isExecutingScript):
+
+2010-06-22 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ Implement IDL attribute for HTML5 hidden
+ https://bugs.webkit.org/show_bug.cgi?id=41039
+
+ Test: fast/html/hidden-attr-dom.html
+
+ * html/HTMLElement.idl: Just add to the IDL file. [Reflect] takes
+ care of the rest.
+
+2010-06-23 Joanmarie Diggs <joanmarie.diggs@gmail.com>
+
+ Reviewed by Chris Fleizach.
+
+ [Gtk] nameFromChildren is obsolete
+ https://bugs.webkit.org/show_bug.cgi?id=36128
+
+ Look to the AtkText interface implemented by the objects in
+ question.
+
+ Test: platform/gtk/accessibility/name-from-label.html
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (webkit_accessible_get_name):
+ (webkit_accessible_table_get_column_description):
+ (webkit_accessible_table_get_row_description):
+
+2010-06-23 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Port FileSystem
+ https://bugs.webkit.org/show_bug.cgi?id=34323
+
+ Port FileSystem with IFileMgr interface.
+
+ * platform/FileSystem.h:
+ * platform/brew/FileSystemBrew.cpp: Added.
+ (WebCore::getFileSize):
+ (WebCore::getFileModificationTime):
+ (WebCore::fileExists):
+ (WebCore::deleteFile):
+ (WebCore::deleteEmptyDirectory):
+ (WebCore::pathByAppendingComponent):
+ (WebCore::fileSystemRepresentation):
+ (WebCore::canonicalPath):
+ (WebCore::makeAllDirectories):
+ (WebCore::homeDirectoryPath):
+ (WebCore::pathGetFileName):
+ (WebCore::directoryName):
+ (WebCore::openTemporaryFile):
+ (WebCore::closeFile):
+ (WebCore::writeToFile):
+ (WebCore::unloadModule):
+ (WebCore::listDirectory):
+
+2010-06-23 Alexendar Pavlov <apavlov@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ Swap checks in Position::isCandidate so that the less expensive
+ nodeIsUserSelectNode (node && node->renderer() &&
+ node->renderer()->style()->userSelect() == SELECT_NONE) came first.
+
+ (Was Web Inspector: Hangup when expanding elements with enormous
+ text node content in Elements panel).
+
+ https://bugs.webkit.org/show_bug.cgi?id=35926
+
+ * dom/Position.cpp:
+ (WebCore::Position::isCandidate):
+ * dom/PositionIterator.cpp:
+ (WebCore::PositionIterator::isCandidate):
+
+2010-06-23 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Add PopupMenu implementation
+ https://bugs.webkit.org/show_bug.cgi?id=40226
+
+ Delegate PopupMenu handling to ChromeClientBrew.
+
+ * page/brew/ChromeClientBrew.h: Added.
+ * platform/PopupMenu.h:
+ * platform/brew/PopupMenuBrew.cpp: Added.
+ (WebCore::PopupMenu::PopupMenu):
+ (WebCore::PopupMenu::~PopupMenu):
+ (WebCore::PopupMenu::show):
+ (WebCore::PopupMenu::hide):
+ (WebCore::PopupMenu::updateFromElement):
+ (WebCore::PopupMenu::itemWritingDirectionIsNatural):
+
+2010-06-23 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Implement format conversions in texImage2D and texSubImage2D taking HTML data
+ https://bugs.webkit.org/show_bug.cgi?id=40319
+
+ Generalized code supporting premultiplication of alpha and
+ vertical flip to pack texture data into requested format and type.
+ Handled incoming image data of various formats, RGBA and BGRA in
+ particular, both to reduce the number of temporary copies during
+ texture upload and to support premultiplying alpha for the
+ texImage2D and texSubImage2D entry points taking ArrayBufferView
+ in a subsequent bug. Added test case exercising all combinations
+ of format/type combinations, premultiplication of alpha, and
+ Image/ImageData upload. (Incorporated pnglib.js under
+ fast/canvas/webgl/resources/ to be able to generate Image elements
+ programmatically.) Tested in Safari on Mac OS X and in Chromium on
+ Mac OS X, Windows and Linux.
+
+ Test: fast/canvas/webgl/tex-image-with-format-and-type.html
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::readPixels):
+ (WebCore::WebGLRenderingContext::texImage2DImpl):
+ (WebCore::WebGLRenderingContext::texImage2D):
+ (WebCore::WebGLRenderingContext::texSubImage2DImpl):
+ (WebCore::WebGLRenderingContext::texSubImage2D):
+ (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType):
+ (WebCore::WebGLRenderingContext::validateTexFuncParameters):
+ * platform/graphics/GraphicsContext3D.cpp:
+ (WebCore::GraphicsContext3D::computeFormatAndTypeParameters):
+ (WebCore::GraphicsContext3D::extractImageData):
+ (WebCore::GraphicsContext3D::flipVertically):
+ (WebCore::doUnpackingAndPacking):
+ (WebCore::doPacking):
+ (WebCore::GraphicsContext3D::packPixels):
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::):
+ * platform/graphics/cg/GraphicsContext3DCG.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::narrowInternalFormat):
+ (WebCore::GraphicsContext3D::texImage2D):
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+ * platform/graphics/skia/GraphicsContext3DSkia.cpp:
+ (WebCore::GraphicsContext3D::getImageData):
+
+2010-06-23 Stephen White <senorblanco@chromium.org>
+
+ Unreviewed; correcting bad patch.
+
+ In my haste to land r61710, I mistakenly landed the wrong version, in
+ which a chunk of code was moved. This patch moves that chunk of code
+ to where it was in the patch that was reviewed. Mea culpa.
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::ImageQualityController::shouldPaintAtLowQuality):
+
+2010-06-23 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Hyatt.
+
+ This is a tweak to the resize algorithm introduced in r61341, and
+ is a fix for the regression described in
+ https://bugs.webkit.org/show_bug.cgi?id=41036
+
+ The goal is to bring back the some of old behaviour, without regressing
+ too much of the performance gains in r61341.
+
+ The old algorithm was:
+ - on first resize, draw in high quality and record the paint time
+ - if we've already drawn at this size, use the same quality as last time
+ - on subsequent resizes, if the resize occurs within X ms of the
+ previous one, draw at low quality and set a timer (one timer per
+ image).
+ - when each timer expires, draw that image at high quality
+
+ The r61341 algorithm was:
+ - on first resize, draw the image in low quality, add it to a list of
+ resized images, and set a timer (one timer for all images)
+ - when the timer expires, redraw all resized images in high quality
+
+ The new algorithm is:
+ - on first resize, if no other animated resizes are outstanding, draw in
+ high quality and set the timer (one timer for all images)
+ - if any images have been resized to two different sizes in the last
+ X ms, draw all resized images in low quality and kick the timer
+ forward
+ - when the timer expires, if any animated resizes occured, redraw all
+ resized images in high quality, and reset the flag
+
+ This should cause GUIMark and the IE9 demos to have good performance
+ after the first frame, while other pages with only static resizes
+ should be unaffected.
+
+ * rendering/RenderBoxModelObject.cpp:
+ Change the LastPaintTimeMap to a LastPaintSizeMap: we now record the
+ last size an image was resized to, rather than the time it was painted
+ (the time actually became redundant in r61341 when I added the
+ check for m_timer.isActive(): we only care if anything is resizing
+ while the timer is active).
+ (WebCore::ImageQualityController::ImageQualityController):
+ Add an initializer for the m_animatedResizeIsActive flag.
+ (WebCore::ImageQualityController::objectDestroyed):
+ Reset the m_animatedResizeIsActive flag if this was the last object
+ in the list.
+ (WebCore::ImageQualityController::highQualityRepaintTimerFired):
+ Only repaint all the images if there was an animated resize (otherwise,
+ everything is already high quality).
+ (WebCore::ImageQualityController::shouldPaintAtLowQuality):
+ Implement the above algorithm.
+
+2010-06-23 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Bad cast after DOM mutation in RenderMenuList
+ https://bugs.webkit.org/show_bug.cgi?id=40828
+
+ Firing the onchange event on select which changes its size > 1 causes the select
+ object to change from a menulist to a listbox. However, when propogating the events,
+ we do a bad cast assuming the object will remain a menulist. Added proper checks to
+ make sure we check the renderer after the onchange is fired and propogate the event
+ based on correct object type.
+
+ Test: fast/events/select-onchange-crash.html
+
+ * dom/SelectElement.cpp:
+ (WebCore::SelectElement::setSelectedIndex):
+
+2010-06-23 Andy Estes <aestes@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ <rdar://problem/8107855> Prevent a crash in WebCore when removing an
+ object element with an invalid data URL in in a listener to its
+ beforeload event.
+ https://bugs.webkit.org/show_bug.cgi?id=41054
+
+ Tests: fast/dom/beforeload/remove-bad-object-in-beforeload-listener.html
+
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::renderFallbackContent): Exit early if the
+ object element is not in the document.
+ * rendering/RenderEmbeddedObject.cpp:
+ (WebCore::RenderEmbeddedObject::updateWidget): If RenderWidget::destroy()
+ was called during processing of onbeforeload, do not proceed with loading
+ the object.
+
+2010-06-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [gtk] web fonts not loaded properly in scribd html5 reader
+ https://bugs.webkit.org/show_bug.cgi?id=38758
+
+ Drop filling the pattern with default values, because this
+ restricts the matching more than we want.
+
+ * platform/graphics/cairo/FontCacheCairo.cpp:
+ (WebCore::FontCache::createFontPlatformData):
+
+2010-06-23 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [gtk] web fonts not loaded properly in scribd html5 reader
+ https://bugs.webkit.org/show_bug.cgi?id=38758
+
+ Also special-case `sans' amd `mono', which are aliases commonly
+ used in GTK+ applications.
+
+ * platform/graphics/cairo/FontCacheCairo.cpp:
+ (WebCore::isWellKnownFontName):
+
+2010-06-23 Justin Schuh <jschuh@chromium.org>
+
+ Unreviewed, rolling out r61695.
+ http://trac.webkit.org/changeset/61695
+ https://bugs.webkit.org/show_bug.cgi?id=40798
+
+ 61695 broke all the Linux builds.
+
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageDecoder::rowAvailable):
+
+2010-06-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ Reviewed by Darin Adler.
+
+ Fix PluginViewNone.cpp compilation for ports that also compile PluginView.cpp
+ https://bugs.webkit.org/show_bug.cgi?id=37939
+
+ * plugins/PluginViewNone.cpp:
+ (WebCore::PluginView::handleFocusInEvent):
+ (WebCore::PluginView::handleFocusOutEvent):
+ (WebCore::PluginView::keepAlive):
+ (WebCore::PluginView::privateBrowsingStateChanged):
+ (WebCore::PluginView::setJavaScriptPaused):
+
+2010-06-23 Cris Neckar <cdn@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Out of bounds write in WebCore::PNGImageDecoder::rowAvailable
+ https://bugs.webkit.org/show_bug.cgi?id=40798
+
+ Catches error in row callback for libPNG when extra rows are returned.
+
+ Test: fast/images/png-extra-row-crash.html
+
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageDecoder::rowAvailable):
+
+2010-06-23 James Robinson <jamesr@chromium.org>
+
+ Reviewed by Dan Bernstein.
+
+ Do not set needsLayout when the style attribute changes on an SVG element
+ https://bugs.webkit.org/show_bug.cgi?id=40366
+
+ SVGSVGElement::svgAttributeChanged was incorrectly calling renderer()->setNeedsLayout(true)
+ whenever the styleAttr changed on its element. This could happen during layout in some
+ circumstances due to lazy style attribute synchronization. When it did, it could cause the
+ layout flags to become inconsistent. See the test case for details.
+
+ Changes to an element's style attribute always mark an element as needing layout anyway so
+ this call was redundant.
+
+ Test: fast/repaint/svg-layout-root-style-attr-update.html
+
+ * svg/SVGStyledElement.cpp:
+ (WebCore::SVGStyledElement::isKnownAttribute):
+
+2010-06-23 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ r61215 broke Acid3
+ https://bugs.webkit.org/show_bug.cgi?id=41034
+
+ The code added in r61215, which tests whether the root renderer will fill
+ the entire viewport, should not run for subframes. So bail from
+ RenderView::paintBoxDecorations() if document()->ownerElement() is not null.
+ The old code was trying to do this by checking 'elt', but that ends up as
+ null after the for loop above.
+
+ We can also bail early if the is no FrameView().
+
+ Test: fast/frames/paint-iframe-background.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::paintBoxDecorations):
+
+2010-06-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: do not reset profiles panel on navigation.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41068
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::didCommitLoad):
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::resetProfilesPanel):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfilesPanel):
+ (WebInspector.ProfilesPanel.prototype.populateInterface):
+ (WebInspector.ProfilesPanel.prototype.profilerWasDisabled):
+ (WebInspector.ProfilesPanel.prototype._reset):
+ (WebInspector.ProfilesPanel.prototype._clearProfiles):
+ * inspector/front-end/inspector.js:
+ (WebInspector.resetProfilesPanel):
+
+2010-06-23 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: InspectorController should be added only once as ScriptDebugListener to
+ ScriptDebugServer.
+ https://bugs.webkit.org/show_bug.cgi?id=41070
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::connectFrontend):
+ (WebCore::InspectorController::disconnectFrontend):
+ (WebCore::InspectorController::enableDebuggerFromFrontend):
+ * inspector/front-end/ScriptsPanel.js:
+ (WebInspector.ScriptsPanel): don't call InspectorBackend.enableDebugger if debugger is always enabled,
+ InspectorController will do this on its side when the front end is connected.
+
+2010-06-23 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Clear breakpoints before restoring them, not after.
+ https://bugs.webkit.org/show_bug.cgi?id=41071
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::enableDebuggerFromFrontend):
+
+2010-06-23 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Do not render the full frame when there is some elements with fixed positioning
+ https://bugs.webkit.org/show_bug.cgi?id=33150
+
+ Do not render the full frame when there is some elements with fixed positioning
+ https://bugs.webkit.org/show_bug.cgi?id=33150
+
+ The frame view take into acount the list of fixed object when scrolling
+ the view. If the number of object is lower than a certain threshold, the pixel
+ are blitted, and the invalidated area updated.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::addFixedObject):
+ (WebCore::FrameView::removeFixedObject):
+ (WebCore::FrameView::scrollContentsFastPath):
+ * page/FrameView.h:
+ * platform/ScrollView.cpp:
+ (WebCore::ScrollView::scrollContents):
+ (WebCore::ScrollView::scrollContentsFastPath):
+ * platform/ScrollView.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::repaintRectIncludingDescendants):
+ * rendering/RenderLayer.h:
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::styleWillChange):
+
+2010-06-23 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Fix displaying of several CPU profiles with the same name.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40992
+
+ * inspector/front-end/ProfilesPanel.js:
+ (WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect):
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Unreviewed. clean-header-guards that were made dirty by recent
+ renames.
+
+ * html/HTMLDocumentParser.h:
+ * html/HTMLPreloadScanner.h:
+ * html/HTMLTokenizer.h:
+ * html/HTMLTreeBuilder.h:
+ * html/LegacyHTMLDocumentParser.h:
+ * html/LegacyHTMLTreeBuilder.h:
+ * html/LegacyPreloadScanner.h:
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename LegacyHTMLTreeConstructor to LegacyHTMLTreeBuilder
+ https://bugs.webkit.org/show_bug.cgi?id=41053
+
+ There was some debate about whether to call this class (and the
+ non-legacy version) "tree builder" or "tree constructor". Maciej
+ pointed out that other implementations (including Mozilla and HTML5Lib)
+ call it a tree builder. The path of least resistance seems to be call
+ it that for now.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::htmlTreeConstructor):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::htmlTreeConstructor):
+ * html/HTMLDocumentParser.h:
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::removedFromTree):
+ * html/HTMLInputElement.cpp:
+ * html/HTMLMeterElement.cpp:
+ * html/HTMLProgressElement.cpp:
+ * html/HTMLTreeBuilder.cpp:
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ * html/HTMLTreeBuilder.h:
+ (WebCore::HTMLTreeBuilder::legacyTreeConstructor):
+ * html/LegacyHTMLDocumentParser.cpp:
+ (WebCore::LegacyHTMLDocumentParser::LegacyHTMLDocumentParser):
+ * html/LegacyHTMLDocumentParser.h:
+ (WebCore::LegacyHTMLDocumentParser::htmlTreeConstructor):
+ * html/LegacyHTMLTreeBuilder.cpp: Copied from WebCore/html/LegacyHTMLTreeConstructor.cpp.
+ (WebCore::LegacyHTMLTreeBuilder::LegacyHTMLTreeBuilder):
+ (WebCore::LegacyHTMLTreeBuilder::~LegacyHTMLTreeBuilder):
+ (WebCore::LegacyHTMLTreeBuilder::reset):
+ (WebCore::LegacyHTMLTreeBuilder::setCurrent):
+ (WebCore::LegacyHTMLTreeBuilder::limitDepth):
+ (WebCore::LegacyHTMLTreeBuilder::insertNodeAfterLimitDepth):
+ (WebCore::LegacyHTMLTreeBuilder::parseToken):
+ (WebCore::LegacyHTMLTreeBuilder::parseDoctypeToken):
+ (WebCore::LegacyHTMLTreeBuilder::insertNode):
+ (WebCore::LegacyHTMLTreeBuilder::handleError):
+ (WebCore::LegacyHTMLTreeBuilder::textCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::commentCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::headCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::bodyCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::framesetCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::formCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::isindexCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::selectCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::ddCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::dtCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::rpCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::rtCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::nestedCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::nestedPCloserCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::nestedStyleCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::tableCellCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::tableSectionCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::noembedCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::noframesCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::noscriptCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::pCloserCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::pCloserStrictCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::mapCreateErrorCheck):
+ (WebCore::LegacyHTMLTreeBuilder::getNode):
+ (WebCore::LegacyHTMLTreeBuilder::allowNestedRedundantTag):
+ (WebCore::LegacyHTMLTreeBuilder::processCloseTag):
+ (WebCore::LegacyHTMLTreeBuilder::isHeadingTag):
+ (WebCore::LegacyHTMLTreeBuilder::isInline):
+ (WebCore::LegacyHTMLTreeBuilder::isResidualStyleTag):
+ (WebCore::LegacyHTMLTreeBuilder::isAffectedByResidualStyle):
+ (WebCore::LegacyHTMLTreeBuilder::handleResidualStyleCloseTagAcrossBlocks):
+ (WebCore::LegacyHTMLTreeBuilder::reopenResidualStyleTags):
+ (WebCore::LegacyHTMLTreeBuilder::pushBlock):
+ (WebCore::LegacyHTMLTreeBuilder::popBlock):
+ (WebCore::LegacyHTMLTreeBuilder::popOneBlockCommon):
+ (WebCore::LegacyHTMLTreeBuilder::popOneBlock):
+ (WebCore::LegacyHTMLTreeBuilder::moveOneBlockToStack):
+ (WebCore::LegacyHTMLTreeBuilder::checkIfHasPElementInScope):
+ (WebCore::LegacyHTMLTreeBuilder::popInlineBlocks):
+ (WebCore::LegacyHTMLTreeBuilder::freeBlock):
+ (WebCore::LegacyHTMLTreeBuilder::createHead):
+ (WebCore::LegacyHTMLTreeBuilder::handleIsindex):
+ (WebCore::LegacyHTMLTreeBuilder::startBody):
+ (WebCore::LegacyHTMLTreeBuilder::finished):
+ (WebCore::LegacyHTMLTreeBuilder::reportErrorToConsole):
+ * html/LegacyHTMLTreeBuilder.h: Copied from WebCore/html/LegacyHTMLTreeConstructor.h.
+ * html/LegacyHTMLTreeConstructor.cpp: Removed.
+ * html/LegacyHTMLTreeConstructor.h: Removed.
+ * html/StepRange.cpp:
+ * html/ValidityState.cpp:
+ * rendering/RenderSlider.cpp:
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename the preload scanners
+ https://bugs.webkit.org/show_bug.cgi?id=41052
+
+ Renames PreloadScanner to LegacyPreloadScanner because this code is now
+ off by default. Also, rename HTML5PreloadScanner to
+ HTMLPreloadScanner. We're not calling it PreloadScanner because we've
+ factored out the CSSPreloadScanner and the HTMLPreloadScanner from the
+ original PreloadScanner.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTML5PreloadScanner.cpp: Removed.
+ * html/HTML5PreloadScanner.h: Removed.
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::pumpTokenizer):
+ * html/HTMLDocumentParser.h:
+ * html/HTMLPreloadScanner.cpp: Copied from WebCore/html/HTML5PreloadScanner.cpp.
+ (WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
+ (WebCore::HTMLPreloadScanner::appendToEnd):
+ (WebCore::HTMLPreloadScanner::scan):
+ (WebCore::HTMLPreloadScanner::processToken):
+ (WebCore::HTMLPreloadScanner::scanningBody):
+ * html/HTMLPreloadScanner.h: Copied from WebCore/html/HTML5PreloadScanner.h.
+ * html/LegacyHTMLDocumentParser.cpp:
+ (WebCore::LegacyHTMLDocumentParser::scriptHandler):
+ (WebCore::LegacyHTMLDocumentParser::scriptExecution):
+ * html/LegacyHTMLDocumentParser.h:
+ * html/LegacyPreloadScanner.cpp: Copied from WebCore/html/PreloadScanner.cpp.
+ (WebCore::LegacyPreloadScanner::LegacyPreloadScanner):
+ (WebCore::LegacyPreloadScanner::~LegacyPreloadScanner):
+ (WebCore::LegacyPreloadScanner::begin):
+ (WebCore::LegacyPreloadScanner::end):
+ (WebCore::LegacyPreloadScanner::reset):
+ (WebCore::LegacyPreloadScanner::scanningBody):
+ (WebCore::LegacyPreloadScanner::write):
+ (WebCore::LegacyPreloadScanner::clearLastCharacters):
+ (WebCore::LegacyPreloadScanner::rememberCharacter):
+ (WebCore::LegacyPreloadScanner::lastCharactersMatch):
+ (WebCore::LegacyPreloadScanner::consumeEntity):
+ (WebCore::LegacyPreloadScanner::tokenize):
+ (WebCore::LegacyPreloadScanner::processAttribute):
+ (WebCore::LegacyPreloadScanner::emitCharacter):
+ (WebCore::LegacyPreloadScanner::tokenizeCSS):
+ (WebCore::LegacyPreloadScanner::emitTag):
+ (WebCore::LegacyPreloadScanner::emitCSSRule):
+ * html/LegacyPreloadScanner.h: Copied from WebCore/html/PreloadScanner.h.
+ * html/PreloadScanner.cpp: Removed.
+ * html/PreloadScanner.h: Removed.
+ * page/XSSAuditor.cpp:
+ (WebCore::XSSAuditor::decodeHTMLEntities):
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Yet more HTML5 => HTML renames
+ https://bugs.webkit.org/show_bug.cgi?id=41051
+
+ This patch renames HTML5DocumentParser to HTMLDocumentParser and
+ HTML5TreeBuilder to HTMLTreeBuilder. There was some discussion about
+ whether to use the name HTMLTreeBuilder or HTMLTreeConstructor, but
+ tree builder seems to be the dominate name in other implementations.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/DocumentFragment.cpp:
+ (WebCore::DocumentFragment::parseHTML):
+ * html/HTML5DocumentParser.cpp: Removed.
+ * html/HTML5DocumentParser.h: Removed.
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTML5PreloadScanner::scan):
+ (WebCore::HTML5PreloadScanner::processToken):
+ * html/HTML5TreeBuilder.cpp: Removed.
+ * html/HTML5TreeBuilder.h: Removed.
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::createParser):
+ * html/HTMLDocumentParser.cpp: Copied from WebCore/html/HTML5DocumentParser.cpp.
+ (WebCore::HTMLDocumentParser::HTMLDocumentParser):
+ (WebCore::HTMLDocumentParser::~HTMLDocumentParser):
+ (WebCore::HTMLDocumentParser::begin):
+ (WebCore::HTMLDocumentParser::stopParsing):
+ (WebCore::HTMLDocumentParser::processingData):
+ (WebCore::HTMLDocumentParser::pumpTokenizerIfPossible):
+ (WebCore::HTMLDocumentParser::isScheduledForResume):
+ (WebCore::HTMLDocumentParser::resumeParsingAfterYield):
+ (WebCore::HTMLDocumentParser::runScriptsForPausedTreeConstructor):
+ (WebCore::HTMLDocumentParser::pumpTokenizer):
+ (WebCore::HTMLDocumentParser::willPumpLexer):
+ (WebCore::HTMLDocumentParser::didPumpLexer):
+ (WebCore::HTMLDocumentParser::write):
+ (WebCore::HTMLDocumentParser::end):
+ (WebCore::HTMLDocumentParser::attemptToEnd):
+ (WebCore::HTMLDocumentParser::endIfDelayed):
+ (WebCore::HTMLDocumentParser::finish):
+ (WebCore::HTMLDocumentParser::finishWasCalled):
+ (WebCore::HTMLDocumentParser::executingScript):
+ (WebCore::HTMLDocumentParser::inScriptExecution):
+ (WebCore::HTMLDocumentParser::lineNumber):
+ (WebCore::HTMLDocumentParser::columnNumber):
+ (WebCore::HTMLDocumentParser::htmlTreeConstructor):
+ (WebCore::HTMLDocumentParser::isWaitingForScripts):
+ (WebCore::HTMLDocumentParser::resumeParsingAfterScriptExecution):
+ (WebCore::HTMLDocumentParser::watchForLoad):
+ (WebCore::HTMLDocumentParser::stopWatchingForLoad):
+ (WebCore::HTMLDocumentParser::shouldLoadExternalScriptFromSrc):
+ (WebCore::HTMLDocumentParser::notifyFinished):
+ (WebCore::HTMLDocumentParser::executeScriptsWaitingForStylesheets):
+ (WebCore::HTMLDocumentParser::script):
+ * html/HTMLDocumentParser.h: Copied from WebCore/html/HTML5DocumentParser.h.
+ * html/HTMLParserScheduler.cpp:
+ (WebCore::HTMLParserScheduler::HTMLParserScheduler):
+ * html/HTMLParserScheduler.h:
+ * html/HTMLTreeBuilder.cpp: Copied from WebCore/html/HTML5TreeBuilder.cpp.
+ (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder):
+ (WebCore::HTMLTreeBuilder::handleScriptStartTag):
+ (WebCore::HTMLTreeBuilder::handleScriptEndTag):
+ (WebCore::HTMLTreeBuilder::takeScriptToProcess):
+ (WebCore::HTMLTreeBuilder::adjustedLexerState):
+ (WebCore::HTMLTreeBuilder::passTokenToLegacyParser):
+ (WebCore::HTMLTreeBuilder::constructTreeFromToken):
+ (WebCore::HTMLTreeBuilder::processToken):
+ (WebCore::HTMLTreeBuilder::finished):
+ (WebCore::HTMLTreeBuilder::isScriptingFlagEnabled):
+ * html/HTMLTreeBuilder.h: Copied from WebCore/html/HTML5TreeBuilder.h.
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ More HTML5 => HTML renames
+ https://bugs.webkit.org/show_bug.cgi?id=41049
+
+ This patch renames HTML5ScriptRunner, HTML5ScriptRunnerHost, and
+ HTML5Token to remove the "5" from their names. These clases aren't
+ specific to HTML5 and will be used going forward.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/CSSPreloadScanner.cpp:
+ (WebCore::CSSPreloadScanner::scan):
+ * html/CSSPreloadScanner.h:
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::HTML5DocumentParser):
+ (WebCore::HTML5DocumentParser::notifyFinished):
+ * html/HTML5DocumentParser.h:
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTMLNames::PreloadTask::PreloadTask):
+ (WebCore::HTMLNames::PreloadTask::processAttributes):
+ (WebCore::HTML5PreloadScanner::processToken):
+ * html/HTML5PreloadScanner.h:
+ * html/HTML5ScriptRunner.cpp: Removed.
+ * html/HTML5ScriptRunner.h: Removed.
+ * html/HTML5ScriptRunnerHost.h: Removed.
+ * html/HTML5Token.h: Removed.
+ * html/HTML5TreeBuilder.cpp:
+ (WebCore::convertToOldStyle):
+ (WebCore::HTML5TreeBuilder::handleScriptEndTag):
+ (WebCore::HTML5TreeBuilder::passTokenToLegacyParser):
+ (WebCore::HTML5TreeBuilder::constructTreeFromToken):
+ (WebCore::HTML5TreeBuilder::processToken):
+ * html/HTML5TreeBuilder.h:
+ * html/HTMLScriptRunner.cpp: Copied from WebCore/html/HTML5ScriptRunner.cpp.
+ (WebCore::HTMLScriptRunner::HTMLScriptRunner):
+ (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
+ (WebCore::HTMLScriptRunner::sourceFromPendingScript):
+ (WebCore::HTMLScriptRunner::isPendingScriptReady):
+ (WebCore::HTMLScriptRunner::executePendingScript):
+ (WebCore::HTMLScriptRunner::executeScript):
+ (WebCore::HTMLScriptRunner::hasScriptsWaitingForLoad):
+ (WebCore::HTMLScriptRunner::watchForLoad):
+ (WebCore::HTMLScriptRunner::stopWatchingForLoad):
+ (WebCore::HTMLScriptRunner::execute):
+ (WebCore::HTMLScriptRunner::haveParsingBlockingScript):
+ (WebCore::HTMLScriptRunner::executeParsingBlockingScripts):
+ (WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
+ (WebCore::HTMLScriptRunner::executeScriptsWaitingForStylesheets):
+ (WebCore::HTMLScriptRunner::requestScript):
+ (WebCore::HTMLScriptRunner::runScript):
+ * html/HTMLScriptRunner.h: Copied from WebCore/html/HTML5ScriptRunner.h.
+ * html/HTMLScriptRunnerHost.h: Copied from WebCore/html/HTML5ScriptRunnerHost.h.
+ (WebCore::HTMLScriptRunnerHost::~HTMLScriptRunnerHost):
+ * html/HTMLToken.h: Copied from WebCore/html/HTML5Token.h.
+ (WebCore::HTMLToken::HTMLToken):
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::nextToken):
+ (WebCore::HTMLTokenizer::emitCharacter):
+ (WebCore::HTMLTokenizer::emitCurrentToken):
+ (WebCore::HTMLTokenizer::shouldEmitBufferedCharacterToken):
+ * html/HTMLTokenizer.h:
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename HTML5EntityParser to HTMLEntityParser
+ https://bugs.webkit.org/show_bug.cgi?id=41048
+
+ Mostly the result of do-webcore-rename, but I tweaked the header guard
+ and the name of the free function.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTML5EntityParser.cpp: Removed.
+ * html/HTML5EntityParser.h: Removed.
+ * html/HTMLEntityParser.cpp: Copied from WebCore/html/HTML5EntityParser.cpp.
+ (WebCore::consumeHTMLEntity):
+ * html/HTMLEntityParser.h: Copied from WebCore/html/HTML5EntityParser.h.
+ * html/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::processEntity):
+ (WebCore::HTMLTokenizer::nextToken):
+
+2010-06-22 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Add a new class that stores information about WebSocket handshake response.
+
+ In the future, instances of the new class will be passed to the Web Inspector
+ so that it will be able to display information about WebSocket handshake
+ response.
+
+ WebSocket: Add WebSocketHandshakeResponse
+ https://bugs.webkit.org/show_bug.cgi?id=38728
+
+ Test: websocket/tests/handshake-fail-by-no-cr.html
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * websockets/WebSocketHandshake.cpp:
+ (WebCore::trimConsoleMessage):
+ (WebCore::WebSocketHandshake::readServerHandshake):
+ (WebCore::WebSocketHandshake::serverHandshakeResponse):
+ (WebCore::WebSocketHandshake::readStatusLine): Moved from extractResponseCode.
+ Add more error checks and make error messages more descriptive.
+ (WebCore::WebSocketHandshake::readHTTPHeaders):
+ (WebCore::WebSocketHandshake::processHeaders):
+ * websockets/WebSocketHandshake.h:
+ * websockets/WebSocketHandshakeResponse.cpp: Added.
+ (WebCore::WebSocketHandshakeResponse::ChallengeResponse::ChallengeResponse):
+ (WebCore::WebSocketHandshakeResponse::ChallengeResponse::set):
+ (WebCore::WebSocketHandshakeResponse::WebSocketHandshakeResponse):
+ (WebCore::WebSocketHandshakeResponse::~WebSocketHandshakeResponse):
+ (WebCore::WebSocketHandshakeResponse::statusCode):
+ (WebCore::WebSocketHandshakeResponse::setStatusCode):
+ (WebCore::WebSocketHandshakeResponse::statusText):
+ (WebCore::WebSocketHandshakeResponse::setStatusText):
+ (WebCore::WebSocketHandshakeResponse::headerFields):
+ (WebCore::WebSocketHandshakeResponse::addHeaderField):
+ (WebCore::WebSocketHandshakeResponse::clearHeaderFields):
+ (WebCore::WebSocketHandshakeResponse::challengeResponse):
+ (WebCore::WebSocketHandshakeResponse::setChallengeResponse):
+ * websockets/WebSocketHandshakeResponse.h: Added.
+
+2010-06-23 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Implement page format data programming interface.
+ The final goal is to implement CSS Paged Media Module Level 3 (http://dev.w3.org/csswg/css3-page/).
+ To begin with, this change adds methods to know:
+ - if page box is visible,
+ - the page area rectangle, and
+ - preferred page size.
+
+ https://bugs.webkit.org/show_bug.cgi?id=37538
+
+ Test: printing/page-format-data.html
+
+ * WebCore.base.exp:
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseSizeParameter):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+ (WebCore::CSSStyleSelector::applyPageSizeProperty):
+ (WebCore::CSSStyleSelector::pageSizeFromName):
+ (WebCore::CSSStyleSelector::mmLength):
+ (WebCore::CSSStyleSelector::inchLength):
+ * css/CSSStyleSelector.h:
+ * css/html.css:
+ (@page):
+ * dom/Document.cpp:
+ (WebCore::Document::isPageBoxVisible):
+ (WebCore::Document::pageAreaRectInPixels):
+ (WebCore::Document::preferredPageSizeInPixels):
+ * dom/Document.h:
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::isPageBoxVisible):
+ (WebCore::PrintContext::pageAreaRectInPixels):
+ (WebCore::PrintContext::preferredPageSizeInPixels):
+ * page/PrintContext.h:
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::pageSize):
+ (WebCore::InheritedFlags::setPageSize):
+ * rendering/style/StyleRareNonInheritedData.h:
+
+2010-06-23 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename lexer and m_lexer to tokenizer and m_tokenizer, respectively
+ https://bugs.webkit.org/show_bug.cgi?id=41046
+
+ This is a follow up to the recent HTML5Lexer => HTMLTokenizer rename.
+
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::HTML5DocumentParser):
+ (WebCore::HTML5DocumentParser::begin):
+ (WebCore::HTML5DocumentParser::pumpLexer):
+ (WebCore::HTML5DocumentParser::willPumpLexer):
+ (WebCore::HTML5DocumentParser::didPumpLexer):
+ (WebCore::HTML5DocumentParser::lineNumber):
+ (WebCore::HTML5DocumentParser::columnNumber):
+ * html/HTML5DocumentParser.h:
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTML5PreloadScanner::scan):
+ (WebCore::HTML5PreloadScanner::processToken):
+ * html/HTML5PreloadScanner.h:
+ * html/HTML5TreeBuilder.cpp:
+ (WebCore::HTML5TreeBuilder::HTML5TreeBuilder):
+ (WebCore::HTML5TreeBuilder::handleScriptStartTag):
+ (WebCore::HTML5TreeBuilder::passTokenToLegacyParser):
+ * html/HTML5TreeBuilder.h:
+ * html/HTMLTokenizer.h:
+ * html/LegacyHTMLDocumentParser.h:
+
+2010-06-23 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Eric Seidel.
+
+ Reproducible crash in com.apple.WebCore 0x01ed3784 WebCore::RenderLineBoxList::appendLineBox(WebCore::InlineFlowBox*) + 36
+ https://bugs.webkit.org/show_bug.cgi?id=40953
+
+ REGRESSION (r58209-58231): Memory corruption with invalid SVG
+ https://bugs.webkit.org/show_bug.cgi?id=40173
+
+ Fix several crashes, all related to <foreignObject> and/or invalid SVG documents.
+ - Only allow <svg> nodes, as direct children of a <foreignObject>, not any other "partial" SVG content.
+ - Assure to create RenderSVGRoot objects for <svg> nodes in <foreignObject>, treat them as "outermost SVG elements".
+ - Never allow any partial SVG content to appear in any document. Only <svg> elements are allowed.
+
+ Tests: svg/custom/bug45331.svg
+ svg/foreignObject/disallowed-svg-nodes-as-direct-children.svg
+ svg/foreignObject/no-crash-with-svg-content-in-html-document.svg
+ svg/foreignObject/svg-document-as-direct-child.svg
+ svg/foreignObject/svg-document-in-html-document.svg
+ svg/foreignObject/text-tref-02-b.svg
+
+ * dom/Element.cpp: Added childShouldCreateRenderer, with ENABLE(SVG) guards.
+ (WebCore::Element::childShouldCreateRenderer): Only create a renderer for a SVG child, if we're a SVG element, or if the child is a <svg> element.
+ * dom/Element.h: Added childShouldCreateRenderer, with ENABLE(SVG) guards.
+ * svg/SVGForeignObjectElement.cpp:
+ (WebCore::SVGForeignObjectElement::childShouldCreateRenderer): Disallow arbitary SVG content, only <svg> elements are allowed as direct children of a <foreignObject>
+ * svg/SVGSVGElement.cpp:
+ (WebCore::SVGSVGElement::isOutermostSVG): Be sure to create RenderSVGRoot objects for <svg> elements inside <foreignObject>
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename HTML5Lexer to HTMLTokenizer
+ https://bugs.webkit.org/show_bug.cgi?id=41045
+
+ This might be slightly confusing given that the old class was called
+ HTMLTokenizer, but it matches the terminology in the HTML5 spec.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::HTML5DocumentParser):
+ (WebCore::HTML5DocumentParser::pumpLexer):
+ * html/HTML5DocumentParser.h:
+ * html/HTML5Lexer.cpp: Removed.
+ * html/HTML5Lexer.h: Removed.
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTML5PreloadScanner::processToken):
+ * html/HTML5PreloadScanner.h:
+ * html/HTML5TreeBuilder.cpp:
+ (WebCore::HTML5TreeBuilder::HTML5TreeBuilder):
+ (WebCore::HTML5TreeBuilder::handleScriptStartTag):
+ (WebCore::HTML5TreeBuilder::adjustedLexerState):
+ * html/HTML5TreeBuilder.h:
+ * html/HTMLTokenizer.cpp: Copied from WebCore/html/HTML5Lexer.cpp.
+ (WebCore::HTMLNames::isEndTagBufferingState):
+ (WebCore::HTMLTokenizer::HTMLTokenizer):
+ (WebCore::HTMLTokenizer::~HTMLTokenizer):
+ (WebCore::HTMLTokenizer::reset):
+ (WebCore::HTMLTokenizer::processEntity):
+ (WebCore::HTMLTokenizer::nextToken):
+ (WebCore::HTMLTokenizer::temporaryBufferIs):
+ (WebCore::HTMLTokenizer::addToPossibleEndTag):
+ (WebCore::HTMLTokenizer::isAppropriateEndTag):
+ (WebCore::HTMLTokenizer::emitCharacter):
+ (WebCore::HTMLTokenizer::emitCodePoint):
+ (WebCore::HTMLTokenizer::emitParseError):
+ (WebCore::HTMLTokenizer::emitCurrentToken):
+ (WebCore::HTMLTokenizer::shouldEmitBufferedCharacterToken):
+ * html/HTMLTokenizer.h: Copied from WebCore/html/HTML5Lexer.h.
+
+2010-06-22 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Qt/Symbian build fix.
+
+ Fix "make clean" to not try to execute clean commands for
+ the extra targets we use to simulate "make install".
+
+ * WebCore.pro: Use no_clean in CONFIG of extra compilers.
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Run clean-header-guards to fix some header guards
+ https://bugs.webkit.org/show_bug.cgi?id=41044
+
+ No functional changes, thus no tests.
+
+ This entire change was generated by running
+ clean-header-guards, and then reverting changes
+ to files which shouldn't be changed. Those which
+ are left all should be updated.
+
+ Some of these changes are just fixing 755 permissions
+ to be 644, since it seems various files have the wrong
+ execute bit which don't need it. clean-header-guards
+ made those (welcome) permission fixes unintentionally.
+
+ * bindings/v8/custom/V8HTMLAudioElementConstructor.h:
+ * bindings/v8/custom/V8HTMLImageElementConstructor.h:
+ * bindings/v8/custom/V8HTMLOptionElementConstructor.h:
+ * dom/Touch.h:
+ * dom/TouchList.h:
+ * dom/XMLDocumentParser.h:
+ * dom/XMLDocumentParserScope.h:
+ * html/HTML5DocumentParser.h:
+ * html/LegacyHTMLTreeConstructor.h:
+ * loader/CrossOriginPreflightResultCache.h:
+ * page/OriginAccessEntry.h:
+ * page/win/FrameWin.h:
+ * platform/ThreadTimers.h:
+ * platform/chromium/KeyboardCodes.h:
+ * platform/graphics/chromium/FontPlatformDataChromiumWin.h:
+ * platform/graphics/chromium/FontUtilsChromiumWin.h:
+ * platform/graphics/filters/FEBlend.h:
+ * platform/graphics/filters/FEColorMatrix.h:
+ * platform/graphics/filters/FEComponentTransfer.h:
+ * platform/graphics/filters/FEComposite.h:
+ * platform/graphics/gstreamer/DataSourceGStreamer.h:
+ * platform/graphics/gstreamer/VideoSinkGStreamer.h:
+ - I checked, this crazy define was not referenced
+ anywhere else. It's safe to change the name. :)
+ * platform/graphics/haiku/FontPlatformData.h:
+ * platform/graphics/qt/FontCustomPlatformData.h:
+ * platform/graphics/skia/SkiaFontWin.h:
+ * platform/graphics/win/GraphicsLayerCACF.h:
+ * platform/graphics/win/QTMovieWinTimer.h:
+ * platform/graphics/win/RefCountedGDIHandle.h:
+ * platform/graphics/win/WebLayer.h:
+ * platform/graphics/win/WebTiledLayer.h:
+ * platform/graphics/wince/FontPlatformData.h:
+ * platform/graphics/wx/FontPlatformData.h:
+ * platform/network/CredentialStorage.h:
+ * platform/network/cf/FormDataStreamCFNet.h:
+ * platform/network/curl/FormDataStreamCurl.h:
+ * platform/network/qt/DnsPrefetchHelper.h:
+ * platform/network/qt/QNetworkReplyHandler.h:
+ * platform/win/PlatformScrollBar.h:
+ * plugins/PluginDatabase.h:
+ * plugins/PluginPackage.h:
+ * plugins/PluginStream.h:
+ * plugins/qt/PluginContainerQt.h:
+ * plugins/symbian/npinterface.h:
+ * rendering/RenderSelectionInfo.h:
+ * rendering/SVGRenderSupport.h:
+ * storage/IDBObjectStoreImpl.h:
+ * svg/animation/SMILTimeContainer.h:
+ * wml/WMLErrorHandling.h:
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename HTMLDocumentParser to LegacyHTMLDocumentParser
+ https://bugs.webkit.org/show_bug.cgi?id=41043
+
+ As requested by Darin Adler.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSStyleSheet.cpp:
+ (WebCore::CSSStyleSheet::checkLoaded):
+ * dom/Document.cpp:
+ (WebCore::Document::write):
+ * dom/DocumentFragment.cpp:
+ * dom/DocumentParser.h:
+ (WebCore::DocumentParser::asHTMLDocumentParser):
+ * dom/XMLDocumentParserLibxml2.cpp:
+ * dom/XMLDocumentParserQt.cpp:
+ * html/HTML5Lexer.h:
+ (WebCore::HTML5Lexer::columnNumber):
+ * html/HTML5TreeBuilder.cpp:
+ * html/HTMLDocument.cpp:
+ (WebCore::HTMLDocument::createParser):
+ * html/HTMLDocumentParser.cpp: Removed.
+ * html/HTMLDocumentParser.h: Removed.
+ * html/HTMLFormControlElement.cpp:
+ * html/HTMLParserScheduler.cpp:
+ (WebCore::parserChunkSize):
+ * html/HTMLViewSourceDocument.cpp:
+ (WebCore::HTMLViewSourceDocument::createParser):
+ (WebCore::HTMLViewSourceDocument::addViewSourceToken):
+ * html/HTMLViewSourceDocument.h:
+ * html/LegacyHTMLDocumentParser.cpp: Copied from WebCore/html/HTMLDocumentParser.cpp.
+ (WebCore::LegacyHTMLDocumentParser::LegacyHTMLDocumentParser):
+ (WebCore::LegacyHTMLDocumentParser::reset):
+ (WebCore::LegacyHTMLDocumentParser::begin):
+ (WebCore::LegacyHTMLDocumentParser::setForceSynchronous):
+ (WebCore::LegacyHTMLDocumentParser::processListing):
+ (WebCore::LegacyHTMLDocumentParser::parseNonHTMLText):
+ (WebCore::LegacyHTMLDocumentParser::scriptHandler):
+ (WebCore::LegacyHTMLDocumentParser::scriptExecution):
+ (WebCore::LegacyHTMLDocumentParser::parseComment):
+ (WebCore::LegacyHTMLDocumentParser::parseServer):
+ (WebCore::LegacyHTMLDocumentParser::parseProcessingInstruction):
+ (WebCore::LegacyHTMLDocumentParser::parseText):
+ (WebCore::LegacyHTMLDocumentParser::parseEntity):
+ (WebCore::LegacyHTMLDocumentParser::parseDoctype):
+ (WebCore::LegacyHTMLDocumentParser::parseTag):
+ (WebCore::LegacyHTMLDocumentParser::continueProcessing):
+ (WebCore::LegacyHTMLDocumentParser::advance):
+ (WebCore::LegacyHTMLDocumentParser::willWriteHTML):
+ (WebCore::LegacyHTMLDocumentParser::didWriteHTML):
+ (WebCore::LegacyHTMLDocumentParser::write):
+ (WebCore::LegacyHTMLDocumentParser::stopParsing):
+ (WebCore::LegacyHTMLDocumentParser::processingData):
+ (WebCore::LegacyHTMLDocumentParser::timerFired):
+ (WebCore::LegacyHTMLDocumentParser::end):
+ (WebCore::LegacyHTMLDocumentParser::finish):
+ (WebCore::LegacyHTMLDocumentParser::finishWasCalled):
+ (WebCore::LegacyHTMLDocumentParser::processToken):
+ (WebCore::LegacyHTMLDocumentParser::processDoctypeToken):
+ (WebCore::LegacyHTMLDocumentParser::~LegacyHTMLDocumentParser):
+ (WebCore::LegacyHTMLDocumentParser::enlargeBuffer):
+ (WebCore::LegacyHTMLDocumentParser::enlargeScriptBuffer):
+ (WebCore::LegacyHTMLDocumentParser::executeScriptsWaitingForStylesheets):
+ (WebCore::LegacyHTMLDocumentParser::notifyFinished):
+ (WebCore::LegacyHTMLDocumentParser::executeExternalScriptsIfReady):
+ (WebCore::LegacyHTMLDocumentParser::executeExternalScriptsTimerFired):
+ (WebCore::LegacyHTMLDocumentParser::continueExecutingExternalScripts):
+ (WebCore::LegacyHTMLDocumentParser::isWaitingForScripts):
+ (WebCore::LegacyHTMLDocumentParser::setSrc):
+ (WebCore::parseLegacyHTMLDocumentFragment):
+ * html/LegacyHTMLDocumentParser.h: Copied from WebCore/html/HTMLDocumentParser.h.
+ (WebCore::LegacyHTMLDocumentParser::asHTMLDocumentParser):
+ * html/LegacyHTMLTreeConstructor.cpp:
+ (WebCore::LegacyHTMLTreeConstructor::reportErrorToConsole):
+ * html/LegacyHTMLTreeConstructor.h:
+ * loader/FTPDirectoryDocument.cpp:
+ (WebCore::FTPDirectoryDocumentParser::FTPDirectoryDocumentParser):
+ (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
+ (WebCore::FTPDirectoryDocumentParser::finish):
+ * page/XSSAuditor.h:
+
+2010-06-22 Shinichiro Hamaji <hamaji@chromium.org>
+
+ Unreviewed attempt to fix the windows build.
+
+ Split out HTML5DocumentParser yield/resume logic into a separate class
+ https://bugs.webkit.org/show_bug.cgi?id=41018
+
+ * WebCore.vcproj/WebCore.vcproj:
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Split out HTML5DocumentParser yield/resume logic into a separate class
+ https://bugs.webkit.org/show_bug.cgi?id=41018
+
+ The HTML5DocumentParser is just the coordinator, and shouldn't have
+ any real parsing logic of his own. Continuing along that path, I'm
+ moving the when-to-yield/resume logic out into a separate class.
+
+ I could have create a new HTMLParserSchedulerHost virtual interface
+ to allow the HTMLParserScheduler to talk back to the
+ HTML5DocumentParser, but instead I just exposed the one method it
+ needs (resumeParsing()) as a public method. Since no code besides
+ HTMLDocument (and DocumentFrament) ever should know about the
+ HTML5DocumentParser DocumentParser subclass, no class should ever
+ see the resumeParsing() method anyway.
+
+ Most of this change is just moving code from HTML5DocumentParser
+ to the new HTMLParserScheduler.
+
+ Some of this change is wrapping previous direct access to
+ m_continueNextChunkTimer.isActive() with isScheduledForResume().
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::HTML5DocumentParser):
+ (WebCore::HTML5DocumentParser::stopParsing):
+ (WebCore::HTML5DocumentParser::processingData):
+ (WebCore::HTML5DocumentParser::pumpLexerIfPossible):
+ (WebCore::HTML5DocumentParser::isScheduledForResume):
+ (WebCore::HTML5DocumentParser::resumeParsing):
+ (WebCore::HTML5DocumentParser::pumpLexer):
+ (WebCore::HTML5DocumentParser::end):
+ (WebCore::HTML5DocumentParser::attemptToEnd):
+ (WebCore::HTML5DocumentParser::endIfDelayed):
+ * html/HTML5DocumentParser.h:
+ (WebCore::HTML5DocumentParser::document):
+ - Exposed for HTMLParserScheduler.
+ * html/HTMLParserScheduler.cpp: Added.
+ (WebCore::parserTimeLimit): Moved from HTML5DocumentParser.
+ (WebCore::parserChunkSize): ditto.
+ (WebCore::HTMLParserScheduler::HTMLParserScheduler):
+ (WebCore::HTMLParserScheduler::~HTMLParserScheduler):
+ (WebCore::isLayoutTimerActive):
+ (WebCore::HTMLParserScheduler::continueNextChunkTimerFired):
+ - Moved from HTML5DocumentParser.
+ * html/HTMLParserScheduler.h: Added.
+ (WebCore::HTMLParserScheduler::PumpSession::PumpSession):
+ - Moved from HTML5DocumentParser.
+ (WebCore::HTMLParserScheduler::shouldContinueParsing):
+ (WebCore::HTMLParserScheduler::isScheduledForResume):
+
+2010-06-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: move nodeByPath from InjectedScript to InspectorBackend.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40988
+
+ * inspector/InjectedScriptHost.cpp:
+ * inspector/InjectedScriptHost.h:
+ * inspector/InjectedScriptHost.idl:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::pushNodeByPathToFrontend):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
+ (WebCore::InspectorDOMAgent::nodeForPath):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::didPushNodeByPathToFrontend):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/DOMAgent.js:
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.prototype.setDocument):
+ * inspector/front-end/InjectedScript.js:
+ * inspector/front-end/InjectedScriptAccess.js:
+
+2010-06-22 David Levin <levin@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ REGRESSION: (r47291): Upload progress events are not fired for simple cross-site XHR.
+ https://bugs.webkit.org/show_bug.cgi?id=39029
+
+ Specifically, WebKit should fire upload events if one or more event listeners are
+ registered on the XMLHttpRequestUpload object when send is called in an async manner.
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::createRequest): Allow upload events to be fired when there are
+ handlers for them in the cross-origin simple request case.
+
+2010-06-22 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Fix uninitialized SubframeLoader::m_containsPlugins
+ https://bugs.webkit.org/show_bug.cgi?id=41035
+
+ * loader/SubframeLoader.cpp:
+ (WebCore::SubframeLoader::SubframeLoader):
+ Initialize m_containsPlugins with false.
+
+2010-06-22 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add BlobBuilder.idl to expose BlobBuilder interface
+ https://bugs.webkit.org/show_bug.cgi?id=40593
+
+ (Resubmitting with the correct file set.)
+
+ BlobBuilder is defined in FileAPI's FileWriter spec.
+ (http://dev.w3.org/2009/dap/file-system/file-writer.html)
+
+ Also removes the ENABLE_FILE_WRITER ifdef guard for BlobBuilder.
+
+ Tests: http/tests/local/blob/send-data-blob.html
+ http/tests/local/blob/send-hybrid-blob.html
+ http/tests/local/blob/send-sliced-data-blob.html
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::append):
+ * html/BlobBuilder.h:
+ * html/BlobBuilder.idl: Added.
+ * page/DOMWindow.idl:
+
+2010-06-22 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed, build fix for r61648.
+
+ * platform/graphics/GraphicsContext3D.h:
+
+2010-06-22 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Define GraphicsContext3D::platformLayer() for all remaining (non PLATFORM(MAC))
+ ports to get RenderLayerBacking.cpp compiling again.
+ https://bugs.webkit.org/show_bug.cgi?id=41026
+
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::platformLayer):
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Rolling out http://trac.webkit.org/changeset/61638
+ made a few tests crash.
+
+ Make PendingScript hold a CachedResourceClient open for its lifetime
+ https://bugs.webkit.org/show_bug.cgi?id=40968
+
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::watchForLoad):
+ (WebCore::HTML5DocumentParser::notifyFinished):
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::HTML5ScriptRunner::~HTML5ScriptRunner):
+ (WebCore::HTML5ScriptRunner::sourceFromPendingScript):
+ (WebCore::HTML5ScriptRunner::isPendingScriptReady):
+ (WebCore::HTML5ScriptRunner::executePendingScript):
+ (WebCore::HTML5ScriptRunner::hasScriptsWaitingForLoad):
+ (WebCore::HTML5ScriptRunner::watchForLoad):
+ (WebCore::HTML5ScriptRunner::stopWatchingForLoad):
+ (WebCore::HTML5ScriptRunner::executeScriptsWaitingForLoad):
+ (WebCore::HTML5ScriptRunner::executeScriptsWaitingForStylesheets):
+ (WebCore::HTML5ScriptRunner::requestScript):
+ * html/HTML5ScriptRunner.h:
+ (WebCore::HTML5ScriptRunner::PendingScript::):
+ (WebCore::HTML5ScriptRunner::PendingScript::PendingScript):
+ (WebCore::HTML5ScriptRunner::PendingScript::watchingForLoad):
+ * html/HTML5ScriptRunnerHost.h:
+
+2010-06-22 Adele Peterson <adele@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix for Crash when the renderer for the button in <input type="number"> goes away during event handling
+ https://bugs.webkit.org/show_bug.cgi?id=41013
+
+ Test: fast/forms/input-number-crash.html
+
+ * rendering/TextControlInnerElements.cpp: (WebCore::SpinButtonElement::defaultEventHandler):
+ Nil check the RenderBox since its possible the renderer has gone away during event handling.
+
+2010-06-22 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Pull script line number from DocumentParser instead of pushing it to ScriptController
+ https://bugs.webkit.org/show_bug.cgi?id=40649
+
+ This approach is cleaner and improves WebCore/benchmarks/parser/html-parser.html by ~2%.
+
+ Tests: fast/js/script-line-number.html
+
+ * bindings/js/ScriptController.cpp:
+ (WebCore::ScriptController::ScriptController):
+ (WebCore::ScriptController::eventHandlerLineNumber):
+ * bindings/js/ScriptController.h:
+ * bindings/v8/ScriptController.cpp:
+ (WebCore::ScriptController::eventHandlerLineNumber):
+ (WebCore::ScriptController::eventHandlerColumnNumber):
+ * bindings/v8/ScriptController.h:
+ * bindings/v8/ScriptEventListener.cpp:
+ (WebCore::createAttributeEventListener):
+ * bindings/v8/V8Proxy.h:
+ * dom/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::startElementNs):
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::pumpLexer):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::processToken):
+
+2010-06-22 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Make PendingScript hold a CachedResourceClient open for its lifetime
+ https://bugs.webkit.org/show_bug.cgi?id=40968
+
+ This replaces the mechanism introduced in r61374 with a simpler
+ approach from preventing unexpected purges; always keep a client open.
+ This will approach will allow deferred scripts to add a client after
+ the resource may have already been loaded without having to worry about
+ the buffer being purged in the meantime.
+
+ No new tests because making a CachedResource purge itself is not
+ testable from a LayoutTest.
+
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::watchForLoad):
+ (WebCore::HTML5DocumentParser::notifyFinished):
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::HTML5ScriptRunner::~HTML5ScriptRunner):
+ (WebCore::HTML5ScriptRunner::sourceFromPendingScript):
+ (WebCore::HTML5ScriptRunner::isPendingScriptReady):
+ (WebCore::HTML5ScriptRunner::executePendingScript):
+ (WebCore::HTML5ScriptRunner::watchForLoad):
+ (WebCore::HTML5ScriptRunner::stopWatchingForLoad):
+ (WebCore::HTML5ScriptRunner::executeScriptsWaitingForLoad):
+ (WebCore::HTML5ScriptRunner::executeScriptsWaitingForStylesheets):
+ (WebCore::HTML5ScriptRunner::requestScript):
+ * html/HTML5ScriptRunner.h:
+ (WebCore::HTML5ScriptRunner::PendingScript::PendingScript):
+ (WebCore::HTML5ScriptRunner::PendingScript::~PendingScript):
+ (WebCore::HTML5ScriptRunner::PendingScript::setCachedScript):
+ (WebCore::HTML5ScriptRunner::PendingScript::cachedScript):
+ (WebCore::HTML5ScriptRunner::PendingScript::notifyFinished):
+ * html/HTML5ScriptRunnerHost.h:
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Fragment parsing needs to go through the HTML5 Parser code path
+ https://bugs.webkit.org/show_bug.cgi?id=40645
+
+ Added a new HTML5DocumentParser::parseHTMLDocumentFragment
+ codepath which optionally calls through to the old fragment
+ parsing path, now renamed parseLegacyHTMLDocumentFragment.
+
+ * dom/Element.cpp:
+ (WebCore::Element::createContextualFragment):
+ - Use document()->createDocumentFragment() instead
+ of DocumentFragment::create() to match other callers
+ (and not depend on DocumentFragment.h).
+ - Update call to parseHTMLDocumentFragment to use the new
+ HTML5 parser codepath.
+ * dom/MappedAttributeEntry.h:
+ - Add a FIXME about this horrible enum placement.
+ Sadly this will cause a world-rebuild for everyone.
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::HTML5DocumentParser):
+ (WebCore::HTML5DocumentParser::runScriptsForPausedTreeConstructor):
+ - The main pumpLexer function has gotten to large. Move the script
+ running logic into this new function.
+ - Handle the case where we have no m_scriptRunner (fragment case).
+ (WebCore::HTML5DocumentParser::pumpLexer):
+ - Use new runScriptsForPausedTreeConstructor().
+ (WebCore::HTML5DocumentParser::executingScript):
+ (WebCore::HTML5DocumentParser::inScriptExecution):
+ - New function to handle the case where m_scriptRunner is null.
+ (WebCore::HTML5DocumentParser::resumeParsingAfterScriptExecution):
+ - Use inScriptExecution() instead of m_scriptRunner->inScriptExecution().
+ (WebCore::HTML5DocumentParser::executeScript): ditto.
+ (WebCore::HTML5DocumentParser::notifyFinished): ditto.
+ (WebCore::HTML5DocumentParser::executeScriptsWaitingForStylesheets): ditto.
+ (WebCore::shouldUseLegacyParser):
+ - Helper function to check the html5ParserEnabled() setting.
+ (WebCore::HTML5DocumentParser::parseHTMLDocumentFragment):
+ - Run HTML5DocumentParser in fragment mode, or optionally run
+ the legacy parser if !html5ParserEnabled().
+ * html/HTML5DocumentParser.h:
+ * html/HTML5TreeBuilder.cpp:
+ (WebCore::HTML5TreeBuilder::HTML5TreeBuilder):
+ (WebCore::HTML5TreeBuilder::passTokenToLegacyParser):
+ - Implement the FragmentScriptingNotAllowed hack for platform/Pasteboard.
+ * html/HTML5TreeBuilder.h:
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::parseLegacyHTMLDocumentFragment):
+ - Renamed from parseHTMLDocumentFragment
+ * html/HTMLDocumentParser.h:
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::insertAdjacentHTML):
+ - Call HTML5DocumentParser::parseHTMLDocumentFragment.
+ * platform/mac/PasteboardMac.mm:
+ (WebCore::Pasteboard::documentFragment): ditto.
+ * xml/XSLTProcessor.cpp:
+ (WebCore::createFragmentFromSource): ditto.
+
+2010-06-22 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40643
+
+ Final phase of moving ownership of WebGLLayer to GraphicsContext3D.
+ As it turns out, I still have to have a separate CGLContextObj for
+ rendering because Core Animation composites in a separate thread,
+ so we need to disconnect WebGL rendering from CA compositing. But
+ this change is still worthwhile because it reduces dependencies
+ and makes it easier to port WebGL to other platforms.
+
+ No new tests since this is just restructuring and the current tests
+ are all still valid and do a sufficient test of WebGL functionality.
+
+ * platform/graphics/GraphicsContext3D.h:
+ (WebCore::GraphicsContext3D::platformLayer):
+ * platform/graphics/GraphicsLayer.h:
+ (WebCore::GraphicsLayer::setContentsToWebGL):
+ (WebCore::GraphicsLayer::setWebGLNeedsDisplay):
+ * platform/graphics/mac/GraphicsContext3DMac.mm: Add creation of WebGLLayer
+ (WebCore::GraphicsContext3D::GraphicsContext3D):
+ * platform/graphics/mac/GraphicsLayerCA.h:
+ (WebCore::GraphicsLayerCA::):
+ * platform/graphics/mac/GraphicsLayerCA.mm: Handle setting of WebGLLayer as content the same as for MediaLayer. Also changed WebGL related names for clarity
+ (WebCore::GraphicsLayerCA::GraphicsLayerCA):
+ (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+ (WebCore::GraphicsLayerCA::updateContentsWebGLLayer):
+ (WebCore::GraphicsLayerCA::setContentsToWebGL):
+ (WebCore::GraphicsLayerCA::setWebGLNeedsDisplay):
+ * platform/graphics/mac/WebGLLayer.h:
+ * platform/graphics/mac/WebGLLayer.mm: Got rid of storage for context and texture, now just store GraphicsContext3D and get them from there when needed
+ (-[WebGLLayer copyCGLPixelFormatForDisplayMask:]):
+ (-[WebGLLayer copyCGLContextForPixelFormat:]):
+ (-[WebGLLayer drawInCGLContext:pixelFormat:forLayerTime:displayTime:]):
+ (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
+ * rendering/RenderLayerBacking.cpp: Changed init of WebGL contentsLayer to pass WebGLLayer rather than GraphicsContext3D
+ (WebCore::RenderLayerBacking::updateGraphicsLayerConfiguration):
+ (WebCore::RenderLayerBacking::rendererContentChanged):
+
+2010-06-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ * html/HTMLTableCellElement.cpp:
+ (WebCore::HTMLTableCellElement::parseMappedAttribute): Removed incorrect FIXME comments.
+
+2010-06-22 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ <rdar://problem/8119403> REGRESSION (r61548): PLT is almost 1.5% slower, Google page cycler slower
+ https://bugs.webkit.org/show_bug.cgi?id=41012
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine): Removed a redundant statement that was
+ left over in the original patch and resulted in double the calls to RenderText::width() here.
+ (WebCore::RenderBlock::findNextLineBreak): Changed the order of evaluating conditions for a
+ potential speedup.
+
+2010-06-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Alexey asked me to take out the autorelease pools because he believes
+ that there is no code that should be running using Objective-C
+ autorelease. Most likely, the code that is triggering these stderr
+ messages is incorrect, and that bug should be fixed instead.
+
+ * workers/WorkerRunLoop.cpp:
+ (WebCore::WorkerRunLoop::run): Roll out use of AutodrainedPool.
+
+2010-06-22 Darin Adler <darin@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ Fix autorelease problem seen when running worker regression tests.
+ We were seeing logs to stderr saying autorelease was used without
+ an autorelease pool being set up.
+
+ * workers/WorkerRunLoop.cpp:
+ (WebCore::WorkerRunLoop::run): Use an AutodrainedPool as the file
+ thread, icon database, and database thread do. No effect on platforms
+ other than Mac.
+
+2010-06-22 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: If an element that is a continuation is removed, its parent tree is not notified appropriately that their children have changed
+ https://bugs.webkit.org/show_bug.cgi?id=41000
+
+ Test: accessibility/removed-continuation-element-causes-crash.html
+
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::updateChildrenIfNecessary):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::childrenChanged):
+ (WebCore::AccessibilityRenderObject::addChildren):
+ * accessibility/AccessibilityRenderObject.h:
+
+2010-06-22 Peter Kasting <pkasting@google.com>
+
+ Reviewed by Adam Barth.
+
+ Override setFailed() in each image decoder to clean up any temporary
+ objects.
+ https://bugs.webkit.org/show_bug.cgi?id=35411
+
+ In a few cases, we need to be careful to avoid deleting objects until
+ after they're no longer needed. These cases usually mean some jumping
+ through hoops, to the detriment of code simplicity.
+
+ No layout tests because this does not change the visible output of
+ decoding in any way.
+
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::ImageDecoder::setData):
+ * platform/image-decoders/bmp/BMPImageDecoder.cpp:
+ (WebCore::BMPImageDecoder::setFailed):
+ (WebCore::BMPImageDecoder::decode):
+ * platform/image-decoders/bmp/BMPImageDecoder.h:
+ * platform/image-decoders/bmp/BMPImageReader.cpp:
+ (WebCore::BMPImageReader::decodeBMP):
+ (WebCore::BMPImageReader::readInfoHeaderSize):
+ (WebCore::BMPImageReader::processInfoHeader):
+ (WebCore::BMPImageReader::readInfoHeader):
+ (WebCore::BMPImageReader::processBitmasks):
+ (WebCore::BMPImageReader::processColorTable):
+ (WebCore::BMPImageReader::processRLEData):
+ (WebCore::BMPImageReader::processNonRLEData):
+ * platform/image-decoders/bmp/BMPImageReader.h:
+ (WebCore::BMPImageReader::):
+ * platform/image-decoders/gif/GIFImageDecoder.cpp:
+ (WebCore::GIFImageDecoder::setFailed):
+ (WebCore::GIFImageDecoder::decode):
+ * platform/image-decoders/gif/GIFImageDecoder.h:
+ * platform/image-decoders/ico/ICOImageDecoder.cpp:
+ (WebCore::ICOImageDecoder::setFailed):
+ (WebCore::ICOImageDecoder::decode):
+ * platform/image-decoders/ico/ICOImageDecoder.h:
+ * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+ (WebCore::JPEGImageReader::decode):
+ (WebCore::JPEGImageDecoder::setFailed):
+ (WebCore::JPEGImageDecoder::decode):
+ * platform/image-decoders/jpeg/JPEGImageDecoder.h:
+ * platform/image-decoders/png/PNGImageDecoder.cpp:
+ (WebCore::PNGImageReader::decode):
+ (WebCore::PNGImageDecoder::PNGImageDecoder):
+ (WebCore::PNGImageDecoder::setFailed):
+ (WebCore::PNGImageDecoder::headerAvailable):
+ (WebCore::PNGImageDecoder::decode):
+ * platform/image-decoders/png/PNGImageDecoder.h:
+
+2010-06-04 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Remove side effects of form submission and prepare FormDataBuilder for splitting up.
+ https://bugs.webkit.org/show_bug.cgi?id=40184
+
+ Refactoring, covered by existing tests.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::prepareFormSubmission):
+ * Changed to use new accessors on FormDataBuilder;
+ * Simplified the logic around action URL;
+ * Removed form submission side effect of element's enctype property being updated when
+ submitting a mailto form;
+ * Removed unnecessary updating of action URL for mailto forms.
+ (WebCore::HTMLFormElement::submit): Moved action URL check into prepareFormSubmission.
+ (WebCore::HTMLFormElement::parseMappedAttribute): Updated to use new methods on FormDataBuilder.
+ * html/HTMLFormElement.h: Removed decls for isMailtoForm and dataEncoding methods;
+ moved m_target and m_url to FormDataBuilder.
+ * platform/network/FormData.cpp:
+ (WebCore::FormData::appendDOMFormData): Removed unnecessary instantiation of FormDataBuilder.
+ * platform/network/FormDataBuilder.cpp:
+ (WebCore::FormDataBuilder::parseAction): Moved from HTMLFormControl.
+ * platform/network/FormDataBuilder.h:
+ (WebCore::FormDataBuilder::action): Ditto.
+ (WebCore::FormDataBuilder::target): Ditto.
+ (WebCore::FormDataBuilder::setTarget): Ditto.
+
+2010-06-22 Yuta Kitamura <yutak@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix WebSocketHandshakeRequest so that it fits the new handshake protocol.
+
+ The new WebSocket specification (draft 76 and later) allows a browser to
+ send header fields in arbitrary order. Thus we can use a HTTPHeaderMap to
+ store header fields instead of Vector of pairs of a field name and
+ a field value.
+
+ This patch also does refactoring of WebSocketHandshakeRequest class
+ to make it simpler and easier to use.
+
+ Fix WebSocketHandshakeRequest so that it fits the new handshake protocol
+ https://bugs.webkit.org/show_bug.cgi?id=39864
+
+ No new tests, because there is no functional change.
+
+ * websockets/WebSocketHandshake.cpp:
+ (WebCore::WebSocketHandshake::clientHandshakeRequest):
+ * websockets/WebSocketHandshakeRequest.cpp:
+ (WebCore::WebSocketHandshakeRequest::Key3::Key3):
+ (WebCore::WebSocketHandshakeRequest::Key3::set):
+ (WebCore::WebSocketHandshakeRequest::WebSocketHandshakeRequest):
+ (WebCore::WebSocketHandshakeRequest::requestMethod):
+ (WebCore::WebSocketHandshakeRequest::url):
+ (WebCore::WebSocketHandshakeRequest::addHeaderField):
+ (WebCore::WebSocketHandshakeRequest::headerFields):
+ (WebCore::WebSocketHandshakeRequest::key3):
+ (WebCore::WebSocketHandshakeRequest::setKey3):
+ * websockets/WebSocketHandshakeRequest.h:
+
+2010-06-20 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ <meter> should be yellow when min < value < low < optimum
+ https://bugs.webkit.org/show_bug.cgi?id=40824
+
+ Fixed a wrong conditional on HTMLMeterElement::gaugeRegion().
+
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::gaugeRegion):
+
+ Tests: fast/dom/HTMLMeterElement/meter-appearances-capacity.html
+ fast/dom/HTMLMeterElement/meter-optimums.html
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Follow the HTML5 spec more closely w.r.t. when to save the insertion point
+ https://bugs.webkit.org/show_bug.cgi?id=40976
+
+ The spec always increments the nesting level and saves the insertion
+ point at the same time. In this patch, we now do those operations
+ packaged as a RAII.
+
+ As a side effect, the test case below no longer ASSERTs. (The output
+ is wrong, but we'll get to that next.)
+
+ Test: fast/tokenizer/write-on-load.html
+
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::NestScript::NestScript):
+ (WebCore::NestScript::~NestScript):
+ (WebCore::HTML5ScriptRunner::executePendingScript):
+ (WebCore::HTML5ScriptRunner::executeScript):
+ (WebCore::HTML5ScriptRunner::requestScript):
+ (WebCore::HTML5ScriptRunner::runScript):
+ * html/HTMLInputStream.h:
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Expose HTMLInputStream to ScriptRunner so that ScriptRunner can save the insertion point itself
+ https://bugs.webkit.org/show_bug.cgi?id=40975
+
+ This saves us having to call back into the HTML5DocumentParser each
+ time we need to save the insertion point. This prepares us for another
+ place we need to save the insertion point.
+
+ * html/HTML5DocumentParser.cpp:
+ * html/HTML5DocumentParser.h:
+ (WebCore::HTML5DocumentParser::inputStream):
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::HTML5ScriptRunner::executeScript):
+ (WebCore::HTML5ScriptRunner::requestScript):
+ * html/HTML5ScriptRunnerHost.h:
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Move HTMLInputStream to its own file
+ https://bugs.webkit.org/show_bug.cgi?id=40974
+
+ No new tests, just code motion.
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/HTML5DocumentParser.h:
+
+2010-06-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Save the insertion point before beforeload events
+ https://bugs.webkit.org/show_bug.cgi?id=40973
+
+ We need to save the insertion point before dispatching the beforeload
+ event in case someone decides to document.write during beforeload.
+ Prior to this patch, such writes would pump the lexer too much and
+ tokenize the rest of the document before executing the script.
+
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::dispatchBeforeLoad):
+ * html/HTML5DocumentParser.h:
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::HTML5ScriptRunner::requestScript):
+ * html/HTML5ScriptRunnerHost.h:
+
+2010-06-21 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ document.write from BeforeLoad should not assert
+ https://bugs.webkit.org/show_bug.cgi?id=40971
+
+ We're setting the parse blocking script too early. It's not actually
+ blocking parsing yet.
+
+ Test: fast/tokenizer/write-before-load.html
+
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::HTML5ScriptRunner::requestScript):
+
+2010-06-21 Chris Fleizach <cfleizach@apple.com>
+
+ No review. QT build fix again.
+
+ AX: VoiceOver does not announce WAI-ARIA state change of aria-expanded
+ https://bugs.webkit.org/show_bug.cgi?id=40927
+
+ * accessibility/AXObjectCache.h:
+ (WebCore::AXObjectCache::postNotification):
+
+2010-06-21 Chris Fleizach <cfleizach@apple.com>
+
+ No review. QT build fix.
+
+ AX: VoiceOver does not announce WAI-ARIA state change of aria-expanded
+ https://bugs.webkit.org/show_bug.cgi?id=40927
+
+ * accessibility/AXObjectCache.h:
+ (WebCore::AXObjectCache::postNotification):
+
+2010-06-21 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: VoiceOver does not announce WAI-ARIA state change of aria-expanded
+ https://bugs.webkit.org/show_bug.cgi?id=40927
+
+ Test: platform/mac/accessibility/aria-expanded-notifications.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::handleAriaExpandedChange):
+ * accessibility/AXObjectCache.h:
+ (WebCore::AXObjectCache::handleAriaExpandedChange):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::handleAriaExpandedChanged):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
+ * accessibility/AccessibilityRenderObject.h:
+ * accessibility/mac/AXObjectCacheMac.mm:
+ (WebCore::AXObjectCache::postPlatformNotification):
+ * dom/Element.cpp:
+ (WebCore::Element::updateAfterAttributeChanged):
+
+2010-06-21 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61585.
+ http://trac.webkit.org/changeset/61585
+ https://bugs.webkit.org/show_bug.cgi?id=40950
+
+ It broke builds (Requested by kinuko on #webkit).
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::appendString):
+ (WebCore::BlobBuilder::appendBlob):
+ * html/BlobBuilder.h:
+ * page/DOMWindow.idl:
+
+2010-06-21 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Add BlobBuilder.idl to expose BlobBuilder interface
+ https://bugs.webkit.org/show_bug.cgi?id=40593
+
+ BlobBuilder is defined in FileAPI's FileWriter spec.
+ (http://dev.w3.org/2009/dap/file-system/file-writer.html)
+
+ Also removes the ENABLE_FILE_WRITER ifdef guard for BlobBuilder.
+
+ Tests: http/tests/local/blob/send-data-blob.html
+ http/tests/local/blob/send-hybrid-blob.html
+ http/tests/local/blob/send-sliced-data-blob.html
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/BlobBuilder.cpp:
+ (WebCore::BlobBuilder::append):
+ * html/BlobBuilder.h:
+ * html/BlobBuilder.idl: Added.
+ * page/DOMWindow.idl:
+
+2010-06-21 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ FrameLoader cleanup: Split high level subframe and plugin
+ loading functions into a separate class.
+ https://bugs.webkit.org/show_bug.cgi?id=40453
+
+ Refactor only, no new tests.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.base.exp:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/DOMImplementation.cpp:
+ * history/PageCache.cpp:
+ * html/HTMLFrameElementBase.cpp:
+ * html/HTMLMediaElement.cpp:
+ * loader/FrameLoader.cpp:
+ * loader/FrameLoader.h:
+ (WebCore::FrameLoader::subframeLoader):
+ * loader/PluginDocument.cpp:
+ * loader/SubframeLoader.cpp: Added.
+ (WebCore::SubframeLoader::SubframeLoader):
+ (WebCore::toPlugInElement):
+ (WebCore::SubframeLoader::clear):
+ (WebCore::SubframeLoader::requestFrame):
+ (WebCore::SubframeLoader::requestObject):
+ (WebCore::FrameLoader::loadMediaPlayerProxyPlugin):
+ (WebCore::SubframeLoader::createJavaAppletWidget):
+ (WebCore::SubframeLoader::loadSubframe):
+ (WebCore::SubframeLoader::allowPlugins):
+ (WebCore::SubframeLoader::shouldUsePlugin):
+ (WebCore::SubframeLoader::loadPlugin):
+ (WebCore::SubframeLoader::completeURL):
+ * loader/SubframeLoader.h: Added.
+ (WebCore::SubframeLoader::containsPlugins):
+ * page/Page.cpp:
+ * page/XSSAuditor.h:
+ * platform/graphics/wince/MediaPlayerProxy.cpp:
+ * plugins/MimeType.cpp:
+ * rendering/RenderApplet.cpp:
+ * rendering/RenderEmbeddedObject.cpp:
+
+2010-06-21 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, build fix.
+
+ Bad merge, left a reference to m_committedFirstRealDocumentLoad in
+ http://trac.webkit.org/changeset/61568.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::transitionToCommitted):
+
+2010-06-21 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Remove a couple of FrameLoader's unused boolean members
+ (m_receivedData, m_cancellingWithLoadInProcess) and merge
+ several more into a single state machine called FrameLoaderStateMachine
+ (m_firstLayoutDone, m_creatingInitialEmptyDocument,
+ m_isDisplayingInitialEmptyDocument, m_committedFirstRealDocumentLoad).
+
+ https://bugs.webkit.org/show_bug.cgi?id=39695
+
+ Refactor only, so no new tests.
+
+ * WebCore.base.exp:
+ * WebCore.xcodeproj/project.pbxproj:
+ * loader/DocumentWriter.cpp:
+ (WebCore::DocumentWriter::createDocument):
+ (WebCore::DocumentWriter::begin):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::FrameLoader):
+ (WebCore::FrameLoader::init):
+ (WebCore::FrameLoader::stopLoading):
+ (WebCore::FrameLoader::didOpenURL):
+ (WebCore::FrameLoader::didExplicitOpen):
+ (WebCore::FrameLoader::clear):
+ (WebCore::FrameLoader::didBeginDocument):
+ (WebCore::FrameLoader::finishedParsing):
+ (WebCore::FrameLoader::provisionalLoadStarted):
+ (WebCore::FrameLoader::logCanCachePageDecision):
+ (WebCore::FrameLoader::logCanCacheFrameDecision):
+ (WebCore::FrameLoader::frameHasLoaded):
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ (WebCore::FrameLoader::transitionToCommitted):
+ (WebCore::FrameLoader::finishedLoadingDocument):
+ (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
+ (WebCore::FrameLoader::didFirstLayout):
+ (WebCore::FrameLoader::frameLoadCompleted):
+ (WebCore::FrameLoader::dispatchDidCommitLoad):
+ * loader/FrameLoader.h:
+ (WebCore::FrameLoader::stateMachine):
+ * loader/FrameLoaderStateMachine.cpp: Added.
+ * loader/FrameLoaderStateMachine.h: Added.
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::restoreScrollPositionAndViewState):
+ (WebCore::HistoryController::saveDocumentState):
+ * loader/ProgressTracker.cpp:
+ (WebCore::ProgressTracker::incrementProgress):
+ * loader/RedirectScheduler.cpp:
+ (WebCore::RedirectScheduler::scheduleLocationChange):
+ (WebCore::RedirectScheduler::scheduleFormSubmission):
+
+2010-06-21 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix. Fix header includes for ENABLE(DATABASE)
+
+ * bindings/js/JSExceptionBase.cpp:
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Fix clang++ build.
+
+ * loader/FormSubmission.h:
+
+2010-06-21 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, build fix.
+
+ Add a missing include in AsyncImageResizer.h
+
+ * html/AsyncImageResizer.h: Added the IntSize include.
+
+2010-06-21 Adam Roben <aroben@apple.com>
+
+ Call NotifyAddrChange again each time we are notified of a change
+
+ NotifyAddrChange only notifies you of a single change. If you want to
+ listen for subsequent changes, you have to call it again.
+
+ Fixes <http://webkit.org/b/33004> NetworkStateNotifier ignores all
+ state changes after the first.
+
+ No test possible, as we don't have a way to modify the system's
+ network adapters when running tests.
+
+ Reviewed by Anders Carlsson.
+
+ * platform/network/win/NetworkStateNotifierWin.cpp:
+ (WebCore::NetworkStateNotifier::addrChangeCallback): Call
+ registerForAddressChange as soon as we're notified of an address
+ change, so we'll also get notified of the *next* address change. I
+ added the call here instead of in addressChanged (which is called
+ later on the main thread) to minimize the time between the callback
+ and registering again (so that we won't miss changes that happen in
+ rapid succession).
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Release build fix
+
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::tryHyphenating):
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Windows build fix
+
+ * WebCore.vcproj/WebCore.vcproj: Fixed a typo.
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ CSS3: Implement the 'hyphens' and 'hyphenate-character' properties
+ https://bugs.webkit.org/show_bug.cgi?id=10228
+
+ Tests: fast/text/hyphenate-character.html
+ fast/text/hyphens.html
+
+ Added -webkit-hyphens and -webkit-hyphenate-character as specified in
+ <http://www.w3.org/TR/2010/WD-css3-gcpm-20100608/#hyphenation>.
+
+ * Android.mk: Added Hyphenation.cpp.
+ * CMakeLists.txt: Ditto.
+ * GNUmakefile.am: Added Hyphenation.{cpp,h}.
+ * WebCore.base.exp: Exported wkGetHyphenationLocationBeforeIndex().
+ * WebCore.gypi: Added Hyphenation.{cpp,h}.
+ * WebCore.pro: Added Hyphenation.{cpp,h}.
+ * WebCore.vcproj/WebCore.vcproj: Added Hyphenation.{cpp,h}.
+ * WebCore.xcodeproj/project.pbxproj: Added Hyphenation.{cpp,h}.
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Added the -webkit-hyphenate-character
+ and -webkit-hyphens cases.
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue): Validate values for the new properties.
+ * css/CSSPrimitiveValueMappings.h:
+ (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): Added. Maps from a Hyphens value to an identifier.
+ (WebCore::CSSPrimitiveValue::operator Hyphens): Added. Maps from an identifier to a Hyphens value.
+ * css/CSSPropertyNames.in: Added -webkit-hyphenate-character and -webkit-hyphens.
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty): Apply the new properties to the RenderStyle.
+ * css/CSSValueKeywords.in:
+ * platform/mac/WebCoreSystemInterface.h: Added wkGetHyphenationLocationBeforeIndex.
+ * platform/mac/WebCoreSystemInterface.mm: Ditto.
+ * platform/text/CharacterNames.h: Added the hyphen character.
+ * platform/text/Hyphenation.cpp: Added.
+ (WebCore::lastHyphenLocation): Added this default implementation for platforms that do not implement
+ hyphenation yet. It calls notImplemented() and returns 0.
+ * platform/text/Hyphenation.h: Added.
+ * platform/text/cf/HyphenationCF.cpp: Added.
+ (WebCore::lastHyphenLocation): Returns the last hyphenation location occurring in the given string before
+ the given index. Uses the current search locale (which is based on the top language preference of the user)
+ for hyphenation.
+ * platform/text/mac/HyphenationMac.mm: Added.
+ (WebCore::lastHyphenLocation): Returns the last hyphenation location occurring in the given string before
+ the given index. Returns 0 if the current search locale is not "en", because the platform only knows how to
+ hyphenate English.
+ * rendering/BidiRun.h:
+ (WebCore::BidiRun::BidiRun): Added a boolean member, m_hasHyphen, and initialized it to false in the constructor.
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::InlineBox): Renamed m_hasEllipsisBox to m_hasEllipsisBoxOrHyphen, because this bit is now
+ shared by two subclass: RootInlineBox uses it for hasEllipsisBox(), while InlineTextBox uses it for hasHyphen().
+ * rendering/InlineTextBox.cpp:
+ (WebCore::adjustCharactersAndLengthForHyphen): Added this helper function to get the hyphen string from the style
+ and return a UChar* and length for the concatenation of the given text with the hyphen string.
+ (WebCore::InlineTextBox::selectionRect): If the selected range touches the end and the box has a hyphen,
+ compute the width of the text with the hyphen string concatenated to it.
+ (WebCore::InlineTextBox::paint): If the box has a hyphen, draw the text with the hyphen string concatenated to it.
+ (WebCore::InlineTextBox::paintSelection): Similarly concatenate the hyphen string.
+ * rendering/InlineTextBox.h:
+ (WebCore::InlineTextBox::hasHyphen): Added this accessor.
+ (WebCore::InlineTextBox::setHasHyphen): Ditto.
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::constructLine): Copy the m_hasHyphen flag from the run to its text box.
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine): Add the width of the hyphen string when computing the
+ width of a box that has a hyphen.
+ (WebCore::RenderBlock::layoutInlineChildren): If the line was hyphenated, set the m_hasHyphen flag on the
+ logically last run.
+ (WebCore::tryHyphenating): Added this helper function which checks if a piece of text that does not fit on the
+ line could be hyphenated such that the part before the hyphen, including the hyphen, would fit. Given the amount
+ of space remaining on the line, it finds the longest prefix that can fit in the remaining space (which leaving room for
+ the hyphen), and then checks for a hyphenation location within that prefix.
+ (WebCore::RenderBlock::findNextLineBreak): In the 'hyphens: none' case, prevent line breaks at soft hyphens.
+ In the 'hyphens: auto' case, try hyphenating when a word will not fit in the remaining space on the line.
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::detachEllipsisBox): Changed to use hasEllipsisBox() and setHasEllipsisBox().
+ (WebCore::RootInlineBox::clearTruncation): Ditto.
+ (WebCore::RootInlineBox::placeEllipsis): Ditto.
+ (WebCore::RootInlineBox::paintEllipsisBox): Ditto.
+ (WebCore::RootInlineBox::nodeAtPoint): Ditto.
+ (WebCore::RootInlineBox::ellipsisBox): Ditto.
+ * rendering/RootInlineBox.h:
+ (WebCore::RootInlineBox::hasEllipsisBox): Added this accessor.
+ (WebCore::RootInlineBox::setHasEllipsisBox): Ditto.
+ * rendering/style/RenderStyle.cpp:
+ (WebCore::RenderStyle::diff): Return a layout hint if the hyphens setting or hyphenate-character differs.
+ (WebCore::RenderStyle::hyphenString): Added. For hyphenate-character: auto, returns the hyphen character.
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::hyphens): Added this accessor.
+ (WebCore::InheritedFlags::hyphenateCharacter): Ditto.
+ (WebCore::InheritedFlags::setHyphens): Ditto.
+ (WebCore::InheritedFlags::setHyphenateCharacter): Ditto.
+ (WebCore::InheritedFlags::initialHyphens): Added. Returns HyphensManual.
+ (WebCore::InheritedFlags::initialHyphenateCharacter): Added. Returns the null string, corresponding to
+ a value of 'auto'.
+ * rendering/style/RenderStyleConstants.h:
+ Added a Hyphens enum.
+ * rendering/style/StyleRareInheritedData.cpp:
+ (WebCore::StyleRareInheritedData::StyleRareInheritedData): Initialize and copy the new members.
+ (WebCore::StyleRareInheritedData::operator==): Compare the new members.
+ * rendering/style/StyleRareInheritedData.h: Added two new members: hyphens and hyphenateCharacter.
+
+2010-06-03 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Plumb FormSubmission through to ScheduledFormSubmission.
+ https://bugs.webkit.org/show_bug.cgi?id=40137
+
+ No behavior change, covered by existing tests.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::prepareFormSubmission): Moved creation of action URL
+ instance here from FrameLoader::submit, because it makes more sense here,
+ also added a FIXME to investigate existing code later.
+ * loader/FormSubmission.cpp:
+ (WebCore::FormSubmission::FormSubmission): Changed action to be a KURL, not a String.
+ (WebCore::FormSubmission::create): Ditto.
+ (WebCore::FormSubmission::populateFrameLoadRequest): Added, moving the logic from
+ FrameLoader::submit closer to the data.
+ * loader/FormSubmission.h:
+ (WebCore::FormSubmission::action): Changed type to KURL.
+ (WebCore::FormSubmission::clearTarget): Added.
+ (WebCore::FormSubmission::referrer): Added.
+ (WebCore::FormSubmission::setReferrer): Added.
+ (WebCore::FormSubmission::origin): Added.
+ (WebCore::FormSubmission::setOrigin): Added.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::submitForm): Cleaned up to make it more about decision-making,
+ not data manipulation.
+ * loader/RedirectScheduler.cpp:
+ (WebCore::ScheduledFormSubmission::ScheduledFormSubmission): Changed to accept FormSubmission as argument.
+ (WebCore::ScheduledFormSubmission::fire): Changed to use FormSubmission.
+ (WebCore::RedirectScheduler::scheduleFormSubmission): Removed assert that no longer makes sense,
+ changed to use FormSubmission.
+ * loader/RedirectScheduler.h: Updated ScheduledFormSubmission decl to hold FormSubmission ref.
+
+2010-06-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
+
+ No new tests are needed, because there is no new functionality.
+
+ * Configurations/FeatureDefines.xcconfig:
+ * GNUmakefile.am:
+ * WebCore.pri:
+
+2010-06-21 Hans Wennborg <hans@chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ Delete DOM storage databases when they are empty.
+ https://bugs.webkit.org/show_bug.cgi?id=40767
+
+ Even if a page clears its local storage, the database file for it stays around,
+ and there is currently no mechanism that deletes them.
+
+ After doing the "final sync" of a storage area, the StorageAreaSyncMaster should
+ see if the database is empty, and in that case delete it.
+
+ Tests:
+ manual-tests/localstorage-empty-database.html
+
+ * manual-tests/localstorage-empty-database.html:
+ Added link to clear local storage for testing that the file is removed.
+ * storage/LocalStorageTask.cpp:
+ (WebCore::LocalStorageTask::LocalStorageTask):
+ Added local storage task type DeleteEmptyDatabase.
+ (WebCore::LocalStorageTask::performTask):
+ Ditto.
+ * storage/LocalStorageTask.h:
+ (WebCore::LocalStorageTask::):
+ Ditto.
+ (WebCore::LocalStorageTask::createDeleteEmptyDatabase):
+ Ditto.
+ * storage/StorageAreaSync.cpp:
+ (WebCore::StorageAreaSync::scheduleFinalSync):
+ When scheduling final sync, also schedule DeleteEmptyDatabase.
+ (WebCore::StorageAreaSync::sync):
+ Return early if final sync has nothing to sync.
+ (WebCore::StorageAreaSync::deleteEmptyDatabase):
+ Added function to check if a database is empty and in that case delete it.
+ * storage/StorageAreaSync.h:
+ Ditto.
+ * storage/StorageSyncManager.cpp:
+ (WebCore::StorageSyncManager::scheduleDeleteEmptyDatabase):
+ Added function for scheduling DeleteEmptyDatabase task.
+ * storage/StorageSyncManager.h:
+ Ditto.
+
+2010-06-21 Balazs Kelemen <kb@inf.u-szeged.hu>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Avoid unnecessary image conversion in RGBA32Buffer::zeroFill()
+ https://bugs.webkit.org/show_bug.cgi?id=40910
+
+ * platform/image-decoders/qt/RGBA32BufferQt.cpp:
+ (WebCore::RGBA32Buffer::zeroFill):
+
+2010-06-21 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Decode images directly to QPixmap
+ https://bugs.webkit.org/show_bug.cgi?id=40797
+
+ Decode images to QPixmap directly instead of QImage when possible.
+ RGBA32Buffer transforms the pixmap back to image if
+ necessary.
+
+ This improve the performance with certain graphic system, and
+ can reduce memory usage.
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::setData):
+ (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+ * platform/image-decoders/ImageDecoder.h:
+ (WebCore::RGBA32Buffer::getAddr):
+ * platform/image-decoders/qt/RGBA32BufferQt.cpp:
+ (WebCore::RGBA32Buffer::clear):
+ (WebCore::RGBA32Buffer::zeroFill):
+ (WebCore::RGBA32Buffer::copyBitmapData):
+ (WebCore::RGBA32Buffer::setSize):
+ (WebCore::RGBA32Buffer::asNewNativeImage):
+ (WebCore::RGBA32Buffer::setPixmap):
+
+2010-06-20 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Adding the SQLException class which will be used to report sync DB errors.
+ https://bugs.webkit.org/show_bug.cgi?id=40607
+
+ * Android.derived.jscbindings.mk:
+ * Android.derived.v8bindings.mk:
+ * CMakeLists.txt:
+ * DerivedSources.cpp:
+ * DerivedSources.make:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pri:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSDOMBinding.cpp:
+ (WebCore::setDOMException):
+ * bindings/js/JSExceptionBase.cpp:
+ (WebCore::toExceptionBase):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::setDOMException):
+ * bindings/v8/V8Proxy.h:
+ * dom/ExceptionCode.cpp:
+ (WebCore::):
+ (WebCore::getExceptionCodeDescription):
+ * dom/ExceptionCode.h:
+ (WebCore::):
+ * page/DOMWindow.idl:
+ * storage/SQLException.h: Added.
+ (WebCore::SQLException::create):
+ (WebCore::SQLException::):
+ (WebCore::SQLException::SQLException):
+ * storage/SQLException.idl: Added.
+
+2010-06-20 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [v8] Web Inspector: don't add ScriptDebugServer as v8 listener if browser exposes
+ v8 debugging protocol.
+ https://bugs.webkit.org/show_bug.cgi?id=40844
+
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::ScriptDebugServer):
+ (WebCore::ScriptDebugServer::addListener):
+ (WebCore::ScriptDebugServer::setEnabled):
+ (WebCore::ScriptDebugServer::isDebuggerAlwaysEnabled):
+ * bindings/v8/ScriptDebugServer.h:
+
+2010-06-20 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Unreviewed build fix.
+
+ [EFL] Build break for r61527
+ https://bugs.webkit.org/post_bug.cgi
+
+ * CMakeLists.txt: Add loader/FormSubmission.cpp
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Remove bogus const qualifiers.
+
+ * platform/mac/PasteboardHelper.h:
+
+2010-06-20 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by Kent Tamura.
+
+ Buildfix for NotificationCenter.h.
+ https://bugs.webkit.org/show_bug.cgi?id=40890
+
+ ScriptExecutionContext::completeURL is used in header,
+ but ScriptExecutionContext.h wasn't included.
+
+ * notifications/NotificationCenter.h:
+
+2010-06-20 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Recognize async attribute on HTML script tags.
+ https://bugs.webkit.org/show_bug.cgi?id=39026
+
+ This does not implement async behavior, it only parses the async
+ attribute for HTML script tags. SVG script tags continue to not
+ support the async attribute.
+
+ Tests: fast/dom/HTMLScriptElement/script-async-attr.html
+ svg/dom/SVGScriptElement/script-async-attr.svg
+
+ * dom/ScriptElement.cpp:
+ (WebCore::ScriptElementData::isAsynchronous):
+ (WebCore::ScriptElementData::isDeferred):
+ * dom/ScriptElement.h:
+ * html/HTMLAttributeNames.in:
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::async):
+ (WebCore::HTMLScriptElement::setAsync):
+ (WebCore::HTMLScriptElement::defer):
+ (WebCore::HTMLScriptElement::asyncAttributeValue):
+ (WebCore::HTMLScriptElement::deferAttributeValue):
+ * html/HTMLScriptElement.h:
+ * html/HTMLScriptElement.idl:
+ * svg/SVGScriptElement.cpp:
+ (WebCore::SVGScriptElement::asyncAttributeValue):
+ (WebCore::SVGScriptElement::deferAttributeValue):
+ * svg/SVGScriptElement.h:
+
+2010-06-20 Nikita Vasilyev <me@elv1s.ru>
+
+ Reviewed by Joseph Pecoraro.
+
+ Web Inspector: Auto-completion for CSS property names in Styles pane
+ https://bugs.webkit.org/show_bug.cgi?id=17374
+
+ Added autocompletion for CSS properties. A suggestion for a property
+ shows when you type. You can also cycle through known property names
+ using the Up and Down arrow keys.
+
+ * WebCore.gypi:
+ * inspector/front-end/CSSCompletions.js: Added.
+ (WebInspector.CSSCompletions):
+ (WebInspector.CSSCompletions.startsWith):
+ (WebInspector.CSSCompletions.firstStartsWith):
+ (WebInspector.CSSCompletions._firstIndexOfPrefix):
+ (WebInspector.CSSCompletions.next):
+ (WebInspector.CSSCompletions.previous):
+ (WebInspector.CSSCompletions._closest):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertyTreeElement.prototype):
+ * inspector/front-end/WebKit.qrc:
+ * inspector/front-end/inspector.html:
+ * inspector/front-end/utilities.js:
+ (Text.prototype.select):
+ ():
+
+2010-06-14 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Introduce FormSubmission, the structure representing a form submission.
+ https://bugs.webkit.org/show_bug.cgi?id=40084
+
+ No change in functionality, covered by existing tests.
+
+ * GNUmakefile.am: Added FormSubmission.h/cpp.
+ * WebCore.gypi: Ditto.
+ * WebCore.pro: Ditto.
+ * WebCore.vcproj/WebCore.vcproj: Ditto.
+ * WebCore.xcodeproj/project.pbxproj: Ditto.
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::prepareFormSubmission): Renamed prepareFormData to prepareFormSubmission,
+ added code for populating a FormSubmission instance, moved the loop of accumulating text input
+ values into this functions (it belongs here logically).
+ (WebCore::HTMLFormElement::submit): Modified to use prepareFormSubmission.
+ * html/HTMLFormElement.h:
+ * loader/FormSubmission.cpp: Added.
+ * loader/FormSubmission.h: Added.
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::submitForm): Modified to use FormSubmission. Stopped plumbing further to keep
+ the patch size down.
+ * loader/FrameLoader.h: Modified submitForm signature.
+
+2010-06-20 Joseph Pecoraro <joepeck@webkit.org>
+
+ Unreviewed rollout r61506, because it made 1 test crash.
+
+ Causes crash. Will approach the solution in a different way.
+
+2010-06-20 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Timothy Hatcher.
+
+ Web Inspector: Should Autocomplete Style Properties
+ https://bugs.webkit.org/show_bug.cgi?id=38448
+
+ This Autocompletes style properties when in the console.
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+
+2010-06-20 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] NPP_SetWindow seems to not be called when TestNetscapePlugin is moved
+
+ https://bugs.webkit.org/show_bug.cgi?id=36702
+
+ setNPWindowIfNeeded() is called on paint() in PluginViewQt, which doesn't
+ work for DRT. So call it if we are in DRT mode and the window geometry
+ has changed.
+
+ Unskips plugins/reentrant-update-widget-positions.html
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+
+2010-06-19 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Persist V8's ScriptData to the memory cache.
+ https://bugs.webkit.org/show_bug.cgi?id=38661
+
+ This stores V8's ScriptData in the memory cache and also causes the
+ network platform layer to be notified of the available cacheable
+ metadata.
+
+ Chromium's morejs benchmark showed a ~7% improvement when this was
+ originally submitted (before it had to be rolled back).
+
+ Test: fast/js/parser-high-byte-character.html
+
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ (WebCore::ScriptSourceCode::cachedScript):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::precompileScript):
+ (WebCore::V8Proxy::evaluate):
+ * bindings/v8/V8Proxy.h:
+
+2010-06-19 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Port SocketStream
+ https://bugs.webkit.org/show_bug.cgi?id=39671
+
+ Port SocketStream with BREW MP's ISocket interface.
+
+ * platform/network/brew/SocketStreamError.h: Added.
+ (WebCore::SocketStreamError::SocketStreamError):
+ * platform/network/brew/SocketStreamHandle.h: Added.
+ (WebCore::SocketStreamHandle::create):
+ * platform/network/brew/SocketStreamHandleBrew.cpp: Added.
+ (WebCore::socketStreamConnectCallback):
+ (WebCore::getHostByNameCallback):
+ (WebCore::socketReadableCallback):
+ (WebCore::networkManager):
+ (WebCore::SocketStreamHandlePrivate::SocketStreamHandlePrivate):
+ (WebCore::SocketStreamHandlePrivate::~SocketStreamHandlePrivate):
+ (WebCore::SocketStreamHandlePrivate::socketConnected):
+ (WebCore::SocketStreamHandlePrivate::socketReadyRead):
+ (WebCore::SocketStreamHandlePrivate::connect):
+ (WebCore::SocketStreamHandlePrivate::send):
+ (WebCore::SocketStreamHandlePrivate::close):
+ (WebCore::SocketStreamHandlePrivate::socketClosed):
+ (WebCore::SocketStreamHandlePrivate::socketError):
+ (WebCore::SocketStreamHandle::SocketStreamHandle):
+ (WebCore::SocketStreamHandle::~SocketStreamHandle):
+ (WebCore::SocketStreamHandle::platformSend):
+ (WebCore::SocketStreamHandle::platformClose):
+ (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge):
+ (WebCore::SocketStreamHandle::receivedCredential):
+ (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential):
+ (WebCore::SocketStreamHandle::receivedCancellation):
+ * platform/network/brew/SocketStreamHandlePrivate.h: Added.
+
+2010-06-19 Nikita Vasilyev <me@elv1s.ru>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: Prevent from copying "filename.css" in Styles pane
+ https://bugs.webkit.org/show_bug.cgi?id=40420
+
+ * inspector/front-end/Section.js:
+ (WebInspector.Section.prototype.set subtitle):
+ (WebInspector.Section.prototype.get subtitleAsText):
+ * inspector/front-end/StylesSidebarPane.js:
+ (WebInspector.StylePropertiesSection):
+ * inspector/front-end/inspector.css:
+ (.styles-section .subtitle::before, .styles-section .subtitle a::before):
+
+2010-06-19 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Darin Adler.
+
+ A fix for a change in https://bugs.webkit.org/show_bug.cgi?id=39941
+ that caused a compile error in MathML.
+ https://bugs.webkit.org/show_bug.cgi?id=40827
+
+ * mathml/MathMLElement.cpp:
+ (WebCore::MathMLElement::MathMLElement):
+
+2010-06-19 Kartikaya Gupta <kagupta@rim.com>
+
+ Reviewed by Nikolas Zimmermann.
+
+ CPP bindings missing some APIs
+ https://bugs.webkit.org/show_bug.cgi?id=40570
+
+ Add missing C++ DOM API bindings. Specifically:
+ - NodeFilter callback support
+ - Missing custom method implementations in HTMLCollection and HTMLOptionsCollection
+ - Missing EventTarget static type-determination methods
+ - Fix CPP binding generator to not generate d-ptrs for classes that extend EventTarget and just use the parent's d-ptr instead
+ - Switch binding generator to use DOMWindow instead of AbstractView so that necessary W3C-defined methods (e.g. getComputedStyle) are accessible.
+
+ * bindings/cpp/WebDOMDOMWindowCustom.cpp: Added.
+ (WebDOMDOMWindow::addEventListener):
+ (WebDOMDOMWindow::removeEventListener):
+ * bindings/cpp/WebDOMEventTarget.cpp:
+ (toWebKit):
+ * bindings/cpp/WebDOMEventTarget.h:
+ * bindings/cpp/WebDOMHTMLCollectionCustom.cpp: Added.
+ (WebDOMHTMLCollection::item):
+ (WebDOMHTMLCollection::namedItem):
+ * bindings/cpp/WebDOMHTMLOptionsCollectionCustom.cpp: Added.
+ (WebDOMHTMLOptionsCollection::length):
+ (WebDOMHTMLOptionsCollection::setLength):
+ * bindings/cpp/WebDOMNodeFilterCustom.cpp: Added.
+ (WebDOMNodeFilter::acceptNode):
+ (toWebKit):
+ * bindings/cpp/WebNativeNodeFilterCondition.cpp: Added.
+ (WebNativeNodeFilterCondition::WebNativeNodeFilterCondition):
+ (WebNativeNodeFilterCondition::~WebNativeNodeFilterCondition):
+ (WebNativeNodeFilterCondition::acceptNode):
+ * bindings/cpp/WebNativeNodeFilterCondition.h: Added.
+ (WebNativeNodeFilterCondition::create):
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * dom/NodeFilter.idl:
+ * page/DOMWindow.idl:
+
+2010-06-19 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [chromium] Adding a conditional gyp dependency for the WebCore target to
+ the gles2_c_lib which is required by the gpu compositor. The dependency will
+ only kick in if the accelerated_compositing path is enabled.
+ https://bugs.webkit.org/show_bug.cgi?id=40801
+
+ * WebCore.gyp/WebCore.gyp:
+
+2010-06-19 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Platform plugin's multi-select does not take OptGroup into account
+ https://bugs.webkit.org/show_bug.cgi?id=40718
+
+ In multi-select elements, optgroup elements are counted in the index calculation,
+ but in single-select they are not. Keep the same logic even when NO_LISTBOX_RENDERING
+ is enabled.
+ Added tests to the existing manual test, as testing this requires a special build, in which
+ NO_LISTBOX_RENDERING is enabled.
+
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::listBoxSelectItem):
+ * manual-tests/no-listbox-rendering.html:
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::listBoxSelectItem):
+
+2010-06-19 Thomas Van Lenten <thomasvl@chromium.org>
+
+ Reviewed by David Levin.
+
+ Warnings from -Wextra in a Chromium Mac build
+ 1. checks of unsigned >= 0
+ 2. enumeral and non-enumeral type in conditional expression
+ 3. copy ctors that don't call the super copy ctor or ctor
+ No functionality change so no new tests.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40791
+
+ * platform/chromium/ChromiumDataObject.cpp:
+ (WebCore::ChromiumDataObject::ChromiumDataObject):
+ * platform/chromium/ThemeChromiumMac.mm:
+ (WebCore::updateStates):
+ * rendering/RenderThemeChromiumMac.mm:
+ (WebCore::RenderThemeChromiumMac::updateActiveState):
+
+2010-06-19 Ben Murdoch <benm@google.com>
+
+ Reviewed by Pavel Feldman.
+
+ Fix build break with inspector disabled.
+ https://bugs.webkit.org/show_bug.cgi?id=40790
+
+ Replace a #include with a forward declaration.
+
+ Fixing a build break so no new tests required.
+
+ * inspector/InspectorController.h: Forward declare InspectorValue
+ rather than #including its header which has its content guarded
+ out.
+
+2010-06-19 Zhe Su <suzhe@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium]Refactor input method related APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=40608
+
+ No new tests are needed, because there is no new functionality.
+
+ * page/FocusController.cpp:
+ (WebCore::FocusController::setFocusedNode):
+
+2010-06-19 George Wright <gwright@rim.com>
+
+ Reviewed by George Staikos.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40720
+
+ Make setWapInputFormat() public again as CSSStyleSelector.cpp calls this when WCSS is enabled.
+
+ * html/HTMLInputElement.h:
+ (WebCore::HTMLInputElement::data):
+
+2010-06-02 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Support evaluateScriptInIsolatedWorld()
+
+ https://bugs.webkit.org/show_bug.cgi?id=40079
+
+ getOwnPropertyNames() crashes if PropertyNameArray is size 0. This change allows
+ http/tests/world-reuse.html and didClearWindowObject.html to fail instead of crash.
+
+ * WebCore.pro: Add qwebscriptworld.*
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2010-06-19 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Some very minor cleanups for HTML5 Parser
+ https://bugs.webkit.org/show_bug.cgi?id=40638
+
+ No new tests because no new functionality.
+
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::): Make ctor explicit.
+ * html/HTML5DocumentParser.h:
+ (WebCore::HTML5DocumentParser::InsertionPointRecord::InsertionPointRecord): Make ctor explicit.
+ * html/HTML5Lexer.cpp:
+ (WebCore::HTMLNames::isEndTagBufferingState): Use switch to generate an efficient table with single branch.
+ * html/HTML5Token.h:
+ (WebCore::HTML5Token::forceQuirks): Add const.
+ * html/HTML5TreeBuilder.h:
+ (WebCore::HTML5TreeBuilder::isPaused): Add const.
+
+2010-06-18 Aaron Boodman <aa@chromium.org>
+
+ Remove WebKit::WebDocument::isXHTMLDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=40815
+
+ * dom/Document.h: remove isXHTML() getter.
+
+2010-06-19 Aaron Boodman <aa@chromium.org>
+
+ Unreviewed, rolling out r61466.
+ http://trac.webkit.org/changeset/61466
+ https://bugs.webkit.org/show_bug.cgi?id=40816
+
+ Landed wrong change
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::initContextIfNeeded):
+ * bindings/v8/V8DOMWindowShell.h:
+
+2010-06-18 Aaron Boodman <aa@chromium.org>
+
+ WebKit API: Undo static hooks into V8 when WebKit is shut down.
+ https://bugs.webkit.org/show_bug.cgi?id=40816
+
+ * bindings/v8/V8DOMWindowShell.cpp:
+ (WebCore::V8DOMWindowShell::initContextIfNeeded):
+ (WebCore::V8DOMWindowShell::initializeV8IfNeeded):
+ (WebCore::V8DOMWindowShell::uninitializeV8IfNeeded):
+ * bindings/v8/V8DOMWindowShell.h:
+
+2010-06-18 Jessie Berlin <jberlin@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Bug 19509 - Database Tables in the Inspector should be sortable
+ https://bugs.webkit.org/show_bug.cgi?id=19509
+
+ * inspector/front-end/StoragePanel.js:
+ (WebInspector.StoragePanel.prototype.dataGridForResult):
+ Make each column in the DataGrid sortable.
+ (WebInspector.StoragePanel.prototype._sortDataGrid.comparator):
+ Make sure to sort numeric columns by their numeric values, instead of lexicographically.
+ (WebInspector.StoragePanel.prototype._sortDataGrid):
+ Sort the entries in the DataGrid based on the selected column.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ More clang++ warning fixes.
+
+ * inspector/InspectorFrontendClientLocal.cpp:
+ (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
+ * platform/graphics/mac/FontPlatformData.h:
+ * platform/graphics/mac/WebLayer.mm:
+ (-[CALayer _descriptionWithPrefix:]):
+
+2010-06-18 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, build fix.
+
+ * WebCore.gyp/WebCore.gyp: Modified inclusion rule in to actually add WebSystemInterface.mm.
+
+2010-06-18 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, build fix.
+
+ * WebCore.gyp/WebCore.gyp: Renamed WebSystemInterface.m to WebSystemInterface.mm.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Make WebCoreSystemInterface.h a C++ only header
+ https://bugs.webkit.org/show_bug.cgi?id=40867
+
+ * platform/mac/WebCoreSystemInterface.h:
+
+2010-06-18 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Convert column span from an unsigned short type to an unsigned int
+ type. Fixes a divide-by-zero crash arising from using a zero colspan
+ value coming from a narrow cast of an int to an unsigned short.
+ https://bugs.webkit.org/show_bug.cgi?id=40812
+
+ Test: fast/table/zero-colspan-crash.html
+
+ * rendering/RenderTable.h: Change span from unsigned short to unsigned int.
+ * rendering/RenderTableSection.cpp: Fix a compiler warning with comparing
+ unsigned int with signed int. Value of an unsigned int here cannot be
+ greater than maximum positive value of a signed int.
+ (WebCore::RenderTableSection::addCell):
+
+2010-06-18 Ananth Jasty <ext-ananth.jasty@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Text spacing miscalculation when using wordSpacing.
+ https://bugs.webkit.org/show_bug.cgi?id=40483
+
+ Removed wordSpacing compensation in FontQt whitespace width
+ calculation. The QFontMetrics::width() overload that takes
+ a character does not take QFont's word spacing into account.
+
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::Font::floatWidthForComplexText):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Get rid of PluginDataMac.mm and use the plug-in strategy instead
+ https://bugs.webkit.org/show_bug.cgi?id=40860
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * page/mac/WebCoreViewFactory.h:
+ * plugins/PluginData.cpp:
+ (WebCore::PluginData::refresh):
+ (WebCore::PluginData::initPlugins):
+ * plugins/PluginStrategy.h:
+ * plugins/mac/PluginDataMac.mm: Removed.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix some (not all) clang++ warnings.
+
+ * dom/Position.h:
+ (WebCore::lastOffsetInNode):
+ * editing/CompositeEditCommand.cpp:
+ (WebCore::CompositeEditCommand::deleteInsignificantText):
+ * loader/appcache/ApplicationCache.cpp:
+ (WebCore::ApplicationCache::resourceForRequest):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::offsetForPosition):
+ (WebCore::ComplexTextController::collectComplexTextRuns):
+ * platform/network/CredentialStorage.cpp:
+ (WebCore::protectionSpaceMapKeyFromURL):
+ * rendering/style/StyleRareNonInheritedData.h:
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add stubbed out WebPlatformStrategies class to WebKit.
+ https://bugs.webkit.org/show_bug.cgi?id=40851
+
+ * WebCore.base.exp:
+ * platform/PlatformStrategies.cpp:
+ * platform/PlatformStrategies.h:
+ (WebCore::PlatformStrategies::~PlatformStrategies):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Fix build errors when building with clang++.
+
+ * loader/archive/cf/LegacyWebArchiveMac.mm:
+ Move the const qualifier to the right place.
+
+ * page/EditorClient.h:
+ * platform/Pasteboard.h:
+ Use @class when forward declaring Objective-C classes in Objective-C.
+
+2010-06-18 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Geoff Garen.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40852
+ <rdar://problem/8105498> Limit simultaneous DNS prefetch request number (40852)
+
+ No change in functionality, so no tests.
+
+ We still queue up to 64 names, but only make up to 8 requests at once. If there are names
+ remaining in queue, we retry after a short timeout (which is easier than posting
+ notifications from client callback).
+
+ * platform/network/cf/DNSCFNet.cpp:
+ (WebCore::DNSResolveQueue::add):
+ (WebCore::DNSResolveQueue::fired):
+
+2010-06-18 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Simon Fraser.
+
+ WebGL demos show bad flicker
+ https://bugs.webkit.org/show_bug.cgi?id=38560
+
+ * platform/graphics/mac/GraphicsContext3DMac.mm:
+ (WebCore::GraphicsContext3D::prepareTexture): Move ensureContext() out of if-block so it's always executed.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add PlatformStrategies and PluginStrategy classes.
+ https://bugs.webkit.org/show_bug.cgi?id=40850
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/PlatformStrategies.cpp: Added.
+ (WebCore::PlatformStrategies::~PlatformStrategies):
+ (WebCore::platformStrategies):
+ (WebCore::setPlatformStrategies):
+ * platform/PlatformStrategies.h: Added.
+ (WebCore::PlatformStrategies::pluginStrategy):
+ (WebCore::PlatformStrategies::PlatformStrategies):
+ * plugins/PluginData.cpp:
+ * plugins/PluginStrategy.h: Added.
+ (WebCore::PluginStrategy::~PluginStrategy):
+
+2010-06-18 Martin Robinson <mrobinson@igalia.com>
+
+ Unreviewed.
+
+ Fix the GTK+ build after r61413 and 61379.
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ Produce a g_value_set that uses getterExpressionPrefix instead of the raw getter.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_get_property): Update expected test results.
+
+2010-06-18 Leandro Pereira <leandro@profusion.mobi>
+
+ [EFL] Unreviewed build fix.
+
+ * CMakeLists.txt: Add inspector/ScriptBreakpoint.cpp.
+
+2010-06-18 Andy Estes <aestes@apple.com>
+
+ Rubber-stamped by Sam Weinig.
+
+ Update copyright header.
+
+ * html/HTMLLinkElement.h:
+
+2010-06-17 Andy Estes <aestes@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/8091385> Prevent a crash in WebCore when removing a stylesheet link element in
+ in a listener to its beforeload event.
+ https://bugs.webkit.org/show_bug.cgi?id=40742
+
+ Postpone loading of link elements until after they have been inserted into the DOM and
+ attached. This prevents DOM mutations triggered by beforeload handlers from firing in the
+ midst of DOM insertion, which can lead to assertion failures and crashes.
+
+ Test: fast/dom/beforeload/remove-link-in-beforeload-listener.html
+
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::HTMLLinkElement): Initialize m_shouldProcessAfterAttach to false.
+ (WebCore::HTMLLinkElement::processCallback): Add a static callback function which calls
+ HTMLLinkElement::process().
+ (WebCore::HTMLLinkElement::insertedIntoDocument): Instead of calling process() directly, set
+ m_shouldProcessAfterAttach to true to indicate that process() should be called after attach().
+ (WebCore::HTMLLinkElement::removedFromDocument): Set m_shouldProcessAfterAttach to false.
+ (WebCore::HTMLLinkElement::attach): If m_shouldProcessAfterAttach is true, register
+ HTMLLinkElement::processCallback() as a post-attach callback.
+ * html/HTMLLinkElement.h: Add m_shouldProcessAfterAttach.
+ (WebCore::HTMLLinkElement::canLazyAttach): Override canLazyAttach() to return false to
+ indicate that a full attach should be performed. This ensures the post-attach callbacks are
+ fired.
+
+2010-06-18 Chris Fleizach <cfleizach@apple.com>
+
+ Unreviewed. Windows build fix.
+
+ AX: presentational role needs to be inherited by required elements
+ https://bugs.webkit.org/show_bug.cgi?id=40132
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
+
+2010-06-18 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by David Kilzer.
+
+ AX: presentational role needs to be inherited by required elements
+ https://bugs.webkit.org/show_bug.cgi?id=40132
+
+ Test: platform/mac/accessibility/inherited-presentational-lists.html
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+ (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
+ * accessibility/AccessibilityRenderObject.h:
+ (WebCore::AccessibilityRenderObject::node):
+
+2010-06-18 Darin Adler <darin@apple.com>
+
+ Fix GTK build after reflection change.
+
+ * bindings/scripts/CodeGeneratorGObject.pm: Changed code
+ that emits setters to convey the correct type of the attribute.
+ The GObject code generator takes a different approach to attributes
+ than the others, so it's hacked a bit to make it more like them.
+ We should find a way to share more code between the different generators.
+
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ Updated to expect correct results.
+
+2010-06-18 Yury Semikhatsky <yurys@chromium.org>
+
+ Unreviewed: Qt build fix.
+
+ * inspector/InspectorController.cpp:
+
+2010-06-18 Justin Garcia <justin.garcia@apple.com>
+
+ Reviewed by Ojan Vafai.
+
+ https://bugs.webkit.org/show_bug.cgi?id=39798
+ No selection change notification for editing operation that doesn't change the selection's DOM position
+
+ Some editing operations change the selection visually without affecting its position within
+ the DOM. This was previously known to occur for certain typing commands, but it can also
+ occur for some Pastes and changes to block style.
+
+ * editing/Editor.cpp:
+ (WebCore::Editor::appliedEditing):
+ (WebCore::Editor::unappliedEditing):
+ (WebCore::Editor::reappliedEditing):
+ (WebCore::Editor::changeSelectionAfterCommand):
+ * editing/Editor.h:
+
+2010-06-18 Gyuyoung Kim <gyuyoung.kim@samsung.com>
+
+ Unreviewed build fix.
+
+ [EFL] Build break on Debug build.
+ https://bugs.webkit.org/show_bug.cgi?id=40810
+
+ * CMakeLists.txt: Add CSSPreloadScanner.cpp
+
+2010-06-18 Pavel Podivilov <podivilov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: persist breakpoints in inspector settings.
+ https://bugs.webkit.org/show_bug.cgi?id=14190
+
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::setSessionSettings):
+ (WebCore::InspectorController::didCommitLoad):
+ (WebCore::InspectorController::setBreakpoint):
+ (WebCore::InspectorController::removeBreakpoint):
+ (WebCore::InspectorController::didParseSource):
+ (WebCore::InspectorController::breakpointsSettingKey):
+ (WebCore::InspectorController::loadBreakpoints):
+ (WebCore::InspectorController::saveBreakpoints):
+ * inspector/InspectorController.h:
+ * inspector/InspectorValues.cpp:
+ (WebCore::InspectorValue::parseJSON):
+ * inspector/InspectorValues.h:
+ * inspector/ScriptBreakpoint.cpp: Added.
+ (WebCore::ScriptBreakpoint::sourceBreakpointsFromInspectorObject):
+ (WebCore::ScriptBreakpoint::inspectorObjectFromSourceBreakpoints):
+ * inspector/ScriptBreakpoint.h:
+ * inspector/front-end/BreakpointManager.js:
+ (WebInspector.BreakpointManager.prototype.addBreakpoint):
+ (WebInspector.BreakpointManager.prototype.restoredBreakpoint):
+ (WebInspector.BreakpointManager.prototype.breakpointsForSourceID):
+ (WebInspector.BreakpointManager.prototype.breakpointsForURL):
+ (WebInspector.BreakpointManager.prototype._addBreakpoint):
+ * inspector/front-end/inspector.js:
+ (WebInspector.restoredBreakpoint):
+
+2010-06-18 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Implement additional DOM attribute reflection for bindings
+ https://bugs.webkit.org/show_bug.cgi?id=39936
+
+ - Added support for [Reflect] for long, unsigned long, and boolean
+ attributes.
+ - Fixed code that set attributes like this: <video controls="controls">
+ to instead set them like this: <video controls>.
+ - Added lots more uses of [Reflect].
+ - Removed now-unneeded [ConvertFromString].
+ - Made [Reflect] imply [ConvertNullToNullString] so we can get rid
+ of most uses of the latter.
+ - Made [Reflect] automatically lowercase the name of the reflected
+ content attribute to minimize the need to specify a custom content
+ attribute name.
+
+ One thing this patch does *not* do is remove the unneeded functions
+ in the various DOM classes that are no longer used by the bindings.
+ We should do that in a followup.
+
+ * bindings/scripts/CodeGenerator.pm: Added new functions so code
+ can be shared across bindings, GetterExpressionPrefix and
+ SetterExpressionPrefix. We can do a lot more refactoring like
+ this in the future.
+
+ * bindings/scripts/CodeGeneratorCPP.pm: Removed unneeded
+ ConvertFromString handling, changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ to better handle reflected DOM attributes.
+
+ * bindings/scripts/CodeGeneratorGObject.pm: Removed unneeded
+ ConvertFromString handling, changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ to better handle reflected DOM attributes. Fixed a few things
+ in the output so the .cpp file will have more WebKit style.
+ The .h file should be GTK style, but the .cpp file can be the
+ standard WebKit style eventually.
+
+ * bindings/scripts/CodeGeneratorJS.pm: Changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ and removed a now-unneeded IsSVGAnimatedType special case since
+ the new functions take care of it. Made reflected attributes
+ automatically convert null to the null string without a
+ separate ConvertNullToNullString attribute.
+
+ * bindings/scripts/CodeGeneratorObjC.pm: Changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ and removed a now-unneeded IsSVGAnimatedType special case since
+ the new functions take care of it. Redid the special cases for
+ ownerDocument and for operator to fit better with the new code
+ paths. Removed unneeded ConvertFromString handling.
+
+ * bindings/scripts/CodeGeneratorV8.pm: Changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ and removed a now-unneeded IsSVGAnimatedType special case since
+ the new functions take care of it. Made reflected attributes
+ automatically convert null to the null string without a
+ separate ConvertNullToNullString attribute.
+
+ * bindings/scripts/test/TestObj.idl: Added some test cases for
+ content attribute reflection and for exceptions in string-typed
+ attributes.
+
+ * bindings/scripts/test/CPP/WebKitDOMTestObj.cpp: Updated.
+ * bindings/scripts/test/CPP/WebKitDOMTestObj.h: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
+ * bindings/scripts/test/V8/V8TestObj.cpp: Ditto.
+
+ * dom/Element.cpp:
+ (WebCore::Element::getIntegralAttribute): Added.
+ (WebCore::Element::setIntegralAttribute): Added.
+ (WebCore::Element::getUnsignedIntegralAttribute): Added.
+ (WebCore::Element::setUnsignedIntegralAttribute): Added.
+ * dom/Element.h: Added new attribute get/set functions for bindings.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::isURLAttribute): Added. Returns true for
+ srcAttr.
+ * html/HTMLMediaElement.h: Added isURLAttribute.
+
+ * html/HTMLVideoElement.cpp:
+ (WebCore::HTMLVideoElement::isURLAttribute): Changed to call
+ HTMLMediaElement::isURLAttribute before checking for posterAttr.
+
+ * html/HTMLAnchorElement.idl:
+ * html/HTMLAppletElement.idl:
+ * html/HTMLAreaElement.idl:
+ * html/HTMLBRElement.idl:
+ * html/HTMLBaseElement.idl:
+ * html/HTMLBaseFontElement.idl:
+ * html/HTMLBlockquoteElement.idl:
+ * html/HTMLBodyElement.idl:
+ * html/HTMLButtonElement.idl:
+ * html/HTMLDListElement.idl:
+ * html/HTMLDirectoryElement.idl:
+ * html/HTMLDivElement.idl:
+ * html/HTMLElement.idl:
+ * html/HTMLEmbedElement.idl:
+ * html/HTMLFontElement.idl:
+ * html/HTMLFormElement.idl:
+ * html/HTMLFrameElement.idl:
+ * html/HTMLFrameSetElement.idl:
+ * html/HTMLHRElement.idl:
+ * html/HTMLHeadElement.idl:
+ * html/HTMLHeadingElement.idl:
+ * html/HTMLHtmlElement.idl:
+ * html/HTMLIFrameElement.idl:
+ * html/HTMLImageElement.idl:
+ * html/HTMLInputElement.idl:
+ * html/HTMLIsIndexElement.idl:
+ * html/HTMLLIElement.idl:
+ * html/HTMLLabelElement.idl:
+ * html/HTMLLegendElement.idl:
+ * html/HTMLLinkElement.idl:
+ * html/HTMLMapElement.idl:
+ * html/HTMLMediaElement.idl:
+ * html/HTMLMenuElement.idl:
+ * html/HTMLMetaElement.idl:
+ * html/HTMLModElement.idl:
+ * html/HTMLOListElement.idl:
+ * html/HTMLObjectElement.idl:
+ * html/HTMLOptGroupElement.idl:
+ * html/HTMLOptionElement.idl:
+ * html/HTMLParagraphElement.idl:
+ * html/HTMLParamElement.idl:
+ * html/HTMLPreElement.idl:
+ * html/HTMLQuoteElement.idl:
+ * html/HTMLScriptElement.idl:
+ * html/HTMLStyleElement.idl:
+ * html/HTMLTableCaptionElement.idl:
+ * html/HTMLTableCellElement.idl:
+ * html/HTMLTableColElement.idl:
+ * html/HTMLTableElement.idl:
+ * html/HTMLTableRowElement.idl:
+ * html/HTMLTableSectionElement.idl:
+ * html/HTMLTextAreaElement.idl:
+ * html/HTMLUListElement.idl:
+ * html/HTMLVideoElement.idl:
+ * svg/SVGElement.idl:
+ Added more uses of [Reflect]. Got rid of uses of [ConvertNullToNullString] that
+ are now unneeded since [Reflect] now implies that. Changed formatting to be
+ simpler and consistent without all the lining up and multiple lines.
+
+2010-06-17 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Remove some unnecessary checks that cause compiler warnings.
+ https://bugs.webkit.org/show_bug.cgi?id=40772
+
+ * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
+ (WebCore::V8SQLResultSetRowList::itemCallback):
+ * bindings/v8/npruntime.cpp:
+
+2010-06-18 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Implement 'takeHeapSnapshot' in InspectorController.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40834
+
+ * bindings/js/ScriptProfiler.h:
+ (WebCore::ScriptProfiler::takeHeapSnapshot):
+ * bindings/v8/ScriptProfiler.cpp:
+ (WebCore::ScriptProfiler::takeHeapSnapshot):
+ * bindings/v8/ScriptProfiler.h:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::takeHeapSnapshot):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::takeHeapSnapshot):
+ * inspector/InspectorController.h:
+
+2010-06-18 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ REGRESSION (r61379?): Assertion failure in Element::getURLAttribute() when accessing the src attribute of a script element
+ https://bugs.webkit.org/show_bug.cgi?id=40831
+
+ Test: fast/dom/HTMLScriptElement/isURLAttribute.html
+
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::isURLAttribute): Check for the 'src' attribute.
+
+2010-06-18 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61405.
+ http://trac.webkit.org/changeset/61405
+ https://bugs.webkit.org/show_bug.cgi?id=40838
+
+ broke chromium mac compile (Requested by tonyg-cr1 on
+ #webkit).
+
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::evaluate):
+ * bindings/v8/V8Proxy.h:
+
+2010-06-18 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Fix WebGLRenderingContext helper functions find{Texture/Renderbuffer/Buffer}
+ https://bugs.webkit.org/show_bug.cgi?id=40176
+
+ * html/canvas/WebGLBuffer.cpp: Remove constructor with existing name.
+ * html/canvas/WebGLBuffer.h: Ditto.
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getVertexAttrib): Use findBuffer instead of creating a new WebGLBuffer.
+ (WebCore::WebGLRenderingContext::findTexture): Deal with name == 0 case and return raw pointer.
+ (WebCore::WebGLRenderingContext::findRenderbuffer): Ditto.
+ (WebCore::WebGLRenderingContext::findBuffer): Find WebGLBuffer object using given name.
+ * html/canvas/WebGLRenderingContext.h: Add findBuffer function declaration, change return type to raw pointer.
+
+2010-06-18 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by David Levin.
+
+ Persist V8's ScriptData to the memory cache.
+ https://bugs.webkit.org/show_bug.cgi?id=38661
+
+ This stores V8's ScriptData in the memory cache and also causes the
+ network platform layer to be notified of the available cacheable
+ metadata.
+
+ Chromium's morejs benchmark showed a ~7% improvement when this was
+ originally submitted (before it had to be rolled back).
+
+ Test: fast/js/parser-high-byte-character.html
+
+ * bindings/v8/ScriptSourceCode.h:
+ (WebCore::ScriptSourceCode::ScriptSourceCode):
+ (WebCore::ScriptSourceCode::cachedScript):
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::compileScript):
+ (WebCore::V8Proxy::precompileScript):
+ (WebCore::V8Proxy::evaluate):
+ * bindings/v8/V8Proxy.h:
+
+2010-06-18 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [v8] Finish migration to new named property query API
+ https://bugs.webkit.org/show_bug.cgi?id=40771
+ Remove definition which allowed gradual transition to new API.
+ See https://bugs.webkit.org/show_bug.cgi?id=40303 for first phase.
+
+ * config.h:
+
+2010-06-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: bring XHR console records back.
+ - adds "Enable XHR Monitor" / "Disable XHR Monitor" actions to the console's context menu
+ - make the chosen option persist in the settings.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40799
+
+ * English.lproj/localizedStrings.js:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::disableSearchingForNode):
+ (WebCore::InspectorBackend::enableMonitoringXHR):
+ (WebCore::InspectorBackend::disableMonitoringXHR):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ (WebCore::InspectorController::setMonitoringXHR):
+ (WebCore::InspectorController::didLoadResourceFromMemoryCache):
+ (WebCore::InspectorController::identifierForInitialRequest):
+ (WebCore::InspectorController::resourceRetrievedByXMLHttpRequest):
+ (WebCore::InspectorController::ensureSettingsLoaded):
+ * inspector/InspectorController.h:
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::monitoringXHRWasEnabled):
+ (WebCore::InspectorFrontend::monitoringXHRWasDisabled):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
+ (WebInspector.ConsoleView.prototype._registerShortcuts):
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor.):
+ * inspector/front-end/InspectorBackendStub.js:
+ (.WebInspector.InspectorBackendStub):
+ (.WebInspector.InspectorBackendStub.prototype.enableMonitoringXHR):
+ (.WebInspector.InspectorBackendStub.prototype.disableMonitoringXHR):
+ * inspector/front-end/inspector.js:
+ (WebInspector.monitoringXHRWasEnabled):
+ (WebInspector.monitoringXHRWasDisabled):
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::didFinishLoading):
+
+2010-06-18 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Modernize SVG Text code, following the HTML design
+ https://bugs.webkit.org/show_bug.cgi?id=40663
+
+ SVG Text does not support subpixel positioning
+ https://bugs.webkit.org/show_bug.cgi?id=12172
+
+ RenderSVGText can't do partial repaints
+ https://bugs.webkit.org/show_bug.cgi?id=15386
+
+ HTML and SVG need to share more text painting code
+ https://bugs.webkit.org/show_bug.cgi?id=15644
+
+ Rewrite SVG Text rendering, only keeping the layout of the actual characters/chunks as it was.
+ We're now drawing SVG Text very similar to HTML Text, utilizing the SVGInlineFlowBox/SVGInlineTextBox structure,
+ instead of painting all text content of a <text> element from the SVGRootInlineBox, as it was the last years.
+
+ Rough overview of the changes:
+ - Partial repainting support for text selections (startPos/endPos are respected), no more redrawing of the whole <text> content while selecting
+ - Subpixel positioning (near pixel-perfect rendering for all W3C tests that contain text, finally!)
+ -> much better textPath results, characters now align as expected, as all rounding hacks are disabled for SVG text runs, and subpixel precision is used while painting
+ - No more custom handling of selection, the standard methods offsetFromPosition() / selectionRectForText() are used instead.
+ - Selection works as expected on stretched/squeezed text (lengthAdjust="spacingAndGlyphs"), takes 'includePartialGlyphs' into account - just like HTML text
+ - Correct text decoration drawing (proper with and positions and rendering-order, underline/overline before text, strike-through afterwards)
+ - Proper sizing of all InlineBoxes, starting from the SVGRootInlineBox, down to every single flow & text box
+ -> correct DRT results, no more weird negative offsets of text runs, etc. Looks exactly like the HTML text test results.
+ - Rewritten SVGTextContentElement API to take per-character / per-chunk transformations into account.
+ - Speeeeeed! Drawing is much faster now.
+
+ Add 24 new testcases covering basic selection features and the SVGTextContentElement API. Each test draws a half-opaque red rectangle, calculated using
+ SVGTextContentElement API to highlight the area that is supposed to be selected. Then eventSender API is utilized to move the mouse to the calculated
+ start origin, holding it down and moving it to the end position.
+
+ A detailed list of tests that show progression, can be found in the corresponding LayoutTests/ChangeLog.
+ Note that this requires a rebaselining of all SVG tests containing text elements.
+
+ Tests: svg/hixie/text/001.xml (moved from svg/hixie/text/001-broken.xml)
+ svg/text/lengthAdjust-text-metrics.html
+ svg/text/select-textLength-spacing-squeeze-1.svg
+ svg/text/select-textLength-spacing-squeeze-2.svg
+ svg/text/select-textLength-spacing-squeeze-3.svg
+ svg/text/select-textLength-spacing-squeeze-4.svg
+ svg/text/select-textLength-spacing-stretch-1.svg
+ svg/text/select-textLength-spacing-stretch-2.svg
+ svg/text/select-textLength-spacing-stretch-3.svg
+ svg/text/select-textLength-spacing-stretch-4.svg
+ svg/text/select-textLength-spacingAndGlyphs-squeeze-1.svg
+ svg/text/select-textLength-spacingAndGlyphs-squeeze-2.svg
+ svg/text/select-textLength-spacingAndGlyphs-squeeze-3.svg
+ svg/text/select-textLength-spacingAndGlyphs-squeeze-4.svg
+ svg/text/select-textLength-spacingAndGlyphs-stretch-1.svg
+ svg/text/select-textLength-spacingAndGlyphs-stretch-2.svg
+ svg/text/select-textLength-spacingAndGlyphs-stretch-3.svg
+ svg/text/select-textLength-spacingAndGlyphs-stretch-4.svg
+ svg/text/select-x-list-1.svg
+ svg/text/select-x-list-2.svg
+ svg/text/select-x-list-3.svg
+ svg/text/select-x-list-4.svg
+ svg/text/select-x-list-with-tspans-1.svg
+ svg/text/select-x-list-with-tspans-2.svg
+ svg/text/select-x-list-with-tspans-3.svg
+ svg/text/select-x-list-with-tspans-4.svg
+
+ * rendering/InlineBox.h: Remove not needed isInlineBox() method.
+ (WebCore::InlineBox::isInlineTextBox): Constify this method.
+ (WebCore::InlineBox::isSVGInlineTextBox): Added, with ENABLE(SVG) guards, just like the existing isSVGRootInlineBox().
+ (WebCore::InlineBox::isSVGRootInlineBox): Constify this method.
+ (WebCore::InlineBox::calculateBoundaries): Added, with ENABLE(SVG) guards, used to calculate the whole boundaries of a InlineText/FlowBox, only used in SVG text.
+ * rendering/InlineFlowBox.h: Devirtualize placeBoxesHorizontally(), SVG no more overrides it.
+ * rendering/InlineTextBox.h: Virtualize selectionStartEnd() - SVGInlineTextBox needs to change start/endPositions based on the current text chunk part that it's rendering.
+ SVGTextChunkLayoutInfo.h contains a detailed documentation what a SVGTextChunk/SVGTextChunkPart is, and why they are necessary.
+ (WebCore::InlineTextBox::isInlineTextBox): Constify this method.
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::forceLayoutInlineChildren): Add helper method, used only by RenderSVGText, to use a simplified layout strategy, which is a big speed win.
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::RenderBlock::computeHorizontalPositionsForLine): Remove all isSVGText() special cases, as this function is not called anymore for SVG text.
+ (WebCore::RenderBlock::layoutInlineChildren): Don't call computeHorizontalPositionsForLine() for SVG text. computePerCharacterLayoutInformation() overrides it anyway.
+ * rendering/RenderSVGInline.cpp: Remove custom absoluteRects/absoluteQuads code, all shared with RenderInline now.
+ (WebCore::RenderSVGInline::clippedOverflowRectForRepaint): Added, forward to SVGRenderBase, just like all other non-text SVG renderers do.
+ (WebCore::RenderSVGInline::computeRectForRepaint): Ditto.
+ (WebCore::RenderSVGInline::mapLocalToContainer): Ditto
+ * rendering/RenderSVGInline.h:
+ * rendering/RenderSVGInlineText.cpp: Remove destroy() hack, which called setNeedsLayoutAndPrefWidthsRecalc/repaint on destruction.
+ As repaint rects work properly now, this hack is no longer necessary, it was only hiding the real problem.
+ (WebCore::RenderSVGInlineText::styleDidChange): Don't skip RenderText::styleDidChange() anymore, which automatically schedules layout changes for us.
+ (WebCore::RenderSVGInlineText::localCaretRect): Remove outdated comment, localCaretRect() is not yet needed in SVG text code.
+ * rendering/RenderSVGInlineText.h: Remove custom absoluteRects/absoluteQuads/selectionRectForRepaint/positionForPoint/destroy/computeRectForRepaint* code, all shared with RenderText now.
+ * rendering/RenderSVGText.cpp:
+ (WebCore::RenderSVGText::mapLocalToContainer): Take x/y translation into account, but do NOT include in localToParentTransform(), as that would affect rendering.
+ (WebCore::RenderSVGText::layout): Use super-simplified layout strategy, removing a lot of uncessary stuff done by RenderBlock, that SVG does not need.
+ (WebCore::RenderSVGText::absoluteRects): Remove dead-code, retreving the RenderSVGRoot* object, not necessary since a longer time.
+ (WebCore::RenderSVGText::absoluteQuads): Ditto.
+ (WebCore::RenderSVGText::paint): Early exit if we're not in PaintPhaseForeground/PaintPhaseSelfOutline. We're not interessted in other phases.
+ (WebCore::RenderSVGText::strokeBoundingBox): Fix stroke width calculation, no need to special case SVGFonts.
+ * rendering/RenderSVGText.h: Remove updateFirstLineBlock/updateFirstLetter overrides, the new RenderSVGText::layout() code, doesn't use these methods at all.
+ We asked RenderBlock to layout before, which was calling updateFirstLetter & co, this is gone now, as it was all not needed.
+ (WebCore::RenderSVGText::objectBoundingBox): Directly return the frameRect here, inlined for speed.
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::verticallyAlignBoxes): Early-exit if we're a SVGRootInlineBox. SVG handles this on its own.
+ * rendering/RootInlineBox.h: Devirtualize verticallyAlignBoxes(), SVG no longer overrides it. Remove virtual computePerCharacterLayoutInformation() method, only lives in SVGRootInlineBox now.
+ * rendering/SVGCharacterData.h: Remove no longer needed SVGTextDecorationInfo.
+ * rendering/SVGCharacterLayoutInfo.cpp: Don't pass a reference to a Vector<SVGChar> to SVGCharacterLayoutInfo, let it create it.
+ (WebCore::SVGCharacterLayoutInfo::SVGCharacterLayoutInfo):
+ * rendering/SVGCharacterLayoutInfo.h:
+ * rendering/SVGInlineFlowBox.cpp:
+ (WebCore::SVGInlineFlowBox::paint): Ask children to paint.
+ (WebCore::SVGInlineFlowBox::calculateBoundaries): Calculate boundaries by uniting all direct children boundaries.
+ * rendering/SVGInlineFlowBox.h: Remove placeBoxesHorizontally, which does not get called anymore, and does not need to be overriden.
+ * rendering/SVGInlineTextBox.cpp:
+ (WebCore::SVGInlineTextBox::SVGInlineTextBox): Don't use abbrevations for variable names, initialize new member variables.
+ (WebCore::SVGInlineTextBox::measureCharacter): New helper function extracted from buildLayoutInformation, replacing calculateGlyphWidth/Height.
+ (WebCore::SVGInlineTextBox::offsetForPosition): Implement this method by utilizing Font::offsetForPosition(), but respecting the text chunk parts.
+ (WebCore::SVGInlineTextBox::positionForOffset): No change here, still not used.
+ (WebCore::SVGInlineTextBox::selectionRect): Rewritten, utilizing Font::selectionRectForText(), taking text chunk parts into account, and the supplied startPos/endPos.
+ (WebCore::SVGInlineTextBox::paint): Rewritten, to handle paint servers much more elegant, than the old solution. See code for details, too much to explain here.
+ (WebCore::SVGInlineTextBox::acquirePaintingResource): Helper function, used from paint().
+ (WebCore::SVGInlineTextBox::releasePaintingResource): Ditto.
+ (WebCore::SVGInlineTextBox::prepareGraphicsContextForTextPainting): Ditto.
+ (WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting): Ditto.
+ (WebCore::SVGInlineTextBox::constructTextRun): Helper function centralizing the creation of a TextRun object, used to draw/measure SVG text.
+ (WebCore::SVGInlineTextBox::mapStartEndPositionsIntoChunkPartCoordinates): Important helper function, mapping a startPos/endPos from InlineTextBox
+ coordinate space to the SVGInlineTextBox, respecting the current text chunk part.
+ (WebCore::SVGInlineTextBox::selectionStartEnd): Call InlineTextBox::selectionStartEnd(), and apply post fixes when m_currentChunkPart is set. (called when painting a selected chunk part)
+ (WebCore::positionOffsetForDecoration): Refactored from old paintDecoration() code.
+ (WebCore::thicknessForDecoration): Ditto.
+ (WebCore::findRenderObjectDefininingTextDecoration): Ditto.
+ (WebCore::SVGInlineTextBox::paintDecoration): Ditto. (Can not share the code with HTML, as we need floating point precision, and directly call fillRect, instead of drawHighlightForText.)
+ (WebCore::SVGInlineTextBox::paintDecorationWithStyle): Ditto.
+ (WebCore::SVGInlineTextBox::paintSelection): New method, painting text selections with floating-point precision.
+ (WebCore::SVGInlineTextBox::paintText): New method, painting text with floating-point precision, correctly handling selected text, removing the need for special SVG text sub-paint phases.
+ (GlyphFill/StrokeSelectionPhase, GlyphFill/StrokePhase)
+ (WebCore::SVGInlineTextBox::buildLayoutInformation): Use new measureCharacter() helper function, renamed some variables, to avoid abbrevations.
+ (WebCore::SVGInlineTextBox::calculateGlyphBoundaries): Rewritten to use new measureCharacter() helper function.
+ (WebCore::SVGInlineTextBox::calculateBoundaries): Rewritten to take text chunk parts into account, serves as central method used to layout InlineBoxes (see SVGRootInlineBox.)
+ * rendering/SVGInlineTextBox.h:
+ (WebCore::SVGInlineTextBox::isSVGInlineTextBox): Added.
+ (WebCore::SVGInlineTextBox::setHeight): Rename variable, to avoid abbrevations.
+ (WebCore::SVGInlineTextBox::chunkTransformation): New helper function, returning the transformation, that gets applied to the complete text chunk, if any.
+ (WebCore::SVGInlineTextBox::setChunkTransformation): New helper function used by SVGRrootInlineBox, to set the chunk transformation, during text chunk part propagation phase.
+ (WebCore::SVGInlineTextBox::addChunkPartInformation): Ditto.
+ (WebCore::SVGInlineTextBox::svgTextChunkParts): Ditto.
+ * rendering/SVGRootInlineBox.cpp: Virtually rewritten, to be designed more like HTMLs RootInlineBox, diving into children for painting.
+ (WebCore::SVGRootInlineBox::paint): Ask children to paint, nothing more. No more traversing through the SVGTextChunks, figuring out which part to render, this is done in layout phase now.
+ (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation): Completly redesigned, see SVGTextChunkLayoutInfo.h for a high-level overview.
+ (WebCore::SVGRootInlineBox::buildLayoutInformation): Just small cleanups, nothing changed here.
+ (WebCore::SVGRootInlineBox::layoutChildBoxes): New helper function, extracted from old layoutInlineBoxes().
+ (WebCore::SVGRootInlineBox::layoutRootBox): Ditto.
+ (WebCore::SVGRootInlineBox::propagateTextChunkPartInformation): Key-concept of the new design, builds "text chunk parts" and propagates that knownledge to all child SVGInlineTextBoxes.
+ * rendering/SVGRootInlineBox.h:
+ (WebCore::SVGRootInlineBox::isSVGRootInlineBox): Constified method.
+ (WebCore::SVGRootInlineBox::setHeight): Change variable name, to avoid abbrevations.
+ * rendering/SVGTextChunkLayoutInfo.cpp: Remove if 0, enable compilation.
+ * rendering/SVGTextChunkLayoutInfo.h: Add large comment explaining text chunk parts, the key concept of the new design. Remove SVGTextChunkWalker & friends, no longer used.
+ (WebCore::SVGTextChunkPart::SVGTextChunkPart):
+ (WebCore::SVGTextChunkPart::isValid):
+ (WebCore::SVGTextChunk::SVGTextChunk):
+ (WebCore::SVGTextChunkLayoutInfo::SVGTextChunkLayoutInfo):
+ (WebCore::SVGTextChunkLayoutInfo::textChunks):
+ * rendering/SVGTextLayoutUtilities.cpp:
+ (WebCore::cummulatedWidthOfInlineBoxCharacterRange):
+ (WebCore::cummulatedHeightOfInlineBoxCharacterRange):
+ (WebCore::svgTextRunForInlineTextBox): Disable rounding hacks, explain parameters with comments, why they have which values.
+ * rendering/SVGTextLayoutUtilities.h: Remove SVGTextPaintSubphase and SVGTextPaintInfo.
+ * rendering/SVGTextQuery.cpp: Remove if 0, enable compilation.
+ * rendering/SVGTextQuery.h: Ditto.
+ * svg/SVGStyledElement.cpp: Very important change! Do not treat CSS attributes as recognized attributes, that would lead to setNeedsLayout() calls, reducing performance!
+ This hack existed, as we were not dealing with text updates correctly, now that RenderSVGInlineText::styleDidChange is fixed, it's no longer necessary.
+ (WebCore::SVGStyledElement::isKnownAttribute):
+ * svg/SVGTextContentElement.cpp: Completely remove the SVGTextContentElement API, that manually traversed all text chunks, instead use the new SVGTextQuery API.
+ (WebCore::SVGTextContentElement::getNumberOfChars):
+ (WebCore::SVGTextContentElement::getComputedTextLength):
+ (WebCore::SVGTextContentElement::getSubStringLength):
+ (WebCore::SVGTextContentElement::getStartPositionOfChar):
+ (WebCore::SVGTextContentElement::getEndPositionOfChar):
+ (WebCore::SVGTextContentElement::getExtentOfChar):
+ (WebCore::SVGTextContentElement::getRotationOfChar):
+ (WebCore::SVGTextContentElement::getCharNumAtPosition):
+ * svg/SVGTextElement.cpp: Very important change! Do not calls setNeedsLayout() on RenderSVGText, if childrenChanged() has been called.
+ * svg/SVGTextElement.h: Completly remove childrenChanged() - no longer necessary, updates work as expected without it now.
+
+2010-06-18 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by David Levin.
+
+ Fix compilation when filters are disabled. Revision r60689
+ changed the signature of SVGRenderBase::prepareToRenderSVGContent()
+ but didn't change the unsused parameters when filters are disabled.
+ https://bugs.webkit.org/show_bug.cgi?id=40625
+
+ No new tests. Compilation fix.
+
+ * rendering/SVGRenderSupport.cpp:
+ (WebCore::SVGRenderBase::prepareToRenderSVGContent):
+
+2010-06-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ noAccess url schemes block access to inline stylesheets
+ https://bugs.webkit.org/show_bug.cgi?id=32309
+
+ Instead of using baseURL() to grab the security context we should just
+ use finalURL directly. When I wrote the original patch that added this
+ security check, finalURL didn't exist yet.
+
+ If finalURL is an empty URL, that means we generated the style sheet
+ from text that didn't have a URL. It would be slightly safer to store
+ a bit on CSSStyleSheet indicating whether it came from an inline style
+ sheet, but I think this check is fairly accurate.
+
+ Test: http/tests/security/data-url-inline.css.html
+
+ * css/CSSStyleSheet.cpp:
+ (WebCore::CSSStyleSheet::cssRules):
+
+2010-06-18 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Darin Adler.
+
+ Remove unneeded custom code for WebSocket.send
+ https://bugs.webkit.org/show_bug.cgi?id=38180
+
+ We don't appear to require a custom binding here. The old function was
+ wacky in two ways:
+
+ 1) It required all of its arguments.
+
+ 2) If the toString of its argument threw, it would catch the exception
+ and re-throw a different exception.
+
+ I've kept the first behavior but changed the second (and documented it
+ with a test).
+
+ Test: websocket/tests/send-throw.html
+
+ * bindings/js/JSWebSocketCustom.cpp:
+ * bindings/v8/custom/V8WebSocketCustom.cpp:
+ * websockets/WebSocket.idl:
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * WebCore.base.exp
+ * bindings/generic/RuntimeEnabledFeatures.cpp:
+ (WebCore::RuntimeEnabledFeatures::openDatabaseEnabled):
+ (WebCore::RuntimeEnabledFeatures::openDatabaseSyncEnabled):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::openDatabase):
+ * storage/AbstractDatabase.cpp:
+ (WebCore::AbstractDatabase::isAvailable):
+ (WebCore::AbstractDatabase::setIsAvailable):
+ * storage/AbstractDatabase.h:
+ * storage/Database.cpp:
+ * storage/Database.h:
+ * storage/DatabaseSync.cpp:
+ * storage/DatabaseSync.h:
+ * workers/WorkerContext.cpp:
+ (WebCore::WorkerContext::openDatabase):
+ (WebCore::WorkerContext::openDatabaseSync):
+ * workers/WorkerContext.h:
+
+2010-06-18 Adam Barth <abarth@webkit.org>
+
+ Rubber-stamped by Eric Seidel.
+
+ Fix the namespace indent for HTML5Lexer. This patch changes
+ white-space only.
+
+ * html/HTML5Lexer.h:
+ (WebCore::HTML5Lexer::):
+ (WebCore::HTML5Lexer::lineNumber):
+ (WebCore::HTML5Lexer::columnNumber):
+ (WebCore::HTML5Lexer::state):
+ (WebCore::HTML5Lexer::setState):
+ (WebCore::HTML5Lexer::skipLeadingNewLineForListing):
+ (WebCore::HTML5Lexer::InputStreamPreprocessor::InputStreamPreprocessor):
+ (WebCore::HTML5Lexer::InputStreamPreprocessor::nextInputCharacter):
+ (WebCore::HTML5Lexer::InputStreamPreprocessor::peek):
+ (WebCore::HTML5Lexer::InputStreamPreprocessor::advance):
+
+2010-06-18 Fumitoshi Ukai <ukai@chromium.org>
+
+ Unreviewed test breakage fix.
+
+ WebSocket: resume should not process buffer if already processing.
+ https://bugs.webkit.org/show_bug.cgi?id=39340
+
+ MessageLoop runs in main thread, so we don't need to use timer in worker thread.
+ Also, we should not use Timer in worker thread.
+
+ * websockets/ThreadableWebSocketChannelClientWrapper.h:
+ (WebCore::ThreadableWebSocketChannelClientWrapper::resume):
+ (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
+
+2010-06-17 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ Unreviewed, rolling out r61379.
+ http://trac.webkit.org/changeset/61379
+ https://bugs.webkit.org/show_bug.cgi?id=40813
+
+ Broke multiple tests on all platforms (Requested by tkent on
+ #webkit).
+
+ * bindings/scripts/CodeGenerator.pm:
+ * bindings/scripts/CodeGeneratorCPP.pm:
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ (WebDOMTestObj::attrWithException):
+ (WebDOMTestObj::setAttrWithException):
+ (WebDOMTestObj::attrWithSetterException):
+ (WebDOMTestObj::attrWithGetterException):
+ (WebDOMTestObj::setAttrWithGetterException):
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
+ (webkit_dom_test_callback_callback_with_class1param):
+ (webkit_dom_test_callback_callback_with_class2param):
+ (webkit_dom_test_callback_callback_with_non_bool_return_type):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_void_method):
+ (webkit_dom_test_obj_void_method_with_args):
+ (webkit_dom_test_obj_int_method):
+ (webkit_dom_test_obj_int_method_with_args):
+ (webkit_dom_test_obj_obj_method):
+ (webkit_dom_test_obj_obj_method_with_args):
+ (webkit_dom_test_obj_method_that_requires_all_args):
+ (webkit_dom_test_obj_method_that_requires_all_args_and_throws):
+ (webkit_dom_test_obj_serialized_value):
+ (webkit_dom_test_obj_method_with_exception):
+ (webkit_dom_test_obj_with_dynamic_frame):
+ (webkit_dom_test_obj_with_dynamic_frame_and_arg):
+ (webkit_dom_test_obj_with_dynamic_frame_and_optional_arg):
+ (webkit_dom_test_obj_with_dynamic_frame_and_user_gesture):
+ (webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad):
+ (webkit_dom_test_obj_with_script_state_void):
+ (webkit_dom_test_obj_with_script_state_obj):
+ (webkit_dom_test_obj_with_script_state_void_exception):
+ (webkit_dom_test_obj_with_script_state_obj_exception):
+ (webkit_dom_test_obj_with_script_execution_context):
+ (webkit_dom_test_obj_method_with_optional_arg):
+ (webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg):
+ (webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args):
+ (webkit_dom_test_obj_get_read_only_int_attr):
+ (webkit_dom_test_obj_get_read_only_string_attr):
+ (webkit_dom_test_obj_get_read_only_test_obj_attr):
+ (webkit_dom_test_obj_get_int_attr):
+ (webkit_dom_test_obj_set_int_attr):
+ (webkit_dom_test_obj_get_long_long_attr):
+ (webkit_dom_test_obj_set_long_long_attr):
+ (webkit_dom_test_obj_get_unsigned_long_long_attr):
+ (webkit_dom_test_obj_set_unsigned_long_long_attr):
+ (webkit_dom_test_obj_get_string_attr):
+ (webkit_dom_test_obj_set_string_attr):
+ (webkit_dom_test_obj_get_test_obj_attr):
+ (webkit_dom_test_obj_set_test_obj_attr):
+ (webkit_dom_test_obj_get_attr_with_exception):
+ (webkit_dom_test_obj_set_attr_with_exception):
+ (webkit_dom_test_obj_get_attr_with_setter_exception):
+ (webkit_dom_test_obj_set_attr_with_setter_exception):
+ (webkit_dom_test_obj_get_attr_with_getter_exception):
+ (webkit_dom_test_obj_set_attr_with_getter_exception):
+ (webkit_dom_test_obj_get_script_string_attr):
+ (webkit_dom_test_obj_get_conditional_attr1):
+ (webkit_dom_test_obj_set_conditional_attr1):
+ (webkit_dom_test_obj_get_conditional_attr2):
+ (webkit_dom_test_obj_set_conditional_attr2):
+ (webkit_dom_test_obj_get_conditional_attr3):
+ (webkit_dom_test_obj_set_conditional_attr3):
+ (webkit_dom_test_obj_get_description):
+ (webkit_dom_test_obj_get_id):
+ (webkit_dom_test_obj_set_id):
+ (webkit_dom_test_obj_get_hash):
+ (webkit_dom_test_obj_set_property):
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::):
+ (WebCore::jsTestObjAttrWithException):
+ (WebCore::jsTestObjAttrWithSetterException):
+ (WebCore::jsTestObjAttrWithGetterException):
+ (WebCore::setJSTestObjAttrWithException):
+ (WebCore::setJSTestObjAttrWithGetterException):
+ (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ (-[DOMTestObj attrWithException]):
+ (-[DOMTestObj setAttrWithException:]):
+ (-[DOMTestObj attrWithSetterException]):
+ (-[DOMTestObj attrWithGetterException]):
+ (-[DOMTestObj setAttrWithGetterException:]):
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::attrWithExceptionAttrGetter):
+ (WebCore::TestObjInternal::attrWithExceptionAttrSetter):
+ (WebCore::TestObjInternal::attrWithSetterExceptionAttrGetter):
+ (WebCore::TestObjInternal::attrWithGetterExceptionAttrGetter):
+ (WebCore::TestObjInternal::attrWithGetterExceptionAttrSetter):
+ (WebCore::TestObjInternal::overloadedMethodCallback):
+ (WebCore::):
+ * dom/Element.cpp:
+ * dom/Element.h:
+ * html/HTMLAnchorElement.idl:
+ * html/HTMLAppletElement.idl:
+ * html/HTMLAreaElement.idl:
+ * html/HTMLBRElement.idl:
+ * html/HTMLBaseElement.idl:
+ * html/HTMLBaseFontElement.idl:
+ * html/HTMLBlockquoteElement.idl:
+ * html/HTMLBodyElement.idl:
+ * html/HTMLButtonElement.idl:
+ * html/HTMLDListElement.idl:
+ * html/HTMLDirectoryElement.idl:
+ * html/HTMLDivElement.idl:
+ * html/HTMLElement.idl:
+ * html/HTMLEmbedElement.idl:
+ * html/HTMLFontElement.idl:
+ * html/HTMLFormElement.idl:
+ * html/HTMLFrameElement.idl:
+ * html/HTMLFrameSetElement.idl:
+ * html/HTMLHRElement.idl:
+ * html/HTMLHeadElement.idl:
+ * html/HTMLHeadingElement.idl:
+ * html/HTMLHtmlElement.idl:
+ * html/HTMLIFrameElement.idl:
+ * html/HTMLImageElement.idl:
+ * html/HTMLInputElement.idl:
+ * html/HTMLIsIndexElement.idl:
+ * html/HTMLLIElement.idl:
+ * html/HTMLLabelElement.idl:
+ * html/HTMLLegendElement.idl:
+ * html/HTMLLinkElement.idl:
+ * html/HTMLMapElement.idl:
+ * html/HTMLMediaElement.idl:
+ * html/HTMLMenuElement.idl:
+ * html/HTMLMetaElement.idl:
+ * html/HTMLModElement.idl:
+ * html/HTMLOListElement.idl:
+ * html/HTMLObjectElement.idl:
+ * html/HTMLOptGroupElement.idl:
+ * html/HTMLOptionElement.idl:
+ * html/HTMLParagraphElement.idl:
+ * html/HTMLParamElement.idl:
+ * html/HTMLPreElement.idl:
+ * html/HTMLQuoteElement.idl:
+ * html/HTMLScriptElement.idl:
+ * html/HTMLStyleElement.idl:
+ * html/HTMLTableCaptionElement.idl:
+ * html/HTMLTableCellElement.idl:
+ * html/HTMLTableColElement.idl:
+ * html/HTMLTableElement.idl:
+ * html/HTMLTableRowElement.idl:
+ * html/HTMLTableSectionElement.idl:
+ * html/HTMLTextAreaElement.idl:
+ * html/HTMLUListElement.idl:
+ * html/HTMLVideoElement.idl:
+ * svg/SVGElement.idl:
+
+2010-06-17 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Dave Hyatt.
+
+ CSS3 "Property is declared twice in rule" test fails
+ https://bugs.webkit.org/show_bug.cgi?id=36282
+
+ Filter out duplicate properties in style declaration.
+
+ Test: fast/css/duplicate-property-in-rule.html
+
+ * css/CSSMutableStyleDeclaration.cpp: Filter out duplicate properties
+ (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue): Discard negative padding values
+ * css/CSSStyleSelector.cpp: Remove negative padding check
+ (WebCore::CSSStyleSelector::applyProperty):
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Implement additional DOM attribute reflection for bindings
+ https://bugs.webkit.org/show_bug.cgi?id=39936
+
+ - Added support for [Reflect] for long, unsigned long, and boolean
+ attributes.
+ - Fixed code that set attributes like this: <video controls="controls">
+ to instead set them like this: <video controls>.
+ - Added lots more uses of [Reflect].
+ - Removed now-unneeded [ConvertFromString].
+ - Made [Reflect] imply [ConvertNullToNullString] so we can get rid
+ of most uses of the latter.
+ - Made [Reflect] automatically lowercase the name of the reflected
+ content attribute to minimize the need to specify a custom content
+ attribute name.
+
+ One thing this patch does *not* do is remove the unneeded functions
+ in the various DOM classes that are no longer used by the bindings.
+ We should do that in a followup.
+
+ * bindings/scripts/CodeGenerator.pm: Added new functions so code
+ can be shared across bindings, GetterExpressionPrefix and
+ SetterExpressionPrefix. We can do a lot more refactoring like
+ this in the future.
+
+ * bindings/scripts/CodeGeneratorCPP.pm: Removed unneeded
+ ConvertFromString handling, changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ to better handle reflected DOM attributes.
+
+ * bindings/scripts/CodeGeneratorGObject.pm: Removed unneeded
+ ConvertFromString handling, changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ to better handle reflected DOM attributes. Fixed a few things
+ in the output so the .cpp file will have more WebKit style.
+ The .h file should be GTK style, but the .cpp file can be the
+ standard WebKit style eventually.
+
+ * bindings/scripts/CodeGeneratorJS.pm: Changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ and removed a now-unneeded IsSVGAnimatedType special case since
+ the new functions take care of it. Made reflected attributes
+ automatically convert null to the null string without a
+ separate ConvertNullToNullString attribute.
+
+ * bindings/scripts/CodeGeneratorObjC.pm: Changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ and removed a now-unneeded IsSVGAnimatedType special case since
+ the new functions take care of it. Redid the special cases for
+ ownerDocument and for operator to fit better with the new code
+ paths. Removed unneeded ConvertFromString handling.
+
+ * bindings/scripts/CodeGeneratorV8.pm: Changed to use the new
+ GetterExpressionPrefix and SetterExpressionPrefix functions
+ and removed a now-unneeded IsSVGAnimatedType special case since
+ the new functions take care of it. Made reflected attributes
+ automatically convert null to the null string without a
+ separate ConvertNullToNullString attribute.
+
+ * bindings/scripts/test/TestObj.idl: Added some test cases for
+ content attribute reflection and for exceptions in string-typed
+ attributes.
+
+ * bindings/scripts/test/CPP/WebKitDOMTestObj.cpp: Updated.
+ * bindings/scripts/test/CPP/WebKitDOMTestObj.h: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp: Ditto.
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
+ * bindings/scripts/test/JS/JSTestObj.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestObj.h: Ditto.
+ * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
+ * bindings/scripts/test/V8/V8TestObj.cpp: Ditto.
+
+ * dom/Element.cpp:
+ (WebCore::Element::getIntegralAttribute): Added.
+ (WebCore::Element::setIntegralAttribute): Added.
+ (WebCore::Element::getUnsignedIntegralAttribute): Added.
+ (WebCore::Element::setUnsignedIntegralAttribute): Added.
+ * dom/Element.h: Added new attribute get/set functions for bindings.
+
+ * html/HTMLAnchorElement.idl:
+ * html/HTMLAppletElement.idl:
+ * html/HTMLAreaElement.idl:
+ * html/HTMLBRElement.idl:
+ * html/HTMLBaseElement.idl:
+ * html/HTMLBaseFontElement.idl:
+ * html/HTMLBlockquoteElement.idl:
+ * html/HTMLBodyElement.idl:
+ * html/HTMLButtonElement.idl:
+ * html/HTMLDListElement.idl:
+ * html/HTMLDirectoryElement.idl:
+ * html/HTMLDivElement.idl:
+ * html/HTMLElement.idl:
+ * html/HTMLEmbedElement.idl:
+ * html/HTMLFontElement.idl:
+ * html/HTMLFormElement.idl:
+ * html/HTMLFrameElement.idl:
+ * html/HTMLFrameSetElement.idl:
+ * html/HTMLHRElement.idl:
+ * html/HTMLHeadElement.idl:
+ * html/HTMLHeadingElement.idl:
+ * html/HTMLHtmlElement.idl:
+ * html/HTMLIFrameElement.idl:
+ * html/HTMLImageElement.idl:
+ * html/HTMLInputElement.idl:
+ * html/HTMLIsIndexElement.idl:
+ * html/HTMLLIElement.idl:
+ * html/HTMLLabelElement.idl:
+ * html/HTMLLegendElement.idl:
+ * html/HTMLLinkElement.idl:
+ * html/HTMLMapElement.idl:
+ * html/HTMLMediaElement.idl:
+ * html/HTMLMenuElement.idl:
+ * html/HTMLMetaElement.idl:
+ * html/HTMLModElement.idl:
+ * html/HTMLOListElement.idl:
+ * html/HTMLObjectElement.idl:
+ * html/HTMLOptGroupElement.idl:
+ * html/HTMLOptionElement.idl:
+ * html/HTMLParagraphElement.idl:
+ * html/HTMLParamElement.idl:
+ * html/HTMLPreElement.idl:
+ * html/HTMLQuoteElement.idl:
+ * html/HTMLScriptElement.idl:
+ * html/HTMLStyleElement.idl:
+ * html/HTMLTableCaptionElement.idl:
+ * html/HTMLTableCellElement.idl:
+ * html/HTMLTableColElement.idl:
+ * html/HTMLTableElement.idl:
+ * html/HTMLTableRowElement.idl:
+ * html/HTMLTableSectionElement.idl:
+ * html/HTMLTextAreaElement.idl:
+ * html/HTMLUListElement.idl:
+ * html/HTMLVideoElement.idl:
+ * svg/SVGElement.idl:
+ Added more uses of [Reflect]. Got rid of uses of [ConvertNullToNullString] that
+ are now unneeded since [Reflect] now implies that. Changed formatting to be
+ simpler and consistent without all the lining up and multiple lines.
+
+2010-06-17 MORITA Hajime <morrita@google.com>
+
+ Unreviewd, fixed a build break.
+
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId):
+
+2010-06-16 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Kent Tamura.
+
+ <meter> should allow styling for each gauge-level and component
+ https://bugs.webkit.org/show_bug.cgi?id=40280
+
+ - Introduced following new pseudo classes for <meter> element.
+
+ - -webkit-meter-horizontal-bar
+ - -webkit-meter-vertical-bar
+ - -webkit-meter-horizontal-optimum-value
+ - -webkit-meter-vertical-optimum-value
+ - -webkit-meter-horizontal-suboptimal-value
+ - -webkit-meter-vertical-suboptimal-value
+ - -webkit-meter-horizontal-even-less-good-value
+ - -webkit-meter-vertical-even-less-good-value
+
+ - Introduced 2 shadow nodes for RenderMeter to handle CSS styling.
+ one for bar part and another for value part.
+ - Removed RenderTheme::paintMeter() implementation because it can be
+ handled by styled painting without RenderTheme.
+ - Pulled RenderIndicator up to super class from RenderProgress,
+ then make RenderMeter a subclass of it.
+ - Moved shadow related methods from RenderProgress to ShadowBlockElement
+ to share it with RenderMeter.
+ - Added rules for html.css for new pseudo classes.
+
+ Tests: fast/dom/HTMLMeterElement/meter-styles-changing-pseudo.html
+ fast/dom/HTMLMeterElement/meter-styles.html
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::pseudoId):
+ (WebCore::nameToPseudoTypeMap):
+ (WebCore::CSSSelector::extractPseudoType):
+ * css/CSSSelector.h:
+ (WebCore::CSSSelector::):
+ * css/html.css:
+ (meter::-webkit-meter-horizontal-bar):
+ (meter::-webkit-meter-vertical-bar):
+ (meter::-webkit-meter-horizontal-optimum-value):
+ (meter::-webkit-meter-horizontal-suboptimal-value):
+ (meter::-webkit-meter-horizontal-even-less-good-value):
+ (meter::-webkit-meter-vertical-optimum-value):
+ (meter::-webkit-meter-vertical-suboptimal-value):
+ (meter::-webkit-meter-vertical-even-less-good-value):
+ * rendering/RenderIndicator.cpp: Added.
+ (WebCore::RenderIndicator::RenderIndicator):
+ (WebCore::RenderIndicator::~RenderIndicator):
+ (WebCore::RenderIndicator::layout):
+ (WebCore::RenderIndicator::styleDidChange):
+ (WebCore::RenderIndicator::updateFromElement):
+ (WebCore::RenderIndicator::hasParts):
+ (WebCore::RenderIndicator::requestLayoutForParts):
+ * rendering/RenderIndicator.h: Added.
+ (WebCore::RenderIndicator::requiresForcedStyleRecalcPropagation):
+ * rendering/RenderMeter.cpp:
+ (WebCore::RenderMeter::RenderMeter):
+ (WebCore::RenderMeter::~RenderMeter):
+ (WebCore::RenderMeter::layoutParts): Added.
+ (WebCore::RenderMeter::shouldHaveParts): Added.
+ (WebCore::RenderMeter::valueRatio): Added.
+ (WebCore::RenderMeter::barPartRect): Added.
+ (WebCore::RenderMeter::valuePartRect): Added.
+ (WebCore::RenderMeter::isHorizontal): Added.
+ (WebCore::RenderMeter::valuePseudoId): Added.
+ (WebCore::RenderMeter::barPseudoId): Added.
+ (WebCore::RenderMeter::updatePartsState): Added.
+ * rendering/RenderMeter.h:
+ * rendering/RenderProgress.cpp:
+ (WebCore::RenderProgress::RenderProgress):
+ (WebCore::RenderProgress::updateFromElement):
+ (WebCore::RenderProgress::paint):
+ (WebCore::RenderProgress::layoutParts): Added.
+ (WebCore::RenderProgress::shouldHaveParts): Added.
+ (WebCore::RenderProgress::updatePartsState):
+ (WebCore::RenderProgress::valuePartRect):
+ * rendering/RenderProgress.h:
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::isControlStyled):
+ (WebCore::RenderTheme::paintMeter):
+ * rendering/RenderTheme.h:
+ (WebCore::RenderTheme::supportsMeter): Added.
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::supportsMeter): Added.
+ * rendering/ShadowElement.cpp:
+ (WebCore::ShadowBlockElement::layoutAsPart): Added.
+ (WebCore::ShadowBlockElement::updateStyleForPart): Added.
+ (WebCore::ShadowBlockElement::createForPart): Added.
+ (WebCore::ShadowBlockElement::createStyleForPart): Added.
+ (WebCore::ShadowBlockElement::partShouldHaveStyle): Added.
+ * rendering/ShadowElement.h:
+ * rendering/style/RenderStyleConstants.h:
+ (WebCore::):
+
+2010-06-17 Fumitoshi Ukai <ukai@chromium.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ WebSocket: resume should not process buffer if already processing.
+ https://bugs.webkit.org/show_bug.cgi?id=39340
+
+ Test: websocket/tests/alert-in-event-handler.html
+
+ While running an event handler of WebSocket object, it may be suspended
+ and resumed in various reason. e.g. alert() will suspend/resume
+ ActiveDOM objects. In chromium, sending IPC message would also
+ suspend/resume ActiveDOM objects.
+ If resume process pending buffer in this case, another event might
+ be fired while running the initial event handler.
+ Thus, resume should not process pending buffer immediately.
+ Pending buffer would be processed after the current task has been
+ finished.
+
+ * websockets/ThreadableWebSocketChannelClientWrapper.h:
+ * websockets/WebSocketChannel.cpp:
+ (WebCore::WebSocketChannel::WebSocketChannel):
+ (WebCore::WebSocketChannel::resume):
+ Just set one shot timer for resumeTimerFired() if not yet set.
+ (WebCore::WebSocketChannel::resumeTimerFired):
+ Process pending event after resume was called.
+ * websockets/WebSocketChannel.h:
+
+2010-06-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ REGRESSION(HTML5 parser): editing/selection/leave-requested-block.html can fail or crash
+ https://bugs.webkit.org/show_bug.cgi?id=40764
+
+ HTML5ScriptRunner was careful to only call CachedResource::addClient
+ for cases where the resource was not already loaded. This was to
+ avoid getting synchronous notifyFinished callbacks from inside
+ addClient. (The old HTMLDocumentParser also has hacks to work around
+ addClient's synchronous notifyFinished behavior for already-loaded
+ resources as well.)
+
+ It turns out that CachedResource will mark itself as purgeable if it
+ has no clients, thus it could have its data cleared (but itself not
+ deleted) in the case where we yield back to the runloop to wait for
+ CSS to load before executing the loaded script.
+
+ The fix is to act more like the old parser and always call addClient
+ on every CachedScript we load. But unlike the old parser, we're
+ careful not to re-enter from addClient -> notifyFinished
+ using guards in HTML5DocumentParser::watchForLoad.
+
+ I do not know how to make a CachedResource purge itself
+ from a LayoutTest, so this is not currently testable.
+ If anyone knows how I'm happy to make a test.
+
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::watchForLoad):
+ - It is now expected to call watchForLoad with a loaded script.
+ (WebCore::HTML5DocumentParser::notifyFinished):
+ - Now that watchForLoad is called with loaded scripts, notifyFinished
+ may be be called from addClient, thus we may be in the middle of
+ script execution when it's called. It's OK. We pass the call
+ along to HTML5ScriptRunner::executeScriptsWaitingForLoad
+ and it knows how to ignore the call in that case.
+ * html/HTML5DocumentParser.h:
+ - Document these member variables more.
+ * html/HTML5ScriptRunner.cpp:
+ (WebCore::HTML5ScriptRunner::~HTML5ScriptRunner):
+ (WebCore::HTML5ScriptRunner::executePendingScript):
+ (WebCore::HTML5ScriptRunner::hasScriptsWaitingForLoad):
+ (WebCore::HTML5ScriptRunner::watchForLoad):
+ - Set the pending script to RegisteringForWatch state before
+ watching and WatchingForLoad after.
+ (WebCore::HTML5ScriptRunner::stopWatchingForLoad):
+ - Set the pending script to NotWatchingForLoad.
+ (WebCore::HTML5ScriptRunner::executeScriptsWaitingForLoad):
+ - Assert that callers checked hasScriptsWaitingForLoad()
+ (WebCore::HTML5ScriptRunner::requestScript):
+ * html/HTML5ScriptRunner.h:
+ (WebCore::HTML5ScriptRunner::PendingScript::):
+ (WebCore::HTML5ScriptRunner::PendingScript::PendingScript):
+ (WebCore::HTML5ScriptRunner::PendingScript::watchingForLoad):
+ * html/HTML5ScriptRunnerHost.h:
+ - Document the new expectations of watchForLoad
+
+2010-06-17 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Prevent HTML5PreloadScanner from loading resources in <noscript> tags.
+ https://bugs.webkit.org/show_bug.cgi?id=40779
+
+ No new tests. Will create a layout test in a subsequent patch.
+
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTML5PreloadScanner::processToken):
+ * html/HTML5TreeBuilder.cpp:
+ (WebCore::HTML5TreeBuilder::adjustedLexerState):
+ (WebCore::HTML5TreeBuilder::passTokenToLegacyParser):
+ (WebCore::HTML5TreeBuilder::isScriptingFlagEnabled):
+ * html/HTML5TreeBuilder.h:
+
+2010-06-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTML5PreloadScanner parses <script> in DataState
+ https://bugs.webkit.org/show_bug.cgi?id=40804
+
+ The ScriptDataState is handled separately from the rest of the lexer
+ state changes because it's more complicted in the tree builder. The
+ easiest thing is to just handle it separately in the preloader too.
+
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTML5PreloadScanner::processToken):
+
+2010-06-17 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add CSS scanning to HTML5PreloadScanner
+ https://bugs.webkit.org/show_bug.cgi?id=40802
+
+ This patch just cribs the CSS preload scanning algorithm from the old
+ preload scanner. We also invented a way of testing the preload
+ scanner.
+
+ Tests: fast/preloader/image.html
+ fast/preloader/link.html
+ fast/preloader/script.html
+ fast/preloader/style.html
+
+ * Android.mk:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/CSSPreloadScanner.cpp: Added.
+ (WebCore::isWhitespace):
+ (WebCore::CSSPreloadScanner::CSSPreloadScanner):
+ (WebCore::CSSPreloadScanner::reset):
+ (WebCore::CSSPreloadScanner::scan):
+ (WebCore::CSSPreloadScanner::tokenize):
+ (WebCore::CSSPreloadScanner::emitRule):
+ * html/CSSPreloadScanner.h: Added.
+ (WebCore::CSSPreloadScanner::):
+ * html/HTML5PreloadScanner.cpp:
+ (WebCore::HTML5PreloadScanner::HTML5PreloadScanner):
+ (WebCore::HTML5PreloadScanner::processToken):
+ (WebCore::HTML5PreloadScanner::scanningBody):
+ * html/HTML5PreloadScanner.h:
+
+2010-06-17 Abhishek Arya <inferno@chromium.org>
+
+ Reviewed by David Kilzer.
+
+ (Landed by Dirk Pranke).
+
+ Check for a null frame before setting drag selection.
+ https://bugs.webkit.org/show_bug.cgi?id=38893
+ Same Layout test as https://bugs.webkit.org/show_bug.cgi?id=37168.
+
+ Test: editing/pasteboard/drag-drop-iframe-refresh-crash.html
+
+ Note that you need to run the test manually 20-30 times for the crash
+ to reproduce.
+
+ * editing/SelectionController.cpp:
+ (WebCore::SelectionController::setSelection):
+
+2010-06-17 Benjamin Poulain <benjamin.poulain@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Get rid of the the unused imageSize of ImageDecoderQt::internalHandleCurrentImage()
+ https://bugs.webkit.org/show_bug.cgi?id=40620
+
+ Remove an unused variable.
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+
+2010-06-17 Jeremy Moskovich <jeremy@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium API] Implement WebSandboxSupport on OS X and add stubs to allow
+ OOP loading of fonts.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40544
+
+ * platform/chromium/ChromiumBridge.h: Add prototype for loadFont()
+
+2010-06-17 Nicolas Weber <thakis@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix various warnings that are reported when building with clang
+ https://bugs.webkit.org/show_bug.cgi?id=40503
+
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::labelElementContainer):
+ * accessibility/AccessibilityTableCell.cpp:
+ (WebCore::AccessibilityTableCell::parentTable):
+ * bindings/v8/NPV8Object.cpp:
+ (WebCore::npObjectTypeInfo):
+ * bindings/v8/custom/V8HTMLAudioElementConstructor.cpp:
+ (WebCore::):
+ * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+ (WebCore::):
+ * bindings/v8/custom/V8HTMLOptionElementConstructor.cpp:
+ (WebCore::):
+ * css/CSSStyleSheet.h:
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::getNamedElements):
+ * inspector/InspectorValues.cpp:
+ (WebCore::InspectorObject::getObject):
+ (WebCore::InspectorObject::getArray):
+ * page/animation/AnimationBase.h:
+ * platform/graphics/BitmapImage.h:
+ (WTF::):
+ * platform/graphics/mac/FontPlatformData.h:
+ * rendering/RenderBlock.h:
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::ellipsisBox):
+ * storage/StorageNamespaceImpl.cpp:
+ (WebCore::StorageNamespaceImpl::storageArea):
+
+2010-06-17 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Pavel Feldman.
+
+ Add ENABLE(INSPECTOR) guard for m_sessionSettings
+ https://bugs.webkit.org/show_bug.cgi?id=40611
+
+ Build fix.
+
+ * inspector/InspectorController.h:
+
+2010-06-17 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Add FIXME to explain HTMLDocumentParser's forceSynchronous bool
+ https://bugs.webkit.org/show_bug.cgi?id=40609
+
+ No functional change, just adding comment.
+
+ * dom/Document.cpp:
+ (WebCore::Document::write):
+
+2010-06-13 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ WebCore EventHandler needs to take account of onLoad events
+ fired before layout() complete
+
+ https://bugs.webkit.org/show_bug.cgi?id=40102
+
+ WebCore 'cheats' by firing onLoad events before the frame's layout
+ has been performed. This can result in event listeners performing
+ operations that depend on the document's final layout, such as
+ scrolling operations.
+
+ When scrolling a frameview in eventhandler ensure the layout is complete.
+
+ * page/EventHandler.cpp:
+ (WebCore::EventHandler::scrollRecursively):
+
+2010-06-16 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add the error codes defined in the async DB spec to SQLError.idl and SQLError.h.
+ https://bugs.webkit.org/show_bug.cgi?id=40748
+
+ Test: storage/sql-error-codes.html
+
+ * storage/SQLError.h:
+ (WebCore::SQLError::):
+ * storage/SQLError.idl:
+ * storage/SQLStatement.cpp:
+ (WebCore::SQLStatement::execute):
+ (WebCore::SQLStatement::setDatabaseDeletedError):
+ (WebCore::SQLStatement::setVersionMismatchedError):
+ (WebCore::SQLStatement::setFailureDueToQuota):
+ (WebCore::SQLStatement::lastExecutionFailedDueToQuota):
+ * storage/SQLTransaction.cpp:
+ (WebCore::SQLTransaction::openTransactionAndPreflight):
+ (WebCore::SQLTransaction::deliverTransactionCallback):
+ (WebCore::SQLTransaction::handleCurrentStatementError):
+ (WebCore::SQLTransaction::deliverStatementCallback):
+ (WebCore::SQLTransaction::postflightAndCommit):
+
+2010-06-17 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Fix CRLF ending conversion in StringBlobItem.
+ https://bugs.webkit.org/show_bug.cgi?id=40736
+ Also: fix referencing uninitialized member bug and slice length bug
+ in hybrid blob case.
+
+ Tests will be added when we add BlobBuilder jsc bindings.
+
+ * platform/BlobItem.cpp:
+ (WebCore::StringBlobItem::convertToCString):
+ (WebCore::DataRangeBlobItem::DataRangeBlobItem):
+
+2010-06-17 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, rolling out r61340.
+ http://trac.webkit.org/changeset/61340
+ https://bugs.webkit.org/show_bug.cgi?id=36282
+
+ Broke several editing tests.
+
+ * css/CSSMutableStyleDeclaration.cpp:
+ (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::applyProperty):
+
+2010-06-17 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Add optional contentType parameter to Blob.slice per latest File API spec.
+ https://bugs.webkit.org/show_bug.cgi?id=40647
+
+ Tested by http/tests/local/resources/send-sliced-dragged-file.html.
+
+ * html/Blob.cpp:
+ (WebCore::Blob::slice):
+ * html/Blob.h:
+ * html/Blob.idl:
+
+2010-06-17 Jesus Sanchez-Palencia <jesus@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebKit does not support viewport meta tag
+ https://bugs.webkit.org/show_bug.cgi?id=39902
+
+ Add windowRect() to page client.
+
+ * platform/qt/QWebPageClient.h:
+
+2010-06-17 Stephen White <senorblanco@chromium.org>
+
+ Reviewed by David Levin.
+
+ Fix for slow multiple animated resize issue.
+ https://bugs.webkit.org/show_bug.cgi?id=38233
+
+ The timer-based resize quality approach implemented in
+ http://trac.webkit.org/changeset/34210 is a good idea, but doesn't
+ scale to multiple images with animated resizes. This fix unifies all
+ outstanding resize timers into a single timer, and removes the "use
+ last quality" check (which doesn't work when images are overlapping).
+ It also refactors the copy of this code implemented in
+ RenderBoxModelObject in http://trac.webkit.org/changeset/53949.
+
+ This improves Safari performance for the following IE9 platform demos on my C2D MacPro (10.5):
+ http://ie.microsoft.com/testdrive/Performance/01FlyingImages/Default.html (4->60fps)
+ http://ie.microsoft.com/testdrive/Performance/10FlickrExplorer/Default.html (3->16fps)
+ http://ie.microsoft.com/testdrive/Performance/11BrowserFlip/Default.html (9->60fps)
+
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::ImageQualityController::ImageQualityController):
+ Unify all timers into a single timer, rename RenderBoxModelScaleObserver
+ to ImageQualityController, and remove the resize quality "stickness",
+ since it doesn't work with multiple outstanding resizes.
+ (WebCore::ImageQualityController::objectDestroyed):
+ gImages global is now m_lastPaintTimeMap member.
+ (WebCore::ImageQualityController::highQualityRepaintTimerFired):
+ Function made non-static; repaint all pending resizes (not just one).
+ (WebCore::ImageQualityController::restartTimer):
+ Added function to restart timer at 1.05x threshold.
+ (WebCore::imageQualityController):
+ Static function to return singleton.
+ (WebCore::ImageQualityController::shouldPaintAtLowQuality):
+ Use m_lastPaintTimeMap, not gImages global. Implement new timer
+ algorithm. Remove resize "stickiness".
+ (WebCore::RenderBoxModelObject::shouldPaintAtLowQuality):
+ Implement shouldPaintAtLowQuality, which pulls out "this" and passes
+ the call to the ImageQualityController.
+ (WebCore::RenderBoxModelObject::~RenderBoxModelObject):
+ Call ImageQualityController singleton's objectDestroyed() instead of
+ old static function.
+ (WebCore::RenderBoxModelObject::paintFillLayerExtended):
+ Modify shouldPaintAtLowQuality() call to match new class name and
+ function signature.
+ * rendering/RenderBoxModelObject.h:
+ Expose shouldPaintAtLowQuality as a member function.
+ * rendering/RenderImage.cpp:
+ (WebCore::RenderImage::~RenderImage):
+ No need to call objectDestroyed() here anymore, since the
+ RenderBoxModelObject destructor will do this for us.
+ (WebCore::RenderImage::paintIntoRect):
+ Rip out RenderImageScaleObserver, and call
+ RenderBoxModelObject::shouldPaintAtLowQuality() instead.
+
+2010-06-17 Rob Buis <rwlbuis@gmail.com>
+
+ Reviewed by Dave Hyatt.
+
+ CSS3 "Property is declared twice in rule" test fails
+ https://bugs.webkit.org/show_bug.cgi?id=36282
+
+ Filter out duplicate properties in style declaration.
+
+ Test: fast/css/duplicate-property-in-rule.html
+
+ * css/CSSMutableStyleDeclaration.cpp: Filter out duplicate properties
+ (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
+ * css/CSSParser.cpp:
+ (WebCore::CSSParser::parseValue): Discard negative padding values
+ * css/CSSStyleSelector.cpp: Remove negative padding check
+ (WebCore::CSSStyleSelector::applyProperty):
+
+2010-06-17 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Clean up error conditions for Typed Arrays
+ https://bugs.webkit.org/show_bug.cgi?id=40755
+
+ * bindings/js/JSArrayBufferCustom.cpp:
+ (WebCore::JSArrayBufferConstructor::constructJSArrayBuffer):
+ - Fixed handling of NaN/+inf/-inf lengths. Throw RangeError for too-large or negative lengths.
+ * bindings/js/JSArrayBufferViewHelper.h:
+ (WebCore::constructArrayBufferView):
+ - Changed all error code paths to throw exceptions. Clarified exception types.
+ * bindings/js/JSFloat32ArrayCustom.cpp:
+ (WebCore::JSFloat32ArrayConstructor::constructJSFloat32Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/js/JSInt16ArrayCustom.cpp:
+ (WebCore::JSInt16ArrayConstructor::constructJSInt16Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/js/JSInt32ArrayCustom.cpp:
+ (WebCore::JSInt32ArrayConstructor::constructJSInt32Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/js/JSInt8ArrayCustom.cpp:
+ (WebCore::JSInt8ArrayConstructor::constructJSInt8Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/js/JSUint16ArrayCustom.cpp:
+ (WebCore::JSUint16ArrayConstructor::constructJSUint16Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/js/JSUint32ArrayCustom.cpp:
+ (WebCore::JSUint32ArrayConstructor::constructJSUint32Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/js/JSUint8ArrayCustom.cpp:
+ (WebCore::JSUint8ArrayConstructor::constructJSUint8Array):
+ - Removed throwing of INDEX_SIZE_ERROR, delegating responsibility to constructArrayBufferView.
+ * bindings/v8/custom/V8ArrayBufferCustom.cpp:
+ (WebCore::V8ArrayBuffer::constructorCallback):
+ - Fixed handling of NaN/+inf/-inf lengths. Throw RangeError for too-large or negative lengths.
+ Clarified exception types.
+ * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+ (WebCore::constructWebGLArray):
+ - Clarified exception types and throwing of exceptions along all error code paths.
+ * html/canvas/TypedArrayBase.h:
+ (WebCore::TypedArrayBase::create):
+ - Added necessary null checks during allocation.
+
+2010-06-17 Shu Chang <chang.shu@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Fix the link error on symbian with ENABLE_JIT=0.
+ 1. Add "#if ENABLE(JIT)" in the header file;
+ 2. Put feature enable/disable logic to a common.pri so
+ that both JavaScriptCore.pri and WebCore.pri can share.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40780
+
+ * WebCore.pri:
+
+2010-06-17 Kenneth Russell <kbr@google.com>
+
+ Reviewed by Oliver Hunt.
+
+ Differences in error reporting for overloaded methods causing fast/canvas/webgl/texImageTest.html to fail
+ https://bugs.webkit.org/show_bug.cgi?id=40750
+
+ Added V8Proxy::throwTypeError() and throwSyntaxError for parity
+ with JSC::throwTypeError() and throwSyntaxError. Changed
+ CodeGeneratorV8.pm to use throwTypeError for overload resolution
+ failures. Revised CodeGeneratorJS.pm to use throwVMTypeError
+ instead of manual call to JSValue::encode. Deleted now-unnecessary
+ Chromium expectations for fast/canvas/webgl/texImageTest.html.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/V8Proxy.cpp:
+ (WebCore::V8Proxy::throwTypeError):
+ (WebCore::V8Proxy::throwSyntaxError):
+ * bindings/v8/V8Proxy.h:
+
+2010-06-17 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Brady Eidson.
+
+ If Page::goToItem is passed a HistoryItem that is the current item,
+ then the page should be loaded again.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40660
+
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::recursiveGoToItem): Add a check to
+ recursiveGoToItem that matches the one in FrameLoader::loadItem.
+
+2010-06-17 Kwang Yul Seo <skyul@company100.net>
+
+ Reviewed by Kent Tamura.
+
+ [BREWMP] Build fix for DragDataBrew
+ https://bugs.webkit.org/show_bug.cgi?id=40610
+
+ http://trac.webkit.org/changeset/60957 was not applied to DragDataBrew.cpp.
+ Add FilenameConversionPolicy argument to DragData::containsURL and DragData::asURL.
+
+ * platform/brew/DragDataBrew.cpp:
+ (WebCore::DragData::containsURL):
+ (WebCore::DragData::asURL):
+
+2010-06-17 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by David Levin.
+
+ Rename internalformat to internalFormat
+ https://bugs.webkit.org/show_bug.cgi?id=40149
+
+ * html/canvas/WebGLFramebuffer.cpp: Rename internalformat to internalFormat.
+ (WebCore::WebGLFramebuffer::getColorBufferFormat):
+ * html/canvas/WebGLRenderbuffer.cpp: Ditto.
+ (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
+ * html/canvas/WebGLRenderbuffer.h: Ditto.
+ (WebCore::WebGLRenderbuffer::setInternalFormat):
+ (WebCore::WebGLRenderbuffer::getInternalFormat):
+ * html/canvas/WebGLRenderingContext.cpp: Ditto.
+ (WebCore::WebGLRenderingContext::copyTexImage2D):
+ (WebCore::WebGLRenderingContext::copyTexSubImage2D):
+ (WebCore::WebGLRenderingContext::framebufferRenderbuffer):
+ (WebCore::WebGLRenderingContext::getRenderbufferParameter):
+ (WebCore::WebGLRenderingContext::renderbufferStorage):
+ (WebCore::WebGLRenderingContext::texImage2DBase):
+ (WebCore::WebGLRenderingContext::isTexInternalFormatColorBufferCombinationValid):
+ * html/canvas/WebGLRenderingContext.h: Ditto.
+ * html/canvas/WebGLTexture.cpp: Ditto.
+ (WebCore::WebGLTexture::WebGLTexture):
+ * html/canvas/WebGLTexture.h: Ditto.
+ (WebCore::WebGLTexture::setInternalFormat):
+ (WebCore::WebGLTexture::getInternalFormat):
+
+2010-06-17 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by David Levin.
+
+ Remove input parameter validation for "level" upper limit in *tex* functions
+ https://bugs.webkit.org/show_bug.cgi?id=40603
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::validateTexFuncParameters): Don't check for "level" upper limit.
+
+2010-06-17 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Eric Seidel.
+
+ Clean EFL header files in order to diminish the compilation time with
+ EFL from subversion. We remove the EFL includes from header files and use
+ forward declarations, including the headers in correspondent source
+ files when needed. This causes only the needed source files to be
+ recompiled in case a new version of EFL is installed instead of
+ triggering a recompilation of almost all WebCore/WebKit.
+ https://bugs.webkit.org/show_bug.cgi?id=40575
+
+ No new functionalities, so no new tests.
+
+ * CMakeListsEfl.txt:
+ * platform/PlatformKeyboardEvent.h: forward declaration.
+ * platform/PlatformMouseEvent.h: forward declaration and change method
+ signature to not require enum.
+ * platform/PlatformWheelEvent.h: forward declaration.
+ * platform/Widget.h: forward declaration.
+ * platform/efl/PlatformKeyboardEventEfl.cpp: include needed header.
+ * platform/efl/PlatformMouseEventEfl.cpp:
+ (WebCore::PlatformMouseEvent::setClickCount): change method signature
+ as mentioned above.
+ * platform/efl/PlatformWheelEventEfl.cpp: include needed header.
+ * platform/efl/RenderThemeEfl.cpp: include needed header
+ * platform/efl/RenderThemeEfl.h: forward declaration.
+ * platform/efl/ScrollbarEfl.cpp: include needed header.
+ * platform/efl/ScrollbarEfl.h: forward declaration.
+ * platform/efl/WidgetEfl.cpp: include needed header.
+ * platform/graphics/FloatRect.h: remove unused method.
+ * platform/graphics/Icon.h: forward declaration.
+ * platform/graphics/IntRect.h: remove unused method.
+ * platform/graphics/efl/FloatRectEfl.cpp: Removed. This file was
+ implementing an unused method.
+ * platform/graphics/efl/IntRectEfl.cpp: Removed. This file was
+ implementing an unused method.
+
+2010-06-17 Alex Milowski <alex@milowski.com>
+
+ Reviewed by Darin Adler.
+
+ Fixed a compile error in the paint() methods by making them use the
+ new visitedDependentColor() method.
+ https://bugs.webkit.org/show_bug.cgi?id=40327
+
+ * mathml/RenderMathMLRoot.cpp:
+ (WebCore::RenderMathMLRoot::paint):
+ (WebCore::RenderMathMLRoot::layout): Fixed a crash where every child
+ was assumed to be a RenderMathMLBlock instance when that isn't the
+ case. Also, layout() needed to mark the index for layout before
+ calling layout() on the index.
+ * mathml/RenderMathMLSquareRoot.cpp:
+ (WebCore::RenderMathMLSquareRoot::paint):
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Use adoptRef and create functions in more code paths
+ https://bugs.webkit.org/show_bug.cgi?id=40760
+
+ This helps prepare for an assertion that fires if you ref or destroy an
+ object before calling adoptRef on it. That will help us catch mistakes
+ that can lead to storage leaks.
+
+ * WebCore.base.exp: Updated export now that Frame::create is not an
+ inline function.
+
+ * css/CSSInitialValue.h:
+ (WebCore::CSSInitialValue::createExplicit): Use create.
+ (WebCore::CSSInitialValue::createImplicit): Ditto.
+ (WebCore::CSSInitialValue::create): Added.
+
+ * css/CSSPrimitiveValue.cpp:
+ (WebCore::CSSPrimitiveValue::createUncachedIdentifier): Added.
+ (WebCore::CSSPrimitiveValue::createUncachedColor): Added.
+ (WebCore::CSSPrimitiveValue::createUncached): Added.
+ (WebCore::CSSPrimitiveValue::createIdentifier): Use createUncachedIdentifier
+ instead of using new directly.
+ (WebCore::CSSPrimitiveValue::createColor): Use createUncachedColor instead
+ of using new directly.
+ (WebCore::CSSPrimitiveValue::create): Use createdUncached instead of using
+ new directly.
+ * css/CSSPrimitiveValue.h: Declare the new functions above.
+
+ * css/CSSStyleSelector.cpp:
+ (WebCore::loadFullDefaultStyle): Deref simpleDefaultStyleSheet instead of
+ explicitly deleting it.
+
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::SubresourceLoader): Move the call to
+ addSubresourceLoader out of here.
+ (WebCore::SubresourceLoader::create): Move it in here. This makes it so
+ we don't ref the loader before finishing its creation and calling adoptRef.
+
+ * page/Frame.cpp:
+ (WebCore::Frame::Frame): Move the call to setMainFrame out of here.
+ Also refactor the code so an assertion is easier to read.
+ (WebCore::Frame::create): Move the call to setMainFrame in here.
+ This makes it so we don't ref the frame before finishing its creation
+ and calling adoptRef.
+ * page/Frame.h: Made the create function non-inline.
+
+ * platform/text/BidiContext.cpp:
+ (WebCore::BidiContext::createUncached): Added.
+ (WebCore::BidiContext::create): Call createUncached instead of callling
+ new directly.
+ * platform/text/BidiContext.h: Declare createUncached.
+
+ * rendering/RenderSVGResourceFilter.cpp:
+ (WebCore::RenderSVGResourceFilter::buildPrimitives): Use PassRefPtr and
+ RefPtr instead of OwnPtr. And use the create function instead of new.
+ * rendering/RenderSVGResourceFilter.h: Ditto.
+ * rendering/SVGRenderTreeAsText.cpp:
+ (WebCore::writeSVGResourceContainer): Ditto.
+
+ * storage/StorageAreaImpl.cpp:
+ (WebCore::StorageAreaImpl::StorageAreaImpl): Move the code that calls
+ StorageAreaSync::create out of here.
+ (WebCore::StorageAreaImpl::create): Move it in here. This makes it so we
+ don't ref the storage area before finishing its creation and calling adoptRef.
+
+ * svg/SVGPaint.cpp:
+ (WebCore::SVGPaint::defaultFill): Use create instead of new.
+ (WebCore::SVGPaint::defaultStroke): Ditto.
+
+ * svg/graphics/filters/SVGFilterBuilder.h: Made the constructor private
+ and added a create function since this is a reference counted object and
+ should not be constructed directly.
+
+2010-06-17 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Gustavo Noronha.
+
+ Update CMake build system to use new script for generating source files
+ with gperf (r61091).
+ This updates also the build system to cope with recent changes to
+ source files list.
+ https://bugs.webkit.org/show_bug.cgi?id=40628
+
+ No new tests since it's just compilation fixes.
+
+ * CMakeLists.txt:
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix boolean reflected attributes to use empty string consistently for the content attribute value
+ https://bugs.webkit.org/show_bug.cgi?id=40758
+
+ Test: fast/dom/boolean-attribute-reflection.html
+
+ The HTML5 specification and other browsers are all consistent:
+ When setting a boolean IDL attribute to true, the attribute value
+ gets set to the empty string. The guidelines for authors allow either
+ the empty string or the name of the attribute, but for implementers
+ of the DOM, the reflected attribute gets empty string.
+
+ * dom/Element.cpp:
+ (WebCore::Element::setBooleanAttribute): Use emptyAtom to set the
+ attribute to the empty string.
+
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::setAutofocus): Use the empty string,
+ not "autofocus".
+ (WebCore::HTMLFormControlElement::setRequired): Use the empty string,
+ not "required".
+
+2010-06-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Unreviewed: chromium tests fix. Added InspectorBackend delegates for new inspector methods.
+
+ * inspector/front-end/InspectorBackendStub.js:
+ (.WebInspector.InspectorBackendStub.prototype.clearConsoleMessages):
+ (.WebInspector.InspectorBackendStub.prototype.getOuterHTML):
+ (.WebInspector.InspectorBackendStub.prototype.setOuterHTML):
+ (.WebInspector.InspectorBackendStub.prototype.addInspectedNode):
+
+2010-06-17 Mark Brand <mabrand@mabrand.nl>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] use "win32-g++*" scope to match all MinGW makespecs
+
+ The scope "win32-g++" comes from the name of the makespec. However, it
+ is frequently used to check for MinGW. This works fine as long as
+ win32-g++ is the only makespec for MinGW. Now we need the wildcard
+ to cover "win32-g++-cross" as well.
+
+ * WebCore.pro:
+
+2010-06-16 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joe Pecoraro.
+
+ Web Inspector: move get/setOuterHTML, addInspectedNode and
+ clearConsole to native InspectorDOMAgent. This is done to allow
+ inspected nodes array to store nodes from different domains,
+ also moves outerhtml manipulation closer to the rest of the DOM
+ operations. In addition to that, we are slowly getting rid of
+ InjectedScriptAccess in favor of IDL-defined InspectorBackend
+ interface for clearer remote debugging API.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40733
+
+ * inspector/InjectedScriptHost.cpp:
+ (WebCore::InjectedScriptHost::inspectedNode):
+ * inspector/InjectedScriptHost.h:
+ * inspector/InspectorBackend.cpp:
+ (WebCore::InspectorBackend::changeTagName):
+ (WebCore::InspectorBackend::getOuterHTML):
+ (WebCore::InspectorBackend::setOuterHTML):
+ (WebCore::InspectorBackend::addInspectedNode):
+ (WebCore::InspectorBackend::clearConsoleMessages):
+ * inspector/InspectorBackend.h:
+ * inspector/InspectorBackend.idl:
+ * inspector/InspectorDOMAgent.cpp:
+ (WebCore::InspectorDOMAgent::inspectedNode):
+ (WebCore::InspectorDOMAgent::changeTagName):
+ (WebCore::InspectorDOMAgent::getOuterHTML):
+ (WebCore::InspectorDOMAgent::setOuterHTML):
+ (WebCore::InspectorDOMAgent::addInspectedNode):
+ * inspector/InspectorDOMAgent.h:
+ * inspector/InspectorFrontend.cpp:
+ (WebCore::InspectorFrontend::didGetOuterHTML):
+ (WebCore::InspectorFrontend::didSetOuterHTML):
+ * inspector/InspectorFrontend.h:
+ * inspector/front-end/ConsoleView.js:
+ (WebInspector.ConsoleView.prototype.requestClearMessages):
+ * inspector/front-end/DOMAgent.js:
+ * inspector/front-end/ElementsPanel.js:
+ (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged):
+ (WebInspector.ElementsPanel):
+ * inspector/front-end/ElementsTreeOutline.js:
+ (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted.changeTagNameCallback):
+ (WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted):
+ ():
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ * inspector/front-end/InjectedScriptAccess.js:
+
+2010-06-17 John Gregg <johnnyg@google.com>
+
+ Reviewed by David Levin.
+
+ Move the call to the notification presenter that a Notification is being
+ destroyed from the destructor (not safe) to the ActiveDOMObject::contextDestroyed
+ method.
+
+ Also fix up an incorrect reference loss in the V8 bindings code for Notifications.
+ https://bugs.webkit.org/show_bug.cgi?id=40097
+
+ No new tests; code paths are well-covered by existing tests.
+
+ * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+ (WebCore::V8NotificationCenter::createHTMLNotificationCallback):
+ (WebCore::V8NotificationCenter::createNotificationCallback):
+ * notifications/Notification.cpp:
+ (WebCore::Notification::~Notification):
+ (WebCore::Notification::contextDestroyed):
+ * notifications/Notification.h:
+
+2010-06-17 Csaba Osztrogonác <ossy@webkit.org>
+
+ Unreviewed rollout r61311, because it made 2 tests fail on Qt bot.
+
+ [Qt] NPP_SetWindow seems to not be called when TestNetscapePlugin is moved
+ https://bugs.webkit.org/show_bug.cgi?id=36702
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+
+2010-05-28 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ Reviewed by Simon Hausmann, Antti Koivisto
+
+ Make repaint throttling parameters runtime configurable.
+ https://bugs.webkit.org/show_bug.cgi?id=38401
+
+ REPAINT_THROTTLING now chooses default values for throttling parameters.
+ Should be removed when applications start using runtime configuration.
+
+ * page/FrameView.cpp:
+ (WebCore::FrameView::reset):
+ (WebCore::FrameView::updateDeferredRepaintDelay):
+ (WebCore::FrameView::setRepaintThrottlingDeferredRepaintDelay):
+ (WebCore::FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading):
+ (WebCore::FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading):
+ (WebCore::FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading):
+ * page/FrameView.h:
+
+2010-06-17 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] NPP_SetWindow seems to not be called when TestNetscapePlugin is moved
+
+ https://bugs.webkit.org/show_bug.cgi?id=36702
+
+ setNPWindowIfNeeded() is called on paint() in PluginViewQt, which doesn't
+ work for DRT. So call it if we are in DRT mode and the window geometry
+ has changed.
+
+ Unskips plugins/reentrant-update-widget-positions.html
+
+ * plugins/qt/PluginViewQt.cpp:
+ (WebCore::PluginView::updatePluginWidget):
+
+2010-06-17 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Kenneth Christiansen.
+
+ [Qt] Avoid unnecessary calls to save() and restore() when drawing images
+
+ Avoid calling the expensive save() and restore() on the GraphicsContext just
+ for changing the composition mode. Instead save and restore it manually
+ on QPainter.
+
+ Change fac227f609e544f8f55aca8447b4328d6534407a in Qt makes sure that the
+ call to QPainter::setCompositionMode doesn't do anything if the mode hasn't
+ changed.
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::toQtCompositionMode):
+ * platform/graphics/qt/ImageQt.cpp:
+ (WebCore::BitmapImage::draw):
+
+2010-06-16 Dawit Alemayehu <adawit@kde.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebKit crashes while initializing flash plugin 10.1.53.64.
+ https://bugs.webkit.org/show_bug.cgi?id=40567
+
+ Avoid preventable crashes by ensuring gtk_init() is called in the
+ flash viewer plugins before calling NP_Initialize.
+
+ * plugins/qt/PluginPackageQt.cpp:
+ (WebCore::PluginPackage::load):
+
+2010-06-16 Tony Gentilcore <tonyg@chromium.org>
+
+ Reviewed by David Levin.
+
+ Guarantee that references are held for CachedScripts in HTMLDocumentParser.
+ https://bugs.webkit.org/show_bug.cgi?id=40177
+
+ No new tests because no new functionality.
+
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::reset):
+ (WebCore::HTMLDocumentParser::executeExternalScriptsIfReady):
+
+2010-06-16 Qi Zhang <qi.2.zhang@nokia.com>
+
+ Reviewed by Laszlo Gombos.
+
+ [Qt] Repeat pattern should start from origin
+ https://bugs.webkit.org/show_bug.cgi?id=39225
+
+ Patterns must be painted so that the top left of the first image
+ is anchored at the origin of the coordinate space.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::drawRepeatPattern):
+ (WebCore::GraphicsContext::fillRect):
+
+2010-06-16 Jarkko Sakkinen <jarkko.j.sakkinen@gmail.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] WebGL viewport does not show up on N900
+ https://bugs.webkit.org/show_bug.cgi?id=38528
+
+ With OGLES2 add default precision to the shader code.
+ Use GLsizeiptr and GLintptr with OGLES2.
+ Call paint() in beginPaint() so that drawTexture() is used
+ whenever possible.
+
+ * platform/graphics/qt/GraphicsContext3DQt.cpp:
+ (WebCore::GraphicsContext3D::beginPaint):
+ (WebCore::GraphicsContext3D::paint):
+ (WebCore::GraphicsContext3D::shaderSource):
+
+2010-06-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Fraser.
+
+ Spatial Navigation: refactor scrollInDirection to work with scrollable content
+ https://bugs.webkit.org/show_bug.cgi?id=39195
+
+ scrollInDirection now receives as parameter the node that the Spatial Navigation
+ found as the more appropriated to move focus to. If it is in a scrollable container
+ (e.g. <div> with clipped overflow content), it scrolls recursively starting from
+ the container, not the current focused node.
+
+ Test: fast/events/spatial-navigation/snav-only-clipped-overflow-content.html
+
+ * page/FocusController.cpp:
+ (WebCore::FocusController::advanceFocusDirectionally):
+ * page/SpatialNavigation.cpp:
+ (WebCore::scrollInDirection):
+ * page/SpatialNavigation.h:
+
+2010-06-16 Brady Eidson <beidson@apple.com>
+
+ Reviewed by Eric Carlson
+
+ <rdar://problem/7249553> and https://bugs.webkit.org/show_bug.cgi?id=40749
+ ResourceLoader::willCacheResponse() needs to null-check Frame::Settings()
+
+ No new tests. (Discovered via crash reports, no reproducible cases noted)
+
+ * loader/ResourceLoader.cpp:
+ (WebCore::ResourceLoader::willCacheResponse): Null check m_frame->settings(),
+ but also add an ASSERT so debug-build developers can learn more about why
+ this might be happening.
+
+2010-06-16 Darin Adler <darin@apple.com>
+
+ Try to fix the MathML build.
+
+ * mathml/MathMLMathElement.h: Added missing return type.
+
+2010-06-16 Darin Adler <darin@apple.com>
+
+ Reviewed by David Levin.
+
+ Deploy adoptRef in more places, including all HTML and MathML elements
+ https://bugs.webkit.org/show_bug.cgi?id=39941
+
+ * dom/Element.cpp:
+ (WebCore::Element::dispatchAttrRemovalEvent): Use create instead of new
+ in commented-out code.
+ (WebCore::Element::dispatchAttrAdditionEvent): Ditto.
+
+ * dom/Node.h: Removed now-unused CreateElementZeroRefCount and
+ CreateHTMLElementZeroRefCount.
+
+ * editing/InsertListCommand.cpp:
+ (WebCore::InsertListCommand::insertList): Use create instead of new, fixing
+ a storage leak.
+
+ * editing/ModifySelectionListLevel.cpp:
+ (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
+ Removed "WithType" from function name. Use create instead of new, fixing a
+ storage leak.
+ (WebCore::DecreaseSelectionListLevelCommand::decreaseSelectionListLevel): Use
+ create instead of new, fixing a storage leak.
+
+ * storage/IndexedDatabaseImpl.cpp:
+ (WebCore::IndexedDatabaseImpl::create): Use adoptRef, fixing a storage leak.
+
+ * editing/ModifySelectionListLevel.h: Added create functions.
+
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::HTMLAnchorElement):
+ * html/HTMLFrameOwnerElement.cpp:
+ (WebCore::HTMLFrameOwnerElement::HTMLFrameOwnerElement):
+ * html/HTMLMeterElement.cpp:
+ (WebCore::HTMLMeterElement::HTMLMeterElement):
+ * html/HTMLProgressElement.cpp:
+ (WebCore::HTMLProgressElement::HTMLProgressElement):
+ Removed code to explicitly pass CreateHTMLElement construction type since that's
+ now the type used for all HTML elements.
+
+ * html/HTMLFormControlElement.cpp:
+ (WebCore::HTMLFormControlElement::HTMLFormControlElement):
+ * html/HTMLFormControlElement.h:
+ Removed construction type argument, since CreateHTMLElement is now the type used
+ for all HTML elements.
+
+ * mathml/MathMLElement.cpp:
+ (WebCore::MathMLElement::MathMLElement): Removed construction type of
+ CreateStyledElementZeroRefCount so we'll use the default construction
+ type, CreateStyledElement.
+ (WebCore::MathMLElement::create): Use adoptRef.
+
+ * mathml/MathMLElement.h: Made isMathMLElement function private and
+ removed unneeded override of createRenderer, because it did the
+ same thing as the base class's createRenderer function.
+
+ * mathml/MathMLInlineContainerElement.cpp:
+ (WebCore::MathMLInlineContainerElement::create): Use adoptRef.
+ (WebCore::MathMLInlineContainerElement::createRenderer):
+ Removed unnecessarily initialization of local variable and removed the
+ case for mathTag, since that uses a different derived class.
+
+ * mathml/MathMLInlineContainerElement.h: Made createRenderrer override
+ private.
+
+ * mathml/MathMLMathElement.cpp:
+ (WebCore::MathMLMathElement::MathMLMathElement): Marked inline since
+ it is called in only one place.
+ (WebCore::MathMLMathElement::create): Use adoptRef.
+ (WebCore::MathMLMathElement::createRenderer): Added. Creates a
+ RenderMathMLMath object.
+
+ * mathml/MathMLMathElement.h: Made constructor private and added a
+ private override of createRenderer.
+
+ * mathml/MathMLTextElement.cpp:
+ (WebCore::MathMLTextElement::MathMLTextElement): Marked inline since
+ it is called in only one place.
+ (WebCore::MathMLTextElement::create): Use adoptRef.
+ (WebCore::MathMLTextElement::createRenderer): Changed to call through
+ to the base class instead of calling RenderObject::createObject directly.
+
+ * mathml/MathMLTextElement.h: Made the constructor and createRenderer
+ function private.
+
+ * rendering/RenderFileUploadControl.cpp:
+ (WebCore::RenderFileUploadControl::RenderFileUploadControl):
+ Removed an unneeded initializer.
+
+ * rendering/RenderProgress.cpp: Tweaked includes.
+
+ * rendering/ShadowElement.cpp: Added a "using namespace" directive.
+ * rendering/ShadowElement.h: Tweaked formatting. Made more functions
+ private.
+
+ * editing/DeleteButton.cpp:
+ (WebCore::DeleteButton::create):
+ * html/HTMLAudioElement.cpp:
+ (WebCore::HTMLAudioElement::create):
+ (WebCore::HTMLAudioElement::createForJSConstructor):
+ * html/HTMLBRElement.cpp:
+ (WebCore::HTMLBRElement::create):
+ * html/HTMLBaseElement.cpp:
+ (WebCore::HTMLBaseElement::create):
+ * html/HTMLBaseFontElement.cpp:
+ (WebCore::HTMLBaseFontElement::create):
+ * html/HTMLBlockquoteElement.cpp:
+ (WebCore::HTMLBlockquoteElement::create):
+ * html/HTMLBodyElement.cpp:
+ (WebCore::HTMLBodyElement::create):
+ * html/HTMLButtonElement.cpp:
+ (WebCore::HTMLButtonElement::create):
+ * html/HTMLCanvasElement.cpp:
+ (WebCore::HTMLCanvasElement::create):
+ * html/HTMLDListElement.cpp:
+ (WebCore::HTMLDListElement::create):
+ * html/HTMLDataGridCellElement.cpp:
+ (WebCore::HTMLDataGridCellElement::create):
+ * html/HTMLDataGridColElement.cpp:
+ (WebCore::HTMLDataGridColElement::create):
+ * html/HTMLDataGridElement.cpp:
+ (WebCore::HTMLDataGridElement::create):
+ * html/HTMLDataGridRowElement.cpp:
+ (WebCore::HTMLDataGridRowElement::create):
+ * html/HTMLDataListElement.cpp:
+ (WebCore::HTMLDataListElement::create):
+ * html/HTMLDivElement.cpp:
+ (WebCore::HTMLDivElement::create):
+ * html/HTMLElement.cpp:
+ (WebCore::HTMLElement::create):
+ * html/HTMLElement.h:
+ (WebCore::HTMLElement::HTMLElement):
+ * html/HTMLFieldSetElement.cpp:
+ (WebCore::HTMLFieldSetElement::create):
+ * html/HTMLFontElement.cpp:
+ (WebCore::HTMLFontElement::create):
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::create):
+ * html/HTMLFrameSetElement.cpp:
+ (WebCore::HTMLFrameSetElement::create):
+ * html/HTMLHRElement.cpp:
+ (WebCore::HTMLHRElement::create):
+ * html/HTMLHeadElement.cpp:
+ (WebCore::HTMLHeadElement::create):
+ * html/HTMLHeadingElement.cpp:
+ (WebCore::HTMLHeadingElement::create):
+ * html/HTMLHtmlElement.cpp:
+ (WebCore::HTMLHtmlElement::create):
+ * html/HTMLImageElement.cpp:
+ (WebCore::HTMLImageElement::create):
+ (WebCore::HTMLImageElement::createForJSConstructor):
+ * html/HTMLInputElement.cpp:
+ (WebCore::HTMLInputElement::create):
+ * html/HTMLIsIndexElement.cpp:
+ (WebCore::HTMLIsIndexElement::create):
+ * html/HTMLKeygenElement.cpp:
+ (WebCore::HTMLKeygenElement::create):
+ * html/HTMLLIElement.cpp:
+ (WebCore::HTMLLIElement::create):
+ * html/HTMLLabelElement.cpp:
+ (WebCore::HTMLLabelElement::create):
+ * html/HTMLLegendElement.cpp:
+ (WebCore::HTMLLegendElement::create):
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::create):
+ * html/HTMLMapElement.cpp:
+ (WebCore::HTMLMapElement::create):
+ * html/HTMLMarqueeElement.cpp:
+ (WebCore::HTMLMarqueeElement::create):
+ * html/HTMLMenuElement.cpp:
+ (WebCore::HTMLMenuElement::create):
+ * html/HTMLMetaElement.cpp:
+ (WebCore::HTMLMetaElement::create):
+ * html/HTMLModElement.cpp:
+ (WebCore::HTMLModElement::create):
+ * html/HTMLNoScriptElement.cpp:
+ (WebCore::HTMLNoScriptElement::create):
+ * html/HTMLOListElement.cpp:
+ (WebCore::HTMLOListElement::create):
+ * html/HTMLOptGroupElement.cpp:
+ (WebCore::HTMLOptGroupElement::create):
+ * html/HTMLOptionElement.cpp:
+ (WebCore::HTMLOptionElement::create):
+ (WebCore::HTMLOptionElement::createForJSConstructor):
+ * html/HTMLParagraphElement.cpp:
+ (WebCore::HTMLParagraphElement::create):
+ * html/HTMLParamElement.cpp:
+ (WebCore::HTMLParamElement::create):
+ * html/HTMLPreElement.cpp:
+ (WebCore::HTMLPreElement::create):
+ * html/HTMLQuoteElement.cpp:
+ (WebCore::HTMLQuoteElement::create):
+ * html/HTMLScriptElement.cpp:
+ (WebCore::HTMLScriptElement::create):
+ * html/HTMLSelectElement.cpp:
+ (WebCore::HTMLSelectElement::create):
+ * html/HTMLSourceElement.cpp:
+ (WebCore::HTMLSourceElement::create):
+ * html/HTMLStyleElement.cpp:
+ (WebCore::HTMLStyleElement::create):
+ * html/HTMLTableCaptionElement.cpp:
+ (WebCore::HTMLTableCaptionElement::create):
+ * html/HTMLTableCellElement.cpp:
+ (WebCore::HTMLTableCellElement::create):
+ * html/HTMLTableColElement.cpp:
+ (WebCore::HTMLTableColElement::create):
+ * html/HTMLTableElement.cpp:
+ (WebCore::HTMLTableElement::create):
+ * html/HTMLTableRowElement.cpp:
+ (WebCore::HTMLTableRowElement::create):
+ * html/HTMLTableSectionElement.cpp:
+ (WebCore::HTMLTableSectionElement::create):
+ * html/HTMLTextAreaElement.cpp:
+ (WebCore::HTMLTextAreaElement::create):
+ * html/HTMLTitleElement.cpp:
+ (WebCore::HTMLTitleElement::create):
+ * html/HTMLUListElement.cpp:
+ (WebCore::HTMLUListElement::create):
+ * html/HTMLVideoElement.cpp:
+ (WebCore::HTMLVideoElement::create):
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageDocumentElement::create):
+ * rendering/MediaControlElements.cpp:
+ (WebCore::MediaControlShadowRootElement::create):
+ (WebCore::MediaControlElement::create):
+ (WebCore::MediaControlTimelineContainerElement::create):
+ (WebCore::MediaControlVolumeSliderContainerElement::create):
+ (WebCore::MediaControlStatusDisplayElement::create):
+ (WebCore::MediaControlMuteButtonElement::create):
+ (WebCore::MediaControlPlayButtonElement::create):
+ (WebCore::MediaControlSeekButtonElement::create):
+ (WebCore::MediaControlRewindButtonElement::create):
+ (WebCore::MediaControlReturnToRealtimeButtonElement::create):
+ (WebCore::MediaControlToggleClosedCaptionsButtonElement::create):
+ (WebCore::MediaControlTimelineElement::create):
+ (WebCore::MediaControlVolumeSliderElement::create):
+ (WebCore::MediaControlFullscreenButtonElement::create):
+ (WebCore::MediaControlTimeDisplayElement::create):
+ * rendering/RenderSlider.cpp:
+ (WebCore::SliderThumbElement::create):
+ * rendering/TextControlInnerElements.cpp:
+ (WebCore::TextControlInnerElement::create):
+ (WebCore::TextControlInnerTextElement::create):
+ (WebCore::SearchFieldResultsButtonElement::create):
+ (WebCore::SearchFieldCancelButtonElement::create):
+ (WebCore::SpinButtonElement::create):
+ Use adoptRef.
+
+2010-06-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ HTML5 parser crash when setTimeout document.write after slow script
+ https://bugs.webkit.org/show_bug.cgi?id=40726
+
+ According to the HTML5 spec, we're supposed to open() a new document if
+ we receive a document.write() after we've received EOF for the network.
+ The old parser just dumped those bytes onto the end of the network
+ stream. After this patch, our behavior matches Minefield.
+
+ Test: http/tests/misc/write-while-waiting.html
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * dom/Document.cpp:
+ (WebCore::Document::write):
+ * dom/DocumentParser.h:
+ * dom/XMLDocumentParser.cpp:
+ (WebCore::XMLDocumentParser::finishWasCalled):
+ * dom/XMLDocumentParser.h:
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::finishWasCalled):
+ * html/HTML5DocumentParser.h:
+ (WebCore::HTML5DocumentParser::InputStream::isClosed):
+ * html/HTMLDocumentParser.cpp:
+ (WebCore::HTMLDocumentParser::finishWasCalled):
+ * html/HTMLDocumentParser.h:
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageTokenizer::finishWasCalled):
+ * loader/MediaDocument.cpp:
+ (WebCore::MediaDocumentParser::finishWasCalled):
+ * loader/PluginDocument.cpp:
+ (WebCore::PluginDocumentParser::finishWasCalled):
+ * loader/SinkDocument.cpp:
+ (WebCore::SinkDocumentParser::finishWasCalled):
+ * loader/TextDocument.cpp:
+ (WebCore::TextDocumentParser::finishWasCalled):
+
+2010-06-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] ClipboardGtk::setURL does not match the behavior of other platforms
+ https://bugs.webkit.org/show_bug.cgi?id=40640
+
+ Instead of writing URL labels to the text portion of the clipboard or
+ drag-and-drop data, write the URL itself. Also escape the label text
+ of URLs. Abstracts logic into DataObjectGtk, so ClipboardGtk and
+ PasteboardGtk can share it.
+
+ Tests for this issue will be activated when dropping support has been
+ added to the GTK+ EventSender.
+
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::ClipboardGtk::writeURL): Use DataObjectGtk::setURL.
+ * platform/gtk/DataObjectGtk.cpp:
+ (WebCore::DataObjectGtk::setURL):
+ Added. Write URL to the text portion and remember to escape the
+ label when creating the markup portion.
+ * platform/gtk/DataObjectGtk.h: Add declaration of new method.
+ * platform/gtk/PasteboardGtk.cpp:
+ (WebCore::Pasteboard::writeURL): Use DataObjectGtk::setURL.
+
+2010-06-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Hit assertion in WebCore::HTML5Token::appendToSystemIdentifier
+ https://bugs.webkit.org/show_bug.cgi?id=40729
+
+ This was a copy/paste error. Yay for ASSERTs.
+
+ * html/HTML5Lexer.cpp:
+ (WebCore::HTML5Lexer::nextToken):
+
+2010-06-16 Stuart Morgan <stuartmorgan@chromium.org>
+
+ Reviewed by Anders Carlsson.
+
+ Bring npapi.h more in line with upstream npapi-headers version:
+ - Remove obsolete XP_MAC sections.
+ - Remove Metrowerks defines.
+ - Add OS/2 defines.
+ - Add Maemo defines.
+ - Add new version of the custom Carbon event definitions.
+ - Sync platform define style/details
+
+ https://bugs.webkit.org/show_bug.cgi?id=38666
+
+ * bridge/npapi.h:
+
+2010-06-16 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Allow transitions and animations of clip: rect
+ https://bugs.webkit.org/show_bug.cgi?id=38130
+
+ Make the CSS clip property animatable.
+
+ Test: transitions/clip-transition.html
+
+ * page/animation/AnimationBase.cpp:
+ (WebCore::blendFunc): New blend function for LengthBox
+ (WebCore::AnimationBase::ensurePropertyMap): Create a PropertyWrapper for LengthBoxes.
+
+ * platform/LengthBox.h:
+ (WebCore::LengthBox::LengthBox): New ctor that takes 4 length values.
+ * rendering/style/RenderStyle.h:
+ (WebCore::InheritedFlags::setClip): New method that takes a LengthBox.
+
+2010-06-16 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fix clipping via CSS clip: with composited descendants
+ https://bugs.webkit.org/show_bug.cgi?id=40579
+
+ Consult the 'clip' style, as well as overflow, when creating clipping
+ compositing layers.
+
+ Tests: compositing/geometry/clip.html
+ compositing/overflow/clip-descendents.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::clipBox): Utility function that returns the union of the clip and overflow
+ boxes.
+ (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Use clipBox() to
+ get the correct clipping rectangle.
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer): Look for
+ clip as well as overflow.
+ (WebCore::RenderLayerCompositor::clipsCompositingDescendants): Ditto.
+
+2010-06-16 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ REGRESSION: Undocked inspector toolbar is white
+ https://bugs.webkit.org/show_bug.cgi?id=40644
+
+ Make the html element 100% height so that we don't erase the background to white, after r61215.
+
+ * inspector/front-end/inspector.css:
+ (html):
+
+2010-06-16 Brian Weinstein <bweinstein@apple.com>
+
+ Reviewed by Darin Adler.
+
+ User scripts injected on start are not run on image documents.
+ https://bugs.webkit.org/show_bug.cgi?id=40722
+ <rdar://8087394>
+
+ User scripts that are injected on start are run from FrameLoader::dispatchDocumentElementAvailable,
+ but this is never called from ImageDocument, so call it when we create a document element for
+ our image document.
+
+ * loader/ImageDocument.cpp:
+ (WebCore::ImageDocument::createDocumentStructure): Call FrameLoader::dispatchDocumentElementAvailable
+ after creating our document element.
+
+2010-06-16 Brady Eidson <beidson@apple.com>
+
+ Reviewed by NOBODY (Build fix for Mac)
+
+ * WebCore.xcodeproj/project.pbxproj: Make paths relative to the project root.
+
+2010-06-16 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40643
+
+ Second of three steps - rename Canvas3DLayer to WebGLLayer
+
+ * WebCore.xcodeproj/project.pbxproj:
+ * platform/graphics/mac/Canvas3DLayer.h: Removed.
+ * platform/graphics/mac/Canvas3DLayer.mm: Removed.
+ * platform/graphics/mac/GraphicsLayerCA.mm:
+ (WebCore::GraphicsLayerCA::setContentsToGraphicsContext3D):
+ * platform/graphics/mac/WebGLLayer.h: Copied from WebCore/platform/graphics/mac/Canvas3DLayer.h.
+ * platform/graphics/mac/WebGLLayer.mm: Copied from WebCore/platform/graphics/mac/Canvas3DLayer.mm.
+
+2010-06-16 Chris Marrin <cmarrin@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40643
+
+ Rename GraphicsContext3DMac.cpp so it can interact with CALayer
+
+ * platform/graphics/mac/GraphicsContext3DMac.cpp: Removed.
+ * platform/graphics/mac/GraphicsContext3DMac.mm: Copied from WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp.
+ * WebCore.xcodeproj/project.pbxproj
+
+2010-06-16 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Add new files, needed in SVG Text rewrite
+ https://bugs.webkit.org/show_bug.cgi?id=40676
+
+ Land SVGTextChunkLayoutInfo.cpp and SVGTextQuery.(cpp|h), both with an "#if 0" on top, as they will be needed
+ in a later patch, completing the SVG Text rewrite, that will enable them.
+
+ Doesn't affect any code for now, it should just reduce the review amount.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * rendering/SVGTextChunkLayoutInfo.cpp: Added.
+ (WebCore::cummulatedWidthOrHeightOfTextChunk):
+ (WebCore::cummulatedWidthOfTextChunk):
+ (WebCore::cummulatedHeightOfTextChunk):
+ (WebCore::calculateTextAnchorShiftForTextChunk):
+ (WebCore::applyTextAnchorToTextChunk):
+ (WebCore::calculateTextLengthCorrectionForTextChunk):
+ (WebCore::applyTextLengthCorrectionToTextChunk):
+ (WebCore::SVGTextChunkLayoutInfo::startTextChunk):
+ (WebCore::SVGTextChunkLayoutInfo::closeTextChunk):
+ (WebCore::SVGTextChunkLayoutInfo::buildTextChunks):
+ (WebCore::SVGTextChunkLayoutInfo::recursiveBuildTextChunks):
+ (WebCore::SVGTextChunkLayoutInfo::layoutTextChunks):
+ * rendering/SVGTextChunkLayoutInfo.h: Add missing include, otherwhise compiling SVGTextChunkLayoutInfo.cpp will fail.
+ * rendering/SVGTextQuery.cpp: Added.
+ (WebCore::SVGTextQuery::Data::Data):
+ (WebCore::flowBoxForRenderer):
+ (WebCore::mapLengthThroughChunkTransformation):
+ (WebCore::SVGTextQuery::SVGTextQuery):
+ (WebCore::SVGTextQuery::collectTextBoxesInFlowBox):
+ (WebCore::SVGTextQuery::executeQuery):
+ (WebCore::SVGTextQuery::mapStartAndLengthIntoChunkPartCoordinates):
+ (WebCore::SVGTextQuery::measureCharacterRange):
+ (WebCore::NumberOfCharactersData::NumberOfCharactersData):
+ (WebCore::SVGTextQuery::numberOfCharactersCallback):
+ (WebCore::SVGTextQuery::numberOfCharacters):
+ (WebCore::TextLengthData::TextLengthData):
+ (WebCore::SVGTextQuery::textLengthCallback):
+ (WebCore::SVGTextQuery::textLength):
+ (WebCore::SubStringLengthData::SubStringLengthData):
+ (WebCore::SVGTextQuery::subStringLengthCallback):
+ (WebCore::SVGTextQuery::subStringLength):
+ (WebCore::StartPositionOfCharacterData::StartPositionOfCharacterData):
+ (WebCore::SVGTextQuery::startPositionOfCharacterCallback):
+ (WebCore::SVGTextQuery::startPositionOfCharacter):
+ (WebCore::EndPositionOfCharacterData::EndPositionOfCharacterData):
+ (WebCore::SVGTextQuery::endPositionOfCharacterCallback):
+ (WebCore::SVGTextQuery::endPositionOfCharacter):
+ (WebCore::RotationOfCharacterData::RotationOfCharacterData):
+ (WebCore::SVGTextQuery::rotationOfCharacterCallback):
+ (WebCore::SVGTextQuery::rotationOfCharacter):
+ (WebCore::ExtentOfCharacterData::ExtentOfCharacterData):
+ (WebCore::SVGTextQuery::extentOfCharacterCallback):
+ (WebCore::SVGTextQuery::extentOfCharacter):
+ (WebCore::CharacterNumberAtPositionData::CharacterNumberAtPositionData):
+ (WebCore::SVGTextQuery::characterNumberAtPositionCallback):
+ (WebCore::SVGTextQuery::characterNumberAtPosition):
+ * rendering/SVGTextQuery.h: Added.
+
+2010-06-16 Nikolas Zimmermann <nzimmermann@rim.com>
+
+ Reviewed by Dirk Schulze.
+
+ Provide floating-point support for text selection framework
+ https://bugs.webkit.org/show_bug.cgi?id=40665
+
+ This is the first chunk of the SVG Text rewrite patches.
+ offsetForPosition() / selectionRectForText() should accept float/FloatPoint arguments instead
+ of int/IntPoint. offsetForPosition() already worked with floats internally in Qt and Mac.
+ selectionRectForText() was already returning a FloatRect, but the passed in origin was an integer.
+ Fixing these problems in order to support sub-pixel positioning in the upcoming SVG Text rewrite patch.
+
+ Add a glyphScale parameter to TextRun, that will be used to support text selection
+ in lengthAdjust/textLength scenarios in SVG text, soon.
+
+ Doesn't affect any testcases so far. HTML is not affected in any way,
+ as it only ever passes integers to these functions.
+
+ * platform/graphics/Font.cpp:
+ (WebCore::Font::selectionRectForText):
+ (WebCore::Font::offsetForPosition):
+ * platform/graphics/Font.h:
+ * platform/graphics/FontFastPath.cpp:
+ (WebCore::Font::selectionRectForSimpleText):
+ (WebCore::Font::offsetForPositionForSimpleText):
+ * platform/graphics/TextRun.h:
+ (WebCore::TextRun::TextRun):
+ (WebCore::TextRun::glyphScale):
+ (WebCore::TextRun::setGlyphScale):
+ (WebCore::TextRun::applyGlyphScaling):
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::advance):
+ * platform/graphics/chromium/FontChromiumWin.cpp:
+ (WebCore::Font::selectionRectForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ * platform/graphics/chromium/FontLinux.cpp:
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+ * platform/graphics/efl/FontEfl.cpp:
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+ * platform/graphics/gtk/FontGtk.cpp:
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+ * platform/graphics/haiku/FontHaiku.cpp:
+ (WebCore::Font::selectionRectForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::offsetForPosition):
+ * platform/graphics/mac/ComplexTextController.h:
+ * platform/graphics/mac/FontComplexTextMac.cpp:
+ (WebCore::Font::selectionRectForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::Font::offsetForPositionForSimpleText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForSimpleText):
+ (WebCore::Font::selectionRectForComplexText):
+ * platform/graphics/win/FontWin.cpp:
+ (WebCore::Font::selectionRectForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ * platform/graphics/wince/FontWince.cpp:
+ (WebCore::Font::offsetForPositionForComplexText):
+ (WebCore::Font::selectionRectForComplexText):
+ * platform/graphics/wx/FontWx.cpp:
+ (WebCore::Font::selectionRectForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ * svg/SVGFont.cpp:
+ (WebCore::Font::selectionRectForTextUsingSVGFont):
+ (WebCore::Font::offsetForPositionForTextUsingSVGFont):
+
+2010-06-16 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Nate Chapin.
+
+ [v8] Introduce single element caches for WebCore::String to v8::String conversions
+ https://bugs.webkit.org/show_bug.cgi?id=40435
+ Measurements show that for some web apps (GMail, Wave) and some scenarios
+ (intensive reading and/or keeping a tab open for a long time),
+ hit rate lies in 30--50% interval.
+ Inlining fast case gives another minor performance win.
+
+ * bindings/v8/V8Binding.cpp:
+ (WebCore::getStringCache):
+ (WebCore::v8ExternalStringSlow):
+ * bindings/v8/V8Binding.h:
+ (WebCore::v8ExternalString):
+
+2010-06-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Kenneth Christiansen.
+
+ Spatial Navigation: using offset{Left,Top} is not enough to get the proper inner frames position
+ https://bugs.webkit.org/show_bug.cgi?id=39439
+
+ As pointed out by Darin Adler in https://bugs.webkit.org/show_bug.cgi?id=18662#c20,
+ "It's not correct to use the offsetLeft and offsetTop of the frame owner element's renderer because
+ that's just the distance from the offsetParent, not the absolute position".
+
+ Patch fixes that behavior by now considering the offsetTop and offsetLeft the offsetParent recursively,
+ starting from the HtmlFrameOwnerElement. Previously, only calling offsetTop and offsetLeft works
+ because all tests were done in htmls where the {i}frame element was a directly a child of the body,
+ e.g. <html>...<body><iframe src=xxx>....<body></html>.
+
+ Test: fast/events/spatial-navigation/snav-iframe-recursive-offset-parent.html
+
+ * page/SpatialNavigation.cpp:
+ (WebCore::renderRectRelativeToRootDocument):
+
+2010-06-16 Dan Bernstein <mitz@apple.com>
+
+ Try to fix the Tiger build
+
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph):
+
+2010-06-16 Dan Bernstein <mitz@apple.com>
+
+ Try to fix the Tiger build
+
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformBoundsForGlyph):
+
+2010-06-16 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ <rdar://problem/8077119> REGRESSION (r60247): Google Reader contains the tops of pieces of unidentifiable text under feed headlines.
+ https://bugs.webkit.org/show_bug.cgi?id=40386
+
+ Test: platform/mac/fast/text/x-height.html
+
+ The result of platformBoundsForGlyph() is in flipped coordinates, whereas the result of
+ -[NSFont boundingRectForGlyph:] was not. r60247 failed to account for this.
+
+ * platform/graphics/mac/SimpleFontDataMac.mm:
+ (WebCore::SimpleFontData::platformInit): Measure the height of the x glyph above the baseline
+ correctly.
+ (WebCore::SimpleFontData::platformBoundsForGlyph): Return a rect in flipped coordinates on Tiger
+ as well.
+
+2010-06-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Don't crash when a document ends with an entity
+ https://bugs.webkit.org/show_bug.cgi?id=40658
+
+ When we SWITCH_TO a state, we're expecting our caller to have advanced
+ the source. Rather than have all the callers check for empty, we do
+ that ourselves.
+
+ * html/HTML5Lexer.cpp:
+
+2010-06-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Enable HTML5 lexer
+ https://bugs.webkit.org/show_bug.cgi?id=40650
+
+ * page/Settings.cpp:
+ (WebCore::Settings::Settings):
+
+2010-06-15 Mark Rowe <mrowe@apple.com>
+
+ Rubber-stamped by David Harrison.
+
+ sqlite3_prepare16_v2 is not documented as always setting "tail" during error cases.
+ Explicitly initialize it to null, just to be safe.
+
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::prepare):
+
+2010-06-15 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ <rdar://problem/8091103> URLs not added to history when initial load happens via back/forward navigation
+
+ Back/forward navigation currently does not create or update items in the global history. This is usually
+ desirable, except for in the event where the back/forward list was created programmatically and attached
+ to the WebView and the initial load in that WebView is being performed as a result of a back/forward
+ navigation. In that situation it is preferable to ensure that global history item is created or updated.
+
+ No test case is added because DumpRenderTree is not able to test the scenario where the initial
+ load in a WebView occurs via a back/forward navigation.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::transitionToCommitted): If we're committing the first load in this frame as a
+ back/forward navigation then we should update the history as if it were a standard load, with the
+ exception of updating the back/forward list.
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::updateForStandardLoad): Add a parameter to allow callers to skip updating
+ the back/forward list.
+ * loader/HistoryController.h:
+ (WebCore::HistoryController::):
+
+2010-06-15 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by David Levin.
+
+ Fix compilation errors in BlobBuilder with FILE_WRITER enabled
+ https://bugs.webkit.org/show_bug.cgi?id=40606
+
+ No functionality change so no new tests.
+
+ * html/BlobBuilder.cpp:
+ * html/BlobBuilder.h:
+
+2010-06-15 Jian Li <jianli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Move type attribute from File.idl to Blob.idl per latest File API spec.
+ https://bugs.webkit.org/show_bug.cgi?id=40642
+
+ * html/Blob.idl:
+ * html/File.idl:
+
+2010-06-15 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions out of Frame class that were marked "move to Chrome"
+ https://bugs.webkit.org/show_bug.cgi?id=39636
+
+ Refactoring that does not require new tests.
+
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::didOpenURL): Call setStatus and setDefaultStatus
+ on DOMWindow rather than going through Frame.
+ (WebCore::FrameLoader::open): Ditto.
+ (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Call
+ shouldClose on this object instead of going through Frame.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents): Call
+ shouldClose on FrameLoader instead of going through Frame.
+ (WebCore::DOMWindow::focus): Moved the code from Frame::focusWindow
+ in here.
+ (WebCore::DOMWindow::blur): Moved the code from Frame::unfocusWindow
+ in here.
+ (WebCore::DOMWindow::close): Moved the code from Frame::scheduleClose
+ in here.
+ (WebCore::DOMWindow::setStatus): Moved the code from
+ Frame::setJSStatusBarText in here.
+ (WebCore::DOMWindow::setDefaultStatus): Moved the code from
+ Frame::setJSDefaultStatusBarText in here.
+
+ * page/DOMWindow.h: Added m_status and m_defaultStatus members to
+ store the status messages being set by the DOM.
+
+ * page/Frame.cpp: Removed all the functions that were marked
+ "to be moved into Chrome".
+ * page/Frame.h: Ditto.
+
+2010-06-15 Simon Fraser <simon.fraser@apple.com>
+
+ Fix crashing tests; need to check for null documentElement().
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::paintBoxDecorations):
+
+2010-06-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dave Hyatt.
+
+ Garbage shown outside HTML if HTML is absolutely positioned
+ https://bugs.webkit.org/show_bug.cgi?id=36163
+
+ Add a check that the root renderer (the document element's renderer) covers
+ the entire viewport before deciding that we don't need the RenderView
+ to paint its background. Fixes lack of painting with positioned, floated, and
+ display: table html elements.
+
+ Test: fast/repaint/positioned-document-element.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::RenderView::paintBoxDecorations):
+
+2010-06-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Safari 5 does not clear background with transformed html element
+ https://bugs.webkit.org/show_bug.cgi?id=40498
+
+ When the document element is composited, ensure that the FrameView
+ paints the background, because the composited layer may be transparent,
+ or might get moved via animation.
+
+ Test: compositing/repaint/composited-document-element.html
+
+ * rendering/RenderView.cpp:
+ (WebCore::isComposited):
+ (WebCore::rendererObscuresBackground):
+
+2010-06-15 Xan Lopez <xlopez@igalia.com>
+
+ Try to fix GTK+ build.
+
+ * platform/gtk/GtkVersioning.h:
+
+2010-06-15 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Brady Eidson.
+
+ Introduce HistoryItem::itemSequenceNumber and use it to identify
+ HistoryItems that are clones of one another.
+
+ Changes HistoryController::recursiveGoToItem to use itemSequenceNumber
+ equality instead of isTargetItem as the pre-requisite for not calling
+ FrameLoader::loadItem.
+
+ Changes FrameLoader::loadItem to require equivalent
+ documentSequenceNumber before initiating a same document navigation.
+ This alone would appear to fix the bug, but it does not go far enough
+ since without the itemSequenceNumber equality check, we'd re-load more
+ often than we should.
+
+ Moves documentSequenceNumber assignment into createItemTree as cleanup
+ and to ensure that it gets called properly whenever we create a cloned
+ HistoryItem. (createItemTree's mission is to create clones up until
+ or including the target frame depending on the value of the doClip
+ parameter.)
+
+ Removes the now unused HistoryController::urlsMatchItem.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40451
+
+ Test: fast/history/history-back-within-subframe.html
+ http/tests/navigation/history-back-across-form-submission-to-fragment.html
+
+ * history/HistoryItem.cpp:
+ (WebCore::generateSequenceNumber):
+ (WebCore::HistoryItem::HistoryItem):
+ * history/HistoryItem.h:
+ (WebCore::HistoryItem::setItemSequenceNumber):
+ (WebCore::HistoryItem::itemSequenceNumber):
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::loadItem):
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::updateBackForwardListForFragmentScroll):
+ (WebCore::HistoryController::createItemTree):
+ (WebCore::HistoryController::recursiveGoToItem):
+ (WebCore::HistoryController::pushState):
+ * loader/HistoryController.h:
+
+2010-06-15 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] Does not compile with -DGSEAL_ENABLE
+ https://bugs.webkit.org/show_bug.cgi?id=37851
+
+ Fix compilation with GSEAL_ENABLE.
+
+ * platform/gtk/GtkVersioning.h:
+ * platform/gtk/PlatformScreenGtk.cpp:
+ (WebCore::screenDepth):
+ (WebCore::screenDepthPerComponent):
+ * platform/gtk/PopupMenuGtk.cpp:
+ (WebCore::PopupMenu::show):
+ * platform/gtk/ScrollbarGtk.cpp:
+ (ScrollbarGtk::detachAdjustment):
+ (ScrollbarGtk::updateThumbPosition):
+ (ScrollbarGtk::updateThumbProportion):
+ * plugins/gtk/PluginViewGtk.cpp:
+ (WebCore::PluginView::paint):
+ (WebCore::PluginView::initXEvent):
+ (WebCore::PluginView::platformGetValue):
+ (WebCore::PluginView::platformStart):
+ * plugins/gtk/gtk2xtbin.c:
+ (gtk_xtbin_realize):
+ (gtk_xtbin_new):
+ (gtk_xtbin_set_position):
+ (gtk_xtbin_unrealize):
+
+2010-06-15 Xan Lopez <xlopez@igalia.com>
+
+ Unreviewed build fix.
+
+ Fix the build when WebSockets are disabled.
+
+ * bindings/js/JSWorkerContextCustom.cpp:
+
+2010-06-15 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ YouTube thumbnail borders vanish during transition
+ https://bugs.webkit.org/show_bug.cgi?id=40551
+
+ Turn off the direct image optimization if the image has a clip style, so that is is
+ correctly rendered with the clip.
+
+ Test: compositing/images/clip-on-directly-composited-image.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
+
+2010-06-15 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [v8] Web Inspector: make ui tests pass when ScriptDebugServer is used
+ https://bugs.webkit.org/show_bug.cgi?id=40623
+
+ * bindings/v8/JavaScriptCallFrame.cpp:
+ (WebCore::JavaScriptCallFrame::functionName): return empty string for anonymous functions instead of [anonymous].
+ * bindings/v8/ScriptDebugServer.cpp:
+ (WebCore::ScriptDebugServer::handleV8DebugEvent): autocontinue on syntax errors since there is no stack trace and
+ not much to inspect.
+
+2010-06-15 Adam Roben <aroben@apple.com>
+
+ Make WebCore's and JavaScriptCore's DerivedSources available for debugging in production builds
+
+ Fixes <http://webkit.org/b/40626> <rdar://problem/8094205>.
+
+ Reviewed by Sam Weinig.
+
+ * WebCore.vcproj/WebCore.make: Copy the contents of WebCore's
+ DerivedSources directory to AppleInternal/Sources/WebCore.
+
+2010-06-15 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ Bring framebuffer functions to GLES2 conformance
+ https://bugs.webkit.org/show_bug.cgi?id=40175
+
+ Test: fast/canvas/webgl/framebuffer-test.html
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::checkFramebufferStatus): Check input parameters and deal with default framebuffer situation.
+ (WebCore::WebGLRenderingContext::framebufferRenderbuffer): Check input parameters.
+ (WebCore::WebGLRenderingContext::framebufferTexture2D): Ditto.
+ (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Ditto.
+ (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters): Check input parameters.
+ * html/canvas/WebGLRenderingContext.h: Add validateFramebufferFuncParameters.
+
+2010-06-15 Patrick Gansterer <paroga@paroga.com>
+
+ Reviewed by David Levin.
+
+ Buildfix for ResourceHandleWin after r24202 and r55542.
+ https://bugs.webkit.org/show_bug.cgi?id=32963
+
+ * platform/network/win/ResourceHandleWin.cpp:
+ (WebCore::ResourceHandle::onHandleCreated):
+ (WebCore::ResourceHandle::onRequestComplete):
+ (WebCore::transferJobStatusCallback):
+ (WebCore::ResourceHandle::start):
+
+2010-06-12 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Joe Pecoraro.
+
+ Web Inspector: Should not expose window.console._inspectorCommandLineAPI to the web.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40500
+
+ * inspector/front-end/InjectedScript.js:
+ (injectedScriptConstructor):
+ (injectedScriptConstructor.):
+
+2010-06-15 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] The qt_webkit_version.pri file gets overwritten on install
+ https://bugs.webkit.org/show_bug.cgi?id=40487
+
+ Don't install qt_webkit_version.pri when building WebKit inside of Qt.
+ The import of WebKit into Qt will take care of providing the file
+ in mkspecs/modules and it'll be installed through projects.pro.
+
+ * WebCore.pro:
+
+2010-06-15 Tony Chang <tony@chromium.org>
+
+ Reviewed by Ojan Vafai.
+
+ resolve urls in text/html clipboard data
+ https://bugs.webkit.org/show_bug.cgi?id=40044
+
+ Allow text/html data copied from a page to contain full URLs when
+ dragging or copy/pasting.
+
+ Tests: editing/pasteboard/copy-resolves-urls.html
+ http/tests/misc/copy-resolves-urls.html
+
+ * WebCore.base.exp:
+ * editing/markup.cpp:
+ (WebCore::appendStartMarkup):
+ (WebCore::getStartMarkup):
+ (WebCore::MarkupAccumulator::appendMarkup):
+ (WebCore::createMarkup):
+ * editing/markup.h:
+ (WebCore::):
+ * platform/chromium/ClipboardChromium.cpp:
+ (WebCore::ClipboardChromium::writeRange):
+ * platform/chromium/PasteboardChromium.cpp:
+ (WebCore::Pasteboard::writeSelection):
+ * platform/gtk/ClipboardGtk.cpp:
+ (WebCore::ClipboardGtk::writeRange):
+ * platform/gtk/DataObjectGtk.cpp:
+ (WebCore::DataObjectGtk::markup):
+ * platform/gtk/PasteboardGtk.cpp:
+ (WebCore::Pasteboard::writeSelection):
+ * platform/haiku/PasteboardHaiku.cpp:
+ (WebCore::Pasteboard::writeSelection):
+ * platform/qt/ClipboardQt.cpp:
+ (WebCore::ClipboardQt::writeRange):
+ * platform/qt/PasteboardQt.cpp:
+ (WebCore::Pasteboard::writeSelection):
+
+2010-06-14 Chris Fleizach <cfleizach@apple.com>
+
+ No review. GTK build fix.
+
+ AX: need ListItemRole and PresentationalRole
+ https://bugs.webkit.org/show_bug.cgi?id=40133
+
+ Mostly speculative fix to make GTK unit tests work.
+
+ * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
+ (atkRole):
+ (webkit_accessible_get_role):
+
+2010-06-14 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ <rdar://problem/8090895> Update http streaming MIME types
+
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::TypeExtensionPair::): Add http streaming MIME synonyms.
+
+2010-06-14 Eric Carlson <eric.carlson@apple.com>
+
+ Reviewed by Oliver Hunt.
+
+ audio/x-mp3 MIME type not recognized
+ <rdar://problem/7875393>
+ https://bugs.webkit.org/show_bug.cgi?id=40594
+
+ Allow MIMETypeRegistry to have more than one MIME type for a
+ media file extension, and have the QTKit media engine register
+ all MIME types it can find for each file type QTKit supports.
+
+ Test: media/media-can-play-mp3.html
+
+ * platform/MIMETypeRegistry.cpp:
+ (WebCore::mediaMIMETypeMap): Update for new HashMap format.
+ (WebCore::TypeExtensionPair::): Store String+Vector<String>
+ (WebCore::MIMETypeRegistry::getMediaMIMETypeForExtension): Only consult
+ mediaMIMETypeMap(), it has the canonical answer.
+ (WebCore::MIMETypeRegistry::getMediaMIMETypesForExtension): New, return
+ a Vector of all MIME types for an extension.
+ * platform/MIMETypeRegistry.h:
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+ (WebCore::addFileTypesToCache): Add all MIME types returned in the
+ getMediaMIMETypesForExtension Vector.
+
+2010-06-14 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Brady Eidson.
+
+ <rdar://problem/8071866> REGRESSION: Crash on launch on Tiger and Leopard with network home folder
+
+ * platform/sql/SQLiteStatement.cpp:
+ (WebCore::SQLiteStatement::prepare): Don't assume that tail is always non-null, since that may
+ not be the case with some versions of SQLite. Instead we must null-check before dereferencing.
+
+2010-06-14 Anders Carlsson <andersca@apple.com>
+
+ Fix Tiger build.
+
+ * plugins/mac/PluginDataMac.mm:
+
+2010-06-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Use an array for extensions in MimeClassInfo
+ https://bugs.webkit.org/show_bug.cgi?id=40602
+
+ Get rid of MimeClassInfo::suffixes and replace it with an array of extensions.
+
+ * plugins/MimeType.cpp:
+ (WebCore::MimeType::suffixes):
+ Create a string of joined extensions.
+
+ * plugins/MimeType.h:
+ * plugins/PluginData.h:
+ (WebCore::operator==):
+ * plugins/chromium/PluginDataChromium.cpp:
+ (WebCore::getPluginMimeTypeFromExtension):
+ * plugins/gtk/PluginDataGtk.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/mac/PluginDataMac.mm:
+ (WebCore::PluginData::initPlugins):
+ * plugins/qt/PluginDataQt.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/win/PluginDataWin.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/wx/PluginDataWx.cpp:
+ (WebCore::PluginData::initPlugins):
+
+2010-06-14 Adam Barth <abarth@webkit.org>
+
+ Unreviewed.
+
+ Add an include to try to fix Chromium build.
+
+ * html/HTML5DocumentParser.cpp:
+
+2010-06-14 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Safari beach-balls loading large pages with HTML5 parser
+ https://bugs.webkit.org/show_bug.cgi?id=40596
+
+ Implement parser yielding, similar to how the old
+ HTMLDocumentParser yields.
+
+ This implementation re-uses the tokenizerTimeDelay and
+ tokenizerChunkSize settings even though they don't map exactly
+ to the token loop that the HTML5 parser uses.
+
+ * dom/DocumentParser.h:
+ - Add a FIXME for processingData() and clarify how the
+ appendData flag is used by renaming it to isFromNetwork.
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::parserTimeLimit):
+ - Defaults accessor, probably belongs on Page.
+ (WebCore::parserChunkSize):
+ - Defaults accessor, probably belongs on Page.
+ (WebCore::HTML5DocumentParser::HTML5DocumentParser):
+ (WebCore::HTML5DocumentParser::stopParsing):
+ - Stop the continue-parsing timer if active.
+ (WebCore::HTML5DocumentParser::processingData):
+ - Implement this poorly understood accessor to match
+ the old parser's behavior. It's unclear what this does
+ and it does not affect any layout tests to my knowledge
+ but likely affects the WebKit API in some way.
+ (WebCore::HTML5DocumentParser::pumpLexerIfPossible):
+ - Pass SynchronousMode.
+ - Do not ever pump if we've yielded to the timer.
+ (WebCore::HTML5DocumentParser::PumpSession::PumpSession):
+ - A struct for storing the yield counters.
+ (WebCore::HTML5DocumentParser::shouldContinueParsing):
+ - Mostly matches HTMLDocumentParser::shouldContinueParsing.
+ (WebCore::HTML5DocumentParser::pumpLexer):
+ - Respect SynchronousMode.
+ - ASSERT that a timer is not scheduled if we're pumping.
+ (WebCore::isLayoutTimerActive):
+ - This belongs on Document.
+ (WebCore::HTML5DocumentParser::continueNextChunkTimerFired):
+ (WebCore::HTML5DocumentParser::write):
+ (WebCore::HTML5DocumentParser::end):
+ - We should never end() if a timer is still outstanding.
+ (WebCore::HTML5DocumentParser::attemptToEnd):
+ (WebCore::HTML5DocumentParser::endIfDelayed):
+ (WebCore::HTML5DocumentParser::resumeParsingAfterScriptExecution):
+ * html/HTML5DocumentParser.h:
+ (WebCore::HTML5DocumentParser::):
+ * html/HTMLDocumentParser.cpp:
+ - Clarify the old TimeDelay and ChunkSize constants.
+
+2010-06-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Add a preload scanner for the HTML5 parser
+ https://bugs.webkit.org/show_bug.cgi?id=40557
+
+ This patch adds a simple preload scanner for the HTML5 parser. This
+ preload scanner is not as awesome as the old one because it doesn't
+ scan CSS, but it's much simpler.
+
+ * Android.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ - Build file torture.
+ * html/HTML5DocumentParser.cpp:
+ (WebCore::HTML5DocumentParser::write):
+ - Call into the preload scanner when waiting for a script.
+ * html/HTML5DocumentParser.h:
+ * html/HTML5PreloadScanner.cpp: Copied from WebCore/html/PreloadScanner.cpp.
+ (WebCore::HTML5PreloadScanner::HTML5PreloadScanner):
+ (WebCore::HTML5PreloadScanner::scan):
+ - A simple loop to pump the preload scanner's lexer.
+ (WebCore::HTML5PreloadScanner::processToken):
+ - Preload interesting resources. Stolen from the old preload
+ scanner.
+ (WebCore::HTML5PreloadScanner::scanningBody):
+ * html/HTML5PreloadScanner.h: Copied from WebCore/html/PreloadScanner.h.
+
+2010-06-14 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Constify some HTML5Token methods
+ https://bugs.webkit.org/show_bug.cgi?id=40592
+
+ I keep wanting these methods to be const. Eric wanted this in a
+ separate patch.
+
+ * html/HTML5Lexer.h:
+ (WebCore::HTML5Lexer::state):
+ * html/HTML5Token.h:
+ (WebCore::HTML5Token::attributes):
+ (WebCore::HTML5Token::name):
+ (WebCore::HTML5Token::characters):
+ (WebCore::HTML5Token::comment):
+ (WebCore::HTML5Token::publicIdentifier):
+ (WebCore::HTML5Token::systemIdentifier):
+ * html/HTML5TreeBuilder.cpp:
+ (WebCore::convertToOldStyle):
+ (WebCore::HTML5TreeBuilder::adjustedLexerState):
+ - Technically, this might belong in the other patch, but I think
+ it's fine here.
+ (WebCore::HTML5TreeBuilder::passTokenToLegacyParser):
+ * html/HTML5TreeBuilder.h:
+
+2010-06-14 Dumitru Daniliuc <dumi@chromium.org>
+
+ Unreviewed, build fix.
+
+ * WebCore.xcodeproj/project.pbxproj:
+
+2010-06-14 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, build fix.
+
+ Remove accidental specifying of the class name twice.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::HTMLFormElement::prepareFormData): Removed my ghastly typo.
+
+2010-06-14 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Get DatabaseTracker ready for sync DBs.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * storage/AbstractDatabase.cpp:
+ (WebCore::AbstractDatabase::~AbstractDatabase):
+ * storage/AbstractDatabase.h:
+ * storage/Database.cpp:
+ (WebCore::Database::closeImmediately):
+ * storage/Database.h:
+ (WebCore::Database::scriptExecutionContext):
+ * storage/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+ (WebCore::DatabaseTracker::databaseChanged):
+ (WebCore::DatabaseTracker::addOpenDatabase):
+ (WebCore::DatabaseTracker::removeOpenDatabase):
+ (WebCore::DatabaseTracker::getOpenDatabases):
+ (WebCore::DatabaseTracker::deleteDatabaseFile):
+ * storage/DatabaseTracker.h:
+ * storage/OriginQuotaManager.cpp:
+ (WebCore::OriginQuotaManager::markDatabase):
+ * storage/OriginQuotaManager.h:
+ * storage/chromium/DatabaseObserver.h:
+ * storage/chromium/DatabaseTrackerChromium.cpp:
+ (WebCore::DatabaseTracker::addOpenDatabase):
+ (WebCore::TrackerRemoveOpenDatabaseTask::create):
+ (WebCore::TrackerRemoveOpenDatabaseTask::TrackerRemoveOpenDatabaseTask):
+ (WebCore::DatabaseTracker::removeOpenDatabase):
+ (WebCore::DatabaseTracker::getOpenDatabases):
+ (WebCore::DatabaseTracker::getMaxSizeForDatabase):
+
+2010-06-14 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40529
+ eventSender.keyDown("delete") incorrectly sends a backspace on some platforms
+
+ * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+ Use virtual key code to force correct character code for clarity. Also, reworded comment,
+ since saying that "backspace needs to always be 8" misleadingly implied that it could
+ "sometimes" be such without this code.
+
+2010-06-14 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Refactor form submission code in HTMLFormElement to add clarity.
+ https://bugs.webkit.org/show_bug.cgi?id=39430
+
+ Covered by existing tests in fast/forms/mailto.
+
+ * html/HTMLFormElement.cpp:
+ (WebCore::appendMailtoPostFormDataToURL): Renamed from transferMailtoPostFormDataToUrl,
+ removed clearing out of the FormData and moved it to a new place (next to the call site).
+ (WebCore::HTMLFormElement::prepareFormData): Renamed from createFormData, moved the logic of
+ prepareing FormData here, including the use of appendMailtoPostFormDataToURL.
+ (WebCore::HTMLFormElement::submit): Consolidated multiple invocations of submitForm().
+ * html/HTMLFormElement.h: Renamed createFormData to prepareFormData.
+
+2010-06-14 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: need ListItemRole and PresentationalRole
+ https://bugs.webkit.org/show_bug.cgi?id=40133
+
+ * accessibility/AccessibilityObject.cpp:
+ (WebCore::createARIARoleMap):
+ * accessibility/AccessibilityObject.h:
+ (WebCore::AccessibilityObject::isListItem):
+ * accessibility/AccessibilityRenderObject.cpp:
+ (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
+ (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+ * accessibility/mac/AccessibilityObjectWrapper.mm:
+ (-[AccessibilityObjectWrapper accessibilityAttributeNames]):
+
+2010-06-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove pluginIndex from MimeClassInfo
+ https://bugs.webkit.org/show_bug.cgi?id=40588
+
+ * plugins/PluginData.h:
+ * plugins/gtk/PluginDataGtk.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/mac/PluginDataMac.mm:
+ (WebCore::PluginData::initPlugins):
+ * plugins/qt/PluginDataQt.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/win/PluginDataWin.cpp:
+ (WebCore::PluginData::initPlugins):
+ * plugins/wx/PluginDataWx.cpp:
+ (WebCore::PluginData::initPlugins):
+
+2010-06-14 Kinuko Yasuda <kinuko@chromium.org>
+
+ Reviewed by Jian Li.
+
+ Implement BlobBuilder internal class for BlobBuilder support as defined in FileWriter
+ https://bugs.webkit.org/show_bug.cgi?id=36903
+
+ No new tests; they will be added when we add jsc bindings.
+
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * html/BlobBuilder.cpp: Added.
+ * html/BlobBuilder.h: Added.
+ (WebCore::BlobBuilder::create):
+ * platform/BlobItem.cpp:
+ (WebCore::StringBlobItem::convertToCString): Added EndingNative support.
+ * platform/BlobItem.h: Added EndingNative line-ending type.
+ (WebCore::):
+
+2010-06-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Stop using MimeClassInfo::pluginIndex
+ https://bugs.webkit.org/show_bug.cgi?id=40582
+
+ Add a pluginIndicies vector to PluginData and use it instead of MimeClassInfo::pluginIndex.
+
+ * plugins/MimeType.cpp:
+ (WebCore::MimeType::enabledPlugin):
+ Get the plug-in index from the mimePluginIndices vector.
+
+ * plugins/Plugin.cpp:
+ (WebCore::Plugin::item):
+ Compare the mime plugin index as well.
+
+ * plugins/PluginData.cpp:
+ (WebCore::PluginData::PluginData):
+ Populate the m_mimePluginIndices vector.
+
+ (WebCore::PluginData::pluginNameForMimeType):
+ Get the plug-in index from the m_mimePluginIndices vector.
+
+ * plugins/PluginData.h:
+ (WebCore::operator==):
+ Don't check for pluginIndex.
+
+ (WebCore::PluginData::mimePluginIndices):
+ Add getter for m_mimePluginIndices.
+
+2010-06-14 Sam Weinig <sam@webkit.org>
+
+ Better build fix.
+
+ * bindings/js/JSBindingsAllInOne.cpp:
+
+2010-06-14 Sam Weinig <sam@webkit.org>
+
+ Another windows build fix.
+
+ * bindings/js/JSBindingsAllInOne.cpp:
+
+2010-06-14 Sam Weinig <sam@webkit.org>
+
+ Another build fix.
+
+ * bindings/js/JSDOMWindowCustom.cpp:
+
+2010-06-14 Sam Weinig <sam@webkit.org>
+
+ Add missing comma to fix GTK build.
+
+ * xml/XSLTProcessor.idl:
+
+2010-06-14 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=40581
+ Auto-generate most of the JS constructors
+
+ - Auto-generates all the JS constructors that don't have custom
+ names (eg, Not Image(), Audio() or Option())
+ - Fixes two typos.
+ (new XSLTConstructor()).toString() [object XSLTProcessorConsructor] -> [object XSLTProcessorConstructor])
+ (new EventSource()).toString() [object EventSourceContructor] -> [object EventSourceConstructor])
+
+ * Android.jscbindings.mk:
+ * CMakeLists.txt:
+ * GNUmakefile.am:
+ * WebCore.gypi:
+ * WebCore.pro:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * bindings/js/JSArrayBufferConstructor.cpp: Removed.
+ * bindings/js/JSArrayBufferConstructor.h: Removed.
+ * bindings/js/JSArrayBufferCustom.cpp: Copied from WebCore/bindings/js/JSArrayBufferConstructor.cpp.
+ (WebCore::JSArrayBufferConstructor::constructJSArrayBuffer):
+ * bindings/js/JSArrayBufferViewHelper.h:
+ (WebCore::constructArrayBufferView):
+ * bindings/js/JSBindingsAllInOne.cpp:
+ * bindings/js/JSDOMWindowCustom.cpp:
+ * bindings/js/JSEventSourceConstructor.cpp: Removed.
+ * bindings/js/JSEventSourceConstructor.h: Removed.
+ * bindings/js/JSEventSourceCustom.cpp: Copied from WebCore/bindings/js/JSEventSourceConstructor.cpp.
+ (WebCore::JSEventSourceConstructor::constructJSEventSource):
+ * bindings/js/JSFloat32ArrayConstructor.cpp: Removed.
+ * bindings/js/JSFloat32ArrayConstructor.h: Removed.
+ * bindings/js/JSFloat32ArrayCustom.cpp:
+ (WebCore::JSFloat32ArrayConstructor::constructJSFloat32Array):
+ * bindings/js/JSInt16ArrayConstructor.cpp: Removed.
+ * bindings/js/JSInt16ArrayConstructor.h: Removed.
+ * bindings/js/JSInt16ArrayCustom.cpp:
+ (WebCore::JSInt16ArrayConstructor::constructJSInt16Array):
+ * bindings/js/JSInt32ArrayConstructor.cpp: Removed.
+ * bindings/js/JSInt32ArrayConstructor.h: Removed.
+ * bindings/js/JSInt32ArrayCustom.cpp:
+ (WebCore::JSInt32ArrayConstructor::constructJSInt32Array):
+ * bindings/js/JSInt8ArrayConstructor.cpp: Removed.
+ * bindings/js/JSInt8ArrayConstructor.h: Removed.
+ * bindings/js/JSInt8ArrayCustom.cpp:
+ (WebCore::JSInt8ArrayConstructor::constructJSInt8Array):
+ * bindings/js/JSMessageChannelConstructor.cpp: Removed.
+ * bindings/js/JSMessageChannelConstructor.h: Removed.
+ * bindings/js/JSMessageChannelCustom.cpp:
+ (WebCore::JSMessageChannelConstructor::constructJSMessageChannel):
+ * bindings/js/JSSharedWorkerConstructor.cpp: Removed.
+ * bindings/js/JSSharedWorkerConstructor.h: Removed.
+ * bindings/js/JSSharedWorkerCustom.cpp:
+ (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker):
+ * bindings/js/JSUint16ArrayConstructor.cpp: Removed.
+ * bindings/js/JSUint16ArrayConstructor.h: Removed.
+ * bindings/js/JSUint16ArrayCustom.cpp:
+ (WebCore::JSUint16ArrayConstructor::constructJSUint16Array):
+ * bindings/js/JSUint32ArrayConstructor.cpp: Removed.
+ * bindings/js/JSUint32ArrayConstructor.h: Removed.
+ * bindings/js/JSUint32ArrayCustom.cpp:
+ (WebCore::JSUint32ArrayConstructor::constructJSUint32Array):
+ * bindings/js/JSUint8ArrayConstructor.cpp: Removed.
+ * bindings/js/JSUint8ArrayConstructor.h: Removed.
+ * bindings/js/JSUint8ArrayCustom.cpp:
+ (WebCore::JSUint8ArrayConstructor::constructJSUint8Array):
+ * bindings/js/JSWebKitCSSMatrixConstructor.cpp: Removed.
+ * bindings/js/JSWebKitCSSMatrixConstructor.h: Removed.
+ * bindings/js/JSWebKitCSSMatrixCustom.cpp: Copied from WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp.
+ (WebCore::JSWebKitCSSMatrixConstructor::constructJSWebKitCSSMatrix):
+ * bindings/js/JSWebKitPointConstructor.cpp: Removed.
+ * bindings/js/JSWebKitPointConstructor.h: Removed.
+ * bindings/js/JSWebKitPointCustom.cpp: Copied from WebCore/bindings/js/JSWebKitPointConstructor.cpp.
+ (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):
+ * bindings/js/JSWebSocketConstructor.cpp: Removed.
+ * bindings/js/JSWebSocketConstructor.h: Removed.
+ * bindings/js/JSWebSocketCustom.cpp:
+ (WebCore::JSWebSocketConstructor::constructJSWebSocket):
+ * bindings/js/JSWorkerConstructor.cpp: Removed.
+ * bindings/js/JSWorkerConstructor.h: Removed.
+ * bindings/js/JSWorkerContextCustom.cpp:
+ * bindings/js/JSWorkerCustom.cpp:
+ (WebCore::JSWorkerConstructor::constructJSWorker):
+ * bindings/js/JSXSLTProcessorConstructor.cpp: Removed.
+ * bindings/js/JSXSLTProcessorConstructor.h: Removed.
+ * bindings/js/JSXSLTProcessorCustom.cpp:
+ (WebCore::JSXSLTProcessorConstructor::constructJSXSLTProcessor):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ * css/WebKitCSSMatrix.idl:
+ * dom/MessageChannel.idl:
+ * html/canvas/ArrayBuffer.idl:
+ * html/canvas/Float32Array.idl:
+ * html/canvas/Int16Array.idl:
+ * html/canvas/Int32Array.idl:
+ * html/canvas/Int8Array.idl:
+ * html/canvas/Uint16Array.idl:
+ * html/canvas/Uint32Array.idl:
+ * html/canvas/Uint8Array.idl:
+ * page/EventSource.idl:
+ * page/WebKitPoint.idl:
+ * websockets/WebSocket.idl:
+ * workers/SharedWorker.idl:
+ * workers/Worker.idl:
+ * xml/XSLTProcessor.idl:
+
+2010-05-16 Antonio Gomes <tonikitoo@webkit.org>
+
+ Unreviewed naming fixes of local variables used in Spatial Navigation methods.
+
+ Summary:
+ * "candidate" renamed to "node";
+ * "currentFocusCandidate" renamed to "candidate"
+ * "closestFocusCandidate" renamed to "closest"
+
+ That way naming is more consistent in the various Spatial Navigation methods.
+
+ * page/FocusController.cpp:
+ (WebCore::FocusController::findFocusableNodeInDirection):
+ (WebCore::FocusController::deepFindFocusableNodeInDirection):
+
+2010-06-14 Antonio Gomes <tonikitoo@webkit.org>
+
+ Reviewed by Simon Fraser and Kenneth Christiansen.
+
+ Spatial Navigation: make it work with focusable elements in overflow content
+ https://bugs.webkit.org/show_bug.cgi?id=36463
+
+ This patch addresses the problem with Spatial Navigation. It currently does not
+ properly traverse scrollable contents, including scrollable div's. For this to work,
+ a new class member called scrollableEnclosingBox was introduced to FocusCandidate class which
+ keeps track of the current scrollable box Node wrapping a FocusCandidate.
+
+ To make use of enclosingScrollableBox of FocusCandidate, the DOM traversal routine
+ (FocusController::findNextFocusableInDirection) was changed as follows: when it
+ encounters a scrollable Node, each focusable node which is 'inner' keeps track of
+ the container reference. By the time a sibling of the scrollable Node is encountered,
+ there is no need to track this reference any more and the traversal algorithm continues
+ normally.
+
+ The common case is obviously that there is no scrollable container wrapping it.
+
+ updateFocusCandiditeIfCloser logic was also adapted to fit the need of the
+ newly introduced enclosingScrollableBox class member, getting simpler and more
+ easily maintainable.
+
+ Tests: fast/events/spatial-navigation/snav-div-scrollable-but-without-focusable-content.html
+ fast/events/spatial-navigation/snav-clipped-overflow-content.html
+
+ * page/FocusController.cpp:
+ (WebCore::updateFocusCandidateInSameContainer):
+ (WebCore::updateFocusCandidateIfCloser):
+ (WebCore::FocusController::findFocusableNodeInDirection):
+ (WebCore::FocusController::deepFindFocusableNodeInDirection):
+ * page/SpatialNavigation.cpp:
+ (WebCore::isScrollableContainerNode):
+ * page/SpatialNavigation.h:
+ (WebCore::FocusCandidate::FocusCandidate):
+ (WebCore::FocusCandidate::isInScrollableContainer):
+
+2010-06-14 Jian Li <jianli@chromium.org>
+
+ Unreviewed. Fix build break in GTK.
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestCallbackPrivate.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestInterfacePrivate.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+
+2010-06-14 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Beth Dakin.
+
+ AX: AXUnknown objects are being returned
+ https://bugs.webkit.org/show_bug.cgi?id=40574
+
+ Test: platform/mac/accessibility/no-unknown-objects-when-title-attribute-present.html
+
+ * accessibility/mac/AccessibilityObjectMac.mm:
+ (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+
+2010-06-14 Jian Li <jianli@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Fix code generators to better support Conditional attribute and add test
+ coverage for it.
+ https://bugs.webkit.org/show_bug.cgi?id=39512
+
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ * bindings/scripts/CodeGeneratorObjC.pm:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
+ * bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
+ * bindings/scripts/test/GObject/WebKitDOMTestInterface.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_get_conditional_attr1):
+ (webkit_dom_test_obj_set_conditional_attr1):
+ (webkit_dom_test_obj_get_conditional_attr2):
+ (webkit_dom_test_obj_set_conditional_attr2):
+ (webkit_dom_test_obj_get_conditional_attr3):
+ (webkit_dom_test_obj_set_conditional_attr3):
+ (webkit_dom_test_obj_set_property):
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestInterface.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::):
+ (WebCore::jsTestObjConditionalAttr1):
+ (WebCore::jsTestObjConditionalAttr2):
+ (WebCore::jsTestObjConditionalAttr3):
+ (WebCore::setJSTestObjConditionalAttr1):
+ (WebCore::setJSTestObjConditionalAttr2):
+ (WebCore::setJSTestObjConditionalAttr3):
+ * bindings/scripts/test/JS/JSTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestInterface.mm:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ (-[DOMTestObj conditionalAttr1]):
+ (-[DOMTestObj setConditionalAttr1:]):
+ (-[DOMTestObj conditionalAttr2]):
+ (-[DOMTestObj setConditionalAttr2:]):
+ (-[DOMTestObj conditionalAttr3]):
+ (-[DOMTestObj setConditionalAttr3:]):
+ * bindings/scripts/test/TestInterface.idl:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestInterface.cpp:
+ * bindings/scripts/test/V8/V8TestInterface.h:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::conditionalAttr1AttrGetter):
+ (WebCore::TestObjInternal::conditionalAttr1AttrSetter):
+ (WebCore::TestObjInternal::conditionalAttr2AttrGetter):
+ (WebCore::TestObjInternal::conditionalAttr2AttrSetter):
+ (WebCore::TestObjInternal::conditionalAttr3AttrGetter):
+ (WebCore::TestObjInternal::conditionalAttr3AttrSetter):
+ (WebCore::):
+
+2010-06-14 Chang Shu <chang.shu@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Change the type of ShadowSize from IntSize to FloatSize in GraphicsContext.
+ Using IntSize loses precision and fails the test.
+ Note: This code change fixes Qt port but Mac is still failing due to
+ platform issue.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40434
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::applyShadow):
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::setShadow):
+ (WebCore::GraphicsContext::getShadow):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/GraphicsContextPrivate.h:
+ * platform/graphics/cairo/FontCairo.cpp:
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::calculateShadowBufferDimensions):
+ (WebCore::drawPathShadow):
+ (WebCore::drawBorderlessRectShadow):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/cairo/ImageCairo.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/chromium/FontChromiumWin.cpp:
+ (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
+ (WebCore::Font::drawComplexText):
+ * platform/graphics/gtk/FontGtk.cpp:
+ (WebCore::Font::drawComplexText):
+ * platform/graphics/haiku/GraphicsContextHaiku.cpp:
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/qt/FontQt.cpp:
+ (WebCore::drawTextCommon):
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawRect):
+ (WebCore::GraphicsContext::drawLine):
+ (WebCore::GraphicsContext::strokeArc):
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::drawFilledShadowPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::drawBorderlessRectShadow):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/qt/ImageQt.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/skia/SkiaFontWin.cpp:
+ (WebCore::windowsCanHandleDrawTextShadow):
+ * platform/graphics/win/FontCGWin.cpp:
+ (WebCore::drawGDIGlyphs):
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/wince/GraphicsContextWince.cpp:
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ (WebCore::GraphicsContext::drawText):
+ * platform/graphics/wx/GraphicsContextWx.cpp:
+ (WebCore::GraphicsContext::setPlatformShadow):
+
+2010-06-14 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Simon Fraser.
+
+ <rdar://problem/7752961> Unevenly distributed space in justified text
+ https://bugs.webkit.org/show_bug.cgi?id=36105
+
+ Test: fast/text/justify-padding-distribution.html
+
+ * platform/graphics/WidthIterator.cpp:
+ (WebCore::WidthIterator::WidthIterator): Initialize m_padPerSpace to the quotient of the total
+ padding and the number of spaces rather than truncating it.
+ (WebCore::WidthIterator::advance): Subtract m_padPerSpace from m_padding and add the difference
+ between its old and new values, when rounded, to the advance.
+ * platform/graphics/mac/ComplexTextController.cpp:
+ (WebCore::ComplexTextController::ComplexTextController):
+ (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
+ * platform/graphics/win/UniscribeController.cpp:
+ (WebCore::UniscribeController::UniscribeController):
+ (WebCore::UniscribeController::shapeAndPlaceItem):
+ * platform/graphics/win/UniscribeController.h:
+
+2010-06-14 Andreas Kling <andreas.kling@nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Stack overflow when converting navigator object to QVariant
+ https://bugs.webkit.org/show_bug.cgi?id=40572
+
+ Protect against infinite recursion in JSValue->QVariant conversion.
+ This fixes a crash when trying to convert MimeType objects (they
+ recurse infinitely and on-the-fly via the enabledPlugin property.)
+
+ * bridge/qt/qt_runtime.cpp:
+ (JSC::Bindings::convertValueToQVariant):
+
+2010-06-14 Yong Li <yoli@rim.com>
+
+ Test cases created by: Robin Cao <robin.cao@torchmobile.com.cn>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=38910
+
+ Suspend Document::m_executeScriptSoonTimer objects when the page is deferred.
+ There's no reason why we suspend all active DOM timers on the page but not suspend
+ this one. Document::m_executeScriptSoonTimer can run JS and schedule more DOM Timers.
+
+ It can only be tested manually.
+ * manual-tests/load-deferrer-script-element.html: Added.
+ * manual-tests/resources/load-deferrer-script-element.js: Added.
+
+ * dom/Document.cpp:
+ (WebCore::Document::executeScriptSoon):
+ (WebCore::Document::suspendExecuteScriptSoonTimer): Added.
+ (WebCore::Document::resumeExecuteScriptSoonTimer): Added.
+ * dom/Document.h:
+ * page/PageGroupLoadDeferrer.cpp:
+ (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
+ (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
+
2010-06-13 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
@@ -2403,6 +11013,43 @@
Reviewed by Shinichiro Hamaji.
+ Implement render style selection for pages to support CSS3 Paged Media.
+ https://bugs.webkit.org/show_bug.cgi?id=35961
+
+ Test: printing/page-rule-selection.html
+
+ * WebCore.base.exp:
+ * css/CSSGrammar.y:
+ * css/CSSSelector.cpp:
+ (WebCore::CSSSelector::specificity):
+ (WebCore::CSSSelector::specificityForPage):
+ * css/CSSSelector.h:
+ (WebCore::CSSSelector::CSSSelector):
+ (WebCore::CSSSelector::isForPage):
+ (WebCore::CSSSelector::setForPage):
+ * css/CSSStyleSelector.cpp:
+ (WebCore::CSSStyleSelector::styleForPage):
+ (WebCore::CSSStyleSelector::matchPageRules):
+ (WebCore::CSSStyleSelector::matchPageRulesForList):
+ (WebCore::CSSStyleSelector::isLeftPage):
+ (WebCore::CSSStyleSelector::isFirstPage):
+ (WebCore::CSSStyleSelector::pageName):
+ * css/CSSStyleSelector.h:
+ (WebCore::CSSStyleSelector::isRightPage):
+ * css/html.css:
+ (@page):
+ * dom/Document.cpp:
+ (WebCore::Document::styleForPage):
+ * dom/Document.h:
+ * page/PrintContext.cpp:
+ (WebCore::PrintContext::pageProperty):
+ * page/PrintContext.h:
+
+
+2010-06-10 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
Fix Bug 40452: REGRESSION: printing is broken if stylesheet has @page
https://bugs.webkit.org/show_bug.cgi?id=40452
@@ -3945,7 +12592,7 @@
2010-06-08 Erik Arvidsson <arv@chromium.org>
- Reviewed by ojan@chromium.org.
+ Reviewed by Ojan Vafai.
REGRESSION: Weird focus behavior affects quoting on University of Washington message board system
https://bugs.webkit.org/show_bug.cgi?id=38548
@@ -4424,9 +13071,9 @@
2010-06-07 Eric Seidel <eric@webkit.org>
- Unreviewed. Just commit an edit XCode keeps making automatically.
+ Unreviewed. Just commit an edit Xcode keeps making automatically.
- It appears someone hand-edited the file, XCode no-like.
+ It appears someone hand-edited the file, Xcode no-like.
* WebCore.xcodeproj/project.pbxproj:
@@ -7042,7 +15689,7 @@
2010-06-02 Erik Arvidsson <arv@chromium.org>
- Reviewed by ojan@chromium.org.
+ Reviewed by Ojan Vafai.
REGRESSION: Weird focus behavior affects quoting on University of Washington message board system
https://bugs.webkit.org/show_bug.cgi?id=38548
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 5b52793..08d9ef9 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -57,6 +57,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
ENABLE_IMAGE_RESIZER = ;
ENABLE_INDEXED_DATABASE = ;
+ENABLE_INPUT_SPEECH = ;
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
ENABLE_MATHML = ;
ENABLE_METER_TAG = ENABLE_METER_TAG;
@@ -81,4 +82,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/Configurations/Version.xcconfig b/WebCore/Configurations/Version.xcconfig
index 6f999af..f775a54 100644
--- a/WebCore/Configurations/Version.xcconfig
+++ b/WebCore/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 1;
+MINOR_VERSION = 2;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 7ac3e51..904ea55 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -30,6 +30,7 @@
#include "JSBarInfo.cpp"
#include "JSBeforeLoadEvent.cpp"
#include "JSBlob.cpp"
+#include "JSBlobBuilder.cpp"
#include "JSCanvasGradient.cpp"
#include "JSCanvasPattern.cpp"
#include "JSCanvasRenderingContext.cpp"
@@ -221,6 +222,7 @@
#include "JSSharedWorker.cpp"
#include "JSSharedWorkerContext.cpp"
#include "JSSQLError.cpp"
+#include "JSSQLException.cpp"
#include "JSSQLResultSet.cpp"
#include "JSSQLResultSetRowList.cpp"
#include "JSSQLStatementCallback.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index 7ec915f..bf09a22 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -54,6 +54,7 @@ DOM_CLASSES = \
BarInfo \
BeforeLoadEvent \
Blob \
+ BlobBuilder \
CDATASection \
CSSCharsetRule \
CSSFontFaceRule \
@@ -265,6 +266,7 @@ DOM_CLASSES = \
ScriptProfile \
ScriptProfileNode \
SQLError \
+ SQLException \
SQLResultSet \
SQLResultSetRowList \
SQLStatementCallback \
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index 743296a..7ffafdf 100644
--- a/WebCore/English.lproj/localizedStrings.js
+++ b/WebCore/English.lproj/localizedStrings.js
Binary files differ
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 47f2057..8f9c245 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -180,6 +180,7 @@ IDL_BINDINGS += \
WebCore/dom/WebKitTransitionEvent.idl \
WebCore/dom/WheelEvent.idl \
WebCore/html/Blob.idl \
+ WebCore/html/BlobBuilder.idl \
WebCore/html/canvas/ArrayBufferView.idl \
WebCore/html/canvas/ArrayBuffer.idl \
WebCore/html/canvas/Int8Array.idl \
@@ -435,8 +436,7 @@ webcore_sources += \
WebCore/bindings/js/JSEventCustom.cpp \
WebCore/bindings/js/JSEventListener.cpp \
WebCore/bindings/js/JSEventListener.h \
- WebCore/bindings/js/JSEventSourceConstructor.cpp \
- WebCore/bindings/js/JSEventSourceConstructor.h \
+ WebCore/bindings/js/JSEventSourceCustom.cpp \
WebCore/bindings/js/JSEventTarget.cpp \
WebCore/bindings/js/JSEventTarget.h \
WebCore/bindings/js/JSExceptionBase.cpp \
@@ -477,8 +477,6 @@ webcore_sources += \
WebCore/bindings/js/JSLocationCustom.h \
WebCore/bindings/js/JSMainThreadExecState.cpp \
WebCore/bindings/js/JSMainThreadExecState.h \
- WebCore/bindings/js/JSMessageChannelConstructor.cpp \
- WebCore/bindings/js/JSMessageChannelConstructor.h \
WebCore/bindings/js/JSMessageChannelCustom.cpp \
WebCore/bindings/js/JSMessageEventCustom.cpp \
WebCore/bindings/js/JSMessagePortCustom.cpp \
@@ -506,16 +504,12 @@ webcore_sources += \
WebCore/bindings/js/JSStyleSheetListCustom.cpp \
WebCore/bindings/js/JSTextCustom.cpp \
WebCore/bindings/js/JSTreeWalkerCustom.cpp \
- WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp \
- WebCore/bindings/js/JSWebKitCSSMatrixConstructor.h \
- WebCore/bindings/js/JSWebKitPointConstructor.cpp \
- WebCore/bindings/js/JSWebKitPointConstructor.h \
+ WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp \
+ WebCore/bindings/js/JSWebKitPointCustom.cpp \
WebCore/bindings/js/JSWorkerContextErrorHandler.cpp \
WebCore/bindings/js/JSWorkerContextErrorHandler.h \
WebCore/bindings/js/JSXMLHttpRequestCustom.cpp \
WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp \
- WebCore/bindings/js/JSXSLTProcessorConstructor.cpp \
- WebCore/bindings/js/JSXSLTProcessorConstructor.h \
WebCore/bindings/js/JSXSLTProcessorCustom.cpp \
WebCore/bindings/js/JavaScriptCallFrame.cpp \
WebCore/bindings/js/JavaScriptCallFrame.h \
@@ -816,6 +810,7 @@ webcore_sources += \
WebCore/dom/ExceptionBase.h \
WebCore/dom/ExceptionCode.cpp \
WebCore/dom/ExceptionCode.h \
+ WebCore/dom/FragmentScriptingPermission.h \
WebCore/dom/InputElement.cpp \
WebCore/dom/InputElement.h \
WebCore/dom/KeyboardEvent.cpp \
@@ -877,6 +872,7 @@ webcore_sources += \
WebCore/dom/Range.h \
WebCore/dom/RangeBoundaryPoint.h \
WebCore/dom/RangeException.h \
+ WebCore/dom/RawDataDocumentParser.h \
WebCore/dom/RegisteredEventListener.cpp \
WebCore/dom/RegisteredEventListener.h \
WebCore/dom/ScriptElement.cpp \
@@ -889,6 +885,8 @@ webcore_sources += \
WebCore/dom/SelectorNodeList.h \
WebCore/dom/SpaceSplitString.cpp \
WebCore/dom/SpaceSplitString.h \
+ WebCore/dom/StaticHashSetNodeList.cpp \
+ WebCore/dom/StaticHashSetNodeList.h \
WebCore/dom/StaticNodeList.cpp \
WebCore/dom/StaticNodeList.h \
WebCore/dom/StyleElement.cpp \
@@ -1043,6 +1041,8 @@ webcore_sources += \
WebCore/html/AsyncImageResizer.h \
WebCore/html/Blob.cpp \
WebCore/html/Blob.h \
+ WebCore/html/BlobBuilder.cpp \
+ WebCore/html/BlobBuilder.h \
WebCore/html/canvas/CanvasContextAttributes.h \
WebCore/html/canvas/CanvasGradient.cpp \
WebCore/html/canvas/CanvasGradient.h \
@@ -1059,6 +1059,8 @@ webcore_sources += \
WebCore/html/CollectionCache.cpp \
WebCore/html/CollectionCache.h \
WebCore/html/CollectionType.h \
+ WebCore/html/CSSPreloadScanner.cpp \
+ WebCore/html/CSSPreloadScanner.h \
WebCore/html/DataGridColumn.cpp \
WebCore/html/DataGridColumn.h \
WebCore/html/DataGridColumnList.cpp \
@@ -1087,18 +1089,20 @@ webcore_sources += \
WebCore/html/FileThreadTask.h \
WebCore/html/FormDataList.cpp \
WebCore/html/FormDataList.h \
- WebCore/html/HTML5EntityParser.cpp \
- WebCore/html/HTML5EntityParser.h \
- WebCore/html/HTML5Lexer.cpp \
- WebCore/html/HTML5Lexer.h \
- WebCore/html/HTML5Token.h \
- WebCore/html/HTML5DocumentParser.cpp \
- WebCore/html/HTML5DocumentParser.h \
- WebCore/html/HTML5TreeBuilder.cpp \
- WebCore/html/HTML5TreeBuilder.h \
- WebCore/html/HTML5ScriptRunner.cpp \
- WebCore/html/HTML5ScriptRunner.h \
- WebCore/html/HTML5ScriptRunnerHost.h \
+ WebCore/html/HTMLEntityParser.cpp \
+ WebCore/html/HTMLEntityParser.h \
+ WebCore/html/HTMLTokenizer.cpp \
+ WebCore/html/HTMLTokenizer.h \
+ WebCore/html/HTMLToken.h \
+ WebCore/html/HTMLDocumentParser.cpp \
+ WebCore/html/HTMLDocumentParser.h \
+ WebCore/html/HTMLPreloadScanner.cpp \
+ WebCore/html/HTMLPreloadScanner.h \
+ WebCore/html/HTMLScriptRunner.cpp \
+ WebCore/html/HTMLScriptRunner.h \
+ WebCore/html/HTMLScriptRunnerHost.h \
+ WebCore/html/HTMLTreeBuilder.cpp \
+ WebCore/html/HTMLTreeBuilder.h \
WebCore/html/HTMLAllCollection.cpp \
WebCore/html/HTMLAllCollection.h \
WebCore/html/HTMLAnchorElement.cpp \
@@ -1179,6 +1183,7 @@ webcore_sources += \
WebCore/html/HTMLImageLoader.h \
WebCore/html/HTMLInputElement.cpp \
WebCore/html/HTMLInputElement.h \
+ WebCore/html/HTMLInputStream.h \
WebCore/html/HTMLIsIndexElement.cpp \
WebCore/html/HTMLIsIndexElement.h \
WebCore/html/HTMLKeygenElement.cpp \
@@ -1219,11 +1224,13 @@ webcore_sources += \
WebCore/html/HTMLParagraphElement.h \
WebCore/html/HTMLParamElement.cpp \
WebCore/html/HTMLParamElement.h \
- WebCore/html/LegacyHTMLTreeConstructor.cpp \
- WebCore/html/LegacyHTMLTreeConstructor.h \
+ WebCore/html/LegacyHTMLTreeBuilder.cpp \
+ WebCore/html/LegacyHTMLTreeBuilder.h \
WebCore/html/HTMLParserErrorCodes.cpp \
WebCore/html/HTMLParserErrorCodes.h \
WebCore/html/HTMLParserQuirks.h \
+ WebCore/html/HTMLParserScheduler.cpp \
+ WebCore/html/HTMLParserScheduler.h \
WebCore/html/HTMLPlugInElement.cpp \
WebCore/html/HTMLPlugInElement.h \
WebCore/html/HTMLPlugInImageElement.cpp \
@@ -1260,8 +1267,8 @@ webcore_sources += \
WebCore/html/HTMLTextAreaElement.h \
WebCore/html/HTMLTitleElement.cpp \
WebCore/html/HTMLTitleElement.h \
- WebCore/html/HTMLDocumentParser.cpp \
- WebCore/html/HTMLDocumentParser.h \
+ WebCore/html/LegacyHTMLDocumentParser.cpp \
+ WebCore/html/LegacyHTMLDocumentParser.h \
WebCore/html/HTMLUListElement.cpp \
WebCore/html/HTMLUListElement.h \
WebCore/html/HTMLViewSourceDocument.cpp \
@@ -1273,8 +1280,8 @@ webcore_sources += \
WebCore/html/LabelsNodeList.cpp \
WebCore/html/LabelsNodeList.h \
WebCore/html/MediaError.h \
- WebCore/html/PreloadScanner.cpp \
- WebCore/html/PreloadScanner.h \
+ WebCore/html/LegacyPreloadScanner.cpp \
+ WebCore/html/LegacyPreloadScanner.h \
WebCore/html/StepRange.cpp \
WebCore/html/StepRange.h \
WebCore/html/TextMetrics.h \
@@ -1341,6 +1348,7 @@ webcore_sources += \
WebCore/inspector/InspectorValues.cpp \
WebCore/inspector/InspectorValues.h \
WebCore/inspector/InspectorWorkerResource.h \
+ WebCore/inspector/ScriptBreakpoint.cpp \
WebCore/inspector/ScriptBreakpoint.h \
WebCore/inspector/ScriptDebugListener.h \
WebCore/inspector/ScriptGCEventListener.h \
@@ -1387,9 +1395,13 @@ webcore_sources += \
WebCore/loader/FTPDirectoryParser.h \
WebCore/loader/FormState.cpp \
WebCore/loader/FormState.h \
+ WebCore/loader/FormSubmission.cpp \
+ WebCore/loader/FormSubmission.h \
WebCore/loader/FrameLoader.cpp \
WebCore/loader/FrameLoader.h \
WebCore/loader/FrameLoaderClient.h \
+ WebCore/loader/FrameLoaderStateMachine.cpp \
+ WebCore/loader/FrameLoaderStateMachine.h \
WebCore/loader/FrameLoaderTypes.h \
WebCore/loader/HistoryController.cpp \
WebCore/loader/HistoryController.h \
@@ -1423,8 +1435,10 @@ webcore_sources += \
WebCore/loader/ResourceLoader.h \
WebCore/loader/ResourceLoadNotifier.cpp \
WebCore/loader/ResourceLoadNotifier.h \
- WebCore/loader/SinkDocument.cpp \
- WebCore/loader/SinkDocument.h \
+ WebCore/loader/SinkDocument.cpp \
+ WebCore/loader/SinkDocument.h \
+ WebCore/loader/SubframeLoader.cpp \
+ WebCore/loader/SubframeLoader.h \
WebCore/loader/SubresourceLoader.cpp \
WebCore/loader/SubresourceLoader.h \
WebCore/loader/SubresourceLoaderClient.h \
@@ -1805,6 +1819,8 @@ webcore_sources += \
WebCore/platform/text/BidiContext.h \
WebCore/platform/text/BidiResolver.h \
WebCore/platform/text/CharacterNames.h \
+ WebCore/platform/text/Hyphenation.cpp \
+ WebCore/platform/text/Hyphenation.h \
WebCore/platform/text/ParserUtilities.h \
WebCore/platform/text/PlatformString.h \
WebCore/platform/text/RegularExpression.cpp \
@@ -1934,6 +1950,8 @@ webcore_sources += \
WebCore/rendering/RenderImage.h \
WebCore/rendering/RenderImageGeneratedContent.cpp \
WebCore/rendering/RenderImageGeneratedContent.h \
+ WebCore/rendering/RenderIndicator.cpp \
+ WebCore/rendering/RenderIndicator.h \
WebCore/rendering/RenderInline.cpp \
WebCore/rendering/RenderInline.h \
WebCore/rendering/RenderLayer.cpp \
@@ -2381,6 +2399,7 @@ IDL_BINDINGS += \
WebCore/storage/DatabaseCallback.idl \
WebCore/storage/DatabaseSync.idl \
WebCore/storage/SQLError.idl \
+ WebCore/storage/SQLException.idl \
WebCore/storage/SQLResultSet.idl \
WebCore/storage/SQLResultSetRowList.idl \
WebCore/storage/SQLStatementCallback.idl \
@@ -2436,6 +2455,7 @@ webcore_sources += \
WebCore/storage/OriginUsageRecord.cpp \
WebCore/storage/OriginUsageRecord.h \
WebCore/storage/SQLError.h \
+ WebCore/storage/SQLException.h \
WebCore/storage/SQLResultSet.cpp \
WebCore/storage/SQLResultSet.h \
WebCore/storage/SQLResultSetRowList.cpp \
@@ -2589,6 +2609,20 @@ webcore_sources += \
endif # END ENABLE_DOM_STORAGE
# ----
+# Speech Input API support
+# ----
+if ENABLE_INPUT_SPEECH
+
+FEATURE_DEFINES += ENABLE_INPUT_SPEECH=1
+webcore_cppflags += -DENABLE_INPUT_SPEECH=1
+
+else
+
+webcore_cppflags += -DENABLE_INPUT_SPEECH=0
+
+endif # END ENABLE_INPUT_SPEECH
+
+# ----
# Icon Database Support
# ----
if ENABLE_ICONDATABASE
@@ -2834,8 +2868,6 @@ webcore_cppflags += \
webcore_sources += \
WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp \
- WebCore/bindings/js/JSWorkerConstructor.cpp \
- WebCore/bindings/js/JSWorkerConstructor.h \
WebCore/bindings/js/JSWorkerContextBase.cpp \
WebCore/bindings/js/JSWorkerContextBase.h \
WebCore/bindings/js/JSWorkerContextCustom.cpp \
@@ -2881,8 +2913,6 @@ webcore_cppflags += \
-DENABLE_SHARED_WORKERS=1
webcore_sources += \
- WebCore/bindings/js/JSSharedWorkerConstructor.cpp \
- WebCore/bindings/js/JSSharedWorkerConstructor.h \
WebCore/bindings/js/JSSharedWorkerCustom.cpp \
WebCore/workers/DefaultSharedWorkerRepository.cpp \
WebCore/workers/DefaultSharedWorkerRepository.h \
@@ -3338,9 +3368,12 @@ webcore_sources += \
WebCore/rendering/SVGRootInlineBox.h \
WebCore/rendering/SVGShadowTreeElements.cpp \
WebCore/rendering/SVGShadowTreeElements.h \
+ WebCore/rendering/SVGTextChunkLayoutInfo.cpp \
WebCore/rendering/SVGTextChunkLayoutInfo.h \
WebCore/rendering/SVGTextLayoutUtilities.cpp \
WebCore/rendering/SVGTextLayoutUtilities.h \
+ WebCore/rendering/SVGTextQuery.cpp \
+ WebCore/rendering/SVGTextQuery.h \
WebCore/rendering/style/SVGRenderStyle.cpp \
WebCore/rendering/style/SVGRenderStyle.h \
WebCore/rendering/style/SVGRenderStyleDefs.cpp \
@@ -3733,8 +3766,6 @@ webcore_cppflags += \
-DENABLE_WEB_SOCKETS=1
webcore_sources += \
- WebCore/bindings/js/JSWebSocketConstructor.cpp \
- WebCore/bindings/js/JSWebSocketConstructor.h \
WebCore/bindings/js/JSWebSocketCustom.cpp \
WebCore/platform/network/SocketStreamErrorBase.cpp \
WebCore/platform/network/SocketStreamErrorBase.h \
@@ -3749,7 +3780,9 @@ webcore_sources += \
WebCore/websockets/WebSocketHandshake.cpp \
WebCore/websockets/WebSocketHandshake.h \
WebCore/websockets/WebSocketHandshakeRequest.cpp \
- WebCore/websockets/WebSocketHandshakeRequest.h
+ WebCore/websockets/WebSocketHandshakeRequest.h \
+ WebCore/websockets/WebSocketHandshakeResponse.cpp \
+ WebCore/websockets/WebSocketHandshakeResponse.h
if ENABLE_WORKERS
webcore_sources += \
diff --git a/WebCore/WebCore.Video.exp b/WebCore/WebCore.Video.exp
index da79150..631a601 100644
--- a/WebCore/WebCore.Video.exp
+++ b/WebCore/WebCore.Video.exp
@@ -14,4 +14,5 @@ __ZNK7WebCore16HTMLMediaElement21processingUserGestureEv
__ZNK7WebCore16HTMLMediaElement5mutedEv
__ZNK7WebCore16HTMLMediaElement6volumeEv
__ZNK7WebCore16HTMLMediaElement7canPlayEv
+__ZNK7WebCore16HTMLMediaElement12playbackRateEv
__ZNK7WebCore16HTMLMediaElement8durationEv
diff --git a/WebCore/WebCore.base.exp b/WebCore/WebCore.base.exp
index 29704fb..b0b4d1b 100644
--- a/WebCore/WebCore.base.exp
+++ b/WebCore/WebCore.base.exp
@@ -248,8 +248,12 @@ __ZN7WebCore12IconDatabase4openERKNS_6StringE
__ZN7WebCore12IconDatabase5closeEv
__ZN7WebCore12IconDatabase9setClientEPNS_18IconDatabaseClientE
__ZN7WebCore12PluginWidget14invalidateRectERKNS_7IntRectE
+__ZN7WebCore12PrintContext12pagePropertyEPNS_5FrameEPKci
__ZN7WebCore12PrintContext13numberOfPagesEPNS_5FrameERKNS_9FloatSizeE
+__ZN7WebCore12PrintContext16isPageBoxVisibleEPNS_5FrameEi
+__ZN7WebCore12PrintContext20pageAreaRectInPixelsEPNS_5FrameEi
__ZN7WebCore12PrintContext20pageNumberForElementEPNS_7ElementERKNS_9FloatSizeE
+__ZN7WebCore12PrintContext25preferredPageSizeInPixelsEPNS_5FrameEi
__ZN7WebCore12PrintContext28computePageRectsWithPageSizeERKNS_9FloatSizeEb
__ZN7WebCore12PrintContextC1EPNS_5FrameE
__ZN7WebCore12PrintContextD1Ev
@@ -267,8 +271,8 @@ __ZN7WebCore12TextIteratorC1EPKNS_5RangeENS_20TextIteratorBehaviorE
__ZN7WebCore12WorkerThread17workerThreadCountEv
__ZN7WebCore12applyCommandEN3WTF10PassRefPtrINS_11EditCommandEEE
__ZN7WebCore12cacheStorageEv
-__ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEE
-__ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0EEENS_23EAnnotateForInterchangeEb
+__ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsE
+__ZN7WebCore12createMarkupEPKNS_5RangeEPN3WTF6VectorIPNS_4NodeELm0EEENS_23EAnnotateForInterchangeEbNS_13EAbsoluteURLsE
__ZN7WebCore12gcControllerEv
__ZN7WebCore12iconDatabaseEv
__ZN7WebCore13AXObjectCache11getOrCreateEPNS_12RenderObjectE
@@ -373,6 +377,7 @@ __ZN7WebCore15StringTruncator5widthERKNS_6StringERKNS_4FontEb
__ZN7WebCore15VisiblePositionC1EPNS_4NodeEiNS_9EAffinityE
__ZN7WebCore15VisiblePositionC1ERKNS_8PositionENS_9EAffinityE
__ZN7WebCore15reportExceptionEPN3JSC9ExecStateENS0_7JSValueE
+__ZN7WebCore16AbstractDatabase14setIsAvailableEb
__ZN7WebCore16FontFallbackList15releaseFontDataEv
__ZN7WebCore16FontPlatformDataC1EP6NSFontbb
__ZN7WebCore16FontPlatformDataD1Ev
@@ -447,6 +452,7 @@ __ZN7WebCore21findEventWithKeyStateEPNS_5EventE
__ZN7WebCore21isBackForwardLoadTypeENS_13FrameLoadTypeE
__ZN7WebCore21mainThreadNormalWorldEv
__ZN7WebCore21reportThreadViolationEPKcNS_20ThreadViolationRoundE
+__ZN7WebCore21setPlatformStrategiesEPNS_18PlatformStrategiesE
__ZN7WebCore22ScriptExecutionContext26canSuspendActiveDOMObjectsEv
__ZN7WebCore22applicationIsAppleMailEv
__ZN7WebCore22counterValueForElementEPNS_7ElementE
@@ -504,6 +510,7 @@ __ZN7WebCore4KURLC1ERKS0_RKNS_6StringE
__ZN7WebCore4Node17stopIgnoringLeaksEv
__ZN7WebCore4Node18startIgnoringLeaksEv
__ZN7WebCore4Node19setNeedsStyleRecalcENS_15StyleChangeTypeE
+__ZN7WebCore4Node10renderRectEPb
__ZN7WebCore4Page12setGroupNameERKNS_6StringE
__ZN7WebCore4Page13didStopPluginEPNS_14HaltablePluginE
__ZN7WebCore4Page14didStartPluginEPNS_14HaltablePluginE
@@ -544,8 +551,8 @@ __ZN7WebCore5Frame24computeAndSetTypingStyleEPNS_19CSSStyleDeclarationENS_10Edit
__ZN7WebCore5Frame25matchLabelsAgainstElementEP7NSArrayPNS_7ElementE
__ZN7WebCore5Frame28searchForLabelsBeforeElementEP7NSArrayPNS_7ElementEPmPb
__ZN7WebCore5Frame34setMarkedTextMatchesAreHighlightedEb
+__ZN7WebCore5Frame6createEPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
__ZN7WebCore5Frame7setViewEN3WTF10PassRefPtrINS_9FrameViewEEE
-__ZN7WebCore5FrameC1EPNS_4PageEPNS_21HTMLFrameOwnerElementEPNS_17FrameLoaderClientE
__ZN7WebCore5FrameD1Ev
__ZN7WebCore5Image12supportsTypeERKNS_6StringE
__ZN7WebCore5Image20loadPlatformResourceEPKc
@@ -615,16 +622,18 @@ __ZN7WebCore7IntRectC1ERKNS_9FloatRectE
__ZN7WebCore7IntSizeC1ERK7_NSSize
__ZN7WebCore7cookiesEPKNS_8DocumentERKNS_4KURLE
__ZN7WebCore7nsColorERKNS_5ColorE
-__ZN7WebCore8Database14setIsAvailableEb
__ZN7WebCore8Document11createRangeEv
__ZN7WebCore8Document13removeMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore8Document13svgExtensionsEv
__ZN7WebCore8Document14setFocusedNodeEN3WTF10PassRefPtrINS_4NodeEEE
+__ZN7WebCore8Document16isPageBoxVisibleEi
__ZN7WebCore8Document17getFocusableNodesERN3WTF6VectorINS1_6RefPtrINS_4NodeEEELm0EEE
__ZN7WebCore8Document19accessSVGExtensionsEv
+__ZN7WebCore8Document20pageAreaRectInPixelsEi
__ZN7WebCore8Document22createDocumentFragmentEv
__ZN7WebCore8Document23renderedRectsForMarkersENS_14DocumentMarker10MarkerTypeE
__ZN7WebCore8Document24setShouldCreateRenderersEb
+__ZN7WebCore8Document25preferredPageSizeInPixelsEi
__ZN7WebCore8Document36updateLayoutIgnorePendingStylesheetsEv
__ZN7WebCore8Document4headEv
__ZN7WebCore8FormDataD1Ev
@@ -794,8 +803,6 @@ __ZNK7WebCore10ScrollView18visibleContentRectEb
__ZNK7WebCore11CachedImage5imageEv
__ZNK7WebCore11FrameLoader10isCompleteEv
__ZNK7WebCore11FrameLoader14frameHasLoadedEv
-__ZNK7WebCore11FrameLoader15containsPluginsEv
-__ZNK7WebCore11FrameLoader15firstLayoutDoneEv
__ZNK7WebCore11FrameLoader16outgoingReferrerEv
__ZNK7WebCore11FrameLoader20activeDocumentLoaderEv
__ZNK7WebCore11FrameLoader27numPendingOrLoadingRequestsEb
@@ -894,6 +901,8 @@ __ZNK7WebCore20ResourceResponseBase16textEncodingNameEv
__ZNK7WebCore20ResourceResponseBase17suggestedFilenameEv
__ZNK7WebCore20ResourceResponseBase3urlEv
__ZNK7WebCore20ResourceResponseBase8mimeTypeEv
+__ZNK7WebCore23FrameLoaderStateMachine15firstLayoutDoneEv
+__ZNK7WebCore23FrameLoaderStateMachine23committingFirstRealLoadEv
__ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
__ZNK7WebCore4Font10floatWidthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE
__ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEii
@@ -1019,6 +1028,7 @@ _wkGetFontInLanguageForCharacter
_wkGetFontInLanguageForRange
_wkGetGlyphTransformedAdvances
_wkGetGlyphsForCharacters
+_wkGetHyphenationLocationBeforeIndex
_wkGetMIMETypeForExtension
_wkGetNSURLResponseCalculatedExpiration
_wkGetNSURLResponseLastModifiedDate
@@ -1055,4 +1065,3 @@ _wkSetUpFontCache
_wkSignalCFReadStreamEnd
_wkSignalCFReadStreamError
_wkSignalCFReadStreamHasBytes
-
diff --git a/WebCore/WebCore.gyp/WebCore.gyp b/WebCore/WebCore.gyp/WebCore.gyp
index 16f19d9..4c193cc 100644
--- a/WebCore/WebCore.gyp/WebCore.gyp
+++ b/WebCore/WebCore.gyp/WebCore.gyp
@@ -726,7 +726,7 @@
'<@(webcore_files)',
# For WebCoreSystemInterface, Mac-only.
- '../../WebKit/mac/WebCoreSupport/WebSystemInterface.m',
+ '../../WebKit/mac/WebCoreSupport/WebSystemInterface.mm',
],
'sources/': [
# Exclude JSC custom bindings.
@@ -896,6 +896,11 @@
['exclude', 'rendering/SVG'],
],
}],
+ ['use_accelerated_compositing==1', {
+ 'dependencies': [
+ '<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
+ ],
+ }],
['OS=="linux" or OS=="freebsd"', {
'dependencies': [
'<(chromium_src_dir)/build/linux/system.gyp:fontconfig',
@@ -1016,7 +1021,7 @@
# Use USE_NEW_THEME on Mac.
['include', 'platform/Theme\\.cpp$'],
- ['include', 'WebKit/mac/WebCoreSupport/WebSystemInterface\\.m$'],
+ ['include', 'WebKit/mac/WebCoreSupport/WebSystemInterface\\.mm$'],
],
'sources!': [
# The Mac uses platform/mac/KillRingMac.mm instead of the dummy
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index f03613a..4887033 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -83,6 +83,7 @@
'dom/WebKitTransitionEvent.idl',
'dom/WheelEvent.idl',
'html/Blob.idl',
+ 'html/BlobBuilder.idl',
'html/canvas/WebGLActiveInfo.idl',
'html/canvas/ArrayBufferView.idl',
'html/canvas/ArrayBuffer.idl',
@@ -238,6 +239,7 @@
'storage/IDBSuccessEvent.idl',
'storage/IndexedDatabaseRequest.idl',
'storage/SQLError.idl',
+ 'storage/SQLException.idl',
'storage/SQLResultSet.idl',
'storage/SQLResultSetRowList.idl',
'storage/SQLStatementCallback.idl',
@@ -549,6 +551,7 @@
'bindings/js/JSEventCustom.cpp',
'bindings/js/JSEventListener.cpp',
'bindings/js/JSEventListener.h',
+ 'bindings/js/JSEventSourceCustom.cpp',
'bindings/js/JSEventTarget.cpp',
'bindings/js/JSEventTarget.h',
'bindings/js/JSExceptionBase.cpp',
@@ -589,8 +592,6 @@
'bindings/js/JSLocationCustom.h',
'bindings/js/JSMainThreadExecState.cpp',
'bindings/js/JSMainThreadExecState.h',
- 'bindings/js/JSMessageChannelConstructor.cpp',
- 'bindings/js/JSMessageChannelConstructor.h',
'bindings/js/JSMessageChannelCustom.cpp',
'bindings/js/JSMessageEventCustom.cpp',
'bindings/js/JSMessagePortCustom.cpp',
@@ -615,8 +616,6 @@
'bindings/js/JSPluginElementFunctions.h',
'bindings/js/JSRGBColor.cpp',
'bindings/js/JSRGBColor.h',
- 'bindings/js/JSSharedWorkerConstructor.cpp',
- 'bindings/js/JSSharedWorkerConstructor.h',
'bindings/js/JSSharedWorkerCustom.cpp',
'bindings/js/JSScriptProfileNodeCustom.cpp',
'bindings/js/JSSQLResultSetRowListCustom.cpp',
@@ -636,15 +635,9 @@
'bindings/js/JSSVGPODTypeWrapper.h',
'bindings/js/JSTextCustom.cpp',
'bindings/js/JSTreeWalkerCustom.cpp',
- 'bindings/js/JSWebKitCSSMatrixConstructor.cpp',
- 'bindings/js/JSWebKitCSSMatrixConstructor.h',
- 'bindings/js/JSWebKitPointConstructor.cpp',
- 'bindings/js/JSWebKitPointConstructor.h',
- 'bindings/js/JSWebSocketConstructor.cpp',
- 'bindings/js/JSWebSocketConsuructor.h',
+ 'bindings/js/JSWebKitCSSMatrixCustom.cpp',
+ 'bindings/js/JSWebKitPointCustom.cpp',
'bindings/js/JSWebSocketCustom.cpp',
- 'bindings/js/JSWorkerConstructor.cpp',
- 'bindings/js/JSWorkerConstructor.h',
'bindings/js/JSWorkerContextBase.cpp',
'bindings/js/JSWorkerContextBase.h',
'bindings/js/JSWorkerContextCustom.cpp',
@@ -653,8 +646,6 @@
'bindings/js/JSWorkerCustom.cpp',
'bindings/js/JSXMLHttpRequestCustom.cpp',
'bindings/js/JSXMLHttpRequestUploadCustom.cpp',
- 'bindings/js/JSXSLTProcessorConstructor.cpp',
- 'bindings/js/JSXSLTProcessorConstructor.h',
'bindings/js/JSXSLTProcessorCustom.cpp',
'bindings/js/JavaScriptCallFrame.cpp',
'bindings/js/JavaScriptCallFrame.h',
@@ -1146,6 +1137,7 @@
'dom/ExceptionBase.h',
'dom/ExceptionCode.cpp',
'dom/ExceptionCode.h',
+ 'dom/FragmentScriptingPermission.h',
'dom/InputElement.cpp',
'dom/InputElement.h',
'dom/KeyboardEvent.cpp',
@@ -1207,6 +1199,7 @@
'dom/Range.h',
'dom/RangeBoundaryPoint.h',
'dom/RangeException.h',
+ 'dom/RawDataDocumentParser.h',
'dom/RegisteredEventListener.cpp',
'dom/RegisteredEventListener.h',
'dom/ScriptElement.cpp',
@@ -1389,6 +1382,8 @@
'html/AsyncImageResizer.h',
'html/Blob.cpp',
'html/Blob.h',
+ 'html/BlobBuilder.cpp',
+ 'html/BlobBuilder.h',
'html/canvas/ArrayBufferView.cpp',
'html/canvas/ArrayBufferView.h',
'html/canvas/ArrayBuffer.cpp',
@@ -1448,6 +1443,8 @@
'html/CollectionCache.cpp',
'html/CollectionCache.h',
'html/CollectionType.h',
+ 'html/CSSPreloadScanner.cpp',
+ 'html/CSSPreloadScanner.h',
'html/DataGridColumn.cpp',
'html/DataGridColumn.h',
'html/DOMDataGridDataSource.cpp',
@@ -1475,16 +1472,18 @@
'html/FileThreadTask.h',
'html/FormDataList.cpp',
'html/FormDataList.h',
- 'html/HTML5EntityParser.cpp',
- 'html/HTML5EntityParser.h',
- 'html/HTML5Lexer.cpp',
- 'html/HTML5Lexer.h',
- 'html/HTML5DocumentParser.cpp',
- 'html/HTML5DocumentParser.h',
- 'html/HTML5TreeBuilder.cpp',
- 'html/HTML5TreeBuilder.h',
- 'html/HTML5ScriptRunner.cpp',
- 'html/HTML5ScriptRunner.h',
+ 'html/HTMLEntityParser.cpp',
+ 'html/HTMLEntityParser.h',
+ 'html/HTMLTokenizer.cpp',
+ 'html/HTMLTokenizer.h',
+ 'html/HTMLDocumentParser.cpp',
+ 'html/HTMLDocumentParser.h',
+ 'html/HTMLPreloadScanner.cpp',
+ 'html/HTMLPreloadScanner.h',
+ 'html/HTMLScriptRunner.cpp',
+ 'html/HTMLScriptRunner.h',
+ 'html/HTMLTreeBuilder.cpp',
+ 'html/HTMLTreeBuilder.h',
'html/HTMLAllCollection.cpp',
'html/HTMLAllCollection.h',
'html/HTMLAnchorElement.cpp',
@@ -1567,6 +1566,7 @@
'html/HTMLImageLoader.h',
'html/HTMLInputElement.cpp',
'html/HTMLInputElement.h',
+ 'html/HTMLInputStream.h',
'html/HTMLIsIndexElement.cpp',
'html/HTMLIsIndexElement.h',
'html/HTMLKeygenElement.cpp',
@@ -1609,10 +1609,12 @@
'html/HTMLParagraphElement.h',
'html/HTMLParamElement.cpp',
'html/HTMLParamElement.h',
- 'html/LegacyHTMLTreeConstructor.cpp',
- 'html/LegacyHTMLTreeConstructor.h',
+ 'html/LegacyHTMLTreeBuilder.cpp',
+ 'html/LegacyHTMLTreeBuilder.h',
'html/HTMLParserErrorCodes.cpp',
'html/HTMLParserErrorCodes.h',
+ 'html/HTMLParserScheduler.cpp',
+ 'html/HTMLParserScheduler.h',
'html/HTMLPlugInElement.cpp',
'html/HTMLPlugInElement.h',
'html/HTMLPlugInImageElement.cpp',
@@ -1651,8 +1653,8 @@
'html/HTMLTextAreaElement.h',
'html/HTMLTitleElement.cpp',
'html/HTMLTitleElement.h',
- 'html/HTMLDocumentParser.cpp',
- 'html/HTMLDocumentParser.h',
+ 'html/LegacyHTMLDocumentParser.cpp',
+ 'html/LegacyHTMLDocumentParser.h',
'html/HTMLUListElement.cpp',
'html/HTMLUListElement.h',
'html/HTMLVideoElement.cpp',
@@ -1666,8 +1668,8 @@
'html/LabelsNodeList.cpp',
'html/LabelsNodeList.h',
'html/MediaError.h',
- 'html/PreloadScanner.cpp',
- 'html/PreloadScanner.h',
+ 'html/LegacyPreloadScanner.cpp',
+ 'html/LegacyPreloadScanner.h',
'html/StepRange.cpp',
'html/StepRange.h',
'html/TextMetrics.h',
@@ -1707,6 +1709,7 @@
'inspector/InspectorValues.cpp',
'inspector/InspectorValues.h',
'inspector/InspectorWorkerResource.h',
+ 'inspector/ScriptBreakpoint.cpp',
'inspector/ScriptBreakpoint.h',
'inspector/ScriptDebugListener.h',
'inspector/ScriptGCEventListener.h',
@@ -1796,9 +1799,13 @@
'loader/FTPDirectoryParser.h',
'loader/FormState.cpp',
'loader/FormState.h',
+ 'loader/FormSubmission.cpp',
+ 'loader/FormSubmission.h',
'loader/FrameLoader.cpp',
'loader/FrameLoader.h',
'loader/FrameLoaderClient.h',
+ 'loader/FrameLoaderStateMachine.cpp',
+ 'loader/FrameLoaderStateMachine.h',
'loader/FrameLoaderTypes.h',
'loader/HistoryController.cpp',
'loader/HistoryController.h',
@@ -1834,6 +1841,8 @@
'loader/ResourceLoadNotifier.h',
'loader/SinkDocument.cpp',
'loader/SinkDocument.h',
+ 'loader/SubframeLoader.cpp',
+ 'loader/SubframeLoader.h',
'loader/SubresourceLoader.cpp',
'loader/SubresourceLoader.h',
'loader/SubresourceLoaderClient.h',
@@ -2127,6 +2136,8 @@
'platform/graphics/chromium/IconChromiumWin.cpp',
'platform/graphics/chromium/ImageBufferData.h',
'platform/graphics/chromium/ImageChromiumMac.mm',
+ 'platform/graphics/chromium/ImageLayerChromium.cpp',
+ 'platform/graphics/chromium/ImageLayerChromium.h',
'platform/graphics/chromium/LayerChromium.cpp',
'platform/graphics/chromium/LayerChromium.h',
'platform/graphics/chromium/LayerRendererChromium.cpp',
@@ -2135,12 +2146,16 @@
'platform/graphics/chromium/PlatformIcon.h',
'platform/graphics/chromium/SimpleFontDataChromiumWin.cpp',
'platform/graphics/chromium/SimpleFontDataLinux.cpp',
+ 'platform/graphics/chromium/TransformLayerChromium.cpp',
+ 'platform/graphics/chromium/TransformLayerChromium.h',
'platform/graphics/chromium/TransparencyWin.cpp',
'platform/graphics/chromium/TransparencyWin.h',
'platform/graphics/chromium/UniscribeHelper.cpp',
'platform/graphics/chromium/UniscribeHelper.h',
'platform/graphics/chromium/UniscribeHelperTextRun.cpp',
'platform/graphics/chromium/UniscribeHelperTextRun.h',
+ 'platform/graphics/chromium/WebGLLayerChromium.cpp',
+ 'platform/graphics/chromium/WebGLLayerChromium.h',
'platform/graphics/filters/FEBlend.cpp',
'platform/graphics/filters/FEBlend.h',
'platform/graphics/filters/FEColorMatrix.cpp',
@@ -2763,6 +2778,8 @@
'platform/text/BidiContext.h',
'platform/text/BidiResolver.h',
'platform/text/CharacterNames.h',
+ 'platform/text/Hyphenation.cpp',
+ 'platform/text/Hyphenation.h',
'platform/text/ParserUtilities.h',
'platform/text/PlatformString.h',
'platform/text/RegularExpression.cpp',
@@ -3159,6 +3176,8 @@
'rendering/RenderImage.h',
'rendering/RenderImageGeneratedContent.cpp',
'rendering/RenderImageGeneratedContent.h',
+ 'rendering/RenderIndicator.cpp',
+ 'rendering/RenderIndicator.h',
'rendering/RenderInline.cpp',
'rendering/RenderInline.h',
'rendering/RenderLayer.cpp',
@@ -3337,9 +3356,12 @@
'rendering/SVGRootInlineBox.h',
'rendering/SVGShadowTreeElements.cpp',
'rendering/SVGShadowTreeElements.h',
+ 'rendering/SVGTextChunkLayoutInfo.cpp',
'rendering/SVGTextChunkLayoutInfo.h',
'rendering/SVGTextLayoutUtilities.cpp',
'rendering/SVGTextLayoutUtilities.h',
+ 'rendering/SVGTextQuery.cpp',
+ 'rendering/SVGTextQuery.h',
'rendering/TableLayout.h',
'rendering/TextControlInnerElements.cpp',
'rendering/TextControlInnerElements.h',
@@ -3417,6 +3439,7 @@
'storage/OriginUsageRecord.cpp',
'storage/OriginUsageRecord.h',
'storage/SQLError.h',
+ 'storage/SQLException.h',
'storage/SQLResultSet.cpp',
'storage/SQLResultSet.h',
'storage/SQLResultSetRowList.cpp',
@@ -3789,6 +3812,8 @@
'websockets/WebSocketHandshake.h',
'websockets/WebSocketHandshakeRequest.cpp',
'websockets/WebSocketHandshakeRequest.h',
+ 'websockets/WebSocketHandshakeResponse.cpp',
+ 'websockets/WebSocketHandshakeResponse.h',
'websockets/WorkerThreadableWebSocketChannel.cpp',
'websockets/WorkerThreadableWebSocketChannel.h',
'workers/AbstractWorker.cpp',
@@ -3901,6 +3926,7 @@
'inspector/front-end/ConsoleView.js',
'inspector/front-end/ContextMenu.js',
'inspector/front-end/CookieItemsView.js',
+ 'inspector/front-end/CSSCompletions.js',
'inspector/front-end/CSSStyleModel.js',
'inspector/front-end/Database.js',
'inspector/front-end/DatabaseQueryView.js',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index f4abc27..66e77ca 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -1,3 +1,6 @@
+
+include(../common.pri)
+
CONFIG(standalone_package) {
isEmpty(WC_GENERATED_SOURCES_DIR):WC_GENERATED_SOURCES_DIR = $$PWD/generated
} else {
@@ -66,6 +69,7 @@ contains(DEFINES, ENABLE_SINGLE_THREADED=1) {
!contains(DEFINES, ENABLE_BLOB_SLICE=.): DEFINES += ENABLE_BLOB_SLICE=0
!contains(DEFINES, ENABLE_NOTIFICATIONS=.): DEFINES += ENABLE_NOTIFICATIONS=1
!contains(DEFINES, ENABLE_IMAGE_RESIZER=.): DEFINES += ENABLE_IMAGE_RESIZER=0
+!contains(DEFINES, ENABLE_INPUT_SPEECH=.): DEFINES += ENABLE_INPUT_SPEECH=0
greaterThan(QT_MINOR_VERSION, 5) {
!contains(DEFINES, ENABLE_3D_RENDERING=.): DEFINES += ENABLE_3D_RENDERING=1
@@ -316,6 +320,7 @@ IDL_BINDINGS += \
dom/WebKitTransitionEvent.idl \
dom/WheelEvent.idl \
html/Blob.idl \
+ html/BlobBuilder.idl \
html/canvas/ArrayBufferView.idl \
html/canvas/ArrayBuffer.idl \
html/canvas/Int8Array.idl \
@@ -471,6 +476,7 @@ IDL_BINDINGS += \
storage/Storage.idl \
storage/StorageEvent.idl \
storage/SQLError.idl \
+ storage/SQLException.idl \
storage/SQLResultSet.idl \
storage/SQLResultSetRowList.idl \
storage/SQLStatementCallback.idl \
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index eb77370..68a5527 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -25,6 +25,13 @@ symbian: {
webkitbackup.sources = ../WebKit/qt/symbian/backup_registration.xml
webkitbackup.path = /private/10202D56/import/packages/$$replace(TARGET.UID3, 0x,)
+ contains(QT_CONFIG, declarative) {
+ declarativeImport.sources = qmlwebkitplugin$${QT_LIBINFIX}.dll
+ declarativeImport.sources += ../WebKit/qt/declarative/qmldir
+ declarativeImport.path = c:$$QT_IMPORTS_BASE_DIR/QtWebKit
+ DEPLOYMENT += declarativeImport
+ }
+
DEPLOYMENT += webkitlibs webkitbackup
# Need to guarantee that these come before system includes of /epoc32/include
@@ -100,7 +107,7 @@ win32-msvc2005|win32-msvc2008:{
}
# Pick up 3rdparty libraries from INCLUDE/LIB just like with MSVC
-win32-g++ {
+win32-g++* {
TMPPATH = $$quote($$(INCLUDE))
QMAKE_INCDIR_POST += $$split(TMPPATH,";")
TMPPATH = $$quote($$(LIB))
@@ -298,7 +305,7 @@ SOURCES += \
bindings/js/JSDOMWrapper.cpp \
bindings/js/JSElementCustom.cpp \
bindings/js/JSEventCustom.cpp \
- bindings/js/JSEventSourceConstructor.cpp \
+ bindings/js/JSEventSourceCustom.cpp \
bindings/js/JSEventTarget.cpp \
bindings/js/JSExceptionBase.cpp \
bindings/js/JSGeolocationCustom.cpp \
@@ -337,13 +344,12 @@ SOURCES += \
bindings/js/JSStyleSheetListCustom.cpp \
bindings/js/JSTextCustom.cpp \
bindings/js/JSTreeWalkerCustom.cpp \
- bindings/js/JSWebKitCSSMatrixConstructor.cpp \
- bindings/js/JSWebKitPointConstructor.cpp \
+ bindings/js/JSWebKitCSSMatrixCustom.cpp \
+ bindings/js/JSWebKitPointCustom.cpp \
bindings/js/JSXMLHttpRequestCustom.cpp \
bindings/js/JSXMLHttpRequestUploadCustom.cpp \
bindings/js/JSPluginCustom.cpp \
bindings/js/JSPluginArrayCustom.cpp \
- bindings/js/JSMessageChannelConstructor.cpp \
bindings/js/JSMessageChannelCustom.cpp \
bindings/js/JSMessageEventCustom.cpp \
bindings/js/JSMessagePortCustom.cpp \
@@ -501,6 +507,7 @@ SOURCES += \
dom/Notation.cpp \
dom/OptionGroupElement.cpp \
dom/OptionElement.cpp \
+ dom/StaticHashSetNodeList.cpp \
dom/OverflowEvent.cpp \
dom/PageTransitionEvent.cpp \
dom/PopStateEvent.cpp \
@@ -510,6 +517,7 @@ SOURCES += \
dom/ProgressEvent.cpp \
dom/QualifiedName.cpp \
dom/Range.cpp \
+ dom/RawDataDocumentParser.h \
dom/RegisteredEventListener.cpp \
dom/ScriptElement.cpp \
dom/ScriptExecutionContext.cpp \
@@ -591,6 +599,7 @@ SOURCES += \
history/PageCache.cpp \
html/AsyncImageResizer.cpp \
html/Blob.cpp \
+ html/BlobBuilder.cpp \
html/canvas/CanvasGradient.cpp \
html/canvas/CanvasPattern.cpp \
html/canvas/CanvasPixelArray.cpp \
@@ -598,6 +607,7 @@ SOURCES += \
html/canvas/CanvasRenderingContext2D.cpp \
html/canvas/CanvasStyle.cpp \
html/CollectionCache.cpp \
+ html/CSSPreloadScanner.cpp \
html/DataGridColumn.cpp \
html/DataGridColumnList.cpp \
html/DateComponents.cpp \
@@ -610,11 +620,12 @@ SOURCES += \
html/FileStreamProxy.cpp \
html/FileThread.cpp \
html/FormDataList.cpp \
- html/HTML5EntityParser.cpp \
- html/HTML5Lexer.cpp \
- html/HTML5DocumentParser.cpp \
- html/HTML5TreeBuilder.cpp \
- html/HTML5ScriptRunner.cpp \
+ html/HTMLEntityParser.cpp \
+ html/HTMLTokenizer.cpp \
+ html/HTMLDocumentParser.cpp \
+ html/HTMLPreloadScanner.cpp \
+ html/HTMLScriptRunner.cpp \
+ html/HTMLTreeBuilder.cpp \
html/HTMLAllCollection.cpp \
html/HTMLAnchorElement.cpp \
html/HTMLAppletElement.cpp \
@@ -675,8 +686,9 @@ SOURCES += \
html/HTMLOptionsCollection.cpp \
html/HTMLParagraphElement.cpp \
html/HTMLParamElement.cpp \
- html/LegacyHTMLTreeConstructor.cpp \
+ html/LegacyHTMLTreeBuilder.cpp \
html/HTMLParserErrorCodes.cpp \
+ html/HTMLParserScheduler.cpp \
html/HTMLPlugInElement.cpp \
html/HTMLPlugInImageElement.cpp \
html/HTMLPreElement.cpp \
@@ -695,13 +707,13 @@ SOURCES += \
html/HTMLTableSectionElement.cpp \
html/HTMLTextAreaElement.cpp \
html/HTMLTitleElement.cpp \
- html/HTMLDocumentParser.cpp \
+ html/LegacyHTMLDocumentParser.cpp \
html/HTMLUListElement.cpp \
html/HTMLViewSourceDocument.cpp \
html/ImageData.cpp \
html/ImageResizerThread.cpp \
html/LabelsNodeList.cpp \
- html/PreloadScanner.cpp \
+ html/LegacyPreloadScanner.cpp \
html/StepRange.cpp \
html/ValidityState.cpp \
inspector/ConsoleMessage.cpp \
@@ -719,6 +731,7 @@ SOURCES += \
inspector/InspectorResource.cpp \
inspector/InspectorTimelineAgent.cpp \
inspector/InspectorValues.cpp \
+ inspector/ScriptBreakpoint.cpp \
inspector/TimelineRecordFactory.cpp \
loader/archive/ArchiveFactory.cpp \
loader/archive/ArchiveResource.cpp \
@@ -739,7 +752,9 @@ SOURCES += \
loader/DocumentThreadableLoader.cpp \
loader/DocumentWriter.cpp \
loader/FormState.cpp \
+ loader/FormSubmission.cpp \
loader/FrameLoader.cpp \
+ loader/FrameLoaderStateMachine.cpp \
loader/HistoryController.cpp \
loader/FTPDirectoryDocument.cpp \
loader/FTPDirectoryParser.cpp \
@@ -761,6 +776,7 @@ SOURCES += \
loader/ResourceLoader.cpp \
loader/ResourceLoadNotifier.cpp \
loader/SinkDocument.cpp \
+ loader/SubframeLoader.cpp \
loader/SubresourceLoader.cpp \
loader/TextDocument.cpp \
loader/TextResourceDecoder.cpp \
@@ -821,6 +837,7 @@ SOURCES += \
platform/BlobItem.cpp \
platform/text/Base64.cpp \
platform/text/BidiContext.cpp \
+ platform/text/Hyphenation.cpp \
platform/ContentType.cpp \
platform/ContextMenu.cpp \
platform/CrossThreadCopier.cpp \
@@ -947,6 +964,7 @@ SOURCES += \
rendering/RenderIFrame.cpp \
rendering/RenderImage.cpp \
rendering/RenderImageGeneratedContent.cpp \
+ rendering/RenderIndicator.cpp \
rendering/RenderInline.cpp \
rendering/RenderLayer.cpp \
rendering/RenderLineBoxList.cpp \
@@ -1059,7 +1077,6 @@ HEADERS += \
bindings/js/JSDOMWindowShell.h \
bindings/js/JSDOMWrapper.h \
bindings/js/JSEventListener.h \
- bindings/js/JSEventSourceConstructor.h \
bindings/js/JSEventTarget.h \
bindings/js/JSHistoryCustom.h \
bindings/js/JSHTMLAppletElementCustom.h \
@@ -1070,19 +1087,13 @@ HEADERS += \
bindings/js/JSImageConstructor.h \
bindings/js/JSLazyEventListener.h \
bindings/js/JSLocationCustom.h \
- bindings/js/JSMessageChannelConstructor.h \
bindings/js/JSNodeCustom.h \
bindings/js/JSNodeFilterCondition.h \
bindings/js/JSOptionConstructor.h \
bindings/js/JSPluginElementFunctions.h \
- bindings/js/JSSharedWorkerConstructor.h \
bindings/js/JSStorageCustom.h \
- bindings/js/JSWebKitCSSMatrixConstructor.h \
- bindings/js/JSWebKitPointConstructor.h \
- bindings/js/JSWorkerConstructor.h \
bindings/js/JSWorkerContextBase.h \
bindings/js/JSWorkerContextErrorHandler.h \
- bindings/js/JSXSLTProcessorConstructor.h \
bindings/js/JavaScriptCallFrame.h \
bindings/js/ScheduledAction.h \
bindings/js/ScriptArray.h \
@@ -1222,6 +1233,7 @@ HEADERS += \
dom/EventTarget.h \
dom/ExceptionBase.h \
dom/ExceptionCode.h \
+ dom/FragmentScriptingPermission.h \
dom/InputElement.h \
dom/KeyboardEvent.h \
dom/MessageChannel.h \
@@ -1240,6 +1252,7 @@ HEADERS += \
dom/Notation.h \
dom/OptionElement.h \
dom/OptionGroupElement.h \
+ dom/StaticHashSetNodeList.h \
dom/OverflowEvent.h \
dom/PageTransitionEvent.h \
dom/Position.h \
@@ -1328,6 +1341,7 @@ HEADERS += \
history/PageCache.h \
html/AsyncImageResizer.h \
html/Blob.h \
+ html/BlobBuilder.h \
html/canvas/CanvasGradient.h \
html/canvas/CanvasPattern.h \
html/canvas/CanvasPixelArray.h \
@@ -1413,7 +1427,7 @@ HEADERS += \
html/HTMLParagraphElement.h \
html/HTMLParamElement.h \
html/HTMLParserErrorCodes.h \
- html/LegacyHTMLTreeConstructor.h \
+ html/LegacyHTMLTreeBuilder.h \
html/HTMLPlugInElement.h \
html/HTMLPlugInImageElement.h \
html/HTMLPreElement.h \
@@ -1433,14 +1447,14 @@ HEADERS += \
html/HTMLTableSectionElement.h \
html/HTMLTextAreaElement.h \
html/HTMLTitleElement.h \
- html/HTMLDocumentParser.h \
+ html/LegacyHTMLDocumentParser.h \
html/HTMLUListElement.h \
html/HTMLVideoElement.h \
html/HTMLViewSourceDocument.h \
html/ImageData.h \
html/ImageResizerThread.h \
html/LabelsNodeList.h \
- html/PreloadScanner.h \
+ html/LegacyPreloadScanner.h \
html/StepRange.h \
html/TimeRanges.h \
html/ValidityState.h \
@@ -1485,6 +1499,7 @@ HEADERS += \
loader/DocumentThreadableLoader.h \
loader/FormState.h \
loader/FrameLoader.h \
+ loader/FrameLoaderStateMachine.h \
loader/FTPDirectoryDocument.h \
loader/FTPDirectoryParser.h \
loader/icon/IconDatabase.h \
@@ -1673,6 +1688,7 @@ HEADERS += \
platform/text/AtomicString.h \
platform/text/Base64.h \
platform/text/BidiContext.h \
+ platform/text/Hyphenation.h \
platform/text/qt/TextCodecQt.h \
platform/text/RegularExpression.h \
platform/text/SegmentedString.h \
@@ -1736,6 +1752,7 @@ HEADERS += \
rendering/RenderIFrame.h \
rendering/RenderImageGeneratedContent.h \
rendering/RenderImage.h \
+ rendering/RenderIndicator.h \
rendering/RenderInline.h \
rendering/RenderLayer.h \
rendering/RenderLineBoxList.h \
@@ -1843,6 +1860,7 @@ HEADERS += \
rendering/SVGShadowTreeElements.h \
rendering/SVGTextChunkLayoutInfo.h \
rendering/SVGTextLayoutUtilities.h \
+ rendering/SVGTextQuery.h \
rendering/TextControlInnerElements.h \
rendering/TransformState.h \
svg/animation/SMILTimeContainer.h \
@@ -2180,6 +2198,7 @@ SOURCES += \
../WebKit/qt/Api/qwebplugindatabase.cpp \
../WebKit/qt/Api/qwebpluginfactory.cpp \
../WebKit/qt/Api/qwebsecurityorigin.cpp \
+ ../WebKit/qt/Api/qwebscriptworld.cpp \
../WebKit/qt/Api/qwebdatabase.cpp \
../WebKit/qt/Api/qwebinspector.cpp \
../WebKit/qt/Api/qwebkitversion.cpp
@@ -2451,7 +2470,6 @@ contains(DEFINES, ENABLE_ICONDATABASE=1) {
contains(DEFINES, ENABLE_WORKERS=1) {
SOURCES += \
bindings/js/JSDedicatedWorkerContextCustom.cpp \
- bindings/js/JSWorkerConstructor.cpp \
bindings/js/JSWorkerContextBase.cpp \
bindings/js/JSWorkerContextCustom.cpp \
bindings/js/JSWorkerCustom.cpp \
@@ -2472,7 +2490,6 @@ contains(DEFINES, ENABLE_WORKERS=1) {
contains(DEFINES, ENABLE_SHARED_WORKERS=1) {
SOURCES += \
- bindings/js/JSSharedWorkerConstructor.cpp \
bindings/js/JSSharedWorkerCustom.cpp \
workers/DefaultSharedWorkerRepository.cpp \
workers/SharedWorker.cpp \
@@ -2546,7 +2563,6 @@ contains(DEFINES, ENABLE_XSLT=1) {
tobe|!tobe: QT += xmlpatterns
SOURCES += \
- bindings/js/JSXSLTProcessorConstructor.cpp \
bindings/js/JSXSLTProcessorCustom.cpp \
dom/TransformSourceQt.cpp \
xml/XSLStyleSheetQt.cpp \
@@ -2853,7 +2869,9 @@ contains(DEFINES, ENABLE_SVG=1) {
rendering/SVGRenderSupport.cpp \
rendering/SVGRootInlineBox.cpp \
rendering/SVGShadowTreeElements.cpp \
- rendering/SVGTextLayoutUtilities.cpp
+ rendering/SVGTextChunkLayoutInfo.cpp \
+ rendering/SVGTextLayoutUtilities.cpp \
+ rendering/SVGTextQuery.cpp
}
contains(DEFINES, ENABLE_JAVASCRIPT_DEBUGGER=1) {
@@ -2884,6 +2902,7 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
websockets/WebSocketChannelClient.h \
websockets/WebSocketHandshake.h \
websockets/WebSocketHandshakeRequest.h \
+ websockets/WebSocketHandshakeResponse.h \
platform/network/qt/SocketStreamHandlePrivate.h
SOURCES += \
@@ -2891,12 +2910,12 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
websockets/WebSocketChannel.cpp \
websockets/WebSocketHandshake.cpp \
websockets/WebSocketHandshakeRequest.cpp \
+ websockets/WebSocketHandshakeResponse.cpp \
websockets/ThreadableWebSocketChannel.cpp \
platform/network/SocketStreamErrorBase.cpp \
platform/network/SocketStreamHandleBase.cpp \
platform/network/qt/SocketStreamHandleQt.cpp \
- bindings/js/JSWebSocketCustom.cpp \
- bindings/js/JSWebSocketConstructor.cpp
+ bindings/js/JSWebSocketCustom.cpp
contains(DEFINES, ENABLE_WORKERS=1) {
HEADERS += \
@@ -2910,80 +2929,65 @@ contains(DEFINES, ENABLE_WEB_SOCKETS=1) {
contains(DEFINES, ENABLE_3D_CANVAS=1) {
tobe|!tobe: QT += opengl
HEADERS += \
- bindings/js/JSArrayBufferConstructor.h \
- bindings/js/JSArrayBufferViewHelper.h \
- bindings/js/JSInt8ArrayConstructor.h \
- bindings/js/JSFloat32ArrayConstructor.h \
- bindings/js/JSInt32ArrayConstructor.h \
- bindings/js/JSInt16ArrayConstructor.h \
- bindings/js/JSUint8ArrayConstructor.h \
- bindings/js/JSUint32ArrayConstructor.h \
- bindings/js/JSUint16ArrayConstructor.h \
- html/canvas/CanvasContextAttributes.h \
- html/canvas/CanvasObject.h \
- html/canvas/WebGLActiveInfo.h \
- html/canvas/ArrayBuffer.h \
- html/canvas/ArrayBufferView.h \
- html/canvas/WebGLBuffer.h \
- html/canvas/Int8Array.h \
- html/canvas/WebGLContextAttributes.h \
- html/canvas/Float32Array.h \
- html/canvas/WebGLFramebuffer.h \
- html/canvas/WebGLGetInfo.h \
- html/canvas/Int32Array.h \
- html/canvas/WebGLProgram.h \
- html/canvas/WebGLRenderbuffer.h \
- html/canvas/WebGLRenderingContext.h \
- html/canvas/WebGLShader.h \
- html/canvas/Int16Array.h \
- html/canvas/WebGLTexture.h \
- html/canvas/WebGLUniformLocation.h \
- html/canvas/Uint8Array.h \
- html/canvas/Uint32Array.h \
- html/canvas/Uint16Array.h \
- platform/graphics/GraphicsContext3D.h
+ bindings/js/JSArrayBufferViewHelper.h \
+ html/canvas/CanvasContextAttributes.h \
+ html/canvas/CanvasObject.h \
+ html/canvas/WebGLActiveInfo.h \
+ html/canvas/ArrayBuffer.h \
+ html/canvas/ArrayBufferView.h \
+ html/canvas/WebGLBuffer.h \
+ html/canvas/Int8Array.h \
+ html/canvas/WebGLContextAttributes.h \
+ html/canvas/Float32Array.h \
+ html/canvas/WebGLFramebuffer.h \
+ html/canvas/WebGLGetInfo.h \
+ html/canvas/Int32Array.h \
+ html/canvas/WebGLProgram.h \
+ html/canvas/WebGLRenderbuffer.h \
+ html/canvas/WebGLRenderingContext.h \
+ html/canvas/WebGLShader.h \
+ html/canvas/Int16Array.h \
+ html/canvas/WebGLTexture.h \
+ html/canvas/WebGLUniformLocation.h \
+ html/canvas/Uint8Array.h \
+ html/canvas/Uint32Array.h \
+ html/canvas/Uint16Array.h \
+ platform/graphics/GraphicsContext3D.h
SOURCES += \
- bindings/js/JSArrayBufferConstructor.cpp \
- bindings/js/JSArrayBufferViewCustom.cpp \
- bindings/js/JSInt8ArrayConstructor.cpp \
- bindings/js/JSInt8ArrayCustom.cpp \
- bindings/js/JSFloat32ArrayConstructor.cpp \
- bindings/js/JSFloat32ArrayCustom.cpp \
- bindings/js/JSInt32ArrayConstructor.cpp \
- bindings/js/JSInt32ArrayCustom.cpp \
- bindings/js/JSWebGLRenderingContextCustom.cpp \
- bindings/js/JSInt16ArrayConstructor.cpp \
- bindings/js/JSInt16ArrayCustom.cpp \
- bindings/js/JSUint8ArrayConstructor.cpp \
- bindings/js/JSUint8ArrayCustom.cpp \
- bindings/js/JSUint32ArrayConstructor.cpp \
- bindings/js/JSUint32ArrayCustom.cpp \
- bindings/js/JSUint16ArrayConstructor.cpp \
- bindings/js/JSUint16ArrayCustom.cpp \
- html/canvas/CanvasContextAttributes.cpp \
- html/canvas/CanvasObject.cpp \
- html/canvas/ArrayBuffer.cpp \
- html/canvas/ArrayBufferView.cpp \
- html/canvas/WebGLBuffer.cpp \
- html/canvas/Int8Array.cpp \
- html/canvas/WebGLContextAttributes.cpp \
- html/canvas/Float32Array.cpp \
- html/canvas/WebGLFramebuffer.cpp \
- html/canvas/WebGLGetInfo.cpp \
- html/canvas/Int32Array.cpp \
- html/canvas/WebGLProgram.cpp \
- html/canvas/WebGLRenderbuffer.cpp \
- html/canvas/WebGLRenderingContext.cpp \
- html/canvas/WebGLShader.cpp \
- html/canvas/Int16Array.cpp \
- html/canvas/WebGLTexture.cpp \
- html/canvas/WebGLUniformLocation.cpp \
- html/canvas/Uint8Array.cpp \
- html/canvas/Uint32Array.cpp \
- html/canvas/Uint16Array.cpp \
- platform/graphics/GraphicsContext3D.cpp \
- platform/graphics/qt/GraphicsContext3DQt.cpp \
+ bindings/js/JSArrayBufferCustom.cpp \
+ bindings/js/JSArrayBufferViewCustom.cpp \
+ bindings/js/JSInt8ArrayCustom.cpp \
+ bindings/js/JSFloat32ArrayCustom.cpp \
+ bindings/js/JSInt32ArrayCustom.cpp \
+ bindings/js/JSWebGLRenderingContextCustom.cpp \
+ bindings/js/JSInt16ArrayCustom.cpp \
+ bindings/js/JSUint8ArrayCustom.cpp \
+ bindings/js/JSUint32ArrayCustom.cpp \
+ bindings/js/JSUint16ArrayCustom.cpp \
+ html/canvas/CanvasContextAttributes.cpp \
+ html/canvas/CanvasObject.cpp \
+ html/canvas/ArrayBuffer.cpp \
+ html/canvas/ArrayBufferView.cpp \
+ html/canvas/WebGLBuffer.cpp \
+ html/canvas/Int8Array.cpp \
+ html/canvas/WebGLContextAttributes.cpp \
+ html/canvas/Float32Array.cpp \
+ html/canvas/WebGLFramebuffer.cpp \
+ html/canvas/WebGLGetInfo.cpp \
+ html/canvas/Int32Array.cpp \
+ html/canvas/WebGLProgram.cpp \
+ html/canvas/WebGLRenderbuffer.cpp \
+ html/canvas/WebGLRenderingContext.cpp \
+ html/canvas/WebGLShader.cpp \
+ html/canvas/Int16Array.cpp \
+ html/canvas/WebGLTexture.cpp \
+ html/canvas/WebGLUniformLocation.cpp \
+ html/canvas/Uint8Array.cpp \
+ html/canvas/Uint32Array.cpp \
+ html/canvas/Uint16Array.cpp \
+ platform/graphics/GraphicsContext3D.cpp \
+ platform/graphics/qt/GraphicsContext3DQt.cpp \
}
@@ -2998,12 +3002,7 @@ contains(DEFINES, ENABLE_SYMBIAN_DIALOG_PROVIDERS) {
include($$PWD/../WebKit/qt/Api/headers.pri)
HEADERS += $$WEBKIT_API_HEADERS
-CONFIG(QTDIR_build) {
- modfile.files = $$moduleFile
- modfile.path = $$[QMAKE_MKSPECS]/modules
-
- INSTALLS += modfile
-} else {
+!CONFIG(QTDIR_build) {
exists($$OUTPUT_DIR/include/QtWebKit/classheaders.pri): include($$OUTPUT_DIR/include/QtWebKit/classheaders.pri)
WEBKIT_INSTALL_HEADERS = $$WEBKIT_API_HEADERS $$WEBKIT_CLASS_HEADERS
@@ -3024,6 +3023,7 @@ CONFIG(QTDIR_build) {
# INSTALLS is not implemented in qmake's s60 generators, copy headers manually
inst_headers.commands = $$QMAKE_COPY ${QMAKE_FILE_NAME} ${QMAKE_FILE_OUT}
inst_headers.input = WEBKIT_INSTALL_HEADERS
+ inst_headers.CONFIG = no_clean
!isEmpty(INSTALL_HEADERS): inst_headers.output = $$INSTALL_HEADERS/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
else: inst_headers.output = $$[QT_INSTALL_HEADERS]/QtWebKit/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
@@ -3033,6 +3033,7 @@ CONFIG(QTDIR_build) {
inst_modfile.commands = $$inst_headers.commands
inst_modfile.input = moduleFile
inst_modfile.output = $$[QMAKE_MKSPECS]/modules
+ inst_modfile.CONFIG = no_clean
QMAKE_EXTRA_COMPILERS += inst_modfile
@@ -3088,7 +3089,7 @@ CONFIG(QTDIR_build) {
CONFIG += no_debug_info
}
-!win32-g++:win32:contains(QMAKE_HOST.arch, x86_64):{
+win32:!win32-g++*:contains(QMAKE_HOST.arch, x86_64):{
asm_compiler.commands = ml64 /c
asm_compiler.commands += /Fo ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
asm_compiler.output = ${QMAKE_VAR_OBJECTS_DIR}${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
diff --git a/WebCore/WebCore.vcproj/WebCore.make b/WebCore/WebCore.vcproj/WebCore.make
index afe6707..84b9661 100644
--- a/WebCore/WebCore.vcproj/WebCore.make
+++ b/WebCore/WebCore.vcproj/WebCore.make
@@ -17,3 +17,5 @@ install:
xcopy "$(OBJROOT)\obj\WebCore\scripts\*" "$(DSTROOT)\AppleInternal\tools\scripts" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\*.pdb" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\*.dll" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
+ -mkdir "$(DSTROOT)\AppleInternal\Sources\WebCore"
+ xcopy "$(OBJROOT)\obj\WebCore\DerivedSources\*" "$(DSTROOT)\AppleInternal\Sources\WebCore" /e/v/i/h/y
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index e693884..ebd21a9 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -777,6 +777,14 @@
>
</File>
<File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBlobBuilder.cpp"
+ >
+ </File>
+ <File
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSBlobBuilder.h"
+ >
+ </File>
+ <File
RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSCanvasGradient.cpp"
>
<FileConfiguration
@@ -21973,6 +21981,14 @@
>
</File>
<File
+ RelativePath="..\loader\FormSubmission.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\loader\FormSubmission.h"
+ >
+ </File>
+ <File
RelativePath="..\loader\FrameLoader.cpp"
>
</File>
@@ -21985,6 +22001,14 @@
>
</File>
<File
+ RelativePath="..\loader\FrameLoaderStateMachine.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\loader\FrameLoaderStateMachine.h"
+ >
+ </File>
+ <File
RelativePath="..\loader\FrameLoaderTypes.h"
>
</File>
@@ -22169,6 +22193,14 @@
>
</File>
<File
+ RelativePath="..\loader\SubframeLoader.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\loader\SubframeLoader.h"
+ >
+ </File>
+ <File
RelativePath="..\loader\SubresourceLoader.cpp"
>
</File>
@@ -26252,6 +26284,14 @@
>
</File>
<File
+ RelativePath="..\platform\text\Hyphenation.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\platform\text\Hyphenation.h"
+ >
+ </File>
+ <File
RelativePath="..\platform\text\ParserUtilities.h"
>
</File>
@@ -28185,6 +28225,14 @@
>
</File>
<File
+ RelativePath="..\rendering\RenderIndicator.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\RenderIndicator.h"
+ >
+ </File>
+ <File
RelativePath="..\rendering\RenderInline.cpp"
>
</File>
@@ -28959,6 +29007,10 @@
>
</File>
<File
+ RelativePath="..\rendering\SVGTextChunkLayoutInfo.cpp"
+ >
+ </File>
+ <File
RelativePath="..\rendering\SVGTextChunkLayoutInfo.h"
>
</File>
@@ -28970,6 +29022,14 @@
RelativePath="..\rendering\SVGTextLayoutUtilities.h"
>
</File>
+ <File
+ RelativePath="..\rendering\SVGTextQuery.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\rendering\SVGTextQuery.h"
+ >
+ </File>
<File
RelativePath="..\rendering\TableLayout.h"
>
@@ -30145,6 +30205,14 @@
>
</File>
<File
+ RelativePath="..\dom\StaticHashSetNodeList.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\dom\StaticHashSetNodeList.h"
+ >
+ </File>
+ <File
RelativePath="..\dom\StaticNodeList.cpp"
>
</File>
@@ -33141,6 +33209,14 @@
>
</File>
<File
+ RelativePath="..\html\BlobBuilder.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\BlobBuilder.h"
+ >
+ </File>
+ <File
RelativePath="..\html\canvas\CanvasGradient.cpp"
>
</File>
@@ -33208,6 +33284,14 @@
RelativePath="..\html\CollectionType.h"
>
</File>
+ <File
+ RelativePath="..\html\CSSPreloadScanner.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\CSSPreloadScanner.h"
+ >
+ </File>
<File
RelativePath="..\html\DataGridColumn.cpp"
>
@@ -33320,44 +33404,52 @@
RelativePath="..\html\FormDataList.h"
>
</File>
- <File
- RelativePath="..\html\HTML5DocumentParser.cpp"
+ <File
+ RelativePath="..\html\HTMLDocumentParser.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\html\HTMLDocumentParser.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\HTMLEntityParser.cpp"
>
- </File>
- <File
- RelativePath="..\html\HTML5DocumentParser.h"
+ </File>
+ <File
+ RelativePath="..\html\HTMLEntityParser.h"
>
- </File>
- <File
- RelativePath="..\html\HTML5EntityParser.cpp"
+ </File>
+ <File
+ RelativePath="..\html\HTMLTokenizer.cpp"
>
</File>
<File
- RelativePath="..\html\HTML5EntityParser.h"
+ RelativePath="..\html\HTMLTokenizer.h"
>
</File>
<File
- RelativePath="..\html\HTML5Lexer.cpp"
+ RelativePath="..\html\HTMLPreloadScanner.cpp"
>
</File>
<File
- RelativePath="..\html\HTML5Lexer.h"
+ RelativePath="..\html\HTMLPreloadScanner.h"
>
</File>
<File
- RelativePath="..\html\HTML5ScriptRunner.cpp"
+ RelativePath="..\html\HTMLScriptRunner.cpp"
>
</File>
<File
- RelativePath="..\html\HTML5ScriptRunner.h"
+ RelativePath="..\html\HTMLScriptRunner.h"
>
</File>
<File
- RelativePath="..\html\HTML5TreeBuilder.cpp"
+ RelativePath="..\html\HTMLTreeBuilder.cpp"
>
</File>
<File
- RelativePath="..\html\HTML5TreeBuilder.h"
+ RelativePath="..\html\HTMLTreeBuilder.h"
>
</File>
<File
@@ -35372,6 +35464,10 @@
RelativePath="..\html\HTMLInputElement.h"
>
</File>
+ <File
+ RelativePath="..\html\HTMLInputStream.h"
+ >
+ </File>
<File
RelativePath="..\html\HTMLIsIndexElement.cpp"
>
@@ -36469,11 +36565,11 @@
>
</File>
<File
- RelativePath="..\html\LegacyHTMLTreeConstructor.cpp"
+ RelativePath="..\html\LegacyHTMLTreeBuilder.cpp"
>
</File>
<File
- RelativePath="..\html\LegacyHTMLTreeConstructor.h"
+ RelativePath="..\html\LegacyHTMLTreeBuilder.h"
>
</File>
<File
@@ -36481,6 +36577,14 @@
>
</File>
<File
+ RelativePath="..\html\HTMLParserScheduler.h"
+ >
+ </File>
+ <File
+ RelativePath="..\html\HTMLParserScheduler.cpp"
+ >
+ </File>
+ <File
RelativePath="..\html\HTMLParserErrorCodes.h"
>
</File>
@@ -37501,11 +37605,11 @@
>
</File>
<File
- RelativePath="..\html\HTMLDocumentParser.cpp"
+ RelativePath="..\html\LegacyHTMLDocumentParser.cpp"
>
</File>
<File
- RelativePath="..\html\HTMLDocumentParser.h"
+ RelativePath="..\html\LegacyHTMLDocumentParser.h"
>
</File>
<File
@@ -37657,11 +37761,11 @@
>
</File>
<File
- RelativePath="..\html\PreloadScanner.cpp"
+ RelativePath="..\html\LegacyPreloadScanner.cpp"
>
</File>
<File
- RelativePath="..\html\PreloadScanner.h"
+ RelativePath="..\html\LegacyPreloadScanner.h"
>
</File>
<File
@@ -39520,7 +39624,7 @@
>
</File>
<File
- RelativePath="..\bindings\js\JSEventSourceConstructor.cpp"
+ RelativePath="..\bindings\js\JSEventSourceCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -39572,10 +39676,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSEventSourceConstructor.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSEventTarget.cpp"
>
<FileConfiguration
@@ -40584,7 +40684,7 @@
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBAny.cpp"
+ RelativePath="..\bindings\js\JSWebKitCSSMatrixCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40636,11 +40736,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBAny.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSIDBAnyCustom.cpp"
+ RelativePath="..\bindings\js\JSWebKitPointCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40692,7 +40788,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabase.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBAny.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40744,11 +40840,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabase.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBAny.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseError.cpp"
+ RelativePath="..\bindings\js\JSIDBAnyCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40800,11 +40896,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseError.h"
- >
- </File>
- <File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseException.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabase.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40856,11 +40948,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseException.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabase.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseRequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseError.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40912,11 +41004,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseRequest.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseError.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBErrorEvent.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseException.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -40968,11 +41060,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBErrorEvent.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseException.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBEvent.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41024,11 +41116,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBEvent.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBDatabaseRequest.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBIndexRequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBErrorEvent.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41080,7 +41172,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBIndexRequest.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBErrorEvent.h"
>
</File>
<File
@@ -41192,11 +41284,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBEvent.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBIndexRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41248,11 +41340,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBIndexRequest.h"
>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41304,11 +41396,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSImageConstructor.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41360,11 +41452,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSImageConstructor.h"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBRequest.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSImageDataCustom.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41416,7 +41508,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaserequest.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBSuccessEvent.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSImageConstructor.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41468,11 +41564,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaseRequest.h"
+ RelativePath="..\bindings\js\JSImageConstructor.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSInjectedScriptHostCustom.cpp"
+ RelativePath="..\bindings\js\JSImageDataCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41524,7 +41620,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSInspectorFrontendHostCustom.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaserequest.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41576,7 +41672,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSJavaScriptCallFrameCustom.cpp"
+ RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIndexedDatabaseRequest.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSInjectedScriptHostCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41628,7 +41728,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSLazyEventListener.cpp"
+ RelativePath="..\bindings\js\JSInspectorFrontendHostCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41680,11 +41780,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSLazyEventListener.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSLocationCustom.cpp"
+ RelativePath="..\bindings\js\JSJavaScriptCallFrameCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41736,7 +41832,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMainThreadExecState.cpp"
+ RelativePath="..\bindings\js\JSLazyEventListener.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41788,11 +41884,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMainThreadExecState.h"
+ RelativePath="..\bindings\js\JSLazyEventListener.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSMessageChannelConstructor.cpp"
+ RelativePath="..\bindings\js\JSLocationCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41844,11 +41940,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessageChannelConstructor.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSMessageChannelCustom.cpp"
+ RelativePath="..\bindings\js\JSMainThreadExecState.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41900,7 +41992,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessageEventCustom.cpp"
+ RelativePath="..\bindings\js\JSMainThreadExecState.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSMessageChannelCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -41952,7 +42048,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessagePortCustom.cpp"
+ RelativePath="..\bindings\js\JSMessageEventCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42004,11 +42100,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSMessagePortCustom.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSMimeTypeArrayCustom.cpp"
+ RelativePath="..\bindings\js\JSMessagePortCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42060,7 +42152,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"
+ RelativePath="..\bindings\js\JSMessagePortCustom.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSMimeTypeArrayCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42112,7 +42208,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNavigatorCustom.cpp"
+ RelativePath="..\bindings\js\JSNamedNodeMapCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42164,7 +42260,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeCustom.cpp"
+ RelativePath="..\bindings\js\JSNavigatorCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42216,11 +42312,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeCustom.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSNodeFilterCondition.cpp"
+ RelativePath="..\bindings\js\JSNodeCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42272,11 +42364,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeFilterCondition.h"
+ RelativePath="..\bindings\js\JSNodeCustom.h"
>
</File>
<File
- RelativePath="..\bindings\js\JSNodeFilterCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeFilterCondition.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42328,7 +42420,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeIteratorCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeFilterCondition.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSNodeFilterCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42380,7 +42476,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSNodeListCustom.cpp"
+ RelativePath="..\bindings\js\JSNodeIteratorCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42432,7 +42528,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSOptionConstructor.cpp"
+ RelativePath="..\bindings\js\JSNodeListCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42484,11 +42580,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSOptionConstructor.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSPluginArrayCustom.cpp"
+ RelativePath="..\bindings\js\JSOptionConstructor.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42540,7 +42632,11 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSPluginCustom.cpp"
+ RelativePath="..\bindings\js\JSOptionConstructor.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSPluginArrayCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42592,7 +42688,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSPluginElementFunctions.cpp"
+ RelativePath="..\bindings\js\JSPluginCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42644,15 +42740,7 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSPluginElementFunctions.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSPopStateEventCustom.cpp"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSScriptProfileNodeCustom.cpp"
+ RelativePath="..\bindings\js\JSPluginElementFunctions.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42704,7 +42792,15 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSSharedWorkerConstructor.cpp"
+ RelativePath="..\bindings\js\JSPluginElementFunctions.h"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSPopStateEventCustom.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\bindings\js\JSScriptProfileNodeCustom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
@@ -42756,10 +42852,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSSharedWorkerConstructor.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSSharedWorkerCustom.cpp"
>
<FileConfiguration
@@ -43500,174 +43592,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSWebKitCSSMatrixConstructor.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\JSWebKitCSSMatrixConstructor.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSWebKitPointConstructor.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\JSWebKitPointConstructor.h"
- >
- </File>
- <File
- RelativePath="..\bindings\js\JSWebSocketConstructor.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\JSWebSocketConstructor.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSWebSocketCustom.cpp"
>
<FileConfiguration
@@ -43720,62 +43644,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSWorkerConstructor.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\JSWorkerConstructor.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSWorkerContextBase.cpp"
>
<FileConfiguration
@@ -44044,62 +43912,6 @@
</FileConfiguration>
</File>
<File
- RelativePath="..\bindings\js\JSXSLTProcessorConstructor.cpp"
- >
- <FileConfiguration
- Name="Debug|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Internal|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release_Cairo|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug_All|Win32"
- ExcludedFromBuild="true"
- >
- <Tool
- Name="VCCLCompilerTool"
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="..\bindings\js\JSXSLTProcessorConstructor.h"
- >
- </File>
- <File
RelativePath="..\bindings\js\JSXSLTProcessorCustom.cpp"
>
<FileConfiguration
@@ -46697,6 +46509,10 @@
>
</File>
<File
+ RelativePath="..\storage\SQLException.h"
+ >
+ </File>
+ <File
RelativePath="..\storage\SQLResultSet.cpp"
>
</File>
@@ -47133,6 +46949,10 @@
>
</File>
<File
+ RelativePath="..\inspector\ScriptBreakpoint.cpp"
+ >
+ </File>
+ <File
RelativePath="..\inspector\ScriptBreakpoint.h"
>
</File>
@@ -47937,6 +47757,14 @@
>
</File>
<File
+ RelativePath="..\websockets\WebSocketHandshakeResponse.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\websockets\WebSocketHandshakeResponse.h"
+ >
+ </File>
+ <File
RelativePath="..\websockets\WorkerThreadableWebSocketChannel.cpp"
>
</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 8d6bb96..4aa4577 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -90,6 +90,9 @@
084D2834110A7FCB0038239A /* SVGAnimatedPropertyTraits.h in Headers */ = {isa = PBXBuildFile; fileRef = 084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */; settings = {ATTRIBUTES = (Private, ); }; };
084DBAA10ED39D360038C226 /* WMLVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 084DBA9D0ED39D350038C226 /* WMLVariables.cpp */; };
084DBAA20ED39D360038C226 /* WMLVariables.h in Headers */ = {isa = PBXBuildFile; fileRef = 084DBA9E0ED39D360038C226 /* WMLVariables.h */; };
+ 0853D73211C9109000B2FD42 /* SVGTextChunkLayoutInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0853D72F11C9108F00B2FD42 /* SVGTextChunkLayoutInfo.cpp */; };
+ 0853D73311C9109000B2FD42 /* SVGTextQuery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0853D73011C9109000B2FD42 /* SVGTextQuery.cpp */; };
+ 0853D73411C9109000B2FD42 /* SVGTextQuery.h in Headers */ = {isa = PBXBuildFile; fileRef = 0853D73111C9109000B2FD42 /* SVGTextQuery.h */; };
08563BB4117861780012B578 /* RenderSVGResourcePattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08563BB2117861770012B578 /* RenderSVGResourcePattern.cpp */; };
08563BB5117861780012B578 /* RenderSVGResourcePattern.h in Headers */ = {isa = PBXBuildFile; fileRef = 08563BB3117861770012B578 /* RenderSVGResourcePattern.h */; };
08563BD0117865F50012B578 /* RenderSVGResource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 08563BCF117865F50012B578 /* RenderSVGResource.cpp */; };
@@ -424,6 +427,7 @@
1A8F6BC50DB55CDC001DB794 /* ManifestParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A8F6BBA0DB55CDC001DB794 /* ManifestParser.cpp */; };
1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8F6BBB0DB55CDC001DB794 /* ManifestParser.h */; };
1A98956B0AA78F80005EF5EF /* KURLCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A98956A0AA78F80005EF5EF /* KURLCFNet.cpp */; };
+ 1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA8798F11CBE846003C664F /* PluginStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE780C051FDE00139F4F /* zoomInCursor.png */; };
1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */; };
1AB7FC680A8B92EC00D9D37B /* XPathEvaluator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */; };
@@ -472,6 +476,8 @@
1AD2316E0CD269E700C1F194 /* JSSQLTransactionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD2316D0CD269E700C1F194 /* JSSQLTransactionCustom.cpp */; };
1AD51A140CB59CD300953D11 /* DatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD51A120CB59CD300953D11 /* DatabaseTracker.h */; settings = {ATTRIBUTES = (Private, ); }; };
1AD51A150CB59CD300953D11 /* DatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD51A130CB59CD300953D11 /* DatabaseTracker.cpp */; };
+ 1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */; };
1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA140E0E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp */; };
1ADA14110E1AE5D900023EE5 /* PluginMainThreadScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
1AE2AA1E0A1CDAB400B42B25 /* JSHTMLAreaElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AE2AA0A0A1CDAB300B42B25 /* JSHTMLAreaElement.cpp */; };
@@ -584,6 +590,7 @@
1CF6BE140E9BB4670025E1CD /* ObjCNodeFilterCondition.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1CF6BE120E9BB4670025E1CD /* ObjCNodeFilterCondition.mm */; };
1CF6BE150E9BB4670025E1CD /* ObjCNodeFilterCondition.h in Headers */ = {isa = PBXBuildFile; fileRef = 1CF6BE130E9BB4670025E1CD /* ObjCNodeFilterCondition.h */; };
1CFAE3230A6D6A3F0032593D /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1CFAE3220A6D6A3F0032593D /* libobjc.dylib */; };
+ 200B190911C277D900DCCD3A /* ScriptBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */; };
228C284510D82500009D0D0E /* ScriptWrappable.h in Headers */ = {isa = PBXBuildFile; fileRef = 228C284410D82500009D0D0E /* ScriptWrappable.h */; settings = {ATTRIBUTES = (Private, ); }; };
24F54EAC101FE914000AE741 /* ApplicationCacheHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */; };
24F54EAD101FE914000AE741 /* ApplicationCacheHost.h in Headers */ = {isa = PBXBuildFile; fileRef = 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */; settings = {ATTRIBUTES = (); }; };
@@ -729,6 +736,7 @@
3390CA580FFC157B00921962 /* NotificationContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 3390CA540FFC157B00921962 /* NotificationContents.h */; };
33C0CCD4112C5E6200CE057D /* SecureTextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */; };
33C0CCD5112C5E6200CE057D /* SecureTextInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 33C0CCD3112C5E6200CE057D /* SecureTextInput.h */; };
+ 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */; };
371F4F400D25B9AF00ECE0D5 /* FontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4F3E0D25B9AF00ECE0D5 /* FontData.h */; settings = {ATTRIBUTES = (Private, ); }; };
371F4F410D25B9AF00ECE0D5 /* FontData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */; };
371F4FFC0D25E7F300ECE0D5 /* SegmentedFontData.h in Headers */ = {isa = PBXBuildFile; fileRef = 371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */; };
@@ -739,6 +747,8 @@
371F53EA0D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */; };
37202199106213C600F25C4B /* FontSmoothingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 37202198106213C600F25C4B /* FontSmoothingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
3744570F0DB05FA500AE0992 /* SVGGlyphMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */; };
+ 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */ = {isa = PBXBuildFile; fileRef = 375CD231119D43C800A2A859 /* Hyphenation.h */; };
+ 375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 375CD239119D44EA00A2A859 /* HyphenationMac.mm */; };
3774ABA50FA21EB400AD7DE9 /* OverlapTestRequestClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
377C4CDF1014E9F600B9AE42 /* PlaceholderDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */; };
377C4CE01014E9F600B9AE42 /* PlaceholderDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 377C4CDE1014E9F600B9AE42 /* PlaceholderDocument.cpp */; };
@@ -762,8 +772,6 @@
411046410FA222A600BA436A /* ScriptEventListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 4110463F0FA222A600BA436A /* ScriptEventListener.h */; };
411046420FA222A600BA436A /* ScriptEventListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 411046400FA222A600BA436A /* ScriptEventListener.cpp */; };
4127D5370F8AAB1D00E424F5 /* ScriptState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */; };
- 415B7C580FF598E6006770F7 /* JSSharedWorkerConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 415B7C550FF598E6006770F7 /* JSSharedWorkerConstructor.cpp */; };
- 415B7C630FF5A767006770F7 /* JSSharedWorkerConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 415B7C620FF5A767006770F7 /* JSSharedWorkerConstructor.h */; };
4162A450101145AE00DFF3ED /* DedicatedWorkerContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4162A44D101145AE00DFF3ED /* DedicatedWorkerContext.cpp */; };
4162A451101145AE00DFF3ED /* DedicatedWorkerContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A44E101145AE00DFF3ED /* DedicatedWorkerContext.h */; };
4162A454101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4162A453101145E300DFF3ED /* JSDedicatedWorkerContextCustom.cpp */; };
@@ -777,6 +785,8 @@
416E75CB0EDF90C700360E1D /* ScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E75C90EDF90C700360E1D /* ScriptCallFrame.h */; };
416E75CC0EDF90C700360E1D /* ScriptCallFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 416E75CA0EDF90C700360E1D /* ScriptCallFrame.cpp */; };
416F45F00ED7B311008215B6 /* ScriptString.h in Headers */ = {isa = PBXBuildFile; fileRef = 416F45EF0ED7B311008215B6 /* ScriptString.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */ = {isa = PBXBuildFile; fileRef = 41885B9111B6FDA6003383BB /* FormSubmission.h */; };
+ 41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41885B9211B6FDA6003383BB /* FormSubmission.cpp */; };
418F88040FF957AE0080F045 /* JSAbstractWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 418F88020FF957AE0080F045 /* JSAbstractWorker.cpp */; };
418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 418F88030FF957AE0080F045 /* JSAbstractWorker.h */; };
41A3D58E101C152D00316D07 /* DedicatedWorkerThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41A3D58C101C152D00316D07 /* DedicatedWorkerThread.cpp */; };
@@ -850,8 +860,6 @@
49484FCD102CF23C00187DD3 /* CanvasStyle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49484FBF102CF23C00187DD3 /* CanvasStyle.cpp */; };
49484FCE102CF23C00187DD3 /* CanvasStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 49484FC0102CF23C00187DD3 /* CanvasStyle.h */; };
494BD7950F55C8EE00747828 /* WebKitPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 494BD7930F55C8EE00747828 /* WebKitPoint.h */; };
- 494BD7990F55C90E00747828 /* JSWebKitPointConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494BD7970F55C90E00747828 /* JSWebKitPointConstructor.cpp */; };
- 494BD79A0F55C90E00747828 /* JSWebKitPointConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 494BD7980F55C90E00747828 /* JSWebKitPointConstructor.h */; };
494BD79D0F55C94C00747828 /* JSWebKitPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494BD79B0F55C94C00747828 /* JSWebKitPoint.cpp */; };
494BD79E0F55C94C00747828 /* JSWebKitPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 494BD79C0F55C94C00747828 /* JSWebKitPoint.h */; };
4983913F0F1E767500C23782 /* JSWebKitCSSMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4983913D0F1E767500C23782 /* JSWebKitCSSMatrix.cpp */; };
@@ -861,8 +869,6 @@
498391520F1E76B400C23782 /* DOMWebKitCSSMatrixInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 4983914F0F1E76B400C23782 /* DOMWebKitCSSMatrixInternal.h */; };
498391580F1E776900C23782 /* WebKitCSSMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498391550F1E776900C23782 /* WebKitCSSMatrix.cpp */; };
498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 498391560F1E776900C23782 /* WebKitCSSMatrix.h */; };
- 498391630F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498391610F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.cpp */; };
- 498391640F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 498391620F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h */; };
49C7B9931042D2D30009D447 /* JSWebGLBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */; };
49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */; };
49C7B9951042D2D30009D447 /* JSInt8Array.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9821042D2D30009D447 /* JSInt8Array.cpp */; };
@@ -898,9 +904,6 @@
49C7B9E51042D32F0009D447 /* WebGLTexture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9C51042D32F0009D447 /* WebGLTexture.cpp */; };
49C7B9E61042D32F0009D447 /* WebGLTexture.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C7B9C61042D32F0009D447 /* WebGLTexture.h */; };
49C7B9FC1042D3650009D447 /* GraphicsContext3D.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C7B9FB1042D3650009D447 /* GraphicsContext3D.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 49C7BA001042D38C0009D447 /* Canvas3DLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49C7B9FD1042D38C0009D447 /* Canvas3DLayer.h */; };
- 49C7BA011042D38C0009D447 /* Canvas3DLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9FE1042D38C0009D447 /* Canvas3DLayer.mm */; };
- 49C7BA021042D38C0009D447 /* GraphicsContext3DMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7B9FF1042D38C0009D447 /* GraphicsContext3DMac.cpp */; };
49C7BA791042EFAE0009D447 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49C7BA781042EFAE0009D447 /* OpenGL.framework */; };
49C7BA8D1042F5B10009D447 /* JSDocumentCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */; };
49D5DC2B0F423A73008F20FD /* Matrix3DTransformOperation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D5DC270F423A73008F20FD /* Matrix3DTransformOperation.cpp */; };
@@ -967,22 +970,6 @@
49EECF7C10508D9C00099FAB /* JSUint8ArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF7510508D9C00099FAB /* JSUint8ArrayCustom.cpp */; };
49EECF7D10508D9C00099FAB /* JSUint32ArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF7610508D9C00099FAB /* JSUint32ArrayCustom.cpp */; };
49EECF7E10508D9C00099FAB /* JSUint16ArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF7710508D9C00099FAB /* JSUint16ArrayCustom.cpp */; };
- 49EECFAB1050938200099FAB /* JSArrayBufferConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF991050938200099FAB /* JSArrayBufferConstructor.cpp */; };
- 49EECFAC1050938200099FAB /* JSArrayBufferConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECF9A1050938200099FAB /* JSArrayBufferConstructor.h */; };
- 49EECFAD1050938200099FAB /* JSInt8ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF9B1050938200099FAB /* JSInt8ArrayConstructor.cpp */; };
- 49EECFAE1050938200099FAB /* JSInt8ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECF9C1050938200099FAB /* JSInt8ArrayConstructor.h */; };
- 49EECFAF1050938200099FAB /* JSFloat32ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF9D1050938200099FAB /* JSFloat32ArrayConstructor.cpp */; };
- 49EECFB01050938200099FAB /* JSFloat32ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECF9E1050938200099FAB /* JSFloat32ArrayConstructor.h */; };
- 49EECFB11050938200099FAB /* JSInt32ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECF9F1050938200099FAB /* JSInt32ArrayConstructor.cpp */; };
- 49EECFB21050938200099FAB /* JSInt32ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECFA01050938200099FAB /* JSInt32ArrayConstructor.h */; };
- 49EECFB51050938200099FAB /* JSInt16ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECFA31050938200099FAB /* JSInt16ArrayConstructor.cpp */; };
- 49EECFB61050938200099FAB /* JSInt16ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECFA41050938200099FAB /* JSInt16ArrayConstructor.h */; };
- 49EECFB71050938200099FAB /* JSUint8ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECFA51050938200099FAB /* JSUint8ArrayConstructor.cpp */; };
- 49EECFB81050938200099FAB /* JSUint8ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECFA61050938200099FAB /* JSUint8ArrayConstructor.h */; };
- 49EECFB91050938200099FAB /* JSUint32ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECFA71050938200099FAB /* JSUint32ArrayConstructor.cpp */; };
- 49EECFBA1050938200099FAB /* JSUint32ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECFA81050938200099FAB /* JSUint32ArrayConstructor.h */; };
- 49EECFBB1050938200099FAB /* JSUint16ArrayConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EECFA91050938200099FAB /* JSUint16ArrayConstructor.cpp */; };
- 49EECFBC1050938200099FAB /* JSUint16ArrayConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EECFAA1050938200099FAB /* JSUint16ArrayConstructor.h */; };
49EED1421051969400099FAB /* JSCanvasRenderingContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED13C1051969400099FAB /* JSCanvasRenderingContext.cpp */; };
49EED1431051969400099FAB /* JSCanvasRenderingContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */; };
49EED1441051969400099FAB /* JSCanvasRenderingContext2D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */; };
@@ -992,6 +979,9 @@
49EED14E1051971A00099FAB /* JSCanvasRenderingContext2DCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */; };
49EED14F1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED14C1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp */; };
49EED1501051971A00099FAB /* JSCanvasRenderingContextCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EED14D1051971A00099FAB /* JSCanvasRenderingContextCustom.cpp */; };
+ 49FFBF1D11C8550E006A7118 /* GraphicsContext3DMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FFBF1C11C8550E006A7118 /* GraphicsContext3DMac.mm */; };
+ 49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */; };
+ 49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */; };
4A8C96EB0BE69032004EEFF0 /* SelectionControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4A8C96EA0BE69032004EEFF0 /* SelectionControllerMac.mm */; };
4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B2708C50AF19EE40065127F /* Pasteboard.h */; };
4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B2709810AF2E5E00065127F /* PasteboardMac.mm */; };
@@ -1106,8 +1096,6 @@
5189F0DE10B46B0E00F3C739 /* PopStateEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5189F0DD10B46B0E00F3C739 /* PopStateEvent.cpp */; };
518A34C11026C831001B6896 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34BE1026C831001B6896 /* WebSocket.cpp */; };
518A34C21026C831001B6896 /* WebSocket.h in Headers */ = {isa = PBXBuildFile; fileRef = 518A34BF1026C831001B6896 /* WebSocket.h */; };
- 518A34C71026C8C9001B6896 /* JSWebSocketConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34C41026C8C9001B6896 /* JSWebSocketConstructor.cpp */; };
- 518A34C81026C8C9001B6896 /* JSWebSocketConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = 518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */; };
518A34C91026C8C9001B6896 /* JSWebSocketCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */; };
5196116A0CAC56570010A80C /* Database.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5196115E0CAC56570010A80C /* Database.cpp */; };
5196116B0CAC56570010A80C /* Database.h in Headers */ = {isa = PBXBuildFile; fileRef = 5196115F0CAC56570010A80C /* Database.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -1333,6 +1321,8 @@
75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */; };
7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */; };
+ 767F99BE11A1194A0080C51D /* WebSocketHandshakeResponse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */; };
+ 767F99C011A119560080C51D /* WebSocketHandshakeResponse.h in Headers */ = {isa = PBXBuildFile; fileRef = 767F99BF11A119560080C51D /* WebSocketHandshakeResponse.h */; };
7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BACE106C2DCA007B0823 /* HaltablePlugin.h */; settings = {ATTRIBUTES = (Private, ); }; };
7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7693BACF106C2DCA007B0823 /* PluginHalter.cpp */; };
7693BAD4106C2DCA007B0823 /* PluginHalter.h in Headers */ = {isa = PBXBuildFile; fileRef = 7693BAD0106C2DCA007B0823 /* PluginHalter.h */; };
@@ -2287,6 +2277,10 @@
895253DF116C4F0600CABF00 /* FileThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 895253DE116C4F0600CABF00 /* FileThreadTask.h */; };
8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8988E10C11A3508B00DB732E /* BlobItem.cpp */; };
8988E10F11A3508B00DB732E /* BlobItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 8988E10D11A3508B00DB732E /* BlobItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */; };
+ 89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89BED5EA11BE11CE00448492 /* BlobBuilder.h */; };
+ 89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */; };
+ 89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 89CD029211C85B870070B791 /* JSBlobBuilder.h */; };
8FAC774D119872CB0015AE94 /* JSMainThreadExecState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */; };
9302B0BD0D79F82900C7EE83 /* PageGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */; };
9302B0BF0D79F82C00C7EE83 /* PageGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 9302B0BE0D79F82C00C7EE83 /* PageGroup.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2488,8 +2482,8 @@
93EB355F09E37FD600F43799 /* MouseEventWithHitTestResults.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93EB355E09E37FD600F43799 /* MouseEventWithHitTestResults.cpp */; };
93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23C02DE4396018635CA /* HTMLDocument.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F198E608245E59001E9ABC /* HTMLElement.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D23F02DE4396018635CA /* HTMLElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 93F198EF08245E59001E9ABC /* LegacyHTMLTreeConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* LegacyHTMLTreeConstructor.h */; };
- 93F198F008245E59001E9ABC /* HTMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* HTMLDocumentParser.h */; };
+ 93F198EF08245E59001E9ABC /* LegacyHTMLTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25102DE4396018635CA /* LegacyHTMLTreeBuilder.h */; };
+ 93F198F008245E59001E9ABC /* LegacyHTMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D25302DE4396018635CA /* LegacyHTMLDocumentParser.h */; };
93F198F608245E59001E9ABC /* TextResourceDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D27902DE43D7018635CA /* TextResourceDecoder.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1991808245E59001E9ABC /* Range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30402DE4476018635CA /* Range.h */; settings = {ATTRIBUTES = (Private, ); }; };
93F1992108245E59001E9ABC /* XMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D30A02DE4476018635CA /* XMLDocumentParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2518,8 +2512,8 @@
93F19A5F08245E59001E9ABC /* WebCoreViewFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = F587855502DE375901EA4122 /* WebCoreViewFactory.m */; };
93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23B02DE4396018635CA /* HTMLDocument.cpp */; };
93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D23E02DE4396018635CA /* HTMLElement.cpp */; };
- 93F19A9B08245E59001E9ABC /* LegacyHTMLTreeConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25002DE4396018635CA /* LegacyHTMLTreeConstructor.cpp */; };
- 93F19A9C08245E59001E9ABC /* HTMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25202DE4396018635CA /* HTMLDocumentParser.cpp */; };
+ 93F19A9B08245E59001E9ABC /* LegacyHTMLTreeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25002DE4396018635CA /* LegacyHTMLTreeBuilder.cpp */; };
+ 93F19A9C08245E59001E9ABC /* LegacyHTMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D25202DE4396018635CA /* LegacyHTMLDocumentParser.cpp */; };
93F19A9D08245E59001E9ABC /* TextResourceDecoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */; };
93F19AB908245E59001E9ABC /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30302DE4476018635CA /* Range.cpp */; };
93F19ABC08245E59001E9ABC /* XMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D30902DE4476018635CA /* XMLDocumentParser.cpp */; };
@@ -2555,12 +2549,15 @@
97059978107D975200A50A7C /* PolicyCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 97059974107D975200A50A7C /* PolicyCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
97059979107D975200A50A7C /* PolicyChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97059975107D975200A50A7C /* PolicyChecker.cpp */; };
9705997A107D975200A50A7C /* PolicyChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 97059976107D975200A50A7C /* PolicyChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 9719AF0011D09F2C00D45831 /* HTMLInputStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 9719AEFF11D09F2C00D45831 /* HTMLInputStream.h */; };
973889A0116EA9DC00ADF313 /* DocumentWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */; };
973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9738899F116EA9DC00ADF313 /* DocumentWriter.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, ); }; };
- 976E896011C0CA3A00EA9CA9 /* HTML5EntityParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976E895E11C0CA3A00EA9CA9 /* HTML5EntityParser.cpp */; };
- 976E896111C0CA3A00EA9CA9 /* HTML5EntityParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E895F11C0CA3A00EA9CA9 /* HTML5EntityParser.h */; };
+ 976E2BA711CAE4DE006C56A0 /* CSSPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976E2BA511CAE4DE006C56A0 /* CSSPreloadScanner.cpp */; };
+ 976E2BA811CAE4DE006C56A0 /* CSSPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */; };
+ 976E896011C0CA3A00EA9CA9 /* HTMLEntityParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */; };
+ 976E896111C0CA3A00EA9CA9 /* HTMLEntityParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */; };
979F43D31075E44A0000F83B /* RedirectScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 979F43D11075E44A0000F83B /* RedirectScheduler.cpp */; };
979F43D41075E44A0000F83B /* RedirectScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 979F43D21075E44A0000F83B /* RedirectScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
97C078501165D5BE003A32EF /* SuffixTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 97C0784F1165D5BE003A32EF /* SuffixTree.h */; };
@@ -2568,9 +2565,11 @@
97DCE20210807C750057D394 /* HistoryController.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DCE20010807C750057D394 /* HistoryController.h */; settings = {ATTRIBUTES = (Private, ); }; };
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */; };
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */ = {isa = PBXBuildFile; fileRef = 97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */; };
- 97E8B35611A23CE200169409 /* HTML5Lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E8B35411A23CE200169409 /* HTML5Lexer.cpp */; };
- 97E8B35711A23CE200169409 /* HTML5Lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E8B35511A23CE200169409 /* HTML5Lexer.h */; };
- 97E8B3C311A2890800169409 /* HTML5Token.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E8B3C211A2890800169409 /* HTML5Token.h */; };
+ 97E7936511C6030900E649BC /* HTMLPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E7936311C6030900E649BC /* HTMLPreloadScanner.cpp */; };
+ 97E7936611C6030900E649BC /* HTMLPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E7936411C6030900E649BC /* HTMLPreloadScanner.h */; };
+ 97E8B35611A23CE200169409 /* HTMLTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97E8B35411A23CE200169409 /* HTMLTokenizer.cpp */; };
+ 97E8B35711A23CE200169409 /* HTMLTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E8B35511A23CE200169409 /* HTMLTokenizer.h */; };
+ 97E8B3C311A2890800169409 /* HTMLToken.h in Headers */ = {isa = PBXBuildFile; fileRef = 97E8B3C211A2890800169409 /* HTMLToken.h */; };
97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; };
9F6FC1961122E82A00E80196 /* ScriptDebugServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */; };
9F6FC1971122E82A00E80196 /* ScriptDebugServer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2635,6 +2634,8 @@
A784941B0B5FE507001E237A /* Clipboard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A784941A0B5FE507001E237A /* Clipboard.cpp */; };
A795463E0B5C4C80007B438F /* DragDataMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A795463D0B5C4C80007B438F /* DragDataMac.mm */; };
A79546430B5C4CB4007B438F /* DragData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A79546420B5C4CB4007B438F /* DragData.cpp */; };
+ A7AA66D611C5ED6A001D8C8C /* RenderIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7AA66D411C5ED6A001D8C8C /* RenderIndicator.cpp */; };
+ A7AA66D711C5ED6A001D8C8C /* RenderIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A7AA66D511C5ED6A001D8C8C /* RenderIndicator.h */; };
A7AD2F870EC89D07008AB002 /* LinkHash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7AD2F850EC89D07008AB002 /* LinkHash.cpp */; };
A7AD2F880EC89D07008AB002 /* LinkHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A7AD2F860EC89D07008AB002 /* LinkHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
A7B6E69F0B291A9600D0529F /* DragData.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B6E69D0B291A9600D0529F /* DragData.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2937,8 +2938,8 @@
A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A833C80A0A2CF25600D57664 /* XMLNames.cpp */; };
A833C80D0A2CF25600D57664 /* XMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = A833C80B0A2CF25600D57664 /* XMLNames.h */; };
A833C8520A2CF52800D57664 /* SVGElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581E609D1508D000E61D7 /* SVGElementFactory.cpp */; };
- A83B3AF011ADEFF500458809 /* HTML5ScriptRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A83B3AEE11ADEFF500458809 /* HTML5ScriptRunner.cpp */; };
- A83B3AF111ADEFF500458809 /* HTML5ScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B3AEF11ADEFF500458809 /* HTML5ScriptRunner.h */; };
+ A83B3AF011ADEFF500458809 /* HTMLScriptRunner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A83B3AEE11ADEFF500458809 /* HTMLScriptRunner.cpp */; };
+ A83B3AF111ADEFF500458809 /* HTMLScriptRunner.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B3AEF11ADEFF500458809 /* HTMLScriptRunner.h */; };
A83B78FC0CCAFF15000B0825 /* JSSVGFontFaceUriElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B78F20CCAFF15000B0825 /* JSSVGFontFaceUriElement.h */; };
A83B78FD0CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A83B78F30CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp */; };
A83B78FE0CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B78F40CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h */; };
@@ -2965,17 +2966,19 @@
A83B79560CCB0125000B0825 /* DOMSVGFontFaceElement.mm in Sources */ = {isa = PBXBuildFile; fileRef = A83B79470CCB0125000B0825 /* DOMSVGFontFaceElement.mm */; };
A83B79570CCB0125000B0825 /* DOMSVGFontFaceElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A83B79480CCB0125000B0825 /* DOMSVGFontFaceElement.h */; };
A83E1C740E49042C00140B9C /* ScriptControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A83E1C720E49042B00140B9C /* ScriptControllerMac.mm */; };
+ A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A84D827B11D333ED00972990 /* RawDataDocumentParser.h */; };
A84EBD780CB8C89200079609 /* JSStyleSheetListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */; };
A84EBD830CB8C97700079609 /* JSStyleSheetList.h in Headers */ = {isa = PBXBuildFile; fileRef = A84EBD810CB8C97700079609 /* JSStyleSheetList.h */; };
A84EBD840CB8C97700079609 /* JSStyleSheetList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A84EBD820CB8C97700079609 /* JSStyleSheetList.cpp */; };
+ A853123D11D0471B00D4D077 /* FragmentScriptingPermission.h in Headers */ = {isa = PBXBuildFile; fileRef = A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */; settings = {ATTRIBUTES = (Private, ); }; };
A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629C909DA2B47009633A5 /* JSUIEvent.h */; };
A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */; };
A86629D109DA2B48009633A5 /* JSMouseEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629CB09DA2B47009633A5 /* JSMouseEvent.h */; };
A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */; };
A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */; };
A86629D409DA2B48009633A5 /* JSKeyboardEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */; };
- A871038A11A2947000DBD50E /* HTML5DocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871038811A2947000DBD50E /* HTML5DocumentParser.cpp */; };
- A871038B11A2947000DBD50E /* HTML5DocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A871038911A2947000DBD50E /* HTML5DocumentParser.h */; };
+ A871038A11A2947000DBD50E /* HTMLDocumentParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */; };
+ A871038B11A2947000DBD50E /* HTMLDocumentParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A871038911A2947000DBD50E /* HTMLDocumentParser.h */; };
A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871D4570A127CBC00B12A68 /* HTMLPlugInElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */; };
A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A871D44E0A127CBC00B12A68 /* HTMLParamElement.h */; };
@@ -3034,9 +3037,9 @@
A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFDF0A15376B00B12A68 /* RenderReplaced.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871DFE40A15376B00B12A68 /* RenderWidget.h in Headers */ = {isa = PBXBuildFile; fileRef = A871DFE00A15376B00B12A68 /* RenderWidget.h */; settings = {ATTRIBUTES = (Private, ); }; };
A871DFE50A15376B00B12A68 /* RenderWidget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A871DFE10A15376B00B12A68 /* RenderWidget.cpp */; };
- A879C62511A9D1F70059237A /* HTML5TreeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A879C62311A9D1F70059237A /* HTML5TreeBuilder.cpp */; };
- A879C62611A9D1F70059237A /* HTML5TreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A879C62411A9D1F70059237A /* HTML5TreeBuilder.h */; };
- A87F163511AE841300CBB2E5 /* HTML5ScriptRunnerHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A87F163411AE841300CBB2E5 /* HTML5ScriptRunnerHost.h */; };
+ A879C62511A9D1F70059237A /* HTMLTreeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A879C62311A9D1F70059237A /* HTMLTreeBuilder.cpp */; };
+ A879C62611A9D1F70059237A /* HTMLTreeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = A879C62411A9D1F70059237A /* HTMLTreeBuilder.h */; };
+ A87F163511AE841300CBB2E5 /* HTMLScriptRunnerHost.h in Headers */ = {isa = PBXBuildFile; fileRef = A87F163411AE841300CBB2E5 /* HTMLScriptRunnerHost.h */; };
A883DF270F3D045D00F19BF6 /* VisibleSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */; };
A883DF280F3D045D00F19BF6 /* VisibleSelection.h in Headers */ = {isa = PBXBuildFile; fileRef = A883DF260F3D045D00F19BF6 /* VisibleSelection.h */; settings = {ATTRIBUTES = (Private, ); }; };
A88AD52F09524B92001DD196 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */; };
@@ -3279,6 +3282,8 @@
A8E545BD0CA9D1C20097D09B /* DOMSVGAnimatedAngleInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E544BF0CA9D1C20097D09B /* DOMSVGAnimatedAngleInternal.h */; };
A8E545BF0CA9D1C20097D09B /* DOMSVGTextElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E544C10CA9D1C20097D09B /* DOMSVGTextElement.h */; };
A8E545C10CA9D1C20097D09B /* DOMSVGDescElementInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E544C30CA9D1C20097D09B /* DOMSVGDescElementInternal.h */; };
+ A8E6A78111D1661B00311F4A /* HTMLParserScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E6A77F11D1661B00311F4A /* HTMLParserScheduler.h */; };
+ A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8E6A78011D1661B00311F4A /* HTMLParserScheduler.cpp */; };
A8EA73C30A1900E300A8EF5F /* RenderFieldset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA73AF0A1900E300A8EF5F /* RenderFieldset.cpp */; };
A8EA73C40A1900E300A8EF5F /* RenderFieldset.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA73B00A1900E300A8EF5F /* RenderFieldset.h */; };
A8EA79F10A1916DF00A8EF5F /* HTMLOListElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */; };
@@ -3469,7 +3474,6 @@
A9C6E4F00D745E38006442E9 /* PluginArray.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4EE0D745E38006442E9 /* PluginArray.h */; };
A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4F10D745E48006442E9 /* PluginData.cpp */; };
A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E4F20D745E48006442E9 /* PluginData.h */; settings = {ATTRIBUTES = (Private, ); }; };
- A9C6E4F60D745E61006442E9 /* PluginDataMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E4F50D745E61006442E9 /* PluginDataMac.mm */; };
A9C6E5A50D746458006442E9 /* Navigator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E5A30D746458006442E9 /* Navigator.cpp */; };
A9C6E5A60D746458006442E9 /* Navigator.h in Headers */ = {isa = PBXBuildFile; fileRef = A9C6E5A40D746458006442E9 /* Navigator.h */; };
A9C6E6470D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A9C6E6460D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp */; };
@@ -4234,10 +4238,13 @@
B523CF091182675400EBB29C /* SQLTransactionSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B523CF021182675400EBB29C /* SQLTransactionSync.cpp */; };
B523CF0A1182675400EBB29C /* DatabaseSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B523CF031182675400EBB29C /* DatabaseSync.cpp */; };
B523CF0B1182675400EBB29C /* DatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B523CF041182675400EBB29C /* DatabaseSync.h */; };
+ B525A96511CA2340003A23A8 /* JSSQLException.h in Headers */ = {isa = PBXBuildFile; fileRef = B525A96311CA2340003A23A8 /* JSSQLException.h */; };
+ B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B525A96411CA2340003A23A8 /* JSSQLException.cpp */; };
B55D5AA4119131FC00BCC315 /* JSSQLTransactionSyncCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */; };
B55D5AA5119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */; };
B55D5AA81191325000BCC315 /* JSDatabaseSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */; };
B55D5AA91191325000BCC315 /* JSSQLTransactionSyncCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B55D5AA71191325000BCC315 /* JSSQLTransactionSyncCustom.cpp */; };
+ B56EBA8511C9FF8100B04477 /* SQLException.h in Headers */ = {isa = PBXBuildFile; fileRef = B56EBA8311C9FF8100B04477 /* SQLException.h */; };
B58CEB6911913607002A6790 /* JSDatabaseSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6711913607002A6790 /* JSDatabaseSync.h */; };
B58CEB6A11913607002A6790 /* JSDatabaseSync.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */; };
B58CEB6D1191361C002A6790 /* JSSQLTransactionSync.h in Headers */ = {isa = PBXBuildFile; fileRef = B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */; };
@@ -4255,7 +4262,7 @@
B5A684220FFABE9800D24689 /* SQLiteFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = B5A684210FFABE9800D24689 /* SQLiteFileSystem.h */; };
B5A684240FFABEAA00D24689 /* SQLiteFileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A684230FFABEAA00D24689 /* SQLiteFileSystem.cpp */; };
B5B5DC69119BB3D5002A8790 /* AbstractDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */; };
- B5B5DC6A119BB3D5002A8790 /* AbstractDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */; };
+ B5B5DC6A119BB3D5002A8790 /* AbstractDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
B5C1123B102B6C4600096578 /* SQLTransactionCoordinator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5C11239102B6C4600096578 /* SQLTransactionCoordinator.cpp */; };
B5C1123C102B6C4600096578 /* SQLTransactionCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = B5C1123A102B6C4600096578 /* SQLTransactionCoordinator.h */; };
B5D3601A112F8B560048DEA8 /* DatabaseCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = B5D36019112F8B560048DEA8 /* DatabaseCallback.h */; };
@@ -4349,6 +4356,10 @@
BC23EE920DAED2BC009FDC91 /* CSSImageGeneratorValue.h in Headers */ = {isa = PBXBuildFile; fileRef = BC23EE910DAED2BC009FDC91 /* CSSImageGeneratorValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC23F0DB0DAFF4A4009FDC91 /* GeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */; };
BC2441C40E8B65D00055320F /* ScrollView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2441C30E8B65D00055320F /* ScrollView.cpp */; };
+ BC275B7911C5D1C300C9206C /* JSWebKitPointCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */; };
+ BC275B7D11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */; };
+ BC275B8111C5D2B400C9206C /* JSEventSourceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */; };
+ BC275CB311C5E85C00C9206C /* JSArrayBufferCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */; };
BC2CC8DF0F32881000A9DF26 /* RenderObjectChildList.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */; settings = {ATTRIBUTES = (Private, ); }; };
BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */; };
BC2ED6500C6BC48C00920BFF /* JSHTMLIFrameElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC2ED64F0C6BC48C00920BFF /* JSHTMLIFrameElementCustom.cpp */; };
@@ -4722,8 +4733,6 @@
BCE789861120E7A60060ECE5 /* BidiRun.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE789851120E7A60060ECE5 /* BidiRun.h */; };
BCE7898B1120E8020060ECE5 /* BidiRun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE7898A1120E8020060ECE5 /* BidiRun.cpp */; };
BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */; };
- BCE99EC30DCA624100182683 /* JSXSLTProcessorConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE99EC10DCA624100182683 /* JSXSLTProcessorConstructor.cpp */; };
- BCE99EC40DCA624100182683 /* JSXSLTProcessorConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE99EC20DCA624100182683 /* JSXSLTProcessorConstructor.h */; };
BCEA478F097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */; };
BCEA4790097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */; settings = {ATTRIBUTES = (Private, ); }; };
BCEA4852097D93020094C9E4 /* RenderBlockLineLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEA4813097D93020094C9E4 /* RenderBlockLineLayout.cpp */; };
@@ -4873,8 +4882,14 @@
CE4C00E410F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE4C00E310F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp */; };
CE4C00E610F6F7C100CA38F5 /* HTMLNoScriptElement.h in Headers */ = {isa = PBXBuildFile; fileRef = CE4C00E510F6F7C100CA38F5 /* HTMLNoScriptElement.h */; };
CE54FD381016D9A6008B44C8 /* ScriptSourceProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */; };
+ CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */ = {isa = PBXBuildFile; fileRef = CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */; };
CEF418CE1179678C009D112C /* ViewportArguments.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEF418CC1179678C009D112C /* ViewportArguments.cpp */; };
CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */ = {isa = PBXBuildFile; fileRef = CEF418CD1179678C009D112C /* ViewportArguments.h */; };
+ D000EBA211BDAFD400C47726 /* FrameLoaderStateMachine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */; };
+ D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */ = {isa = PBXBuildFile; fileRef = D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ D000ED2711C1B9CD00C47726 /* SubframeLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D000ED2511C1B9CD00C47726 /* SubframeLoader.cpp */; };
+ D000ED2811C1B9CD00C47726 /* SubframeLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = D000ED2611C1B9CD00C47726 /* SubframeLoader.h */; settings = {ATTRIBUTES = (Private, ); }; };
D01A27AD10C9BFD800026A42 /* SpaceSplitString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */; };
D01A27AE10C9BFD800026A42 /* SpaceSplitString.h in Headers */ = {isa = PBXBuildFile; fileRef = D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */; settings = {ATTRIBUTES = (Private, ); }; };
D05CED290A40BB2C00C5AF38 /* FormatBlockCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */; };
@@ -4901,12 +4916,8 @@
E0FEF372B27C53EAC1C1FBEE /* EventSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E0FEF371B27C53EAC1C1FBEE /* EventSource.cpp */; };
E0FEF372B37C53EAC1C1FBEE /* JSEventSource.h in Headers */ = {isa = PBXBuildFile; fileRef = E0FEF371B37C53EAC1C1FBEE /* JSEventSource.h */; };
E0FEF372B47C53EAC1C1FBEE /* JSEventSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E0FEF371B47C53EAC1C1FBEE /* JSEventSource.cpp */; };
- E0FEF372B67C53EAC1C1FBEE /* JSEventSourceConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E0FEF371B67C53EAC1C1FBEE /* JSEventSourceConstructor.h */; };
- E0FEF372B77C53EAC1C1FBEE /* JSEventSourceConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E0FEF371B77C53EAC1C1FBEE /* JSEventSourceConstructor.cpp */; };
E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */; };
E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E107400C0E77BDC00033AF24 /* JSMessageChannel.h */; };
- E10743240E7835830033AF24 /* JSMessageChannelConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E10743230E7835830033AF24 /* JSMessageChannelConstructor.cpp */; };
- E10743270E7835A50033AF24 /* JSMessageChannelConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E10743260E7835A50033AF24 /* JSMessageChannelConstructor.h */; };
E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */; };
E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */; };
E10B9B6C0B747599003ED890 /* NativeXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E10B9B6A0B747599003ED890 /* NativeXPathNSResolver.h */; };
@@ -4977,8 +4988,6 @@
E1C4DE6E0EA75C650023CCD6 /* ActiveDOMObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */; };
E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */; };
E1CA5CBC0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */; };
- E1CA5CD30E8CDE8000E8EF90 /* JSWorkerConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CA5CD20E8CDE8000E8EF90 /* JSWorkerConstructor.h */; };
- E1CA5CD60E8CDEE900E8EF90 /* JSWorkerConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1CA5CD50E8CDEE900E8EF90 /* JSWorkerConstructor.cpp */; };
E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = E1CAA5C50E8BD23600A73ECA /* JSWorker.h */; };
E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */; };
E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */; };
@@ -5034,8 +5043,8 @@
E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E4778B7E115A581A00B5D372 /* JSCustomEvent.h */; };
E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = E47B4BE60E71241600038854 /* CachedResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */; };
- E49626C20D80D94800E3405C /* PreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D4ABE00D7542F000F96869 /* PreloadScanner.cpp */; };
- E49626C30D80D94900E3405C /* PreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D4ABE10D7542F100F96869 /* PreloadScanner.h */; };
+ E49626C20D80D94800E3405C /* LegacyPreloadScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4D4ABE00D7542F000F96869 /* LegacyPreloadScanner.cpp */; };
+ E49626C30D80D94900E3405C /* LegacyPreloadScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D4ABE10D7542F100F96869 /* LegacyPreloadScanner.h */; };
E4AFCFA50DAF29A300F5F55C /* UnitBezier.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFCFA40DAF29A300F5F55C /* UnitBezier.h */; };
E4AFD00B0DAF335400F5F55C /* SMILTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4AFD0050DAF335400F5F55C /* SMILTime.cpp */; };
E4AFD00C0DAF335400F5F55C /* SMILTime.h in Headers */ = {isa = PBXBuildFile; fileRef = E4AFD0060DAF335400F5F55C /* SMILTime.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -5629,6 +5638,9 @@
084D2832110A7FCB0038239A /* SVGAnimatedPropertyTraits.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimatedPropertyTraits.h; sourceTree = "<group>"; };
084DBA9D0ED39D350038C226 /* WMLVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WMLVariables.cpp; sourceTree = "<group>"; };
084DBA9E0ED39D360038C226 /* WMLVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WMLVariables.h; sourceTree = "<group>"; };
+ 0853D72F11C9108F00B2FD42 /* SVGTextChunkLayoutInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextChunkLayoutInfo.cpp; sourceTree = "<group>"; };
+ 0853D73011C9109000B2FD42 /* SVGTextQuery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGTextQuery.cpp; sourceTree = "<group>"; };
+ 0853D73111C9109000B2FD42 /* SVGTextQuery.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGTextQuery.h; sourceTree = "<group>"; };
08563BB2117861770012B578 /* RenderSVGResourcePattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResourcePattern.cpp; sourceTree = "<group>"; };
08563BB3117861770012B578 /* RenderSVGResourcePattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSVGResourcePattern.h; sourceTree = "<group>"; };
08563BCF117865F50012B578 /* RenderSVGResource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSVGResource.cpp; sourceTree = "<group>"; };
@@ -5983,6 +5995,7 @@
1A8F6BBA0DB55CDC001DB794 /* ManifestParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ManifestParser.cpp; sourceTree = "<group>"; };
1A8F6BBB0DB55CDC001DB794 /* ManifestParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ManifestParser.h; sourceTree = "<group>"; };
1A98956A0AA78F80005EF5EF /* KURLCFNet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = KURLCFNet.cpp; sourceTree = "<group>"; };
+ 1AA8798F11CBE846003C664F /* PluginStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginStrategy.h; sourceTree = "<group>"; };
1AB1AE780C051FDE00139F4F /* zoomInCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomInCursor.png; sourceTree = "<group>"; };
1AB1AE790C051FDE00139F4F /* zoomOutCursor.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zoomOutCursor.png; sourceTree = "<group>"; };
1AB7FC470A8B92EC00D9D37B /* XPathEvaluator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XPathEvaluator.cpp; sourceTree = "<group>"; };
@@ -6037,6 +6050,8 @@
1AD2316D0CD269E700C1F194 /* JSSQLTransactionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionCustom.cpp; sourceTree = "<group>"; };
1AD51A120CB59CD300953D11 /* DatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseTracker.h; sourceTree = "<group>"; };
1AD51A130CB59CD300953D11 /* DatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseTracker.cpp; sourceTree = "<group>"; };
+ 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformStrategies.h; sourceTree = "<group>"; };
+ 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformStrategies.cpp; sourceTree = "<group>"; };
1ADA140E0E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginMainThreadScheduler.cpp; sourceTree = "<group>"; };
1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginMainThreadScheduler.h; sourceTree = "<group>"; };
1AE2A9F00A1CDA5700B42B25 /* HTMLAreaElement.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = HTMLAreaElement.idl; sourceTree = "<group>"; };
@@ -6154,6 +6169,7 @@
1CF6BE120E9BB4670025E1CD /* ObjCNodeFilterCondition.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ObjCNodeFilterCondition.mm; sourceTree = "<group>"; };
1CF6BE130E9BB4670025E1CD /* ObjCNodeFilterCondition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjCNodeFilterCondition.h; sourceTree = "<group>"; };
1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
+ 200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptBreakpoint.cpp; sourceTree = "<group>"; };
228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheHost.cpp; sourceTree = "<group>"; };
24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; };
@@ -6317,6 +6333,7 @@
3390CA540FFC157B00921962 /* NotificationContents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationContents.h; path = notifications/NotificationContents.h; sourceTree = "<group>"; };
33C0CCD2112C5E6200CE057D /* SecureTextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecureTextInput.cpp; sourceTree = "<group>"; };
33C0CCD3112C5E6200CE057D /* SecureTextInput.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecureTextInput.h; sourceTree = "<group>"; };
+ 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HyphenationCF.cpp; sourceTree = "<group>"; };
371F4F3E0D25B9AF00ECE0D5 /* FontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontData.h; sourceTree = "<group>"; };
371F4F3F0D25B9AF00ECE0D5 /* FontData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontData.cpp; sourceTree = "<group>"; };
371F4FFA0D25E7F300ECE0D5 /* SegmentedFontData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SegmentedFontData.h; sourceTree = "<group>"; };
@@ -6327,6 +6344,8 @@
371F53E80D2704F900ECE0D5 /* CSSUnicodeRangeValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSUnicodeRangeValue.cpp; sourceTree = "<group>"; };
37202198106213C600F25C4B /* FontSmoothingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSmoothingMode.h; sourceTree = "<group>"; };
3744570E0DB05FA500AE0992 /* SVGGlyphMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGGlyphMap.h; sourceTree = "<group>"; };
+ 375CD231119D43C800A2A859 /* Hyphenation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Hyphenation.h; sourceTree = "<group>"; };
+ 375CD239119D44EA00A2A859 /* HyphenationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HyphenationMac.mm; sourceTree = "<group>"; };
3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlapTestRequestClient.h; sourceTree = "<group>"; };
377C4CDD1014E9F600B9AE42 /* PlaceholderDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlaceholderDocument.h; sourceTree = "<group>"; };
377C4CDE1014E9F600B9AE42 /* PlaceholderDocument.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlaceholderDocument.cpp; sourceTree = "<group>"; };
@@ -6351,8 +6370,6 @@
4110463F0FA222A600BA436A /* ScriptEventListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptEventListener.h; sourceTree = "<group>"; };
411046400FA222A600BA436A /* ScriptEventListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptEventListener.cpp; sourceTree = "<group>"; };
4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptState.cpp; sourceTree = "<group>"; };
- 415B7C550FF598E6006770F7 /* JSSharedWorkerConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSharedWorkerConstructor.cpp; sourceTree = "<group>"; };
- 415B7C620FF5A767006770F7 /* JSSharedWorkerConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSharedWorkerConstructor.h; sourceTree = "<group>"; };
4162A44D101145AE00DFF3ED /* DedicatedWorkerContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DedicatedWorkerContext.cpp; path = workers/DedicatedWorkerContext.cpp; sourceTree = "<group>"; };
4162A44E101145AE00DFF3ED /* DedicatedWorkerContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DedicatedWorkerContext.h; path = workers/DedicatedWorkerContext.h; sourceTree = "<group>"; };
4162A44F101145AE00DFF3ED /* DedicatedWorkerContext.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = DedicatedWorkerContext.idl; path = workers/DedicatedWorkerContext.idl; sourceTree = "<group>"; };
@@ -6367,6 +6384,8 @@
416E75C90EDF90C700360E1D /* ScriptCallFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptCallFrame.h; sourceTree = "<group>"; };
416E75CA0EDF90C700360E1D /* ScriptCallFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptCallFrame.cpp; sourceTree = "<group>"; };
416F45EF0ED7B311008215B6 /* ScriptString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptString.h; sourceTree = "<group>"; };
+ 41885B9111B6FDA6003383BB /* FormSubmission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormSubmission.h; sourceTree = "<group>"; };
+ 41885B9211B6FDA6003383BB /* FormSubmission.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FormSubmission.cpp; sourceTree = "<group>"; };
418F88020FF957AE0080F045 /* JSAbstractWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAbstractWorker.cpp; sourceTree = "<group>"; };
418F88030FF957AE0080F045 /* JSAbstractWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAbstractWorker.h; sourceTree = "<group>"; };
41A3D58C101C152D00316D07 /* DedicatedWorkerThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DedicatedWorkerThread.cpp; path = workers/DedicatedWorkerThread.cpp; sourceTree = "<group>"; };
@@ -6460,8 +6479,6 @@
49484FC0102CF23C00187DD3 /* CanvasStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CanvasStyle.h; path = canvas/CanvasStyle.h; sourceTree = "<group>"; };
494BD7930F55C8EE00747828 /* WebKitPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitPoint.h; sourceTree = "<group>"; };
494BD7940F55C8EE00747828 /* WebKitPoint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitPoint.idl; sourceTree = "<group>"; };
- 494BD7970F55C90E00747828 /* JSWebKitPointConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPointConstructor.cpp; sourceTree = "<group>"; };
- 494BD7980F55C90E00747828 /* JSWebKitPointConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPointConstructor.h; sourceTree = "<group>"; };
494BD79B0F55C94C00747828 /* JSWebKitPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPoint.cpp; sourceTree = "<group>"; };
494BD79C0F55C94C00747828 /* JSWebKitPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPoint.h; sourceTree = "<group>"; };
4983913D0F1E767500C23782 /* JSWebKitCSSMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrix.cpp; sourceTree = "<group>"; };
@@ -6472,8 +6489,6 @@
498391550F1E776900C23782 /* WebKitCSSMatrix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSMatrix.cpp; sourceTree = "<group>"; };
498391560F1E776900C23782 /* WebKitCSSMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSMatrix.h; sourceTree = "<group>"; };
498391570F1E776900C23782 /* WebKitCSSMatrix.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitCSSMatrix.idl; sourceTree = "<group>"; };
- 498391610F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrixConstructor.cpp; sourceTree = "<group>"; };
- 498391620F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitCSSMatrixConstructor.h; sourceTree = "<group>"; };
49C7B9801042D2D30009D447 /* JSWebGLBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLBuffer.cpp; sourceTree = "<group>"; };
49C7B9811042D2D30009D447 /* JSWebGLBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLBuffer.h; sourceTree = "<group>"; };
49C7B9821042D2D30009D447 /* JSInt8Array.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInt8Array.cpp; sourceTree = "<group>"; };
@@ -6518,9 +6533,6 @@
49C7B9C61042D32F0009D447 /* WebGLTexture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebGLTexture.h; path = canvas/WebGLTexture.h; sourceTree = "<group>"; };
49C7B9C71042D32F0009D447 /* WebGLTexture.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebGLTexture.idl; path = canvas/WebGLTexture.idl; sourceTree = "<group>"; };
49C7B9FB1042D3650009D447 /* GraphicsContext3D.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsContext3D.h; sourceTree = "<group>"; };
- 49C7B9FD1042D38C0009D447 /* Canvas3DLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Canvas3DLayer.h; sourceTree = "<group>"; };
- 49C7B9FE1042D38C0009D447 /* Canvas3DLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Canvas3DLayer.mm; sourceTree = "<group>"; };
- 49C7B9FF1042D38C0009D447 /* GraphicsContext3DMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsContext3DMac.cpp; sourceTree = "<group>"; };
49C7BA781042EFAE0009D447 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
49C7BA8C1042F5B10009D447 /* JSDocumentCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDocumentCustom.cpp; sourceTree = "<group>"; };
49D5DC270F423A73008F20FD /* Matrix3DTransformOperation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Matrix3DTransformOperation.cpp; path = transforms/Matrix3DTransformOperation.cpp; sourceTree = "<group>"; };
@@ -6595,22 +6607,6 @@
49EECF7510508D9C00099FAB /* JSUint8ArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUint8ArrayCustom.cpp; sourceTree = "<group>"; };
49EECF7610508D9C00099FAB /* JSUint32ArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUint32ArrayCustom.cpp; sourceTree = "<group>"; };
49EECF7710508D9C00099FAB /* JSUint16ArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUint16ArrayCustom.cpp; sourceTree = "<group>"; };
- 49EECF991050938200099FAB /* JSArrayBufferConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSArrayBufferConstructor.cpp; sourceTree = "<group>"; };
- 49EECF9A1050938200099FAB /* JSArrayBufferConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferConstructor.h; sourceTree = "<group>"; };
- 49EECF9B1050938200099FAB /* JSInt8ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInt8ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECF9C1050938200099FAB /* JSInt8ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInt8ArrayConstructor.h; sourceTree = "<group>"; };
- 49EECF9D1050938200099FAB /* JSFloat32ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFloat32ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECF9E1050938200099FAB /* JSFloat32ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFloat32ArrayConstructor.h; sourceTree = "<group>"; };
- 49EECF9F1050938200099FAB /* JSInt32ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInt32ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECFA01050938200099FAB /* JSInt32ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInt32ArrayConstructor.h; sourceTree = "<group>"; };
- 49EECFA31050938200099FAB /* JSInt16ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInt16ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECFA41050938200099FAB /* JSInt16ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInt16ArrayConstructor.h; sourceTree = "<group>"; };
- 49EECFA51050938200099FAB /* JSUint8ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUint8ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECFA61050938200099FAB /* JSUint8ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUint8ArrayConstructor.h; sourceTree = "<group>"; };
- 49EECFA71050938200099FAB /* JSUint32ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUint32ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECFA81050938200099FAB /* JSUint32ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUint32ArrayConstructor.h; sourceTree = "<group>"; };
- 49EECFA91050938200099FAB /* JSUint16ArrayConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSUint16ArrayConstructor.cpp; sourceTree = "<group>"; };
- 49EECFAA1050938200099FAB /* JSUint16ArrayConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSUint16ArrayConstructor.h; sourceTree = "<group>"; };
49EED13C1051969400099FAB /* JSCanvasRenderingContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContext.cpp; sourceTree = "<group>"; };
49EED13D1051969400099FAB /* JSCanvasRenderingContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCanvasRenderingContext.h; sourceTree = "<group>"; };
49EED13E1051969400099FAB /* JSCanvasRenderingContext2D.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContext2D.cpp; sourceTree = "<group>"; };
@@ -6620,6 +6616,9 @@
49EED14B1051971900099FAB /* JSCanvasRenderingContext2DCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContext2DCustom.cpp; sourceTree = "<group>"; };
49EED14C1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLRenderingContextCustom.cpp; sourceTree = "<group>"; };
49EED14D1051971A00099FAB /* JSCanvasRenderingContextCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCanvasRenderingContextCustom.cpp; sourceTree = "<group>"; };
+ 49FFBF1C11C8550E006A7118 /* GraphicsContext3DMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GraphicsContext3DMac.mm; sourceTree = "<group>"; };
+ 49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLLayer.h; sourceTree = "<group>"; };
+ 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebGLLayer.mm; sourceTree = "<group>"; };
4A8C96EA0BE69032004EEFF0 /* SelectionControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = SelectionControllerMac.mm; path = mac/SelectionControllerMac.mm; sourceTree = "<group>"; };
4B2708C50AF19EE40065127F /* Pasteboard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pasteboard.h; sourceTree = "<group>"; };
4B2709810AF2E5E00065127F /* PasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardMac.mm; sourceTree = "<group>"; };
@@ -6753,8 +6752,6 @@
518A34BE1026C831001B6896 /* WebSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocket.cpp; sourceTree = "<group>"; };
518A34BF1026C831001B6896 /* WebSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocket.h; sourceTree = "<group>"; };
518A34C01026C831001B6896 /* WebSocket.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebSocket.idl; sourceTree = "<group>"; };
- 518A34C41026C8C9001B6896 /* JSWebSocketConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocketConstructor.cpp; sourceTree = "<group>"; };
- 518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebSocketConstructor.h; sourceTree = "<group>"; };
518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebSocketCustom.cpp; sourceTree = "<group>"; };
5196115E0CAC56570010A80C /* Database.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Database.cpp; sourceTree = "<group>"; };
5196115F0CAC56570010A80C /* Database.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Database.h; sourceTree = "<group>"; };
@@ -7000,6 +6997,8 @@
75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; };
7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeRequest.cpp; sourceTree = "<group>"; };
7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshakeRequest.h; sourceTree = "<group>"; };
+ 767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSocketHandshakeResponse.cpp; sourceTree = "<group>"; };
+ 767F99BF11A119560080C51D /* WebSocketHandshakeResponse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSocketHandshakeResponse.h; sourceTree = "<group>"; };
7693BACE106C2DCA007B0823 /* HaltablePlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HaltablePlugin.h; sourceTree = "<group>"; };
7693BACF106C2DCA007B0823 /* PluginHalter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginHalter.cpp; sourceTree = "<group>"; };
7693BAD0106C2DCA007B0823 /* PluginHalter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginHalter.h; sourceTree = "<group>"; };
@@ -7909,6 +7908,11 @@
895253DE116C4F0600CABF00 /* FileThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FileThreadTask.h; sourceTree = "<group>"; };
8988E10C11A3508B00DB732E /* BlobItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobItem.cpp; sourceTree = "<group>"; };
8988E10D11A3508B00DB732E /* BlobItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobItem.h; sourceTree = "<group>"; };
+ 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BlobBuilder.cpp; sourceTree = "<group>"; };
+ 89BED5EA11BE11CE00448492 /* BlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlobBuilder.h; sourceTree = "<group>"; };
+ 89CD027911C859A80070B791 /* BlobBuilder.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = BlobBuilder.idl; sourceTree = "<group>"; };
+ 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSBlobBuilder.cpp; sourceTree = "<group>"; };
+ 89CD029211C85B870070B791 /* JSBlobBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSBlobBuilder.h; sourceTree = "<group>"; };
8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMainThreadExecState.h; sourceTree = "<group>"; };
8F934D841189F1EE00508D5D /* JSMainThreadExecState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMainThreadExecState.cpp; sourceTree = "<group>"; };
9302B0BC0D79F82900C7EE83 /* PageGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroup.cpp; sourceTree = "<group>"; };
@@ -8156,12 +8160,15 @@
97059974107D975200A50A7C /* PolicyCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyCallback.h; sourceTree = "<group>"; };
97059975107D975200A50A7C /* PolicyChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PolicyChecker.cpp; sourceTree = "<group>"; };
97059976107D975200A50A7C /* PolicyChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PolicyChecker.h; sourceTree = "<group>"; };
+ 9719AEFF11D09F2C00D45831 /* HTMLInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLInputStream.h; sourceTree = "<group>"; };
9738899E116EA9DC00ADF313 /* DocumentWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentWriter.cpp; sourceTree = "<group>"; };
9738899F116EA9DC00ADF313 /* DocumentWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentWriter.h; sourceTree = "<group>"; };
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>"; };
- 976E895E11C0CA3A00EA9CA9 /* HTML5EntityParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTML5EntityParser.cpp; sourceTree = "<group>"; };
- 976E895F11C0CA3A00EA9CA9 /* HTML5EntityParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5EntityParser.h; sourceTree = "<group>"; };
+ 976E2BA511CAE4DE006C56A0 /* CSSPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSPreloadScanner.cpp; sourceTree = "<group>"; };
+ 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPreloadScanner.h; sourceTree = "<group>"; };
+ 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLEntityParser.cpp; sourceTree = "<group>"; };
+ 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLEntityParser.h; sourceTree = "<group>"; };
979F43D11075E44A0000F83B /* RedirectScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RedirectScheduler.cpp; sourceTree = "<group>"; };
979F43D21075E44A0000F83B /* RedirectScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RedirectScheduler.h; sourceTree = "<group>"; };
97C0784F1165D5BE003A32EF /* SuffixTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SuffixTree.h; sourceTree = "<group>"; };
@@ -8169,9 +8176,11 @@
97DCE20010807C750057D394 /* HistoryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryController.h; sourceTree = "<group>"; };
97DD4D840FDF4D6D00ECF9A4 /* XSSAuditor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSSAuditor.cpp; sourceTree = "<group>"; };
97DD4D850FDF4D6E00ECF9A4 /* XSSAuditor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSSAuditor.h; sourceTree = "<group>"; };
- 97E8B35411A23CE200169409 /* HTML5Lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTML5Lexer.cpp; sourceTree = "<group>"; };
- 97E8B35511A23CE200169409 /* HTML5Lexer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5Lexer.h; sourceTree = "<group>"; };
- 97E8B3C211A2890800169409 /* HTML5Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5Token.h; sourceTree = "<group>"; };
+ 97E7936311C6030900E649BC /* HTMLPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPreloadScanner.cpp; sourceTree = "<group>"; };
+ 97E7936411C6030900E649BC /* HTMLPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLPreloadScanner.h; sourceTree = "<group>"; };
+ 97E8B35411A23CE200169409 /* HTMLTokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTokenizer.cpp; sourceTree = "<group>"; };
+ 97E8B35511A23CE200169409 /* HTMLTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTokenizer.h; sourceTree = "<group>"; };
+ 97E8B3C211A2890800169409 /* HTMLToken.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLToken.h; sourceTree = "<group>"; };
97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptControllerBase.cpp; sourceTree = "<group>"; };
9F6FC1941122E82A00E80196 /* ScriptDebugServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptDebugServer.cpp; sourceTree = "<group>"; };
9F6FC1951122E82A00E80196 /* ScriptDebugServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugServer.h; sourceTree = "<group>"; };
@@ -8242,6 +8251,8 @@
A784941A0B5FE507001E237A /* Clipboard.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Clipboard.cpp; sourceTree = "<group>"; };
A795463D0B5C4C80007B438F /* DragDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DragDataMac.mm; sourceTree = "<group>"; };
A79546420B5C4CB4007B438F /* DragData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DragData.cpp; sourceTree = "<group>"; };
+ A7AA66D411C5ED6A001D8C8C /* RenderIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderIndicator.cpp; sourceTree = "<group>"; };
+ A7AA66D511C5ED6A001D8C8C /* RenderIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderIndicator.h; sourceTree = "<group>"; };
A7AD2F850EC89D07008AB002 /* LinkHash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkHash.cpp; sourceTree = "<group>"; };
A7AD2F860EC89D07008AB002 /* LinkHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkHash.h; sourceTree = "<group>"; };
A7B6E69D0B291A9600D0529F /* DragData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragData.h; sourceTree = "<group>"; };
@@ -8409,8 +8420,8 @@
A833C7F60A2CF1D800D57664 /* xmlattrs.in */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = xmlattrs.in; sourceTree = "<group>"; };
A833C80A0A2CF25600D57664 /* XMLNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = XMLNames.cpp; sourceTree = "<group>"; };
A833C80B0A2CF25600D57664 /* XMLNames.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = XMLNames.h; sourceTree = "<group>"; };
- A83B3AEE11ADEFF500458809 /* HTML5ScriptRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTML5ScriptRunner.cpp; sourceTree = "<group>"; };
- A83B3AEF11ADEFF500458809 /* HTML5ScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5ScriptRunner.h; sourceTree = "<group>"; };
+ A83B3AEE11ADEFF500458809 /* HTMLScriptRunner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLScriptRunner.cpp; sourceTree = "<group>"; };
+ A83B3AEF11ADEFF500458809 /* HTMLScriptRunner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLScriptRunner.h; sourceTree = "<group>"; };
A83B78F20CCAFF15000B0825 /* JSSVGFontFaceUriElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFontFaceUriElement.h; sourceTree = "<group>"; };
A83B78F30CCAFF15000B0825 /* JSSVGFontFaceUriElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGFontFaceUriElement.cpp; sourceTree = "<group>"; };
A83B78F40CCAFF15000B0825 /* JSSVGFontFaceSrcElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGFontFaceSrcElement.h; sourceTree = "<group>"; };
@@ -8437,9 +8448,11 @@
A83B79470CCB0125000B0825 /* DOMSVGFontFaceElement.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMSVGFontFaceElement.mm; sourceTree = "<group>"; };
A83B79480CCB0125000B0825 /* DOMSVGFontFaceElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGFontFaceElement.h; sourceTree = "<group>"; };
A83E1C720E49042B00140B9C /* ScriptControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScriptControllerMac.mm; sourceTree = "<group>"; };
+ A84D827B11D333ED00972990 /* RawDataDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RawDataDocumentParser.h; sourceTree = "<group>"; };
A84EBD770CB8C89200079609 /* JSStyleSheetListCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetListCustom.cpp; sourceTree = "<group>"; };
A84EBD810CB8C97700079609 /* JSStyleSheetList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSStyleSheetList.h; sourceTree = "<group>"; };
A84EBD820CB8C97700079609 /* JSStyleSheetList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSStyleSheetList.cpp; sourceTree = "<group>"; };
+ A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FragmentScriptingPermission.h; sourceTree = "<group>"; };
A85D7A2F0879EBA9006A9172 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
A86629C909DA2B47009633A5 /* JSUIEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSUIEvent.h; sourceTree = "<group>"; };
A86629CA09DA2B47009633A5 /* JSUIEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSUIEvent.cpp; sourceTree = "<group>"; };
@@ -8447,8 +8460,8 @@
A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMouseEvent.cpp; sourceTree = "<group>"; };
A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSKeyboardEvent.h; sourceTree = "<group>"; };
A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSKeyboardEvent.cpp; sourceTree = "<group>"; };
- A871038811A2947000DBD50E /* HTML5DocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTML5DocumentParser.cpp; sourceTree = "<group>"; };
- A871038911A2947000DBD50E /* HTML5DocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5DocumentParser.h; sourceTree = "<group>"; };
+ A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocumentParser.cpp; sourceTree = "<group>"; };
+ A871038911A2947000DBD50E /* HTMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDocumentParser.h; sourceTree = "<group>"; };
A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLPlugInElement.h; sourceTree = "<group>"; };
A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLPlugInElement.cpp; sourceTree = "<group>"; };
A871D44E0A127CBC00B12A68 /* HTMLParamElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLParamElement.h; sourceTree = "<group>"; };
@@ -8507,9 +8520,9 @@
A871DFDF0A15376B00B12A68 /* RenderReplaced.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderReplaced.h; sourceTree = "<group>"; };
A871DFE00A15376B00B12A68 /* RenderWidget.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderWidget.h; sourceTree = "<group>"; };
A871DFE10A15376B00B12A68 /* RenderWidget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWidget.cpp; sourceTree = "<group>"; };
- A879C62311A9D1F70059237A /* HTML5TreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTML5TreeBuilder.cpp; sourceTree = "<group>"; };
- A879C62411A9D1F70059237A /* HTML5TreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5TreeBuilder.h; sourceTree = "<group>"; };
- A87F163411AE841300CBB2E5 /* HTML5ScriptRunnerHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTML5ScriptRunnerHost.h; sourceTree = "<group>"; };
+ A879C62311A9D1F70059237A /* HTMLTreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLTreeBuilder.cpp; sourceTree = "<group>"; };
+ A879C62411A9D1F70059237A /* HTMLTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLTreeBuilder.h; sourceTree = "<group>"; };
+ A87F163411AE841300CBB2E5 /* HTMLScriptRunnerHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLScriptRunnerHost.h; sourceTree = "<group>"; };
A883DF250F3D045D00F19BF6 /* VisibleSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VisibleSelection.cpp; sourceTree = "<group>"; };
A883DF260F3D045D00F19BF6 /* VisibleSelection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VisibleSelection.h; sourceTree = "<group>"; };
A88DD4860B4629A300C02990 /* PathTraversalState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PathTraversalState.h; sourceTree = "<group>"; };
@@ -8744,6 +8757,8 @@
A8E544BF0CA9D1C20097D09B /* DOMSVGAnimatedAngleInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGAnimatedAngleInternal.h; sourceTree = "<group>"; };
A8E544C10CA9D1C20097D09B /* DOMSVGTextElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGTextElement.h; sourceTree = "<group>"; };
A8E544C30CA9D1C20097D09B /* DOMSVGDescElementInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMSVGDescElementInternal.h; sourceTree = "<group>"; };
+ A8E6A77F11D1661B00311F4A /* HTMLParserScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLParserScheduler.h; sourceTree = "<group>"; };
+ A8E6A78011D1661B00311F4A /* HTMLParserScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLParserScheduler.cpp; sourceTree = "<group>"; };
A8EA73AF0A1900E300A8EF5F /* RenderFieldset.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderFieldset.cpp; sourceTree = "<group>"; };
A8EA73B00A1900E300A8EF5F /* RenderFieldset.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderFieldset.h; sourceTree = "<group>"; };
A8EA79E50A1916DF00A8EF5F /* HTMLOListElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HTMLOListElement.h; sourceTree = "<group>"; };
@@ -8816,7 +8831,6 @@
A9C6E4EE0D745E38006442E9 /* PluginArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginArray.h; sourceTree = "<group>"; };
A9C6E4F10D745E48006442E9 /* PluginData.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PluginData.cpp; sourceTree = "<group>"; };
A9C6E4F20D745E48006442E9 /* PluginData.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PluginData.h; sourceTree = "<group>"; };
- A9C6E4F50D745E61006442E9 /* PluginDataMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PluginDataMac.mm; path = mac/PluginDataMac.mm; sourceTree = "<group>"; };
A9C6E5A30D746458006442E9 /* Navigator.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Navigator.cpp; sourceTree = "<group>"; };
A9C6E5A40D746458006442E9 /* Navigator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Navigator.h; sourceTree = "<group>"; };
A9C6E6460D7465CA006442E9 /* JSMimeTypeArrayCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMimeTypeArrayCustom.cpp; sourceTree = "<group>"; };
@@ -9734,6 +9748,8 @@
B523CF021182675400EBB29C /* SQLTransactionSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SQLTransactionSync.cpp; sourceTree = "<group>"; };
B523CF031182675400EBB29C /* DatabaseSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseSync.cpp; sourceTree = "<group>"; };
B523CF041182675400EBB29C /* DatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseSync.h; sourceTree = "<group>"; };
+ B525A96311CA2340003A23A8 /* JSSQLException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLException.h; sourceTree = "<group>"; };
+ B525A96411CA2340003A23A8 /* JSSQLException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLException.cpp; sourceTree = "<group>"; };
B55D5AA2119131FC00BCC315 /* JSSQLTransactionSyncCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSyncCallback.h; sourceTree = "<group>"; };
B55D5AA3119131FC00BCC315 /* JSSQLTransactionSyncCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLTransactionSyncCallback.cpp; sourceTree = "<group>"; };
B55D5AA61191325000BCC315 /* JSDatabaseSyncCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSyncCustom.cpp; sourceTree = "<group>"; };
@@ -9741,6 +9757,8 @@
B55D5ABB1191327200BCC315 /* DatabaseSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DatabaseSync.idl; sourceTree = "<group>"; };
B55D5ABC1191327200BCC315 /* SQLTransactionSync.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SQLTransactionSync.idl; sourceTree = "<group>"; };
B55D5ABD1191327200BCC315 /* SQLTransactionSyncCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SQLTransactionSyncCallback.idl; sourceTree = "<group>"; };
+ B56EBA8311C9FF8100B04477 /* SQLException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLException.h; sourceTree = "<group>"; };
+ B56EBA8411C9FF8100B04477 /* SQLException.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SQLException.idl; sourceTree = "<group>"; };
B58CEB6711913607002A6790 /* JSDatabaseSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDatabaseSync.h; sourceTree = "<group>"; };
B58CEB6811913607002A6790 /* JSDatabaseSync.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDatabaseSync.cpp; sourceTree = "<group>"; };
B58CEB6B1191361C002A6790 /* JSSQLTransactionSync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLTransactionSync.h; sourceTree = "<group>"; };
@@ -9863,6 +9881,10 @@
BC23EE910DAED2BC009FDC91 /* CSSImageGeneratorValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSImageGeneratorValue.h; sourceTree = "<group>"; };
BC23F0DA0DAFF4A4009FDC91 /* GeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedImage.h; sourceTree = "<group>"; };
BC2441C30E8B65D00055320F /* ScrollView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollView.cpp; sourceTree = "<group>"; };
+ BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPointCustom.cpp; sourceTree = "<group>"; };
+ BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitCSSMatrixCustom.cpp; sourceTree = "<group>"; };
+ BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventSourceCustom.cpp; sourceTree = "<group>"; };
+ BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSArrayBufferCustom.cpp; sourceTree = "<group>"; };
BC2CC8DE0F32881000A9DF26 /* RenderObjectChildList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderObjectChildList.h; sourceTree = "<group>"; };
BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSElementCustom.cpp; sourceTree = "<group>"; };
BC2ED64F0C6BC48C00920BFF /* JSHTMLIFrameElementCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLIFrameElementCustom.cpp; sourceTree = "<group>"; };
@@ -10259,8 +10281,6 @@
BCE789851120E7A60060ECE5 /* BidiRun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BidiRun.h; sourceTree = "<group>"; };
BCE7898A1120E8020060ECE5 /* BidiRun.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BidiRun.cpp; sourceTree = "<group>"; };
BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHistoryCustom.cpp; sourceTree = "<group>"; };
- BCE99EC10DCA624100182683 /* JSXSLTProcessorConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSXSLTProcessorConstructor.cpp; sourceTree = "<group>"; };
- BCE99EC20DCA624100182683 /* JSXSLTProcessorConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSXSLTProcessorConstructor.h; sourceTree = "<group>"; };
BCEA477C097CAAC80094C9E4 /* CSSComputedStyleDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CSSComputedStyleDeclaration.cpp; sourceTree = "<group>"; };
BCEA477D097CAAC80094C9E4 /* CSSComputedStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSComputedStyleDeclaration.h; sourceTree = "<group>"; };
BCEA477E097CAAC80094C9E4 /* CSSGrammar.y */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.yacc; path = CSSGrammar.y; sourceTree = "<group>"; };
@@ -10430,8 +10450,14 @@
CE4C00E310F6F7BA00CA38F5 /* HTMLNoScriptElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLNoScriptElement.cpp; sourceTree = "<group>"; };
CE4C00E510F6F7C100CA38F5 /* HTMLNoScriptElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLNoScriptElement.h; sourceTree = "<group>"; };
CE54FD371016D9A6008B44C8 /* ScriptSourceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptSourceProvider.h; sourceTree = "<group>"; };
+ CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StaticHashSetNodeList.cpp; sourceTree = "<group>"; };
+ CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StaticHashSetNodeList.h; sourceTree = "<group>"; };
CEF418CC1179678C009D112C /* ViewportArguments.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ViewportArguments.cpp; sourceTree = "<group>"; };
CEF418CD1179678C009D112C /* ViewportArguments.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewportArguments.h; sourceTree = "<group>"; };
+ D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameLoaderStateMachine.cpp; sourceTree = "<group>"; };
+ D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameLoaderStateMachine.h; sourceTree = "<group>"; };
+ D000ED2511C1B9CD00C47726 /* SubframeLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubframeLoader.cpp; sourceTree = "<group>"; };
+ D000ED2611C1B9CD00C47726 /* SubframeLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubframeLoader.h; sourceTree = "<group>"; };
D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpaceSplitString.cpp; sourceTree = "<group>"; };
D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpaceSplitString.h; sourceTree = "<group>"; };
D05CED270A40BB2C00C5AF38 /* FormatBlockCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = FormatBlockCommand.cpp; sourceTree = "<group>"; };
@@ -10458,12 +10484,8 @@
E0FEF371B27C53EAC1C1FBEE /* EventSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventSource.cpp; sourceTree = "<group>"; };
E0FEF371B37C53EAC1C1FBEE /* JSEventSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventSource.h; sourceTree = "<group>"; };
E0FEF371B47C53EAC1C1FBEE /* JSEventSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventSource.cpp; sourceTree = "<group>"; };
- E0FEF371B67C53EAC1C1FBEE /* JSEventSourceConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSEventSourceConstructor.h; sourceTree = "<group>"; };
- E0FEF371B77C53EAC1C1FBEE /* JSEventSourceConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSEventSourceConstructor.cpp; sourceTree = "<group>"; };
E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannel.cpp; sourceTree = "<group>"; };
E107400C0E77BDC00033AF24 /* JSMessageChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessageChannel.h; sourceTree = "<group>"; };
- E10743230E7835830033AF24 /* JSMessageChannelConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannelConstructor.cpp; sourceTree = "<group>"; };
- E10743260E7835A50033AF24 /* JSMessageChannelConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessageChannelConstructor.h; sourceTree = "<group>"; };
E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomXPathNSResolver.h; sourceTree = "<group>"; };
E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomXPathNSResolver.cpp; sourceTree = "<group>"; };
E10B9B6A0B747599003ED890 /* NativeXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeXPathNSResolver.h; sourceTree = "<group>"; };
@@ -10536,8 +10558,6 @@
E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveDOMObject.cpp; sourceTree = "<group>"; };
E1C8BE5C0E8BD15A0064CB7D /* JSWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorker.cpp; sourceTree = "<group>"; };
E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerCustom.cpp; sourceTree = "<group>"; };
- E1CA5CD20E8CDE8000E8EF90 /* JSWorkerConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerConstructor.h; sourceTree = "<group>"; };
- E1CA5CD50E8CDEE900E8EF90 /* JSWorkerConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerConstructor.cpp; sourceTree = "<group>"; };
E1CAA5C50E8BD23600A73ECA /* JSWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorker.h; sourceTree = "<group>"; };
E1E1BEFF115FF6FB006F52CA /* WindowsKeyboardCodes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowsKeyboardCodes.h; sourceTree = "<group>"; };
E1E6EEA30B628DA8005F2F70 /* JSHTMLSelectElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLSelectElement.cpp; sourceTree = "<group>"; };
@@ -10619,8 +10639,8 @@
E4C178960EE6903800824D69 /* CSSSelectorList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSSelectorList.h; sourceTree = "<group>"; };
E4C279560CF9741900E97B98 /* RenderMedia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderMedia.cpp; sourceTree = "<group>"; };
E4C279570CF9741900E97B98 /* RenderMedia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMedia.h; sourceTree = "<group>"; };
- E4D4ABE00D7542F000F96869 /* PreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreloadScanner.cpp; sourceTree = "<group>"; };
- E4D4ABE10D7542F100F96869 /* PreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreloadScanner.h; sourceTree = "<group>"; };
+ E4D4ABE00D7542F000F96869 /* LegacyPreloadScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyPreloadScanner.cpp; sourceTree = "<group>"; };
+ E4D4ABE10D7542F100F96869 /* LegacyPreloadScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyPreloadScanner.h; sourceTree = "<group>"; };
E4D687760ED7AE3D006EA978 /* PurgeableBufferMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PurgeableBufferMac.cpp; sourceTree = "<group>"; };
E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgeableBuffer.h; sourceTree = "<group>"; };
E4EEFFC60D34550C00469A58 /* JSAudioConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioConstructor.cpp; sourceTree = "<group>"; };
@@ -10644,10 +10664,10 @@
F523D23C02DE4396018635CA /* HTMLDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDocument.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D23E02DE4396018635CA /* HTMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D23F02DE4396018635CA /* HTMLElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D25002DE4396018635CA /* LegacyHTMLTreeConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyHTMLTreeConstructor.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D25102DE4396018635CA /* LegacyHTMLTreeConstructor.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = LegacyHTMLTreeConstructor.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D25202DE4396018635CA /* HTMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLDocumentParser.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- F523D25302DE4396018635CA /* HTMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLDocumentParser.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F523D25002DE4396018635CA /* LegacyHTMLTreeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyHTMLTreeBuilder.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F523D25102DE4396018635CA /* LegacyHTMLTreeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = LegacyHTMLTreeBuilder.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F523D25202DE4396018635CA /* LegacyHTMLDocumentParser.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LegacyHTMLDocumentParser.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ F523D25302DE4396018635CA /* LegacyHTMLDocumentParser.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = LegacyHTMLDocumentParser.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextResourceDecoder.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D27902DE43D7018635CA /* TextResourceDecoder.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TextResourceDecoder.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F523D30302DE4476018635CA /* Range.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Range.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -10794,7 +10814,6 @@
93EEC1EC09C2877700C515D1 /* html */,
1C81B94D0E9732D900266E07 /* inspector */,
BCB16BFB0979C38700467741 /* loader */,
- FABE72EC1059C1EB00D999DD /* mathml */,
333F703D0FB49C16008E12A6 /* notifications */,
65BF02180974806300C43196 /* page */,
BCF1A5BA097832090061A123 /* platform */,
@@ -11061,15 +11080,6 @@
1AE82EC90CAAE177002237AE /* storage */ = {
isa = PBXGroup;
children = (
- 81CC114011BEAA9D00D0D856 /* IDBKeyRange.idl */,
- 816C806611BE887E009A45E9 /* IDBKeyRange.cpp */,
- 816C806711BE887E009A45E9 /* IDBKeyRange.h */,
- B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */,
- B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */,
- B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */,
- B6693EE811AD63E6003F2770 /* IDBObjectStore.h */,
- B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */,
- B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */,
B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */,
B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */,
514185ED0CD65F0400763C99 /* ChangeVersionWrapper.cpp */,
@@ -11118,11 +11128,20 @@
C51DA9A211AEF2C1009799C5 /* IDBIndexRequest.cpp */,
C51DA9A311AEF2C1009799C5 /* IDBIndexRequest.h */,
C51DA9A411AEF2C1009799C5 /* IDBIndexRequest.idl */,
+ 816C806611BE887E009A45E9 /* IDBKeyRange.cpp */,
+ 816C806711BE887E009A45E9 /* IDBKeyRange.h */,
+ 81CC114011BEAA9D00D0D856 /* IDBKeyRange.idl */,
+ B6693EE811AD63E6003F2770 /* IDBObjectStore.h */,
B6693EE811AD63E6003F2770 /* IDBObjectStore.h */,
B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */,
+ B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */,
+ B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */,
B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */,
B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */,
+ B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */,
B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */,
+ B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */,
+ B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */,
B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */,
C5198F421192ECFD002B74A6 /* IDBRequest.cpp */,
C5198F431192ECFD002B74A6 /* IDBRequest.h */,
@@ -11147,6 +11166,8 @@
51A9267B0D53F0570063ECC2 /* OriginUsageRecord.h */,
51EC92570CE90DB400F90308 /* SQLError.h */,
51EC92580CE90DB400F90308 /* SQLError.idl */,
+ B56EBA8311C9FF8100B04477 /* SQLException.h */,
+ B56EBA8411C9FF8100B04477 /* SQLException.idl */,
519611670CAC56570010A80C /* SQLResultSet.cpp */,
519611680CAC56570010A80C /* SQLResultSet.h */,
519611690CAC56570010A80C /* SQLResultSet.idl */,
@@ -11264,6 +11285,7 @@
F375CC061150D300008DDB81 /* InspectorWorkerResource.h */,
1C81BA050E97348300266E07 /* JavaScriptCallFrame.idl */,
BCC64F5F0DCFB84E0081EF3B /* localizedStrings.js */,
+ 200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */,
7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */,
7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */,
9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */,
@@ -11780,6 +11802,8 @@
51ABAE431043AB4A008C5260 /* WebSocketHandshake.h */,
7637C540112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp */,
7637C542112E7B7E003D6CDC /* WebSocketHandshakeRequest.h */,
+ 767F99BD11A1194A0080C51D /* WebSocketHandshakeResponse.cpp */,
+ 767F99BF11A119560080C51D /* WebSocketHandshakeResponse.h */,
5112247710CFB8F4008099D7 /* WorkerThreadableWebSocketChannel.cpp */,
5112247910CFB8FF008099D7 /* WorkerThreadableWebSocketChannel.h */,
);
@@ -11848,10 +11872,10 @@
A9C6E6610D74671E006442E9 /* PluginArray.idl */,
A9C6E4F10D745E48006442E9 /* PluginData.cpp */,
A9C6E4F20D745E48006442E9 /* PluginData.h */,
- A9C6E4F50D745E61006442E9 /* PluginDataMac.mm */,
1ADA140E0E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp */,
1ADA140F0E1AE5D900023EE5 /* PluginMainThreadScheduler.h */,
76FF17E211235673001D61B5 /* PluginViewNone.cpp */,
+ 1AA8798F11CBE846003C664F /* PluginStrategy.h */,
0AFDAC3C10F5448C00E1F3D2 /* PluginWidget.h */,
);
path = plugins;
@@ -11860,20 +11884,20 @@
656580EC09D12B20000E61D7 /* Derived Sources */ = {
isa = PBXGroup;
children = (
- E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */,
- E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */,
- E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */,
- E406F3FB1198307D009D59D6 /* ColorData.cpp */,
- E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */,
656581AC09D14EE6000E61D7 /* CharsetData.cpp */,
+ E406F3FB1198307D009D59D6 /* ColorData.cpp */,
6565814409D13043000E61D7 /* CSSGrammar.cpp */,
650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */,
+ E41EA038119836DB00710BC5 /* CSSPropertyNames.cpp */,
656580EE09D12B20000E61D7 /* CSSPropertyNames.gperf */,
656580EF09D12B20000E61D7 /* CSSPropertyNames.h */,
+ E41EA0391198374900710BC5 /* CSSValueKeywords.cpp */,
6565814709D13043000E61D7 /* CSSValueKeywords.gperf */,
6565814809D13043000E61D7 /* CSSValueKeywords.h */,
+ E406F3FA1198304D009D59D6 /* DocTypeStrings.cpp */,
A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */,
A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */,
+ E406F4021198329A009D59D6 /* HTMLEntityNames.cpp */,
A8D06B380A265DCD005E7203 /* HTMLNames.cpp */,
A8D06B370A265DCD005E7203 /* HTMLNames.h */,
938E65F609F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp */,
@@ -13416,15 +13440,20 @@
93EEC1EC09C2877700C515D1 /* html */ = {
isa = PBXGroup;
children = (
- 49484FAE102CF01E00187DD3 /* canvas */,
B0149E7911A4B21500196A7B /* AsyncImageResizer.cpp */,
B0149E7A11A4B21500196A7B /* AsyncImageResizer.h */,
2EAFAF0B10E2AF2D007ED3D6 /* Blob.cpp */,
2EAFAF0C10E2AF2D007ED3D6 /* Blob.h */,
2EAFAF0D10E2AF2D007ED3D6 /* Blob.idl */,
+ 89BED5E911BE11CE00448492 /* BlobBuilder.cpp */,
+ 89BED5EA11BE11CE00448492 /* BlobBuilder.h */,
+ 89CD027911C859A80070B791 /* BlobBuilder.idl */,
+ 49484FAE102CF01E00187DD3 /* canvas */,
93C441ED0F813A1A00C1A634 /* CollectionCache.cpp */,
93C441EE0F813A1A00C1A634 /* CollectionCache.h */,
93C441FF0F813AE100C1A634 /* CollectionType.h */,
+ 976E2BA511CAE4DE006C56A0 /* CSSPreloadScanner.cpp */,
+ 976E2BA611CAE4DE006C56A0 /* CSSPreloadScanner.h */,
BC77D2380FF298080070887B /* DataGridColumn.cpp */,
BC77CFC10FF175550070887B /* DataGridColumn.h */,
BC77CF9E0FF172B30070887B /* DataGridColumn.idl */,
@@ -13460,18 +13489,20 @@
895253DE116C4F0600CABF00 /* FileThreadTask.h */,
A8136D370973A8E700D74463 /* FormDataList.cpp */,
A8136D360973A8E700D74463 /* FormDataList.h */,
- 976E895E11C0CA3A00EA9CA9 /* HTML5EntityParser.cpp */,
- 976E895F11C0CA3A00EA9CA9 /* HTML5EntityParser.h */,
- 97E8B35411A23CE200169409 /* HTML5Lexer.cpp */,
- 97E8B35511A23CE200169409 /* HTML5Lexer.h */,
- A83B3AEE11ADEFF500458809 /* HTML5ScriptRunner.cpp */,
- A83B3AEF11ADEFF500458809 /* HTML5ScriptRunner.h */,
- A87F163411AE841300CBB2E5 /* HTML5ScriptRunnerHost.h */,
- 97E8B3C211A2890800169409 /* HTML5Token.h */,
- A871038811A2947000DBD50E /* HTML5DocumentParser.cpp */,
- A871038911A2947000DBD50E /* HTML5DocumentParser.h */,
- A879C62311A9D1F70059237A /* HTML5TreeBuilder.cpp */,
- A879C62411A9D1F70059237A /* HTML5TreeBuilder.h */,
+ A871038811A2947000DBD50E /* HTMLDocumentParser.cpp */,
+ A871038911A2947000DBD50E /* HTMLDocumentParser.h */,
+ 976E895E11C0CA3A00EA9CA9 /* HTMLEntityParser.cpp */,
+ 976E895F11C0CA3A00EA9CA9 /* HTMLEntityParser.h */,
+ 97E8B35411A23CE200169409 /* HTMLTokenizer.cpp */,
+ 97E8B35511A23CE200169409 /* HTMLTokenizer.h */,
+ 97E7936311C6030900E649BC /* HTMLPreloadScanner.cpp */,
+ 97E7936411C6030900E649BC /* HTMLPreloadScanner.h */,
+ A83B3AEE11ADEFF500458809 /* HTMLScriptRunner.cpp */,
+ A83B3AEF11ADEFF500458809 /* HTMLScriptRunner.h */,
+ A87F163411AE841300CBB2E5 /* HTMLScriptRunnerHost.h */,
+ 97E8B3C211A2890800169409 /* HTMLToken.h */,
+ A879C62311A9D1F70059237A /* HTMLTreeBuilder.cpp */,
+ A879C62411A9D1F70059237A /* HTMLTreeBuilder.h */,
BC97E239109144950010D361 /* HTMLAllCollection.cpp */,
BC97E238109144950010D361 /* HTMLAllCollection.h */,
BC97E23C109146F10010D361 /* HTMLAllCollection.idl */,
@@ -13539,6 +13570,8 @@
F523D23B02DE4396018635CA /* HTMLDocument.cpp */,
F523D23C02DE4396018635CA /* HTMLDocument.h */,
1A494E290A12354300FDAFC1 /* HTMLDocument.idl */,
+ F523D25202DE4396018635CA /* LegacyHTMLDocumentParser.cpp */,
+ F523D25302DE4396018635CA /* LegacyHTMLDocumentParser.h */,
F523D23E02DE4396018635CA /* HTMLElement.cpp */,
F523D23F02DE4396018635CA /* HTMLElement.h */,
1A494BBB0A122DCD00FDAFC1 /* HTMLElement.idl */,
@@ -13591,6 +13624,7 @@
A81369B1097374F500D74463 /* HTMLInputElement.cpp */,
A81369B0097374F500D74463 /* HTMLInputElement.h */,
A80E7E170A1A7CCB007FB8C5 /* HTMLInputElement.idl */,
+ 9719AEFF11D09F2C00D45831 /* HTMLInputStream.h */,
A81369AF097374F500D74463 /* HTMLIsIndexElement.cpp */,
A81369AE097374F500D74463 /* HTMLIsIndexElement.h */,
1AE2AA850A1CDCCE00B42B25 /* HTMLIsIndexElement.idl */,
@@ -13654,11 +13688,11 @@
A871D44F0A127CBC00B12A68 /* HTMLParamElement.cpp */,
A871D44E0A127CBC00B12A68 /* HTMLParamElement.h */,
1AE2AB720A1CE81500B42B25 /* HTMLParamElement.idl */,
- F523D25002DE4396018635CA /* LegacyHTMLTreeConstructor.cpp */,
- F523D25102DE4396018635CA /* LegacyHTMLTreeConstructor.h */,
BC588B4A0BFA723C00EE679E /* HTMLParserErrorCodes.cpp */,
BC588AEF0BFA6CF900EE679E /* HTMLParserErrorCodes.h */,
449B19F30FA72ECE0015CA4A /* HTMLParserQuirks.h */,
+ A8E6A78011D1661B00311F4A /* HTMLParserScheduler.cpp */,
+ A8E6A77F11D1661B00311F4A /* HTMLParserScheduler.h */,
A871D44D0A127CBC00B12A68 /* HTMLPlugInElement.cpp */,
A871D44C0A127CBC00B12A68 /* HTMLPlugInElement.h */,
4415292D0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp */,
@@ -13713,8 +13747,6 @@
A871DC1D0A15205700B12A68 /* HTMLTitleElement.cpp */,
A871DC1C0A15205700B12A68 /* HTMLTitleElement.h */,
A80E7AAE0A19D1F1007FB8C5 /* HTMLTitleElement.idl */,
- F523D25202DE4396018635CA /* HTMLDocumentParser.cpp */,
- F523D25302DE4396018635CA /* HTMLDocumentParser.h */,
A8EA79E70A1916DF00A8EF5F /* HTMLUListElement.cpp */,
A8EA79E60A1916DF00A8EF5F /* HTMLUListElement.h */,
1A85B1D50A1B236C00D8C87C /* HTMLUListElement.idl */,
@@ -13730,10 +13762,12 @@
B0149E7C11A4B21500196A7B /* ImageResizerThread.h */,
A456FA2411AD4A830020B420 /* LabelsNodeList.cpp */,
A456FA2511AD4A830020B420 /* LabelsNodeList.h */,
+ F523D25002DE4396018635CA /* LegacyHTMLTreeBuilder.cpp */,
+ F523D25102DE4396018635CA /* LegacyHTMLTreeBuilder.h */,
E446139B0CD6331000FADA75 /* MediaError.h */,
E446139C0CD6331000FADA75 /* MediaError.idl */,
- E4D4ABE00D7542F000F96869 /* PreloadScanner.cpp */,
- E4D4ABE10D7542F100F96869 /* PreloadScanner.h */,
+ E4D4ABE00D7542F000F96869 /* LegacyPreloadScanner.cpp */,
+ E4D4ABE10D7542F100F96869 /* LegacyPreloadScanner.h */,
A5AFB34D115151A700B045CB /* StepRange.cpp */,
A5AFB34E115151A700B045CB /* StepRange.h */,
BCEF45E80E687767001C1287 /* TextMetrics.h */,
@@ -13803,6 +13837,8 @@
49EECF1A105072F300099FAB /* JSArrayBufferView.h */,
2E2D99CB10E2BBDA00496337 /* JSBlob.cpp */,
2E2D99CC10E2BBDA00496337 /* JSBlob.h */,
+ 89CD029111C85B870070B791 /* JSBlobBuilder.cpp */,
+ 89CD029211C85B870070B791 /* JSBlobBuilder.h */,
65DF323309D1DE65000BE325 /* JSCanvasGradient.cpp */,
65DF323409D1DE65000BE325 /* JSCanvasGradient.h */,
65DF323509D1DE65000BE325 /* JSCanvasPattern.cpp */,
@@ -14501,6 +14537,8 @@
C56C919F119D918100DE4CD9 /* JSIDBEvent.h */,
C5BBC9CE11AEF838007C2BFE /* JSIDBIndexRequest.cpp */,
C5BBC9CF11AEF838007C2BFE /* JSIDBIndexRequest.h */,
+ 816C80B011BE9934009A45E9 /* JSIDBKeyRange.cpp */,
+ 816C80AE11BE990D009A45E9 /* JSIDBKeyRange.h */,
B6693EF011AD6486003F2770 /* JSIDBObjectStoreRequest.cpp */,
B6693EF111AD6486003F2770 /* JSIDBObjectStoreRequest.h */,
C5F4F404119306AC00FDFADD /* JSIDBRequest.cpp */,
@@ -14511,6 +14549,8 @@
C5F4F40F119306C000FDFADD /* JSIndexedDatabaseRequest.h */,
514C76350CE9225E007EF3CD /* JSSQLError.cpp */,
BC8243250D0CE8A200460C8F /* JSSQLError.h */,
+ B525A96311CA2340003A23A8 /* JSSQLException.h */,
+ B525A96411CA2340003A23A8 /* JSSQLException.cpp */,
1AE82FEA0CAB07EE002237AE /* JSSQLResultSet.cpp */,
1AE82FEB0CAB07EE002237AE /* JSSQLResultSet.h */,
1AFE11970CBFFCC4003017FA /* JSSQLResultSetRowList.cpp */,
@@ -14533,8 +14573,6 @@
51E3F9D50DA05E1D00250911 /* JSStorage.h */,
51E0BAE80DA55D4A00A9E417 /* JSStorageEvent.cpp */,
51E0BAE90DA55D4A00A9E417 /* JSStorageEvent.h */,
- 816C80AE11BE990D009A45E9 /* JSIDBKeyRange.h */,
- 816C80B011BE9934009A45E9 /* JSIDBKeyRange.cpp */,
);
name = Storage;
sourceTree = "<group>";
@@ -15096,8 +15134,6 @@
B27535490B053814002CE64F /* mac */ = {
isa = PBXGroup;
children = (
- 49C7B9FD1042D38C0009D447 /* Canvas3DLayer.h */,
- 49C7B9FE1042D38C0009D447 /* Canvas3DLayer.mm */,
EDE3A4FF0C7A430600956A37 /* ColorMac.h */,
B275354A0B053814002CE64F /* ColorMac.mm */,
37C2360E1097EE7700EF9F72 /* ComplexTextController.cpp */,
@@ -15115,7 +15151,7 @@
B2AFFC790D00A5C10030074D /* FontPlatformData.h */,
B2AFFC7A0D00A5C10030074D /* FontPlatformDataMac.mm */,
B2AFFC7B0D00A5C10030074D /* GlyphPageTreeNodeMac.cpp */,
- 49C7B9FF1042D38C0009D447 /* GraphicsContext3DMac.cpp */,
+ 49FFBF1C11C8550E006A7118 /* GraphicsContext3DMac.mm */,
B277B4030B22F37C0004BEC6 /* GraphicsContextMac.mm */,
0F580B040F12A2550051D689 /* GraphicsLayerCA.h */,
0F580B030F12A2540051D689 /* GraphicsLayerCA.mm */,
@@ -15130,6 +15166,8 @@
163E8B12118B3ADD00ED9231 /* SimpleFontDataATSUI.mm */,
163E88F5118A39D200ED9231 /* SimpleFontDataCoreText.cpp */,
B2AFFC770D00A5C10030074D /* SimpleFontDataMac.mm */,
+ 49FFBF3D11C93EE3006A7118 /* WebGLLayer.h */,
+ 49FFBF3E11C93EE3006A7118 /* WebGLLayer.mm */,
0FCF332B0F2B9A25004B6795 /* WebLayer.h */,
0FCF332A0F2B9A25004B6795 /* WebLayer.mm */,
0FCF33290F2B9A25004B6795 /* WebTiledLayer.h */,
@@ -15240,6 +15278,7 @@
B2B264590D00A77E000ACC1D /* cf */ = {
isa = PBXGroup;
children = (
+ 371A67CA11C6C7DB00047B8B /* HyphenationCF.cpp */,
B2B2645A0D00A77E000ACC1D /* StringCF.cpp */,
B2B2645B0D00A77E000ACC1D /* StringImplCF.cpp */,
);
@@ -15261,6 +15300,7 @@
B2C3D9F30D006C1D00EF6F26 /* BidiContext.h */,
B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */,
B2C3D9F50D006C1D00EF6F26 /* CharacterNames.h */,
+ 375CD231119D43C800A2A859 /* Hyphenation.h */,
BC76AC110DD7AD5C00415F34 /* ParserUtilities.h */,
B2C3D9FB0D006C1D00EF6F26 /* PlatformString.h */,
B2C3D9FC0D006C1D00EF6F26 /* RegularExpression.cpp */,
@@ -15308,6 +15348,7 @@
children = (
B2AFFC850D00A5DF0030074D /* character-sets.txt */,
B2C3D9FA0D006C1D00EF6F26 /* CharsetData.h */,
+ 375CD239119D44EA00A2A859 /* HyphenationMac.mm */,
B2AFFC860D00A5DF0030074D /* mac-encodings.txt */,
B2AFFC870D00A5DF0030074D /* make-charset-table.pl */,
B2AFFC880D00A5DF0030074D /* ShapeArabic.c */,
@@ -15395,8 +15436,6 @@
8F934D831189F1EE00508D5D /* JSMainThreadExecState.h */,
93B70D4F09EB0C7C009D8468 /* JSPluginElementFunctions.cpp */,
93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */,
- 415B7C550FF598E6006770F7 /* JSSharedWorkerConstructor.cpp */,
- 415B7C620FF5A767006770F7 /* JSSharedWorkerConstructor.h */,
14CD8D81106B529000A46D23 /* JSSharedWorkerCustom.cpp */,
B21127A50B3186770009BE53 /* JSSVGPODTypeWrapper.h */,
E1C36D320EB0A094007410BC /* JSWorkerContextBase.cpp */,
@@ -15498,6 +15537,7 @@
BC4EDEF70C08F414007EDD49 /* Custom */ = {
isa = PBXGroup;
children = (
+ BC275CB211C5E85C00C9206C /* JSArrayBufferCustom.cpp */,
492273A21083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp */,
86243D0011BC31F700CC006A /* JSArrayBufferViewHelper.h */,
BC2ED6BB0C6BD2F000920BFF /* JSAttrCustom.cpp */,
@@ -15523,6 +15563,7 @@
652FBBBB0DE27CB60001D386 /* JSDOMWindowCustom.h */,
BC2ED5540C6B9BD300920BFF /* JSElementCustom.cpp */,
BCEFAF4D0C317E6900FA81F6 /* JSEventCustom.cpp */,
+ BC275B8011C5D2B400C9206C /* JSEventSourceCustom.cpp */,
49EECF7210508D9C00099FAB /* JSFloat32ArrayCustom.cpp */,
FE80D7A60E9C1ED2000D6F75 /* JSGeolocationCustom.cpp */,
BCE7B1920D4E86960075A539 /* JSHistoryCustom.cpp */,
@@ -15587,6 +15628,8 @@
49EECF7610508D9C00099FAB /* JSUint32ArrayCustom.cpp */,
49EECF7510508D9C00099FAB /* JSUint8ArrayCustom.cpp */,
49EED14C1051971A00099FAB /* JSWebGLRenderingContextCustom.cpp */,
+ BC275B7C11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp */,
+ BC275B7811C5D1C300C9206C /* JSWebKitPointCustom.cpp */,
518A34C61026C8C9001B6896 /* JSWebSocketCustom.cpp */,
E18258AB0EF3CD7000933242 /* JSWorkerContextCustom.cpp */,
E1CA5CBB0E8CDCAF00E8EF90 /* JSWorkerCustom.cpp */,
@@ -15719,6 +15762,7 @@
BCB16BFB0979C38700467741 /* loader */ = {
isa = PBXGroup;
children = (
+ FABE72EC1059C1EB00D999DD /* mathml */,
1A8F6BB00DB55CDC001DB794 /* appcache */,
512DD8E80D91E691000F89EE /* archive */,
5126E6B60A2E3AEF005C29FA /* icon */,
@@ -15761,9 +15805,13 @@
B255990D0D00D8B900BB825C /* EmptyClients.h */,
656D37230ADBA5DE00A4554D /* FormState.cpp */,
656D37220ADBA5DE00A4554D /* FormState.h */,
+ 41885B9111B6FDA6003383BB /* FormSubmission.h */,
+ 41885B9211B6FDA6003383BB /* FormSubmission.cpp */,
932E16080AF578340025F408 /* FrameLoader.cpp */,
656D37240ADBA5DE00A4554D /* FrameLoader.h */,
656D37260ADBA5DE00A4554D /* FrameLoaderClient.h */,
+ D000EBA011BDAFD400C47726 /* FrameLoaderStateMachine.cpp */,
+ D000EBA111BDAFD400C47726 /* FrameLoaderStateMachine.h */,
93B77A370ADD792500EA4B81 /* FrameLoaderTypes.h */,
51E4ADB20C42B4CF0042BC55 /* FTPDirectoryDocument.cpp */,
51E4ADB30C42B4CF0042BC55 /* FTPDirectoryDocument.h */,
@@ -15805,6 +15853,8 @@
973E325510883B7C005BC493 /* ResourceLoadNotifier.h */,
51327D5F11A33A2B004F9D65 /* SinkDocument.cpp */,
51327D5E11A33A2B004F9D65 /* SinkDocument.h */,
+ D000ED2511C1B9CD00C47726 /* SubframeLoader.cpp */,
+ D000ED2611C1B9CD00C47726 /* SubframeLoader.h */,
93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */,
656D37300ADBA5DE00A4554D /* SubresourceLoader.h */,
1A3178920B20A81600316987 /* SubresourceLoaderClient.h */,
@@ -15854,44 +15904,12 @@
BCCE58B41061E925008FB35A /* Constructors */ = {
isa = PBXGroup;
children = (
- 49EECF991050938200099FAB /* JSArrayBufferConstructor.cpp */,
- 49EECF9A1050938200099FAB /* JSArrayBufferConstructor.h */,
E4EEFFC60D34550C00469A58 /* JSAudioConstructor.cpp */,
E4EEFFC70D34550C00469A58 /* JSAudioConstructor.h */,
- E0FEF371B77C53EAC1C1FBEE /* JSEventSourceConstructor.cpp */,
- E0FEF371B67C53EAC1C1FBEE /* JSEventSourceConstructor.h */,
- 49EECF9D1050938200099FAB /* JSFloat32ArrayConstructor.cpp */,
- 49EECF9E1050938200099FAB /* JSFloat32ArrayConstructor.h */,
BC6C49F10D7DBA0500FFA558 /* JSImageConstructor.cpp */,
BC6C49F20D7DBA0500FFA558 /* JSImageConstructor.h */,
- 49EECFA31050938200099FAB /* JSInt16ArrayConstructor.cpp */,
- 49EECFA41050938200099FAB /* JSInt16ArrayConstructor.h */,
- 49EECF9F1050938200099FAB /* JSInt32ArrayConstructor.cpp */,
- 49EECFA01050938200099FAB /* JSInt32ArrayConstructor.h */,
- 49EECF9B1050938200099FAB /* JSInt8ArrayConstructor.cpp */,
- 49EECF9C1050938200099FAB /* JSInt8ArrayConstructor.h */,
- E10743230E7835830033AF24 /* JSMessageChannelConstructor.cpp */,
- E10743260E7835A50033AF24 /* JSMessageChannelConstructor.h */,
A826E8AD0A1A8F2300CD1BB6 /* JSOptionConstructor.cpp */,
A826E8AC0A1A8F2300CD1BB6 /* JSOptionConstructor.h */,
- 415B7C550FF598E6006770F7 /* JSSharedWorkerConstructor.cpp */,
- 415B7C620FF5A767006770F7 /* JSSharedWorkerConstructor.h */,
- 49EECFA91050938200099FAB /* JSUint16ArrayConstructor.cpp */,
- 49EECFAA1050938200099FAB /* JSUint16ArrayConstructor.h */,
- 49EECFA71050938200099FAB /* JSUint32ArrayConstructor.cpp */,
- 49EECFA81050938200099FAB /* JSUint32ArrayConstructor.h */,
- 49EECFA51050938200099FAB /* JSUint8ArrayConstructor.cpp */,
- 49EECFA61050938200099FAB /* JSUint8ArrayConstructor.h */,
- 498391610F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.cpp */,
- 498391620F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h */,
- 494BD7970F55C90E00747828 /* JSWebKitPointConstructor.cpp */,
- 494BD7980F55C90E00747828 /* JSWebKitPointConstructor.h */,
- 518A34C41026C8C9001B6896 /* JSWebSocketConstructor.cpp */,
- 518A34C51026C8C9001B6896 /* JSWebSocketConstructor.h */,
- E1CA5CD50E8CDEE900E8EF90 /* JSWorkerConstructor.cpp */,
- E1CA5CD20E8CDE8000E8EF90 /* JSWorkerConstructor.h */,
- BCE99EC10DCA624100182683 /* JSXSLTProcessorConstructor.cpp */,
- BCE99EC20DCA624100182683 /* JSXSLTProcessorConstructor.h */,
);
name = Constructors;
sourceTree = "<group>";
@@ -15970,6 +15988,8 @@
932871BF0B20DEB70049035A /* PlatformMenuDescription.h */,
935C476709AC4D4300A6AAB4 /* PlatformMouseEvent.h */,
BCEC01D60C274EB4009F4EC9 /* PlatformScreen.h */,
+ 1AD8F81A11CAB9E900E93E54 /* PlatformStrategies.cpp */,
+ 1AD8F81911CAB9E900E93E54 /* PlatformStrategies.h */,
935C476A09AC4D4F00A6AAB4 /* PlatformWheelEvent.h */,
0668E1890ADD9624004128E0 /* PopupMenu.h */,
ABC128760B33AA6D00C693D5 /* PopupMenuClient.h */,
@@ -16414,6 +16434,8 @@
BCEA4837097D93020094C9E4 /* RenderImage.h */,
BCB4F8920DB28E530039139B /* RenderImageGeneratedContent.cpp */,
BCB4F88F0DB28DD60039139B /* RenderImageGeneratedContent.h */,
+ A7AA66D411C5ED6A001D8C8C /* RenderIndicator.cpp */,
+ A7AA66D511C5ED6A001D8C8C /* RenderIndicator.h */,
BCEA4838097D93020094C9E4 /* RenderInline.cpp */,
BCEA4839097D93020094C9E4 /* RenderInline.h */,
BCEA483A097D93020094C9E4 /* RenderLayer.cpp */,
@@ -16580,9 +16602,12 @@
853CA9E50AEEC608002372DC /* SVGRootInlineBox.h */,
08DAB9C01103D9C1003E7ABA /* SVGShadowTreeElements.cpp */,
08DAB9C11103D9C1003E7ABA /* SVGShadowTreeElements.h */,
+ 0853D72F11C9108F00B2FD42 /* SVGTextChunkLayoutInfo.cpp */,
0842BC801190147200C7D08F /* SVGTextChunkLayoutInfo.h */,
083F529711957FBE00653EBE /* SVGTextLayoutUtilities.cpp */,
083F529811957FBE00653EBE /* SVGTextLayoutUtilities.h */,
+ 0853D73011C9109000B2FD42 /* SVGTextQuery.cpp */,
+ 0853D73111C9109000B2FD42 /* SVGTextQuery.h */,
A8CFF04C0A154F09000A4234 /* TableLayout.h */,
AB014DE10E689A4300E10445 /* TextControlInnerElements.cpp */,
AB014DE20E689A4300E10445 /* TextControlInnerElements.h */,
@@ -16598,6 +16623,7 @@
F523D32402DE4478018635CA /* dom */ = {
isa = PBXGroup;
children = (
+ A84D827B11D333ED00972990 /* RawDataDocumentParser.h */,
E1C4DE6D0EA75C650023CCD6 /* ActiveDOMObject.cpp */,
E1C4DE680EA75C1E0023CCD6 /* ActiveDOMObject.h */,
A8C4A7FC09D563270003AC8D /* Attr.cpp */,
@@ -16665,6 +16691,7 @@
A8185F3509765765005826D9 /* DocumentFragment.h */,
1A494ED50A123F1A00FDAFC1 /* DocumentFragment.idl */,
ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */,
+ BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */,
A8185F3209765765005826D9 /* DocumentType.cpp */,
A8185F3109765765005826D9 /* DocumentType.h */,
93EEC1E809C2877700C515D1 /* DocumentType.idl */,
@@ -16803,6 +16830,8 @@
BC7FA67F0D1F167900DB22A9 /* SelectorNodeList.h */,
D01A27AB10C9BFD800026A42 /* SpaceSplitString.cpp */,
D01A27AC10C9BFD800026A42 /* SpaceSplitString.h */,
+ CEA3949A11D45CDA003094CF /* StaticHashSetNodeList.cpp */,
+ CEA3949B11D45CDA003094CF /* StaticHashSetNodeList.h */,
BC7FA62C0D1F0EFF00DB22A9 /* StaticNodeList.cpp */,
BC7FA62B0D1F0EFF00DB22A9 /* StaticNodeList.h */,
A8C4A7EC09D563270003AC8D /* StyledElement.cpp */,
@@ -16817,7 +16846,6 @@
933A142B0B7D188600A53FFD /* TextEvent.cpp */,
933A142D0B7D188600A53FFD /* TextEvent.h */,
933A142C0B7D188600A53FFD /* TextEvent.idl */,
- BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */,
5DB1BC6810715A6400EFAA49 /* TransformSource.h */,
5DB1BC6910715A6400EFAA49 /* TransformSourceLibxslt.cpp */,
854FE72C0A2297BE0058D7AD /* Traversal.cpp */,
@@ -16849,6 +16877,7 @@
54C50F7A0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp */,
5D15E3A90F9E6AC1009E0E3F /* XMLDocumentParserScope.cpp */,
5D15E3AA0F9E6AC1009E0E3F /* XMLDocumentParserScope.h */,
+ A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
);
path = dom;
sourceTree = "<group>";
@@ -16887,7 +16916,8 @@
FA7EFB031120D25400CF79C7 /* RenderMathMLUnderOver.cpp */,
FA7EFB041120D25400CF79C7 /* RenderMathMLUnderOver.h */,
);
- path = mathml;
+ name = mathml;
+ path = ../mathml;
sourceTree = "<group>";
};
/* End PBXGroup section */
@@ -16967,6 +16997,7 @@
BC5EB9200E82040800B25965 /* BindingURI.h in Headers */,
A89943280B42338800D7C802 /* BitmapImage.h in Headers */,
2EAFAF0F10E2AF2D007ED3D6 /* Blob.h in Headers */,
+ 89BED5EC11BE11CE00448492 /* BlobBuilder.h in Headers */,
8988E10F11A3508B00DB732E /* BlobItem.h in Headers */,
93F199BE08245E59001E9ABC /* BlockExceptions.h in Headers */,
BC5EB5E10E81BE8700B25965 /* BorderData.h in Headers */,
@@ -16995,7 +17026,6 @@
BCB16C260979C3BD00467741 /* CachedXBLDocument.h in Headers */,
BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
93F1995008245E59001E9ABC /* CachePolicy.h in Headers */,
- 49C7BA001042D38C0009D447 /* Canvas3DLayer.h in Headers */,
6E4E91AD10F7FB3100A2779C /* CanvasContextAttributes.h in Headers */,
49484FC2102CF23C00187DD3 /* CanvasGradient.h in Headers */,
49C7B9D51042D32F0009D447 /* CanvasObject.h in Headers */,
@@ -17088,6 +17118,7 @@
A80E6D000A1989CA007FB8C5 /* CSSPageRule.h in Headers */,
BC772B3E0C4EA91E0083285F /* CSSParser.h in Headers */,
BC02A4B70E0997B9004B6D2B /* CSSParserValues.h in Headers */,
+ 976E2BA811CAE4DE006C56A0 /* CSSPreloadScanner.h in Headers */,
A80E6CE60A1989CA007FB8C5 /* CSSPrimitiveValue.h in Headers */,
E1ED8AC30CC49BE000BFC557 /* CSSPrimitiveValueMappings.h in Headers */,
A80E6CFF0A1989CA007FB8C5 /* CSSProperty.h in Headers */,
@@ -17152,6 +17183,7 @@
A8185F3D09765766005826D9 /* DocumentFragment.h in Headers */,
656D37360ADBA5DE00A4554D /* DocumentLoader.h in Headers */,
ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */,
+ BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */,
0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
A8185F3909765766005826D9 /* DocumentType.h in Headers */,
973889A1116EA9DC00ADF313 /* DocumentWriter.h in Headers */,
@@ -17984,6 +18016,7 @@
A8136D380973A8E700D74463 /* FormDataList.h in Headers */,
514C764E0CE9234E007EF3CD /* FormDataStreamMac.h in Headers */,
656D373A0ADBA5DE00A4554D /* FormState.h in Headers */,
+ 41885B9311B6FDA6003383BB /* FormSubmission.h in Headers */,
935C476D09AC4D6300A6AAB4 /* FoundationExtras.h in Headers */,
65BF022F0974816300C43196 /* Frame.h in Headers */,
656D373C0ADBA5DE00A4554D /* FrameLoader.h in Headers */,
@@ -18027,13 +18060,14 @@
930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */,
9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */,
BC3BC29C0E91AB0F00835588 /* HostWindow.h in Headers */,
- 976E896111C0CA3A00EA9CA9 /* HTML5EntityParser.h in Headers */,
- 97E8B35711A23CE200169409 /* HTML5Lexer.h in Headers */,
- A83B3AF111ADEFF500458809 /* HTML5ScriptRunner.h in Headers */,
- A87F163511AE841300CBB2E5 /* HTML5ScriptRunnerHost.h in Headers */,
- 97E8B3C311A2890800169409 /* HTML5Token.h in Headers */,
- A871038B11A2947000DBD50E /* HTML5DocumentParser.h in Headers */,
- A879C62611A9D1F70059237A /* HTML5TreeBuilder.h in Headers */,
+ A871038B11A2947000DBD50E /* HTMLDocumentParser.h in Headers */,
+ 976E896111C0CA3A00EA9CA9 /* HTMLEntityParser.h in Headers */,
+ 97E8B35711A23CE200169409 /* HTMLTokenizer.h in Headers */,
+ 97E7936611C6030900E649BC /* HTMLPreloadScanner.h in Headers */,
+ A83B3AF111ADEFF500458809 /* HTMLScriptRunner.h in Headers */,
+ A87F163511AE841300CBB2E5 /* HTMLScriptRunnerHost.h in Headers */,
+ 97E8B3C311A2890800169409 /* HTMLToken.h in Headers */,
+ A879C62611A9D1F70059237A /* HTMLTreeBuilder.h in Headers */,
BC97E23A109144950010D361 /* HTMLAllCollection.h in Headers */,
A8CFF7AB0A156978000A4234 /* HTMLAnchorElement.h in Headers */,
A871D45D0A127CBC00B12A68 /* HTMLAppletElement.h in Headers */,
@@ -18056,6 +18090,7 @@
A8EA7CB70A192B9C00A8EF5F /* HTMLDivElement.h in Headers */,
A8EA79F70A1916DF00A8EF5F /* HTMLDListElement.h in Headers */,
93F198E508245E59001E9ABC /* HTMLDocument.h in Headers */,
+ 93F198F008245E59001E9ABC /* LegacyHTMLDocumentParser.h in Headers */,
93309DE8099E64920056E581 /* htmlediting.h in Headers */,
93F198E608245E59001E9ABC /* HTMLElement.h in Headers */,
A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */,
@@ -18100,7 +18135,6 @@
A81369DA097374F600D74463 /* HTMLOptionsCollection.h in Headers */,
A8EA7CB50A192B9C00A8EF5F /* HTMLParagraphElement.h in Headers */,
A871D4580A127CBC00B12A68 /* HTMLParamElement.h in Headers */,
- 93F198EF08245E59001E9ABC /* LegacyHTMLTreeConstructor.h in Headers */,
BC588AF00BFA6CF900EE679E /* HTMLParserErrorCodes.h in Headers */,
449B19F50FA72ECE0015CA4A /* HTMLParserQuirks.h in Headers */,
A871D4560A127CBC00B12A68 /* HTMLPlugInElement.h in Headers */,
@@ -18122,12 +18156,12 @@
A871DB250A150BD600B12A68 /* HTMLTableSectionElement.h in Headers */,
A81369D6097374F600D74463 /* HTMLTextAreaElement.h in Headers */,
A871DC280A15205700B12A68 /* HTMLTitleElement.h in Headers */,
- 93F198F008245E59001E9ABC /* HTMLDocumentParser.h in Headers */,
A8EA79F20A1916DF00A8EF5F /* HTMLUListElement.h in Headers */,
E44613AB0CD6331000FADA75 /* HTMLVideoElement.h in Headers */,
BCCD74DC0A4C8D35005FDA6D /* HTMLViewSourceDocument.h in Headers */,
514C76710CE923A1007EF3CD /* HTTPHeaderMap.h in Headers */,
514C76730CE923A1007EF3CD /* HTTPParsers.h in Headers */,
+ 375CD232119D43C800A2A859 /* Hyphenation.h in Headers */,
B275356E0B053814002CE64F /* Icon.h in Headers */,
5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */,
51E1ECBE0C91C90400DC255B /* IconDatabaseClient.h in Headers */,
@@ -18143,10 +18177,17 @@
C56C9160119D84E600DE4CD9 /* IDBErrorEvent.h in Headers */,
C56C9163119D84E600DE4CD9 /* IDBEvent.h in Headers */,
C51DA9A511AEF2C1009799C5 /* IDBIndex.h in Headers */,
+ C51DA9A511AEF2C1009799C5 /* IDBIndex.h in Headers */,
+ C51DA9A711AEF2C1009799C5 /* IDBIndexImpl.h in Headers */,
C51DA9A711AEF2C1009799C5 /* IDBIndexImpl.h in Headers */,
C51DA9A911AEF2C1009799C5 /* IDBIndexRequest.h in Headers */,
+ C51DA9A911AEF2C1009799C5 /* IDBIndexRequest.h in Headers */,
+ 816C806911BE887E009A45E9 /* IDBKeyRange.h in Headers */,
+ B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */,
B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */,
B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
+ B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
+ B6693EEE11AD63E6003F2770 /* IDBObjectStoreRequest.h in Headers */,
B6693EEE11AD63E6003F2770 /* IDBObjectStoreRequest.h in Headers */,
C5198F571192ECFD002B74A6 /* IDBRequest.h in Headers */,
C56C9169119D84FF00DE4CD9 /* IDBSuccessEvent.h in Headers */,
@@ -18218,7 +18259,6 @@
93309DF4099E64920056E581 /* JoinTextNodesCommand.h in Headers */,
418F88050FF957AF0080F045 /* JSAbstractWorker.h in Headers */,
49EECF01105070C400099FAB /* JSArrayBuffer.h in Headers */,
- 49EECFAC1050938200099FAB /* JSArrayBufferConstructor.h in Headers */,
49EECF1C105072F300099FAB /* JSArrayBufferView.h in Headers */,
86243D0111BC31F700CC006A /* JSArrayBufferViewHelper.h in Headers */,
65DF31DB09D1C123000BE325 /* JSAttr.h in Headers */,
@@ -18226,6 +18266,7 @@
BC124F000C26447A009E2349 /* JSBarInfo.h in Headers */,
BC946348107A936600857193 /* JSBeforeLoadEvent.h in Headers */,
2E2D99CE10E2BBDA00496337 /* JSBlob.h in Headers */,
+ 89CD029411C85B870070B791 /* JSBlobBuilder.h in Headers */,
1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
65DF323C09D1DE65000BE325 /* JSCanvasPattern.h in Headers */,
@@ -18294,7 +18335,6 @@
BC60D9C00D2A269A00B9918F /* JSEventException.h in Headers */,
93B70D6A09EB0C7C009D8468 /* JSEventListener.h in Headers */,
E0FEF372B37C53EAC1C1FBEE /* JSEventSource.h in Headers */,
- E0FEF372B67C53EAC1C1FBEE /* JSEventSourceConstructor.h in Headers */,
BC60901F0E91B8EC000C68B5 /* JSEventTarget.h in Headers */,
3314ACEC10892086000F0E56 /* JSExceptionBase.h in Headers */,
BC00F0150E0A189500FD04E3 /* JSFile.h in Headers */,
@@ -18302,7 +18342,6 @@
BC00F0170E0A189500FD04E3 /* JSFileList.h in Headers */,
2E94F43C119207DA00B7F75D /* JSFileReader.h in Headers */,
49EECF03105070C400099FAB /* JSFloat32Array.h in Headers */,
- 49EECFB01050938200099FAB /* JSFloat32ArrayConstructor.h in Headers */,
FE80DA640E9C4703000D6F75 /* JSGeolocation.h in Headers */,
FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */,
BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */,
@@ -18387,6 +18426,9 @@
C56C91A1119D918100DE4CD9 /* JSIDBErrorEvent.h in Headers */,
C56C91A3119D918100DE4CD9 /* JSIDBEvent.h in Headers */,
C5BBC9D111AEF838007C2BFE /* JSIDBIndexRequest.h in Headers */,
+ C5BBC9D111AEF838007C2BFE /* JSIDBIndexRequest.h in Headers */,
+ 816C80AF11BE990D009A45E9 /* JSIDBKeyRange.h in Headers */,
+ B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */,
B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */,
C5F4F40D119306AC00FDFADD /* JSIDBRequest.h in Headers */,
C56C91A7119D918700DE4CD9 /* JSIDBSuccessEvent.h in Headers */,
@@ -18397,11 +18439,8 @@
41F060CE0F5EEB2B00A07EAC /* JSInspectorBackend.h in Headers */,
7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */,
49EECF07105070C400099FAB /* JSInt16Array.h in Headers */,
- 49EECFB61050938200099FAB /* JSInt16ArrayConstructor.h in Headers */,
49EECF05105070C400099FAB /* JSInt32Array.h in Headers */,
- 49EECFB21050938200099FAB /* JSInt32ArrayConstructor.h in Headers */,
49C7B9961042D2D30009D447 /* JSInt8Array.h in Headers */,
- 49EECFAE1050938200099FAB /* JSInt8ArrayConstructor.h in Headers */,
1C5FAED20DCFD90100D58F78 /* JSJavaScriptCallFrame.h in Headers */,
A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */,
935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */,
@@ -18410,7 +18449,6 @@
BC3C39B70C0D3D8D005F4D7A /* JSMediaList.h in Headers */,
9FFE3EA611B5A4390037874E /* JSMemoryInfo.h in Headers */,
E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */,
- E10743270E7835A50033AF24 /* JSMessageChannelConstructor.h in Headers */,
75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */,
E1ADEDDA0E76BD93004A1A5E /* JSMessagePort.h in Headers */,
41F584C7104652CB009CAA64 /* JSMessagePortCustom.h in Headers */,
@@ -18446,7 +18484,6 @@
9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */,
9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */,
41D07A7F0FF935CA0095EDCE /* JSSharedWorker.h in Headers */,
- 415B7C630FF5A767006770F7 /* JSSharedWorkerConstructor.h in Headers */,
41D1690610238B66009BC827 /* JSSharedWorkerContext.h in Headers */,
BC8243290D0CE8A200460C8F /* JSSQLError.h in Headers */,
1AE82FED0CAB07EE002237AE /* JSSQLResultSet.h in Headers */,
@@ -18607,11 +18644,8 @@
1A750D5D0A90DEE1000FF215 /* JSTreeWalker.h in Headers */,
A86629CF09DA2B47009633A5 /* JSUIEvent.h in Headers */,
49EECF0D105070C400099FAB /* JSUint16Array.h in Headers */,
- 49EECFBC1050938200099FAB /* JSUint16ArrayConstructor.h in Headers */,
49EECF0B105070C400099FAB /* JSUint32Array.h in Headers */,
- 49EECFBA1050938200099FAB /* JSUint32ArrayConstructor.h in Headers */,
49EECF09105070C400099FAB /* JSUint8Array.h in Headers */,
- 49EECFB81050938200099FAB /* JSUint8ArrayConstructor.h in Headers */,
15C77093100D3CA8005BA267 /* JSValidityState.h in Headers */,
A7D20F63107F406900A80392 /* JSWebGLActiveInfo.h in Headers */,
49C7B9941042D2D30009D447 /* JSWebGLBuffer.h in Headers */,
@@ -18627,16 +18661,12 @@
316FE0720E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.h in Headers */,
316FE0740E6CCBEE00BF6088 /* JSWebKitCSSKeyframesRule.h in Headers */,
498391400F1E767500C23782 /* JSWebKitCSSMatrix.h in Headers */,
- 498391640F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.h in Headers */,
31611E5B0E1C4DE000F6A579 /* JSWebKitCSSTransformValue.h in Headers */,
494BD79E0F55C94C00747828 /* JSWebKitPoint.h in Headers */,
- 494BD79A0F55C90E00747828 /* JSWebKitPointConstructor.h in Headers */,
31C0FF400E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.h in Headers */,
5DA5E0FD102B953800088CF9 /* JSWebSocket.h in Headers */,
- 518A34C81026C8C9001B6896 /* JSWebSocketConstructor.h in Headers */,
65DF320609D1CC60000BE325 /* JSWheelEvent.h in Headers */,
E1CAA5C60E8BD23600A73ECA /* JSWorker.h in Headers */,
- E1CA5CD30E8CDE8000E8EF90 /* JSWorkerConstructor.h in Headers */,
E18256900EF2B02D00933242 /* JSWorkerContext.h in Headers */,
E1C36D350EB0A094007410BC /* JSWorkerContextBase.h in Headers */,
F3D461491161D53200CA0D09 /* JSWorkerContextErrorHandler.h in Headers */,
@@ -18653,7 +18683,6 @@
1A762C780A074F2600989F5B /* JSXPathNSResolver.h in Headers */,
1A762C7A0A074F2600989F5B /* JSXPathResult.h in Headers */,
BCEFE1EB0DCA5F6400739219 /* JSXSLTProcessor.h in Headers */,
- BCE99EC40DCA624100182683 /* JSXSLTProcessorConstructor.h in Headers */,
85031B440A44EFC700F992E0 /* KeyboardEvent.h in Headers */,
A513B3D7114B1666001C429B /* KeyEventCocoa.h in Headers */,
A59E3C1E11580F510072928E /* KeyEventCodesIPhone.h in Headers */,
@@ -18665,6 +18694,7 @@
A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
85EC9AFB0A71A2C600EEEAED /* Language.h in Headers */,
2D9066070BE141D400956998 /* LayoutState.h in Headers */,
+ 93F198EF08245E59001E9ABC /* LegacyHTMLTreeBuilder.h in Headers */,
512DD8F50D91E6AF000F89EE /* LegacyWebArchive.h in Headers */,
BCE65BEB0EACDF16007E4533 /* Length.h in Headers */,
BCFF64910EAD15C200C1D6F7 /* LengthBox.h in Headers */,
@@ -18809,7 +18839,7 @@
FE80D7CF0E9C1F25000D6F75 /* PositionErrorCallback.h in Headers */,
37919C240B7D188600A56998 /* PositionIterator.h in Headers */,
FE80D7D10E9C1F25000D6F75 /* PositionOptions.h in Headers */,
- E49626C30D80D94900E3405C /* PreloadScanner.h in Headers */,
+ E49626C30D80D94900E3405C /* LegacyPreloadScanner.h in Headers */,
B71FE6DF11091CB300DAEF77 /* PrintContext.h in Headers */,
A8EA7EBC0A1945D000A8EF5F /* ProcessingInstruction.h in Headers */,
E44613EC0CD681B500FADA75 /* ProgressEvent.h in Headers */,
@@ -18851,6 +18881,7 @@
0FD308D6117D168500A791F7 /* RenderIFrame.h in Headers */,
BCEA4876097D93020094C9E4 /* RenderImage.h in Headers */,
BCB4F8900DB28DD60039139B /* RenderImageGeneratedContent.h in Headers */,
+ A7AA66D711C5ED6A001D8C8C /* RenderIndicator.h in Headers */,
BCEA4878097D93020094C9E4 /* RenderInline.h in Headers */,
BCEA487A097D93020094C9E4 /* RenderLayer.h in Headers */,
0F580CFF0F12DE9B0051D689 /* RenderLayerBacking.h in Headers */,
@@ -19264,6 +19295,7 @@
083F529A11957FBE00653EBE /* SVGTextLayoutUtilities.h in Headers */,
B2227ACE0D00BF220071B782 /* SVGTextPathElement.h in Headers */,
B2227AD10D00BF220071B782 /* SVGTextPositioningElement.h in Headers */,
+ 0853D73411C9109000B2FD42 /* SVGTextQuery.h in Headers */,
B2227AD40D00BF220071B782 /* SVGTitleElement.h in Headers */,
B2227AD70D00BF220071B782 /* SVGTransform.h in Headers */,
B2227ADA0D00BF220071B782 /* SVGTransformable.h in Headers */,
@@ -19321,7 +19353,6 @@
9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
E44613B00CD6331000FADA75 /* TimeRanges.h in Headers */,
49E912AE0EFAC906009D0CAF /* TimingFunction.h in Headers */,
- BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */,
49E911C40EF86D47009D0CAF /* TransformationMatrix.h in Headers */,
49E911CE0EF86D47009D0CAF /* TransformOperation.h in Headers */,
49E911D00EF86D47009D0CAF /* TransformOperations.h in Headers */,
@@ -19375,6 +19406,7 @@
6E4E91AF10F7FB3100A2779C /* WebGLContextAttributes.h in Headers */,
49C7B9CF1042D32F0009D447 /* WebGLFramebuffer.h in Headers */,
6E47E66110B7944B00B186C8 /* WebGLGetInfo.h in Headers */,
+ 49FFBF3F11C93EE3006A7118 /* WebGLLayer.h in Headers */,
49C7B9D71042D32F0009D447 /* WebGLProgram.h in Headers */,
49C7B9DA1042D32F0009D447 /* WebGLRenderbuffer.h in Headers */,
49C7B9E01042D32F0009D447 /* WebGLRenderingContext.h in Headers */,
@@ -19397,6 +19429,7 @@
510D4A50103177A20049EA54 /* WebSocketChannelClient.h in Headers */,
51ABAE451043AB4A008C5260 /* WebSocketHandshake.h in Headers */,
7637C543112E7B7E003D6CDC /* WebSocketHandshakeRequest.h in Headers */,
+ 767F99C011A119560080C51D /* WebSocketHandshakeResponse.h in Headers */,
0FCF332D0F2B9A25004B6795 /* WebTiledLayer.h in Headers */,
85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
9380F47409A11AB4001FDB34 /* Widget.h in Headers */,
@@ -19459,6 +19492,8 @@
5112247A10CFB8FF008099D7 /* WorkerThreadableWebSocketChannel.h in Headers */,
93309E24099E64920056E581 /* WrapContentsInDummySpanCommand.h in Headers */,
6565820209D1508D000E61D7 /* XLinkNames.h in Headers */,
+ 93F1992108245E59001E9ABC /* XMLDocumentParser.h in Headers */,
+ 5D15E3AC0F9E6AC1009E0E3F /* XMLDocumentParserScope.h in Headers */,
BC772C470C4EB2C60083285F /* XMLHttpRequest.h in Headers */,
BC60D9C90D2A29E500B9918F /* XMLHttpRequestException.h in Headers */,
F9F0ED7A0DB50CA200D16DB9 /* XMLHttpRequestProgressEvent.h in Headers */,
@@ -19467,8 +19502,6 @@
A833C80D0A2CF25600D57664 /* XMLNames.h in Headers */,
E15A36D71104572000B7B639 /* XMLNSNames.h in Headers */,
1ACE53EB0A8D18E70022947D /* XMLSerializer.h in Headers */,
- 93F1992108245E59001E9ABC /* XMLDocumentParser.h in Headers */,
- 5D15E3AC0F9E6AC1009E0E3F /* XMLDocumentParserScope.h in Headers */,
1AB7FC690A8B92EC00D9D37B /* XPathEvaluator.h in Headers */,
BC60DA5B0D2A31F700B9918F /* XPathException.h in Headers */,
1AB7FC6C0A8B92EC00D9D37B /* XPathExpression.h in Headers */,
@@ -19493,16 +19526,17 @@
E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */,
97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
- B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */,
- B6693EEE11AD63E6003F2770 /* IDBObjectStoreRequest.h in Headers */,
- B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */,
- C51DA9A511AEF2C1009799C5 /* IDBIndex.h in Headers */,
- C51DA9A711AEF2C1009799C5 /* IDBIndexImpl.h in Headers */,
- C51DA9A911AEF2C1009799C5 /* IDBIndexRequest.h in Headers */,
- C5BBC9D111AEF838007C2BFE /* JSIDBIndexRequest.h in Headers */,
- B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
- 816C806911BE887E009A45E9 /* IDBKeyRange.h in Headers */,
- 816C80AF11BE990D009A45E9 /* JSIDBKeyRange.h in Headers */,
+ D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */,
+ D000ED2811C1B9CD00C47726 /* SubframeLoader.h in Headers */,
+ 1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */,
+ 1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */,
+ B56EBA8511C9FF8100B04477 /* SQLException.h in Headers */,
+ B525A96511CA2340003A23A8 /* JSSQLException.h in Headers */,
+ 9719AF0011D09F2C00D45831 /* HTMLInputStream.h in Headers */,
+ A853123D11D0471B00D4D077 /* FragmentScriptingPermission.h in Headers */,
+ A8E6A78111D1661B00311F4A /* HTMLParserScheduler.h in Headers */,
+ A84D827C11D333ED00972990 /* RawDataDocumentParser.h in Headers */,
+ CEA3949D11D45CDA003094CF /* StaticHashSetNodeList.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -19818,6 +19852,7 @@
BC5EB91F0E82040800B25965 /* BindingURI.cpp in Sources */,
A89943290B42338800D7C802 /* BitmapImage.cpp in Sources */,
2EAFAF0E10E2AF2D007ED3D6 /* Blob.cpp in Sources */,
+ 89BED5EB11BE11CE00448492 /* BlobBuilder.cpp in Sources */,
8988E10E11A3508B00DB732E /* BlobItem.cpp in Sources */,
93F19AE108245E59001E9ABC /* BlockExceptions.mm in Sources */,
BCEA4854097D93020094C9E4 /* break_lines.cpp in Sources */,
@@ -19839,7 +19874,6 @@
BCB16C230979C3BD00467741 /* CachedScript.cpp in Sources */,
BCB16C250979C3BD00467741 /* CachedXBLDocument.cpp in Sources */,
BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */,
- 49C7BA011042D38C0009D447 /* Canvas3DLayer.mm in Sources */,
6E4E91AC10F7FB3100A2779C /* CanvasContextAttributes.cpp in Sources */,
49484FC1102CF23C00187DD3 /* CanvasGradient.cpp in Sources */,
49C7B9D41042D32F0009D447 /* CanvasObject.cpp in Sources */,
@@ -19921,6 +19955,7 @@
A80E6CF50A1989CA007FB8C5 /* CSSPageRule.cpp in Sources */,
BC772B3D0C4EA91E0083285F /* CSSParser.cpp in Sources */,
BC02A5400E099C5A004B6D2B /* CSSParserValues.cpp in Sources */,
+ 976E2BA711CAE4DE006C56A0 /* CSSPreloadScanner.cpp in Sources */,
A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,
A80E6CF70A1989CA007FB8C5 /* CSSProperty.cpp in Sources */,
0F6ECD460F252F3700BDE271 /* CSSPropertyLonghand.cpp in Sources */,
@@ -20337,6 +20372,7 @@
A8136D390973A8E700D74463 /* FormDataList.cpp in Sources */,
514C764F0CE9234E007EF3CD /* FormDataStreamMac.mm in Sources */,
656D373B0ADBA5DE00A4554D /* FormState.cpp in Sources */,
+ 41885B9411B6FDA6003383BB /* FormSubmission.cpp in Sources */,
65BF022E0974816300C43196 /* Frame.cpp in Sources */,
932E16090AF578340025F408 /* FrameLoader.cpp in Sources */,
65BF02450974819000C43196 /* FrameMac.mm in Sources */,
@@ -20356,7 +20392,7 @@
B2A015A80AF6CD53006BCE0E /* GraphicsContext.cpp in Sources */,
6E21C6C01126338500A7BE02 /* GraphicsContext3D.cpp in Sources */,
6E21C6C21126339900A7BE02 /* GraphicsContext3DCG.cpp in Sources */,
- 49C7BA021042D38C0009D447 /* GraphicsContext3DMac.cpp in Sources */,
+ 49FFBF1D11C8550E006A7118 /* GraphicsContext3DMac.mm in Sources */,
B2ED97710B1F55CE00257D0F /* GraphicsContextCG.cpp in Sources */,
B277B4040B22F37C0004BEC6 /* GraphicsContextMac.mm in Sources */,
0F580B0C0F12A2690051D689 /* GraphicsLayer.cpp in Sources */,
@@ -20368,11 +20404,12 @@
5160F4980B0AA75F00C1D2AF /* HistoryItemMac.mm in Sources */,
9363B62C0F8E8FE000803810 /* HistoryPropertyList.cpp in Sources */,
9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */,
- 976E896011C0CA3A00EA9CA9 /* HTML5EntityParser.cpp in Sources */,
- 97E8B35611A23CE200169409 /* HTML5Lexer.cpp in Sources */,
- A83B3AF011ADEFF500458809 /* HTML5ScriptRunner.cpp in Sources */,
- A871038A11A2947000DBD50E /* HTML5DocumentParser.cpp in Sources */,
- A879C62511A9D1F70059237A /* HTML5TreeBuilder.cpp in Sources */,
+ A871038A11A2947000DBD50E /* HTMLDocumentParser.cpp in Sources */,
+ 976E896011C0CA3A00EA9CA9 /* HTMLEntityParser.cpp in Sources */,
+ 97E8B35611A23CE200169409 /* HTMLTokenizer.cpp in Sources */,
+ 97E7936511C6030900E649BC /* HTMLPreloadScanner.cpp in Sources */,
+ A83B3AF011ADEFF500458809 /* HTMLScriptRunner.cpp in Sources */,
+ A879C62511A9D1F70059237A /* HTMLTreeBuilder.cpp in Sources */,
BC97E23B109144950010D361 /* HTMLAllCollection.cpp in Sources */,
A8CFF7A40A156978000A4234 /* HTMLAnchorElement.cpp in Sources */,
A871D45E0A127CBC00B12A68 /* HTMLAppletElement.cpp in Sources */,
@@ -20395,6 +20432,7 @@
A8EA7CB10A192B9C00A8EF5F /* HTMLDivElement.cpp in Sources */,
A8EA79F50A1916DF00A8EF5F /* HTMLDListElement.cpp in Sources */,
93F19A9108245E59001E9ABC /* HTMLDocument.cpp in Sources */,
+ 93F19A9C08245E59001E9ABC /* LegacyHTMLDocumentParser.cpp in Sources */,
93309DE7099E64920056E581 /* htmlediting.cpp in Sources */,
93F19A9208245E59001E9ABC /* HTMLElement.cpp in Sources */,
A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */,
@@ -20440,7 +20478,6 @@
9327A94209968D1A0068A546 /* HTMLOptionsCollection.cpp in Sources */,
A8EA7CB20A192B9C00A8EF5F /* HTMLParagraphElement.cpp in Sources */,
A871D4590A127CBC00B12A68 /* HTMLParamElement.cpp in Sources */,
- 93F19A9B08245E59001E9ABC /* LegacyHTMLTreeConstructor.cpp in Sources */,
BC588B4B0BFA723C00EE679E /* HTMLParserErrorCodes.cpp in Sources */,
A871D4570A127CBC00B12A68 /* HTMLPlugInElement.cpp in Sources */,
4415292F0E1AE8A000C4A2D0 /* HTMLPlugInImageElement.cpp in Sources */,
@@ -20461,12 +20498,13 @@
A871DB260A150BD600B12A68 /* HTMLTableSectionElement.cpp in Sources */,
A81369D7097374F600D74463 /* HTMLTextAreaElement.cpp in Sources */,
A871DC290A15205700B12A68 /* HTMLTitleElement.cpp in Sources */,
- 93F19A9C08245E59001E9ABC /* HTMLDocumentParser.cpp in Sources */,
A8EA79F30A1916DF00A8EF5F /* HTMLUListElement.cpp in Sources */,
E44613AA0CD6331000FADA75 /* HTMLVideoElement.cpp in Sources */,
BCCD74E50A4C8DDF005FDA6D /* HTMLViewSourceDocument.cpp in Sources */,
0B8C56D40F28627F000502E1 /* HTTPHeaderMap.cpp in Sources */,
514C76720CE923A1007EF3CD /* HTTPParsers.cpp in Sources */,
+ 371A67CB11C6C7DB00047B8B /* HyphenationCF.cpp in Sources */,
+ 375CD23B119D44EA00A2A859 /* HyphenationMac.mm in Sources */,
5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */,
445C8DB710015FC90031531A /* IconDatabaseNone.cpp in Sources */,
1A2D753E0DE47FAB00F0A648 /* IconFetcher.cpp in Sources */,
@@ -20475,13 +20513,19 @@
51E1ECC00C91C90400DC255B /* IconRecord.cpp in Sources */,
C56C9152119D84CB00DE4CD9 /* IDBAny.cpp in Sources */,
B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */,
+ B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */,
C5198F531192ECFD002B74A6 /* IDBDatabaseRequest.cpp in Sources */,
C56C915F119D84E600DE4CD9 /* IDBErrorEvent.cpp in Sources */,
C56C9162119D84E600DE4CD9 /* IDBEvent.cpp in Sources */,
C51DA9A611AEF2C1009799C5 /* IDBIndexImpl.cpp in Sources */,
+ C51DA9A611AEF2C1009799C5 /* IDBIndexImpl.cpp in Sources */,
C51DA9A811AEF2C1009799C5 /* IDBIndexRequest.cpp in Sources */,
+ C51DA9A811AEF2C1009799C5 /* IDBIndexRequest.cpp in Sources */,
+ 816C806811BE887E009A45E9 /* IDBKeyRange.cpp in Sources */,
+ B6B0540911B68F10002564C5 /* IDBObjectStoreImpl.cpp in Sources */,
B6B0540911B68F10002564C5 /* IDBObjectStoreImpl.cpp in Sources */,
B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */,
+ B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */,
C5198F561192ECFD002B74A6 /* IDBRequest.cpp in Sources */,
C56C9168119D84FF00DE4CD9 /* IDBSuccessEvent.cpp in Sources */,
1A71D57B0F33819000F9CE4E /* IdentifierRep.cpp in Sources */,
@@ -20547,7 +20591,7 @@
93309DF3099E64920056E581 /* JoinTextNodesCommand.cpp in Sources */,
418F88040FF957AE0080F045 /* JSAbstractWorker.cpp in Sources */,
49EECF00105070C400099FAB /* JSArrayBuffer.cpp in Sources */,
- 49EECFAB1050938200099FAB /* JSArrayBufferConstructor.cpp in Sources */,
+ BC275CB311C5E85C00C9206C /* JSArrayBufferCustom.cpp in Sources */,
49EECF1B105072F300099FAB /* JSArrayBufferView.cpp in Sources */,
492273A31083B3B100EE5C84 /* JSArrayBufferViewCustom.cpp in Sources */,
65DF31DA09D1C123000BE325 /* JSAttr.cpp in Sources */,
@@ -20556,6 +20600,7 @@
BC124EFF0C26447A009E2349 /* JSBarInfo.cpp in Sources */,
BC946346107A934B00857193 /* JSBeforeLoadEvent.cpp in Sources */,
2E2D99CD10E2BBDA00496337 /* JSBlob.cpp in Sources */,
+ 89CD029311C85B870070B791 /* JSBlobBuilder.cpp in Sources */,
1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */,
65DF323909D1DE65000BE325 /* JSCanvasGradient.cpp in Sources */,
65DF323B09D1DE65000BE325 /* JSCanvasPattern.cpp in Sources */,
@@ -20646,7 +20691,7 @@
BC60D9BF0D2A269A00B9918F /* JSEventException.cpp in Sources */,
93B70D6909EB0C7C009D8468 /* JSEventListener.cpp in Sources */,
E0FEF372B47C53EAC1C1FBEE /* JSEventSource.cpp in Sources */,
- E0FEF372B77C53EAC1C1FBEE /* JSEventSourceConstructor.cpp in Sources */,
+ BC275B8111C5D2B400C9206C /* JSEventSourceCustom.cpp in Sources */,
BC6090200E91B8EC000C68B5 /* JSEventTarget.cpp in Sources */,
3314ACEB10892086000F0E56 /* JSExceptionBase.cpp in Sources */,
BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
@@ -20654,7 +20699,6 @@
BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
2E94F43B119207DA00B7F75D /* JSFileReader.cpp in Sources */,
49EECF02105070C400099FAB /* JSFloat32Array.cpp in Sources */,
- 49EECFAF1050938200099FAB /* JSFloat32ArrayConstructor.cpp in Sources */,
49EECF7910508D9C00099FAB /* JSFloat32ArrayCustom.cpp in Sources */,
FE80DA630E9C4703000D6F75 /* JSGeolocation.cpp in Sources */,
FE80D7AB0E9C1ED2000D6F75 /* JSGeolocationCustom.cpp in Sources */,
@@ -20758,6 +20802,9 @@
C56C91A0119D918100DE4CD9 /* JSIDBErrorEvent.cpp in Sources */,
C56C91A2119D918100DE4CD9 /* JSIDBEvent.cpp in Sources */,
C5BBC9D011AEF838007C2BFE /* JSIDBIndexRequest.cpp in Sources */,
+ C5BBC9D011AEF838007C2BFE /* JSIDBIndexRequest.cpp in Sources */,
+ 816C80B111BE9934009A45E9 /* JSIDBKeyRange.cpp in Sources */,
+ B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */,
B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */,
C5F4F40C119306AC00FDFADD /* JSIDBRequest.cpp in Sources */,
C56C91A6119D918700DE4CD9 /* JSIDBSuccessEvent.cpp in Sources */,
@@ -20771,13 +20818,10 @@
7A0E771E10C00DB100A0276E /* JSInspectorFrontendHost.cpp in Sources */,
7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */,
49EECF06105070C400099FAB /* JSInt16Array.cpp in Sources */,
- 49EECFB51050938200099FAB /* JSInt16ArrayConstructor.cpp in Sources */,
49EECF7B10508D9C00099FAB /* JSInt16ArrayCustom.cpp in Sources */,
49EECF04105070C400099FAB /* JSInt32Array.cpp in Sources */,
- 49EECFB11050938200099FAB /* JSInt32ArrayConstructor.cpp in Sources */,
49EECF7A10508D9C00099FAB /* JSInt32ArrayCustom.cpp in Sources */,
49C7B9951042D2D30009D447 /* JSInt8Array.cpp in Sources */,
- 49EECFAD1050938200099FAB /* JSInt8ArrayConstructor.cpp in Sources */,
49EECF7810508D9C00099FAB /* JSInt8ArrayCustom.cpp in Sources */,
1C5FAED10DCFD90100D58F78 /* JSJavaScriptCallFrame.cpp in Sources */,
1C5FAEE70DCFDA6800D58F78 /* JSJavaScriptCallFrameCustom.cpp in Sources */,
@@ -20790,7 +20834,6 @@
BC3C39B60C0D3D8D005F4D7A /* JSMediaList.cpp in Sources */,
9FFE3EA511B5A4390037874E /* JSMemoryInfo.cpp in Sources */,
E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */,
- E10743240E7835830033AF24 /* JSMessageChannelConstructor.cpp in Sources */,
E1A5F99B0E7EAA2500AF85EA /* JSMessageChannelCustom.cpp in Sources */,
75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */,
410B7E721045FAB000D8224F /* JSMessageEventCustom.cpp in Sources */,
@@ -20839,7 +20882,6 @@
9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */,
9FA37EE71172FCF000C4CD55 /* JSScriptProfileNodeCustom.cpp in Sources */,
41D07A7E0FF935CA0095EDCE /* JSSharedWorker.cpp in Sources */,
- 415B7C580FF598E6006770F7 /* JSSharedWorkerConstructor.cpp in Sources */,
41D1690510238B66009BC827 /* JSSharedWorkerContext.cpp in Sources */,
14CD8D82106B529000A46D23 /* JSSharedWorkerCustom.cpp in Sources */,
514C76370CE9225E007EF3CD /* JSSQLError.cpp in Sources */,
@@ -21012,13 +21054,10 @@
516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */,
A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */,
49EECF0C105070C400099FAB /* JSUint16Array.cpp in Sources */,
- 49EECFBB1050938200099FAB /* JSUint16ArrayConstructor.cpp in Sources */,
49EECF7E10508D9C00099FAB /* JSUint16ArrayCustom.cpp in Sources */,
49EECF0A105070C400099FAB /* JSUint32Array.cpp in Sources */,
- 49EECFB91050938200099FAB /* JSUint32ArrayConstructor.cpp in Sources */,
49EECF7D10508D9C00099FAB /* JSUint32ArrayCustom.cpp in Sources */,
49EECF08105070C400099FAB /* JSUint8Array.cpp in Sources */,
- 49EECFB71050938200099FAB /* JSUint8ArrayConstructor.cpp in Sources */,
49EECF7C10508D9C00099FAB /* JSUint8ArrayCustom.cpp in Sources */,
15C77094100D3CA8005BA267 /* JSValidityState.cpp in Sources */,
A7D20F62107F406900A80392 /* JSWebGLActiveInfo.cpp in Sources */,
@@ -21036,17 +21075,15 @@
316FE0710E6CCBEE00BF6088 /* JSWebKitCSSKeyframeRule.cpp in Sources */,
316FE0730E6CCBEE00BF6088 /* JSWebKitCSSKeyframesRule.cpp in Sources */,
4983913F0F1E767500C23782 /* JSWebKitCSSMatrix.cpp in Sources */,
- 498391630F1E8EE100C23782 /* JSWebKitCSSMatrixConstructor.cpp in Sources */,
+ BC275B7D11C5D23500C9206C /* JSWebKitCSSMatrixCustom.cpp in Sources */,
31611E5A0E1C4DE000F6A579 /* JSWebKitCSSTransformValue.cpp in Sources */,
494BD79D0F55C94C00747828 /* JSWebKitPoint.cpp in Sources */,
- 494BD7990F55C90E00747828 /* JSWebKitPointConstructor.cpp in Sources */,
+ BC275B7911C5D1C300C9206C /* JSWebKitPointCustom.cpp in Sources */,
31C0FF3F0E4CEFAC007D6FE5 /* JSWebKitTransitionEvent.cpp in Sources */,
5DA5E0FC102B953800088CF9 /* JSWebSocket.cpp in Sources */,
- 518A34C71026C8C9001B6896 /* JSWebSocketConstructor.cpp in Sources */,
518A34C91026C8C9001B6896 /* JSWebSocketCustom.cpp in Sources */,
65DF320509D1CC60000BE325 /* JSWheelEvent.cpp in Sources */,
E1C8BE5D0E8BD15A0064CB7D /* JSWorker.cpp in Sources */,
- E1CA5CD60E8CDEE900E8EF90 /* JSWorkerConstructor.cpp in Sources */,
E182568F0EF2B02D00933242 /* JSWorkerContext.cpp in Sources */,
E1C36D340EB0A094007410BC /* JSWorkerContextBase.cpp in Sources */,
E18258AC0EF3CD7000933242 /* JSWorkerContextCustom.cpp in Sources */,
@@ -21067,7 +21104,6 @@
1A762C770A074F2600989F5B /* JSXPathNSResolver.cpp in Sources */,
1A762C790A074F2600989F5B /* JSXPathResult.cpp in Sources */,
BCEFE1EA0DCA5F6400739219 /* JSXSLTProcessor.cpp in Sources */,
- BCE99EC30DCA624100182683 /* JSXSLTProcessorConstructor.cpp in Sources */,
BCEFE1E50DCA5F3300739219 /* JSXSLTProcessorCustom.cpp in Sources */,
85031B430A44EFC700F992E0 /* KeyboardEvent.cpp in Sources */,
A513B3D8114B166A001C429B /* KeyEventCocoa.mm in Sources */,
@@ -21082,6 +21118,7 @@
A456FA2611AD4A830020B420 /* LabelsNodeList.cpp in Sources */,
9352084509BD43B900F2038D /* Language.mm in Sources */,
2D9066060BE141D400956998 /* LayoutState.cpp in Sources */,
+ 93F19A9B08245E59001E9ABC /* LegacyHTMLTreeBuilder.cpp in Sources */,
512DD8F40D91E6AF000F89EE /* LegacyWebArchive.cpp in Sources */,
51B2417B0D931F3F00E83F5C /* LegacyWebArchiveMac.mm in Sources */,
BCE65BEA0EACDF16007E4533 /* Length.cpp in Sources */,
@@ -21187,7 +21224,6 @@
A9C6E4EB0D745E2B006442E9 /* Plugin.cpp in Sources */,
A9C6E4EF0D745E38006442E9 /* PluginArray.cpp in Sources */,
A9C6E4F30D745E48006442E9 /* PluginData.cpp in Sources */,
- A9C6E4F60D745E61006442E9 /* PluginDataMac.mm in Sources */,
1AC694C70A3B1676003F5049 /* PluginDocument.cpp in Sources */,
7693BAD3106C2DCA007B0823 /* PluginHalter.cpp in Sources */,
1ADA14100E1AE5D900023EE5 /* PluginMainThreadScheduler.cpp in Sources */,
@@ -21200,7 +21236,7 @@
0668E1900ADD9640004128E0 /* PopupMenuMac.mm in Sources */,
93F19AF808245E59001E9ABC /* Position.cpp in Sources */,
37919C230B7D188600A56998 /* PositionIterator.cpp in Sources */,
- E49626C20D80D94800E3405C /* PreloadScanner.cpp in Sources */,
+ E49626C20D80D94800E3405C /* LegacyPreloadScanner.cpp in Sources */,
B776D43D1104527500BEB0EC /* PrintContext.cpp in Sources */,
A8EA7EBD0A1945D000A8EF5F /* ProcessingInstruction.cpp in Sources */,
E44613EB0CD681B400FADA75 /* ProgressEvent.cpp in Sources */,
@@ -21238,6 +21274,7 @@
0FD308D5117D168500A791F7 /* RenderIFrame.cpp in Sources */,
BCEA4875097D93020094C9E4 /* RenderImage.cpp in Sources */,
BCB4F8930DB28E530039139B /* RenderImageGeneratedContent.cpp in Sources */,
+ A7AA66D611C5ED6A001D8C8C /* RenderIndicator.cpp in Sources */,
BCEA4877097D93020094C9E4 /* RenderInline.cpp in Sources */,
BCEA4879097D93020094C9E4 /* RenderLayer.cpp in Sources */,
0F580D000F12DE9B0051D689 /* RenderLayerBacking.cpp in Sources */,
@@ -21613,11 +21650,13 @@
B2227ABD0D00BF220071B782 /* SVGSwitchElement.cpp in Sources */,
B2227AC00D00BF220071B782 /* SVGSymbolElement.cpp in Sources */,
B2227AC40D00BF220071B782 /* SVGTests.cpp in Sources */,
+ 0853D73211C9109000B2FD42 /* SVGTextChunkLayoutInfo.cpp in Sources */,
B2227AC70D00BF220071B782 /* SVGTextContentElement.cpp in Sources */,
B2227ACA0D00BF220071B782 /* SVGTextElement.cpp in Sources */,
083F529911957FBE00653EBE /* SVGTextLayoutUtilities.cpp in Sources */,
B2227ACD0D00BF220071B782 /* SVGTextPathElement.cpp in Sources */,
B2227AD00D00BF220071B782 /* SVGTextPositioningElement.cpp in Sources */,
+ 0853D73311C9109000B2FD42 /* SVGTextQuery.cpp in Sources */,
B2227AD30D00BF220071B782 /* SVGTitleElement.cpp in Sources */,
B2227AD60D00BF220071B782 /* SVGTransform.cpp in Sources */,
B2227AD90D00BF220071B782 /* SVGTransformable.cpp in Sources */,
@@ -21701,6 +21740,7 @@
6E4E91AE10F7FB3100A2779C /* WebGLContextAttributes.cpp in Sources */,
49C7B9CE1042D32F0009D447 /* WebGLFramebuffer.cpp in Sources */,
6E47E66010B7944B00B186C8 /* WebGLGetInfo.cpp in Sources */,
+ 49FFBF4011C93EE3006A7118 /* WebGLLayer.mm in Sources */,
49C7B9D61042D32F0009D447 /* WebGLProgram.cpp in Sources */,
49C7B9D91042D32F0009D447 /* WebGLRenderbuffer.cpp in Sources */,
49C7B9DF1042D32F0009D447 /* WebGLRenderingContext.cpp in Sources */,
@@ -21719,6 +21759,7 @@
510D4A4E103177A20049EA54 /* WebSocketChannel.cpp in Sources */,
51ABAE441043AB4A008C5260 /* WebSocketHandshake.cpp in Sources */,
7637C541112E7B74003D6CDC /* WebSocketHandshakeRequest.cpp in Sources */,
+ 767F99BE11A1194A0080C51D /* WebSocketHandshakeResponse.cpp in Sources */,
0FCF332C0F2B9A25004B6795 /* WebTiledLayer.mm in Sources */,
85031B500A44EFC700F992E0 /* WheelEvent.cpp in Sources */,
935C477309AC4D7700A6AAB4 /* WheelEventMac.mm in Sources */,
@@ -21777,15 +21818,15 @@
5112247810CFB8F4008099D7 /* WorkerThreadableWebSocketChannel.cpp in Sources */,
93309E23099E64920056E581 /* WrapContentsInDummySpanCommand.cpp in Sources */,
A833C7CC0A2CF07400D57664 /* XLinkNames.cpp in Sources */,
+ 93F19ABC08245E59001E9ABC /* XMLDocumentParser.cpp in Sources */,
+ 54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */,
+ 5D15E3AB0F9E6AC1009E0E3F /* XMLDocumentParserScope.cpp in Sources */,
BC772C460C4EB2C60083285F /* XMLHttpRequest.cpp in Sources */,
A136A00C1134DBD200CC8D50 /* XMLHttpRequestProgressEventThrottle.cpp in Sources */,
BCDFD48F0E305290009D10AD /* XMLHttpRequestUpload.cpp in Sources */,
A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */,
E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */,
1ACE53EA0A8D18E70022947D /* XMLSerializer.cpp in Sources */,
- 93F19ABC08245E59001E9ABC /* XMLDocumentParser.cpp in Sources */,
- 54C50F7B0E801DF3009832A0 /* XMLDocumentParserLibxml2.cpp in Sources */,
- 5D15E3AB0F9E6AC1009E0E3F /* XMLDocumentParserScope.cpp in Sources */,
1AB7FC680A8B92EC00D9D37B /* XPathEvaluator.cpp in Sources */,
1AB7FC6B0A8B92EC00D9D37B /* XPathExpression.cpp in Sources */,
1AB7FC6E0A8B92EC00D9D37B /* XPathExpressionNode.cpp in Sources */,
@@ -21809,15 +21850,13 @@
93F19B0508245E59001E9ABC /* XSLTProcessorLibxslt.cpp in Sources */,
E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
- B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */,
- B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */,
- B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */,
- C51DA9A611AEF2C1009799C5 /* IDBIndexImpl.cpp in Sources */,
- C51DA9A811AEF2C1009799C5 /* IDBIndexRequest.cpp in Sources */,
- C5BBC9D011AEF838007C2BFE /* JSIDBIndexRequest.cpp in Sources */,
- B6B0540911B68F10002564C5 /* IDBObjectStoreImpl.cpp in Sources */,
- 816C806811BE887E009A45E9 /* IDBKeyRange.cpp in Sources */,
- 816C80B111BE9934009A45E9 /* JSIDBKeyRange.cpp in Sources */,
+ D000EBA211BDAFD400C47726 /* FrameLoaderStateMachine.cpp in Sources */,
+ D000ED2711C1B9CD00C47726 /* SubframeLoader.cpp in Sources */,
+ 200B190911C277D900DCCD3A /* ScriptBreakpoint.cpp in Sources */,
+ 1AD8F81C11CAB9E900E93E54 /* PlatformStrategies.cpp in Sources */,
+ B525A96611CA2340003A23A8 /* JSSQLException.cpp in Sources */,
+ A8E6A78211D1661B00311F4A /* HTMLParserScheduler.cpp in Sources */,
+ CEA3949C11D45CDA003094CF /* StaticHashSetNodeList.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebCore/accessibility/AXObjectCache.cpp b/WebCore/accessibility/AXObjectCache.cpp
index b7622b8..750c611 100644
--- a/WebCore/accessibility/AXObjectCache.cpp
+++ b/WebCore/accessibility/AXObjectCache.cpp
@@ -456,6 +456,15 @@ void AXObjectCache::selectedChildrenChanged(RenderObject* renderer)
#endif
#if HAVE(ACCESSIBILITY)
+void AXObjectCache::handleAriaExpandedChange(RenderObject *renderer)
+{
+ if (!renderer)
+ return;
+ AccessibilityObject* obj = getOrCreate(renderer);
+ if (obj)
+ obj->handleAriaExpandedChanged();
+}
+
void AXObjectCache::handleActiveDescendantChanged(RenderObject* renderer)
{
if (!renderer)
diff --git a/WebCore/accessibility/AXObjectCache.h b/WebCore/accessibility/AXObjectCache.h
index 25f5347..8d98fa3 100644
--- a/WebCore/accessibility/AXObjectCache.h
+++ b/WebCore/accessibility/AXObjectCache.h
@@ -88,7 +88,8 @@ public:
void handleAriaRoleChanged(RenderObject*);
void handleFocusedUIElementChanged(RenderObject* oldFocusedRenderer, RenderObject* newFocusedRenderer);
void handleScrolledToAnchor(const Node* anchorNode);
-
+ void handleAriaExpandedChange(RenderObject*);
+
static void enableAccessibility() { gAccessibilityEnabled = true; }
static void enableEnhancedUserInterfaceAccessibility() { gAccessibilityEnhancedUserInterfaceEnabled = true; }
@@ -116,6 +117,9 @@ public:
AXScrolledToAnchor,
AXLiveRegionChanged,
AXMenuListValueChanged,
+ AXRowCountChanged,
+ AXRowCollapsed,
+ AXRowExpanded,
};
void postNotification(RenderObject*, AXNotification, bool postToElement, PostType = PostAsynchronously);
@@ -150,10 +154,12 @@ inline void AXObjectCache::detachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::attachWrapper(AccessibilityObject*) { }
inline void AXObjectCache::selectedChildrenChanged(RenderObject*) { }
inline void AXObjectCache::postNotification(RenderObject*, AXNotification, bool postToElement, PostType) { }
+inline void AXObjectCache::postNotification(AccessibilityObject*, Document*, AXNotification, bool postToElement, PostType) { }
inline void AXObjectCache::postPlatformNotification(AccessibilityObject*, AXNotification) { }
inline void AXObjectCache::handleFocusedUIElementChanged(RenderObject*, RenderObject*) { }
inline void AXObjectCache::handleScrolledToAnchor(const Node*) { }
inline void AXObjectCache::contentChanged(RenderObject*) { }
+inline void AXObjectCache::handleAriaExpandedChange(RenderObject*) { }
#endif
}
diff --git a/WebCore/accessibility/AccessibilityObject.cpp b/WebCore/accessibility/AccessibilityObject.cpp
index 8dedc36..555ba6f 100644
--- a/WebCore/accessibility/AccessibilityObject.cpp
+++ b/WebCore/accessibility/AccessibilityObject.cpp
@@ -902,7 +902,7 @@ static ARIARoleMap* createARIARoleMap()
{ "img", ImageRole },
{ "link", WebCoreLinkRole },
{ "list", ListRole },
- { "listitem", GroupRole },
+ { "listitem", ListItemRole },
{ "listbox", ListBoxRole },
{ "log", ApplicationLogRole },
// "option" isn't here because it may map to different roles depending on the parent element's role
@@ -917,7 +917,7 @@ static ARIARoleMap* createARIARoleMap()
{ "note", DocumentNoteRole },
{ "navigation", LandmarkNavigationRole },
{ "option", ListBoxOptionRole },
- { "presentation", IgnoredRole },
+ { "presentation", PresentationalRole },
{ "progressbar", ProgressIndicatorRole },
{ "radio", RadioButtonRole },
{ "radiogroup", RadioGroupRole },
diff --git a/WebCore/accessibility/AccessibilityObject.h b/WebCore/accessibility/AccessibilityObject.h
index 8b4923a..3c8d392 100644
--- a/WebCore/accessibility/AccessibilityObject.h
+++ b/WebCore/accessibility/AccessibilityObject.h
@@ -160,6 +160,7 @@ enum AccessibilityRole {
AnnotationRole,
SliderThumbRole,
IgnoredRole,
+ PresentationalRole,
TabRole,
TabListRole,
TabPanelRole,
@@ -296,6 +297,7 @@ public:
bool isTreeItem() const { return roleValue() == TreeItemRole; }
bool isScrollbar() const { return roleValue() == ScrollBarRole; }
bool isButton() const { return roleValue() == ButtonRole; }
+ bool isListItem() const { return roleValue() == ListItemRole; }
virtual bool isChecked() const { return false; }
virtual bool isEnabled() const { return false; }
@@ -442,13 +444,15 @@ public:
virtual void addChildren() { }
virtual bool canHaveChildren() const { return true; }
virtual bool hasChildren() const { return m_haveChildren; }
+ virtual void updateChildrenIfNecessary() { }
virtual void selectedChildren(AccessibilityChildrenVector&) { }
virtual void visibleChildren(AccessibilityChildrenVector&) { }
virtual void tabChildren(AccessibilityChildrenVector&) { }
virtual bool shouldFocusActiveDescendant() const { return false; }
virtual AccessibilityObject* activeDescendant() const { return 0; }
virtual void handleActiveDescendantChanged() { }
-
+ virtual void handleAriaExpandedChanged() { }
+
static AccessibilityRole ariaRoleToWebCoreRole(const String&);
static const AtomicString& getAttribute(Node*, const QualifiedName&);
diff --git a/WebCore/accessibility/AccessibilityRenderObject.cpp b/WebCore/accessibility/AccessibilityRenderObject.cpp
index ffe62f8..1ef6e09 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.cpp
+++ b/WebCore/accessibility/AccessibilityRenderObject.cpp
@@ -1256,11 +1256,11 @@ static HTMLLabelElement* labelForElement(Element* element)
HTMLLabelElement* AccessibilityRenderObject::labelElementContainer() const
{
if (!m_renderer)
- return false;
+ return 0;
// the control element should not be considered part of the label
if (isControl())
- return false;
+ return 0;
// find if this has a parent that is a label
for (Node* parentNode = m_renderer->node(); parentNode; parentNode = parentNode->parentNode()) {
@@ -1735,6 +1735,9 @@ bool AccessibilityRenderObject::accessibilityIsIgnored() const
if (roleValue() == IgnoredRole)
return true;
+ if (roleValue() == PresentationalRole || inheritsPresentationalRole())
+ return true;
+
// An ARIA tree can only have tree items and static text as children.
if (!isAllowedChildOfTree())
return true;
@@ -2829,6 +2832,39 @@ AccessibilityObject* AccessibilityRenderObject::activeDescendant() const
return 0;
}
+void AccessibilityRenderObject::handleAriaExpandedChanged()
+{
+ // Find if a parent of this object should handle aria-expanded changes.
+ AccessibilityObject* containerParent = this->parentObject();
+ while (containerParent) {
+ bool foundParent = false;
+
+ switch (containerParent->roleValue()) {
+ case TreeRole:
+ case TreeGridRole:
+ case GridRole:
+ case TableRole:
+ case BrowserRole:
+ foundParent = true;
+ break;
+ default:
+ break;
+ }
+
+ if (foundParent)
+ break;
+
+ containerParent = containerParent->parentObject();
+ }
+
+ // Post that the row count changed.
+ if (containerParent)
+ axObjectCache()->postNotification(containerParent, document(), AXObjectCache::AXRowCountChanged, true);
+
+ // Post that the specific row either collapsed or expanded.
+ if (roleValue() == RowRole || roleValue() == TreeItemRole)
+ axObjectCache()->postNotification(this, document(), isExpanded() ? AXObjectCache::AXRowExpanded : AXObjectCache::AXRowCollapsed, true);
+}
void AccessibilityRenderObject::handleActiveDescendantChanged()
{
@@ -2954,6 +2990,8 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
return ImageMapRole;
return WebCoreLinkRole;
}
+ if (m_renderer->isListItem())
+ return ListItemRole;
if (m_renderer->isListMarker())
return ListMarkerRole;
if (node && node->hasTagName(buttonTag))
@@ -3046,6 +3084,49 @@ AccessibilityOrientation AccessibilityRenderObject::orientation() const
return AccessibilityObject::orientation();
}
+bool AccessibilityRenderObject::inheritsPresentationalRole() const
+{
+ // ARIA spec says that when a parent object is presentational, and it has required child elements,
+ // those child elements are also presentational. For example, <li> becomes presentational from <ul>.
+ // http://www.w3.org/WAI/PF/aria/complete#presentation
+ DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, listItemParents, ());
+
+ HashSet<QualifiedName>* possibleParentTagNames = 0;
+ switch (roleValue()) {
+ case ListItemRole:
+ case ListMarkerRole:
+ if (listItemParents.isEmpty()) {
+ listItemParents.add(ulTag);
+ listItemParents.add(olTag);
+ listItemParents.add(dlTag);
+ }
+ possibleParentTagNames = &listItemParents;
+ break;
+ default:
+ break;
+ }
+
+ // Not all elements need to check for this, only ones that are required children.
+ if (!possibleParentTagNames)
+ return false;
+
+ for (AccessibilityObject* parent = parentObject(); parent; parent = parent->parentObject()) {
+ if (!parent->isAccessibilityRenderObject())
+ continue;
+
+ Node* elementNode = static_cast<AccessibilityRenderObject*>(parent)->node();
+ if (!elementNode || !elementNode->isElementNode())
+ continue;
+
+ // If native tag of the parent element matches an acceptable name, then return
+ // based on its presentational status.
+ if (possibleParentTagNames->contains(static_cast<Element*>(elementNode)->tagQName()))
+ return parent->roleValue() == PresentationalRole;
+ }
+
+ return false;
+}
+
bool AccessibilityRenderObject::isPresentationalChildOfAriaRole() const
{
// Walk the parent chain looking for a parent that has presentational children
@@ -3142,18 +3223,16 @@ void AccessibilityRenderObject::contentChanged()
void AccessibilityRenderObject::childrenChanged()
{
- // this method is meant as a quick way of marking dirty
- // a portion of the accessibility tree
-
+ // This method is meant as a quick way of marking a portion of the accessibility tree dirty.
if (!m_renderer)
return;
- // Go up the render parent chain, marking children as dirty.
- // We can't rely on the accessibilityParent() because it may not exist and we must not create an AX object here either
+ // Go up the accessibility parent chain, but only if the element already exists. This method is
+ // called during render layouts, minimal work should be done.
+ // If AX elements are created now, they could interrogate the render tree while it's in a funky state.
// At the same time, process ARIA live region changes.
- for (RenderObject* renderParent = m_renderer; renderParent; renderParent = renderParent->parent()) {
- AccessibilityObject* parent = m_renderer->document()->axObjectCache()->get(renderParent);
- if (!parent || !parent->isAccessibilityRenderObject())
+ for (AccessibilityObject* parent = this; parent; parent = parent->parentObjectIfExists()) {
+ if (!parent->isAccessibilityRenderObject())
continue;
AccessibilityRenderObject* axParent = static_cast<AccessibilityRenderObject*>(parent);
@@ -3165,7 +3244,7 @@ void AccessibilityRenderObject::childrenChanged()
// If this element supports ARIA live regions, then notify the AT of changes.
if (axParent->supportsARIALiveRegion())
- axObjectCache()->postNotification(renderParent, AXObjectCache::AXLiveRegionChanged, true);
+ axObjectCache()->postNotification(axParent->renderer(), AXObjectCache::AXLiveRegionChanged, true);
}
}
}
@@ -3232,8 +3311,7 @@ void AccessibilityRenderObject::addChildren()
// add all unignored acc children
for (RefPtr<AccessibilityObject> obj = firstChild(); obj; obj = obj->nextSibling()) {
if (obj->accessibilityIsIgnored()) {
- if (!obj->hasChildren())
- obj->addChildren();
+ obj->updateChildrenIfNecessary();
AccessibilityChildrenVector children = obj->children();
unsigned length = children.size();
for (unsigned i = 0; i < length; ++i)
diff --git a/WebCore/accessibility/AccessibilityRenderObject.h b/WebCore/accessibility/AccessibilityRenderObject.h
index 494e6bb..d4f798a 100644
--- a/WebCore/accessibility/AccessibilityRenderObject.h
+++ b/WebCore/accessibility/AccessibilityRenderObject.h
@@ -30,6 +30,7 @@
#define AccessibilityRenderObject_h
#include "AccessibilityObject.h"
+#include "RenderObject.h"
namespace WebCore {
@@ -47,7 +48,6 @@ class HTMLSelectElement;
class IntPoint;
class IntSize;
class Node;
-class RenderObject;
class RenderListBox;
class RenderTextControl;
class RenderView;
@@ -169,6 +169,11 @@ public:
void setRenderer(RenderObject* renderer) { m_renderer = renderer; }
RenderObject* renderer() const { return m_renderer; }
+ Node* node() const
+ {
+ return m_renderer ? m_renderer->node() : 0;
+ };
+
RenderView* topRenderer() const;
RenderTextControl* textControl() const;
Document* document() const;
@@ -199,7 +204,7 @@ public:
virtual const AccessibilityChildrenVector& children();
virtual void clearChildren();
- void updateChildrenIfNecessary();
+ virtual void updateChildrenIfNecessary();
virtual void setFocused(bool);
virtual void setSelectedTextRange(const PlainTextRange&);
@@ -222,7 +227,8 @@ public:
virtual bool shouldFocusActiveDescendant() const;
virtual AccessibilityObject* activeDescendant() const;
virtual void handleActiveDescendantChanged();
-
+ virtual void handleAriaExpandedChanged();
+
virtual VisiblePositionRange visiblePositionRange() const;
virtual VisiblePositionRange visiblePositionRangeForLine(unsigned) const;
virtual IntRect boundsForVisiblePositionRange(const VisiblePositionRange&) const;
@@ -305,6 +311,7 @@ private:
virtual bool ariaLiveRegionAtomic() const;
virtual bool ariaLiveRegionBusy() const;
+ bool inheritsPresentationalRole() const;
void setNeedsToUpdateChildren() const { m_childrenDirty = true; }
mutable AccessibilityRole m_roleForMSAA;
diff --git a/WebCore/accessibility/AccessibilityTableCell.cpp b/WebCore/accessibility/AccessibilityTableCell.cpp
index 318c619..7fadb88 100644
--- a/WebCore/accessibility/AccessibilityTableCell.cpp
+++ b/WebCore/accessibility/AccessibilityTableCell.cpp
@@ -71,7 +71,7 @@ bool AccessibilityTableCell::accessibilityIsIgnored() const
AccessibilityObject* AccessibilityTableCell::parentTable() const
{
if (!m_renderer || !m_renderer->isTableCell())
- return false;
+ return 0;
return axObjectCache()->getOrCreate(toRenderTableCell(m_renderer)->table());
}
diff --git a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
index 5158774..8e2aa2c 100644
--- a/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
+++ b/WebCore/accessibility/gtk/AccessibilityObjectWrapperAtk.cpp
@@ -143,18 +143,7 @@ static AccessibilityObject* core(AtkDocument* document)
return core(ATK_OBJECT(document));
}
-static const gchar* nameFromChildren(AccessibilityObject* object)
-{
- if (!object)
- return 0;
-
- AccessibilityRenderObject::AccessibilityChildrenVector children = object->children();
- // Currently, object->stringValue() should be an empty String. This might not be the case down the road.
- String name = object->stringValue();
- for (unsigned i = 0; i < children.size(); ++i)
- name += children.at(i).get()->stringValue();
- return returnString(name);
-}
+static gchar* webkit_accessible_text_get_text(AtkText* text, gint startOffset, gint endOffset);
static const gchar* webkit_accessible_get_name(AtkObject* object)
{
@@ -165,8 +154,11 @@ static const gchar* webkit_accessible_get_name(AtkObject* object)
AccessibilityRenderObject* renderObject = static_cast<AccessibilityRenderObject*>(coreObject);
if (coreObject->isControl()) {
AccessibilityObject* label = renderObject->correspondingLabelForControlElement();
- if (label)
- return returnString(nameFromChildren(label));
+ if (label) {
+ AtkObject* atkObject = label->wrapper();
+ if (ATK_IS_TEXT(atkObject))
+ return webkit_accessible_text_get_text(ATK_TEXT(atkObject), 0, -1);
+ }
}
if (renderObject->isImage() || renderObject->isInputImage()) {
@@ -422,6 +414,7 @@ static AtkRole atkRole(AccessibilityRole role)
return ATK_ROLE_HEADING;
case ListBoxRole:
return ATK_ROLE_LIST;
+ case ListItemRole:
case ListBoxOptionRole:
return ATK_ROLE_LIST_ITEM;
default:
@@ -436,13 +429,6 @@ static AtkRole webkit_accessible_get_role(AtkObject* object)
if (!axObject)
return ATK_ROLE_UNKNOWN;
- // WebCore does not seem to have a role for list items
- if (axObject->isGroup()) {
- AccessibilityObject* parent = axObject->parentObjectUnignored();
- if (parent && parent->isList())
- return ATK_ROLE_LIST_ITEM;
- }
-
// WebCore does not know about paragraph role, label role, or section role
if (axObject->isAccessibilityRenderObject()) {
Node* node = static_cast<AccessibilityRenderObject*>(axObject)->renderer()->node();
@@ -1501,8 +1487,8 @@ static AtkObject* webkit_accessible_table_get_caption(AtkTable* table)
static const gchar* webkit_accessible_table_get_column_description(AtkTable* table, gint column)
{
AtkObject* columnHeader = atk_table_get_column_header(table, column);
- if (columnHeader)
- return returnString(nameFromChildren(core(columnHeader)));
+ if (columnHeader && ATK_IS_TEXT(columnHeader))
+ return webkit_accessible_text_get_text(ATK_TEXT(columnHeader), 0, -1);
return 0;
}
@@ -1510,8 +1496,8 @@ static const gchar* webkit_accessible_table_get_column_description(AtkTable* tab
static const gchar* webkit_accessible_table_get_row_description(AtkTable* table, gint row)
{
AtkObject* rowHeader = atk_table_get_row_header(table, row);
- if (rowHeader)
- return returnString(nameFromChildren(core(rowHeader)));
+ if (rowHeader && ATK_IS_TEXT(rowHeader))
+ return webkit_accessible_text_get_text(ATK_TEXT(rowHeader), 0, -1);
return 0;
}
diff --git a/WebCore/accessibility/mac/AXObjectCacheMac.mm b/WebCore/accessibility/mac/AXObjectCacheMac.mm
index 6f886fe..a02bc75 100644
--- a/WebCore/accessibility/mac/AXObjectCacheMac.mm
+++ b/WebCore/accessibility/mac/AXObjectCacheMac.mm
@@ -91,7 +91,18 @@ void AXObjectCache::postPlatformNotification(AccessibilityObject* obj, AXNotific
case AXLiveRegionChanged:
macNotification = NSAccessibilityLiveRegionChangedNotification;
break;
- // Does not exist on Mac.
+ case AXRowCountChanged:
+ macNotification = NSAccessibilityRowCountChangedNotification;
+ break;
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ case AXRowExpanded:
+ macNotification = NSAccessibilityRowExpandedNotification;
+ break;
+ case AXRowCollapsed:
+ macNotification = NSAccessibilityRowCollapsedNotification;
+ break;
+#endif
+ // Does not exist on Mac.
case AXCheckedStateChanged:
default:
return;
diff --git a/WebCore/accessibility/mac/AccessibilityObjectMac.mm b/WebCore/accessibility/mac/AccessibilityObjectMac.mm
index 37fa65a..1076972 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectMac.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectMac.mm
@@ -46,6 +46,11 @@ AccessibilityObjectInclusion AccessibilityObject::accessibilityPlatformIncludesO
if (isMenuListPopup() || isMenuListOption())
return IgnoreObject;
+ // Never expose an unknown object on the Mac. Clients of the AX API will not know what to do with it.
+ // Special case is when the unknown object is actually an attachment.
+ if (roleValue() == UnknownRole && !isAttachment())
+ return IgnoreObject;
+
return DefaultBehavior;
}
diff --git a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
index 1fdb0cc..9de7e4d 100644
--- a/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
+++ b/WebCore/accessibility/mac/AccessibilityObjectWrapper.mm
@@ -957,7 +957,7 @@ static WebCoreTextMarkerRange* textMarkerRangeFromVisiblePositions(VisiblePositi
else if (m_object->isControl())
objectAttributes = controlAttrs;
- else if (m_object->isGroup())
+ else if (m_object->isGroup() || m_object->isListItem())
objectAttributes = groupAttrs;
else if (m_object->isTabList())
objectAttributes = tabListAttrs;
@@ -1148,6 +1148,7 @@ static const AccessibilityRoleMap& createAccessibilityRoleMap()
{ TabPanelRole, NSAccessibilityGroupRole },
{ TreeRole, NSAccessibilityOutlineRole },
{ TreeItemRole, NSAccessibilityRowRole },
+ { ListItemRole, NSAccessibilityGroupRole }
};
AccessibilityRoleMap& roleMap = *new AccessibilityRoleMap;
diff --git a/WebCore/bindings/cpp/WebDOMDOMWindowCustom.cpp b/WebCore/bindings/cpp/WebDOMDOMWindowCustom.cpp
new file mode 100644
index 0000000..5dd9ec4
--- /dev/null
+++ b/WebCore/bindings/cpp/WebDOMDOMWindowCustom.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebDOMDOMWindow.h"
+
+#include "DOMWindow.h"
+#include "WebDOMEventListener.h"
+#include "WebNativeEventListener.h"
+
+void WebDOMDOMWindow::addEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture)
+{
+ if (!impl())
+ return;
+
+ if (toWebCore(listener))
+ impl()->addEventListener(type, toWebCore(listener), useCapture);
+}
+
+void WebDOMDOMWindow::removeEventListener(const WebDOMString& type, const WebDOMEventListener& listener, bool useCapture)
+{
+ if (!impl())
+ return;
+
+ if (toWebCore(listener))
+ impl()->removeEventListener(type, toWebCore(listener), useCapture);
+}
diff --git a/WebCore/bindings/cpp/WebDOMEventTarget.cpp b/WebCore/bindings/cpp/WebDOMEventTarget.cpp
index 2eaef00..b24bc84 100644
--- a/WebCore/bindings/cpp/WebDOMEventTarget.cpp
+++ b/WebCore/bindings/cpp/WebDOMEventTarget.cpp
@@ -22,6 +22,7 @@
#include "WebDOMEventTarget.h"
#include "DOMApplicationCache.h"
+#include "DOMWindow.h"
#include "DedicatedWorkerContext.h"
#include "EventSource.h"
#include "MessagePort.h"
@@ -31,6 +32,7 @@
#include "SharedWorkerContext.h"
#include "ThreadCheck.h"
#include "WebDOMDOMApplicationCache.h"
+#include "WebDOMDOMWindow.h"
#include "WebDOMDedicatedWorkerContext.h"
#include "WebDOMEventSource.h"
#include "WebDOMMessagePort.h"
@@ -88,6 +90,45 @@ WebCore::EventTarget* WebDOMEventTarget::impl() const
return m_impl ? m_impl->impl.get() : 0;
}
+#define ConvertTo(type) \
+WebDOM##type WebDOMEventTarget::to##type() \
+{ \
+ WebCore::EventTarget* target = impl(); \
+ return WebDOM##type(target ? target->to##type() : 0); \
+}
+
+ConvertTo(Node)
+ConvertTo(DOMWindow)
+ConvertTo(XMLHttpRequest)
+ConvertTo(XMLHttpRequestUpload)
+ConvertTo(MessagePort)
+
+#if ENABLE(EVENTSOURCE)
+ConvertTo(EventSource)
+#endif
+
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ConvertTo(DOMApplicationCache)
+#endif
+
+#if ENABLE(WORKERS)
+ConvertTo(Worker)
+ConvertTo(DedicatedWorkerContext)
+#endif
+
+#if ENABLE(SHARED_WORKERS)
+ConvertTo(SharedWorker)
+ConvertTo(SharedWorkerContext)
+#endif
+
+#if ENABLE(NOTIFICATIONS)
+ConvertTo(Notification)
+#endif
+
+#if ENABLE(WEB_SOCKETS)
+ConvertTo(WebSocket)
+#endif
+
WebCore::EventTarget* toWebCore(const WebDOMEventTarget& wrapper)
{
return wrapper.impl();
@@ -95,6 +136,21 @@ WebCore::EventTarget* toWebCore(const WebDOMEventTarget& wrapper)
WebDOMEventTarget toWebKit(WebCore::EventTarget* value)
{
+ if (WebCore::Node* node = value->toNode())
+ return toWebKit(node);
+
+ if (WebCore::DOMWindow* window = value->toDOMWindow())
+ return toWebKit(window);
+
+ if (WebCore::XMLHttpRequest* xhr = value->toXMLHttpRequest())
+ return toWebKit(xhr);
+
+ if (WebCore::XMLHttpRequestUpload* upload = value->toXMLHttpRequestUpload())
+ return toWebKit(upload);
+
+ if (WebCore::MessagePort* messagePort = value->toMessagePort())
+ return toWebKit(messagePort);
+
#if ENABLE(EVENTSOURCE)
if (WebCore::EventSource* eventSource = value->toEventSource())
return toWebKit(eventSource);
@@ -107,23 +163,11 @@ WebDOMEventTarget toWebKit(WebCore::EventTarget* value)
return toWebKit(instance);
#endif
- if (WebCore::Node* node = value->toNode())
- return toWebKit(node);
-
- if (WebCore::XMLHttpRequest* xhr = value->toXMLHttpRequest())
- return toWebKit(xhr);
-
- if (WebCore::XMLHttpRequestUpload* upload = value->toXMLHttpRequestUpload())
- return toWebKit(upload);
-
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
if (WebCore::DOMApplicationCache* cache = value->toDOMApplicationCache())
return toWebKit(cache);
#endif
- if (WebCore::MessagePort* messagePort = value->toMessagePort())
- return toWebKit(messagePort);
-
#if ENABLE(WORKERS)
if (WebCore::Worker* worker = value->toWorker())
return toWebKit(worker);
diff --git a/WebCore/bindings/cpp/WebDOMEventTarget.h b/WebCore/bindings/cpp/WebDOMEventTarget.h
index f5360ca..d514372 100644
--- a/WebCore/bindings/cpp/WebDOMEventTarget.h
+++ b/WebCore/bindings/cpp/WebDOMEventTarget.h
@@ -26,6 +26,20 @@ namespace WebCore {
class EventTarget;
};
+class WebDOMDedicatedWorkerContext;
+class WebDOMDOMApplicationCache;
+class WebDOMDOMWindow;
+class WebDOMEventSource;
+class WebDOMMessagePort;
+class WebDOMNode;
+class WebDOMNotification;
+class WebDOMSharedWorker;
+class WebDOMSharedWorkerContext;
+class WebDOMWebSocket;
+class WebDOMWorker;
+class WebDOMXMLHttpRequest;
+class WebDOMXMLHttpRequestUpload;
+
class WebDOMEventTarget : public WebDOMObject {
public:
WebDOMEventTarget();
@@ -35,8 +49,20 @@ public:
WebCore::EventTarget* impl() const;
- // FIXME: Add a possibility to check what kind of EventTarget we have,
- // to be able to cast eg. a WebDOMEventTarget to a WebDOMNode
+ WebDOMNode toNode();
+ WebDOMDOMWindow toDOMWindow();
+ WebDOMXMLHttpRequest toXMLHttpRequest();
+ WebDOMXMLHttpRequestUpload toXMLHttpRequestUpload();
+ WebDOMMessagePort toMessagePort();
+
+ WebDOMEventSource toEventSource();
+ WebDOMDOMApplicationCache toDOMApplicationCache();
+ WebDOMWorker toWorker();
+ WebDOMDedicatedWorkerContext toDedicatedWorkerContext();
+ WebDOMSharedWorker toSharedWorker();
+ WebDOMSharedWorkerContext toSharedWorkerContext();
+ WebDOMNotification toNotification();
+ WebDOMWebSocket toWebSocket();
protected:
struct WebDOMEventTargetPrivate;
diff --git a/WebCore/platform/graphics/efl/FloatRectEfl.cpp b/WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp
index 12f8d03..3f3378c 100644
--- a/WebCore/platform/graphics/efl/FloatRectEfl.cpp
+++ b/WebCore/bindings/cpp/WebDOMHTMLCollectionCustom.cpp
@@ -1,8 +1,5 @@
/*
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
+ * 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
@@ -21,21 +18,25 @@
*/
#include "config.h"
-#include "FloatRect.h"
+#include "WebDOMHTMLCollection.h"
-namespace WebCore {
+#include "AtomicString.h"
+#include "HTMLCollection.h"
+#include "WebDOMNode.h"
+#include <wtf/GetPtr.h>
-FloatRect::FloatRect(const Eina_Rectangle& r)
- : m_location(FloatPoint(r.x, r.y))
- , m_size(r.w, r.h)
+WebDOMNode WebDOMHTMLCollection::item(unsigned index)
{
+ if (!impl())
+ return WebDOMNode();
+
+ return toWebKit(WTF::getPtr(impl()->item(index)));
}
-FloatRect::operator Eina_Rectangle() const // NOLINT
+WebDOMNode WebDOMHTMLCollection::namedItem(const WebDOMString& name)
{
- Eina_Rectangle r = {(int) round(x()), (int) round(y()), (int) round(width()), (int) round(height())};
- return r;
-}
+ if (!impl())
+ return WebDOMNode();
+ return toWebKit(WTF::getPtr(impl()->namedItem(name)));
}
-
diff --git a/WebCore/platform/graphics/efl/IntRectEfl.cpp b/WebCore/bindings/cpp/WebDOMHTMLOptionsCollectionCustom.cpp
index 5ff8626..7e2eb25 100644
--- a/WebCore/platform/graphics/efl/IntRectEfl.cpp
+++ b/WebCore/bindings/cpp/WebDOMHTMLOptionsCollectionCustom.cpp
@@ -1,8 +1,5 @@
/*
- * Copyright (C) 2007 Alp Toker <alp@atoker.com>
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
+ * 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
@@ -21,21 +18,25 @@
*/
#include "config.h"
-#include "IntRect.h"
+#include "WebDOMHTMLOptionsCollection.h"
-namespace WebCore {
+#include "HTMLOptionsCollection.h"
+#include "WebExceptionHandler.h"
-IntRect::IntRect(const Eina_Rectangle& r)
- : m_location(IntPoint(r.x, r.y))
- , m_size(r.w, r.h)
+unsigned WebDOMHTMLOptionsCollection::length() const
{
+ if (!impl())
+ return 0;
+
+ return impl()->length();
}
-IntRect::operator Eina_Rectangle() const // NOLINT
+void WebDOMHTMLOptionsCollection::setLength(unsigned length)
{
- Eina_Rectangle r = { x(), y(), width(), height() };
- return r;
-}
+ if (!impl())
+ return;
+ WebCore::ExceptionCode ec = 0;
+ impl()->setLength(length, ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
}
-
diff --git a/WebCore/bindings/js/JSWebKitPointConstructor.h b/WebCore/bindings/cpp/WebDOMNodeFilterCustom.cpp
index 44c253d..565fa61 100644
--- a/WebCore/bindings/js/JSWebKitPointConstructor.h
+++ b/WebCore/bindings/cpp/WebDOMNodeFilterCustom.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,24 +23,22 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSWebKitPointConstructor_h
-#define JSWebKitPointConstructor_h
+#include "config.h"
+#include "WebDOMNodeFilter.h"
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
+#include "WebDOMNode.h"
+#include "WebNativeNodeFilterCondition.h"
-namespace WebCore {
-
-class JSWebKitPointConstructor : public DOMConstructorObject {
-public:
- JSWebKitPointConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static const JSC::ClassInfo s_info;
-
-private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
-};
+short WebDOMNodeFilter::acceptNode(const WebDOMNode& n)
+{
+ if (!impl())
+ return 0;
+ return impl()->acceptNode(0, toWebCore(n));
}
-#endif // JSWebKitPointConstructor_h
+WebDOMNodeFilter toWebKit(WebUserNodeFilter* value)
+{
+ RefPtr<WebCore::NodeFilter> listener = WebCore::NodeFilter::create(WebNativeNodeFilterCondition::create(value));
+ return WebDOMNodeFilter(listener.get());
+}
diff --git a/WebCore/bindings/cpp/WebNativeNodeFilterCondition.cpp b/WebCore/bindings/cpp/WebNativeNodeFilterCondition.cpp
new file mode 100644
index 0000000..3d30810
--- /dev/null
+++ b/WebCore/bindings/cpp/WebNativeNodeFilterCondition.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "WebNativeNodeFilterCondition.h"
+
+#include "WebDOMNode.h"
+
+WebNativeNodeFilterCondition::WebNativeNodeFilterCondition(WebUserNodeFilter* filter)
+ : WebCore::NodeFilterCondition()
+ , m_filter(filter)
+{
+ ASSERT(m_filter);
+ m_filter->ref();
+}
+
+WebNativeNodeFilterCondition::~WebNativeNodeFilterCondition()
+{
+ m_filter->deref();
+}
+
+short WebNativeNodeFilterCondition::acceptNode(WebCore::ScriptState*, WebCore::Node* node) const
+{
+ return m_filter->acceptNode(toWebKit(node));
+}
diff --git a/WebCore/bindings/cpp/WebNativeNodeFilterCondition.h b/WebCore/bindings/cpp/WebNativeNodeFilterCondition.h
new file mode 100644
index 0000000..33d2786
--- /dev/null
+++ b/WebCore/bindings/cpp/WebNativeNodeFilterCondition.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ * Copyright (C) 2001 Peter Kelly (pmk@post.com)
+ * Copyright (C) 2003, 2008, 2009 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef WebNativeNodeFilterCondition_h
+#define WebNativeNodeFilterCondition_h
+
+#include "NodeFilter.h"
+#include "WebDOMNodeFilter.h"
+
+class WebNativeNodeFilterCondition : public WebCore::NodeFilterCondition {
+public:
+ static PassRefPtr<WebNativeNodeFilterCondition> create(WebUserNodeFilter* filter)
+ {
+ return adoptRef(new WebNativeNodeFilterCondition(filter));
+ }
+
+ virtual ~WebNativeNodeFilterCondition();
+
+ virtual short acceptNode(WebCore::ScriptState*, WebCore::Node*) const;
+
+protected:
+ WebNativeNodeFilterCondition(WebUserNodeFilter*);
+ WebUserNodeFilter* m_filter;
+};
+
+#endif
diff --git a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
index a3e488e..93ce1ee 100644
--- a/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/generic/RuntimeEnabledFeatures.cpp
@@ -31,8 +31,7 @@
#include "config.h"
#include "RuntimeEnabledFeatures.h"
-#include "Database.h"
-#include "DatabaseSync.h"
+#include "AbstractDatabase.h"
#include "MediaPlayer.h"
#include "SharedWorkerRepository.h"
#include "WebSocket.h"
@@ -95,12 +94,12 @@ bool RuntimeEnabledFeatures::webSocketEnabled()
#if ENABLE(DATABASE)
bool RuntimeEnabledFeatures::openDatabaseEnabled()
{
- return Database::isAvailable();
+ return AbstractDatabase::isAvailable();
}
bool RuntimeEnabledFeatures::openDatabaseSyncEnabled()
{
- return DatabaseSync::isAvailable();
+ return AbstractDatabase::isAvailable();
}
#endif
diff --git a/WebCore/bindings/js/JSArrayBufferConstructor.h b/WebCore/bindings/js/JSArrayBufferConstructor.h
deleted file mode 100644
index fa07a55..0000000
--- a/WebCore/bindings/js/JSArrayBufferConstructor.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSArrayBufferConstructor_h
-#define JSArrayBufferConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-#include "JSArrayBuffer.h"
-#include <runtime/Error.h>
-#include "ArrayBuffer.h"
-
-namespace WebCore {
-
- class ArrayBufferView;
-
- // Template function used by CanvasXXXArrayConstructors
- template<class C, typename T>
- PassRefPtr<ArrayBufferView> construct(JSC::ExecState* exec, const JSC::ArgList& args)
- {
- // There are 3 constructors:
- //
- // 1) (in int size)
- // 2) (in ArrayBuffer buffer, [Optional] in int offset, [Optional] in unsigned int length)
- // 3) (in sequence<T>) - This ends up being a JS "array-like" object
- //
- RefPtr<C> arrayObject;
-
- // For the 0 args case, just create an object without a buffer
- if (args.size() < 1)
- return C::create(0, 0, 0);
-
- if (args.size() > 1 && !args.at(0).isObject())
- // Invalid first argument
- return 0;
-
- if (args.at(0).isObject()) {
- RefPtr<ArrayBuffer> buffer = toArrayBuffer(args.at(0));
- if (buffer) {
- unsigned offset = (args.size() > 1) ? args.at(1).toUInt32(exec) : 0;
- unsigned int length = (buffer->byteLength() - offset) / sizeof(T);
- if (args.size() > 2)
- length = args.at(2).toUInt32(exec);
- return C::create(buffer, offset, length);
- }
-
- JSC::JSObject* array = asObject(args.at(0));
- unsigned length = array->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
- void* tempValues;
- if (!tryFastCalloc(length, sizeof(T)).getValue(tempValues)) {
- throwError(exec, createError(exec, "Error"));
- return 0;
- }
-
- OwnFastMallocPtr<T> values(static_cast<T*>(tempValues));
- for (unsigned i = 0; i < length; ++i) {
- JSC::JSValue v = array->get(exec, i);
- if (exec->hadException())
- return 0;
- values.get()[i] = static_cast<T>(v.toNumber(exec));
- }
-
- return C::create(values.get(), length);
- }
-
- unsigned size = args.at(0).toUInt32(exec);
- return C::create(size);
- }
-
- class JSArrayBufferConstructor : public DOMConstructorObject {
- public:
- JSArrayBufferConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static const JSC::ClassInfo s_info;
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- };
-
-}
-
-#endif // JSArrayBufferConstructor_h
diff --git a/WebCore/bindings/js/JSArrayBufferConstructor.cpp b/WebCore/bindings/js/JSArrayBufferCustom.cpp
index 683f9d1..3555a60 100644
--- a/WebCore/bindings/js/JSArrayBufferConstructor.cpp
+++ b/WebCore/bindings/js/JSArrayBufferCustom.cpp
@@ -27,49 +27,31 @@
#if ENABLE(3D_CANVAS)
-#include "JSArrayBufferConstructor.h"
+#include "JSArrayBuffer.h"
-#include "Document.h"
+#include "ArrayBuffer.h"
#include "ExceptionCode.h"
-#include "JSArrayBuffer.h"
+#include <runtime/Error.h>
namespace WebCore {
using namespace JSC;
-const ClassInfo JSArrayBufferConstructor::s_info = { "ArrayBufferConstructor", 0, 0, 0 };
-
-JSArrayBufferConstructor::JSArrayBufferConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSArrayBufferConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSArrayBufferPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasArrayBuffer(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL JSArrayBufferConstructor::constructJSArrayBuffer(ExecState* exec)
{
JSArrayBufferConstructor* jsConstructor = static_cast<JSArrayBufferConstructor*>(exec->callee());
- unsigned int size = 0;
- if (exec->argumentCount() == 1) {
- size = (unsigned int)exec->argument(0).toInt32(exec);
- if (isnan(size))
- size = 0;
- }
- RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(size, 1);
- if (!buffer.get()){
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
+ int length = 0;
+ if (exec->argumentCount() > 0)
+ length = exec->argument(0).toInt32(exec); // NaN/+inf/-inf returns 0, this is intended by WebIDL
+ RefPtr<ArrayBuffer> buffer;
+ if (length >= 0)
+ buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1);
+ if (!buffer.get())
+ return throwVMError(exec, createRangeError(exec, "ArrayBuffer size is not a small enough positive integer."));
return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), buffer.get())));
}
-JSC::ConstructType JSArrayBufferConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasArrayBuffer;
- return ConstructTypeHost;
-}
-
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSArrayBufferViewHelper.h b/WebCore/bindings/js/JSArrayBufferViewHelper.h
index f632f38..331e950 100644
--- a/WebCore/bindings/js/JSArrayBufferViewHelper.h
+++ b/WebCore/bindings/js/JSArrayBufferViewHelper.h
@@ -27,7 +27,9 @@
#ifndef JSArrayBufferViewHelper_h
#define JSArrayBufferViewHelper_h
+#include "ArrayBufferView.h"
#include "ExceptionCode.h"
+#include "JSArrayBuffer.h"
#include "JSDOMBinding.h"
#include <interpreter/CallFrame.h>
#include <runtime/ArgList.h>
@@ -81,6 +83,73 @@ JSC::JSValue setWebGLArrayHelper(JSC::ExecState* exec, T* impl, T* (*conversionF
return JSC::throwSyntaxError(exec);
}
+// Template function used by XXXArrayConstructors.
+// If this returns 0, it will already have thrown a JavaScript exception.
+template<class C, typename T>
+PassRefPtr<ArrayBufferView> constructArrayBufferView(JSC::ExecState* exec)
+{
+ // There are 3 constructors:
+ //
+ // 1) (in int size)
+ // 2) (in ArrayBuffer buffer, [Optional] in int offset, [Optional] in unsigned int length)
+ // 3) (in sequence<T>) - This ends up being a JS "array-like" object
+ //
+ RefPtr<C> arrayObject;
+
+ // For the 0 args case, just create an object without a buffer
+ if (exec->argumentCount() < 1)
+ return C::create(0, 0, 0);
+
+ if (exec->argument(0).isNull()) {
+ // Invalid first argument
+ throwTypeError(exec);
+ return 0;
+ }
+
+ if (exec->argument(0).isObject()) {
+ RefPtr<ArrayBuffer> buffer = toArrayBuffer(exec->argument(0));
+ if (buffer) {
+ unsigned offset = (exec->argumentCount() > 1) ? exec->argument(1).toUInt32(exec) : 0;
+ unsigned int length = (buffer->byteLength() - offset) / sizeof(T);
+ if (exec->argumentCount() > 2)
+ length = exec->argument(2).toUInt32(exec);
+ PassRefPtr<ArrayBufferView> array = C::create(buffer, offset, length);
+ if (!array)
+ setDOMException(exec, INDEX_SIZE_ERR);
+ return array;
+ }
+
+ JSC::JSObject* array = asObject(exec->argument(0));
+ unsigned length = array->get(exec, JSC::Identifier(exec, "length")).toUInt32(exec);
+ void* tempValues;
+ if (!tryFastCalloc(length, sizeof(T)).getValue(tempValues)) {
+ JSC::throwError(exec, createError(exec, "Error"));
+ return 0;
+ }
+
+ OwnFastMallocPtr<T> values(static_cast<T*>(tempValues));
+ for (unsigned i = 0; i < length; ++i) {
+ JSC::JSValue v = array->get(exec, i);
+ if (exec->hadException())
+ return 0;
+ values.get()[i] = static_cast<T>(v.toNumber(exec));
+ }
+
+ PassRefPtr<ArrayBufferView> result = C::create(values.get(), length);
+ if (!result)
+ setDOMException(exec, INDEX_SIZE_ERR);
+ return result;
+ }
+
+ int length = exec->argument(0).toInt32(exec);
+ PassRefPtr<ArrayBufferView> result;
+ if (length >= 0)
+ result = C::create(static_cast<unsigned>(length));
+ if (!result)
+ throwError(exec, createRangeError(exec, "ArrayBufferView size is not a small enough positive integer."));
+ return result;
}
+} // namespace WebCore
+
#endif // JSArrayBufferViewHelper_h
diff --git a/WebCore/bindings/js/JSBindingsAllInOne.cpp b/WebCore/bindings/js/JSBindingsAllInOne.cpp
index ae31608..1d64198 100644
--- a/WebCore/bindings/js/JSBindingsAllInOne.cpp
+++ b/WebCore/bindings/js/JSBindingsAllInOne.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -58,7 +58,7 @@
#include "JSElementCustom.cpp"
#include "JSEventCustom.cpp"
#include "JSEventListener.cpp"
-#include "JSEventSourceConstructor.cpp"
+#include "JSEventSourceCustom.cpp"
#include "JSEventTarget.cpp"
#include "JSExceptionBase.cpp"
#include "JSHTMLAllCollectionCustom.cpp"
@@ -86,7 +86,6 @@
#include "JSLazyEventListener.cpp"
#include "JSLocationCustom.cpp"
#include "JSMainThreadExecState.cpp"
-#include "JSMessageChannelConstructor.cpp"
#include "JSMessageChannelCustom.cpp"
#include "JSMessageEventCustom.cpp"
#include "JSMessagePortCustom.cpp"
@@ -111,25 +110,21 @@
#include "JSSVGPathSegCustom.cpp"
#include "JSSVGPathSegListCustom.cpp"
#include "JSScriptProfileNodeCustom.cpp"
-#include "JSSharedWorkerConstructor.cpp"
#include "JSSharedWorkerCustom.cpp"
#include "JSStorageCustom.cpp"
#include "JSStyleSheetCustom.cpp"
#include "JSStyleSheetListCustom.cpp"
#include "JSTextCustom.cpp"
#include "JSTreeWalkerCustom.cpp"
-#include "JSWebKitCSSMatrixConstructor.cpp"
-#include "JSWebKitPointConstructor.cpp"
-#include "JSWebSocketConstructor.cpp"
+#include "JSWebKitCSSMatrixCustom.cpp"
+#include "JSWebKitPointCustom.cpp"
#include "JSWebSocketCustom.cpp"
-#include "JSWorkerConstructor.cpp"
#include "JSWorkerContextBase.cpp"
#include "JSWorkerContextCustom.cpp"
#include "JSWorkerContextErrorHandler.cpp"
#include "JSWorkerCustom.cpp"
#include "JSXMLHttpRequestCustom.cpp"
#include "JSXMLHttpRequestUploadCustom.cpp"
-#include "JSXSLTProcessorConstructor.cpp"
#include "JSXSLTProcessorCustom.cpp"
#include "JavaScriptCallFrame.cpp"
#include "MemoryInfo.cpp"
diff --git a/WebCore/bindings/js/JSDOMBinding.cpp b/WebCore/bindings/js/JSDOMBinding.cpp
index 27ac9e4..8220f51 100644
--- a/WebCore/bindings/js/JSDOMBinding.cpp
+++ b/WebCore/bindings/js/JSDOMBinding.cpp
@@ -71,6 +71,11 @@
#include "XPathException.h"
#endif
+#if ENABLE(DATABASE)
+#include "JSSQLException.h"
+#include "SQLException.h"
+#endif
+
using namespace JSC;
namespace WebCore {
@@ -600,6 +605,11 @@ void setDOMException(ExecState* exec, ExceptionCode ec)
errorObject = toJS(exec, globalObject, XPathException::create(description));
break;
#endif
+#if ENABLE(DATABASE)
+ case SQLExceptionType:
+ errorObject = toJS(exec, globalObject, SQLException::create(description));
+ break;
+#endif
}
ASSERT(errorObject);
diff --git a/WebCore/bindings/js/JSDOMWindowCustom.cpp b/WebCore/bindings/js/JSDOMWindowCustom.cpp
index 7e0a785..30d79b3 100644
--- a/WebCore/bindings/js/JSDOMWindowCustom.cpp
+++ b/WebCore/bindings/js/JSDOMWindowCustom.cpp
@@ -43,38 +43,38 @@
#include "JSDOMWindowShell.h"
#include "JSEvent.h"
#include "JSEventListener.h"
-#include "JSEventSourceConstructor.h"
+#include "JSEventSource.h"
#include "JSHTMLCollection.h"
#include "JSHistory.h"
#include "JSImageConstructor.h"
#include "JSLocation.h"
-#include "JSMessageChannelConstructor.h"
+#include "JSMessageChannel.h"
#include "JSMessagePort.h"
#include "JSMessagePortCustom.h"
#include "JSOptionConstructor.h"
#if ENABLE(SHARED_WORKERS)
-#include "JSSharedWorkerConstructor.h"
+#include "JSSharedWorker.h"
#endif
#if ENABLE(3D_CANVAS)
-#include "JSArrayBufferConstructor.h"
-#include "JSInt8ArrayConstructor.h"
-#include "JSUint8ArrayConstructor.h"
-#include "JSInt32ArrayConstructor.h"
-#include "JSUint32ArrayConstructor.h"
-#include "JSInt16ArrayConstructor.h"
-#include "JSUint16ArrayConstructor.h"
-#include "JSFloat32ArrayConstructor.h"
+#include "JSArrayBuffer.h"
+#include "JSInt8Array.h"
+#include "JSUint8Array.h"
+#include "JSInt32Array.h"
+#include "JSUint32Array.h"
+#include "JSInt16Array.h"
+#include "JSUint16Array.h"
+#include "JSFloat32Array.h"
#endif
-#include "JSWebKitCSSMatrixConstructor.h"
-#include "JSWebKitPointConstructor.h"
+#include "JSWebKitCSSMatrix.h"
+#include "JSWebKitPoint.h"
#if ENABLE(WEB_SOCKETS)
-#include "JSWebSocketConstructor.h"
+#include "JSWebSocket.h"
#endif
-#include "JSWorkerConstructor.h"
+#include "JSWorker.h"
#include "JSXMLHttpRequest.h"
-#include "JSXSLTProcessorConstructor.h"
+#include "JSXSLTProcessor.h"
#include "Location.h"
#include "MediaPlayer.h"
#include "MessagePort.h"
diff --git a/WebCore/bindings/js/JSEventSourceConstructor.h b/WebCore/bindings/js/JSEventSourceConstructor.h
deleted file mode 100644
index b2f3cb5..0000000
--- a/WebCore/bindings/js/JSEventSourceConstructor.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2009 Ericsson AB
- * 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 Ericsson 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 JSEventSourceConstructor_h
-#define JSEventSourceConstructor_h
-
-#if ENABLE(EVENTSOURCE)
-
-#include "JSDOMBinding.h"
-
-namespace WebCore {
-
- class JSEventSourceConstructor : public DOMConstructorObject {
- public:
- JSEventSourceConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static const JSC::ClassInfo s_info;
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- };
-
-} // namespace WebCore
-
-#endif // ENABLE(EVENTSOURCE)
-
-#endif // JSEventSourceConstructor_h
diff --git a/WebCore/bindings/js/JSEventSourceConstructor.cpp b/WebCore/bindings/js/JSEventSourceCustom.cpp
index 4524f70..aa991dd 100644
--- a/WebCore/bindings/js/JSEventSourceConstructor.cpp
+++ b/WebCore/bindings/js/JSEventSourceCustom.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2009 Ericsson AB
- * All rights reserved.
+ * Copyright (C) 2009 Ericsson AB. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,11 +33,10 @@
#if ENABLE(EVENTSOURCE)
-#include "JSEventSourceConstructor.h"
+#include "JSEventSource.h"
#include "EventSource.h"
#include "ExceptionCode.h"
-#include "JSEventSource.h"
#include "ScriptExecutionContext.h"
#include <runtime/Error.h>
@@ -45,18 +44,7 @@ using namespace JSC;
namespace WebCore {
-ASSERT_CLASS_FITS_IN_CELL(JSEventSourceConstructor);
-
-const ClassInfo JSEventSourceConstructor::s_info = { "EventSourceContructor", 0, 0, 0 };
-
-JSEventSourceConstructor::JSEventSourceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSEventSourceConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSEventSourcePrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly|DontDelete|DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructEventSource(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL JSEventSourceConstructor::constructJSEventSource(ExecState* exec)
{
if (exec->argumentCount() < 1)
return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
@@ -80,12 +68,6 @@ static EncodedJSValue JSC_HOST_CALL constructEventSource(ExecState* exec)
return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), eventSource.release())));
}
-ConstructType JSEventSourceConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = constructEventSource;
- return ConstructTypeHost;
-}
-
} // namespace WebCore
#endif // ENABLE(EVENTSOURCE)
diff --git a/WebCore/bindings/js/JSExceptionBase.cpp b/WebCore/bindings/js/JSExceptionBase.cpp
index 3749eed..44b38ec 100644
--- a/WebCore/bindings/js/JSExceptionBase.cpp
+++ b/WebCore/bindings/js/JSExceptionBase.cpp
@@ -1,64 +1,72 @@
-/*
- * Copyright (C) 2009 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 "JSExceptionBase.h"
-
-#include "JSDOMCoreException.h"
-#include "JSEventException.h"
-#include "JSRangeException.h"
-#include "JSXMLHttpRequestException.h"
-#if ENABLE(SVG)
-#include "JSSVGException.h"
-#endif
-#if ENABLE(XPATH)
-#include "JSXPathException.h"
-#endif
-
-namespace WebCore {
-
-ExceptionBase* toExceptionBase(JSC::JSValue value)
-{
- if (DOMCoreException* domException = toDOMCoreException(value))
- return reinterpret_cast<ExceptionBase*>(domException);
- if (RangeException* rangeException = toRangeException(value))
- return reinterpret_cast<ExceptionBase*>(rangeException);
- if (EventException* eventException = toEventException(value))
- return reinterpret_cast<ExceptionBase*>(eventException);
- if (XMLHttpRequestException* xmlHttpException = toXMLHttpRequestException(value))
- return reinterpret_cast<ExceptionBase*>(xmlHttpException);
-#if ENABLE(SVG)
- if (SVGException* svgException = toSVGException(value))
- return reinterpret_cast<ExceptionBase*>(svgException);
-#endif
-#if ENABLE(XPATH)
- if (XPathException* pathException = toXPathException(value))
- return reinterpret_cast<ExceptionBase*>(pathException);
-#endif
-
- return 0;
-}
-
-} // namespace WebCore
+/*
+ * Copyright (C) 2009 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 "JSExceptionBase.h"
+
+#include "JSDOMCoreException.h"
+#include "JSEventException.h"
+#include "JSRangeException.h"
+#include "JSXMLHttpRequestException.h"
+#if ENABLE(DATABASE)
+#include "SQLException.h"
+#include "JSSQLException.h"
+#endif
+#if ENABLE(SVG)
+#include "JSSVGException.h"
+#endif
+#if ENABLE(XPATH)
+#include "JSXPathException.h"
+#endif
+
+namespace WebCore {
+
+ExceptionBase* toExceptionBase(JSC::JSValue value)
+{
+ if (DOMCoreException* domException = toDOMCoreException(value))
+ return reinterpret_cast<ExceptionBase*>(domException);
+ if (RangeException* rangeException = toRangeException(value))
+ return reinterpret_cast<ExceptionBase*>(rangeException);
+ if (EventException* eventException = toEventException(value))
+ return reinterpret_cast<ExceptionBase*>(eventException);
+ if (XMLHttpRequestException* xmlHttpException = toXMLHttpRequestException(value))
+ return reinterpret_cast<ExceptionBase*>(xmlHttpException);
+#if ENABLE(SVG)
+ if (SVGException* svgException = toSVGException(value))
+ return reinterpret_cast<ExceptionBase*>(svgException);
+#endif
+#if ENABLE(XPATH)
+ if (XPathException* pathException = toXPathException(value))
+ return reinterpret_cast<ExceptionBase*>(pathException);
+#endif
+#if ENABLE(DATABASE)
+ if (SQLException* pathException = toSQLException(value))
+ return reinterpret_cast<ExceptionBase*>(pathException);
+#endif
+
+ return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/JSFloat32ArrayConstructor.cpp b/WebCore/bindings/js/JSFloat32ArrayConstructor.cpp
deleted file mode 100644
index 08cffb5..0000000
--- a/WebCore/bindings/js/JSFloat32ArrayConstructor.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSFloat32ArrayConstructor.h"
-
-#include "Document.h"
-#include "Float32Array.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSFloat32Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSFloat32ArrayConstructor::s_info = { "Float32ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSFloat32ArrayConstructor::JSFloat32ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSFloat32ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSFloat32ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSFloat32ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSFloat32ArrayPrototype(globalObject, JSFloat32ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSFloat32ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSFloat32ArrayConstructor, DOMObject>(exec, JSFloat32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSFloat32ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSFloat32ArrayConstructor, DOMObject>(exec, JSFloat32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasFloatArray(ExecState* exec)
-{
- ArgList args(exec);
- JSFloat32ArrayConstructor* jsConstructor = static_cast<JSFloat32ArrayConstructor*>(exec->callee());
- RefPtr<Float32Array> array = static_cast<Float32Array*>(construct<Float32Array, float>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSFloat32ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasFloatArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSFloat32ArrayConstructor.h b/WebCore/bindings/js/JSFloat32ArrayConstructor.h
deleted file mode 100644
index c2f8b7e..0000000
--- a/WebCore/bindings/js/JSFloat32ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSFloat32ArrayConstructor_h
-#define JSFloat32ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSFloat32ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSFloat32ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSFloat32ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSFloat32ArrayCustom.cpp b/WebCore/bindings/js/JSFloat32ArrayCustom.cpp
index 7965274..3be7458 100644
--- a/WebCore/bindings/js/JSFloat32ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSFloat32ArrayCustom.cpp
@@ -51,6 +51,16 @@ JSC::JSValue JSFloat32Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toFloat32Array);
}
+EncodedJSValue JSC_HOST_CALL JSFloat32ArrayConstructor::constructJSFloat32Array(ExecState* exec)
+{
+ JSFloat32ArrayConstructor* jsConstructor = static_cast<JSFloat32ArrayConstructor*>(exec->callee());
+ RefPtr<Float32Array> array = static_cast<Float32Array*>(constructArrayBufferView<Float32Array, float>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSInt16ArrayConstructor.cpp b/WebCore/bindings/js/JSInt16ArrayConstructor.cpp
deleted file mode 100644
index aaed578..0000000
--- a/WebCore/bindings/js/JSInt16ArrayConstructor.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSInt16ArrayConstructor.h"
-
-#include "Document.h"
-#include "Int16Array.h"
-#include "JSArrayBufferView.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSInt16Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSInt16ArrayConstructor::s_info = { "Int16ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSInt16ArrayConstructor::JSInt16ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSInt16ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSInt16ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSInt16ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSInt16ArrayPrototype(globalObject, JSInt16ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSInt16ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSInt16ArrayConstructor, DOMObject>(exec, JSInt16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSInt16ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSInt16ArrayConstructor, DOMObject>(exec, JSInt16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasShortArray(ExecState* exec)
-{
- ArgList args(exec);
- JSInt16ArrayConstructor* jsConstructor = static_cast<JSInt16ArrayConstructor*>(exec->callee());
- RefPtr<Int16Array> array = static_cast<Int16Array*>(construct<Int16Array, short>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSInt16ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasShortArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSInt16ArrayConstructor.h b/WebCore/bindings/js/JSInt16ArrayConstructor.h
deleted file mode 100644
index 87908a0..0000000
--- a/WebCore/bindings/js/JSInt16ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSInt16ArrayConstructor_h
-#define JSInt16ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSInt16ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSInt16ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSInt16ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSInt16ArrayCustom.cpp b/WebCore/bindings/js/JSInt16ArrayCustom.cpp
index 2888a1b..e8be4d1 100644
--- a/WebCore/bindings/js/JSInt16ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSInt16ArrayCustom.cpp
@@ -51,6 +51,16 @@ JSC::JSValue JSInt16Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toInt16Array);
}
+EncodedJSValue JSC_HOST_CALL JSInt16ArrayConstructor::constructJSInt16Array(ExecState* exec)
+{
+ JSInt16ArrayConstructor* jsConstructor = static_cast<JSInt16ArrayConstructor*>(exec->callee());
+ RefPtr<Int16Array> array = static_cast<Int16Array*>(constructArrayBufferView<Int16Array, short>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSInt32ArrayConstructor.cpp b/WebCore/bindings/js/JSInt32ArrayConstructor.cpp
deleted file mode 100644
index b44c9ca..0000000
--- a/WebCore/bindings/js/JSInt32ArrayConstructor.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSInt32ArrayConstructor.h"
-
-#include "Document.h"
-#include "Int32Array.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSInt32Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSInt32ArrayConstructor::s_info = { "Int32ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSInt32ArrayConstructor::JSInt32ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSInt32ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSInt32ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSInt32ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSInt32ArrayPrototype(globalObject, JSInt32ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSInt32ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSInt32ArrayConstructor, DOMObject>(exec, JSInt32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSInt32ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSInt32ArrayConstructor, DOMObject>(exec, JSInt32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasIntArray(ExecState* exec)
-{
- ArgList args(exec);
- JSInt32ArrayConstructor* jsConstructor = static_cast<JSInt32ArrayConstructor*>(exec->callee());
- RefPtr<Int32Array> array = static_cast<Int32Array*>(construct<Int32Array, int>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSInt32ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasIntArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSInt32ArrayConstructor.h b/WebCore/bindings/js/JSInt32ArrayConstructor.h
deleted file mode 100644
index 6bed3c4..0000000
--- a/WebCore/bindings/js/JSInt32ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSInt32ArrayConstructor_h
-#define JSInt32ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSInt32ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSInt32ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSInt32ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSInt32ArrayCustom.cpp b/WebCore/bindings/js/JSInt32ArrayCustom.cpp
index cfdab63..ee5712b 100644
--- a/WebCore/bindings/js/JSInt32ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSInt32ArrayCustom.cpp
@@ -51,6 +51,16 @@ JSC::JSValue JSInt32Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toInt32Array);
}
+EncodedJSValue JSC_HOST_CALL JSInt32ArrayConstructor::constructJSInt32Array(ExecState* exec)
+{
+ JSInt32ArrayConstructor* jsConstructor = static_cast<JSInt32ArrayConstructor*>(exec->callee());
+ RefPtr<Int32Array> array = static_cast<Int32Array*>(constructArrayBufferView<Int32Array, int>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSInt8ArrayConstructor.cpp b/WebCore/bindings/js/JSInt8ArrayConstructor.cpp
deleted file mode 100644
index e4c5688..0000000
--- a/WebCore/bindings/js/JSInt8ArrayConstructor.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSInt8ArrayConstructor.h"
-
-#include "Document.h"
-#include "Int8Array.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSInt8Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSInt8ArrayConstructor::s_info = { "Int8ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSInt8ArrayConstructor::JSInt8ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSInt8ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSInt8ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSInt8ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSInt8ArrayPrototype(globalObject, JSInt8ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSInt8ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSInt8ArrayConstructor, DOMObject>(exec, JSInt8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSInt8ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSInt8ArrayConstructor, DOMObject>(exec, JSInt8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasByteArray(ExecState* exec)
-{
- ArgList args(exec);
- JSInt8ArrayConstructor* jsConstructor = static_cast<JSInt8ArrayConstructor*>(exec->callee());
- RefPtr<Int8Array> array = static_cast<Int8Array*>(construct<Int8Array, signed char>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSInt8ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasByteArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSInt8ArrayConstructor.h b/WebCore/bindings/js/JSInt8ArrayConstructor.h
deleted file mode 100644
index 96482fc..0000000
--- a/WebCore/bindings/js/JSInt8ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSInt8ArrayConstructor_h
-#define JSInt8ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSInt8ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSInt8ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSInt8ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSInt8ArrayCustom.cpp b/WebCore/bindings/js/JSInt8ArrayCustom.cpp
index 9d41694..70f18a5 100644
--- a/WebCore/bindings/js/JSInt8ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSInt8ArrayCustom.cpp
@@ -31,7 +31,6 @@
#include "JSInt8Array.h"
#include "Int8Array.h"
-
#include <runtime/Error.h>
using namespace JSC;
@@ -53,6 +52,16 @@ JSC::JSValue JSInt8Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toInt8Array);
}
+EncodedJSValue JSC_HOST_CALL JSInt8ArrayConstructor::constructJSInt8Array(ExecState* exec)
+{
+ JSInt8ArrayConstructor* jsConstructor = static_cast<JSInt8ArrayConstructor*>(exec->callee());
+ RefPtr<Int8Array> array = static_cast<Int8Array*>(constructArrayBufferView<Int8Array, signed char>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSMessageChannelConstructor.cpp b/WebCore/bindings/js/JSMessageChannelConstructor.cpp
deleted file mode 100644
index b188ed5..0000000
--- a/WebCore/bindings/js/JSMessageChannelConstructor.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "JSMessageChannelConstructor.h"
-
-#include "Document.h"
-#include "JSDocument.h"
-#include "JSMessageChannel.h"
-#include "MessageChannel.h"
-#include <runtime/Error.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-const ClassInfo JSMessageChannelConstructor::s_info = { "MessageChannelConstructor", 0, 0, 0 };
-
-JSMessageChannelConstructor::JSMessageChannelConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSMessageChannelConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSMessageChannelPrototype::self(exec, globalObject), None);
-}
-
-JSMessageChannelConstructor::~JSMessageChannelConstructor()
-{
-}
-
-ConstructType JSMessageChannelConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = construct;
- return ConstructTypeHost;
-}
-
-EncodedJSValue JSC_HOST_CALL JSMessageChannelConstructor::construct(ExecState* exec)
-{
- JSMessageChannelConstructor* jsConstructor = static_cast<JSMessageChannelConstructor*>(exec->callee());
- ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
- if (!context)
- return throwVMError(exec, createReferenceError(exec, "MessageChannel constructor associated document is unavailable"));
-
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), MessageChannel::create(context))));
-}
-
-} // namespace WebCore
diff --git a/WebCore/bindings/js/JSMessageChannelCustom.cpp b/WebCore/bindings/js/JSMessageChannelCustom.cpp
index d28d494..c2f5779 100644
--- a/WebCore/bindings/js/JSMessageChannelCustom.cpp
+++ b/WebCore/bindings/js/JSMessageChannelCustom.cpp
@@ -27,6 +27,7 @@
#include "JSMessageChannel.h"
#include "MessageChannel.h"
+#include <runtime/Error.h>
using namespace JSC;
@@ -43,4 +44,14 @@ void JSMessageChannel::markChildren(MarkStack& markStack)
markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
}
+EncodedJSValue JSC_HOST_CALL JSMessageChannelConstructor::constructJSMessageChannel(ExecState* exec)
+{
+ JSMessageChannelConstructor* jsConstructor = static_cast<JSMessageChannelConstructor*>(exec->callee());
+ ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
+ if (!context)
+ return throwVMError(exec, createReferenceError(exec, "MessageChannel constructor associated document is unavailable"));
+
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), MessageChannel::create(context))));
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSSharedWorkerConstructor.cpp b/WebCore/bindings/js/JSSharedWorkerConstructor.cpp
deleted file mode 100644
index f2bf6de..0000000
--- a/WebCore/bindings/js/JSSharedWorkerConstructor.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(SHARED_WORKERS)
-
-#include "JSSharedWorkerConstructor.h"
-
-#include "JSDOMWindowCustom.h"
-#include "JSSharedWorker.h"
-#include "SharedWorker.h"
-#include <runtime/Error.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-const ClassInfo JSSharedWorkerConstructor::s_info = { "SharedWorkerConstructor", 0, 0, 0 };
-
-JSSharedWorkerConstructor::JSSharedWorkerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSSharedWorkerConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSSharedWorkerPrototype::self(exec, globalObject), None);
- // Host functions have a length property describing the number of expected arguments.
- putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructSharedWorker(ExecState* exec)
-{
- JSSharedWorkerConstructor* jsConstructor = static_cast<JSSharedWorkerConstructor*>(exec->callee());
-
- if (exec->argumentCount() < 1)
- return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
-
- UString scriptURL = exec->argument(0).toString(exec);
- UString name;
- if (exec->argumentCount() > 1)
- name = exec->argument(1).toString(exec);
-
- if (exec->hadException())
- return JSValue::encode(JSValue());
-
- // FIXME: We need to use both the dynamic scope and the lexical scope (dynamic scope for resolving the worker URL)
- DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
- ExceptionCode ec = 0;
- RefPtr<SharedWorker> worker = SharedWorker::create(ustringToString(scriptURL), ustringToString(name), window->document(), ec);
- setDOMException(exec, ec);
-
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), worker.release())));
-}
-
-ConstructType JSSharedWorkerConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = constructSharedWorker;
- return ConstructTypeHost;
-}
-
-
-} // namespace WebCore
-
-#endif // ENABLE(SHARED_WORKERS)
diff --git a/WebCore/bindings/js/JSSharedWorkerCustom.cpp b/WebCore/bindings/js/JSSharedWorkerCustom.cpp
index 4617087..261ae2b 100644
--- a/WebCore/bindings/js/JSSharedWorkerCustom.cpp
+++ b/WebCore/bindings/js/JSSharedWorkerCustom.cpp
@@ -35,7 +35,9 @@
#include "JSSharedWorker.h"
#include "JSDOMGlobalObject.h"
+#include "JSDOMWindowCustom.h"
#include "SharedWorker.h"
+#include <runtime/Error.h>
using namespace JSC;
@@ -49,6 +51,30 @@ void JSSharedWorker::markChildren(MarkStack& markStack)
markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), port);
}
+EncodedJSValue JSC_HOST_CALL JSSharedWorkerConstructor::constructJSSharedWorker(ExecState* exec)
+{
+ JSSharedWorkerConstructor* jsConstructor = static_cast<JSSharedWorkerConstructor*>(exec->callee());
+
+ if (exec->argumentCount() < 1)
+ return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
+
+ UString scriptURL = exec->argument(0).toString(exec);
+ UString name;
+ if (exec->argumentCount() > 1)
+ name = exec->argument(1).toString(exec);
+
+ if (exec->hadException())
+ return JSValue::encode(JSValue());
+
+ // FIXME: We need to use both the dynamic scope and the lexical scope (dynamic scope for resolving the worker URL)
+ DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
+ ExceptionCode ec = 0;
+ RefPtr<SharedWorker> worker = SharedWorker::create(ustringToString(scriptURL), ustringToString(name), window->document(), ec);
+ setDOMException(exec, ec);
+
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), worker.release())));
+}
+
} // namespace WebCore
#endif // ENABLE(SHARED_WORKERS)
diff --git a/WebCore/bindings/js/JSUint16ArrayConstructor.cpp b/WebCore/bindings/js/JSUint16ArrayConstructor.cpp
deleted file mode 100644
index b1770c5..0000000
--- a/WebCore/bindings/js/JSUint16ArrayConstructor.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSUint16ArrayConstructor.h"
-
-#include "Document.h"
-#include "Uint16Array.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSUint16Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSUint16ArrayConstructor::s_info = { "Uint16ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSUint16ArrayConstructor::JSUint16ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSUint16ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSUint16ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSUint16ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSUint16ArrayPrototype(globalObject, JSUint16ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSUint16ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSUint16ArrayConstructor, DOMObject>(exec, JSUint16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSUint16ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSUint16ArrayConstructor, DOMObject>(exec, JSUint16ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasUnsignedShortArray(ExecState* exec)
-{
- ArgList args(exec);
- JSUint16ArrayConstructor* jsConstructor = static_cast<JSUint16ArrayConstructor*>(exec->callee());
- RefPtr<Uint16Array> array = static_cast<Uint16Array*>(construct<Uint16Array, unsigned short>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSUint16ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasUnsignedShortArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSUint16ArrayConstructor.h b/WebCore/bindings/js/JSUint16ArrayConstructor.h
deleted file mode 100644
index b950791..0000000
--- a/WebCore/bindings/js/JSUint16ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSUint16ArrayConstructor_h
-#define JSUint16ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSUint16ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSUint16ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSUint16ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSUint16ArrayCustom.cpp b/WebCore/bindings/js/JSUint16ArrayCustom.cpp
index 4eb254f..ccea62f 100644
--- a/WebCore/bindings/js/JSUint16ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSUint16ArrayCustom.cpp
@@ -51,6 +51,16 @@ JSC::JSValue JSUint16Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toUint16Array);
}
+EncodedJSValue JSC_HOST_CALL JSUint16ArrayConstructor::constructJSUint16Array(ExecState* exec)
+{
+ JSUint16ArrayConstructor* jsConstructor = static_cast<JSUint16ArrayConstructor*>(exec->callee());
+ RefPtr<Uint16Array> array = static_cast<Uint16Array*>(constructArrayBufferView<Uint16Array, unsigned short>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSUint32ArrayConstructor.cpp b/WebCore/bindings/js/JSUint32ArrayConstructor.cpp
deleted file mode 100644
index 46ec9da..0000000
--- a/WebCore/bindings/js/JSUint32ArrayConstructor.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSUint32ArrayConstructor.h"
-
-#include "Document.h"
-#include "Uint32Array.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSUint32Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSUint32ArrayConstructor::s_info = { "Uint32ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSUint32ArrayConstructor::JSUint32ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSUint32ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSUint32ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSUint32ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSUint32ArrayPrototype(globalObject, JSUint32ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSUint32ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSUint32ArrayConstructor, DOMObject>(exec, JSUint32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSUint32ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSUint32ArrayConstructor, DOMObject>(exec, JSUint32ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasUnsignedIntArray(ExecState* exec)
-{
- ArgList args(exec);
- JSUint32ArrayConstructor* jsConstructor = static_cast<JSUint32ArrayConstructor*>(exec->callee());
- RefPtr<Uint32Array> array = static_cast<Uint32Array*>(construct<Uint32Array, unsigned int>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSUint32ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasUnsignedIntArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSUint32ArrayConstructor.h b/WebCore/bindings/js/JSUint32ArrayConstructor.h
deleted file mode 100644
index 7cad849..0000000
--- a/WebCore/bindings/js/JSUint32ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSUint32ArrayConstructor_h
-#define JSUint32ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSUint32ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSUint32ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSUint32ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSUint32ArrayCustom.cpp b/WebCore/bindings/js/JSUint32ArrayCustom.cpp
index 2826b6a..31ec8cb 100644
--- a/WebCore/bindings/js/JSUint32ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSUint32ArrayCustom.cpp
@@ -51,6 +51,16 @@ JSC::JSValue JSUint32Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toUint32Array);
}
+EncodedJSValue JSC_HOST_CALL JSUint32ArrayConstructor::constructJSUint32Array(ExecState* exec)
+{
+ JSUint32ArrayConstructor* jsConstructor = static_cast<JSUint32ArrayConstructor*>(exec->callee());
+ RefPtr<Uint32Array> array = static_cast<Uint32Array*>(constructArrayBufferView<Uint32Array, unsigned int>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSUint8ArrayConstructor.cpp b/WebCore/bindings/js/JSUint8ArrayConstructor.cpp
deleted file mode 100644
index 0d47b51..0000000
--- a/WebCore/bindings/js/JSUint8ArrayConstructor.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(3D_CANVAS)
-
-#include "JSUint8ArrayConstructor.h"
-
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "Uint8Array.h"
-#include "JSArrayBuffer.h"
-#include "JSArrayBufferConstructor.h"
-#include "JSUint8Array.h"
-#include <runtime/Error.h>
-
-namespace WebCore {
-
-using namespace JSC;
-
-const ClassInfo JSUint8ArrayConstructor::s_info = { "Uint8ArrayConstructor", &JSArrayBufferView::s_info, 0, 0 };
-
-JSUint8ArrayConstructor::JSUint8ArrayConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSUint8ArrayConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSUint8ArrayPrototype::self(exec, globalObject), DontDelete | ReadOnly);
-}
-
-JSObject* JSUint8ArrayConstructor::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
-{
- return new (exec) JSUint8ArrayPrototype(globalObject, JSUint8ArrayPrototype::createStructure(globalObject->objectPrototype()));
-}
-
-bool JSUint8ArrayConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
-{
- return getStaticValueSlot<JSUint8ArrayConstructor, DOMObject>(exec, JSUint8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, slot);
-}
-
-bool JSUint8ArrayConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
-{
- return getStaticValueDescriptor<JSUint8ArrayConstructor, DOMObject>(exec, JSUint8ArrayPrototype::s_info.staticPropHashTable, this, propertyName, descriptor);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructCanvasUnsignedByteArray(ExecState* exec)
-{
- ArgList args(exec);
- JSUint8ArrayConstructor* jsConstructor = static_cast<JSUint8ArrayConstructor*>(exec->callee());
- RefPtr<Uint8Array> array = static_cast<Uint8Array*>(construct<Uint8Array, unsigned char>(exec, args).get());
- if (!array.get()) {
- setDOMException(exec, INDEX_SIZE_ERR);
- return JSValue::encode(JSValue());
- }
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
-}
-
-JSC::ConstructType JSUint8ArrayConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructCanvasUnsignedByteArray;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSUint8ArrayConstructor.h b/WebCore/bindings/js/JSUint8ArrayConstructor.h
deleted file mode 100644
index 644cf86..0000000
--- a/WebCore/bindings/js/JSUint8ArrayConstructor.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef JSUint8ArrayConstructor_h
-#define JSUint8ArrayConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
-
-namespace WebCore {
-
- class JSUint8ArrayConstructor : public DOMConstructorObject {
- typedef DOMConstructorObject Base;
- public:
- JSUint8ArrayConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
- virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
- virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
- static const JSC::ClassInfo s_info;
-
- static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
- {
- return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- protected:
- static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
- };
-
-}
-
-#endif // JSUint8ArrayConstructor_h
diff --git a/WebCore/bindings/js/JSUint8ArrayCustom.cpp b/WebCore/bindings/js/JSUint8ArrayCustom.cpp
index 45c80c0..7361b08 100644
--- a/WebCore/bindings/js/JSUint8ArrayCustom.cpp
+++ b/WebCore/bindings/js/JSUint8ArrayCustom.cpp
@@ -51,6 +51,16 @@ JSC::JSValue JSUint8Array::set(JSC::ExecState* exec)
return setWebGLArrayHelper(exec, impl(), toUint8Array);
}
+EncodedJSValue JSC_HOST_CALL JSUint8ArrayConstructor::constructJSUint8Array(ExecState* exec)
+{
+ JSUint8ArrayConstructor* jsConstructor = static_cast<JSUint8ArrayConstructor*>(exec->callee());
+ RefPtr<Uint8Array> array = static_cast<Uint8Array*>(constructArrayBufferView<Uint8Array, unsigned char>(exec).get());
+ if (!array.get())
+ // Exception has already been thrown.
+ return JSValue::encode(JSValue());
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), array.get())));
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp b/WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp
index 5013a6d..0889dcf 100644
--- a/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.cpp
+++ b/WebCore/bindings/js/JSWebKitCSSMatrixCustom.cpp
@@ -24,25 +24,15 @@
*/
#include "config.h"
-#include "JSWebKitCSSMatrixConstructor.h"
+#include "JSWebKitCSSMatrix.h"
#include "WebKitCSSMatrix.h"
-#include "JSWebKitCSSMatrix.h"
using namespace JSC;
namespace WebCore {
-const ClassInfo JSWebKitCSSMatrixConstructor::s_info = { "WebKitCSSMatrixConstructor", 0, 0, 0 };
-
-JSWebKitCSSMatrixConstructor::JSWebKitCSSMatrixConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSWebKitCSSMatrixConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSWebKitCSSMatrixPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly|DontDelete|DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructWebKitCSSMatrix(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL JSWebKitCSSMatrixConstructor::constructJSWebKitCSSMatrix(ExecState* exec)
{
JSWebKitCSSMatrixConstructor* jsConstructor = static_cast<JSWebKitCSSMatrixConstructor*>(exec->callee());
String s;
@@ -55,10 +45,4 @@ static EncodedJSValue JSC_HOST_CALL constructWebKitCSSMatrix(ExecState* exec)
return JSValue::encode(CREATE_DOM_OBJECT_WRAPPER(exec, jsConstructor->globalObject(), WebKitCSSMatrix, matrix.get()));
}
-ConstructType JSWebKitCSSMatrixConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = constructWebKitCSSMatrix;
- return ConstructTypeHost;
-}
-
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSWebKitPointConstructor.cpp b/WebCore/bindings/js/JSWebKitPointCustom.cpp
index c62f5b6..e1b20ce 100644
--- a/WebCore/bindings/js/JSWebKitPointConstructor.cpp
+++ b/WebCore/bindings/js/JSWebKitPointCustom.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,34 +24,23 @@
*/
#include "config.h"
-#include "JSWebKitPointConstructor.h"
-
-#include "Document.h"
-#include "WebKitPoint.h"
#include "JSWebKitPoint.h"
-namespace WebCore {
+#include "WebKitPoint.h"
using namespace JSC;
-const ClassInfo JSWebKitPointConstructor::s_info = { "WebKitPointConstructor", 0, 0, 0 };
-
-JSWebKitPointConstructor::JSWebKitPointConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSWebKitPointConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSWebKitPointPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 2), ReadOnly|DontDelete|DontEnum);
-}
+namespace WebCore {
-static EncodedJSValue JSC_HOST_CALL constructWebKitPoint(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL JSWebKitPointConstructor::constructJSWebKitPoint(ExecState* exec)
{
JSWebKitPointConstructor* jsConstructor = static_cast<JSWebKitPointConstructor*>(exec->callee());
float x = 0;
float y = 0;
if (exec->argumentCount() >= 2) {
- x = (float)exec->argument(0).toNumber(exec);
- y = (float)exec->argument(1).toNumber(exec);
+ x = static_cast<float>(exec->argument(0).toNumber(exec));
+ y = static_cast<float>(exec->argument(1).toNumber(exec));
if (isnan(x))
x = 0;
if (isnan(y))
@@ -60,11 +49,4 @@ static EncodedJSValue JSC_HOST_CALL constructWebKitPoint(ExecState* exec)
return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), WebKitPoint::create(x, y))));
}
-JSC::ConstructType JSWebKitPointConstructor::getConstructData(JSC::ConstructData& constructData)
-{
- constructData.native.function = constructWebKitPoint;
- return ConstructTypeHost;
-}
-
-
} // namespace WebCore
diff --git a/WebCore/bindings/js/JSWebSocketConstructor.cpp b/WebCore/bindings/js/JSWebSocketConstructor.cpp
deleted file mode 100644
index 2384c7b..0000000
--- a/WebCore/bindings/js/JSWebSocketConstructor.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(WEB_SOCKETS)
-
-#include "JSWebSocketConstructor.h"
-
-#include "JSWebSocket.h"
-#include "ScriptExecutionContext.h"
-#include "WebSocket.h"
-#include <runtime/Error.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-ASSERT_CLASS_FITS_IN_CELL(JSWebSocketConstructor);
-
-const ClassInfo JSWebSocketConstructor::s_info = { "WebSocketConstructor", 0, 0, 0 };
-
-JSWebSocketConstructor::JSWebSocketConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSWebSocketConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSWebSocketPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly | DontDelete | DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructWebSocket(ExecState* exec)
-{
- JSWebSocketConstructor* jsConstructor = static_cast<JSWebSocketConstructor*>(exec->callee());
- ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
- if (!context)
- return throwVMError(exec, createReferenceError(exec, "WebSocket constructor associated document is unavailable"));
-
- if (!exec->argumentCount())
- return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
-
- const String& urlString = ustringToString(exec->argument(0).toString(exec));
- if (exec->hadException())
- return throwVMError(exec, createSyntaxError(exec, "wrong URL"));
- const KURL& url = context->completeURL(urlString);
- RefPtr<WebSocket> webSocket = WebSocket::create(context);
- ExceptionCode ec = 0;
- if (exec->argumentCount() < 2)
- webSocket->connect(url, ec);
- else {
- const String& protocol = ustringToString(exec->argument(1).toString(exec));
- if (exec->hadException())
- return JSValue::encode(JSValue());
- webSocket->connect(url, protocol, ec);
- }
- setDOMException(exec, ec);
- return JSValue::encode(CREATE_DOM_OBJECT_WRAPPER(exec, jsConstructor->globalObject(), WebSocket, webSocket.get()));
-}
-
-ConstructType JSWebSocketConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = constructWebSocket;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/WebCore/bindings/js/JSWebSocketCustom.cpp b/WebCore/bindings/js/JSWebSocketCustom.cpp
index eb0fda0..3567206 100644
--- a/WebCore/bindings/js/JSWebSocketCustom.cpp
+++ b/WebCore/bindings/js/JSWebSocketCustom.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
- * Copyright (C) 2009 Apple, Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -44,21 +44,34 @@ using namespace JSC;
namespace WebCore {
-// Custom functions
-JSValue JSWebSocket::send(ExecState* exec)
+EncodedJSValue JSC_HOST_CALL JSWebSocketConstructor::constructJSWebSocket(ExecState* exec)
{
- if (exec->argumentCount() < 1)
- return throwError(exec, createSyntaxError(exec, "Not enough arguments"));
+ JSWebSocketConstructor* jsConstructor = static_cast<JSWebSocketConstructor*>(exec->callee());
+ ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
+ if (!context)
+ return throwVMError(exec, createReferenceError(exec, "WebSocket constructor associated document is unavailable"));
- const String& msg = ustringToString(exec->argument(0).toString(exec));
+ if (!exec->argumentCount())
+ return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
+
+ const String& urlString = ustringToString(exec->argument(0).toString(exec));
if (exec->hadException())
- return throwError(exec, createSyntaxError(exec, "bad message data."));
+ return throwVMError(exec, createSyntaxError(exec, "wrong URL"));
+ const KURL& url = context->completeURL(urlString);
+ RefPtr<WebSocket> webSocket = WebSocket::create(context);
ExceptionCode ec = 0;
- JSValue ret = jsBoolean(impl()->send(msg, ec));
+ if (exec->argumentCount() < 2)
+ webSocket->connect(url, ec);
+ else {
+ const String& protocol = ustringToString(exec->argument(1).toString(exec));
+ if (exec->hadException())
+ return JSValue::encode(JSValue());
+ webSocket->connect(url, protocol, ec);
+ }
setDOMException(exec, ec);
- return ret;
+ return JSValue::encode(CREATE_DOM_OBJECT_WRAPPER(exec, jsConstructor->globalObject(), WebSocket, webSocket.get()));
}
-} // namespace WebCore
+} // namespace WebCore
#endif
diff --git a/WebCore/bindings/js/JSWorkerConstructor.cpp b/WebCore/bindings/js/JSWorkerConstructor.cpp
deleted file mode 100644
index 13d8ddc..0000000
--- a/WebCore/bindings/js/JSWorkerConstructor.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(WORKERS)
-
-#include "JSWorkerConstructor.h"
-
-#include "Document.h"
-#include "ExceptionCode.h"
-#include "JSDOMWindowCustom.h"
-#include "JSWorker.h"
-#include "Worker.h"
-#include <runtime/Error.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-const ClassInfo JSWorkerConstructor::s_info = { "WorkerConstructor", 0, 0, 0 };
-
-JSWorkerConstructor::JSWorkerConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSWorkerConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSWorkerPrototype::self(exec, globalObject), None);
- putDirect(exec->propertyNames().length, jsNumber(exec, 1), ReadOnly|DontDelete|DontEnum);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructWorker(ExecState* exec)
-{
- JSWorkerConstructor* jsConstructor = static_cast<JSWorkerConstructor*>(exec->callee());
-
- if (!exec->argumentCount())
- return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
-
- UString scriptURL = exec->argument(0).toString(exec);
- if (exec->hadException())
- return JSValue::encode(JSValue());
-
- // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
- DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
-
- ExceptionCode ec = 0;
- RefPtr<Worker> worker = Worker::create(ustringToString(scriptURL), window->document(), ec);
- if (ec) {
- setDOMException(exec, ec);
- return JSValue::encode(JSValue());
- }
-
- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), worker.release())));
-}
-
-ConstructType JSWorkerConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = constructWorker;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/js/JSWorkerContextCustom.cpp b/WebCore/bindings/js/JSWorkerContextCustom.cpp
index 2bde58b..b443f90 100644
--- a/WebCore/bindings/js/JSWorkerContextCustom.cpp
+++ b/WebCore/bindings/js/JSWorkerContextCustom.cpp
@@ -31,6 +31,7 @@
#if ENABLE(DATABASE)
#include "Database.h"
+#include "DatabaseSync.h"
#include "JSDatabase.h"
#include "JSDatabaseCallback.h"
#include "JSDatabaseSync.h"
@@ -39,10 +40,9 @@
#include "JSDOMBinding.h"
#include "JSDOMGlobalObject.h"
#include "JSEventListener.h"
-#include "JSEventSourceConstructor.h"
-#include "JSMessageChannelConstructor.h"
+#include "JSEventSource.h"
+#include "JSMessageChannel.h"
#include "JSMessagePort.h"
-#include "JSWebSocketConstructor.h"
#include "JSWorkerLocation.h"
#include "JSWorkerNavigator.h"
#include "JSXMLHttpRequest.h"
@@ -52,6 +52,10 @@
#include "WorkerNavigator.h"
#include <interpreter/Interpreter.h>
+#if ENABLE(WEB_SOCKETS)
+#include "JSWebSocket.h"
+#endif
+
using namespace JSC;
namespace WebCore {
diff --git a/WebCore/bindings/js/JSWorkerCustom.cpp b/WebCore/bindings/js/JSWorkerCustom.cpp
index 64d9d41..27580ae 100644
--- a/WebCore/bindings/js/JSWorkerCustom.cpp
+++ b/WebCore/bindings/js/JSWorkerCustom.cpp
@@ -32,6 +32,8 @@
#include "JSDOMGlobalObject.h"
#include "JSMessagePortCustom.h"
#include "Worker.h"
+#include "JSDOMWindowCustom.h"
+#include <runtime/Error.h>
using namespace JSC;
@@ -42,6 +44,30 @@ JSC::JSValue JSWorker::postMessage(JSC::ExecState* exec)
return handlePostMessage(exec, impl());
}
+EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* exec)
+{
+ JSWorkerConstructor* jsConstructor = static_cast<JSWorkerConstructor*>(exec->callee());
+
+ if (!exec->argumentCount())
+ return throwVMError(exec, createSyntaxError(exec, "Not enough arguments"));
+
+ UString scriptURL = exec->argument(0).toString(exec);
+ if (exec->hadException())
+ return JSValue::encode(JSValue());
+
+ // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
+ DOMWindow* window = asJSDOMWindow(exec->lexicalGlobalObject())->impl();
+
+ ExceptionCode ec = 0;
+ RefPtr<Worker> worker = Worker::create(ustringToString(scriptURL), window->document(), ec);
+ if (ec) {
+ setDOMException(exec, ec);
+ return JSValue::encode(JSValue());
+ }
+
+ return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), worker.release())));
+}
+
} // namespace WebCore
#endif // ENABLE(WORKERS)
diff --git a/WebCore/bindings/js/JSXSLTProcessorConstructor.cpp b/WebCore/bindings/js/JSXSLTProcessorConstructor.cpp
deleted file mode 100644
index b2ebef3..0000000
--- a/WebCore/bindings/js/JSXSLTProcessorConstructor.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-
-#if ENABLE(XSLT)
-
-#include "JSXSLTProcessorConstructor.h"
-
-#include "JSXSLTProcessor.h"
-#include "XSLTProcessor.h"
-#include <wtf/RefPtr.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-ASSERT_CLASS_FITS_IN_CELL(JSXSLTProcessorConstructor);
-
-const ClassInfo JSXSLTProcessorConstructor::s_info = { "XSLTProcessorConsructor", 0, 0, 0 };
-
-JSXSLTProcessorConstructor::JSXSLTProcessorConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSXSLTProcessorConstructor::createStructure(globalObject->objectPrototype()), globalObject)
-{
- putDirect(exec->propertyNames().prototype, JSXSLTProcessorPrototype::self(exec, globalObject), None);
-}
-
-static EncodedJSValue JSC_HOST_CALL constructXSLTProcessor(ExecState* exec)
-{
- JSXSLTProcessorConstructor* jsConstructor = static_cast<JSXSLTProcessorConstructor*>(exec->callee());
- return JSValue::encode(CREATE_DOM_OBJECT_WRAPPER(exec, jsConstructor->globalObject(), XSLTProcessor, XSLTProcessor::create().get()));
-}
-
-ConstructType JSXSLTProcessorConstructor::getConstructData(ConstructData& constructData)
-{
- constructData.native.function = constructXSLTProcessor;
- return ConstructTypeHost;
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(XSLT)
diff --git a/WebCore/bindings/js/JSXSLTProcessorCustom.cpp b/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
index 63aa2b5..3423272 100644
--- a/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
+++ b/WebCore/bindings/js/JSXSLTProcessorCustom.cpp
@@ -116,6 +116,12 @@ JSValue JSXSLTProcessor::removeParameter(ExecState* exec)
return jsUndefined();
}
+EncodedJSValue JSC_HOST_CALL JSXSLTProcessorConstructor::constructJSXSLTProcessor(ExecState* exec)
+{
+ JSXSLTProcessorConstructor* jsConstructor = static_cast<JSXSLTProcessorConstructor*>(exec->callee());
+ return JSValue::encode(CREATE_DOM_OBJECT_WRAPPER(exec, jsConstructor->globalObject(), XSLTProcessor, XSLTProcessor::create().get()));
+}
+
} // namespace WebCore
#endif // ENABLE(XSLT)
diff --git a/WebCore/bindings/js/ScriptController.cpp b/WebCore/bindings/js/ScriptController.cpp
index 5c4bd4c..6f0457a 100644
--- a/WebCore/bindings/js/ScriptController.cpp
+++ b/WebCore/bindings/js/ScriptController.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "ScriptController.h"
+#include "DocumentParser.h"
#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
@@ -60,7 +61,6 @@ void ScriptController::initializeThreading()
ScriptController::ScriptController(Frame* frame)
: m_frame(frame)
- , m_handlerLineNumber(0)
, m_sourceURL(0)
, m_inExecuteScript(false)
, m_processingTimerCallback(false)
@@ -235,6 +235,14 @@ JSDOMWindowShell* ScriptController::initScript(DOMWrapperWorld* world)
return windowShell;
}
+int ScriptController::eventHandlerLineNumber() const
+{
+ // JSC expects 1-based line numbers, so we must add one here to get it right.
+ if (DocumentParser* parser = m_frame->document()->parser())
+ return parser->lineNumber() + 1;
+ return 0;
+}
+
bool ScriptController::processingUserGesture(DOMWrapperWorld* world) const
{
if (m_allowPopupsFromPlugin || isJavaScriptAnchorNavigation())
diff --git a/WebCore/bindings/js/ScriptController.h b/WebCore/bindings/js/ScriptController.h
index ee7cc7d..0debf39 100644
--- a/WebCore/bindings/js/ScriptController.h
+++ b/WebCore/bindings/js/ScriptController.h
@@ -117,9 +117,8 @@ public:
ScriptValue evaluate(const ScriptSourceCode&, ShouldAllowXSS shouldAllowXSS = DoNotAllowXSS);
ScriptValue evaluateInWorld(const ScriptSourceCode&, DOMWrapperWorld*, ShouldAllowXSS shouldAllowXSS = DoNotAllowXSS);
- void setEventHandlerLineNumber(int lineno) { m_handlerLineNumber = lineno; }
- int eventHandlerLineNumber() { return m_handlerLineNumber; }
-
+ int eventHandlerLineNumber() const;
+
void setProcessingTimerCallback(bool b) { m_processingTimerCallback = b; }
bool processingUserGesture(DOMWrapperWorld*) const;
bool anyPageIsProcessingUserGesture() const;
@@ -187,7 +186,6 @@ private:
ShellMap m_windowShells;
Frame* m_frame;
- int m_handlerLineNumber;
const String* m_sourceURL;
bool m_inExecuteScript;
diff --git a/WebCore/bindings/js/ScriptDebugServer.cpp b/WebCore/bindings/js/ScriptDebugServer.cpp
index eb0923b..1fd9ae4 100644
--- a/WebCore/bindings/js/ScriptDebugServer.cpp
+++ b/WebCore/bindings/js/ScriptDebugServer.cpp
@@ -69,6 +69,7 @@ ScriptDebugServer::ScriptDebugServer()
, m_pauseOnExceptionsState(DontPauseOnExceptions)
, m_pauseOnNextStatement(false)
, m_paused(false)
+ , m_pausedPage(0)
, m_doneProcessingDebuggerEvents(true)
, m_breakpointsActivated(true)
, m_pauseOnCallFrame(0)
@@ -113,8 +114,6 @@ void ScriptDebugServer::removeListener(ScriptDebugListener* listener, Page* page
}
didRemoveListener(page);
- if (!hasListeners())
- didRemoveLastListener();
}
void ScriptDebugServer::pageCreated(Page* page)
@@ -324,7 +323,7 @@ void ScriptDebugServer::sourceParsed(ExecState* exec, const SourceCode& source,
if (m_callingListeners)
return;
- Page* page = toPage(exec->dynamicGlobalObject());
+ Page* page = toPage(exec->lexicalGlobalObject());
if (!page)
return;
@@ -360,8 +359,6 @@ void ScriptDebugServer::dispatchFunctionToListeners(JavaScriptExecutionCallback
m_callingListeners = true;
- ASSERT(hasListeners());
-
if (ListenerSet* pageListeners = m_pageListenersMap.get(page)) {
ASSERT(!pageListeners->isEmpty());
dispatchFunctionToListeners(*pageListeners, callback);
@@ -443,6 +440,7 @@ void ScriptDebugServer::pauseIfNeeded(Page* page)
m_pauseOnCallFrame = 0;
m_pauseOnNextStatement = false;
m_paused = true;
+ m_pausedPage = page;
dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidPause, page);
@@ -458,6 +456,7 @@ void ScriptDebugServer::pauseIfNeeded(Page* page)
setJavaScriptPaused(page->group(), false);
m_paused = false;
+ m_pausedPage = 0;
dispatchFunctionToListeners(&ScriptDebugServer::dispatchDidContinue, page);
}
@@ -573,29 +572,19 @@ void ScriptDebugServer::recompileAllJSFunctions(Timer<ScriptDebugServer>*)
void ScriptDebugServer::didAddListener(Page* page)
{
recompileAllJSFunctionsSoon();
-
- if (page)
- page->setDebugger(this);
- else
- Page::setDebuggerForAllPages(this);
+ page->setDebugger(this);
}
void ScriptDebugServer::didRemoveListener(Page* page)
{
- if (page && hasListenersInterestedInPage(page))
+ if (hasListenersInterestedInPage(page))
return;
- recompileAllJSFunctionsSoon();
+ if (m_pausedPage == page)
+ m_doneProcessingDebuggerEvents = true;
- if (page)
- page->setDebugger(0);
- else
- Page::setDebuggerForAllPages(0);
-}
-
-void ScriptDebugServer::didRemoveLastListener()
-{
- m_doneProcessingDebuggerEvents = true;
+ recompileAllJSFunctionsSoon();
+ page->setDebugger(0);
}
} // namespace WebCore
diff --git a/WebCore/bindings/js/ScriptDebugServer.h b/WebCore/bindings/js/ScriptDebugServer.h
index a45fae4..dcf290e 100644
--- a/WebCore/bindings/js/ScriptDebugServer.h
+++ b/WebCore/bindings/js/ScriptDebugServer.h
@@ -101,7 +101,6 @@ private:
~ScriptDebugServer();
bool hasBreakpoint(intptr_t sourceID, unsigned lineNumber) const;
- bool hasListeners() const { return !m_pageListenersMap.isEmpty(); }
bool hasListenersInterestedInPage(Page*);
void setJavaScriptPaused(const PageGroup&, bool paused);
@@ -131,7 +130,6 @@ private:
void didAddListener(Page*);
void didRemoveListener(Page*);
- void didRemoveLastListener();
typedef HashMap<Page*, ListenerSet*> PageListenersMap;
typedef HashMap<intptr_t, SourceBreakpoints> BreakpointsMap;
@@ -141,6 +139,7 @@ private:
PauseOnExceptionsState m_pauseOnExceptionsState;
bool m_pauseOnNextStatement;
bool m_paused;
+ Page* m_pausedPage;
bool m_doneProcessingDebuggerEvents;
bool m_breakpointsActivated;
JavaScriptCallFrame* m_pauseOnCallFrame;
diff --git a/WebCore/bindings/js/ScriptProfiler.h b/WebCore/bindings/js/ScriptProfiler.h
index a86bcfb..16195a3 100644
--- a/WebCore/bindings/js/ScriptProfiler.h
+++ b/WebCore/bindings/js/ScriptProfiler.h
@@ -39,6 +39,7 @@ class ScriptProfiler : public Noncopyable {
public:
static void start(ScriptState* state, const String& title);
static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
+ static void takeHeapSnapshot() { }
};
} // namespace WebCore
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index 7c0f427..fbcee02 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -381,5 +381,86 @@ sub LinkOverloadedFunctions
}
}
+sub AttributeNameForGetterAndSetter
+{
+ my ($generator, $attribute) = @_;
+
+ my $attributeName = $attribute->signature->name;
+
+ # Avoid clash with C++ keyword.
+ $attributeName = "_operator" if $attributeName eq "operator";
+
+ # SVG animated types need to use a special attribute name.
+ # The rest of the special casing for SVG animated types is handled in the language-specific code generators.
+ $attributeName .= "Animated" if $generator->IsSVGAnimatedType($generator->StripModule($attribute->signature->type));
+
+ return $attributeName;
+}
+
+sub ContentAttributeName
+{
+ my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
+
+ my $contentAttributeName = $attribute->signature->extendedAttributes->{"Reflect"}
+ || $attribute->signature->extendedAttributes->{"ReflectURL"};
+ return undef if !$contentAttributeName;
+
+ $contentAttributeName = lc $generator->AttributeNameForGetterAndSetter($attribute) if $contentAttributeName eq "1";
+
+ my $namespace = $generator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
+
+ $implIncludes->{"${namespace}.h"} = 1;
+ return "WebCore::${namespace}::${contentAttributeName}Attr";
+}
+
+sub GetterExpressionPrefix
+{
+ my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
+
+ my $contentAttributeName = $generator->ContentAttributeName($implIncludes, $interfaceName, $attribute);
+
+ if (!$contentAttributeName) {
+ return $generator->WK_lcfirst($generator->AttributeNameForGetterAndSetter($attribute)) . "(";
+ }
+
+ my $functionName;
+ if ($attribute->signature->extendedAttributes->{"ReflectURL"}) {
+ $functionName = "getURLAttribute";
+ } elsif ($attribute->signature->type eq "boolean") {
+ $functionName = "hasAttribute";
+ } elsif ($attribute->signature->type eq "long") {
+ $functionName = "getIntegralAttribute";
+ } elsif ($attribute->signature->type eq "unsigned long") {
+ $functionName = "getUnsignedIntegralAttribute";
+ } else {
+ $functionName = "getAttribute";
+ }
+
+ return "$functionName($contentAttributeName"
+}
+
+sub SetterExpressionPrefix
+{
+ my ($generator, $implIncludes, $interfaceName, $attribute) = @_;
+
+ my $contentAttributeName = $generator->ContentAttributeName($implIncludes, $interfaceName, $attribute);
+
+ if (!$contentAttributeName) {
+ return "set" . $generator->WK_ucfirst($generator->AttributeNameForGetterAndSetter($attribute)) . "(";
+ }
+
+ my $functionName;
+ if ($attribute->signature->type eq "boolean") {
+ $functionName = "setBooleanAttribute";
+ } elsif ($attribute->signature->type eq "long") {
+ $functionName = "setIntegralAttribute";
+ } elsif ($attribute->signature->type eq "unsigned long") {
+ $functionName = "setUnsignedIntegralAttribute";
+ } else {
+ $functionName = "setAttribute";
+ }
+
+ return "$functionName($contentAttributeName, "
+}
1;
diff --git a/WebCore/bindings/scripts/CodeGeneratorCPP.pm b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
index f441b0e..7df91ca 100644
--- a/WebCore/bindings/scripts/CodeGeneratorCPP.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorCPP.pm
@@ -145,7 +145,6 @@ sub GetClassName
# special cases
return "WebDOMString" if $codeGenerator->IsStringType($name) or $name eq "SerializedScriptValue";
- return "WebDOMAbstractView" if $name eq "DOMWindow";
return "WebDOMObject" if $name eq "DOMObject";
return "bool" if $name eq "boolean";
return $name if $codeGenerator->IsPrimitiveType($name);
@@ -155,10 +154,7 @@ sub GetClassName
sub GetImplClassName
{
- my $name = $codeGenerator->StripModule(shift);
-
- return "DOMWindow" if $name eq "AbstractView";
- return $name;
+ return $codeGenerator->StripModule(shift);
}
sub GetParentImplClassName
@@ -203,7 +199,8 @@ sub ShouldSkipTypeInImplementation
return 1 if $typeInfo->signature->extendedAttributes->{"CustomArgumentHandling"}
or $typeInfo->signature->extendedAttributes->{"CustomGetter"}
- or $typeInfo->signature->extendedAttributes->{"NeedsUserGestureCheck"};
+ or $typeInfo->signature->extendedAttributes->{"NeedsUserGestureCheck"}
+ or $typeInfo->signature->extendedAttributes->{"CPPCustom"};
# FIXME: We don't generate bindings for SVG related interfaces yet
return 1 if $typeInfo->signature->name =~ /getSVGDocument/;
@@ -297,12 +294,6 @@ sub AddIncludesForType
return;
}
- if ($type eq "DOMWindow") {
- $implIncludes{"DOMWindow.h"} = 1;
- $implIncludes{"WebDOMAbstractView.h"} = 1;
- return;
- }
-
if ($type eq "EventListener") {
$implIncludes{"WebNativeEventListener.h"} = 1;
return;
@@ -388,12 +379,12 @@ sub GenerateHeader
push(@headerContent, " explicit $className($implClassNameWithNamespace*);\n");
# Copy constructor on classes which have the d-ptr
- if (@{$dataNode->parents} eq 0) {
+ if ($parentName eq "WebDOMObject") {
push(@headerContent, " $className(const $className&);\n");
}
# Destructor
- if (@{$dataNode->parents} eq 0) {
+ if ($parentName eq "WebDOMObject") {
push(@headerContent, " ~$className();\n");
}
@@ -505,7 +496,7 @@ sub GenerateHeader
push(@headerContent, "\n");
push(@headerContent, " $implClassNameWithNamespace* impl() const;\n");
- if (@{$dataNode->parents} eq 0) {
+ if ($parentName eq "WebDOMObject") {
push(@headerContent, "\nprotected:\n");
push(@headerContent, " struct ${className}Private;\n");
push(@headerContent, " ${className}Private* m_impl;\n");
@@ -607,7 +598,7 @@ sub GenerateImplementation
push(@implContent, "#include <wtf/RefPtr.h>\n\n");
# Private datastructure, encapsulating WebCore types
- if (@{$dataNode->parents} eq 0) {
+ if ($baseClass eq "WebDOMObject") {
push(@implContent, "struct ${className}::${className}Private {\n");
push(@implContent, " ${className}Private($implClassNameWithNamespace* object = 0)\n");
push(@implContent, " : impl(object)\n");
@@ -620,12 +611,12 @@ sub GenerateImplementation
# Constructor
push(@implContent, "${className}::$className()\n");
push(@implContent, " : ${baseClass}()\n");
- push(@implContent, " , m_impl(0)\n") if (@{$dataNode->parents} eq 0);
+ push(@implContent, " , m_impl(0)\n") if ($baseClass eq "WebDOMObject");
push(@implContent, "{\n");
push(@implContent, "}\n\n");
push(@implContent, "${className}::$className($implClassNameWithNamespace* impl)\n");
- if (@{$dataNode->parents} eq 0) {
+ if ($baseClass eq "WebDOMObject") {
push(@implContent, " : ${baseClass}()\n");
push(@implContent, " , m_impl(new ${className}Private(impl))\n");
push(@implContent, "{\n");
@@ -679,18 +670,7 @@ sub GenerateImplementation
# - GETTER
my $getterSig = "$attributeType $className\:\:$attributeName() const\n";
my $hasGetterException = @{$attribute->getterExceptions};
- my $getterContentHead;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterContentHead = "impl()->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr";
- } else {
- $getterContentHead = "impl()->" . $codeGenerator->WK_lcfirst($attributeName) . "(";
- }
+ my $getterContentHead = "impl()->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
my $getterContentTail = ")";
# Special cases
@@ -698,8 +678,6 @@ sub GenerateImplementation
if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$getterContentHead = "WebCore::String::number(" . $getterContentHead;
$getterContentTail .= ")";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $getterContentTail .= ".toInt()";
} elsif ($attribute->signature->type eq "SerializedScriptValue") {
$getterContentHead = "$getterContentHead";
$getterContentTail .= "->toString()";
@@ -750,10 +728,8 @@ sub GenerateImplementation
my $argName = "new" . ucfirst($attributeName);
my $arg = GetCPPTypeGetter($argName, $idlType);
- # The definition of ConvertFromString and ConvertToString is flipped for the setter
- if ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $arg = "WebCore::String::number($arg)";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
+ # The definition of ConvertToString is flipped for the setter
+ if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$arg = "WebCore::String($arg).toInt()";
}
@@ -762,18 +738,10 @@ sub GenerateImplementation
push(@implContent, "{\n");
push(@implContent, AddEarlyReturnStatement());
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
push(@implContent, " $exceptionInit\n") if $hasSetterException;
my $ec = $hasSetterException ? ", ec" : "";
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContent, " impl()->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, $arg$ec);\n");
- } else {
- push(@implContent, " impl()->$coreSetterName($arg$ec);\n");
- }
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+ push(@implContent, " impl()->$setterExpressionPrefix$arg$ec);\n");
push(@implContent, " $exceptionRaiseOnError\n") if $hasSetterException;
push(@implContent, "}\n\n");
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorGObject.pm b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
index e98c661..ef2a125 100644
--- a/WebCore/bindings/scripts/CodeGeneratorGObject.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorGObject.pm
@@ -301,11 +301,29 @@ sub GetWriteableProperties {
return @result;
}
+sub GenerateConditionalString
+{
+ my $node = shift;
+ my $conditional = $node->extendedAttributes->{"Conditional"};
+ if ($conditional) {
+ if ($conditional =~ /&/) {
+ return "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")";
+ } elsif ($conditional =~ /\|/) {
+ return "ENABLE(" . join(") || ENABLE(", split(/\|/, $conditional)) . ")";
+ } else {
+ return "ENABLE(" . $conditional . ")";
+ }
+ } else {
+ return "";
+ }
+}
+
sub GenerateProperty {
my $attribute = shift;
my $interfaceName = shift;
my @writeableProperties = @{shift @_};
+ my $conditionalString = GenerateConditionalString($attribute->signature);
my $camelPropName = $attribute->signature->name;
my $setPropNameFunction = $codeGenerator->WK_ucfirst($camelPropName);
my $getPropNameFunction = $codeGenerator->WK_lcfirst($camelPropName);
@@ -314,7 +332,9 @@ sub GenerateProperty {
my $propNameCaps = uc($propName);
$propName =~ s/_/-/g;
my ${propEnum} = "PROP_${propNameCaps}";
+ push(@cBodyPriv, "#if ${conditionalString}\n") if $conditionalString;
push(@cBodyPriv, " ${propEnum},\n");
+ push(@cBodyPriv, "#endif /* ${conditionalString} */\n") if $conditionalString;
my $propType = $attribute->signature->type;
my ${propGType} = decamelize($propType);
@@ -341,35 +361,26 @@ sub GenerateProperty {
my $convertFunction = "";
if ($gtype eq "string") {
$convertFunction = "WebCore::String::fromUTF8";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $convertFunction = "WebCore::String::number";
}
- my $setterContentHead;
- my $getterContentHead;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $camelPropName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $setterContentHead = "coreSelf->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, ${convertFunction}(g_value_get_$gtype(value))";
- $getterContentHead = "coreSelf->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr";
- } else {
- $setterContentHead = "coreSelf->set${setPropNameFunction}(${convertFunction}(g_value_get_$gtype(value))";
- $getterContentHead = "coreSelf->${getPropNameFunction}(";
- }
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+
+ my $getterContentHead = "coreSelf->$getterExpressionPrefix";
+ my $setterContentHead = "coreSelf->$setterExpressionPrefix${convertFunction}(g_value_get_$gtype(value))";
if (grep {$_ eq $attribute} @writeableProperties) {
+ push(@txtSetProps, "#if ${conditionalString}\n") if $conditionalString;
push(@txtSetProps, " case ${propEnum}:\n {\n");
push(@txtSetProps, " WebCore::ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
push(@txtSetProps, " ${setterContentHead}");
push(@txtSetProps, ", ec") if @{$attribute->setterExceptions};
push(@txtSetProps, ");\n");
push(@txtSetProps, " break;\n }\n");
+ push(@txtSetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
}
+ push(@txtGetProps, "#if ${conditionalString}\n") if $conditionalString;
push(@txtGetProps, " case ${propEnum}:\n {\n");
my $exception = "";
@@ -392,17 +403,6 @@ EOF
$done = 1;
}
- if($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- # TODO: Add other conversion functions for different types. Current
- # IDLs only list longs.
- if($gtype eq "long") {
- $convertFunction = "";
- $postConvertFunction = ".toInt()";
- } else {
- die "Can't convert to type ${gtype}.";
- }
- }
-
# FIXME: get rid of this glitch?
my $_gtype = $gtype;
if ($gtype eq "ushort") {
@@ -410,10 +410,11 @@ EOF
}
if (!$done) {
- push(@txtGetProps, " g_value_set_$_gtype(value, ${convertFunction}coreSelf->${getPropNameFunction}(${exception})${postConvertFunction});\n");
+ push(@txtGetProps, " g_value_set_$_gtype(value, ${convertFunction}coreSelf->${getterExpressionPrefix}${exception})${postConvertFunction});\n");
}
push(@txtGetProps, " break;\n }\n");
+ push(@txtGetProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
my %param_spec_options = ("int", "G_MININT, /* min */\nG_MAXINT, /* max */\n0, /* default */",
"boolean", "FALSE, /* default */",
@@ -439,7 +440,9 @@ EOF
$param_spec_options{$gtype}
${gparamflag}));
EOF
+ push(@txtInstallProps, "#if ${conditionalString}\n") if $conditionalString;
push(@txtInstallProps, $txtInstallProp);
+ push(@txtInstallProps, "#endif /* ${conditionalString} */\n") if $conditionalString;
}
my %breakWords = ("before" => 1, "can" => 1, "context" => 1, "dbl" => 1, "drag" => 1,
@@ -755,10 +758,11 @@ sub GenerateFunction {
}
my $functionSigName = $function->signature->name;
- my $functionSigType = $function->signature->type;
+ my $functionSigType = $prefix eq "set_" ? "void" : $function->signature->type;
my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . decamelize($functionSigName);
my $returnType = GetGlibTypeName($functionSigType);
my $returnValueIsGDOMType = IsGDOMClassType($functionSigType);
+ my $conditionalString = GenerateConditionalString($function->signature);
my $functionSig = "${className}* self";
@@ -788,7 +792,7 @@ sub GenerateFunction {
}
}
if ($paramIsGDOMType || ($paramIDLType eq "DOMString") || ($paramIDLType eq "CompareHow")) {
- $paramName = "_g_" . $paramName;
+ $paramName = "converted_" . $paramName;
}
if ($callImplParams) {
$callImplParams .= ", $paramName";
@@ -812,7 +816,12 @@ sub GenerateFunction {
$functionSig .= ", GError **error";
}
- push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n\n");
+ push(@hBody, "#if ${conditionalString}\n") if $conditionalString;
+ push(@hBody, "WEBKIT_API $returnType\n$functionName($functionSig);\n");
+ push(@hBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
+ push(@hBody, "\n");
+
+ push(@cBody, "#if ${conditionalString}\n") if $conditionalString;
push(@cBody, "$returnType\n$functionName($functionSig)\n{\n");
if ($conditionalMethods{$functionName}) {
@@ -821,9 +830,9 @@ sub GenerateFunction {
if ($returnType ne "void") {
# TODO: return proper default result
- push(@cBody, " g_return_val_if_fail (self, 0);\n");
+ push(@cBody, " g_return_val_if_fail(self, 0);\n");
} else {
- push(@cBody, " g_return_if_fail (self);\n");
+ push(@cBody, " g_return_if_fail(self);\n");
}
# The WebKit::core implementations check for NULL already; no need to
@@ -838,9 +847,9 @@ sub GenerateFunction {
if (!$paramTypeIsPrimitive) {
if ($returnType ne "void") {
# TODO: return proper default result
- push(@cBody, " g_return_val_if_fail ($paramName, 0);\n");
+ push(@cBody, " g_return_val_if_fail($paramName, 0);\n");
} else {
- push(@cBody, " g_return_if_fail ($paramName);\n");
+ push(@cBody, " g_return_if_fail($paramName);\n");
}
}
}
@@ -852,19 +861,19 @@ sub GenerateFunction {
my $paramIsGDOMType = IsGDOMClassType($paramIDLType);
if ($paramIDLType eq "DOMString") {
- push(@cBody, " WebCore::String _g_${paramName} = WebCore::String::fromUTF8($paramName);\n");
+ push(@cBody, " WebCore::String converted_${paramName} = WebCore::String::fromUTF8($paramName);\n");
} elsif ($paramIDLType eq "CompareHow") {
- push(@cBody, " WebCore::Range::CompareHow _g_${paramName} = static_cast<WebCore::Range::CompareHow>($paramName);\n");
+ push(@cBody, " WebCore::Range::CompareHow converted_${paramName} = static_cast<WebCore::Range::CompareHow>($paramName);\n");
} elsif ($paramIsGDOMType) {
- push(@cBody, " WebCore::${paramIDLType} * _g_${paramName} = WebKit::core($paramName);\n");
+ push(@cBody, " WebCore::${paramIDLType} * converted_${paramName} = WebKit::core($paramName);\n");
if ($returnType ne "void") {
# TODO: return proper default result
- push(@cBody, " g_return_val_if_fail (_g_${paramName}, 0);\n");
+ push(@cBody, " g_return_val_if_fail(converted_${paramName}, 0);\n");
} else {
- push(@cBody, " g_return_if_fail (_g_${paramName});\n");
+ push(@cBody, " g_return_if_fail(converted_${paramName});\n");
}
}
- $returnParamName = "_g_".$paramName if $param->extendedAttributes->{"Return"};
+ $returnParamName = "converted_".$paramName if $param->extendedAttributes->{"Return"};
}
my $assign = "";
@@ -923,35 +932,25 @@ EOF
return;
} elsif ($functionSigType eq "DOMString") {
my $getterContentHead;
- my $reflect = $function->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $function->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $functionSigName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterContentHead = "${assign}convertToUTF8String(item->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr));\n";
+ if ($prefix) {
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $function);
+ $getterContentHead = "${assign}convertToUTF8String(item->$getterExpressionPrefix${exceptions}));\n";
} else {
$getterContentHead = "${assign}convertToUTF8String(item->${functionSigName}(${callImplParams}${exceptions}));\n";
}
-
push(@cBody, " ${getterContentHead}");
} else {
- my $setterContentHead;
- my $reflect = $function->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $function->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $functionSigName : ($reflect || $reflectURL);
- $contentAttributeName =~ s/set//;
- $contentAttributeName = $codeGenerator->WK_lcfirst($contentAttributeName);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- $setterContentHead = "${assign}${assignPre}item->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, ${callImplParams}${exceptions}${assignPost});\n";
+ my $contentHead;
+ if ($prefix eq "get_") {
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $function);
+ $contentHead = "${assign}${assignPre}item->$getterExpressionPrefix${callImplParams}${exceptions}${assignPost});\n";
+ } elsif ($prefix eq "set_") {
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $function);
+ $contentHead = "${assign}${assignPre}item->$setterExpressionPrefix${callImplParams}${exceptions}${assignPost});\n";
} else {
- $setterContentHead = "${assign}${assignPre}item->${functionSigName}(${callImplParams}${exceptions}${assignPost});\n";
+ $contentHead = "${assign}${assignPre}item->${functionSigName}(${callImplParams}${exceptions}${assignPost});\n";
}
-
- push(@cBody, " ${setterContentHead}");
+ push(@cBody, " ${contentHead}");
if(@{$function->raisesExceptions}) {
my $exceptionHandling = << "EOF";
@@ -982,7 +981,9 @@ EOF
push(@cBody, "#endif\n");
}
- push(@cBody, "}\n\n");
+ push(@cBody, "}\n");
+ push(@cBody, "#endif /* ${conditionalString} */\n") if $conditionalString;
+ push(@cBody, "\n");
}
sub ClassHasFunction {
@@ -1014,7 +1015,6 @@ sub GenerateFunctions {
# This will conflict with the get_type() function we define to return a GType
# according to GObject conventions. Skip this for now.
|| $attribute->signature->name eq "URL" # TODO: handle this
- || $attribute->signature->extendedAttributes->{"ConvertFromString"} # TODO: handle this
) {
next TOP;
}
@@ -1044,8 +1044,8 @@ sub GenerateFunctions {
$function = new domFunction();
$function->signature(new domSignature());
- $function->signature->name($setname);
- $function->signature->type("void");
+ $function->signature->name($attribute->signature->name);
+ $function->signature->type($attribute->signature->type);
$function->signature->extendedAttributes($attribute->signature->extendedAttributes);
my $param = new domSignature();
@@ -1058,7 +1058,7 @@ sub GenerateFunctions {
$function->raisesExceptions($attribute->setterExceptions);
- $object->GenerateFunction($interfaceName, $function, "");
+ $object->GenerateFunction($interfaceName, $function, "set_");
}
}
@@ -1128,7 +1128,7 @@ sub GenerateEndHeader {
my $guard = $className . "_h";
push(@hBody, "G_END_DECLS\n\n");
- push(@hBody, "#endif /* $guard */\n");
+ push(@hPrefixGuardEnd, "#endif /* $guard */\n");
}
sub GeneratePrivateHeader {
@@ -1189,7 +1189,7 @@ EOF
#endif /* ${guard} */
EOF
print PRIVHEADER $text;
-
+
close(PRIVHEADER);
}
@@ -1248,6 +1248,11 @@ sub Generate {
my $parentGObjType = GetParentGObjType($dataNode);
my $interfaceName = $dataNode->name;
+ # Add the guard if the 'Conditional' extended attribute exists
+ my $conditionalString = GenerateConditionalString($dataNode);
+ push(@conditionGuardStart, "#if ${conditionalString}\n\n") if $conditionalString;
+ push(@conditionGuardEnd, "#endif /* ${conditionalString} */\n") if $conditionalString;
+
# Add the default impl header template
@cPrefix = split("\r", $licenceTemplate);
push(@cPrefix, "\n");
@@ -1308,6 +1313,7 @@ sub WriteData {
print HEADER "\n";
print HEADER @hBodyPre;
print HEADER @hBody;
+ print HEADER @hPrefixGuardEnd;
close(HEADER);
@@ -1318,6 +1324,7 @@ sub WriteData {
print IMPL @cPrefix;
print IMPL "#include <glib-object.h>\n";
print IMPL "#include \"config.h\"\n\n";
+ print IMPL @conditionGuardStart;
print IMPL "#include <wtf/GetPtr.h>\n";
print IMPL "#include <wtf/RefPtr.h>\n";
print IMPL map { "#include \"$_\"\n" } sort keys(%implIncludes);
@@ -1326,6 +1333,7 @@ sub WriteData {
print IMPL "\n";
print IMPL @cBodyPriv;
+ print IMPL @conditionGuardEnd;
close(IMPL);
diff --git a/WebCore/bindings/scripts/CodeGeneratorJS.pm b/WebCore/bindings/scripts/CodeGeneratorJS.pm
index c3521bf..4e2e911 100644
--- a/WebCore/bindings/scripts/CodeGeneratorJS.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorJS.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) Research In Motion Limited 2010. All rights reserved.
#
@@ -1170,7 +1170,7 @@ END
push(@implContent, " return ${functionName}$overload->{overloadIndex}(exec);\n");
}
push(@implContent, <<END);
- return JSValue::encode(throwTypeError(exec));
+ return throwVMTypeError(exec);
}
END
@@ -1570,20 +1570,9 @@ sub GenerateImplementation
push(@implContent, " JSValue result = " . NativeToJSValue($attribute->signature, 0, $implClassName, "", "imp.$implGetterFunctionName()", "castedThis") . ";\n");
}
} else {
+ my $getterExpression = "imp->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute) . ")";
+ my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion, $getterExpression, "castedThis");
push(@implContent, " $implClassName* imp = static_cast<$implClassName*>(castedThis->impl());\n");
- my $value;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $name : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $value = "imp->$getAttributeFunctionName(${namespace}::${contentAttributeName}Attr)"
- } else {
- $value = "imp->$implGetterFunctionName()";
- }
- my $jsType = NativeToJSValue($attribute->signature, 0, $implClassName, $implClassNameForValueConversion, $value, "castedThis");
if ($codeGenerator->IsSVGAnimatedType($type)) {
push(@implContent, " RefPtr<$type> obj = $jsType;\n");
push(@implContent, " JSValue result = toJS(exec, castedThis->globalObject(), obj.get(), imp);\n");
@@ -1734,17 +1723,10 @@ sub GenerateImplementation
push(@implContent, " imp->commitChange(podImp, castedThis);\n");
} else {
my $nativeValue = JSValueToNative($attribute->signature, "value");
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+
push(@implContent, " ExceptionCode ec = 0;\n") if @{$attribute->setterExceptions};
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $name : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContent, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, $nativeValue");
- } else {
- push(@implContent, " imp->set$implSetterFunctionName($nativeValue");
- }
+ push(@implContent, " imp->$setterExpressionPrefix$nativeValue");
push(@implContent, ", ec") if @{$attribute->setterExceptions};
push(@implContent, ");\n");
push(@implContent, " setDOMException(exec, ec);\n") if @{$attribute->setterExceptions};
@@ -2330,7 +2312,7 @@ sub JSValueToNative
return "static_cast<SVGPaint::SVGPaintType>($value.toInt32(exec))" if $type eq "SVGPaintType";
if ($type eq "DOMString") {
- return "valueToStringWithNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertNullToNullString"};
+ return "valueToStringWithNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertNullToNullString"} || $signature->extendedAttributes->{"Reflect"} || $signature->extendedAttributes->{"ReflectURL"};
return "valueToStringWithUndefinedOrNullCheck(exec, $value)" if $signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"};
return "ustringToString($value.toString(exec))";
}
@@ -2424,13 +2406,6 @@ sub NativeToJSValue
}
}
- if ($codeGenerator->IsSVGAnimatedType($type)) {
- # Some SVGFE*Element.idl use 'operator' as attribute name, rewrite as '_operator' to avoid clashes with C/C++
- $value =~ s/operator\(\)/_operator\(\)/ if ($value =~ /operator/);
- $value =~ s/\(\)//;
- $value .= "Animated()";
- }
-
if ($type eq "CSSStyleDeclaration") {
$implIncludes{"CSSMutableStyleDeclaration.h"} = 1;
}
@@ -2766,6 +2741,7 @@ sub GenerateConstructorDefinition
my $canConstruct = $dataNode->extendedAttributes->{"CanBeConstructed"};
my $customConstructFunction = $dataNode->extendedAttributes->{"CustomConstructFunction"};
my $callWith = $dataNode->extendedAttributes->{"CallWith"};
+ my $numberOfconstructParameters = $dataNode->extendedAttributes->{"ConstructorParameters"};
push(@$outputArray, "const ClassInfo ${constructorClassName}::s_info = { \"${visibleClassName}Constructor\", 0, &${constructorClassName}Table, 0 };\n\n");
@@ -2773,6 +2749,7 @@ sub GenerateConstructorDefinition
push(@$outputArray, " : DOMConstructorObject(${constructorClassName}::createStructure(globalObject->objectPrototype()), globalObject)\n");
push(@$outputArray, "{\n");
push(@$outputArray, " putDirect(exec->propertyNames().prototype, ${protoClassName}::self(exec, globalObject), DontDelete | ReadOnly);\n");
+ push(@$outputArray, " putDirect(exec->propertyNames().length, jsNumber(exec, ${numberOfconstructParameters}), ReadOnly | DontDelete | DontEnum);\n") if $numberOfconstructParameters;
push(@$outputArray, "}\n\n");
push(@$outputArray, "bool ${constructorClassName}::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)\n");
diff --git a/WebCore/bindings/scripts/CodeGeneratorObjC.pm b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
index daead72..7d66979 100644
--- a/WebCore/bindings/scripts/CodeGeneratorObjC.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorObjC.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2006 Anders Carlsson <andersca@mac.com>
# Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
# Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
-# Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+# Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
# Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
# Copyright (C) 2010 Google Inc.
#
@@ -793,6 +793,12 @@ sub GenerateHeader
push(@headerAttributes, $property) if $public;
push(@privateHeaderAttributes, $property) unless $public;
} else {
+ my $attributeConditionalString = GenerateConditionalString($attribute->signature);
+ if ($attributeConditionalString) {
+ push(@headerAttributes, "#if ${attributeConditionalString}\n") if $public;
+ push(@privateHeaderAttributes, "#if ${attributeConditionalString}\n") unless $public;
+ }
+
# - GETTER
my $getter = "- (" . $attributeType . ")" . $attributeName . $declarationSuffix;
push(@headerAttributes, $getter) if $public;
@@ -804,6 +810,11 @@ sub GenerateHeader
push(@headerAttributes, $setter) if $public;
push(@privateHeaderAttributes, $setter) unless $public;
}
+
+ if ($attributeConditionalString) {
+ push(@headerAttributes, "#endif\n") if $public;
+ push(@privateHeaderAttributes, "#endif\n") unless $public;
+ }
}
}
@@ -1164,13 +1175,9 @@ sub GenerateImplementation
} elsif ($attributeName eq "frame") {
# Special case attribute frame to be frameBorders.
$attributeInterfaceName .= "Borders";
- } elsif ($attributeName eq "ownerDocument") {
- # FIXME: for now special case attribute ownerDocument to call document, this is incorrect
- # legacy behavior. (see http://bugs.webkit.org/show_bug.cgi?id=10889)
- $attributeName = "document";
- } elsif ($codeGenerator->IsSVGAnimatedType($idlType)) {
- # Special case for animated types.
- $attributeName .= "Animated";
+ } elsif ($attributeName eq "operator") {
+ # Avoid clash with C++ keyword.
+ $attributeInterfaceName = "_operator";
}
$attributeNames{$attributeInterfaceName} = 1;
@@ -1178,23 +1185,14 @@ sub GenerateImplementation
# - GETTER
my $getterSig = "- ($attributeType)$attributeInterfaceName\n";
- # Some SVGFE*Element.idl use 'operator' as attribute name, rewrite as '_operator' to avoid clashes with C/C++
- $attributeName =~ s/operatorAnimated/_operatorAnimated/ if ($attributeName =~ /operatorAnimated/);
- $getterSig =~ s/operator/_operator/ if ($getterSig =~ /operator/);
+ my $getterExpressionPrefix = $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+
+ # FIXME: Special case attribute ownerDocument to call document. This makes it return the
+ # document when called on the document itself. Legacy behavior, see <https://bugs.webkit.org/show_bug.cgi?id=10889>.
+ $getterExpressionPrefix =~ s/\bownerDocument\b/document/;
my $hasGetterException = @{$attribute->getterExceptions};
- my $getterContentHead;
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterContentHead = "IMPL->${getAttributeFunctionName}(WebCore::${namespace}::${contentAttributeName}Attr";
- } else {
- $getterContentHead = "IMPL->" . $codeGenerator->WK_lcfirst($attributeName) . "(";
- }
+ my $getterContentHead = "IMPL->$getterExpressionPrefix";
my $getterContentTail = ")";
# Special case for DOMSVGNumber
@@ -1245,8 +1243,6 @@ sub GenerateImplementation
} elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$getterContentHead = "WebCore::String::number(" . $getterContentHead;
$getterContentTail .= ")";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $getterContentTail .= ".toInt()";
} elsif ($codeGenerator->IsPodType($idlType) or $idlType eq "Date") {
$getterContentHead = "kit($getterContentHead";
$getterContentTail .= ")";
@@ -1271,6 +1267,8 @@ sub GenerateImplementation
$getterContent = $getterContentHead . $getterContentTail;
}
+ my $attributeConditionalString = GenerateConditionalString($attribute->signature);
+ push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
push(@implContent, $getterSig);
push(@implContent, "{\n");
push(@implContent, " $jsContextSetter\n");
@@ -1291,7 +1289,7 @@ sub GenerateImplementation
} else {
push(@implContent, " return $getterContent;\n");
}
- push(@implContent, "}\n\n");
+ push(@implContent, "}\n");
# - SETTER
if (!$attributeIsReadonly) {
@@ -1303,15 +1301,14 @@ sub GenerateImplementation
my $argName = "new" . ucfirst($attributeInterfaceName);
my $arg = GetObjCTypeGetter($argName, $idlType);
- # The definition of ConvertFromString and ConvertToString is flipped for the setter
- if ($attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $arg = "WebCore::String::number($arg)";
- } elsif ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
+ # The definition of ConvertToString is flipped for the setter
+ if ($attribute->signature->extendedAttributes->{"ConvertToString"}) {
$arg = "WebCore::String($arg).toInt()";
}
my $setterSig = "- (void)$setterName:($attributeType)$argName\n";
+ push(@implContent, "\n");
push(@implContent, $setterSig);
push(@implContent, "{\n");
push(@implContent, " $jsContextSetter\n");
@@ -1332,23 +1329,18 @@ sub GenerateImplementation
push(@implContent, " IMPL->$coreSetterName($arg);\n");
}
} else {
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- push(@implContent, " $exceptionInit\n") if $hasSetterException;
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
my $ec = $hasSetterException ? ", ec" : "";
- if ($reflect || $reflectURL) {
- my $contentAttributeName = (($reflect || $reflectURL) eq "1") ? $attributeName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContent, " IMPL->setAttribute(WebCore::${namespace}::${contentAttributeName}Attr, $arg$ec);\n");
- } else {
- push(@implContent, " IMPL->$coreSetterName($arg$ec);\n");
- }
+ push(@implContent, " $exceptionInit\n") if $hasSetterException;
+ push(@implContent, " IMPL->$setterExpressionPrefix$arg$ec);\n");
push(@implContent, " $exceptionRaiseOnError\n") if $hasSetterException;
}
- push(@implContent, "}\n\n");
+ push(@implContent, "}\n");
}
+
+ push(@implContent, "#endif\n") if $attributeConditionalString;
+ push(@implContent, "\n");
}
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index e471500..e249caa 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -677,7 +677,7 @@ END
my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
if ($getterStringUsesImp && $reflect && IsNodeSubType($dataNode) && $codeGenerator->IsStringType($attrType)) {
# Generate super-compact call for regular attribute getter:
- my $contentAttributeName = $reflect eq "1" ? $attrName : $reflect;
+ my $contentAttributeName = $reflect eq "1" ? lc $attrName : $reflect;
my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
$implIncludes{"${namespace}.h"} = 1;
push(@implContentDecls, " return getElementStringAttr(info, ${namespace}::${contentAttributeName}Attr);\n");
@@ -708,34 +708,13 @@ END
$attrName = $attribute->signature->extendedAttributes->{"v8referenceattr"};
}
- my $getterFunc = $codeGenerator->WK_lcfirst($attrName);
-
- if ($codeGenerator->IsSVGAnimatedType($attribute->signature->type)) {
- # Some SVGFE*Element.idl use 'operator' as attribute name; rewrite as '_operator' to avoid clashes with C/C++
- $getterFunc = "_" . $getterFunc if ($attrName =~ /operator/);
- $getterFunc .= "Animated";
- }
-
my $returnType = GetTypeFromSignature($attribute->signature);
my $getterString;
if ($getterStringUsesImp) {
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? $attrName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- my $getAttributeFunctionName = $reflectURL ? "getURLAttribute" : "getAttribute";
- $getterString = "imp->$getAttributeFunctionName(${namespace}::${contentAttributeName}Attr";
- } else {
- $getterString = "imp->$getterFunc(";
- }
+ $getterString = "imp->" . $codeGenerator->GetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
$getterString .= "ec" if $useExceptions;
$getterString .= ")";
- if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $getterString .= ".toInt()";
- }
} else {
$getterString = "impInstance";
}
@@ -887,7 +866,7 @@ END
my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
if (($reflect || $reflectURL) && IsNodeSubType($dataNode) && $codeGenerator->IsStringType($attrType)) {
# Generate super-compact call for regular attribute setter:
- my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? $attrName : ($reflect || $reflectURL);
+ my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? lc $attrName : ($reflect || $reflectURL);
my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
$implIncludes{"${namespace}.h"} = 1;
push(@implContentDecls, " setElementStringAttr(info, ${namespace}::${contentAttributeName}Attr, value);\n");
@@ -912,14 +891,7 @@ END
push(@implContentDecls, " $nativeType v = " . JSValueToNative($attribute->signature, "value") . ";\n");
}
- my $result = "";
- if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $result .= "WebCore::String::number(";
- }
- $result .= "v";
- if ($nativeType eq "int" and $attribute->signature->extendedAttributes->{"ConvertFromString"}) {
- $result .= ")";
- }
+ my $result = "v";
my $returnType = GetTypeFromSignature($attribute->signature);
if (IsRefPtrType($returnType)) {
$result = "WTF::getPtr(" . $result . ")";
@@ -935,15 +907,8 @@ END
if ($implClassName eq "float") {
push(@implContentDecls, " *imp = $result;\n");
} else {
- my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName);
- my $reflect = $attribute->signature->extendedAttributes->{"Reflect"};
- my $reflectURL = $attribute->signature->extendedAttributes->{"ReflectURL"};
- if ($reflect || $reflectURL) {
- my $contentAttributeName = ($reflect || $reflectURL) eq "1" ? $attrName : ($reflect || $reflectURL);
- my $namespace = $codeGenerator->NamespaceForAttributeName($interfaceName, $contentAttributeName);
- $implIncludes{"${namespace}.h"} = 1;
- push(@implContentDecls, " imp->setAttribute(${namespace}::${contentAttributeName}Attr, $result");
- } elsif ($attribute->signature->type eq "EventListener") {
+ if ($attribute->signature->type eq "EventListener") {
+ my $implSetterFunctionName = $codeGenerator->WK_ucfirst($attrName);
$implIncludes{"V8AbstractEventListener.h"} = 1;
push(@implContentDecls, " transferHiddenDependency(info.Holder(), imp->$attrName(), value, V8${interfaceName}::eventListenerCacheIndex);\n");
if ($interfaceName eq "WorkerContext" and $attribute->signature->name eq "onerror") {
@@ -954,7 +919,8 @@ END
push(@implContentDecls, " imp->set$implSetterFunctionName(V8DOMWrapper::getEventListener(value, true, ListenerFindOrCreate)");
}
} else {
- push(@implContentDecls, " imp->set$implSetterFunctionName($result");
+ my $setterExpressionPrefix = $codeGenerator->SetterExpressionPrefix(\%implIncludes, $interfaceName, $attribute);
+ push(@implContentDecls, " imp->$setterExpressionPrefix$result");
}
push(@implContentDecls, ", ec") if $useExceptions;
push(@implContentDecls, ");\n");
@@ -1104,7 +1070,7 @@ END
push(@implContentDecls, " return ${name}$overload->{overloadIndex}Callback(args);\n");
}
push(@implContentDecls, <<END);
- V8Proxy::setDOMException(SYNTAX_ERR);
+ V8Proxy::throwTypeError();
return notHandledByInterceptor();
END
push(@implContentDecls, "}\n\n");
@@ -1283,9 +1249,9 @@ sub GenerateBatchedAttributeData
foreach my $attribute (@$attributes) {
my $conditionalString = GenerateConditionalString($attribute->signature);
- push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
+ push(@implContent, "#if ${conditionalString}\n") if $conditionalString;
GenerateSingleBatchedAttribute($interfaceName, $attribute, ",", "");
- push(@implContent, "\n#endif // ${conditionalString}\n") if $conditionalString;
+ push(@implContent, "#endif // ${conditionalString}\n") if $conditionalString;
}
}
@@ -2712,7 +2678,7 @@ sub GetNativeTypeFromSignature
my $mode = "";
if ($signature->extendedAttributes->{"ConvertUndefinedOrNullToNullString"}) {
$mode = "WithUndefinedOrNullCheck";
- } elsif ($signature->extendedAttributes->{"ConvertNullToNullString"}) {
+ } elsif ($signature->extendedAttributes->{"ConvertNullToNullString"} || $signature->extendedAttributes->{"Reflect"} || $signature->extendedAttributes->{"ReflectURL"}) {
$mode = "WithNullCheck";
}
$type .= "<$mode>";
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
index 0b20841..0436e13 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.cpp
@@ -19,6 +19,9 @@
*/
#include "config.h"
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "WebDOMTestInterface.h"
#include "TestInterface.h"
@@ -73,3 +76,5 @@ WebDOMTestInterface toWebKit(WebCore::TestInterface* value)
{
return WebDOMTestInterface(value);
}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
index d0cee5b..4e7af6d 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestInterface.h
@@ -23,6 +23,8 @@
#ifndef WebDOMTestInterface_h
#define WebDOMTestInterface_h
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include <WebDOMObject.h>
#include <WebDOMString.h>
@@ -50,3 +52,5 @@ WebCore::TestInterface* toWebCore(const WebDOMTestInterface&);
WebDOMTestInterface toWebKit(WebCore::TestInterface*);
#endif
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index e540a57..65bc9f3 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -22,6 +22,7 @@
#include "WebDOMTestObj.h"
#include "AtomicString.h"
+#include "HTMLNames.h"
#include "KURL.h"
#include "SerializedScriptValue.h"
#include "TestObj.h"
@@ -173,33 +174,163 @@ void WebDOMTestObj::setTestObjAttr(const WebDOMTestObj& newTestObjAttr)
impl()->setTestObjAttr(toWebCore(newTestObjAttr));
}
-int WebDOMTestObj::attrWithException() const
+WebDOMString WebDOMTestObj::reflectedStringAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+}
+
+void WebDOMTestObj::setReflectedStringAttr(const WebDOMString& newReflectedStringAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, newReflectedStringAttr);
+}
+
+int WebDOMTestObj::reflectedIntegralAttr() const
{
if (!impl())
return 0;
- return impl()->attrWithException();
+ return impl()->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr);
}
-void WebDOMTestObj::setAttrWithException(int newAttrWithException)
+void WebDOMTestObj::setReflectedIntegralAttr(int newReflectedIntegralAttr)
{
if (!impl())
return;
- impl()->setAttrWithException(newAttrWithException);
+ impl()->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, newReflectedIntegralAttr);
}
-int WebDOMTestObj::attrWithSetterException() const
+bool WebDOMTestObj::reflectedBooleanAttr() const
+{
+ if (!impl())
+ return false;
+
+ return impl()->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr);
+}
+
+void WebDOMTestObj::setReflectedBooleanAttr(bool newReflectedBooleanAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, newReflectedBooleanAttr);
+}
+
+WebDOMString WebDOMTestObj::reflectedURLAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+}
+
+void WebDOMTestObj::setReflectedURLAttr(const WebDOMString& newReflectedURLAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, newReflectedURLAttr);
+}
+
+WebDOMString WebDOMTestObj::reflectedStringAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+}
+
+void WebDOMTestObj::setReflectedStringAttr(const WebDOMString& newReflectedStringAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, newReflectedStringAttr);
+}
+
+int WebDOMTestObj::reflectedCustomIntegralAttr() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr);
+}
+
+void WebDOMTestObj::setReflectedCustomIntegralAttr(int newReflectedCustomIntegralAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, newReflectedCustomIntegralAttr);
+}
+
+bool WebDOMTestObj::reflectedCustomBooleanAttr() const
+{
+ if (!impl())
+ return false;
+
+ return impl()->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr);
+}
+
+void WebDOMTestObj::setReflectedCustomBooleanAttr(bool newReflectedCustomBooleanAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, newReflectedCustomBooleanAttr);
+}
+
+WebDOMString WebDOMTestObj::reflectedURLAttr() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+}
+
+void WebDOMTestObj::setReflectedURLAttr(const WebDOMString& newReflectedURLAttr)
+{
+ if (!impl())
+ return;
+
+ impl()->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, newReflectedURLAttr);
+}
+
+int WebDOMTestObj::attrWithGetterException() const
{
if (!impl())
return 0;
WebCore::ExceptionCode ec = 0;
- int result = impl()->attrWithSetterException(ec);
+ int result = impl()->attrWithGetterException(ec);
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
return result;
}
+void WebDOMTestObj::setAttrWithGetterException(int newAttrWithGetterException)
+{
+ if (!impl())
+ return;
+
+ WebCore::ExceptionCode ec = 0;
+ impl()->setAttrWithGetterException(newAttrWithGetterException, ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+}
+
+int WebDOMTestObj::attrWithSetterException() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->attrWithSetterException();
+}
+
void WebDOMTestObj::setAttrWithSetterException(int newAttrWithSetterException)
{
if (!impl())
@@ -210,21 +341,42 @@ void WebDOMTestObj::setAttrWithSetterException(int newAttrWithSetterException)
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
}
-int WebDOMTestObj::attrWithGetterException() const
+WebDOMString WebDOMTestObj::stringAttrWithGetterException() const
{
if (!impl())
- return 0;
+ return WebDOMString();
- return impl()->attrWithGetterException();
+ WebCore::ExceptionCode ec = 0;
+ WebDOMString result = impl()->stringAttrWithGetterException(ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+ return static_cast<const WebCore::String&>(result);
}
-void WebDOMTestObj::setAttrWithGetterException(int newAttrWithGetterException)
+void WebDOMTestObj::setStringAttrWithGetterException(const WebDOMString& newStringAttrWithGetterException)
{
if (!impl())
return;
WebCore::ExceptionCode ec = 0;
- impl()->setAttrWithGetterException(newAttrWithGetterException, ec);
+ impl()->setStringAttrWithGetterException(newStringAttrWithGetterException, ec);
+ webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
+}
+
+WebDOMString WebDOMTestObj::stringAttrWithSetterException() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->stringAttrWithSetterException());
+}
+
+void WebDOMTestObj::setStringAttrWithSetterException(const WebDOMString& newStringAttrWithSetterException)
+{
+ if (!impl())
+ return;
+
+ WebCore::ExceptionCode ec = 0;
+ impl()->setStringAttrWithSetterException(newStringAttrWithSetterException, ec);
webDOMRaiseError(static_cast<WebDOMExceptionCode>(ec));
}
@@ -236,6 +388,92 @@ WebDOMString WebDOMTestObj::scriptStringAttr() const
return static_cast<const WebCore::String&>(impl()->scriptStringAttr());
}
+#if ENABLE(Condition1)
+int WebDOMTestObj::conditionalAttr1() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->conditionalAttr1();
+}
+
+void WebDOMTestObj::setConditionalAttr1(int newConditionalAttr1)
+{
+ if (!impl())
+ return;
+
+ impl()->setConditionalAttr1(newConditionalAttr1);
+}
+
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
+int WebDOMTestObj::conditionalAttr2() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->conditionalAttr2();
+}
+
+void WebDOMTestObj::setConditionalAttr2(int newConditionalAttr2)
+{
+ if (!impl())
+ return;
+
+ impl()->setConditionalAttr2(newConditionalAttr2);
+}
+
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
+int WebDOMTestObj::conditionalAttr3() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->conditionalAttr3();
+}
+
+void WebDOMTestObj::setConditionalAttr3(int newConditionalAttr3)
+{
+ if (!impl())
+ return;
+
+ impl()->setConditionalAttr3(newConditionalAttr3);
+}
+
+#endif
+int WebDOMTestObj::description() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->description();
+}
+
+int WebDOMTestObj::id() const
+{
+ if (!impl())
+ return 0;
+
+ return impl()->id();
+}
+
+void WebDOMTestObj::setId(int newId)
+{
+ if (!impl())
+ return;
+
+ impl()->setId(newId);
+}
+
+WebDOMString WebDOMTestObj::hash() const
+{
+ if (!impl())
+ return WebDOMString();
+
+ return static_cast<const WebCore::String&>(impl()->hash());
+}
+
void WebDOMTestObj::voidMethod()
{
if (!impl())
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 7bcd988..33bc7fb 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -54,15 +54,43 @@ public:
void setStringAttr(const WebDOMString&);
WebDOMTestObj testObjAttr() const;
void setTestObjAttr(const WebDOMTestObj&);
- int attrWithException() const;
- void setAttrWithException(int);
- int attrWithSetterException() const;
- void setAttrWithSetterException(int);
+ WebDOMString reflectedStringAttr() const;
+ void setReflectedStringAttr(const WebDOMString&);
+ int reflectedIntegralAttr() const;
+ void setReflectedIntegralAttr(int);
+ bool reflectedBooleanAttr() const;
+ void setReflectedBooleanAttr(bool);
+ WebDOMString reflectedURLAttr() const;
+ void setReflectedURLAttr(const WebDOMString&);
+ WebDOMString reflectedStringAttr() const;
+ void setReflectedStringAttr(const WebDOMString&);
+ int reflectedCustomIntegralAttr() const;
+ void setReflectedCustomIntegralAttr(int);
+ bool reflectedCustomBooleanAttr() const;
+ void setReflectedCustomBooleanAttr(bool);
+ WebDOMString reflectedURLAttr() const;
+ void setReflectedURLAttr(const WebDOMString&);
int attrWithGetterException() const;
void setAttrWithGetterException(int);
+ int attrWithSetterException() const;
+ void setAttrWithSetterException(int);
+ WebDOMString stringAttrWithGetterException() const;
+ void setStringAttrWithGetterException(const WebDOMString&);
+ WebDOMString stringAttrWithSetterException() const;
+ void setStringAttrWithSetterException(const WebDOMString&);
int customAttr() const;
void setCustomAttr(int);
WebDOMString scriptStringAttr() const;
+ int conditionalAttr1() const;
+ void setConditionalAttr1(int);
+ int conditionalAttr2() const;
+ void setConditionalAttr2(int);
+ int conditionalAttr3() const;
+ void setConditionalAttr3(int);
+ int description() const;
+ int id() const;
+ void setId(int);
+ WebDOMString hash() const;
void voidMethod();
void voidMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
index a67b6ac..94f4ca5 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
@@ -21,6 +21,8 @@
#include <glib-object.h>
#include "config.h"
+#if ENABLE(DATABASE)
+
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "ExceptionCode.h"
@@ -55,38 +57,38 @@ gpointer kit(WebCore::TestCallback* obj)
gboolean
webkit_dom_test_callback_callback_with_class1param(WebKitDOMTestCallback* self, WebKitDOMClass1* class1param)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestCallback * item = WebKit::core(self);
- g_return_val_if_fail (class1param, 0);
- WebCore::Class1 * _g_class1param = WebKit::core(class1param);
- g_return_val_if_fail (_g_class1param, 0);
- gboolean res = item->callbackWithClass1Param(_g_class1param);
+ g_return_val_if_fail(class1param, 0);
+ WebCore::Class1 * converted_class1param = WebKit::core(class1param);
+ g_return_val_if_fail(converted_class1param, 0);
+ gboolean res = item->callbackWithClass1Param(converted_class1param);
return res;
}
gboolean
webkit_dom_test_callback_callback_with_class2param(WebKitDOMTestCallback* self, WebKitDOMClass2* class2param, gchar* str_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestCallback * item = WebKit::core(self);
- g_return_val_if_fail (class2param, 0);
- g_return_val_if_fail (str_arg, 0);
- WebCore::Class2 * _g_class2param = WebKit::core(class2param);
- g_return_val_if_fail (_g_class2param, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- gboolean res = item->callbackWithClass2Param(_g_class2param, _g_str_arg);
+ g_return_val_if_fail(class2param, 0);
+ g_return_val_if_fail(str_arg, 0);
+ WebCore::Class2 * converted_class2param = WebKit::core(class2param);
+ g_return_val_if_fail(converted_class2param, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ gboolean res = item->callbackWithClass2Param(converted_class2param, converted_str_arg);
return res;
}
glong
webkit_dom_test_callback_callback_with_non_bool_return_type(WebKitDOMTestCallback* self, WebKitDOMClass3* class3param)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestCallback * item = WebKit::core(self);
- g_return_val_if_fail (class3param, 0);
- WebCore::Class3 * _g_class3param = WebKit::core(class3param);
- g_return_val_if_fail (_g_class3param, 0);
- glong res = item->callbackWithNonBoolReturnType(_g_class3param);
+ g_return_val_if_fail(class3param, 0);
+ WebCore::Class3 * converted_class3param = WebKit::core(class3param);
+ g_return_val_if_fail(converted_class3param, 0);
+ glong res = item->callbackWithNonBoolReturnType(converted_class3param);
return res;
}
@@ -182,3 +184,4 @@ WebKitDOMTestCallback* wrapTestCallback(WebCore::TestCallback* coreObject)
return wrapper;
}
} // namespace WebKit
+#endif /* ENABLE(DATABASE) */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
index 0d0021d..af22530 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
@@ -21,6 +21,8 @@
#include <glib-object.h>
#include "config.h"
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "ExceptionCode.h"
@@ -138,3 +140,4 @@ WebKitDOMTestInterface* wrapTestInterface(WebCore::TestInterface* coreObject)
return wrapper;
}
} // namespace WebKit
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index 5dfb255..efb362b 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -24,6 +24,7 @@
#include <wtf/GetPtr.h>
#include <wtf/RefPtr.h>
#include "ExceptionCode.h"
+#include "HTMLNames.h"
#include "TestObj.h"
#include "WebKitDOMBinding.h"
#include "gobject/ConvertToUTF8String.h"
@@ -51,7 +52,7 @@ gpointer kit(WebCore::TestObj* obj)
void
webkit_dom_test_obj_void_method(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->voidMethod();
}
@@ -59,20 +60,20 @@ webkit_dom_test_obj_void_method(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_void_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (str_arg);
- g_return_if_fail (obj_arg);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_if_fail (_g_obj_arg);
- item->voidMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg);
+ g_return_if_fail(str_arg);
+ g_return_if_fail(obj_arg);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_if_fail(converted_obj_arg);
+ item->voidMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg);
}
glong
webkit_dom_test_obj_int_method(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->intMethod();
return res;
@@ -81,21 +82,21 @@ webkit_dom_test_obj_int_method(WebKitDOMTestObj* self)
glong
webkit_dom_test_obj_int_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
- glong res = item->intMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg);
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ glong res = item->intMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg);
return res;
}
WebKitDOMTestObj*
webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethod());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -105,14 +106,14 @@ webkit_dom_test_obj_obj_method(WebKitDOMTestObj* self)
WebKitDOMTestObj*
webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
- PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, _g_str_arg, _g_obj_arg));
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->objMethodWithArgs(int_arg, converted_str_arg, converted_obj_arg));
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
return res;
}
@@ -120,14 +121,14 @@ webkit_dom_test_obj_obj_method_with_args(WebKitDOMTestObj* self, glong int_arg,
WebKitDOMTestObj*
webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
- PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(_g_str_arg, _g_obj_arg));
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * converted_obj_arg = WebKit::core(obj_arg);
+ g_return_val_if_fail(converted_obj_arg, 0);
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgs(converted_str_arg, converted_obj_arg));
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
return res;
}
@@ -135,15 +136,15 @@ webkit_dom_test_obj_method_that_requires_all_args(WebKitDOMTestObj* self, gchar*
WebKitDOMTestObj*
webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* self, gchar* str_arg, WebKitDOMTestObj* obj_arg, GError **error)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- g_return_val_if_fail (str_arg, 0);
- g_return_val_if_fail (obj_arg, 0);
- WebCore::String _g_str_arg = WebCore::String::fromUTF8(str_arg);
- WebCore::TestObj * _g_obj_arg = WebKit::core(obj_arg);
- g_return_val_if_fail (_g_obj_arg, 0);
+ g_return_val_if_fail(str_arg, 0);
+ g_return_val_if_fail(obj_arg, 0);
+ WebCore::String converted_str_arg = WebCore::String::fromUTF8(str_arg);
+ WebCore::TestObj * 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(item->methodThatRequiresAllArgsAndThrows(_g_str_arg, _g_obj_arg, ec));
+ PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->methodThatRequiresAllArgsAndThrows(converted_str_arg, converted_obj_arg, ec));
if (ec) {
WebCore::ExceptionCodeDescription ecdesc;
WebCore::getExceptionCodeDescription(ec, ecdesc);
@@ -156,18 +157,18 @@ webkit_dom_test_obj_method_that_requires_all_args_and_throws(WebKitDOMTestObj* s
void
webkit_dom_test_obj_serialized_value(WebKitDOMTestObj* self, WebKitDOMSerializedScriptValue* serialized_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (serialized_arg);
- WebCore::SerializedScriptValue * _g_serialized_arg = WebKit::core(serialized_arg);
- g_return_if_fail (_g_serialized_arg);
- item->serializedValue(_g_serialized_arg);
+ g_return_if_fail(serialized_arg);
+ WebCore::SerializedScriptValue * converted_serialized_arg = WebKit::core(serialized_arg);
+ g_return_if_fail(converted_serialized_arg);
+ item->serializedValue(converted_serialized_arg);
}
void
webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
item->methodWithException(ec);
@@ -187,7 +188,7 @@ 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);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrame();
}
@@ -195,7 +196,7 @@ webkit_dom_test_obj_with_dynamic_frame(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndArg(int_arg);
}
@@ -203,7 +204,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_arg(WebKitDOMTestObj* self, glong int
void
webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self, glong int_arg, glong optional_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndOptionalArg(int_arg, optional_arg);
}
@@ -211,7 +212,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_optional_arg(WebKitDOMTestObj* self,
void
webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self, glong int_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndUserGesture(int_arg);
}
@@ -219,7 +220,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_user_gesture(WebKitDOMTestObj* self,
void
webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* self, glong int_arg, glong optional_arg)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withDynamicFrameAndUserGestureASAD(int_arg, optional_arg);
}
@@ -227,7 +228,7 @@ webkit_dom_test_obj_with_dynamic_frame_and_user_gesture_asad(WebKitDOMTestObj* s
void
webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withScriptStateVoid();
}
@@ -235,7 +236,7 @@ webkit_dom_test_obj_with_script_state_void(WebKitDOMTestObj* self)
WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObj());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -245,7 +246,7 @@ webkit_dom_test_obj_with_script_state_obj(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
item->withScriptStateVoidException(ec);
@@ -259,7 +260,7 @@ webkit_dom_test_obj_with_script_state_void_exception(WebKitDOMTestObj* self, GEr
WebKitDOMTestObj*
webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->withScriptStateObjException(ec));
@@ -275,7 +276,7 @@ webkit_dom_test_obj_with_script_state_obj_exception(WebKitDOMTestObj* self, GErr
void
webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->withScriptExecutionContext();
}
@@ -283,7 +284,7 @@ webkit_dom_test_obj_with_script_execution_context(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->methodWithOptionalArg(opt);
}
@@ -291,7 +292,7 @@ webkit_dom_test_obj_method_with_optional_arg(WebKitDOMTestObj* self, glong opt)
void
webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestObj* self, glong non_opt, glong opt)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->methodWithNonOptionalArgAndOptionalArg(non_opt, opt);
}
@@ -299,7 +300,7 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_optional_arg(WebKitDOMTestO
void
webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOMTestObj* self, glong non_opt, glong opt1, glong opt2)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->methodWithNonOptionalArgAndTwoOptionalArgs(non_opt, opt1, opt2);
}
@@ -307,7 +308,7 @@ webkit_dom_test_obj_method_with_non_optional_arg_and_two_optional_args(WebKitDOM
glong
webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->readOnlyIntAttr();
return res;
@@ -316,7 +317,7 @@ webkit_dom_test_obj_get_read_only_int_attr(WebKitDOMTestObj* self)
gchar*
webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->readOnlyStringAttr());
return res;
@@ -325,7 +326,7 @@ webkit_dom_test_obj_get_read_only_string_attr(WebKitDOMTestObj* self)
WebKitDOMTestObj*
webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->readOnlyTestObjAttr());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -335,7 +336,7 @@ webkit_dom_test_obj_get_read_only_test_obj_attr(WebKitDOMTestObj* self)
glong
webkit_dom_test_obj_get_int_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->intAttr();
return res;
@@ -344,7 +345,7 @@ webkit_dom_test_obj_get_int_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_int_attr(WebKitDOMTestObj* self, glong value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setIntAttr(value);
}
@@ -352,7 +353,7 @@ webkit_dom_test_obj_set_int_attr(WebKitDOMTestObj* self, glong value)
gint64
webkit_dom_test_obj_get_long_long_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gint64 res = item->longLongAttr();
return res;
@@ -361,7 +362,7 @@ webkit_dom_test_obj_get_long_long_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_long_long_attr(WebKitDOMTestObj* self, gint64 value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setLongLongAttr(value);
}
@@ -369,7 +370,7 @@ webkit_dom_test_obj_set_long_long_attr(WebKitDOMTestObj* self, gint64 value)
guint64
webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
guint64 res = item->unsignedLongLongAttr();
return res;
@@ -378,7 +379,7 @@ webkit_dom_test_obj_get_unsigned_long_long_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64 value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setUnsignedLongLongAttr(value);
}
@@ -386,7 +387,7 @@ webkit_dom_test_obj_set_unsigned_long_long_attr(WebKitDOMTestObj* self, guint64
gchar*
webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->stringAttr());
return res;
@@ -395,17 +396,17 @@ webkit_dom_test_obj_get_string_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_string_attr(WebKitDOMTestObj* self, gchar* value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (value);
- WebCore::String _g_value = WebCore::String::fromUTF8(value);
- item->setStringAttr(_g_value);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setStringAttr(converted_value);
}
WebKitDOMTestObj*
webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
PassRefPtr<WebCore::TestObj> g_res = WTF::getPtr(item->testObjAttr());
WebKitDOMTestObj* res = static_cast<WebKitDOMTestObj* >(WebKit::kit(g_res.get()));
@@ -415,38 +416,165 @@ webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- g_return_if_fail (value);
- WebCore::TestObj * _g_value = WebKit::core(value);
- g_return_if_fail (_g_value);
- item->setTestObjAttr(_g_value);
+ g_return_if_fail(value);
+ WebCore::TestObj * converted_value = WebKit::core(value);
+ g_return_if_fail(converted_value);
+ item->setTestObjAttr(converted_value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, converted_value);
}
glong
-webkit_dom_test_obj_get_attr_with_exception(WebKitDOMTestObj* self)
+webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_integral_attr(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value);
+}
+
+gboolean
+webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gboolean res = item->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value)
{
- g_return_val_if_fail (self, 0);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- glong res = item->attrWithException();
+ item->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
return res;
}
void
-webkit_dom_test_obj_set_attr_with_exception(WebKitDOMTestObj* self, glong value)
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
- item->setAttrWithException(value);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, converted_value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, converted_value);
}
glong
-webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GError **error)
+webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_custom_integral_attr(WebKitDOMTestObj* self, glong value)
{
- g_return_val_if_fail (self, 0);
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value);
+}
+
+gboolean
+webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gboolean res = item->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr);
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value);
+}
+
+gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ item->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, converted_value);
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error)
+{
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
- glong res = item->attrWithSetterException(ec);
+ glong res = item->attrWithGetterException(ec);
if (ec) {
WebCore::ExceptionCodeDescription ecdesc;
WebCore::getExceptionCodeDescription(ec, ecdesc);
@@ -456,9 +584,32 @@ webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GErro
}
void
+webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ WebCore::ExceptionCode ec = 0;
+ item->setAttrWithGetterException(value, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc;
+ WebCore::getExceptionCodeDescription(ec, ecdesc);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+}
+
+glong
+webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->attrWithSetterException();
+ return res;
+}
+
+void
webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
WebCore::ExceptionCode ec = 0;
item->setAttrWithSetterException(value, ec);
@@ -469,22 +620,50 @@ webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong
}
}
-glong
-webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self)
+gchar*
+webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
- glong res = item->attrWithGetterException();
+ WebCore::ExceptionCode ec = 0;
+ gchar* res = convertToUTF8String(item->stringAttrWithGetterException(ec));
return res;
}
void
-webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error)
+webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
WebCore::ExceptionCode ec = 0;
- item->setAttrWithGetterException(value, ec);
+ item->setStringAttrWithGetterException(converted_value, ec);
+ if (ec) {
+ WebCore::ExceptionCodeDescription ecdesc;
+ WebCore::getExceptionCodeDescription(ec, ecdesc);
+ g_set_error_literal(error, g_quark_from_string("WEBKIT_DOM"), ecdesc.code, ecdesc.name);
+ }
+}
+
+gchar*
+webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ gchar* res = convertToUTF8String(item->stringAttrWithSetterException());
+ return res;
+}
+
+void
+webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ g_return_if_fail(value);
+ WebCore::String converted_value = WebCore::String::fromUTF8(value);
+ WebCore::ExceptionCode ec = 0;
+ item->setStringAttrWithSetterException(converted_value, ec);
if (ec) {
WebCore::ExceptionCodeDescription ecdesc;
WebCore::getExceptionCodeDescription(ec, ecdesc);
@@ -495,16 +674,79 @@ webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong
gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->scriptStringAttr());
return res;
}
+#if ENABLE(Condition1)
+glong
+webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->conditionalAttr1();
+ return res;
+}
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1)
+void
+webkit_dom_test_obj_set_conditional_attr1(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setConditionalAttr1(value);
+}
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+glong
+webkit_dom_test_obj_get_conditional_attr2(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->conditionalAttr2();
+ return res;
+}
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+void
+webkit_dom_test_obj_set_conditional_attr2(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setConditionalAttr2(value);
+}
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+glong
+webkit_dom_test_obj_get_conditional_attr3(WebKitDOMTestObj* self)
+{
+ g_return_val_if_fail(self, 0);
+ WebCore::TestObj * item = WebKit::core(self);
+ glong res = item->conditionalAttr3();
+ return res;
+}
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+void
+webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value)
+{
+ g_return_if_fail(self);
+ WebCore::TestObj * item = WebKit::core(self);
+ item->setConditionalAttr3(value);
+}
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
glong
webkit_dom_test_obj_get_description(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->description();
return res;
@@ -513,7 +755,7 @@ webkit_dom_test_obj_get_description(WebKitDOMTestObj* self)
glong
webkit_dom_test_obj_get_id(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
glong res = item->id();
return res;
@@ -522,7 +764,7 @@ webkit_dom_test_obj_get_id(WebKitDOMTestObj* self)
void
webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value)
{
- g_return_if_fail (self);
+ g_return_if_fail(self);
WebCore::TestObj * item = WebKit::core(self);
item->setId(value);
}
@@ -530,7 +772,7 @@ webkit_dom_test_obj_set_id(WebKitDOMTestObj* self, glong value)
gchar*
webkit_dom_test_obj_get_hash(WebKitDOMTestObj* self)
{
- g_return_val_if_fail (self, 0);
+ g_return_val_if_fail(self, 0);
WebCore::TestObj * item = WebKit::core(self);
gchar* res = convertToUTF8String(item->hash());
return res;
@@ -562,11 +804,29 @@ enum {
PROP_UNSIGNED_LONG_LONG_ATTR,
PROP_STRING_ATTR,
PROP_TEST_OBJ_ATTR,
- PROP_ATTR_WITH_EXCEPTION,
- PROP_ATTR_WITH_SETTER_EXCEPTION,
+ PROP_REFLECTED_STRING_ATTR,
+ PROP_REFLECTED_INTEGRAL_ATTR,
+ PROP_REFLECTED_BOOLEAN_ATTR,
+ PROP_REFLECTED_URL_ATTR,
+ PROP_REFLECTED_STRING_ATTR,
+ PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR,
+ PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR,
+ PROP_REFLECTED_URL_ATTR,
PROP_ATTR_WITH_GETTER_EXCEPTION,
+ PROP_ATTR_WITH_SETTER_EXCEPTION,
+ PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
+ PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
PROP_CUSTOM_ATTR,
PROP_SCRIPT_STRING_ATTR,
+#if ENABLE(Condition1)
+ PROP_CONDITIONAL_ATTR1,
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ PROP_CONDITIONAL_ATTR2,
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ PROP_CONDITIONAL_ATTR3,
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
PROP_DESCRIPTION,
PROP_ID,
PROP_HASH,
@@ -609,9 +869,50 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
coreSelf->setStringAttr(WebCore::String::fromUTF8(g_value_get_string(value)));
break;
}
- case PROP_ATTR_WITH_EXCEPTION:
+ case PROP_REFLECTED_STRING_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_REFLECTED_INTEGRAL_ATTR:
+ {
+ coreSelf->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, (g_value_get_long(value)));
+ break;
+ }
+ case PROP_REFLECTED_BOOLEAN_ATTR:
+ {
+ coreSelf->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, (g_value_get_boolean(value)));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_REFLECTED_STRING_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR:
+ {
+ coreSelf->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, (g_value_get_long(value)));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR:
{
- coreSelf->setAttrWithException((g_value_get_long(value)));
+ coreSelf->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, (g_value_get_boolean(value)));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ coreSelf->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, WebCore::String::fromUTF8(g_value_get_string(value)));
+ break;
+ }
+ case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ {
+ WebCore::ExceptionCode ec = 0;
+ coreSelf->setAttrWithGetterException((g_value_get_long(value)), ec);
break;
}
case PROP_ATTR_WITH_SETTER_EXCEPTION:
@@ -620,12 +921,39 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint prop_id, con
coreSelf->setAttrWithSetterException((g_value_get_long(value)), ec);
break;
}
- case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION:
{
WebCore::ExceptionCode ec = 0;
- coreSelf->setAttrWithGetterException((g_value_get_long(value)), ec);
+ coreSelf->setStringAttrWithGetterException(WebCore::String::fromUTF8(g_value_get_string(value)), ec);
+ break;
+ }
+ case PROP_STRING_ATTR_WITH_SETTER_EXCEPTION:
+ {
+ WebCore::ExceptionCode ec = 0;
+ coreSelf->setStringAttrWithSetterException(WebCore::String::fromUTF8(g_value_get_string(value)), ec);
+ break;
+ }
+#if ENABLE(Condition1)
+ case PROP_CONDITIONAL_ATTR1:
+ {
+ coreSelf->setConditionalAttr1((g_value_get_long(value)));
break;
}
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR2:
+ {
+ coreSelf->setConditionalAttr2((g_value_get_long(value)));
+ break;
+ }
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR3:
+ {
+ coreSelf->setConditionalAttr3((g_value_get_long(value)));
+ break;
+ }
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
case PROP_ID:
{
coreSelf->setId((g_value_get_long(value)));
@@ -685,20 +1013,66 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa
g_value_set_object(value, WebKit::kit(ptr.get()));
break;
}
- case PROP_ATTR_WITH_EXCEPTION:
+ case PROP_REFLECTED_STRING_ATTR:
{
- g_value_set_long(value, coreSelf->attrWithException());
+ g_value_take_string(value, convertToUTF8String(coreSelf->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr)));
+ break;
+ }
+ case PROP_REFLECTED_INTEGRAL_ATTR:
+ {
+ g_value_set_long(value, coreSelf->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+ break;
+ }
+ case PROP_REFLECTED_BOOLEAN_ATTR:
+ {
+ g_value_set_boolean(value, coreSelf->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ g_value_take_string(value, convertToUTF8String(coreSelf->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr)));
+ break;
+ }
+ case PROP_REFLECTED_STRING_ATTR:
+ {
+ g_value_take_string(value, convertToUTF8String(coreSelf->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr)));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR:
+ {
+ g_value_set_long(value, coreSelf->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+ break;
+ }
+ case PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR:
+ {
+ g_value_set_boolean(value, coreSelf->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+ break;
+ }
+ case PROP_REFLECTED_URL_ATTR:
+ {
+ g_value_take_string(value, convertToUTF8String(coreSelf->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr)));
+ break;
+ }
+ case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ {
+ WebCore::ExceptionCode ec = 0;
+ g_value_set_long(value, coreSelf->attrWithGetterException(ec));
break;
}
case PROP_ATTR_WITH_SETTER_EXCEPTION:
{
+ g_value_set_long(value, coreSelf->attrWithSetterException());
+ break;
+ }
+ case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION:
+ {
WebCore::ExceptionCode ec = 0;
- g_value_set_long(value, coreSelf->attrWithSetterException(ec));
+ g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithGetterException(ec)));
break;
}
- case PROP_ATTR_WITH_GETTER_EXCEPTION:
+ case PROP_STRING_ATTR_WITH_SETTER_EXCEPTION:
{
- g_value_set_long(value, coreSelf->attrWithGetterException());
+ g_value_take_string(value, convertToUTF8String(coreSelf->stringAttrWithSetterException()));
break;
}
case PROP_SCRIPT_STRING_ATTR:
@@ -706,6 +1080,27 @@ static void webkit_dom_test_obj_get_property(GObject* object, guint prop_id, GVa
g_value_take_string(value, convertToUTF8String(coreSelf->scriptStringAttr()));
break;
}
+#if ENABLE(Condition1)
+ case PROP_CONDITIONAL_ATTR1:
+ {
+ g_value_set_long(value, coreSelf->conditionalAttr1());
+ break;
+ }
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR2:
+ {
+ g_value_set_long(value, coreSelf->conditionalAttr2());
+ break;
+ }
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ case PROP_CONDITIONAL_ATTR3:
+ {
+ g_value_set_long(value, coreSelf->conditionalAttr3());
+ break;
+ }
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
case PROP_DESCRIPTION:
{
g_value_set_long(value, coreSelf->description());
@@ -800,24 +1195,66 @@ G_MAXUINT64, /* min */
WEBKIT_TYPE_DOM_TEST_OBJ, /* gobject type */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
- PROP_ATTR_WITH_EXCEPTION,
- g_param_spec_long("attr-with-exception", /* name */
- "test_obj_attr-with-exception", /* short description */
- "read-write glong TestObj.attr-with-exception", /* longer - could do with some extra doc stuff here */
+ PROP_REFLECTED_STRING_ATTR,
+ g_param_spec_string("reflected-string-attr", /* name */
+ "test_obj_reflected-string-attr", /* short description */
+ "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_INTEGRAL_ATTR,
+ g_param_spec_long("reflected-integral-attr", /* name */
+ "test_obj_reflected-integral-attr", /* short description */
+ "read-write glong TestObj.reflected-integral-attr", /* longer - could do with some extra doc stuff here */
G_MINLONG, /* min */
G_MAXLONG, /* max */
0, /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
- PROP_ATTR_WITH_SETTER_EXCEPTION,
- g_param_spec_long("attr-with-setter-exception", /* name */
- "test_obj_attr-with-setter-exception", /* short description */
- "read-write glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ PROP_REFLECTED_BOOLEAN_ATTR,
+ g_param_spec_boolean("reflected-boolean-attr", /* name */
+ "test_obj_reflected-boolean-attr", /* short description */
+ "read-write gboolean TestObj.reflected-boolean-attr", /* longer - could do with some extra doc stuff here */
+ FALSE, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_URL_ATTR,
+ g_param_spec_string("reflected-url-attr", /* name */
+ "test_obj_reflected-url-attr", /* short description */
+ "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_STRING_ATTR,
+ g_param_spec_string("reflected-string-attr", /* name */
+ "test_obj_reflected-string-attr", /* short description */
+ "read-write gchar* TestObj.reflected-string-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_CUSTOM_INTEGRAL_ATTR,
+ g_param_spec_long("reflected-custom-integral-attr", /* name */
+ "test_obj_reflected-custom-integral-attr", /* short description */
+ "read-write glong TestObj.reflected-custom-integral-attr", /* longer - could do with some extra doc stuff here */
G_MINLONG, /* min */
G_MAXLONG, /* max */
0, /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR,
+ g_param_spec_boolean("reflected-custom-boolean-attr", /* name */
+ "test_obj_reflected-custom-boolean-attr", /* short description */
+ "read-write gboolean TestObj.reflected-custom-boolean-attr", /* longer - could do with some extra doc stuff here */
+ FALSE, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_REFLECTED_URL_ATTR,
+ g_param_spec_string("reflected-url-attr", /* name */
+ "test_obj_reflected-url-attr", /* short description */
+ "read-write gchar* TestObj.reflected-url-attr", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
PROP_ATTR_WITH_GETTER_EXCEPTION,
g_param_spec_long("attr-with-getter-exception", /* name */
"test_obj_attr-with-getter-exception", /* short description */
@@ -827,12 +1264,68 @@ G_MAXLONG, /* max */
0, /* default */
WEBKIT_PARAM_READWRITE));
g_object_class_install_property(gobjectClass,
+ PROP_ATTR_WITH_SETTER_EXCEPTION,
+ g_param_spec_long("attr-with-setter-exception", /* name */
+ "test_obj_attr-with-setter-exception", /* short description */
+ "read-write glong TestObj.attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
+ g_param_spec_string("string-attr-with-getter-exception", /* name */
+ "test_obj_string-attr-with-getter-exception", /* short description */
+ "read-write gchar* TestObj.string-attr-with-getter-exception", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
+ PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
+ g_param_spec_string("string-attr-with-setter-exception", /* name */
+ "test_obj_string-attr-with-setter-exception", /* short description */
+ "read-write gchar* TestObj.string-attr-with-setter-exception", /* longer - could do with some extra doc stuff here */
+ "", /* default */
+ WEBKIT_PARAM_READWRITE));
+ g_object_class_install_property(gobjectClass,
PROP_SCRIPT_STRING_ATTR,
g_param_spec_string("script-string-attr", /* name */
"test_obj_script-string-attr", /* short description */
"read-only gchar* TestObj.script-string-attr", /* longer - could do with some extra doc stuff here */
"", /* default */
WEBKIT_PARAM_READABLE));
+#if ENABLE(Condition1)
+ g_object_class_install_property(gobjectClass,
+ PROP_CONDITIONAL_ATTR1,
+ g_param_spec_long("conditional-attr1", /* name */
+ "test_obj_conditional-attr1", /* short description */
+ "read-write glong TestObj.conditional-attr1", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+#endif /* ENABLE(Condition1) */
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ g_object_class_install_property(gobjectClass,
+ PROP_CONDITIONAL_ATTR2,
+ g_param_spec_long("conditional-attr2", /* name */
+ "test_obj_conditional-attr2", /* short description */
+ "read-write glong TestObj.conditional-attr2", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ g_object_class_install_property(gobjectClass,
+ PROP_CONDITIONAL_ATTR3,
+ g_param_spec_long("conditional-attr3", /* name */
+ "test_obj_conditional-attr3", /* short description */
+ "read-write glong TestObj.conditional-attr3", /* longer - could do with some extra doc stuff here */
+ G_MINLONG, /* min */
+G_MAXLONG, /* max */
+0, /* default */
+ WEBKIT_PARAM_READWRITE));
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
g_object_class_install_property(gobjectClass,
PROP_DESCRIPTION,
g_param_spec_long("description", /* name */
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
index ef5ccb8..8dcd8c3 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
@@ -160,27 +160,111 @@ webkit_dom_test_obj_get_test_obj_attr(WebKitDOMTestObj* self);
WEBKIT_API void
webkit_dom_test_obj_set_test_obj_attr(WebKitDOMTestObj* self, WebKitDOMTestObj* value);
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value);
+
WEBKIT_API glong
-webkit_dom_test_obj_get_attr_with_exception(WebKitDOMTestObj* self);
+webkit_dom_test_obj_get_reflected_integral_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_integral_attr(WebKitDOMTestObj* self, glong value);
+
+WEBKIT_API gboolean
+webkit_dom_test_obj_get_reflected_boolean_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_boolean_attr(WebKitDOMTestObj* self, gboolean value);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_string_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_attr_with_exception(WebKitDOMTestObj* self, glong value);
+webkit_dom_test_obj_set_reflected_string_attr(WebKitDOMTestObj* self, gchar* value);
WEBKIT_API glong
-webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self, GError **error);
+webkit_dom_test_obj_get_reflected_custom_integral_attr(WebKitDOMTestObj* self);
WEBKIT_API void
-webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error);
+webkit_dom_test_obj_set_reflected_custom_integral_attr(WebKitDOMTestObj* self, glong value);
+
+WEBKIT_API gboolean
+webkit_dom_test_obj_get_reflected_custom_boolean_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_custom_boolean_attr(WebKitDOMTestObj* self, gboolean value);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_reflected_url_attr(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_reflected_url_attr(WebKitDOMTestObj* self, gchar* value);
WEBKIT_API glong
-webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self);
+webkit_dom_test_obj_get_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error);
WEBKIT_API void
webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value, GError **error);
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError **error);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError **error);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_string_attr_with_getter_exception(WebKitDOMTestObj* self, gchar* value, GError **error);
+
+WEBKIT_API gchar*
+webkit_dom_test_obj_get_string_attr_with_setter_exception(WebKitDOMTestObj* self);
+
+WEBKIT_API void
+webkit_dom_test_obj_set_string_attr_with_setter_exception(WebKitDOMTestObj* self, gchar* value, GError **error);
+
WEBKIT_API gchar*
webkit_dom_test_obj_get_script_string_attr(WebKitDOMTestObj* self);
+#if ENABLE(Condition1)
+WEBKIT_API glong
+webkit_dom_test_obj_get_conditional_attr1(WebKitDOMTestObj* self);
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1)
+WEBKIT_API void
+webkit_dom_test_obj_set_conditional_attr1(WebKitDOMTestObj* self, glong value);
+#endif /* ENABLE(Condition1) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+WEBKIT_API glong
+webkit_dom_test_obj_get_conditional_attr2(WebKitDOMTestObj* self);
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+WEBKIT_API void
+webkit_dom_test_obj_set_conditional_attr2(WebKitDOMTestObj* self, glong value);
+#endif /* ENABLE(Condition1) && ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+WEBKIT_API glong
+webkit_dom_test_obj_get_conditional_attr3(WebKitDOMTestObj* self);
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+WEBKIT_API void
+webkit_dom_test_obj_set_conditional_attr3(WebKitDOMTestObj* self, glong value);
+#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
+
WEBKIT_API glong
webkit_dom_test_obj_get_description(WebKitDOMTestObj* self);
diff --git a/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp b/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
index 693a48b..8e71df1 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp
@@ -19,6 +19,9 @@
*/
#include "config.h"
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "JSTestInterface.h"
#include "TestInterface.h"
@@ -61,39 +64,30 @@ static const HashTableValue JSTestInterfaceConstructorTableValues[1] =
static JSC_CONST_HASHTABLE HashTable JSTestInterfaceConstructorTable = { 1, 0, JSTestInterfaceConstructorTableValues, 0 };
class JSTestInterfaceConstructor : public DOMConstructorObject {
public:
- JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+ JSTestInterfaceConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
- putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
- virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
- virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
- virtual const ClassInfo* classInfo() const { return &s_info; }
- static const ClassInfo s_info;
-
- static PassRefPtr<Structure> createStructure(JSValue proto)
- {
- return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
- static EncodedJSValue JSC_HOST_CALL constructTestInterface(ExecState* exec)
- {
- ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext();
- if (!context)
- return throwVMError(exec, createReferenceError(exec, "Reference error"));
- return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context))));
- }
- virtual ConstructType getConstructData(ConstructData& constructData)
- {
- constructData.native.function = constructTestInterface;
- return ConstructTypeHost;
- }
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+ static JSC::EncodedJSValue JSC_HOST_CALL constructJSTestInterface(JSC::ExecState*);
+ virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
};
const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterfaceConstructor", 0, &JSTestInterfaceConstructorTable, 0 };
+JSTestInterfaceConstructor::JSTestInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSTestInterfaceConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+{
+ putDirect(exec->propertyNames().prototype, JSTestInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
bool JSTestInterfaceConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSTestInterfaceConstructor, DOMObject>(exec, &JSTestInterfaceConstructorTable, this, propertyName, slot);
@@ -104,6 +98,20 @@ bool JSTestInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const
return getStaticValueDescriptor<JSTestInterfaceConstructor, DOMObject>(exec, &JSTestInterfaceConstructorTable, this, propertyName, descriptor);
}
+EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::constructJSTestInterface(ExecState* exec)
+{
+ ScriptExecutionContext* context = static_cast<JSTestInterfaceConstructor*>(exec->callee())->scriptExecutionContext();
+ if (!context)
+ return throwVMError(exec, createReferenceError(exec, "Reference error"));
+ return JSValue::encode(asObject(toJS(exec, static_cast<JSTestInterfaceConstructor*>(exec->callee())->globalObject(), TestInterface::create(context))));
+}
+
+ConstructType JSTestInterfaceConstructor::getConstructData(ConstructData& constructData)
+{
+ constructData.native.function = constructJSTestInterface;
+ return ConstructTypeHost;
+}
+
/* Hash table for prototype */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
@@ -173,3 +181,5 @@ TestInterface* toTestInterface(JSC::JSValue value)
}
}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/JS/JSTestInterface.h b/WebCore/bindings/scripts/test/JS/JSTestInterface.h
index 23b183b..09d7d7c 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestInterface.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestInterface.h
@@ -21,6 +21,8 @@
#ifndef JSTestInterface_h
#define JSTestInterface_h
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "JSDOMBinding.h"
#include <runtime/JSGlobalObject.h>
#include <runtime/JSObjectWithGlobalObject.h>
@@ -79,4 +81,6 @@ JSC::JSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::JSValue, const JSC
} // namespace WebCore
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
#endif
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 09b69cd..360782d 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -21,6 +21,7 @@
#include "config.h"
#include "JSTestObj.h"
+#include "HTMLNames.h"
#include "JSEventListener.h"
#include "JSTestObj.h"
#include "JSlog.h"
@@ -46,7 +47,7 @@ ASSERT_CLASS_FITS_IN_CELL(JSTestObj);
#define THUNK_GENERATOR(generator)
#endif
-static const HashTableValue JSTestObjTableValues[18] =
+static const HashTableValue JSTestObjTableValues[30] =
{
{ "readOnlyIntAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
{ "readOnlyStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -56,11 +57,29 @@ static const HashTableValue JSTestObjTableValues[18] =
{ "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) },
{ "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
{ "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
- { "attrWithException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithException), (intptr_t)setJSTestObjAttrWithException THUNK_GENERATOR(0) },
- { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) },
+ { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
+ { "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
+ { "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) },
+ { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) },
+ { "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
+ { "reflectedCustomIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomIntegralAttr), (intptr_t)setJSTestObjReflectedCustomIntegralAttr THUNK_GENERATOR(0) },
+ { "reflectedCustomBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomBooleanAttr), (intptr_t)setJSTestObjReflectedCustomBooleanAttr THUNK_GENERATOR(0) },
+ { "reflectedURLAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedURLAttr), (intptr_t)setJSTestObjReflectedURLAttr THUNK_GENERATOR(0) },
{ "attrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t)setJSTestObjAttrWithGetterException THUNK_GENERATOR(0) },
+ { "attrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t)setJSTestObjAttrWithSetterException THUNK_GENERATOR(0) },
+ { "stringAttrWithGetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t)setJSTestObjStringAttrWithGetterException THUNK_GENERATOR(0) },
+ { "stringAttrWithSetterException", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t)setJSTestObjStringAttrWithSetterException THUNK_GENERATOR(0) },
{ "customAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCustomAttr), (intptr_t)setJSTestObjCustomAttr THUNK_GENERATOR(0) },
{ "scriptStringAttr", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjScriptStringAttr), (intptr_t)0 THUNK_GENERATOR(0) },
+#if ENABLE(Condition1)
+ { "conditionalAttr1", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr1), (intptr_t)setJSTestObjConditionalAttr1 THUNK_GENERATOR(0) },
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ { "conditionalAttr2", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr2), (intptr_t)setJSTestObjConditionalAttr2 THUNK_GENERATOR(0) },
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ { "conditionalAttr3", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjConditionalAttr3), (intptr_t)setJSTestObjConditionalAttr3 THUNK_GENERATOR(0) },
+#endif
{ "description", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjDescription), (intptr_t)0 THUNK_GENERATOR(0) },
{ "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjId), (intptr_t)setJSTestObjId THUNK_GENERATOR(0) },
{ "hash", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjHash), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -69,7 +88,7 @@ static const HashTableValue JSTestObjTableValues[18] =
};
#undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 65, 63, JSTestObjTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjTable = { 69, 63, JSTestObjTableValues, 0 };
/* Hash table for constructor */
#if ENABLE(JIT)
#define THUNK_GENERATOR(generator) , generator
@@ -86,27 +105,28 @@ static const HashTableValue JSTestObjConstructorTableValues[1] =
static JSC_CONST_HASHTABLE HashTable JSTestObjConstructorTable = { 1, 0, JSTestObjConstructorTableValues, 0 };
class JSTestObjConstructor : public DOMConstructorObject {
public:
- JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
- : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+ JSTestObjConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+
+ virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
+ virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
+ virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ static const JSC::ClassInfo s_info;
+ static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
{
- putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+ return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount);
}
- virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
- virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
- virtual const ClassInfo* classInfo() const { return &s_info; }
- static const ClassInfo s_info;
-
- static PassRefPtr<Structure> createStructure(JSValue proto)
- {
- return Structure::create(proto, TypeInfo(ObjectType, StructureFlags), AnonymousSlotCount);
- }
-
protected:
- static const unsigned StructureFlags = OverridesGetOwnPropertySlot | ImplementsHasInstance | DOMConstructorObject::StructureFlags;
+ static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
};
const ClassInfo JSTestObjConstructor::s_info = { "TestObjConstructor", 0, &JSTestObjConstructorTable, 0 };
+JSTestObjConstructor::JSTestObjConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
+ : DOMConstructorObject(JSTestObjConstructor::createStructure(globalObject->objectPrototype()), globalObject)
+{
+ putDirect(exec->propertyNames().prototype, JSTestObjPrototype::self(exec, globalObject), DontDelete | ReadOnly);
+}
+
bool JSTestObjConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
{
return getStaticValueSlot<JSTestObjConstructor, DOMObject>(exec, &JSTestObjConstructorTable, this, propertyName, slot);
@@ -277,31 +297,113 @@ JSValue jsTestObjTestObjAttr(ExecState* exec, JSValue slotBase, const Identifier
return result;
}
-JSValue jsTestObjAttrWithException(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedCustomIntegralAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedCustomBooleanAttr(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjReflectedURLAttr(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsNumber(exec, imp->attrWithException());
+ JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+ return result;
+}
+
+JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ ExceptionCode ec = 0;
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSC::JSValue result = jsNumber(exec, imp->attrWithGetterException(ec));
+ setDOMException(exec, ec);
return result;
}
JSValue jsTestObjAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->attrWithSetterException());
+ return result;
+}
+
+JSValue jsTestObjStringAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
ExceptionCode ec = 0;
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- JSC::JSValue result = jsNumber(exec, imp->attrWithSetterException(ec));
+ JSC::JSValue result = jsString(exec, imp->stringAttrWithGetterException(ec));
setDOMException(exec, ec);
return result;
}
-JSValue jsTestObjAttrWithGetterException(ExecState* exec, JSValue slotBase, const Identifier&)
+JSValue jsTestObjStringAttrWithSetterException(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
UNUSED_PARAM(exec);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- JSValue result = jsNumber(exec, imp->attrWithGetterException());
+ JSValue result = jsString(exec, imp->stringAttrWithSetterException());
return result;
}
@@ -320,6 +422,39 @@ JSValue jsTestObjScriptStringAttr(ExecState* exec, JSValue slotBase, const Ident
return result;
}
+#if ENABLE(Condition1)
+JSValue jsTestObjConditionalAttr1(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->conditionalAttr1());
+ return result;
+}
+#endif
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+JSValue jsTestObjConditionalAttr2(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->conditionalAttr2());
+ return result;
+}
+#endif
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+JSValue jsTestObjConditionalAttr3(ExecState* exec, JSValue slotBase, const Identifier&)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
+ UNUSED_PARAM(exec);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ JSValue result = jsNumber(exec, imp->conditionalAttr3());
+ return result;
+}
+#endif
+
JSValue jsTestObjDescription(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
@@ -392,11 +527,69 @@ void setJSTestObjTestObjAttr(ExecState* exec, JSObject* thisObject, JSValue valu
imp->setTestObjAttr(toTestObj(value));
}
-void setJSTestObjAttrWithException(ExecState* exec, JSObject* thisObject, JSValue value)
+void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
- imp->setAttrWithException(value.toInt32(exec));
+ imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjReflectedIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, value.toInt32(exec));
+}
+
+void setJSTestObjReflectedBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, value.toBoolean(exec));
+}
+
+void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjReflectedStringAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjReflectedCustomIntegralAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, value.toInt32(exec));
+}
+
+void setJSTestObjReflectedCustomBooleanAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, value.toBoolean(exec));
+}
+
+void setJSTestObjReflectedURLAttr(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, valueToStringWithNullCheck(exec, value));
+}
+
+void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ imp->setAttrWithGetterException(value.toInt32(exec), ec);
+ setDOMException(exec, ec);
}
void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
@@ -408,12 +601,21 @@ void setJSTestObjAttrWithSetterException(ExecState* exec, JSObject* thisObject,
setDOMException(exec, ec);
}
-void setJSTestObjAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
+void setJSTestObjStringAttrWithGetterException(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
TestObj* imp = static_cast<TestObj*>(castedThis->impl());
ExceptionCode ec = 0;
- imp->setAttrWithGetterException(value.toInt32(exec), ec);
+ imp->setStringAttrWithGetterException(ustringToString(value.toString(exec)), ec);
+ setDOMException(exec, ec);
+}
+
+void setJSTestObjStringAttrWithSetterException(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ ExceptionCode ec = 0;
+ imp->setStringAttrWithSetterException(ustringToString(value.toString(exec)), ec);
setDOMException(exec, ec);
}
@@ -422,6 +624,33 @@ void setJSTestObjCustomAttr(ExecState* exec, JSObject* thisObject, JSValue value
static_cast<JSTestObj*>(thisObject)->setCustomAttr(exec, value);
}
+#if ENABLE(Condition1)
+void setJSTestObjConditionalAttr1(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setConditionalAttr1(value.toInt32(exec));
+}
+#endif
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+void setJSTestObjConditionalAttr2(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setConditionalAttr2(value.toInt32(exec));
+}
+#endif
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+void setJSTestObjConditionalAttr3(ExecState* exec, JSObject* thisObject, JSValue value)
+{
+ JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
+ TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+ imp->setConditionalAttr3(value.toInt32(exec));
+}
+#endif
+
void setJSTestObjId(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSTestObj* castedThis = static_cast<JSTestObj*>(thisObject);
@@ -875,7 +1104,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithNonOptionalArgA
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -889,7 +1118,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod1(ExecSta
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -910,7 +1139,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod2(ExecSta
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -923,7 +1152,7 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod3(ExecSta
return JSValue::encode(jsUndefined());
}
-EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSTestObj::s_info))
@@ -938,15 +1167,15 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod4(ExecSta
EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOverloadedMethod(ExecState* exec)
{
- if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
+ if ((exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info)) && (exec->argument(1).isNull() || exec->argument(1).isUndefined() || exec->argument(1).isString() || exec->argument(1).isObject())))
return jsTestObjPrototypeFunctionOverloadedMethod1(exec);
- if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))
+ if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))) || (exec->argumentCount() == 2 && (exec->argument(0).isNull() || exec->argument(0).isObject() && asObject(exec->argument(0))->inherits(&JSTestObj::s_info))))
return jsTestObjPrototypeFunctionOverloadedMethod2(exec);
if ((exec->argumentCount() == 1 && (exec->argument(0).isNull() || exec->argument(0).isUndefined() || exec->argument(0).isString() || exec->argument(0).isObject())))
return jsTestObjPrototypeFunctionOverloadedMethod3(exec);
if (exec->argumentCount() == 1)
return jsTestObjPrototypeFunctionOverloadedMethod4(exec);
- return throwTypeError(exec);
+ return throwVMTypeError(exec);
}
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestObj* object)
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h
index dd84005..3b21c85 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -130,15 +130,39 @@ JSC::JSValue jsTestObjStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Ident
void setJSTestObjStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjTestObjAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjTestObjAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsTestObjAttrWithException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-void setJSTestObjAttrWithException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
-JSC::JSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
-void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedIntegralAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedIntegralAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedBooleanAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedBooleanAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedCustomIntegralAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedCustomIntegralAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedCustomBooleanAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedCustomBooleanAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjReflectedURLAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjCustomAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
void setJSTestObjCustomAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
JSC::JSValue jsTestObjScriptStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+JSC::JSValue jsTestObjConditionalAttr1(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjConditionalAttr1(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjConditionalAttr2(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjConditionalAttr2(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
+JSC::JSValue jsTestObjConditionalAttr3(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
+void setJSTestObjConditionalAttr3(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/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
index 8fd7791..ab59333 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestInterface.mm
@@ -25,6 +25,9 @@
*/
#import "config.h"
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#import "DOMInternal.h"
#import "DOMTestInterface.h"
@@ -85,3 +88,5 @@ DOMTestInterface *kit(WebCore::TestInterface* value)
addDOMWrapper(wrapper, value);
return [wrapper autorelease];
}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 6b50246..d8862da 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -47,15 +47,45 @@
- (void)setStringAttr:(NSString *)newStringAttr;
- (DOMTestObj *)testObjAttr;
- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr;
-- (int)attrWithException;
-- (void)setAttrWithException:(int)newAttrWithException;
-- (int)attrWithSetterException;
-- (void)setAttrWithSetterException:(int)newAttrWithSetterException;
+- (NSString *)reflectedStringAttr;
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
+- (int)reflectedIntegralAttr;
+- (void)setReflectedIntegralAttr:(int)newReflectedIntegralAttr;
+- (BOOL)reflectedBooleanAttr;
+- (void)setReflectedBooleanAttr:(BOOL)newReflectedBooleanAttr;
+- (NSString *)reflectedURLAttr;
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr;
+- (NSString *)reflectedStringAttr;
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
+- (int)reflectedCustomIntegralAttr;
+- (void)setReflectedCustomIntegralAttr:(int)newReflectedCustomIntegralAttr;
+- (BOOL)reflectedCustomBooleanAttr;
+- (void)setReflectedCustomBooleanAttr:(BOOL)newReflectedCustomBooleanAttr;
+- (NSString *)reflectedURLAttr;
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr;
- (int)attrWithGetterException;
- (void)setAttrWithGetterException:(int)newAttrWithGetterException;
+- (int)attrWithSetterException;
+- (void)setAttrWithSetterException:(int)newAttrWithSetterException;
+- (NSString *)stringAttrWithGetterException;
+- (void)setStringAttrWithGetterException:(NSString *)newStringAttrWithGetterException;
+- (NSString *)stringAttrWithSetterException;
+- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException;
- (int)customAttr;
- (void)setCustomAttr:(int)newCustomAttr;
- (NSString *)scriptStringAttr;
+#if ENABLE(Condition1)
+- (int)conditionalAttr1;
+- (void)setConditionalAttr1:(int)newConditionalAttr1;
+#endif
+#if ENABLE(Condition1) && ENABLE(Condition2)
+- (int)conditionalAttr2;
+- (void)setConditionalAttr2:(int)newConditionalAttr2;
+#endif
+#if ENABLE(Condition1) || ENABLE(Condition2)
+- (int)conditionalAttr3;
+- (void)setConditionalAttr3:(int)newConditionalAttr3;
+#endif
- (int)descriptionName;
- (int)idName;
- (void)setIdName:(int)newIdName;
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index e57ed87..9bbbf14 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -39,6 +39,7 @@
#import "DOMlogInternal.h"
#import "EventListener.h"
#import "ExceptionHandlers.h"
+#import "HTMLNames.h"
#import "JSMainThreadExecState.h"
#import "KURL.h"
#import "ObjCEventListener.h"
@@ -151,27 +152,125 @@
IMPL->setTestObjAttr(core(newTestObjAttr));
}
-- (int)attrWithException
+- (NSString *)reflectedStringAttr
{
WebCore::JSMainThreadNullState state;
- return IMPL->attrWithException();
+ return IMPL->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr);
}
-- (void)setAttrWithException:(int)newAttrWithException
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr
{
WebCore::JSMainThreadNullState state;
- IMPL->setAttrWithException(newAttrWithException);
+ IMPL->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, newReflectedStringAttr);
}
-- (int)attrWithSetterException
+- (int)reflectedIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr);
+}
+
+- (void)setReflectedIntegralAttr:(int)newReflectedIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, newReflectedIntegralAttr);
+}
+
+- (BOOL)reflectedBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr);
+}
+
+- (void)setReflectedBooleanAttr:(BOOL)newReflectedBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, newReflectedBooleanAttr);
+}
+
+- (NSString *)reflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr);
+}
+
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, newReflectedURLAttr);
+}
+
+- (NSString *)reflectedStringAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr);
+}
+
+- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, newReflectedStringAttr);
+}
+
+- (int)reflectedCustomIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr);
+}
+
+- (void)setReflectedCustomIntegralAttr:(int)newReflectedCustomIntegralAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, newReflectedCustomIntegralAttr);
+}
+
+- (BOOL)reflectedCustomBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr);
+}
+
+- (void)setReflectedCustomBooleanAttr:(BOOL)newReflectedCustomBooleanAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, newReflectedCustomBooleanAttr);
+}
+
+- (NSString *)reflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr);
+}
+
+- (void)setReflectedURLAttr:(NSString *)newReflectedURLAttr
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, newReflectedURLAttr);
+}
+
+- (int)attrWithGetterException
{
WebCore::JSMainThreadNullState state;
WebCore::ExceptionCode ec = 0;
- int result = IMPL->attrWithSetterException(ec);
+ int result = IMPL->attrWithGetterException(ec);
WebCore::raiseOnDOMError(ec);
return result;
}
+- (void)setAttrWithGetterException:(int)newAttrWithGetterException
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ IMPL->setAttrWithGetterException(newAttrWithGetterException, ec);
+ WebCore::raiseOnDOMError(ec);
+}
+
+- (int)attrWithSetterException
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->attrWithSetterException();
+}
+
- (void)setAttrWithSetterException:(int)newAttrWithSetterException
{
WebCore::JSMainThreadNullState state;
@@ -180,17 +279,34 @@
WebCore::raiseOnDOMError(ec);
}
-- (int)attrWithGetterException
+- (NSString *)stringAttrWithGetterException
{
WebCore::JSMainThreadNullState state;
- return IMPL->attrWithGetterException();
+ WebCore::ExceptionCode ec = 0;
+ NSString *result = IMPL->stringAttrWithGetterException(ec);
+ WebCore::raiseOnDOMError(ec);
+ return result;
}
-- (void)setAttrWithGetterException:(int)newAttrWithGetterException
+- (void)setStringAttrWithGetterException:(NSString *)newStringAttrWithGetterException
{
WebCore::JSMainThreadNullState state;
WebCore::ExceptionCode ec = 0;
- IMPL->setAttrWithGetterException(newAttrWithGetterException, ec);
+ IMPL->setStringAttrWithGetterException(newStringAttrWithGetterException, ec);
+ WebCore::raiseOnDOMError(ec);
+}
+
+- (NSString *)stringAttrWithSetterException
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->stringAttrWithSetterException();
+}
+
+- (void)setStringAttrWithSetterException:(NSString *)newStringAttrWithSetterException
+{
+ WebCore::JSMainThreadNullState state;
+ WebCore::ExceptionCode ec = 0;
+ IMPL->setStringAttrWithSetterException(newStringAttrWithSetterException, ec);
WebCore::raiseOnDOMError(ec);
}
@@ -212,6 +328,48 @@
return IMPL->scriptStringAttr();
}
+#if ENABLE(Condition1)
+- (int)conditionalAttr1
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->conditionalAttr1();
+}
+
+- (void)setConditionalAttr1:(int)newConditionalAttr1
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setConditionalAttr1(newConditionalAttr1);
+}
+#endif
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+- (int)conditionalAttr2
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->conditionalAttr2();
+}
+
+- (void)setConditionalAttr2:(int)newConditionalAttr2
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setConditionalAttr2(newConditionalAttr2);
+}
+#endif
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+- (int)conditionalAttr3
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->conditionalAttr3();
+}
+
+- (void)setConditionalAttr3:(int)newConditionalAttr3
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setConditionalAttr3(newConditionalAttr3);
+}
+#endif
+
- (int)descriptionName
{
WebCore::JSMainThreadNullState state;
diff --git a/WebCore/bindings/scripts/test/TestInterface.idl b/WebCore/bindings/scripts/test/TestInterface.idl
index 5a8b008..1f0aa18 100644
--- a/WebCore/bindings/scripts/test/TestInterface.idl
+++ b/WebCore/bindings/scripts/test/TestInterface.idl
@@ -30,6 +30,7 @@
// changes in its ouput.
module test {
interface [
+ Conditional=Condition1|Condition2,
CanBeConstructed,
CallWith=ScriptExecutionContext
] TestInterface {
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 1cb004c..ef4db10 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -40,6 +40,16 @@ module test {
attribute DOMString stringAttr;
attribute TestObj testObjAttr;
+ // Reflected DOM attributes
+ attribute [Reflect] DOMString reflectedStringAttr;
+ attribute [Reflect] long reflectedIntegralAttr;
+ attribute [Reflect] boolean reflectedBooleanAttr;
+ attribute [ReflectURL] DOMString reflectedURLAttr;
+ attribute [Reflect=customContentStringAttr] DOMString reflectedStringAttr;
+ attribute [Reflect=customContentIntegralAttr] long reflectedCustomIntegralAttr;
+ attribute [Reflect=customContentBooleanAttr] boolean reflectedCustomBooleanAttr;
+ attribute [ReflectURL=customContentURLAttr] DOMString reflectedURLAttr;
+
// Methods
void voidMethod();
void voidMethodWithArgs(in long intArg, in DOMString strArg, in TestObj objArg);
@@ -55,10 +65,11 @@ module test {
void serializedValue(in SerializedScriptValue serializedArg);
// Exceptions
- void methodWithException() raises(DOMException);
- attribute long attrWithException raises(DOMException);
- attribute long attrWithSetterException getter raises(DOMException);
- attribute long attrWithGetterException setter raises(DOMException);
+ void methodWithException() raises(DOMException);
+ attribute long attrWithGetterException getter raises(DOMException);
+ attribute long attrWithSetterException setter raises(DOMException);
+ attribute DOMString stringAttrWithGetterException getter raises(DOMException);
+ attribute DOMString stringAttrWithSetterException setter raises(DOMException);
// 'Custom' extended attribute
attribute [Custom] long customAttr;
@@ -97,6 +108,11 @@ module test {
// 'ConvertScriptString' extended attribute
readonly attribute [ConvertScriptString] DOMString scriptStringAttr;
+ // 'Conditional' extended attribute
+ attribute [Conditional=Condition1] long conditionalAttr1;
+ attribute [Conditional=Condition1&Condition2] long conditionalAttr2;
+ attribute [Conditional=Condition1|Condition2] long conditionalAttr3;
+
#if defined(TESTING_V8) || defined(TESTING_JS)
// Overloads
void overloadedMethod(in TestObj objArg, in DOMString strArg);
diff --git a/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp b/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
index fef199a..eff4ebd 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp
@@ -28,6 +28,7 @@
#include "V8Class2.h"
#include "V8CustomVoidCallback.h"
#include "V8DOMString.h"
+#include "V8Proxy.h"
#include <wtf/Assertions.h>
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index f0bfb86..340dca7 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -21,6 +21,8 @@
#include "config.h"
#include "V8TestInterface.h"
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#include "RuntimeEnabledFeatures.h"
#include "V8Binding.h"
#include "V8BindingState.h"
@@ -113,3 +115,5 @@ void V8TestInterface::derefObject(void* object)
}
} // namespace WebCore
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index ce1310e..d2192ca 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -18,6 +18,8 @@
Boston, MA 02111-1307, USA.
*/
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
#ifndef V8TestInterface_h
#define V8TestInterface_h
@@ -48,3 +50,5 @@ v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >);
}
#endif // V8TestInterface_h
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 69c57bb..4a54ae3 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -22,6 +22,7 @@
#include "V8TestObj.h"
#include "ExceptionCode.h"
+#include "HTMLNames.h"
#include "RuntimeEnabledFeatures.h"
#include "ScriptCallStack.h"
#include "SerializedScriptValue.h"
@@ -151,28 +152,140 @@ static void testObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Valu
return;
}
-static v8::Handle<v8::Value> attrWithExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithException._get");
+ INC_STATS("DOM.TestObj.reflectedStringAttr._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
- return v8::Integer::New(imp->attrWithException());
+ return v8String(imp->getAttribute(WebCore::HTMLNames::reflectedstringattrAttr));
}
-static void attrWithExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithException._set");
+ INC_STATS("DOM.TestObj.reflectedStringAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::reflectedstringattrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedIntegralAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr));
+}
+
+static void reflectedIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedIntegralAttr._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
int v = toInt32(value);
- imp->setAttrWithException(v);
+ imp->setIntegralAttribute(WebCore::HTMLNames::reflectedintegralattrAttr, v);
return;
}
-static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> reflectedBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithSetterException._get");
+ INC_STATS("DOM.TestObj.reflectedBooleanAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr));
+}
+
+static void reflectedBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedBooleanAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ bool v = value->BooleanValue();
+ imp->setBooleanAttribute(WebCore::HTMLNames::reflectedbooleanattrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->getURLAttribute(WebCore::HTMLNames::reflectedurlattrAttr));
+}
+
+static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::reflectedurlattrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedStringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedStringAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->getAttribute(WebCore::HTMLNames::customContentStringAttrAttr));
+}
+
+static void reflectedStringAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedStringAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::customContentStringAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedCustomIntegralAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->getIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr));
+}
+
+static void reflectedCustomIntegralAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomIntegralAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setIntegralAttribute(WebCore::HTMLNames::customContentIntegralAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedCustomBooleanAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8Boolean(imp->hasAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr));
+}
+
+static void reflectedCustomBooleanAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedCustomBooleanAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ bool v = value->BooleanValue();
+ imp->setBooleanAttribute(WebCore::HTMLNames::customContentBooleanAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> reflectedURLAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->getURLAttribute(WebCore::HTMLNames::customContentURLAttrAttr));
+}
+
+static void reflectedURLAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.reflectedURLAttr._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<WithNullCheck> v = value;
+ imp->setAttribute(WebCore::HTMLNames::customContentURLAttrAttr, v);
+ return;
+}
+
+static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.attrWithGetterException._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
ExceptionCode ec = 0;
- int v = imp->attrWithSetterException(ec);
+ int v = imp->attrWithGetterException(ec);
if (UNLIKELY(ec)) {
V8Proxy::setDOMException(ec);
return v8::Handle<v8::Value>();
@@ -180,6 +293,25 @@ static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::Str
return v8::Integer::New(v);
}
+static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.attrWithGetterException._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ ExceptionCode ec = 0;
+ imp->setAttrWithGetterException(v, ec);
+ if (UNLIKELY(ec))
+ V8Proxy::setDOMException(ec);
+ return;
+}
+
+static v8::Handle<v8::Value> attrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.attrWithSetterException._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->attrWithSetterException());
+}
+
static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.attrWithSetterException._set");
@@ -192,20 +324,45 @@ static void attrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Lo
return;
}
-static v8::Handle<v8::Value> attrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> stringAttrWithGetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithGetterException._get");
+ INC_STATS("DOM.TestObj.stringAttrWithGetterException._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
- return v8::Integer::New(imp->attrWithGetterException());
+ ExceptionCode ec = 0;
+ String v = imp->stringAttrWithGetterException(ec);
+ if (UNLIKELY(ec)) {
+ V8Proxy::setDOMException(ec);
+ return v8::Handle<v8::Value>();
+ }
+ return v8String(v);
}
-static void attrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void stringAttrWithGetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.attrWithGetterException._set");
+ INC_STATS("DOM.TestObj.stringAttrWithGetterException._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
- int v = toInt32(value);
+ V8Parameter<> v = value;
ExceptionCode ec = 0;
- imp->setAttrWithGetterException(v, ec);
+ imp->setStringAttrWithGetterException(v, ec);
+ if (UNLIKELY(ec))
+ V8Proxy::setDOMException(ec);
+ return;
+}
+
+static v8::Handle<v8::Value> stringAttrWithSetterExceptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.stringAttrWithSetterException._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8String(imp->stringAttrWithSetterException());
+}
+
+static void stringAttrWithSetterExceptionAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.stringAttrWithSetterException._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ V8Parameter<> v = value;
+ ExceptionCode ec = 0;
+ imp->setStringAttrWithSetterException(v, ec);
if (UNLIKELY(ec))
V8Proxy::setDOMException(ec);
return;
@@ -218,6 +375,78 @@ static v8::Handle<v8::Value> scriptStringAttrAttrGetter(v8::Local<v8::String> na
return v8StringOrNull(imp->scriptStringAttr());
}
+#if ENABLE(Condition1)
+
+static v8::Handle<v8::Value> conditionalAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr1._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->conditionalAttr1());
+}
+
+#endif // ENABLE(Condition1)
+
+#if ENABLE(Condition1)
+
+static void conditionalAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr1._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setConditionalAttr1(v);
+ return;
+}
+
+#endif // ENABLE(Condition1)
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+
+static v8::Handle<v8::Value> conditionalAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr2._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->conditionalAttr2());
+}
+
+#endif // ENABLE(Condition1) && ENABLE(Condition2)
+
+#if ENABLE(Condition1) && ENABLE(Condition2)
+
+static void conditionalAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr2._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setConditionalAttr2(v);
+ return;
+}
+
+#endif // ENABLE(Condition1) && ENABLE(Condition2)
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
+static v8::Handle<v8::Value> conditionalAttr3AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr3._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->conditionalAttr3());
+}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
+#if ENABLE(Condition1) || ENABLE(Condition2)
+
+static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.conditionalAttr3._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setConditionalAttr3(v);
+ return;
+}
+
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
+
static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.description._get");
@@ -643,7 +872,7 @@ static v8::Handle<v8::Value> overloadedMethodCallback(const v8::Arguments& args)
return overloadedMethod3Callback(args);
if (args.Length() == 1)
return overloadedMethod4Callback(args);
- V8Proxy::setDOMException(SYNTAX_ERR);
+ V8Proxy::throwTypeError();
return notHandledByInterceptor();
}
@@ -666,16 +895,46 @@ static const BatchedAttribute TestObjAttrs[] = {
{"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'testObjAttr' (Type: 'attribute' ExtAttr: '')
{"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'attrWithException' (Type: 'attribute' ExtAttr: '')
- {"attrWithException", TestObjInternal::attrWithExceptionAttrGetter, TestObjInternal::attrWithExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
- {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedIntegralAttr", TestObjInternal::reflectedIntegralAttrAttrGetter, TestObjInternal::reflectedIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedBooleanAttr", TestObjInternal::reflectedBooleanAttrAttrGetter, TestObjInternal::reflectedBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'ReflectURL')
+ {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedCustomIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedCustomIntegralAttr", TestObjInternal::reflectedCustomIntegralAttrAttrGetter, TestObjInternal::reflectedCustomIntegralAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedCustomBooleanAttr' (Type: 'attribute' ExtAttr: 'Reflect')
+ {"reflectedCustomBooleanAttr", TestObjInternal::reflectedCustomBooleanAttrAttrGetter, TestObjInternal::reflectedCustomBooleanAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'reflectedURLAttr' (Type: 'attribute' ExtAttr: 'ReflectURL')
+ {"reflectedURLAttr", TestObjInternal::reflectedURLAttrAttrGetter, TestObjInternal::reflectedURLAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'attrWithGetterException' (Type: 'attribute' ExtAttr: '')
{"attrWithGetterException", TestObjInternal::attrWithGetterExceptionAttrGetter, TestObjInternal::attrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'attrWithSetterException' (Type: 'attribute' ExtAttr: '')
+ {"attrWithSetterException", TestObjInternal::attrWithSetterExceptionAttrGetter, TestObjInternal::attrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'stringAttrWithGetterException' (Type: 'attribute' ExtAttr: '')
+ {"stringAttrWithGetterException", TestObjInternal::stringAttrWithGetterExceptionAttrGetter, TestObjInternal::stringAttrWithGetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'stringAttrWithSetterException' (Type: 'attribute' ExtAttr: '')
+ {"stringAttrWithSetterException", TestObjInternal::stringAttrWithSetterExceptionAttrGetter, TestObjInternal::stringAttrWithSetterExceptionAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'customAttr' (Type: 'attribute' ExtAttr: 'Custom')
{"customAttr", V8TestObj::customAttrAccessorGetter, V8TestObj::customAttrAccessorSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'scriptStringAttr' (Type: 'readonly attribute' ExtAttr: 'ConvertScriptString')
{"scriptStringAttr", TestObjInternal::scriptStringAttrAttrGetter, 0, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#if ENABLE(Condition1)
+ // Attribute 'conditionalAttr1' (Type: 'attribute' ExtAttr: 'Conditional')
+ {"conditionalAttr1", TestObjInternal::conditionalAttr1AttrGetter, TestObjInternal::conditionalAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition1)
+#if ENABLE(Condition1) && ENABLE(Condition2)
+ // Attribute 'conditionalAttr2' (Type: 'attribute' ExtAttr: 'Conditional')
+ {"conditionalAttr2", TestObjInternal::conditionalAttr2AttrGetter, TestObjInternal::conditionalAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition1) && ENABLE(Condition2)
+#if ENABLE(Condition1) || ENABLE(Condition2)
+ // Attribute 'conditionalAttr3' (Type: 'attribute' ExtAttr: 'Conditional')
+ {"conditionalAttr3", TestObjInternal::conditionalAttr3AttrGetter, TestObjInternal::conditionalAttr3AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
// 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: '')
diff --git a/WebCore/bindings/v8/JavaScriptCallFrame.cpp b/WebCore/bindings/v8/JavaScriptCallFrame.cpp
index 049321b..20bf378 100644
--- a/WebCore/bindings/v8/JavaScriptCallFrame.cpp
+++ b/WebCore/bindings/v8/JavaScriptCallFrame.cpp
@@ -85,7 +85,7 @@ String JavaScriptCallFrame::functionName() const
v8::HandleScope handleScope;
v8::Context::Scope contextScope(m_debuggerContext.get());
v8::Handle<v8::Value> result = m_callFrame.get()->Get(v8String("functionName"));
- return toWebCoreString(result);
+ return toWebCoreStringWithNullOrUndefinedCheck(result);
}
v8::Handle<v8::Value> JavaScriptCallFrame::scopeChain() const
diff --git a/WebCore/bindings/v8/NPV8Object.cpp b/WebCore/bindings/v8/NPV8Object.cpp
index af0933f..15382ad 100644
--- a/WebCore/bindings/v8/NPV8Object.cpp
+++ b/WebCore/bindings/v8/NPV8Object.cpp
@@ -57,7 +57,7 @@ namespace WebCore {
WrapperTypeInfo* npObjectTypeInfo()
{
- static WrapperTypeInfo typeInfo = { 0, 0, false };
+ static WrapperTypeInfo typeInfo = { 0, 0, 0 };
return &typeInfo;
}
diff --git a/WebCore/bindings/v8/ScriptController.cpp b/WebCore/bindings/v8/ScriptController.cpp
index d3ec33f..6f17373 100644
--- a/WebCore/bindings/v8/ScriptController.cpp
+++ b/WebCore/bindings/v8/ScriptController.cpp
@@ -34,6 +34,7 @@
#include "PlatformBridge.h"
#include "Document.h"
+#include "DocumentParser.h"
#include "DOMWindow.h"
#include "Event.h"
#include "EventListener.h"
@@ -258,9 +259,18 @@ ScriptValue ScriptController::evaluate(const ScriptSourceCode& sourceCode, Shoul
return ScriptValue(object);
}
-void ScriptController::setEventHandlerLineNumber(int lineNumber)
+int ScriptController::eventHandlerLineNumber() const
{
- m_proxy->setEventHandlerLineNumber(lineNumber);
+ if (DocumentParser* parser = m_frame->document()->parser())
+ return parser->lineNumber();
+ return 0;
+}
+
+int ScriptController::eventHandlerColumnNumber() const
+{
+ if (DocumentParser* parser = m_frame->document()->parser())
+ return parser->columnNumber();
+ return 0;
}
void ScriptController::finishedWithEvent(Event* event)
diff --git a/WebCore/bindings/v8/ScriptController.h b/WebCore/bindings/v8/ScriptController.h
index 5d4b83e..3187180 100644
--- a/WebCore/bindings/v8/ScriptController.h
+++ b/WebCore/bindings/v8/ScriptController.h
@@ -153,7 +153,9 @@ public:
static void gcUnprotectJSWrapper(void*);
void finishedWithEvent(Event*);
- void setEventHandlerLineNumber(int lineNumber);
+
+ int eventHandlerLineNumber() const;
+ int eventHandlerColumnNumber() const;
void setProcessingTimerCallback(bool processingTimerCallback) { m_processingTimerCallback = processingTimerCallback; }
// FIXME: Currently we don't use the parameter world at all.
diff --git a/WebCore/bindings/v8/ScriptDebugServer.cpp b/WebCore/bindings/v8/ScriptDebugServer.cpp
index 39e409e..38fcd8a 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.cpp
+++ b/WebCore/bindings/v8/ScriptDebugServer.cpp
@@ -72,6 +72,7 @@ ScriptDebugServer& ScriptDebugServer::shared()
ScriptDebugServer::ScriptDebugServer()
: m_pauseOnExceptionsState(DontPauseOnExceptions)
, m_pausedPage(0)
+ , m_enabled(true)
{
}
@@ -83,6 +84,8 @@ void ScriptDebugServer::setDebuggerScriptSource(const String& scriptSource)
void ScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page)
{
#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
+ if (!m_enabled)
+ return;
v8::HandleScope scope;
v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext();
v8::Context::Scope contextScope(debuggerContext);
@@ -301,9 +304,14 @@ PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::currentCallFrame()
return m_currentCallFrame;
}
+void ScriptDebugServer::setEnabled(bool value)
+{
+ m_enabled = value;
+}
+
bool ScriptDebugServer::isDebuggerAlwaysEnabled()
{
- return true;
+ return m_enabled;
}
#if ENABLE(V8_SCRIPT_DEBUG_SERVER)
@@ -335,6 +343,12 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD
v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value);
dispatchDidParseSource(listener, object);
} else if (event == v8::Break || event == v8::Exception) {
+ if (event == v8::Exception) {
+ v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackTrace(1);
+ // Stack trace is empty in case of syntax error. Silently continue execution in such cases.
+ if (!stackTrace->GetFrameCount())
+ return;
+ }
m_executionState.set(eventDetails.GetExecutionState());
m_pausedPage = frame->page();
ScriptState* currentCallFrameState = mainWorldScriptState(frame);
diff --git a/WebCore/bindings/v8/ScriptDebugServer.h b/WebCore/bindings/v8/ScriptDebugServer.h
index 9439c16..b46f673 100644
--- a/WebCore/bindings/v8/ScriptDebugServer.h
+++ b/WebCore/bindings/v8/ScriptDebugServer.h
@@ -94,6 +94,7 @@ public:
PassRefPtr<JavaScriptCallFrame> currentCallFrame();
+ void setEnabled(bool);
bool isDebuggerAlwaysEnabled();
private:
@@ -119,6 +120,7 @@ private:
OwnHandle<v8::Object> m_executionState;
OwnPtr<ClientMessageLoop> m_clientMessageLoop;
Page* m_pausedPage;
+ bool m_enabled;
};
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptEventListener.cpp b/WebCore/bindings/v8/ScriptEventListener.cpp
index 57a2824..63e7dff 100644
--- a/WebCore/bindings/v8/ScriptEventListener.cpp
+++ b/WebCore/bindings/v8/ScriptEventListener.cpp
@@ -64,11 +64,8 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Node* node, Attribu
return 0;
}
- if (frame->document()->parser()) {
- // FIXME: Change to use script->eventHandlerLineNumber() when implemented.
- lineNumber = frame->document()->parser()->lineNumber();
- columnNumber = frame->document()->parser()->columnNumber();
- }
+ lineNumber = scriptController->eventHandlerLineNumber();
+ columnNumber = scriptController->eventHandlerColumnNumber();
sourceURL = node->document()->url().string();
}
@@ -97,11 +94,8 @@ PassRefPtr<V8LazyEventListener> createAttributeEventListener(Frame* frame, Attri
return 0;
}
- if (frame->document()->parser()) {
- // FIXME: Change to use script->eventHandlerLineNumber() when implemented.
- lineNumber = frame->document()->parser()->lineNumber();
- columnNumber = frame->document()->parser()->columnNumber();
- }
+ lineNumber = scriptController->eventHandlerLineNumber();
+ columnNumber = scriptController->eventHandlerColumnNumber();
sourceURL = frame->document()->url().string();
return V8LazyEventListener::create(attr->localName().string(), frame->document()->isSVGDocument(), attr->value(), sourceURL, lineNumber, columnNumber, WorldContextHandle(UseMainWorld));
}
diff --git a/WebCore/bindings/v8/ScriptProfiler.cpp b/WebCore/bindings/v8/ScriptProfiler.cpp
index ab0b9fe..4891892 100644
--- a/WebCore/bindings/v8/ScriptProfiler.cpp
+++ b/WebCore/bindings/v8/ScriptProfiler.cpp
@@ -52,4 +52,11 @@ PassRefPtr<ScriptProfile> ScriptProfiler::stop(ScriptState* state, const String&
return profile ? ScriptProfile::create(profile) : 0;
}
+void ScriptProfiler::takeHeapSnapshot()
+{
+ v8::V8::ResumeProfilerEx(v8::PROFILER_MODULE_HEAP_SNAPSHOT
+ | v8::PROFILER_MODULE_HEAP_STATS
+ | v8::PROFILER_MODULE_JS_CONSTRUCTORS);
+}
+
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptProfiler.h b/WebCore/bindings/v8/ScriptProfiler.h
index c02cc32..aff3ce7 100644
--- a/WebCore/bindings/v8/ScriptProfiler.h
+++ b/WebCore/bindings/v8/ScriptProfiler.h
@@ -43,6 +43,7 @@ class ScriptProfiler : public Noncopyable {
public:
static void start(ScriptState* state, const String& title);
static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
+ static void takeHeapSnapshot();
};
} // namespace WebCore
diff --git a/WebCore/bindings/v8/ScriptSourceCode.h b/WebCore/bindings/v8/ScriptSourceCode.h
index 5c16168..dbc9d5e 100644
--- a/WebCore/bindings/v8/ScriptSourceCode.h
+++ b/WebCore/bindings/v8/ScriptSourceCode.h
@@ -31,6 +31,7 @@
#ifndef ScriptSourceCode_h
#define ScriptSourceCode_h
+#include "CachedResourceHandle.h"
#include "CachedScript.h"
#include "KURL.h"
#include "PlatformString.h"
@@ -41,6 +42,7 @@ class ScriptSourceCode {
public:
ScriptSourceCode(const String& source, const KURL& url = KURL(), int startLine = 1)
: m_source(source)
+ , m_cachedScript(0)
, m_url(url)
, m_startLine(startLine)
{
@@ -50,6 +52,7 @@ public:
// Not sure if that matters.
ScriptSourceCode(CachedScript* cs)
: m_source(cs->script())
+ , m_cachedScript(cs)
, m_url(ParsedURLString, cs->url())
, m_startLine(1)
{
@@ -58,11 +61,13 @@ public:
bool isEmpty() const { return m_source.isEmpty(); }
const String& source() const { return m_source; }
+ CachedScript* cachedScript() const { return m_cachedScript.get(); }
const KURL& url() const { return m_url; }
int startLine() const { return m_startLine; }
private:
String m_source;
+ CachedResourceHandle<CachedScript> m_cachedScript;
KURL m_url;
int m_startLine;
};
diff --git a/WebCore/bindings/v8/ScriptValue.cpp b/WebCore/bindings/v8/ScriptValue.cpp
index 02d62db..3aca3c1 100755
--- a/WebCore/bindings/v8/ScriptValue.cpp
+++ b/WebCore/bindings/v8/ScriptValue.cpp
@@ -63,7 +63,7 @@ bool ScriptValue::getString(String& result) const
String ScriptValue::toString(ScriptState*) const
{
- return toWebCoreStringWithNullCheck(m_value);
+ return toWebCoreString(m_value);
}
} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8Binding.cpp b/WebCore/bindings/v8/V8Binding.cpp
index 97805c0..1272fd4 100644
--- a/WebCore/bindings/v8/V8Binding.cpp
+++ b/WebCore/bindings/v8/V8Binding.cpp
@@ -442,25 +442,29 @@ static void cachedStringCallback(v8::Persistent<v8::Value> wrapper, void* parame
stringImpl->deref();
}
-v8::Local<v8::String> v8ExternalString(const String& string)
+RefPtr<StringImpl> lastStringImpl = 0;
+v8::Persistent<v8::String> lastV8String;
+
+v8::Local<v8::String> v8ExternalStringSlow(StringImpl* stringImpl)
{
- StringImpl* stringImpl = string.impl();
- if (!stringImpl || !stringImpl->length())
+ if (!stringImpl->length())
return v8::String::Empty();
if (!stringImplCacheEnabled)
- return makeExternalString(string);
+ return makeExternalString(String(stringImpl));
StringCache& stringCache = getStringCache();
v8::String* cachedV8String = stringCache.get(stringImpl);
- if (cachedV8String)
- {
+ if (cachedV8String) {
v8::Persistent<v8::String> handle(cachedV8String);
- if (!handle.IsNearDeath() && !handle.IsEmpty())
+ if (!handle.IsNearDeath() && !handle.IsEmpty()) {
+ lastStringImpl = stringImpl;
+ lastV8String = handle;
return v8::Local<v8::String>::New(handle);
+ }
}
- v8::Local<v8::String> newString = makeExternalString(string);
+ v8::Local<v8::String> newString = makeExternalString(String(stringImpl));
if (newString.IsEmpty())
return newString;
@@ -472,6 +476,9 @@ v8::Local<v8::String> v8ExternalString(const String& string)
wrapper.MakeWeak(stringImpl, cachedStringCallback);
stringCache.set(stringImpl, *wrapper);
+ lastStringImpl = stringImpl;
+ lastV8String = wrapper;
+
return newString;
}
diff --git a/WebCore/bindings/v8/V8Binding.h b/WebCore/bindings/v8/V8Binding.h
index 696cd1a..9eebf51 100644
--- a/WebCore/bindings/v8/V8Binding.h
+++ b/WebCore/bindings/v8/V8Binding.h
@@ -81,10 +81,30 @@ namespace WebCore {
AtomicString v8NonStringValueToAtomicWebCoreString(v8::Handle<v8::Value>);
AtomicString v8ValueToAtomicWebCoreString(v8::Handle<v8::Value> value);
+ // Note: RefPtr is a must as we cache by StringImpl* equality, not identity
+ // hence lastStringImpl might be not a key of the cache (in sense of identity)
+ // and hence it's not refed on addition.
+ extern RefPtr<StringImpl> lastStringImpl;
+ extern v8::Persistent<v8::String> lastV8String;
+ v8::Local<v8::String> v8ExternalStringSlow(StringImpl* stringImpl);
+
// Return a V8 external string that shares the underlying buffer with the given
// WebCore string. The reference counting mechanism is used to keep the
// underlying buffer alive while the string is still live in the V8 engine.
- v8::Local<v8::String> v8ExternalString(const String&);
+ inline v8::Local<v8::String> v8ExternalString(const String& string)
+ {
+ StringImpl* stringImpl = string.impl();
+ if (!stringImpl)
+ return v8::String::Empty();
+
+ if (lastStringImpl.get() == stringImpl) {
+ ASSERT(!lastV8String.IsNearDeath());
+ ASSERT(!lastV8String.IsEmpty());
+ return v8::Local<v8::String>::New(lastV8String);
+ }
+
+ return v8ExternalStringSlow(stringImpl);
+ }
// Convert a string to a V8 string.
inline v8::Handle<v8::String> v8String(const String& string)
diff --git a/WebCore/bindings/v8/V8GCController.cpp b/WebCore/bindings/v8/V8GCController.cpp
index 5611199..c27e1d5 100644
--- a/WebCore/bindings/v8/V8GCController.cpp
+++ b/WebCore/bindings/v8/V8GCController.cpp
@@ -39,6 +39,7 @@
#include "HTMLNames.h"
#include "MessagePort.h"
#include "SVGElement.h"
+#include "V8Binding.h"
#include "V8DOMMap.h"
#include "V8MessagePort.h"
#include "V8Proxy.h"
@@ -359,6 +360,10 @@ void V8GCController::gcPrologue()
ObjectGrouperVisitor objectGrouperVisitor;
visitDOMNodesInCurrentThread(&objectGrouperVisitor);
objectGrouperVisitor.applyGrouping();
+
+ // Clean single element cache for string conversions.
+ lastStringImpl = 0;
+ lastV8String.Clear();
}
class GCEpilogueVisitor : public DOMWrapperMap<void>::Visitor {
diff --git a/WebCore/bindings/v8/V8Proxy.cpp b/WebCore/bindings/v8/V8Proxy.cpp
index 7a5df96..a8473be 100644
--- a/WebCore/bindings/v8/V8Proxy.cpp
+++ b/WebCore/bindings/v8/V8Proxy.cpp
@@ -32,6 +32,7 @@
#include "V8Proxy.h"
#include "CSSMutableStyleDeclaration.h"
+#include "CachedMetadata.h"
#include "DateExtension.h"
#include "DocumentLoader.h"
#include "Frame.h"
@@ -55,6 +56,7 @@
#include "V8HiddenPropertyName.h"
#include "V8IsolatedContext.h"
#include "V8RangeException.h"
+#include "V8SQLException.h"
#include "V8XMLHttpRequestException.h"
#include "V8XPathException.h"
#include "WorkerContext.h"
@@ -69,6 +71,7 @@
#include <utility>
#include <wtf/Assertions.h>
#include <wtf/OwnArrayPtr.h>
+#include <wtf/OwnPtr.h>
#include <wtf/StdLibExtras.h>
#include <wtf/StringExtras.h>
#include <wtf/UnusedParam.h>
@@ -240,6 +243,7 @@ V8Proxy::~V8Proxy()
windowShell()->destroyGlobal();
}
+<<<<<<< HEAD
v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine)
#ifdef ANDROID_INSTRUMENT
{
@@ -251,12 +255,15 @@ v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const
v8::Handle<v8::Script> V8Proxy::compileScriptInternal(v8::Handle<v8::String> code, const String& fileName, int baseLine)
#endif
+=======
+v8::Handle<v8::Script> V8Proxy::compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine, v8::ScriptData* scriptData)
+>>>>>>> webkit.org at r61871
{
const uint16_t* fileNameString = fromWebCoreString(fileName);
v8::Handle<v8::String> name = v8::String::New(fileNameString, fileName.length());
v8::Handle<v8::Integer> line = v8::Integer::New(baseLine);
v8::ScriptOrigin origin(name, line);
- v8::Handle<v8::Script> script = v8::Script::Compile(code, &origin);
+ v8::Handle<v8::Script> script = v8::Script::Compile(code, &origin, scriptData);
return script;
}
@@ -355,6 +362,28 @@ bool V8Proxy::setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetCont
return true;
}
+PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(v8::Handle<v8::String> code, CachedScript* cachedScript)
+{
+ // A pseudo-randomly chosen ID used to store and retrieve V8 ScriptData from
+ // the CachedScript. If the format changes, this ID should be changed too.
+ static const unsigned dataTypeID = 0xECC13BD7;
+
+ // Very small scripts are not worth the effort to preparse.
+ static const int minPreparseLength = 1024;
+
+ if (!cachedScript || code->Length() < minPreparseLength)
+ return 0;
+
+ CachedMetadata* cachedMetadata = cachedScript->cachedMetadata(dataTypeID);
+ if (cachedMetadata)
+ return v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size());
+
+ OwnPtr<v8::ScriptData> scriptData(v8::ScriptData::PreCompile(code));
+ cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length());
+
+ return scriptData.release();
+}
+
v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* node)
{
ASSERT(v8::Context::InContext());
@@ -380,10 +409,11 @@ v8::Local<v8::Value> V8Proxy::evaluate(const ScriptSourceCode& source, Node* nod
#if PLATFORM(CHROMIUM)
PlatformBridge::traceEventBegin("v8.compile", node, "");
#endif
+ OwnPtr<v8::ScriptData> scriptData = precompileScript(code, source.cachedScript());
// NOTE: For compatibility with WebCore, ScriptSourceCode's line starts at
// 1, whereas v8 starts at 0.
- v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1);
+ v8::Handle<v8::Script> script = compileScript(code, source.url(), source.startLine() - 1, scriptData.get());
#if PLATFORM(CHROMIUM)
PlatformBridge::traceEventEnd("v8.compile", node, "");
@@ -711,6 +741,11 @@ void V8Proxy::setDOMException(int exceptionCode)
exception = toV8(XPathException::create(description));
break;
#endif
+#if ENABLE(DATABASE)
+ case SQLExceptionType:
+ exception = toV8(SQLException::create(description));
+ break;
+#endif
default:
ASSERT_NOT_REACHED();
}
@@ -738,6 +773,16 @@ v8::Handle<v8::Value> V8Proxy::throwError(ErrorType type, const char* message)
}
}
+v8::Handle<v8::Value> V8Proxy::throwTypeError()
+{
+ return throwError(TypeError, "Type error");
+}
+
+v8::Handle<v8::Value> V8Proxy::throwSyntaxError()
+{
+ return throwError(SyntaxError, "Syntax error");
+}
+
v8::Local<v8::Context> V8Proxy::context(Frame* frame)
{
v8::Local<v8::Context> context = V8Proxy::mainWorldContext(frame);
diff --git a/WebCore/bindings/v8/V8Proxy.h b/WebCore/bindings/v8/V8Proxy.h
index cd2ddad..ec9352c 100644
--- a/WebCore/bindings/v8/V8Proxy.h
+++ b/WebCore/bindings/v8/V8Proxy.h
@@ -53,6 +53,7 @@
namespace WebCore {
+ class CachedScript;
class DOMWindow;
class Frame;
class Node;
@@ -201,7 +202,6 @@ namespace WebCore {
}
#endif
- void setEventHandlerLineNumber(int lineNumber) { m_handlerLineNumber = lineNumber; }
void finishedWithEvent(Event*) { }
// Evaluate JavaScript in a new isolated world. The script gets its own
@@ -289,7 +289,7 @@ namespace WebCore {
static v8::Handle<v8::Value> checkNewLegal(const v8::Arguments&);
- static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine);
+ static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, int baseLine, v8::ScriptData* = 0);
#ifdef ANDROID_INSTRUMENT
static v8::Handle<v8::Script> compileScriptInternal(v8::Handle<v8::String> code, const String& fileName, int baseLine);
@@ -302,6 +302,10 @@ namespace WebCore {
// Schedule an error object to be thrown.
static v8::Handle<v8::Value> throwError(ErrorType, const char* message);
+ // Helpers for throwing syntax and type errors with predefined messages.
+ static v8::Handle<v8::Value> throwTypeError();
+ static v8::Handle<v8::Value> throwSyntaxError();
+
template <typename T>
static v8::Handle<v8::Value> constructDOMObject(const v8::Arguments&, WrapperTypeInfo*);
@@ -345,6 +349,8 @@ namespace WebCore {
void resetIsolatedWorlds();
+ PassOwnPtr<v8::ScriptData> precompileScript(v8::Handle<v8::String>, CachedScript*);
+
// Returns false when we're out of memory in V8.
bool setInjectedScriptContextDebugId(v8::Handle<v8::Context> targetContext);
@@ -361,13 +367,15 @@ namespace WebCore {
static const char* svgExceptionName(int exceptionCode);
#endif
+#if ENABLE(DATABASE)
+ static const char* sqlExceptionName(int exceptionCode);
+#endif
+
Frame* m_frame;
// For the moment, we have one of these. Soon we will have one per DOMWrapperWorld.
RefPtr<V8DOMWindowShell> m_windowShell;
- int m_handlerLineNumber;
-
// True for <a href="javascript:foo()"> and false for <script>foo()</script>.
// Only valid during execution.
bool m_inlineCode;
diff --git a/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp b/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
index 3e48f4b..501e5a2 100644
--- a/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar
INC_STATS("DOM.ArrayBuffer.Constructor");
if (!args.IsConstructCall())
- return throwError("DOM object constructor cannot be called as a function.");
+ return throwError("DOM object constructor cannot be called as a function.", V8Proxy::SyntaxError);
// If we return a previously constructed ArrayBuffer,
// e.g. from the call to ArrayBufferView.buffer, this code is called
@@ -61,22 +61,15 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar
// ArrayBuffer(n) where n is an integer:
// -- create an empty buffer of n bytes
- int argLen = args.Length();
- if (argLen > 1)
- return throwError("Wrong number of arguments specified to constructor (requires 1)");
-
- int len = 0;
- if (argLen > 0) {
- if (!args[0]->IsInt32())
- return throwError("Argument to ArrayBuffer constructor was not an integer");
- len = toInt32(args[0]);
- }
-
- RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(len, 1);
- if (!buffer.get()) {
- V8Proxy::setDOMException(INDEX_SIZE_ERR);
- return v8::Undefined();
- }
+ int argLength = args.Length();
+ int length = 0;
+ if (argLength > 0)
+ length = toInt32(args[0]); // NaN/+inf/-inf returns 0, this is intended by WebIDL
+ RefPtr<ArrayBuffer> buffer;
+ if (length >= 0)
+ buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1);
+ if (!buffer.get())
+ return throwError("ArrayBuffer size is not a small enough positive integer.", V8Proxy::RangeError);
// Transform the holder into a wrapper object for the array.
V8DOMWrapper::setDOMWrapper(args.Holder(), &info, buffer.get());
return toV8(buffer.release(), args.Holder());
diff --git a/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h b/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
index cc34778..1c5d731 100644
--- a/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
+++ b/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
@@ -68,6 +68,12 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
// "buf", starting at the specified offset, for the given
// length
+ if (args[0]->IsNull()) {
+ // Invalid first argument
+ // FIXME: use forthcoming V8Proxy::throwTypeError().
+ return V8Proxy::throwError(V8Proxy::TypeError, "Type error");
+ }
+
// See whether the first argument is a ArrayBuffer.
if (V8ArrayBuffer::HasInstance(args[0])) {
ArrayBuffer* buf = V8ArrayBuffer::toNative(args[0]->ToObject());
@@ -88,8 +94,10 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
}
RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length);
- if (!array)
- return throwError("Out-of-range offset and/or length");
+ if (!array) {
+ V8Proxy::setDOMException(INDEX_SIZE_ERR);
+ return notHandledByInterceptor();
+ }
// Transform the holder into a wrapper object for the array.
V8DOMWrapper::setDOMWrapper(args.Holder(), type, array.get());
args.Holder()->SetIndexedPropertiesToExternalArrayData(array.get()->baseAddress(), arrayType, array.get()->length());
@@ -98,22 +106,29 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
uint32_t len = 0;
v8::Handle<v8::Object> srcArray;
+ bool doInstantiation = false;
- if (args[0]->IsInt32()) {
- len = toUInt32(args[0]);
- } else if (args[0]->IsObject()) {
+ if (args[0]->IsObject()) {
srcArray = args[0]->ToObject();
if (srcArray.IsEmpty())
return throwError("Could not convert argument 0 to an array");
len = toUInt32(srcArray->Get(v8::String::New("length")));
- } else
- return throwError("Could not convert argument 0 to either a number or an array");
-
- RefPtr<ArrayClass> array = ArrayClass::create(len);
- if (!array.get()) {
- V8Proxy::setDOMException(INDEX_SIZE_ERR);
- return v8::Undefined();
+ doInstantiation = true;
+ } else {
+ bool ok = false;
+ int32_t tempLength = toInt32(args[0], ok); // NaN/+inf/-inf returns 0, this is intended by WebIDL
+ if (ok && tempLength >= 0) {
+ len = static_cast<uint32_t>(tempLength);
+ doInstantiation = true;
+ }
}
+
+ RefPtr<ArrayClass> array;
+ if (doInstantiation)
+ array = ArrayClass::create(len);
+ if (!array.get())
+ return throwError("ArrayBufferView size is not a small enough positive integer.", V8Proxy::RangeError);
+
if (!srcArray.IsEmpty()) {
// Need to copy the incoming array into the newly created ArrayBufferView.
for (unsigned i = 0; i < len; i++) {
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
index df16501..7a0a545 100644
--- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.cpp
@@ -44,7 +44,7 @@
namespace WebCore {
-WrapperTypeInfo V8HTMLAudioElementConstructor::info = { V8HTMLAudioElementConstructor::GetTemplate, 0, false };
+WrapperTypeInfo V8HTMLAudioElementConstructor::info = { V8HTMLAudioElementConstructor::GetTemplate, 0, 0 };
static v8::Handle<v8::Value> v8HTMLAudioElementConstructorCallback(const v8::Arguments& args)
{
diff --git a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h
index 8bc5f2c..8bc5f2c 100755..100644
--- a/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h
+++ b/WebCore/bindings/v8/custom/V8HTMLAudioElementConstructor.h
diff --git a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
index 4751224..24b1709 100644
--- a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
@@ -44,7 +44,7 @@
namespace WebCore {
-WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, false };
+WrapperTypeInfo V8HTMLImageElementConstructor::info = { V8HTMLImageElementConstructor::GetTemplate, 0, 0 };
static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arguments& args)
{
diff --git a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h
index 5db4946..5db4946 100755..100644
--- a/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h
+++ b/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.h
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
index 6b84856..14c80b9 100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.cpp
@@ -44,7 +44,7 @@
namespace WebCore {
-WrapperTypeInfo V8HTMLOptionElementConstructor::info = { V8HTMLOptionElementConstructor::GetTemplate, 0, false };
+WrapperTypeInfo V8HTMLOptionElementConstructor::info = { V8HTMLOptionElementConstructor::GetTemplate, 0, 0 };
static v8::Handle<v8::Value> v8HTMLOptionElementConstructorCallback(const v8::Arguments& args)
{
diff --git a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h
index 2adf0fe..2adf0fe 100755..100644
--- a/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h
+++ b/WebCore/bindings/v8/custom/V8HTMLOptionElementConstructor.h
diff --git a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
index bf81ae9..2ce4780 100644
--- a/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
@@ -58,6 +58,7 @@ v8::Handle<v8::Value> V8NotificationCenter::createHTMLNotificationCallback(const
if (ec)
return throwError(ec);
+ notification->ref();
return toV8(notification.get());
}
@@ -72,6 +73,7 @@ v8::Handle<v8::Value> V8NotificationCenter::createNotificationCallback(const v8:
if (ec)
return throwError(ec);
+ notification->ref();
return toV8(notification.get());
}
diff --git a/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
index 7c24ac8..63d0a97 100644
--- a/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8SQLResultSetRowList::itemCallback(const v8::Arguments& a
SQLResultSetRowList* rowList = V8SQLResultSetRowList::toNative(args.Holder());
unsigned long index = args[0]->IntegerValue();
- if (index < 0 || index >= rowList->length()) {
+ if (index >= rowList->length()) {
V8Proxy::throwError(V8Proxy::RangeError, "Item index is out of range.");
return v8::Undefined();
}
@@ -91,4 +91,3 @@ v8::Handle<v8::Value> V8SQLResultSetRowList::itemCallback(const v8::Arguments& a
} // namespace WebCore
#endif
-
diff --git a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
index b931053..5e15dab 100644
--- a/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
@@ -93,24 +93,6 @@ v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args
return args.Holder();
}
-v8::Handle<v8::Value> V8WebSocket::sendCallback(const v8::Arguments& args)
-{
- INC_STATS("DOM.WebSocket.send()");
- WebSocket* webSocket = V8WebSocket::toNative(args.Holder());
-
- ExceptionCode ec = 0;
- bool ret = false;
- if (args.Length() < 1)
- return throwError("Not enough arguments", V8Proxy::SyntaxError);
- else {
- String msg = toWebCoreString(args[0]);
- ret = webSocket->send(msg, ec);
- }
- if (ec)
- return throwError(ec);
- return v8Boolean(ret);
-}
-
} // namespace WebCore
#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/bindings/v8/npruntime.cpp b/WebCore/bindings/v8/npruntime.cpp
index 12500a7..836456a 100644
--- a/WebCore/bindings/v8/npruntime.cpp
+++ b/WebCore/bindings/v8/npruntime.cpp
@@ -296,7 +296,6 @@ NPObject* _NPN_RetainObject(NPObject* npObject)
void _NPN_DeallocateObject(NPObject* npObject)
{
ASSERT(npObject);
- ASSERT(npObject->referenceCount >= 0);
if (npObject) {
// NPObjects that remain in pure C++ may never have wrappers.
diff --git a/WebCore/bridge/npapi.h b/WebCore/bridge/npapi.h
index c7705b7..f0e1768 100644
--- a/WebCore/bridge/npapi.h
+++ b/WebCore/bridge/npapi.h
@@ -38,8 +38,18 @@
#ifndef npapi_h_
#define npapi_h_
+#if defined(__OS2__)
+#pragma pack(1)
+#endif
+
#include "nptypes.h"
+#if defined(__OS2__) || defined(OS2)
+#ifndef XP_OS2
+#define XP_OS2 1
+#endif
+#endif
+
#ifdef INCLUDE_JAVA
#include "jri.h" /* Java Runtime Interface */
#else
@@ -48,41 +58,22 @@
#endif
#if defined(_WIN32) && !defined(__SYMBIAN32__)
+#include <windows.h>
#ifndef XP_WIN
#define XP_WIN 1
#endif
#endif
-#ifdef __SYMBIAN32__
-# ifndef XP_SYMBIAN
-# define XP_SYMBIAN 1
-# endif
-#endif /* __SYMBIAN32__ */
-
-#ifdef __MWERKS__
-# define _declspec __declspec
-# ifdef macintosh
-# ifndef XP_MAC
-# define XP_MAC 1
-# endif /* XP_MAC */
-# endif /* macintosh */
-# ifdef __INTEL__
-# ifndef XP_SYMBIAN
-# undef NULL
-# ifndef XP_WIN
-# define XP_WIN 1
-# endif /* XP_WIN */
-# endif /* XP_SYMBIAN */
-# endif /* __INTEL__ */
-#endif /* __MWERKS__ */
-
-#if defined(__APPLE_CC__) && !defined(__MACOS_CLASSIC__) && !defined(XP_UNIX)
-# define XP_MACOSX
+#if defined(__SYMBIAN32__)
+#ifndef XP_SYMBIAN
+#define XP_SYMBIAN 1
+#endif
#endif
-#ifdef XP_MAC
- #include <Quickdraw.h>
- #include <Events.h>
+#if defined(__APPLE_CC__) && !defined(XP_UNIX)
+#ifndef XP_MACOSX
+#define XP_MACOSX 1
+#endif
#endif
#if defined(XP_MACOSX) && defined(__LP64__)
@@ -90,7 +81,7 @@
#define NP_NO_CARBON
#endif
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX)
#include <ApplicationServices/ApplicationServices.h>
#include <OpenGL/OpenGL.h>
#ifndef NP_NO_CARBON
@@ -98,19 +89,15 @@
#endif
#endif
-#ifdef XP_UNIX
+#if defined(XP_UNIX)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <stdio.h>
#endif
#if defined(XP_SYMBIAN)
- #include <QEvent>
- #include <QRegion>
-#endif
-
-#ifdef XP_WIN
- #include <windows.h>
+#include <QEvent>
+#include <QRegion>
#endif
/*----------------------------------------------------------------------*/
@@ -120,6 +107,49 @@
#define NP_VERSION_MAJOR 0
#define NP_VERSION_MINOR 24
+
+/* The OS/2 version of Netscape uses RC_DATA to define the
+ mime types, file extensions, etc that are required.
+ Use a vertical bar to separate types, end types with \0.
+ FileVersion and ProductVersion are 32bit ints, all other
+ entries are strings that MUST be terminated with a \0.
+
+AN EXAMPLE:
+
+RCDATA NP_INFO_ProductVersion { 1,0,0,1,}
+
+RCDATA NP_INFO_MIMEType { "video/x-video|",
+ "video/x-flick\0" }
+RCDATA NP_INFO_FileExtents { "avi|",
+ "flc\0" }
+RCDATA NP_INFO_FileOpenName{ "MMOS2 video player(*.avi)|",
+ "MMOS2 Flc/Fli player(*.flc)\0" }
+
+RCDATA NP_INFO_FileVersion { 1,0,0,1 }
+RCDATA NP_INFO_CompanyName { "Netscape Communications\0" }
+RCDATA NP_INFO_FileDescription { "NPAVI32 Extension DLL\0"
+RCDATA NP_INFO_InternalName { "NPAVI32\0" )
+RCDATA NP_INFO_LegalCopyright { "Copyright Netscape Communications \251 1996\0"
+RCDATA NP_INFO_OriginalFilename { "NVAPI32.DLL" }
+RCDATA NP_INFO_ProductName { "NPAVI32 Dynamic Link Library\0" }
+*/
+/* RC_DATA types for version info - required */
+#define NP_INFO_ProductVersion 1
+#define NP_INFO_MIMEType 2
+#define NP_INFO_FileOpenName 3
+#define NP_INFO_FileExtents 4
+/* RC_DATA types for version info - used if found */
+#define NP_INFO_FileDescription 5
+#define NP_INFO_ProductName 6
+/* RC_DATA types for version info - optional */
+#define NP_INFO_CompanyName 7
+#define NP_INFO_FileVersion 8
+#define NP_INFO_InternalName 9
+#define NP_INFO_LegalCopyright 10
+#define NP_INFO_OriginalFilename 11
+
+#ifndef RC_INVOKED
+
/*----------------------------------------------------------------------*/
/* Definition of Basic Types */
/*----------------------------------------------------------------------*/
@@ -144,7 +174,7 @@ typedef char* NPMIMEType;
/*----------------------------------------------------------------------*/
#if !defined(__LP64__)
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#if defined(XP_MACOSX)
#pragma options align=mac68k
#endif
#endif /* __LP64__ */
@@ -201,7 +231,19 @@ typedef struct _NPRect
uint16_t right;
} NPRect;
-#ifdef XP_UNIX
+typedef struct _NPSize
+{
+ int32_t width;
+ int32_t height;
+} NPSize;
+
+/* Return values for NPP_HandleEvent */
+#define kNPEventNotHandled 0
+#define kNPEventHandled 1
+/* Exact meaning must be spec'd in event model. */
+#define kNPEventStartIME 2
+
+#if defined(XP_UNIX)
/*
* Unix specific structures and definitions
*/
@@ -238,7 +280,7 @@ typedef struct
#endif /* XP_UNIX */
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX)
typedef enum {
#ifndef NP_NO_QUICKDRAW
NPDrawingModelQuickDraw = 0,
@@ -280,8 +322,8 @@ typedef enum {
#define _NP_ABI_MIXIN_FOR_GCC3 0
#endif
+#if defined(XP_MACOSX)
#define NP_ABI_MACHO_MASK 0x01000000
-#if (defined(TARGET_RT_MAC_MACHO))
#define _NP_ABI_MIXIN_FOR_MACHO NP_ABI_MACHO_MASK
#else
#define _NP_ABI_MIXIN_FOR_MACHO 0
@@ -324,10 +366,13 @@ typedef enum {
*/
NPPVpluginWantsAllNetworkStreams = 18,
+ /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
+ NPPVpluginNativeAccessibleAtkPlugId = 19,
+
/* Checks to see if the plug-in would like the browser to load the "src" attribute. */
NPPVpluginCancelSrcStream = 20
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX)
/* Used for negotiating drawing models */
, NPPVpluginDrawingModel = 1000
/* Used for negotiating event models */
@@ -336,6 +381,7 @@ typedef enum {
, NPPVpluginCoreAnimationLayer = 1003
#endif
+<<<<<<< HEAD
#ifdef ANDROID
/* Used when the plugin returns 0 from NPN_WriteReady and wishes the browser
* to wait a certain amount of millis before calling NPN_WriteReady again.
@@ -344,6 +390,10 @@ typedef enum {
// TODO(reed): upstream
, NPPFakeValueToForce32Bits = 0x7FFFFFFF
+=======
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ , NPPVpluginWindowlessLocalBool = 2002
+>>>>>>> webkit.org at r61871
#endif
} NPPVariable;
@@ -374,7 +424,7 @@ typedef enum {
NPNVprivateModeBool = 18
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX)
/* Used for negotiating drawing models */
, NPNVpluginDrawingModel = 1000
#ifndef NP_NO_QUICKDRAW
@@ -388,9 +438,14 @@ typedef enum {
#endif
, NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
#endif /* XP_MACOSX */
+<<<<<<< HEAD
#ifdef ANDROID
, NPNFakeValueToForce32Bits = 0x7FFFFFFF
+=======
+#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
+ , NPNVSupportsWindowlessLocal = 2002
+>>>>>>> webkit.org at r61871
#endif
} NPNVariable;
@@ -400,6 +455,14 @@ typedef enum {
} NPNURLVariable;
/*
+ * The type of Toolkit the widgets use
+ */
+typedef enum {
+ NPNVGtk12 = 1,
+ NPNVGtk2
+} NPNToolkitType;
+
+/*
* The type of a NPWindow - it specifies the type of the data structure
* returned in the window field.
*/
@@ -424,6 +487,22 @@ typedef struct _NPWindow
NPWindowType type; /* Is this a window or a drawable? */
} NPWindow;
+typedef struct _NPImageExpose
+{
+ char* data; /* image pointer */
+ int32_t stride; /* Stride of data image pointer */
+ int32_t depth; /* Depth of image pointer */
+ int32_t x; /* Expose x */
+ int32_t y; /* Expose y */
+ uint32_t width; /* Expose width */
+ uint32_t height; /* Expose height */
+ NPSize dataSize; /* Data buffer size */
+ float translateX; /* translate X matrix value */
+ float translateY; /* translate Y matrix value */
+ float scaleX; /* scale X matrix value */
+ float scaleY; /* scale Y matrix value */
+} NPImageExpose;
+
typedef struct _NPFullPrint
{
NPBool pluginPrinted;/* Set TRUE if plugin handled fullscreen printing */
@@ -448,7 +527,7 @@ typedef struct _NPPrint
} print;
} NPPrint;
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#if defined(XP_MACOSX)
#ifndef NP_NO_CARBON
typedef EventRecord NPEvent;
#endif
@@ -461,16 +540,21 @@ typedef struct _NPEvent
uintptr_t wParam;
uintptr_t lParam;
} NPEvent;
-#elif defined (XP_UNIX)
+#elif defined(XP_OS2)
+typedef struct _NPEvent
+{
+ uint32_t event;
+ uint32_t wParam;
+ uint32_t lParam;
+} NPEvent;
+#elif defined(XP_UNIX)
typedef XEvent NPEvent;
#else
typedef void* NPEvent;
#endif
-#if defined(XP_MAC)
-typedef RgnHandle NPRegion;
-#elif defined(XP_MACOSX)
-typedef void *NPRegion;
+#if defined(XP_MACOSX)
+typedef void* NPRegion;
#ifndef NP_NO_QUICKDRAW
typedef RgnHandle NPQDRegion;
#endif
@@ -489,7 +573,7 @@ typedef struct _NPNSString NPNSString;
typedef struct _NPNSWindow NPNSWindow;
typedef struct _NPNSMenu NPNSMenu;
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX)
typedef NPNSMenu NPMenu;
#else
typedef void *NPMenu;
@@ -503,7 +587,7 @@ typedef enum {
NPCoordinateSpaceFlippedScreen
} NPCoordinateSpace;
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX)
#ifndef NP_NO_QUICKDRAW
typedef struct NP_Port
@@ -598,15 +682,24 @@ typedef struct _NPCocoaEvent {
} data;
} NPCocoaEvent;
-#endif /* XP_MACOSX */
-
-#if defined(XP_MAC) || defined(XP_MACOSX)
-/* Non-standard event types that can be passed to HandleEvent */
+#ifndef NP_NO_CARBON
+/* Non-standard event types that can be passed to HandleEvent */
+enum NPEventType {
+ NPEventType_GetFocusEvent = (osEvt + 16),
+ NPEventType_LoseFocusEvent,
+ NPEventType_AdjustCursorEvent,
+ NPEventType_MenuCommandEvent,
+ NPEventType_ClippingChangedEvent,
+ NPEventType_ScrollingBeginsEvent = 1000,
+ NPEventType_ScrollingEndsEvent
+};
+/* Obsolete versions of the above */
#define getFocusEvent (osEvt + 16)
#define loseFocusEvent (osEvt + 17)
#define adjustCursorEvent (osEvt + 18)
-#endif /* XP_MAC */
+#endif /* NP_NO_CARBON */
+#endif /* XP_MACOSX */
/*
* Values for mode passed to NPP_New:
@@ -625,7 +718,7 @@ typedef struct _NPCocoaEvent {
#define NP_MAXREADY (((unsigned)(~0)<<1)>>1)
#if !defined(__LP64__)
-#if defined(XP_MAC) || defined(XP_MACOSX)
+#if defined(XP_MACOSX)
#pragma options align=reset
#endif
#endif /* __LP64__ */
@@ -694,8 +787,8 @@ typedef struct _NPCocoaEvent {
/* Function Prototypes */
/*----------------------------------------------------------------------*/
-#if defined(_WINDOWS) && !defined(WIN32)
-#define NP_LOADDS _loadds
+#if defined(__OS2__)
+#define NP_LOADDS _System
#else
#define NP_LOADDS
#endif
@@ -706,12 +799,12 @@ extern "C" {
/* NPP_* functions are provided by the plugin and called by the navigator. */
-#ifdef XP_UNIX
+#if defined(XP_UNIX)
char* NPP_GetMIMEDescription(void);
#endif
-NPError NPP_Initialize(void);
-void NPP_Shutdown(void);
+NPError NP_LOADDS NPP_Initialize(void);
+void NP_LOADDS NPP_Shutdown(void);
NPError NP_LOADDS NPP_New(NPMIMEType pluginType, NPP instance,
uint16_t mode, int16_t argc, char* argn[],
char* argv[], NPSavedData* saved);
@@ -728,64 +821,62 @@ int32_t NP_LOADDS NPP_Write(NPP instance, NPStream* stream, int32_t offset,
void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream* stream,
const char* fname);
void NP_LOADDS NPP_Print(NPP instance, NPPrint* platformPrint);
-int16_t NPP_HandleEvent(NPP instance, void* event);
+int16_t NP_LOADDS NPP_HandleEvent(NPP instance, void* event);
void NP_LOADDS NPP_URLNotify(NPP instance, const char* url,
NPReason reason, void* notifyData);
jref NP_LOADDS NPP_GetJavaClass(void);
-NPError NPP_GetValue(NPP instance, NPPVariable variable,
- void *value);
-NPError NPP_SetValue(NPP instance, NPNVariable variable,
- void *value);
+NPError NP_LOADDS NPP_GetValue(NPP instance, NPPVariable variable, void *value);
+NPError NP_LOADDS NPP_SetValue(NPP instance, NPNVariable variable, void *value);
/* NPN_* functions are provided by the navigator and called by the plugin. */
-void NPN_Version(int* plugin_major, int* plugin_minor,
+void NP_LOADDS NPN_Version(int* plugin_major, int* plugin_minor,
int* netscape_major, int* netscape_minor);
-NPError NPN_GetURLNotify(NPP instance, const char* url,
+NPError NP_LOADDS NPN_GetURLNotify(NPP instance, const char* url,
const char* target, void* notifyData);
-NPError NPN_GetURL(NPP instance, const char* url,
+NPError NP_LOADDS NPN_GetURL(NPP instance, const char* url,
const char* target);
-NPError NPN_PostURLNotify(NPP instance, const char* url,
+NPError NP_LOADDS NPN_PostURLNotify(NPP instance, const char* url,
const char* target, uint32_t len,
const char* buf, NPBool file,
void* notifyData);
-NPError NPN_PostURL(NPP instance, const char* url,
+NPError NP_LOADDS NPN_PostURL(NPP instance, const char* url,
const char* target, uint32_t len,
const char* buf, NPBool file);
-NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
-NPError NPN_NewStream(NPP instance, NPMIMEType type,
+NPError NP_LOADDS NPN_RequestRead(NPStream* stream, NPByteRange* rangeList);
+NPError NP_LOADDS NPN_NewStream(NPP instance, NPMIMEType type,
const char* target, NPStream** stream);
-int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len,
+int32_t NP_LOADDS NPN_Write(NPP instance, NPStream* stream, int32_t len,
void* buffer);
-NPError NPN_DestroyStream(NPP instance, NPStream* stream,
+NPError NP_LOADDS NPN_DestroyStream(NPP instance, NPStream* stream,
NPReason reason);
-void NPN_Status(NPP instance, const char* message);
-const char* NPN_UserAgent(NPP instance);
-void* NPN_MemAlloc(uint32_t size);
-void NPN_MemFree(void* ptr);
-uint32_t NPN_MemFlush(uint32_t size);
-void NPN_ReloadPlugins(NPBool reloadPages);
-JRIEnv* NPN_GetJavaEnv(void);
-jref NPN_GetJavaPeer(NPP instance);
-NPError NPN_GetValue(NPP instance, NPNVariable variable,
+void NP_LOADDS NPN_Status(NPP instance, const char* message);
+const char* NP_LOADDS NPN_UserAgent(NPP instance);
+void* NP_LOADDS NPN_MemAlloc(uint32_t size);
+void NP_LOADDS NPN_MemFree(void* ptr);
+uint32_t NP_LOADDS NPN_MemFlush(uint32_t size);
+void NP_LOADDS NPN_ReloadPlugins(NPBool reloadPages);
+JRIEnv* NP_LOADDS NPN_GetJavaEnv(void);
+jref NP_LOADDS NPN_GetJavaPeer(NPP instance);
+NPError NP_LOADDS NPN_GetValue(NPP instance, NPNVariable variable,
void *value);
-NPError NPN_SetValue(NPP instance, NPPVariable variable,
+NPError NP_LOADDS NPN_SetValue(NPP instance, NPPVariable variable,
void *value);
-void NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
-void NPN_InvalidateRegion(NPP instance,
+void NP_LOADDS NPN_InvalidateRect(NPP instance, NPRect *invalidRect);
+void NP_LOADDS NPN_InvalidateRegion(NPP instance,
NPRegion invalidRegion);
-void NPN_ForceRedraw(NPP instance);
-void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
-void NPN_PopPopupsEnabledState(NPP instance);
-void NPN_PluginThreadAsyncCall(NPP instance,
+void NP_LOADDS NPN_ForceRedraw(NPP instance);
+void NP_LOADDS NPN_PushPopupsEnabledState(NPP instance, NPBool enabled);
+void NP_LOADDS NPN_PopPopupsEnabledState(NPP instance);
+void NP_LOADDS NPN_PluginThreadAsyncCall(NPP instance,
void (*func) (void *),
void *userData);
-NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
+NPError NP_LOADDS NPN_GetValueForURL(NPP instance, NPNURLVariable variable,
const char *url, char **value,
uint32_t *len);
-NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
+NPError NP_LOADDS NPN_SetValueForURL(NPP instance, NPNURLVariable variable,
const char *url, const char *value,
uint32_t len);
-NPError NPN_GetAuthenticationInfo(NPP instance,
+NPError NP_LOADDS NPN_GetAuthenticationInfo(NPP instance,
const char *protocol,
const char *host, int32_t port,
const char *scheme,
@@ -793,13 +884,18 @@ NPError NPN_GetAuthenticationInfo(NPP instance,
char **username, uint32_t *ulen,
char **password,
uint32_t *plen);
-uint32_t NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
-void NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
-NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
-NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
+uint32_t NP_LOADDS NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID));
+void NP_LOADDS NPN_UnscheduleTimer(NPP instance, uint32_t timerID);
+NPError NP_LOADDS NPN_PopUpContextMenu(NPP instance, NPMenu* menu);
+NPBool NP_LOADDS NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace);
#ifdef __cplusplus
} /* end extern "C" */
#endif
+#endif /* RC_INVOKED */
+#if defined(__OS2__)
+#pragma pack()
+#endif
+
#endif /* npapi_h_ */
diff --git a/WebCore/bridge/qt/qt_runtime.cpp b/WebCore/bridge/qt/qt_runtime.cpp
index 6cea96e..77a6716 100644
--- a/WebCore/bridge/qt/qt_runtime.cpp
+++ b/WebCore/bridge/qt/qt_runtime.cpp
@@ -162,9 +162,11 @@ static JSRealType valueRealType(ExecState* exec, JSValue val)
return String; // I don't know.
}
-QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects)
+QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance, HashSet<JSObject*>* visitedObjects, int recursionLimit)
{
- if (!value)
+ --recursionLimit;
+
+ if (!value || !recursionLimit)
return QVariant();
JSObject* object = 0;
@@ -336,7 +338,8 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
if (type == Object || type == Array || type == RTArray) {
// Enumerate the contents of the object
PropertyNameArray properties(exec);
- object->getPropertyNames(exec, properties);
+ if (properties.size() > 0)
+ object->getPropertyNames(exec, properties);
PropertyNameArray::const_iterator it = properties.begin();
QVariantMap result;
@@ -344,7 +347,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
while(it != properties.end()) {
if (object->propertyIsEnumerable(exec, *it)) {
JSValue val = object->get(exec, *it);
- QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects);
+ QVariant v = convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit);
if (objdist >= 0) {
UString ustring = (*it).ustring();
QString id = QString((const QChar*)ustring.rep()->characters(), ustring.size());
@@ -368,7 +371,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
qConvDebug() << "converting a " << len << " length Array";
for (int i = 0; i < len; ++i) {
JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
- result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects));
+ result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit));
if (objdist == -1) {
qConvDebug() << "Failed converting element at index " << i;
break; // Failed converting a list entry, so fail the array
@@ -387,7 +390,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
qConvDebug() << "converting a " << len << " length Array";
for (int i = 0; i < len; ++i) {
JSValue val = array->get(exec, i);
- result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects));
+ result.append(convertValueToQVariant(exec, val, QMetaType::Void, &objdist, visitedObjects, recursionLimit));
if (objdist == -1) {
qConvDebug() << "Failed converting element at index " << i;
break; // Failed converting a list entry, so fail the array
@@ -401,7 +404,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
// Make a single length array
int objdist;
qConvDebug() << "making a single length variantlist";
- QVariant var = convertValueToQVariant(exec, value, QMetaType::Void, &objdist, visitedObjects);
+ QVariant var = convertValueToQVariant(exec, value, QMetaType::Void, &objdist, visitedObjects, recursionLimit);
if (objdist != -1) {
QVariantList result;
result << var;
@@ -645,7 +648,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
for (int i = 0; i < len; ++i) {
JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
int itemdist = -1;
- QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects);
+ QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit);
if (itemdist >= 0)
result.append(item.value<QObject*>());
else
@@ -664,7 +667,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
for (int i = 0; i < len; ++i) {
JSValue val = array->get(exec, i);
int itemdist = -1;
- QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects);
+ QVariant item = convertValueToQVariant(exec, val, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit);
if (itemdist >= 0)
result.append(item.value<QObject*>());
else
@@ -679,7 +682,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
// Make a single length array
QObjectList result;
int itemdist = -1;
- QVariant item = convertValueToQVariant(exec, value, QMetaType::QObjectStar, &itemdist, visitedObjects);
+ QVariant item = convertValueToQVariant(exec, value, QMetaType::QObjectStar, &itemdist, visitedObjects, recursionLimit);
if (itemdist >= 0) {
result.append(item.value<QObject*>());
dist = 10;
@@ -696,7 +699,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
for (int i = 0; i < len; ++i) {
JSValue val = rtarray->getConcreteArray()->valueAt(exec, i);
int itemdist = -1;
- QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects);
+ QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects, recursionLimit);
if (itemdist >= 0)
result.append(item.value<int>());
else
@@ -715,7 +718,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
for (int i = 0; i < len; ++i) {
JSValue val = array->get(exec, i);
int itemdist = -1;
- QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects);
+ QVariant item = convertValueToQVariant(exec, val, QMetaType::Int, &itemdist, visitedObjects, recursionLimit);
if (itemdist >= 0)
result.append(item.value<int>());
else
@@ -730,7 +733,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
// Make a single length array
QList<int> result;
int itemdist = -1;
- QVariant item = convertValueToQVariant(exec, value, QMetaType::Int, &itemdist, visitedObjects);
+ QVariant item = convertValueToQVariant(exec, value, QMetaType::Int, &itemdist, visitedObjects, recursionLimit);
if (itemdist >= 0) {
result.append(item.value<int>());
dist = 10;
@@ -757,7 +760,7 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
}
// And then recurse with the autodetect flag
- ret = convertValueToQVariant(exec, value, QMetaType::Void, distance, visitedObjects);
+ ret = convertValueToQVariant(exec, value, QMetaType::Void, distance, visitedObjects, recursionLimit);
dist = 10;
}
break;
@@ -777,8 +780,9 @@ QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type
QVariant convertValueToQVariant(ExecState* exec, JSValue value, QMetaType::Type hint, int *distance)
{
+ const int recursionLimit = 200;
HashSet<JSObject*> visitedObjects;
- return convertValueToQVariant(exec, value, hint, distance, &visitedObjects);
+ return convertValueToQVariant(exec, value, hint, distance, &visitedObjects, recursionLimit);
}
JSValue convertQVariantToValue(ExecState* exec, PassRefPtr<RootObject> root, const QVariant& variant)
diff --git a/WebCore/config.h b/WebCore/config.h
index 827bd05..c46a53c 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -323,7 +323,3 @@ typedef float CGFloat;
#if PLATFORM(WIN) && PLATFORM(CG)
#define WTF_USE_SAFARI_THEME 1
#endif
-
-#if defined(WTF_USE_V8)
-#define USE_NEW_QUERY_CALLBACKS
-#endif
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp
index 23366cf..06779a9 100644
--- a/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2004 Zack Rusin <zack@kde.org>
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
* Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
*
@@ -921,6 +921,12 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
if (style->highlight() == nullAtom)
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
return CSSPrimitiveValue::create(style->highlight(), CSSPrimitiveValue::CSS_STRING);
+ case CSSPropertyWebkitHyphens:
+ return CSSPrimitiveValue::create(style->hyphens());
+ case CSSPropertyWebkitHyphenateCharacter:
+ if (style->hyphenateCharacter().isNull())
+ return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
+ return CSSPrimitiveValue::create(style->hyphenateCharacter(), CSSPrimitiveValue::CSS_STRING);
case CSSPropertyWebkitBorderFit:
if (style->borderFit() == BorderFitBorder)
return CSSPrimitiveValue::createIdentifier(CSSValueBorder);
diff --git a/WebCore/css/CSSGrammar.y b/WebCore/css/CSSGrammar.y
index 06c6d01..26b2ba8 100644
--- a/WebCore/css/CSSGrammar.y
+++ b/WebCore/css/CSSGrammar.y
@@ -778,19 +778,25 @@ page_selector:
CSSParser* p = static_cast<CSSParser*>(parser);
$$ = p->createFloatingSelector();
$$->m_tag = QualifiedName(nullAtom, $1, p->m_defaultNamespace);
+ $$->setForPage();
}
| IDENT pseudo_page {
CSSParser* p = static_cast<CSSParser*>(parser);
$$ = $2;
- if ($$)
+ if ($$) {
$$->m_tag = QualifiedName(nullAtom, $1, p->m_defaultNamespace);
+ $$->setForPage();
+ }
}
| pseudo_page {
$$ = $1;
+ if ($$)
+ $$->setForPage();
}
| /* empty */ {
CSSParser* p = static_cast<CSSParser*>(parser);
$$ = p->createFloatingSelector();
+ $$->setForPage();
}
;
diff --git a/WebCore/css/CSSInitialValue.h b/WebCore/css/CSSInitialValue.h
index 96bc2a5..70ea91c 100644
--- a/WebCore/css/CSSInitialValue.h
+++ b/WebCore/css/CSSInitialValue.h
@@ -30,12 +30,12 @@ class CSSInitialValue : public CSSValue {
public:
static PassRefPtr<CSSInitialValue> createExplicit()
{
- static CSSInitialValue* explicitValue = new CSSInitialValue(false);
+ static CSSInitialValue* explicitValue = create(false).releaseRef();
return explicitValue;
}
static PassRefPtr<CSSInitialValue> createImplicit()
{
- static CSSInitialValue* explicitValue = new CSSInitialValue(true);
+ static CSSInitialValue* explicitValue = create(true).releaseRef();
return explicitValue;
}
@@ -47,6 +47,11 @@ private:
{
}
+ static PassRefPtr<CSSInitialValue> create(bool implicit)
+ {
+ return adoptRef(new CSSInitialValue(implicit));
+ }
+
virtual unsigned short cssValueType() const;
virtual bool isImplicitInitialValue() const { return m_implicit; }
diff --git a/WebCore/css/CSSMutableStyleDeclaration.cpp b/WebCore/css/CSSMutableStyleDeclaration.cpp
index 44e0b17..8d37a2e 100644
--- a/WebCore/css/CSSMutableStyleDeclaration.cpp
+++ b/WebCore/css/CSSMutableStyleDeclaration.cpp
@@ -82,13 +82,18 @@ CSSMutableStyleDeclaration::CSSMutableStyleDeclaration(CSSRule* parent, const CS
#endif
{
m_properties.reserveInitialCapacity(numProperties);
+ HashSet<int> candidates;
for (int i = 0; i < numProperties; ++i) {
- ASSERT(properties[i]);
- m_properties.append(*properties[i]);
- if (properties[i]->value()->isVariableDependentValue())
+ const CSSProperty *property = properties[i];
+ ASSERT(property);
+ if (property->value()->isVariableDependentValue())
m_variableDependentValueCount++;
+ else if (candidates.contains(property->id()))
+ removeProperty(properties[i]->id(), false);
+ m_properties.append(*property);
+ if (!getPropertyPriority(property->id()) && !property->isImportant())
+ candidates.add(property->id());
}
- // FIXME: This allows duplicate properties.
}
CSSMutableStyleDeclaration& CSSMutableStyleDeclaration::operator=(const CSSMutableStyleDeclaration& other)
diff --git a/WebCore/css/CSSParser.cpp b/WebCore/css/CSSParser.cpp
index 8934656..57c42d3 100644
--- a/WebCore/css/CSSParser.cpp
+++ b/WebCore/css/CSSParser.cpp
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2003 Lars Knoll (knoll@kde.org)
* Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
* Copyright (C) 2008 Eric Seidel <eric@webkit.org>
* Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
@@ -845,7 +845,7 @@ bool CSSParser::parseValue(int propId, bool important)
case CSSPropertyOutlineColor: // <color> | invert | inherit
// Outline color has "invert" as additional keyword.
// Also, we want to allow the special focus color even in strict parsing mode.
- if (propId == CSSPropertyOutlineColor && (id == CSSValueInvert || id == CSSValueWebkitFocusRingColor)) {
+ if (id == CSSValueInvert || id == CSSValueWebkitFocusRingColor) {
validPrimitive = true;
break;
}
@@ -882,7 +882,7 @@ bool CSSParser::parseValue(int propId, bool important)
// nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | ew-resize |
// ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | text | wait | help |
// vertical-text | cell | context-menu | alias | copy | no-drop | not-allowed | -webkit-zoom-in
- // -webkit-zoom-in | -webkit-zoom-out | all-scroll | -webkit-grab | -webkit-grabbing ] ] | inherit
+ // -webkit-zoom-out | all-scroll | -webkit-grab | -webkit-grabbing ] ] | inherit
RefPtr<CSSValueList> list;
while (value && value->unit == CSSPrimitiveValue::CSS_URI) {
if (!list)
@@ -1030,12 +1030,15 @@ bool CSSParser::parseValue(int propId, bool important)
break;
case CSSPropertyTextIndent: // <length> | <percentage> | inherit
+ validPrimitive = (!id && validUnit(value, FLength | FPercent, m_strict));
+ break;
+
case CSSPropertyPaddingTop: //// <padding-width> | inherit
case CSSPropertyPaddingRight: // Which is defined as
case CSSPropertyPaddingBottom: // <length> | <percentage>
case CSSPropertyPaddingLeft: ////
case CSSPropertyWebkitPaddingStart:
- validPrimitive = (!id && validUnit(value, FLength | FPercent, m_strict));
+ validPrimitive = (!id && validUnit(value, FLength | FPercent | FNonNeg, m_strict));
break;
case CSSPropertyMaxHeight: // <length> | <percentage> | none | inherit
@@ -1606,6 +1609,16 @@ bool CSSParser::parseValue(int propId, bool important)
validPrimitive = true;
break;
+ case CSSPropertyWebkitHyphens:
+ if (id == CSSValueNone || id == CSSValueManual || id == CSSValueAuto)
+ validPrimitive = true;
+ break;
+
+ case CSSPropertyWebkitHyphenateCharacter:
+ if (id == CSSValueAuto || value->unit == CSSPrimitiveValue::CSS_STRING)
+ validPrimitive = true;
+ break;
+
case CSSPropertyWebkitBorderFit:
if (id == CSSValueBorder || id == CSSValueLines)
validPrimitive = true;
@@ -2294,13 +2307,13 @@ CSSParser::SizeParameterType CSSParser::parseSizeParameter(CSSValueList* parsedV
case CSSValueLetter:
if (prevParamType == None || prevParamType == Orientation) {
// Normalize to Page Size then Orientation order by prepending.
- // This is not specified by the CSS3 Paged Media specification, but for simpler processing hereafter.
+ // This is not specified by the CSS3 Paged Media specification, but for simpler processing later (CSSStyleSelector::applyPageSizeProperty).
parsedValues->prepend(CSSPrimitiveValue::createIdentifier(value->id));
return PageSize;
}
return None;
case 0:
- if (validUnit(value, FLength, m_strict) && (prevParamType == None || prevParamType == Length)) {
+ if (validUnit(value, FLength | FNonNeg, m_strict) && (prevParamType == None || prevParamType == Length)) {
parsedValues->append(CSSPrimitiveValue::create(value->fValue, static_cast<CSSPrimitiveValue::UnitTypes>(value->unit)));
return Length;
}
diff --git a/WebCore/css/CSSPrimitiveValue.cpp b/WebCore/css/CSSPrimitiveValue.cpp
index e602f86..0508cd5 100644
--- a/WebCore/css/CSSPrimitiveValue.cpp
+++ b/WebCore/css/CSSPrimitiveValue.cpp
@@ -56,18 +56,33 @@ static CSSTextCache& cssTextCache()
// non-refcounted simple type with value semantics. In practice these sharing tricks get similar memory benefits
// with less need for refactoring.
+inline PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::createUncachedIdentifier(int identifier)
+{
+ return adoptRef(new CSSPrimitiveValue(identifier));
+}
+
+inline PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::createUncachedColor(unsigned rgbValue)
+{
+ return adoptRef(new CSSPrimitiveValue(rgbValue));
+}
+
+inline PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::createUncached(double value, UnitTypes type)
+{
+ return adoptRef(new CSSPrimitiveValue(value, type));
+}
+
PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::createIdentifier(int ident)
{
static RefPtr<CSSPrimitiveValue>* identValueCache = new RefPtr<CSSPrimitiveValue>[numCSSValueKeywords];
if (ident >= 0 && ident < numCSSValueKeywords) {
RefPtr<CSSPrimitiveValue> primitiveValue = identValueCache[ident];
if (!primitiveValue) {
- primitiveValue = adoptRef(new CSSPrimitiveValue(ident));
+ primitiveValue = createUncachedIdentifier(ident);
identValueCache[ident] = primitiveValue;
}
return primitiveValue.release();
}
- return adoptRef(new CSSPrimitiveValue(ident));
+ return createUncachedIdentifier(ident);
}
PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::createColor(unsigned rgbValue)
@@ -76,17 +91,17 @@ PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::createColor(unsigned rgbValue)
static ColorValueCache* colorValueCache = new ColorValueCache;
// These are the empty and deleted values of the hash table.
if (rgbValue == Color::transparent) {
- static CSSPrimitiveValue* colorTransparent = new CSSPrimitiveValue(Color::transparent);
+ static CSSPrimitiveValue* colorTransparent = createUncachedColor(Color::transparent).releaseRef();
return colorTransparent;
}
if (rgbValue == Color::white) {
- static CSSPrimitiveValue* colorWhite = new CSSPrimitiveValue(Color::white);
+ static CSSPrimitiveValue* colorWhite = createUncachedColor(Color::white).releaseRef();
return colorWhite;
}
RefPtr<CSSPrimitiveValue> primitiveValue = colorValueCache->get(rgbValue);
if (primitiveValue)
return primitiveValue.release();
- primitiveValue = adoptRef(new CSSPrimitiveValue(rgbValue));
+ primitiveValue = createUncachedColor(rgbValue);
// Just wipe out the cache and start rebuilding when it gets too big.
const int maxColorCacheSize = 512;
if (colorValueCache->size() >= maxColorCacheSize)
@@ -109,14 +124,14 @@ PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::create(double value, UnitTypes
if (value == intValue) {
RefPtr<CSSPrimitiveValue> primitiveValue = integerValueCache[intValue][type];
if (!primitiveValue) {
- primitiveValue = adoptRef(new CSSPrimitiveValue(value, type));
+ primitiveValue = createUncached(value, type);
integerValueCache[intValue][type] = primitiveValue;
}
return primitiveValue.release();
}
}
- return adoptRef(new CSSPrimitiveValue(value, type));
+ return createUncached(value, type);
}
PassRefPtr<CSSPrimitiveValue> CSSPrimitiveValue::create(const String& value, UnitTypes type)
diff --git a/WebCore/css/CSSPrimitiveValue.h b/WebCore/css/CSSPrimitiveValue.h
index c2a4dc3..a71c8c6 100644
--- a/WebCore/css/CSSPrimitiveValue.h
+++ b/WebCore/css/CSSPrimitiveValue.h
@@ -191,6 +191,10 @@ private:
static void create(unsigned); // compile-time guard
template<typename T> operator T*(); // compile-time guard
+ static PassRefPtr<CSSPrimitiveValue> createUncachedIdentifier(int identifier);
+ static PassRefPtr<CSSPrimitiveValue> createUncachedColor(unsigned rgbValue);
+ static PassRefPtr<CSSPrimitiveValue> createUncached(double value, UnitTypes type);
+
void init(PassRefPtr<Counter>);
void init(PassRefPtr<Rect>);
void init(PassRefPtr<Pair>);
diff --git a/WebCore/css/CSSPrimitiveValueMappings.h b/WebCore/css/CSSPrimitiveValueMappings.h
index f646b29..baa1ab8 100644
--- a/WebCore/css/CSSPrimitiveValueMappings.h
+++ b/WebCore/css/CSSPrimitiveValueMappings.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2007 Alexey Proskuryakov <ap@nypop.com>.
- * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
* Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
@@ -344,6 +344,11 @@ template<> inline CSSPrimitiveValue::CSSPrimitiveValue(ControlPart e)
case CapsLockIndicatorPart:
m_value.ident = CSSValueCapsLockIndicator;
break;
+ case InputSpeechButtonPart:
+#if ENABLE(INPUT_SPEECH)
+ m_value.ident = CSSValueInputSpeechButton;
+#endif
+ break;
}
}
@@ -2157,6 +2162,38 @@ template<> inline CSSPrimitiveValue::operator ColorSpace() const
}
}
+template<> inline CSSPrimitiveValue::CSSPrimitiveValue(Hyphens hyphens)
+ : m_type(CSS_IDENT)
+ , m_hasCachedCSSText(false)
+{
+ switch (hyphens) {
+ case HyphensNone:
+ m_value.ident = CSSValueNone;
+ break;
+ case HyphensManual:
+ m_value.ident = CSSValueManual;
+ break;
+ case HyphensAuto:
+ m_value.ident = CSSValueAuto;
+ break;
+ }
+}
+
+template<> inline CSSPrimitiveValue::operator Hyphens() const
+{
+ switch (m_value.ident) {
+ case CSSValueNone:
+ return HyphensNone;
+ case CSSValueManual:
+ return HyphensManual;
+ case CSSValueAuto:
+ return HyphensAuto;
+ default:
+ ASSERT_NOT_REACHED();
+ return HyphensAuto;
+ }
+}
+
#if ENABLE(SVG)
template<> inline CSSPrimitiveValue::CSSPrimitiveValue(LineCap e)
diff --git a/WebCore/css/CSSPropertyNames.in b/WebCore/css/CSSPropertyNames.in
index 5b9e7fd..9c65971 100644
--- a/WebCore/css/CSSPropertyNames.in
+++ b/WebCore/css/CSSPropertyNames.in
@@ -209,6 +209,8 @@ z-index
-webkit-font-size-delta
-webkit-font-smoothing
-webkit-highlight
+-webkit-hyphenate-character
+-webkit-hyphens
-webkit-line-break
-webkit-line-clamp
-webkit-margin-bottom-collapse
diff --git a/WebCore/css/CSSSelector.cpp b/WebCore/css/CSSSelector.cpp
index e45bf4c..ddf1737 100644
--- a/WebCore/css/CSSSelector.cpp
+++ b/WebCore/css/CSSSelector.cpp
@@ -5,6 +5,7 @@
* 2001-2003 Dirk Mueller (mueller@kde.org)
* Copyright (C) 2002, 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 David Smith (catfish.man@gmail.com)
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -37,6 +38,9 @@ using namespace HTMLNames;
unsigned int CSSSelector::specificity()
{
+ if (m_isForPage)
+ return specificityForPage();
+
// FIXME: Pseudo-elements and pseudo-classes do not have the same specificity. This function
// isn't quite correct.
int s = (m_tag.localName() == starAtom ? 0 : 1);
@@ -66,6 +70,27 @@ unsigned int CSSSelector::specificity()
return s & 0xffffff;
}
+unsigned CSSSelector::specificityForPage()
+{
+ // See http://dev.w3.org/csswg/css3-page/#cascading-and-page-context
+ unsigned s = (m_tag.localName() == starAtom ? 0 : 4);
+
+ switch (pseudoType()) {
+ case PseudoFirstPage:
+ s += 2;
+ break;
+ case PseudoLeftPage:
+ case PseudoRightPage:
+ s += 1;
+ break;
+ case PseudoNotParsed:
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ return s;
+}
+
PseudoId CSSSelector::pseudoId(PseudoType type)
{
switch (type) {
@@ -83,6 +108,10 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
return FILE_UPLOAD_BUTTON;
case PseudoInputPlaceholder:
return INPUT_PLACEHOLDER;
+#if ENABLE(INPUT_SPEECH)
+ case PseudoInputSpeechButton:
+ return INPUT_SPEECH_BUTTON;
+#endif
case PseudoSliderThumb:
return SLIDER_THUMB;
case PseudoSearchCancelButton:
@@ -150,6 +179,37 @@ PseudoId CSSSelector::pseudoId(PseudoType type)
ASSERT_NOT_REACHED();
return NOPSEUDO;
#endif
+
+#if ENABLE(METER_TAG)
+ case PseudoMeterHorizontalBar:
+ return METER_HORIZONTAL_BAR;
+ case PseudoMeterHorizontalOptimum:
+ return METER_HORIZONTAL_OPTIMUM;
+ case PseudoMeterHorizontalSuboptimal:
+ return METER_HORIZONTAL_SUBOPTIMAL;
+ case PseudoMeterHorizontalEvenLessGood:
+ return METER_HORIZONTAL_EVEN_LESS_GOOD;
+ case PseudoMeterVerticalBar:
+ return METER_VERTICAL_BAR;
+ case PseudoMeterVerticalOptimum:
+ return METER_VERTICAL_OPTIMUM;
+ case PseudoMeterVerticalSuboptimal:
+ return METER_VERTICAL_SUBOPTIMAL;
+ case PseudoMeterVerticalEvenLessGood:
+ return METER_VERTICAL_EVEN_LESS_GOOD;
+#else
+ case PseudoMeterHorizontalBar:
+ case PseudoMeterHorizontalOptimum:
+ case PseudoMeterHorizontalSuboptimal:
+ case PseudoMeterHorizontalEvenLessGood:
+ case PseudoMeterVerticalBar:
+ case PseudoMeterVerticalOptimum:
+ case PseudoMeterVerticalSuboptimal:
+ case PseudoMeterVerticalEvenLessGood:
+ ASSERT_NOT_REACHED();
+ return NOPSEUDO;
+#endif
+
case PseudoInputListButton:
#if ENABLE(DATALIST)
return INPUT_LIST_BUTTON;
@@ -225,6 +285,9 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
DEFINE_STATIC_LOCAL(AtomicString, before, ("before"));
DEFINE_STATIC_LOCAL(AtomicString, checked, ("checked"));
DEFINE_STATIC_LOCAL(AtomicString, fileUploadButton, ("-webkit-file-upload-button"));
+#if ENABLE(INPUT_SPEECH)
+ DEFINE_STATIC_LOCAL(AtomicString, inputSpeechButton, ("-webkit-input-speech-button"));
+#endif
DEFINE_STATIC_LOCAL(AtomicString, defaultString, ("default"));
DEFINE_STATIC_LOCAL(AtomicString, disabled, ("disabled"));
DEFINE_STATIC_LOCAL(AtomicString, readOnly, ("read-only"));
@@ -280,6 +343,18 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
#if ENABLE(PROGRESS_TAG)
DEFINE_STATIC_LOCAL(AtomicString, progressBarValue, ("-webkit-progress-bar-value"));
#endif
+
+#if ENABLE(METER_TAG)
+ DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalBar, ("-webkit-meter-horizontal-bar"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalOptimumValue, ("-webkit-meter-horizontal-optimum-value"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalSuboptimalValue, ("-webkit-meter-horizontal-suboptimal-value"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterHorizontalEvenLessGoodValue, ("-webkit-meter-horizontal-even-less-good-value"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterVerticalBar, ("-webkit-meter-vertical-bar"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterVerticalOptimumValue, ("-webkit-meter-vertical-optimum-value"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterVerticalSuboptimalValue, ("-webkit-meter-vertical-suboptimal-value"));
+ DEFINE_STATIC_LOCAL(AtomicString, meterVerticalEvenLessGoodValue, ("-webkit-meter-vertical-even-less-good-value"));
+#endif
+
DEFINE_STATIC_LOCAL(AtomicString, required, ("required"));
DEFINE_STATIC_LOCAL(AtomicString, resizer, ("-webkit-resizer"));
DEFINE_STATIC_LOCAL(AtomicString, root, ("root"));
@@ -323,6 +398,9 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
nameToPseudoType->set(before.impl(), CSSSelector::PseudoBefore);
nameToPseudoType->set(checked.impl(), CSSSelector::PseudoChecked);
nameToPseudoType->set(fileUploadButton.impl(), CSSSelector::PseudoFileUploadButton);
+#if ENABLE(INPUT_SPEECH)
+ nameToPseudoType->set(inputSpeechButton.impl(), CSSSelector::PseudoInputSpeechButton);
+#endif
nameToPseudoType->set(defaultString.impl(), CSSSelector::PseudoDefault);
nameToPseudoType->set(disabled.impl(), CSSSelector::PseudoDisabled);
nameToPseudoType->set(readOnly.impl(), CSSSelector::PseudoReadOnly);
@@ -377,6 +455,16 @@ static HashMap<AtomicStringImpl*, CSSSelector::PseudoType>* nameToPseudoTypeMap(
#if ENABLE(PROGRESS_TAG)
nameToPseudoType->set(progressBarValue.impl(), CSSSelector::PseudoProgressBarValue);
#endif
+#if ENABLE(METER_TAG)
+ nameToPseudoType->set(meterHorizontalBar.impl(), CSSSelector::PseudoMeterHorizontalBar);
+ nameToPseudoType->set(meterHorizontalOptimumValue.impl(), CSSSelector::PseudoMeterHorizontalOptimum);
+ nameToPseudoType->set(meterHorizontalSuboptimalValue.impl(), CSSSelector::PseudoMeterHorizontalSuboptimal);
+ nameToPseudoType->set(meterHorizontalEvenLessGoodValue.impl(), CSSSelector::PseudoMeterHorizontalEvenLessGood);
+ nameToPseudoType->set(meterVerticalBar.impl(), CSSSelector::PseudoMeterVerticalBar);
+ nameToPseudoType->set(meterVerticalOptimumValue.impl(), CSSSelector::PseudoMeterVerticalOptimum);
+ nameToPseudoType->set(meterVerticalSuboptimalValue.impl(), CSSSelector::PseudoMeterVerticalSuboptimal);
+ nameToPseudoType->set(meterVerticalEvenLessGoodValue.impl(), CSSSelector::PseudoMeterVerticalEvenLessGood);
+#endif
nameToPseudoType->set(root.impl(), CSSSelector::PseudoRoot);
nameToPseudoType->set(windowInactive.impl(), CSSSelector::PseudoWindowInactive);
nameToPseudoType->set(decrement.impl(), CSSSelector::PseudoDecrement);
@@ -442,6 +530,9 @@ void CSSSelector::extractPseudoType() const
case PseudoFileUploadButton:
case PseudoInputListButton:
case PseudoInputPlaceholder:
+#if ENABLE(INPUT_SPEECH)
+ case PseudoInputSpeechButton:
+#endif
case PseudoInnerSpinButton:
case PseudoMediaControlsPanel:
case PseudoMediaControlsMuteButton:
@@ -459,6 +550,14 @@ void CSSSelector::extractPseudoType() const
case PseudoMediaControlsFullscreenButton:
case PseudoMediaControlsTimelineContainer:
case PseudoMediaControlsVolumeSliderContainer:
+ case PseudoMeterHorizontalBar:
+ case PseudoMeterHorizontalOptimum:
+ case PseudoMeterHorizontalSuboptimal:
+ case PseudoMeterHorizontalEvenLessGood:
+ case PseudoMeterVerticalBar:
+ case PseudoMeterVerticalOptimum:
+ case PseudoMeterVerticalSuboptimal:
+ case PseudoMeterVerticalEvenLessGood:
case PseudoOuterSpinButton:
case PseudoProgressBarValue:
case PseudoResizer:
diff --git a/WebCore/css/CSSSelector.h b/WebCore/css/CSSSelector.h
index 11d30b1..d55fafc 100644
--- a/WebCore/css/CSSSelector.h
+++ b/WebCore/css/CSSSelector.h
@@ -39,6 +39,7 @@ namespace WebCore {
, m_parsedNth(false)
, m_isLastInSelectorList(false)
, m_hasRareData(false)
+ , m_isForPage(false)
, m_tag(anyQName())
{
}
@@ -50,6 +51,7 @@ namespace WebCore {
, m_parsedNth(false)
, m_isLastInSelectorList(false)
, m_hasRareData(false)
+ , m_isForPage(false)
, m_tag(qName)
{
}
@@ -185,7 +187,18 @@ namespace WebCore {
PseudoMediaControlsReturnToRealtimeButton,
PseudoMediaControlsStatusDisplay,
PseudoMediaControlsFullscreenButton,
+ PseudoMeterHorizontalBar,
+ PseudoMeterVerticalBar,
+ PseudoMeterHorizontalOptimum,
+ PseudoMeterHorizontalSuboptimal,
+ PseudoMeterHorizontalEvenLessGood,
+ PseudoMeterVerticalOptimum,
+ PseudoMeterVerticalSuboptimal,
+ PseudoMeterVerticalEvenLessGood,
PseudoInputListButton,
+#if ENABLE(INPUT_SPEECH)
+ PseudoInputSpeechButton,
+#endif
PseudoInnerSpinButton,
PseudoOuterSpinButton,
PseudoProgressBarValue,
@@ -253,6 +266,9 @@ namespace WebCore {
void setLastInSelectorList() { m_isLastInSelectorList = true; }
bool isSimple() const;
+ bool isForPage() const { return m_isForPage; }
+ void setForPage() { m_isForPage = true; }
+
unsigned m_relation : 3; // enum Relation
mutable unsigned m_match : 4; // enum Match
mutable unsigned m_pseudoType : 8; // PseudoType
@@ -261,7 +277,9 @@ namespace WebCore {
bool m_parsedNth : 1; // Used for :nth-*
bool m_isLastInSelectorList : 1;
bool m_hasRareData : 1;
+ bool m_isForPage : 1;
+ unsigned specificityForPage();
void extractPseudoType() const;
struct RareData : Noncopyable {
diff --git a/WebCore/css/CSSStyleSelector.cpp b/WebCore/css/CSSStyleSelector.cpp
index 13bdeb9..3af3291 100644
--- a/WebCore/css/CSSStyleSelector.cpp
+++ b/WebCore/css/CSSStyleSelector.cpp
@@ -30,6 +30,7 @@
#include "CSSBorderImageValue.h"
#include "CSSCursorImageValue.h"
#include "CSSFontFaceRule.h"
+#include "CSSHelper.h"
#include "CSSImportRule.h"
#include "CSSMediaRule.h"
#include "CSSPageRule.h"
@@ -528,7 +529,7 @@ static void loadFullDefaultStyle()
if (simpleDefaultStyleSheet) {
ASSERT(defaultStyle);
delete defaultStyle;
- delete simpleDefaultStyleSheet;
+ simpleDefaultStyleSheet->deref();
defaultStyle = new CSSRuleSet;
simpleDefaultStyleSheet = 0;
} else {
@@ -1548,6 +1549,36 @@ PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForElement(PseudoId pseudo,
return m_style.release();
}
+PassRefPtr<RenderStyle> CSSStyleSelector::styleForPage(int pageIndex)
+{
+ initForStyleResolve(m_checker.m_document->body());
+
+ m_style = RenderStyle::create();
+ m_style->inheritFrom(m_rootElementStyle);
+
+ const bool isLeft = isLeftPage(pageIndex);
+ const bool isFirst = isFirstPage(pageIndex);
+ const String page = pageName(pageIndex);
+ matchPageRules(defaultPrintStyle, isLeft, isFirst, page);
+ matchPageRules(m_userStyle, isLeft, isFirst, page);
+ matchPageRules(m_authorStyle, isLeft, isFirst, page);
+ m_lineHeightValue = 0;
+ applyDeclarations<true>(false, 0, m_matchedDecls.size() - 1);
+
+ // If our font got dirtied, go ahead and update it now.
+ if (m_fontDirty)
+ updateFont();
+
+ // Line-height is set when we are sure we decided on the font-size
+ if (m_lineHeightValue)
+ applyProperty(CSSPropertyLineHeight, m_lineHeightValue);
+
+ applyDeclarations<false>(false, 0, m_matchedDecls.size() - 1);
+
+ // Now return the style.
+ return m_style.release();
+}
+
#if ENABLE(DATAGRID)
PassRefPtr<RenderStyle> CSSStyleSelector::pseudoStyleForDataGridColumn(DataGridColumn*, RenderStyle*)
@@ -2889,6 +2920,74 @@ void CSSStyleSelector::applyDeclarations(bool isImportant, int startIndex, int e
}
}
+void CSSStyleSelector::matchPageRules(CSSRuleSet* rules, bool isLeftPage, bool isFirstPage, const String& pageName)
+{
+ m_matchedRules.clear();
+
+ if (!rules)
+ return;
+
+ matchPageRulesForList(rules->getPageRules(), isLeftPage, isFirstPage, pageName);
+
+ // If we didn't match any rules, we're done.
+ if (m_matchedRules.isEmpty())
+ return;
+
+ // Sort the set of matched rules.
+ sortMatchedRules(0, m_matchedRules.size());
+
+ // Now transfer the set of matched rules over to our list of decls.
+ for (unsigned i = 0; i < m_matchedRules.size(); i++)
+ addMatchedDeclaration(m_matchedRules[i]->rule()->declaration());
+}
+
+void CSSStyleSelector::matchPageRulesForList(CSSRuleDataList* rules, bool isLeftPage, bool isFirstPage, const String& pageName)
+{
+ if (!rules)
+ return;
+
+ for (CSSRuleData* d = rules->first(); d; d = d->next()) {
+ CSSStyleRule* rule = d->rule();
+ const AtomicString& selectorLocalName = d->selector()->m_tag.localName();
+ if (selectorLocalName != starAtom && selectorLocalName != pageName)
+ continue;
+ CSSSelector::PseudoType pseudoType = d->selector()->pseudoType();
+ if ((pseudoType == CSSSelector::PseudoLeftPage && !isLeftPage)
+ || (pseudoType == CSSSelector::PseudoRightPage && isLeftPage)
+ || (pseudoType == CSSSelector::PseudoFirstPage && !isFirstPage))
+ continue;
+
+ // If the rule has no properties to apply, then ignore it.
+ CSSMutableStyleDeclaration* decl = rule->declaration();
+ if (!decl || !decl->length())
+ continue;
+
+ // Add this rule to our list of matched rules.
+ addMatchedRule(d);
+ }
+}
+
+bool CSSStyleSelector::isLeftPage(int pageIndex) const
+{
+ bool isFirstPageLeft = false;
+ if (m_rootElementStyle->direction() == RTL)
+ isFirstPageLeft = true;
+
+ return (pageIndex + (isFirstPageLeft ? 1 : 0)) % 2;
+}
+
+bool CSSStyleSelector::isFirstPage(int pageIndex) const
+{
+ // FIXME: In case of forced left/right page, page at index 1 (not 0) can be the first page.
+ return (!pageIndex);
+}
+
+String CSSStyleSelector::pageName(int /* pageIndex */) const
+{
+ // FIXME: Implement page index to page name mapping.
+ return "";
+}
+
static void applyCounterList(RenderStyle* style, CSSValueList* list, bool isReset)
{
CounterDirectiveMap& map = style->accessCounterDirectives();
@@ -3760,12 +3859,7 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
l = Length(primitiveValue->getDoubleValue(), Percent);
else
return;
- if (id == CSSPropertyPaddingLeft || id == CSSPropertyPaddingRight ||
- id == CSSPropertyPaddingTop || id == CSSPropertyPaddingBottom)
- // Padding can't be negative
- apply = !((l.isFixed() || l.isPercent()) && l.calcValue(100) < 0);
- else
- apply = true;
+ apply = true;
}
if (!apply) return;
switch (id) {
@@ -5087,6 +5181,19 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
m_style->setHighlight(primitiveValue->getStringValue());
return;
}
+ case CSSPropertyWebkitHyphens: {
+ HANDLE_INHERIT_AND_INITIAL(hyphens, Hyphens);
+ m_style->setHyphens(*primitiveValue);
+ return;
+ }
+ case CSSPropertyWebkitHyphenateCharacter: {
+ HANDLE_INHERIT_AND_INITIAL(hyphenateCharacter, HyphenateCharacter);
+ if (primitiveValue->getIdent() == CSSValueAuto)
+ m_style->setHyphenateCharacter(nullAtom);
+ else
+ m_style->setHyphenateCharacter(primitiveValue->getStringValue());
+ return;
+ }
case CSSPropertyWebkitBorderFit: {
HANDLE_INHERIT_AND_INITIAL(borderFit, BorderFit);
if (primitiveValue->getIdent() == CSSValueBorder)
@@ -5351,12 +5458,14 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
m_style->setColorSpace(*primitiveValue);
}
return;
+ case CSSPropertySize:
+ applyPageSizeProperty(value);
+ return;
case CSSPropertyInvalid:
return;
case CSSPropertyFontStretch:
case CSSPropertyPage:
case CSSPropertyQuotes:
- case CSSPropertySize:
case CSSPropertyTextLineThrough:
case CSSPropertyTextLineThroughColor:
case CSSPropertyTextLineThroughMode:
@@ -5416,6 +5525,161 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
}
}
+void CSSStyleSelector::applyPageSizeProperty(CSSValue* value)
+{
+ if (!value->isValueList())
+ return;
+ CSSValueList* valueList = static_cast<CSSValueList*>(value);
+ Length width;
+ Length height;
+ switch (valueList->length()) {
+ case 2: {
+ // <length>{2} | <page-size> <orientation>
+ if (!valueList->item(0)->isPrimitiveValue() || !valueList->item(1)->isPrimitiveValue())
+ return;
+ CSSPrimitiveValue* primitiveValue0 = static_cast<CSSPrimitiveValue*>(valueList->item(0));
+ CSSPrimitiveValue* primitiveValue1 = static_cast<CSSPrimitiveValue*>(valueList->item(1));
+ int type0 = primitiveValue0->primitiveType();
+ int type1 = primitiveValue1->primitiveType();
+ if (CSSPrimitiveValue::isUnitTypeLength(type0)) {
+ // <length>{2}
+ if (!CSSPrimitiveValue::isUnitTypeLength(type1))
+ return;
+ width = Length(primitiveValue0->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
+ height = Length(primitiveValue1->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
+ } else {
+ // <page-size> <orientation>
+ // The value order is guaranteed. See CSSParser::parseSizeParameter.
+ if (!pageSizeFromName(primitiveValue0, primitiveValue1, width, height))
+ return;
+ }
+ break;
+ }
+ case 1: {
+ // <length> | auto | <page-size> | [ portrait | landscape]
+ if (!valueList->item(0)->isPrimitiveValue())
+ return;
+ CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(valueList->item(0));
+ int type = primitiveValue->primitiveType();
+ if (CSSPrimitiveValue::isUnitTypeLength(type)) {
+ // <length>
+ width = height = Length(primitiveValue->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
+ } else {
+ if (type != CSSPrimitiveValue::CSS_IDENT)
+ return;
+ switch (primitiveValue->getIdent()) {
+ case CSSValueAuto:
+ // auto
+ if (!pageSizeFromName(0, 0, width, height))
+ return;
+ break;
+ case CSSValuePortrait:
+ case CSSValueLandscape:
+ // <page-size>
+ if (!pageSizeFromName(0, primitiveValue, width, height))
+ return;
+ break;
+ default:
+ // [ portrait | landscape]
+ if (!pageSizeFromName(primitiveValue, 0, width, height))
+ return;
+ }
+ }
+ break;
+ }
+ default:
+ return;
+ }
+ m_style->setPageSize(LengthSize(width, height));
+ return;
+}
+
+bool CSSStyleSelector::pageSizeFromName(CSSPrimitiveValue* pageSizeName, CSSPrimitiveValue* pageOrientation, Length& width, Length& height)
+{
+ static const Length a5Width = mmLength(148), a5Height = mmLength(210);
+ static const Length a4Width = mmLength(210), a4Height = mmLength(297);
+ static const Length a3Width = mmLength(297), a3Height = mmLength(420);
+ static const Length b5Width = mmLength(176), b5Height = mmLength(250);
+ static const Length b4Width = mmLength(250), b4Height = mmLength(353);
+ static const Length letterWidth = inchLength(8.5), letterHeight = inchLength(11);
+ static const Length legalWidth = inchLength(8.5), legalHeight = inchLength(14);
+ static const Length ledgerWidth = inchLength(11), ledgerHeight = inchLength(17);
+
+ // FIXME: Define UA default page size. Assume letter for now.
+ int ident = CSSValueLetter;
+ if (pageSizeName) {
+ if (pageSizeName->primitiveType() != CSSPrimitiveValue::CSS_IDENT)
+ return false;
+ ident = pageSizeName->getIdent();
+ }
+
+ // FIXME: Define UA default page orientation. Assume portrait for now.
+ bool portrait = true;
+ if (pageOrientation) {
+ if (pageOrientation->primitiveType() != CSSPrimitiveValue::CSS_IDENT)
+ return false;
+ switch (pageOrientation->getIdent()) {
+ case CSSValueLandscape:
+ portrait = false;
+ break;
+ case CSSValuePortrait:
+ portrait = true;
+ break;
+ default:
+ return false;
+ }
+ }
+ switch (ident) {
+ case CSSValueA5:
+ width = a5Width;
+ height = a5Height;
+ break;
+ case CSSValueA4:
+ width = a4Width;
+ height = a4Height;
+ break;
+ case CSSValueA3:
+ width = a3Width;
+ height = a3Height;
+ break;
+ case CSSValueB5:
+ width = b5Width;
+ height = b5Height;
+ break;
+ case CSSValueB4:
+ width = b4Width;
+ height = b4Height;
+ break;
+ case CSSValueLetter:
+ width = letterWidth;
+ height = letterHeight;
+ break;
+ case CSSValueLegal:
+ width = legalWidth;
+ height = legalHeight;
+ break;
+ case CSSValueLedger:
+ width = ledgerWidth;
+ height = ledgerHeight;
+ break;
+ default:
+ return false;
+ }
+ if (!portrait)
+ swap(width, height);
+ return true;
+}
+
+Length CSSStyleSelector::mmLength(double mm)
+{
+ return Length(CSSPrimitiveValue::create(mm, CSSPrimitiveValue::CSS_MM)->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
+}
+
+Length CSSStyleSelector::inchLength(double inch)
+{
+ return Length(CSSPrimitiveValue::create(inch, CSSPrimitiveValue::CSS_IN)->computeLengthIntForLength(style(), m_rootElementStyle), Fixed);
+}
+
void CSSStyleSelector::mapFillAttachment(FillLayer* layer, CSSValue* value)
{
if (value->cssValueType() == CSSValue::CSS_INITIAL) {
diff --git a/WebCore/css/CSSStyleSelector.h b/WebCore/css/CSSStyleSelector.h
index fd37c85..f0de83b 100644
--- a/WebCore/css/CSSStyleSelector.h
+++ b/WebCore/css/CSSStyleSelector.h
@@ -93,6 +93,8 @@ public:
PassRefPtr<RenderStyle> pseudoStyleForElement(PseudoId pseudo, Element* e, RenderStyle* parentStyle = 0, bool matchVisitedPseudoClass = false);
+ PassRefPtr<RenderStyle> styleForPage(int pageIndex);
+
static PassRefPtr<RenderStyle> styleForDocument(Document*);
#if ENABLE(DATAGRID)
@@ -180,6 +182,13 @@ public:
template <bool firstPass>
void applyDeclarations(bool important, int startIndex, int endIndex);
+
+ void matchPageRules(CSSRuleSet*, bool isLeftPage, bool isFirstPage, const String& pageName);
+ void matchPageRulesForList(CSSRuleDataList*, bool isLeftPage, bool isFirstPage, const String& pageName);
+ bool isLeftPage(int pageIndex) const;
+ bool isRightPage(int pageIndex) const { return !isLeftPage(pageIndex); }
+ bool isFirstPage(int pageIndex) const;
+ String pageName(int pageIndex) const;
CSSRuleSet* m_authorStyle;
CSSRuleSet* m_userStyle;
@@ -251,6 +260,10 @@ public:
void mapNinePieceImage(CSSValue*, NinePieceImage&);
void applyProperty(int id, CSSValue*);
+ void applyPageSizeProperty(CSSValue*);
+ bool pageSizeFromName(CSSPrimitiveValue*, CSSPrimitiveValue*, Length& width, Length& height);
+ Length mmLength(double mm);
+ Length inchLength(double inch);
#if ENABLE(SVG)
void applySVGProperty(int id, CSSValue*);
#endif
diff --git a/WebCore/css/CSSStyleSheet.cpp b/WebCore/css/CSSStyleSheet.cpp
index ad63265..40bb0de 100644
--- a/WebCore/css/CSSStyleSheet.cpp
+++ b/WebCore/css/CSSStyleSheet.cpp
@@ -134,10 +134,10 @@ int CSSStyleSheet::addRule(const String& selector, const String& style, Exceptio
return addRule(selector, style, length(), ec);
}
-
PassRefPtr<CSSRuleList> CSSStyleSheet::cssRules(bool omitCharsetRules)
{
- if (doc() && !doc()->securityOrigin()->canRequest(baseURL()))
+ KURL url = finalURL();
+ if (!url.isEmpty() && doc() && !doc()->securityOrigin()->canRequest(url))
return 0;
return CSSRuleList::create(this, omitCharsetRules);
}
@@ -207,7 +207,7 @@ void CSSStyleSheet::checkLoaded()
if (parent())
parent()->checkLoaded();
- // Avoid |this| being deleted by scripts that run via HTMLDocumentParser::executeScriptsWaitingForStylesheets().
+ // Avoid |this| being deleted by scripts that run via LegacyHTMLDocumentParser::executeScriptsWaitingForStylesheets().
// See <rdar://problem/6622300>.
RefPtr<CSSStyleSheet> protector(this);
m_loadCompleted = ownerNode() ? ownerNode()->sheetLoaded() : true;
diff --git a/WebCore/css/CSSStyleSheet.h b/WebCore/css/CSSStyleSheet.h
index bb14e28..4c59144 100644
--- a/WebCore/css/CSSStyleSheet.h
+++ b/WebCore/css/CSSStyleSheet.h
@@ -26,7 +26,7 @@
namespace WebCore {
-class CSSNamespace;
+struct CSSNamespace;
class CSSParser;
class CSSRule;
class DocLoader;
diff --git a/WebCore/css/CSSValueKeywords.in b/WebCore/css/CSSValueKeywords.in
index 154183b..3439878 100644
--- a/WebCore/css/CSSValueKeywords.in
+++ b/WebCore/css/CSSValueKeywords.in
@@ -566,6 +566,7 @@ button
button-bevel
default-button
inner-spin-button
+input-speech-button
list-button
listbox
listitem
@@ -730,3 +731,8 @@ fullscreen
maximized
minimized
windowed
+
+# -webkit-hyphens
+# none
+manual
+# auto
diff --git a/WebCore/css/SVGCSSParser.cpp b/WebCore/css/SVGCSSParser.cpp
index 0d5cde6..535b273 100644
--- a/WebCore/css/SVGCSSParser.cpp
+++ b/WebCore/css/SVGCSSParser.cpp
@@ -1,7 +1,7 @@
/*
Copyright (C) 2008 Eric Seidel <eric@webkit.org>
Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
- 2004, 2005, 2007 Rob Buis <buis@kde.org>
+ 2004, 2005, 2007, 2010 Rob Buis <buis@kde.org>
Copyright (C) 2005, 2006 Apple Computer, Inc.
This library is free software; you can redistribute it and/or
@@ -31,6 +31,7 @@
#include "CSSQuirkPrimitiveValue.h"
#include "CSSValueKeywords.h"
#include "CSSValueList.h"
+#include "RenderTheme.h"
#include "SVGPaint.h"
using namespace std;
@@ -181,6 +182,8 @@ bool CSSParser::parseSVGValue(int propId, bool important)
parsedValue = SVGPaint::create(SVGPaint::SVG_PAINTTYPE_NONE);
else if (id == CSSValueCurrentcolor)
parsedValue = SVGPaint::create(SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR);
+ else if ((id >= CSSValueActiveborder && id <= CSSValueWindowtext) || id == CSSValueMenu)
+ parsedValue = SVGPaint::create(RenderTheme::defaultTheme()->systemColor(id));
else if (value->unit == CSSPrimitiveValue::CSS_URI) {
RGBA32 c = Color::transparent;
if (m_valueList->next() && parseColorFromValue(m_valueList->current(), c)) {
diff --git a/WebCore/css/WebKitCSSMatrix.idl b/WebCore/css/WebKitCSSMatrix.idl
index 9d6c897..fc45ebe 100644
--- a/WebCore/css/WebKitCSSMatrix.idl
+++ b/WebCore/css/WebKitCSSMatrix.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,12 @@
module css {
// Introduced in DOM Level ?:
- interface [CustomConstructor] WebKitCSSMatrix {
+ interface [
+ CanBeConstructed,
+ CustomConstructFunction,
+ ConstructorParameters=1,
+ V8CustomConstructor
+ ] WebKitCSSMatrix {
// These attributes are simple aliases for certain elements of the 4x4 matrix
attribute double a; // alias for m11
diff --git a/WebCore/css/html.css b/WebCore/css/html.css
index b4bb05a..dc27ff8 100644
--- a/WebCore/css/html.css
+++ b/WebCore/css/html.css
@@ -372,6 +372,11 @@ input::-webkit-outer-spin-button {
-webkit-user-select: none;
}
+input::-webkit-input-speech-button {
+ -webkit-appearance: input-speech-button;
+ display: inline-block;
+}
+
textarea {
-webkit-appearance: textarea;
background-color: white;
@@ -531,6 +536,46 @@ meter::-webkit-meter {
-webkit-appearance: meter;
}
+meter::-webkit-meter-horizontal-bar {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc));
+}
+
+meter::-webkit-meter-vertical-bar {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, right top, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc));
+}
+
+meter::-webkit-meter-horizontal-optimum-value {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, left bottom, from(#ad7), to(#ad7), color-stop(0.20, #cea), color-stop(0.45, #7a3), color-stop(0.55, #7a3));
+}
+
+meter::-webkit-meter-horizontal-suboptimal-value {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, left bottom, from(#fe7), to(#fe7), color-stop(0.20, #ffc), color-stop(0.45, #db3), color-stop(0.55, #db3));
+}
+
+meter::-webkit-meter-horizontal-even-less-good-value {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, left bottom, from(#f77), to(#f77), color-stop(0.20, #fcc), color-stop(0.45, #d44), color-stop(0.55, #d44));
+}
+
+meter::-webkit-meter-vertical-optimum-value {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, right top, from(#ad7), to(#ad7), color-stop(0.20, #cea), color-stop(0.45, #7a3), color-stop(0.55, #7a3));
+}
+
+meter::-webkit-meter-vertical-suboptimal-value {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, right top, from(#fe7), to(#fe7), color-stop(0.20, #ffc), color-stop(0.45, #db3), color-stop(0.55, #db3));
+}
+
+meter::-webkit-meter-vertical-even-less-good-value {
+ -webkit-appearance: meter;
+ background: -webkit-gradient(linear, left top, right top, from(#f77), to(#f77), color-stop(0.20, #fcc), color-stop(0.45, #d44), color-stop(0.55, #d44));
+}
+
/* progress */
progress {
@@ -683,4 +728,12 @@ iframe {
border: 2px inset
}
+/* page */
+
+@page {
+ /* FIXME: Define the right default values for page properties. */
+ size: auto;
+ margin: 1in;
+}
+
/* noscript is handled internally, as it depends on settings */
diff --git a/WebCore/css/mathml.css b/WebCore/css/mathml.css
index 5c9038a..7a9b348 100644
--- a/WebCore/css/mathml.css
+++ b/WebCore/css/mathml.css
@@ -7,15 +7,20 @@ math {
margin: 0px;
vertical-align: baseline;
line-height: 1.0;
+ padding-left: 1px;
+ padding-right: 1px;
}
math[display="block"] {
display: block;
- text-align: center;
page-break-inside: avoid;
margin-bottom: 1em;
}
+math * {
+ text-align: left;
+}
+
math > * {
vertical-align: baseline;
}
@@ -23,12 +28,8 @@ math > * {
mrow, mfenced {
display: inline-block;
white-space: nowrap;
- vertical-align: middle;
-}
-
-mrow > mo, mfenced > mo, math > mo
-{
- vertical-align: middle;
+ padding-left: 1px;
+ padding-right: 1px;
}
mi, mtext {
@@ -42,7 +43,6 @@ mi + mrow {
mfrac {
display: inline-block;
- vertical-align: middle;
}
msub, msup {
@@ -83,10 +83,6 @@ munderover > * + *, mover > * + *, munder > * + * {
font-size: 0.75em;
}
-mover > mi {
- text-align: center;
-}
-
mo, mn, mi, mtext {
padding: 0px;
margin: 0px;
@@ -96,7 +92,7 @@ mo {
display: inline-block;
}
-mo {
+math > mo, mrow > mo, mfenced > mo {
padding-left: 0.05em;
padding-right: 0.05em;
}
@@ -154,7 +150,7 @@ mroot > * + mrow, mroot > * + mfenced {
mtable {
display: inline-table;
text-align: center;
- vertical-align: middle;
+ vertical-align: -40%;
}
mtr {
display: table-row;
diff --git a/WebCore/dom/DOMImplementation.cpp b/WebCore/dom/DOMImplementation.cpp
index 4b7a743..3483b23 100644
--- a/WebCore/dom/DOMImplementation.cpp
+++ b/WebCore/dom/DOMImplementation.cpp
@@ -227,18 +227,18 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceUR
RefPtr<Document> doc;
#if ENABLE(SVG)
if (namespaceURI == SVGNames::svgNamespaceURI)
- doc = SVGDocument::create(0);
+ doc = SVGDocument::create(0, KURL());
else
#endif
#if ENABLE(WML)
if (namespaceURI == WMLNames::wmlNamespaceURI)
- doc = WMLDocument::create(0);
+ doc = WMLDocument::create(0, KURL());
else
#endif
if (namespaceURI == HTMLNames::xhtmlNamespaceURI)
- doc = Document::createXHTML(0);
+ doc = Document::createXHTML(0, KURL());
else
- doc = Document::create(0);
+ doc = Document::create(0, KURL());
RefPtr<Node> documentElement;
if (!qualifiedName.isEmpty()) {
@@ -295,63 +295,63 @@ bool DOMImplementation::isTextMIMEType(const String& mimeType)
PassRefPtr<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title)
{
- RefPtr<HTMLDocument> d = HTMLDocument::create(0);
+ RefPtr<HTMLDocument> d = HTMLDocument::create(0, KURL());
d->open();
d->write("<!doctype html><html><body></body></html>");
d->setTitle(title);
return d.release();
}
-PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame* frame, bool inViewSourceMode)
+PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame* frame, const KURL& url, bool inViewSourceMode)
{
if (inViewSourceMode)
- return HTMLViewSourceDocument::create(frame, type);
+ return HTMLViewSourceDocument::create(frame, url, type);
// Plugins cannot take HTML and XHTML from us, and we don't even need to initialize the plugin database for those.
if (type == "text/html")
- return HTMLDocument::create(frame);
+ return HTMLDocument::create(frame, url);
if (type == "application/xhtml+xml"
#if ENABLE(XHTMLMP)
|| type == "application/vnd.wap.xhtml+xml"
#endif
)
- return Document::createXHTML(frame);
+ return Document::createXHTML(frame, url);
#if ENABLE(WML)
if (type == "text/vnd.wap.wml" || type == "application/vnd.wap.wmlc")
- return WMLDocument::create(frame);
+ return WMLDocument::create(frame, url);
#endif
#if ENABLE(FTPDIR)
// Plugins cannot take FTP from us either
if (type == "application/x-ftp-directory")
- return FTPDirectoryDocument::create(frame);
+ return FTPDirectoryDocument::create(frame, url);
#endif
PluginData* pluginData = 0;
- if (frame && frame->page() && frame->loader()->allowPlugins(NotAboutToInstantiatePlugin))
+ if (frame && frame->page() && frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin))
pluginData = frame->page()->pluginData();
// PDF is one image type for which a plugin can override built-in support.
// We do not want QuickTime to take over all image types, obviously.
if ((type == "application/pdf" || type == "text/pdf") && pluginData && pluginData->supportsMimeType(type))
- return PluginDocument::create(frame);
+ return PluginDocument::create(frame, url);
if (Image::supportsType(type))
- return ImageDocument::create(frame);
+ return ImageDocument::create(frame, url);
#if ENABLE(VIDEO)
// Check to see if the type can be played by our MediaPlayer, if so create a MediaDocument
if (MediaPlayer::supportsType(ContentType(type)))
- return MediaDocument::create(frame);
+ return MediaDocument::create(frame, url);
#endif
// Everything else except text/plain can be overridden by plugins. In particular, Adobe SVG Viewer should be used for SVG, if installed.
// Disallowing plug-ins to use text/plain prevents plug-ins from hijacking a fundamental type that the browser is expected to handle,
// and also serves as an optimization to prevent loading the plug-in database in the common case.
if (type != "text/plain" && pluginData && pluginData->supportsMimeType(type))
- return PluginDocument::create(frame);
+ return PluginDocument::create(frame, url);
if (isTextMIMEType(type))
- return TextDocument::create(frame);
+ return TextDocument::create(frame, url);
#if ENABLE(SVG)
if (type == "image/svg+xml") {
@@ -359,13 +359,13 @@ PassRefPtr<Document> DOMImplementation::createDocument(const String& type, Frame
Settings* settings = frame ? frame->settings() : 0;
if (!settings || !settings->usesDashboardBackwardCompatibilityMode())
#endif
- return SVGDocument::create(frame);
+ return SVGDocument::create(frame, url);
}
#endif
if (isXMLMIMEType(type))
- return Document::create(frame);
+ return Document::create(frame, url);
- return HTMLDocument::create(frame);
+ return HTMLDocument::create(frame, url);
}
}
diff --git a/WebCore/dom/DOMImplementation.h b/WebCore/dom/DOMImplementation.h
index b776d22..c3d5658 100644
--- a/WebCore/dom/DOMImplementation.h
+++ b/WebCore/dom/DOMImplementation.h
@@ -34,6 +34,7 @@ class Document;
class DocumentType;
class Frame;
class HTMLDocument;
+class KURL;
class String;
typedef int ExceptionCode;
@@ -56,7 +57,7 @@ public:
static PassRefPtr<HTMLDocument> createHTMLDocument(const String& title);
// Other methods (not part of DOM)
- static PassRefPtr<Document> createDocument(const String& MIMEType, Frame*, bool inViewSourceMode);
+ static PassRefPtr<Document> createDocument(const String& MIMEType, Frame*, const KURL&, bool inViewSourceMode);
static bool isXMLMIMEType(const String& MIMEType);
static bool isTextMIMEType(const String& MIMEType);
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index c41b87e..c9a2182 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -76,10 +76,10 @@
#include "HTMLMapElement.h"
#include "HTMLNameCollection.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "HTMLStyleElement.h"
#include "HTMLTitleElement.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
#include "HTTPParsers.h"
#include "HistoryItem.h"
#include "HitTestRequest.h"
@@ -372,7 +372,7 @@ private:
Document* m_document;
};
-Document::Document(Frame* frame, bool isXHTML, bool isHTML)
+Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML)
: ContainerNode(0)
, m_domtree_version(0)
, m_styleSheets(StyleSheetList::create(this))
@@ -431,7 +431,13 @@ Document::Document(Frame* frame, bool isXHTML, bool isHTML)
m_frame = frame;
+<<<<<<< HEAD
#if !PLATFORM(ANDROID)
+=======
+ if (frame || !url.isEmpty())
+ setURL(url);
+
+>>>>>>> webkit.org at r61871
m_axObjectCache = 0;
#endif
@@ -1534,6 +1540,43 @@ PassRefPtr<RenderStyle> Document::styleForElementIgnoringPendingStylesheets(Elem
return style.release();
}
+PassRefPtr<RenderStyle> Document::styleForPage(int pageIndex)
+{
+ RefPtr<RenderStyle> style = styleSelector()->styleForPage(pageIndex);
+ return style.release();
+}
+
+bool Document::isPageBoxVisible(int pageIndex)
+{
+ RefPtr<RenderStyle> style = styleForPage(pageIndex);
+ return style->visibility() != HIDDEN; // display property doesn't apply to @page.
+}
+
+IntRect Document::pageAreaRectInPixels(int pageIndex)
+{
+ RefPtr<RenderStyle> style = styleForPage(pageIndex);
+ IntSize pageSize = preferredPageSizeInPixels(pageIndex);
+ // 100% value for margin-{left,right,top,bottom}. This is used also for top and bottom. http://www.w3.org/TR/CSS2/box.html#value-def-margin-width
+ int maxValue = pageSize.width();
+ int surroundLeft = style->marginLeft().calcValue(maxValue) + style->borderLeft().width() + style->paddingLeft().calcValue(maxValue);
+ int surroundRight = style->marginRight().calcValue(maxValue) + style->borderRight().width() + style->paddingRight().calcValue(maxValue);
+ int surroundTop = style->marginTop().calcValue(maxValue) + style->borderTop().width() + style->paddingTop().calcValue(maxValue);
+ int surroundBottom = style->marginBottom().calcValue(maxValue) + style->borderBottom().width() + style->paddingBottom().calcValue(maxValue);
+ int width = pageSize.width() - surroundLeft - surroundRight;
+ int height = pageSize.height() - surroundTop - surroundBottom;
+
+ return IntRect(surroundLeft, surroundTop, width, height);
+}
+
+IntSize Document::preferredPageSizeInPixels(int pageIndex)
+{
+ RefPtr<RenderStyle> style = styleForPage(pageIndex);
+ LengthSize size = style->pageSize();
+ ASSERT(size.width().isFixed());
+ ASSERT(size.height().isFixed());
+ return IntSize(size.width().calcValue(0), size.height().calcValue(0));
+}
+
void Document::createStyleSelector()
{
bool matchAuthorAndUserStyles = true;
@@ -1723,7 +1766,7 @@ void Document::open(Document* ownerDocument)
}
if (m_frame) {
- if (m_frame->loader()->isLoadingMainResource() || (parser() && parser()->executingScript()))
+ if (m_frame->loader()->isLoadingMainResource() || (parser() && parser()->isExecutingScript()))
return;
if (m_frame->loader()->state() == FrameStateProvisional)
@@ -2000,12 +2043,16 @@ void Document::write(const SegmentedString& text, Document* ownerDocument)
printf("Beginning a document.write at %d\n", elapsedTime());
#endif
- if (!m_parser)
+ if (!m_parser || m_parser->finishWasCalled())
open(ownerDocument);
ASSERT(m_parser);
+ // FIXME: forceSynchronous should always be the same as the bool passed to
+ // write(). However LegacyHTMLDocumentParser uses write("", false) to pump
+ // the parser (after running external scripts, etc.) thus necessitating a
+ // separate state for forceSynchronous.
bool wasForcedSynchronous = false;
- HTMLDocumentParser* parser = m_parser->asHTMLDocumentParser();
+ LegacyHTMLDocumentParser* parser = m_parser->asHTMLDocumentParser();
if (parser) {
wasForcedSynchronous = parser->forceSynchronous();
parser->setForceSynchronous(true);
@@ -4630,9 +4677,8 @@ void Document::initSecurityContext()
// In the common case, create the security context from the currently
// loading URL.
- const KURL& url = m_frame->loader()->url();
- m_cookieURL = url;
- ScriptExecutionContext::setSecurityOrigin(SecurityOrigin::create(url, m_frame->loader()->sandboxFlags()));
+ m_cookieURL = m_url;
+ ScriptExecutionContext::setSecurityOrigin(SecurityOrigin::create(m_url, m_frame->loader()->sandboxFlags()));
if (SecurityOrigin::allowSubstituteDataAccessToLocal()) {
// If this document was loaded with substituteData, then the document can
@@ -4790,6 +4836,17 @@ void Document::executeScriptSoon(ScriptElementData* data, CachedResourceHandle<C
m_executeScriptSoonTimer.startOneShot(0);
}
+void Document::suspendExecuteScriptSoonTimer()
+{
+ m_executeScriptSoonTimer.stop();
+}
+
+void Document::resumeExecuteScriptSoonTimer()
+{
+ if (!m_scriptsToExecuteSoon.isEmpty())
+ m_executeScriptSoonTimer.startOneShot(0);
+}
+
// FF method for accessing the selection added for compatibility.
DOMSelection* Document::getSelection() const
{
diff --git a/WebCore/dom/Document.h b/WebCore/dom/Document.h
index 0e86df4..dc4b6ba 100644
--- a/WebCore/dom/Document.h
+++ b/WebCore/dom/Document.h
@@ -185,13 +185,13 @@ enum PageshowEventPersistence {
class Document : public ContainerNode, public ScriptExecutionContext {
public:
- static PassRefPtr<Document> create(Frame* frame)
+ static PassRefPtr<Document> create(Frame* frame, const KURL& url)
{
- return adoptRef(new Document(frame, false, false));
+ return adoptRef(new Document(frame, url, false, false));
}
- static PassRefPtr<Document> createXHTML(Frame* frame)
+ static PassRefPtr<Document> createXHTML(Frame* frame, const KURL& url)
{
- return adoptRef(new Document(frame, true, false));
+ return adoptRef(new Document(frame, url, true, false));
}
virtual ~Document();
@@ -482,6 +482,10 @@ public:
void updateLayout();
void updateLayoutIgnorePendingStylesheets();
PassRefPtr<RenderStyle> styleForElementIgnoringPendingStylesheets(Element*);
+ PassRefPtr<RenderStyle> styleForPage(int pageIndex);
+ bool isPageBoxVisible(int pageIndex);
+ IntRect pageAreaRectInPixels(int pageIndex);
+ IntSize preferredPageSizeInPixels(int pageIndex);
static void updateStyleForAllDocuments(); // FIXME: Try to reduce the # of calls to this function.
DocLoader* docLoader() { return m_docLoader.get(); }
@@ -823,6 +827,9 @@ public:
void executeScriptSoon(ScriptElementData*, CachedResourceHandle<CachedScript>);
+ void suspendExecuteScriptSoonTimer();
+ void resumeExecuteScriptSoonTimer();
+
#if ENABLE(XSLT)
void applyXSLTransform(ProcessingInstruction* pi);
PassRefPtr<Document> transformSourceDocument() { return m_transformSourceDocument; }
@@ -992,7 +999,7 @@ public:
const QualifiedName& idAttributeName() const { return m_idAttributeName; }
protected:
- Document(Frame*, bool isXHTML, bool isHTML);
+ Document(Frame*, const KURL&, bool isXHTML, bool isHTML);
void clearXMLVersion() { m_xmlVersion = String(); }
diff --git a/WebCore/dom/DocumentFragment.cpp b/WebCore/dom/DocumentFragment.cpp
index f7df8f6..7287439 100644
--- a/WebCore/dom/DocumentFragment.cpp
+++ b/WebCore/dom/DocumentFragment.cpp
@@ -24,12 +24,18 @@
#include "DocumentFragment.h"
#include "Document.h"
+#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
+#include "Page.h"
+#include "Settings.h"
+#include "XMLDocumentParser.h"
namespace WebCore {
inline DocumentFragment::DocumentFragment(Document* document)
: ContainerNode(document)
{
+ ASSERT(document);
}
PassRefPtr<DocumentFragment> DocumentFragment::create(Document* document)
@@ -70,4 +76,22 @@ PassRefPtr<Node> DocumentFragment::cloneNode(bool deep)
return clone.release();
}
+bool DocumentFragment::shouldUseLegacyHTMLParser() const
+{
+ return document()->page() && document()->page()->settings()
+ && !document()->page()->settings()->html5ParserEnabled();
+}
+
+void DocumentFragment::parseHTML(const String& source, FragmentScriptingPermission scriptingPermission)
+{
+ if (shouldUseLegacyHTMLParser())
+ return LegacyHTMLDocumentParser::parseDocumentFragment(source, this, scriptingPermission);
+ HTMLDocumentParser::parseDocumentFragment(source, this, scriptingPermission);
+}
+
+bool DocumentFragment::parseXML(const String& source, Element* parent, FragmentScriptingPermission scriptingPermission)
+{
+ return parseXMLDocumentFragment(source, this, parent, scriptingPermission);
+}
+
}
diff --git a/WebCore/dom/DocumentFragment.h b/WebCore/dom/DocumentFragment.h
index e624ee4..5eff17f 100644
--- a/WebCore/dom/DocumentFragment.h
+++ b/WebCore/dom/DocumentFragment.h
@@ -25,6 +25,7 @@
#define DocumentFragment_h
#include "ContainerNode.h"
+#include "FragmentScriptingPermission.h"
namespace WebCore {
@@ -32,9 +33,14 @@ class DocumentFragment : public ContainerNode {
public:
static PassRefPtr<DocumentFragment> create(Document*);
+ void parseHTML(const String&, FragmentScriptingPermission = FragmentScriptingAllowed);
+ bool parseXML(const String&, Element* parent, FragmentScriptingPermission = FragmentScriptingAllowed);
+
private:
DocumentFragment(Document*);
+ bool shouldUseLegacyHTMLParser() const;
+
virtual String nodeName() const;
virtual NodeType nodeType() const;
virtual PassRefPtr<Node> cloneNode(bool deep);
diff --git a/WebCore/dom/DocumentParser.h b/WebCore/dom/DocumentParser.h
index c7eea06..881136c 100644
--- a/WebCore/dom/DocumentParser.h
+++ b/WebCore/dom/DocumentParser.h
@@ -2,6 +2,7 @@
* Copyright (C) 2000 Peter Kelly (pmk@post.com)
* Copyright (C) 2005, 2006 Apple Computer, Inc.
* Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
+ * Copyright (C) 2010 Google, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -23,64 +24,84 @@
#ifndef DocumentParser_h
#define DocumentParser_h
+#include <wtf/Assertions.h>
+
namespace WebCore {
- class LegacyHTMLTreeConstructor;
- class HTMLDocumentParser;
- class SegmentedString;
- class XSSAuditor;
-
- class DocumentParser : public Noncopyable {
- public:
- virtual ~DocumentParser() { }
-
- // Script output must be prepended, while new data
- // received during executing a script must be appended, hence the
- // extra bool to be able to distinguish between both cases.
- // document.write() always uses false, while the loader uses true.
- virtual void write(const SegmentedString&, bool appendData) = 0;
- virtual void finish() = 0;
- virtual bool isWaitingForScripts() const = 0;
- virtual void stopParsing() { m_parserStopped = true; }
- virtual bool processingData() const { return false; }
- virtual int executingScript() const { return 0; }
-
- virtual bool wantsRawData() const { return false; }
- virtual bool writeRawData(const char* /*data*/, int /*length*/) { return false; }
-
- bool inViewSourceMode() const { return m_inViewSourceMode; }
- void setInViewSourceMode(bool mode) { m_inViewSourceMode = mode; }
-
- virtual bool wellFormed() const { return true; }
-
- virtual int lineNumber() const { return -1; }
- virtual int columnNumber() const { return -1; }
-
- virtual void executeScriptsWaitingForStylesheets() {}
-
- virtual LegacyHTMLTreeConstructor* htmlTreeConstructor() const { return 0; }
- virtual HTMLDocumentParser* asHTMLDocumentParser() { return 0; }
-
- XSSAuditor* xssAuditor() const { return m_XSSAuditor; }
- void setXSSAuditor(XSSAuditor* auditor) { m_XSSAuditor = auditor; }
-
- protected:
- DocumentParser(bool viewSourceMode = false)
- : m_parserStopped(false)
- , m_inViewSourceMode(viewSourceMode)
- , m_XSSAuditor(0)
- {
- }
-
- // The parser has buffers, so parsing may continue even after
- // it stops receiving data. We use m_parserStopped to stop the parser
- // even when it has buffered data.
- bool m_parserStopped;
- bool m_inViewSourceMode;
-
- // The XSSAuditor associated with this document parser.
- XSSAuditor* m_XSSAuditor;
- };
+class Document;
+class LegacyHTMLTreeBuilder;
+class LegacyHTMLDocumentParser;
+class SegmentedString;
+class XSSAuditor;
+
+class DocumentParser : public Noncopyable {
+public:
+ virtual ~DocumentParser() { }
+
+ // Script output must be prepended, while new data
+ // received during executing a script must be appended, hence the
+ // extra bool to be able to distinguish between both cases.
+ // document.write() always uses false, while the loader uses true.
+ virtual void write(const SegmentedString&, bool isFromNetwork) = 0;
+ virtual void finish() = 0;
+ virtual bool finishWasCalled() = 0;
+ virtual bool isWaitingForScripts() const = 0;
+ virtual bool isExecutingScript() const { return false; }
+
+ virtual void stopParsing() { m_parserStopped = true; }
+ // FIXME: processingData() is only used by DocumentLoader::isLoadingInAPISense
+ // and is very unclear as to what it actually means. Only LegacyHTMLDocumentParser
+ // actually implements it.
+ virtual bool processingData() const { return false; }
+
+ virtual bool wantsRawData() const { return false; }
+ virtual bool writeRawData(const char* /*data*/, int /*length*/)
+ {
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+
+ virtual bool wellFormed() const { return true; }
+
+ virtual int lineNumber() const { return -1; }
+ virtual int columnNumber() const { return -1; }
+
+ virtual void executeScriptsWaitingForStylesheets() {}
+
+ virtual LegacyHTMLTreeBuilder* htmlTreeBuilder() const { return 0; }
+ virtual LegacyHTMLDocumentParser* asHTMLDocumentParser() { return 0; }
+
+ // FIXME: view source mode is only used by the HTML and Text
+ // DocumentParsers and may not belong on the base-class.
+ bool inViewSourceMode() const { return m_inViewSourceMode; }
+ void setInViewSourceMode(bool mode) { m_inViewSourceMode = mode; }
+
+ Document* document() const { return m_document; }
+
+ XSSAuditor* xssAuditor() const { return m_XSSAuditor; }
+ void setXSSAuditor(XSSAuditor* auditor) { m_XSSAuditor = auditor; }
+
+protected:
+ DocumentParser(Document* document, bool viewSourceMode = false)
+ : m_parserStopped(false)
+ , m_inViewSourceMode(viewSourceMode)
+ , m_document(document)
+ , m_XSSAuditor(0)
+ {
+ ASSERT(document);
+ }
+
+ // The parser has buffers, so parsing may continue even after
+ // it stops receiving data. We use m_parserStopped to stop the parser
+ // even when it has buffered data.
+ bool m_parserStopped;
+ bool m_inViewSourceMode;
+
+ // Every DocumentParser needs a pointer back to the document.
+ Document* m_document;
+ // The XSSAuditor associated with this document parser.
+ XSSAuditor* m_XSSAuditor;
+};
} // namespace WebCore
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index c1c798b..adbb720 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -4,7 +4,7 @@
* (C) 2001 Peter Kelly (pmk@post.com)
* (C) 2001 Dirk Mueller (mueller@kde.org)
* (C) 2007 David Smith (catfish.man@gmail.com)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* (C) 2007 Eric Seidel (eric@webkit.org)
*
* This library is free software; you can redistribute it and/or
@@ -42,7 +42,6 @@
#include "FrameView.h"
#include "HTMLElement.h"
#include "HTMLNames.h"
-#include "HTMLDocumentParser.h"
#include "InspectorController.h"
#include "NodeList.h"
#include "NodeRenderStyle.h"
@@ -52,7 +51,6 @@
#include "RenderWidget.h"
#include "TextIterator.h"
#include "XMLNames.h"
-#include "XMLDocumentParser.h"
#include <wtf/text/CString.h>
#if ENABLE(SVG)
@@ -93,12 +91,12 @@ NodeRareData* Element::createRareData()
PassRefPtr<DocumentFragment> Element::createContextualFragment(const String& markup, FragmentScriptingPermission scriptingPermission)
{
- RefPtr<DocumentFragment> fragment = DocumentFragment::create(document());
-
+ RefPtr<DocumentFragment> fragment = document()->createDocumentFragment();
+
if (document()->isHTMLDocument())
- parseHTMLDocumentFragment(markup, fragment.get(), scriptingPermission);
+ fragment->parseHTML(markup, scriptingPermission);
else {
- if (!parseXMLDocumentFragment(markup, fragment.get(), this, scriptingPermission))
+ if (!fragment->parseXML(markup, this, scriptingPermission))
// FIXME: We should propagate a syntax error exception out here.
return 0;
}
@@ -189,7 +187,7 @@ void Element::setCStringAttribute(const QualifiedName& name, const char* cString
void Element::setBooleanAttribute(const QualifiedName& name, bool b)
{
if (b)
- setAttribute(name, name.localName());
+ setAttribute(name, emptyAtom);
else {
ExceptionCode ex;
removeAttribute(name, ex);
@@ -639,6 +637,8 @@ void Element::updateAfterAttributeChanged(Attribute* attr)
document()->axObjectCache()->contentChanged(renderer());
} else if (attrName == aria_selectedAttr)
document()->axObjectCache()->selectedChildrenChanged(renderer());
+ else if (attrName == aria_expandedAttr)
+ document()->axObjectCache()->handleAriaExpandedChange(renderer());
}
void Element::recalcStyleIfNeededAfterAttributeChanged(Attribute* attr)
@@ -1098,7 +1098,7 @@ void Element::dispatchAttrRemovalEvent(Attribute*)
if (!document()->hasListenerType(Document::DOMATTRMODIFIED_LISTENER))
return;
ExceptionCode ec = 0;
- dispatchEvent(new MutationEvent(DOMAttrModifiedEvent, true, false, attr, attr->value(),
+ dispatchEvent(MutationEvent::create(DOMAttrModifiedEvent, true, attr, attr->value(),
attr->value(), document()->attrName(attr->id()), MutationEvent::REMOVAL), ec);
#endif
}
@@ -1111,7 +1111,7 @@ void Element::dispatchAttrAdditionEvent(Attribute*)
if (!document()->hasListenerType(Document::DOMATTRMODIFIED_LISTENER))
return;
ExceptionCode ec = 0;
- dispatchEvent(new MutationEvent(DOMAttrModifiedEvent, true, false, attr, attr->value(),
+ dispatchEvent(MutationEvent::create(DOMAttrModifiedEvent, true, attr, attr->value(),
attr->value(), document()->attrName(attr->id()), MutationEvent::ADDITION), ec);
#endif
}
@@ -1531,4 +1531,39 @@ KURL Element::getURLAttribute(const QualifiedName& name) const
return document()->completeURL(deprecatedParseURL(getAttribute(name)));
}
+int Element::getIntegralAttribute(const QualifiedName& attributeName) const
+{
+ return getAttribute(attributeName).string().toInt();
+}
+
+void Element::setIntegralAttribute(const QualifiedName& attributeName, int value)
+{
+ // FIXME: Need an AtomicString version of String::number.
+ ExceptionCode ec;
+ setAttribute(attributeName, String::number(value), ec);
+}
+
+unsigned Element::getUnsignedIntegralAttribute(const QualifiedName& attributeName) const
+{
+ return getAttribute(attributeName).string().toUInt();
+}
+
+void Element::setUnsignedIntegralAttribute(const QualifiedName& attributeName, unsigned value)
+{
+ // FIXME: Need an AtomicString version of String::number.
+ ExceptionCode ec;
+ setAttribute(attributeName, String::number(value), ec);
+}
+
+#if ENABLE(SVG)
+bool Element::childShouldCreateRenderer(Node* child) const
+{
+ // Only create renderers for SVG elements whose parents are SVG elements, or for proper <svg xmlns="svgNS"> subdocuments.
+ if (child->isSVGElement())
+ return child->hasTagName(SVGNames::svgTag) || isSVGElement();
+
+ return Node::childShouldCreateRenderer(child);
+}
+#endif
+
} // namespace WebCore
diff --git a/WebCore/dom/Element.h b/WebCore/dom/Element.h
index c6eebcb..a0cf7b1 100644
--- a/WebCore/dom/Element.h
+++ b/WebCore/dom/Element.h
@@ -26,7 +26,7 @@
#define Element_h
#include "Document.h"
-#include "MappedAttributeEntry.h"
+#include "FragmentScriptingPermission.h"
#include "NamedNodeMap.h"
#include "ScrollTypes.h"
@@ -101,6 +101,12 @@ public:
void setAttribute(const QualifiedName&, const AtomicString& value, ExceptionCode&);
void removeAttribute(const QualifiedName&, ExceptionCode&);
+ // Typed getters and setters for language bindings.
+ int getIntegralAttribute(const QualifiedName& attributeName) const;
+ void setIntegralAttribute(const QualifiedName& attributeName, int value);
+ unsigned getUnsignedIntegralAttribute(const QualifiedName& attributeName) const;
+ void setUnsignedIntegralAttribute(const QualifiedName& attributeName, unsigned value);
+
// Call this to get the value of an attribute that is known not to be the style
// attribute or one of the SVG animatable attributes.
bool fastHasAttribute(const QualifiedName&) const;
@@ -279,6 +285,10 @@ public:
virtual void dispatchFormControlChangeEvent() { }
+#if ENABLE(SVG)
+ virtual bool childShouldCreateRenderer(Node*) const;
+#endif
+
protected:
Element(const QualifiedName& tagName, Document* document, ConstructionType type)
: ContainerNode(document, type)
diff --git a/WebCore/dom/ExceptionCode.cpp b/WebCore/dom/ExceptionCode.cpp
index 7bb8a50..9303f9e 100644
--- a/WebCore/dom/ExceptionCode.cpp
+++ b/WebCore/dom/ExceptionCode.cpp
@@ -38,6 +38,10 @@
#include "XPathException.h"
#endif
+#if ENABLE(DATABASE)
+#include "SQLException.h"
+#endif
+
namespace WebCore {
static const char* const exceptionNames[] = {
@@ -145,6 +149,30 @@ static const char* const svgExceptionDescriptions[] = {
};
#endif
+#if ENABLE(DATABASE)
+static const char* const sqlExceptionNames[] = {
+ "UNKNOWN_ERR",
+ "DATABASE_ERR",
+ "VERSION_ERR",
+ "TOO_LARGE_ERR",
+ "QUOTA_ERR",
+ "SYNTAX_ERR",
+ "CONSTRAINT_ERR",
+ "TIMEOUT_ERR"
+};
+
+static const char* const sqlExceptionDescriptions[] = {
+ "The operation failed for reasons unrelated to the database.",
+ "The operation failed for some reason related to the database.",
+ "The actual database version did not match the expected version.",
+ "Data returned from the database is too large.",
+ "Quota was exceeded.",
+ "Invalid or unauthorized statement; or the number of arguments did not match the number of ? placeholders.",
+ "A constraint was violated.",
+ "A transaction lock could not be acquired in a reasonable time."
+};
+#endif
+
void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& description)
{
ASSERT(ec);
@@ -156,7 +184,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
int nameTableSize;
int nameTableOffset;
ExceptionType type;
-
+
if (code >= RangeException::RangeExceptionOffset && code <= RangeException::RangeExceptionMax) {
type = RangeExceptionType;
typeName = "DOM Range";
@@ -203,6 +231,16 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
nameTableSize = sizeof(svgExceptionNames) / sizeof(svgExceptionNames[0]);
nameTableOffset = SVGException::SVG_WRONG_TYPE_ERR;
#endif
+#if ENABLE(DATABASE)
+ } else if (code >= SQLException::SQLExceptionOffset && code <= SQLException::SQLExceptionMax) {
+ type = SQLExceptionType;
+ typeName = "DOM SQL";
+ code -= SQLException::SQLExceptionOffset;
+ nameTable = sqlExceptionNames;
+ descriptionTable = sqlExceptionDescriptions;
+ nameTableSize = sizeof(sqlExceptionNames) / sizeof(sqlExceptionNames[0]);
+ nameTableOffset = SQLException::UNKNOWN_ERR;
+#endif
} else {
type = DOMExceptionType;
typeName = "DOM";
diff --git a/WebCore/dom/ExceptionCode.h b/WebCore/dom/ExceptionCode.h
index a5618f8..ef73052 100644
--- a/WebCore/dom/ExceptionCode.h
+++ b/WebCore/dom/ExceptionCode.h
@@ -78,8 +78,11 @@ namespace WebCore {
#if ENABLE(SVG)
, SVGExceptionType
#endif
- };
-
+#if ENABLE(DATABASE)
+ , SQLExceptionType
+#endif
+ };
+
struct ExceptionCodeDescription {
const char* typeName; // has spaces and is suitable for use in exception description strings; maximum length is 10 characters
diff --git a/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.h b/WebCore/dom/FragmentScriptingPermission.h
index 65b9050..6371011 100644
--- a/WebCore/bindings/js/JSWebKitCSSMatrixConstructor.h
+++ b/WebCore/dom/FragmentScriptingPermission.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -20,27 +20,21 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (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 JSWebKitCSSMatrixConstructor_h
-#define JSWebKitCSSMatrixConstructor_h
-
-#include "JSDOMBinding.h"
-#include "JSDocument.h"
+#ifndef FragmentScriptingPermission_h
+#define FragmentScriptingPermission_h
namespace WebCore {
-class JSWebKitCSSMatrixConstructor : public DOMConstructorObject {
-public:
- JSWebKitCSSMatrixConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static const JSC::ClassInfo s_info;
-
-private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+// FIXME: This enum is poorly named. It is used to remove script contents when
+// generating DocumentFragments for paste in platform/*/Pasteboard.*.
+enum FragmentScriptingPermission {
+ FragmentScriptingAllowed,
+ FragmentScriptingNotAllowed,
};
-}
+};
-#endif // JSWebKitCSSMatrixConstructor_h
+#endif // FragmentScriptingPermission_h
diff --git a/WebCore/dom/InputElement.h b/WebCore/dom/InputElement.h
index d477046..1d6c356 100644
--- a/WebCore/dom/InputElement.h
+++ b/WebCore/dom/InputElement.h
@@ -44,6 +44,9 @@ public:
virtual bool isSearchField() const = 0;
virtual bool isTextField() const = 0;
virtual bool hasSpinButton() const { return false; }
+#if ENABLE(INPUT_SPEECH)
+ virtual bool isSpeechEnabled() const = 0;
+#endif
virtual bool searchEventsShouldBeDispatched() const = 0;
diff --git a/WebCore/dom/MappedAttributeEntry.h b/WebCore/dom/MappedAttributeEntry.h
index ce2464e..f28f182 100644
--- a/WebCore/dom/MappedAttributeEntry.h
+++ b/WebCore/dom/MappedAttributeEntry.h
@@ -48,8 +48,6 @@ enum MappedAttributeEntry {
, eLastEntry
};
-enum FragmentScriptingPermission { FragmentScriptingAllowed, FragmentScriptingNotAllowed };
-
}
#endif
diff --git a/WebCore/dom/MessageChannel.idl b/WebCore/dom/MessageChannel.idl
index bae5b18..a3f3c94 100644
--- a/WebCore/dom/MessageChannel.idl
+++ b/WebCore/dom/MessageChannel.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,7 +26,13 @@
module events {
- interface [CustomConstructor, CustomMarkFunction, NoStaticTables] MessageChannel {
+ interface [
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
+ CustomMarkFunction,
+ NoStaticTables
+ ] MessageChannel {
readonly attribute MessagePort port1;
readonly attribute MessagePort port2;
diff --git a/WebCore/dom/Node.cpp b/WebCore/dom/Node.cpp
index 840b967..4b25d9a 100644
--- a/WebCore/dom/Node.cpp
+++ b/WebCore/dom/Node.cpp
@@ -681,6 +681,21 @@ IntRect Node::getRect() const
return renderer()->absoluteBoundingBoxRect();
return IntRect();
}
+
+IntRect Node::renderRect(bool* isReplaced)
+{
+ RenderObject* hitRenderer = this->renderer();
+ ASSERT(hitRenderer);
+ RenderObject* renderer = hitRenderer;
+ while (renderer && !renderer->isBody() && !renderer->isRoot()) {
+ if (renderer->isRenderBlock() || renderer->isInlineBlockOrInlineTable() || renderer->isReplaced()) {
+ *isReplaced = renderer->isReplaced();
+ return renderer->absoluteBoundingBoxRect(true);
+ }
+ renderer = renderer->parent();
+ }
+ return IntRect();
+}
bool Node::hasNonEmptyBoundingBox() const
{
diff --git a/WebCore/dom/Node.h b/WebCore/dom/Node.h
index 8bf89cc..6e99cd7 100644
--- a/WebCore/dom/Node.h
+++ b/WebCore/dom/Node.h
@@ -332,6 +332,7 @@ public:
virtual bool isContentRichlyEditable() const;
virtual bool shouldUseInputMethod() const;
virtual IntRect getRect() const;
+ IntRect renderRect(bool* isReplaced);
// Returns true if the node has a non-empty bounding box in layout.
// This does not 100% guarantee the user can see it, but is pretty close.
@@ -666,7 +667,7 @@ private:
void clearFlag(NodeFlags mask) const { m_nodeFlags &= ~mask; }
protected:
- // CreateElementZeroRefCount is deprecated and can be removed once we convert all element
+ // CreateWithZeroRefCountFlag is deprecated and can be removed once we convert all element
// classes to start with a reference count of 1.
enum ConstructionType {
CreateOther = DefaultNodeFlags,
@@ -674,11 +675,9 @@ protected:
CreateComment = DefaultNodeFlags | IsCommentFlag,
CreateContainer = DefaultNodeFlags | IsContainerFlag,
CreateElement = CreateContainer | IsElementFlag,
- CreateElementZeroRefCount = IsElementFlag | CreateWithZeroRefCountFlag,
CreateStyledElement = CreateElement | IsStyledElementFlag,
CreateStyledElementZeroRefCount = CreateStyledElement | CreateWithZeroRefCountFlag,
CreateHTMLElement = CreateStyledElement | IsHTMLFlag,
- CreateHTMLElementZeroRefCount = CreateHTMLElement | CreateWithZeroRefCountFlag,
CreateSVGElement = CreateStyledElement | IsSVGFlag,
CreateSVGElementZeroRefCount = CreateSVGElement | CreateWithZeroRefCountFlag,
};
diff --git a/WebCore/dom/NodeFilter.idl b/WebCore/dom/NodeFilter.idl
index 16f3f26..40c5bad 100644
--- a/WebCore/dom/NodeFilter.idl
+++ b/WebCore/dom/NodeFilter.idl
@@ -21,8 +21,12 @@
module traversal {
// Introduced in DOM Level 2:
- interface [CustomMarkFunction, CustomNativeConverter, ObjCProtocol] NodeFilter {
-
+ interface [
+ CustomMarkFunction,
+ CustomNativeConverter,
+ ObjCProtocol,
+ PureInterface
+ ] NodeFilter {
// Constants returned by acceptNode
const short FILTER_ACCEPT = 1;
const short FILTER_REJECT = 2;
diff --git a/WebCore/dom/Position.cpp b/WebCore/dom/Position.cpp
index 7861fbe..65b7261 100644
--- a/WebCore/dom/Position.cpp
+++ b/WebCore/dom/Position.cpp
@@ -739,7 +739,7 @@ bool Position::isCandidate() const
return m_offset == 0 && !nodeIsUserSelectNone(node()->parent());
if (renderer->isText())
- return inRenderedText() && !nodeIsUserSelectNone(node());
+ return !nodeIsUserSelectNone(node()) && inRenderedText();
if (isTableElement(node()) || editingIgnoresContent(node()))
return (atFirstEditingPositionForNode() || atLastEditingPositionForNode()) && !nodeIsUserSelectNone(node()->parent());
diff --git a/WebCore/dom/Position.h b/WebCore/dom/Position.h
index ce06f48..f606c29 100644
--- a/WebCore/dom/Position.h
+++ b/WebCore/dom/Position.h
@@ -234,7 +234,7 @@ inline Position positionAfterNode(Node* anchorNode)
inline int lastOffsetInNode(Node* node)
{
- return node->offsetInCharacters() ? node->maxCharacterOffset() : node->childNodeCount();
+ return node->offsetInCharacters() ? node->maxCharacterOffset() : static_cast<int>(node->childNodeCount());
}
// firstPositionInNode and lastPositionInNode return parent-anchored positions, lastPositionInNode construction is O(n) due to childNodeCount()
diff --git a/WebCore/dom/PositionIterator.cpp b/WebCore/dom/PositionIterator.cpp
index 619e376..d2c3a3f 100644
--- a/WebCore/dom/PositionIterator.cpp
+++ b/WebCore/dom/PositionIterator.cpp
@@ -150,7 +150,7 @@ bool PositionIterator::isCandidate() const
return !m_offsetInAnchor && !Position::nodeIsUserSelectNone(m_anchorNode->parent());
if (renderer->isText())
- return Position(*this).inRenderedText() && !Position::nodeIsUserSelectNone(m_anchorNode);
+ return !Position::nodeIsUserSelectNone(m_anchorNode) && Position(*this).inRenderedText();
if (isTableElement(m_anchorNode) || editingIgnoresContent(m_anchorNode))
return (atStartOfNode() || atEndOfNode()) && !Position::nodeIsUserSelectNone(m_anchorNode->parent());
diff --git a/WebCore/dom/RawDataDocumentParser.h b/WebCore/dom/RawDataDocumentParser.h
new file mode 100644
index 0000000..77d148d
--- /dev/null
+++ b/WebCore/dom/RawDataDocumentParser.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RawDataDocumentParser_h
+#define RawDataDocumentParser_h
+
+#include "DocumentParser.h"
+
+namespace WebCore {
+
+// FIXME: It seems wrong that RawDataDocumentParser is a subclass of
+// DocumentParser. RawDataDocumentParser, just wants to override an earlier
+// version of write() before the data is decoded. Seems the decoding could
+// move into the base-class DocumentParser, and then RawDataDocumentParser
+// would just be short-circuting. That could simplify some of the
+// DocumentWriter logic.
+class RawDataDocumentParser : public DocumentParser {
+public:
+ RawDataDocumentParser(Document* document)
+ : DocumentParser(document)
+ {
+ }
+
+protected:
+ virtual void finish()
+ {
+ if (!m_parserStopped)
+ m_document->finishedParsing();
+ }
+
+private:
+ virtual void write(const SegmentedString&, bool)
+ {
+ // <https://bugs.webkit.org/show_bug.cgi?id=25397>: JS code can always call document.write, we need to handle it.
+ ASSERT_NOT_REACHED();
+ }
+
+ virtual bool finishWasCalled()
+ {
+ // finish() always calls document()->finishedParsing() so we will be
+ // deleted after finish().
+ return false;
+ }
+
+ virtual bool isWaitingForScripts() const { return false; }
+
+ virtual bool wantsRawData() const { return true; }
+ virtual bool writeRawData(const char*, int) { return false; }
+};
+
+};
+
+#endif // RawDataDocumentParser_h
diff --git a/WebCore/dom/ScriptElement.cpp b/WebCore/dom/ScriptElement.cpp
index 0ac0846..518aead 100644
--- a/WebCore/dom/ScriptElement.cpp
+++ b/WebCore/dom/ScriptElement.cpp
@@ -305,6 +305,20 @@ String ScriptElementData::scriptContent() const
return String::adopt(val);
}
+bool ScriptElementData::isAsynchronous() const
+{
+ // Only external scripts may be asynchronous.
+ // See: http://dev.w3.org/html5/spec/Overview.html#attr-script-async
+ return !m_scriptElement->sourceAttributeValue().isEmpty() && m_scriptElement->asyncAttributeValue();
+}
+
+bool ScriptElementData::isDeferred() const
+{
+ // Only external scripts may be deferred and async trumps defer to allow for backward compatibility.
+ // See: http://dev.w3.org/html5/spec/Overview.html#attr-script-defer
+ return !m_scriptElement->sourceAttributeValue().isEmpty() && !m_scriptElement->asyncAttributeValue() && m_scriptElement->deferAttributeValue();
+}
+
ScriptElement* toScriptElement(Element* element)
{
if (element->isHTMLElement() && element->hasTagName(HTMLNames::scriptTag))
diff --git a/WebCore/dom/ScriptElement.h b/WebCore/dom/ScriptElement.h
index 8cc84fc..c663e43 100644
--- a/WebCore/dom/ScriptElement.h
+++ b/WebCore/dom/ScriptElement.h
@@ -44,6 +44,8 @@ public:
virtual String languageAttributeValue() const = 0;
virtual String forAttributeValue() const = 0;
virtual String eventAttributeValue() const = 0;
+ virtual bool asyncAttributeValue() const = 0;
+ virtual bool deferAttributeValue() const = 0;
virtual void dispatchLoadEvent() = 0;
virtual void dispatchErrorEvent() = 0;
@@ -74,6 +76,8 @@ public:
String scriptContent() const;
String scriptCharset() const;
+ bool isAsynchronous() const;
+ bool isDeferred() const;
Element* element() const { return m_element; }
bool createdByParser() const { return m_createdByParser; }
diff --git a/WebCore/dom/SelectElement.cpp b/WebCore/dom/SelectElement.cpp
index c7052b3..43e6e28 100644
--- a/WebCore/dom/SelectElement.cpp
+++ b/WebCore/dom/SelectElement.cpp
@@ -342,8 +342,13 @@ void SelectElement::setSelectedIndex(SelectElementData& data, Element* element,
data.setUserDrivenChange(userDrivenChange);
if (fireOnChangeNow)
menuListOnChange(data, element);
- if (RenderMenuList* menuList = toRenderMenuList(element->renderer()))
- menuList->didSetSelectedIndex();
+ RenderObject* renderer = element->renderer();
+ if (renderer) {
+ if (data.usesMenuList())
+ toRenderMenuList(renderer)->didSetSelectedIndex();
+ else if (renderer->isListBox())
+ toRenderListBox(renderer)->selectionChanged();
+ }
}
if (Frame* frame = element->document()->frame())
diff --git a/WebCore/dom/StaticHashSetNodeList.cpp b/WebCore/dom/StaticHashSetNodeList.cpp
new file mode 100644
index 0000000..d641cb5
--- /dev/null
+++ b/WebCore/dom/StaticHashSetNodeList.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 Antonio Gomes <tonikitoo@webkit.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "StaticHashSetNodeList.h"
+
+#include "Element.h"
+
+namespace WebCore {
+
+unsigned StaticHashSetNodeList::length() const
+{
+ return m_nodes.size();
+}
+
+Node* StaticHashSetNodeList::item(unsigned index) const
+{
+ if (index < (unsigned) m_nodes.size()) {
+ ListHashSet<RefPtr<Node> >::const_iterator it = m_nodes.begin();
+ for (unsigned count = 0; count < index; ++it, ++count) { }
+ return (*it).get();
+ }
+
+ return 0;
+}
+
+Node* StaticHashSetNodeList::itemWithName(const AtomicString& elementId) const
+{
+ ListHashSet<RefPtr<Node> >::const_iterator it = m_nodes.begin();
+ ListHashSet<RefPtr<Node> >::const_iterator end = m_nodes.end();
+ for ( ; it != end ; ++it) {
+ Node* node = (*it).get();
+ if (node->hasID() && static_cast<Element*>(node)->getIdAttribute() == elementId)
+ return node;
+ }
+
+ return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/StaticHashSetNodeList.h b/WebCore/dom/StaticHashSetNodeList.h
new file mode 100644
index 0000000..e954493
--- /dev/null
+++ b/WebCore/dom/StaticHashSetNodeList.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2010 Antonio Gomes <tonikitoo@webkit.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StaticHashSetNodeList_h
+#define StaticHashSetNodeList_h
+
+#include "NodeList.h"
+#include <wtf/ListHashSet.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Node;
+
+class StaticHashSetNodeList : public NodeList {
+public:
+ // Adopts the contents of the nodes ListHashSet.
+ static PassRefPtr<StaticHashSetNodeList> adopt(const ListHashSet<RefPtr<Node> >& nodes)
+ {
+ return adopt(const_cast<ListHashSet<RefPtr<Node> >&>(nodes));
+ }
+
+ static PassRefPtr<StaticHashSetNodeList> adopt(ListHashSet<RefPtr<Node> >& nodes)
+ {
+ return adoptRef(new StaticHashSetNodeList(nodes));
+ }
+
+ virtual unsigned length() const;
+ virtual Node* item(unsigned index) const;
+ virtual Node* itemWithName(const AtomicString&) const;
+
+private:
+ StaticHashSetNodeList(ListHashSet<RefPtr<Node> >& nodes)
+ {
+ m_nodes.swap(nodes);
+ }
+
+ ListHashSet<RefPtr<Node> > m_nodes;
+};
+
+} // namespace WebCore
+
+#endif // StaticHashSetNodeList_h
diff --git a/WebCore/dom/Touch.h b/WebCore/dom/Touch.h
index ceb8ae7..54e85a5 100644
--- a/WebCore/dom/Touch.h
+++ b/WebCore/dom/Touch.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TOUCH_H_
-#define TOUCH_H_
+#ifndef Touch_h
+#define Touch_h
#if ENABLE(TOUCH_EVENTS)
@@ -72,4 +72,4 @@ private:
#endif // ENABLE(TOUCH_EVENTS)
-#endif /* TOUCH_H_ */
+#endif /* Touch_h */
diff --git a/WebCore/dom/TouchList.h b/WebCore/dom/TouchList.h
index 61350b0..2546955 100644
--- a/WebCore/dom/TouchList.h
+++ b/WebCore/dom/TouchList.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef TOUCHLIST_H_
-#define TOUCHLIST_H_
+#ifndef TouchList_h
+#define TouchList_h
#if ENABLE(TOUCH_EVENTS)
@@ -57,4 +57,4 @@ private:
#endif // ENABLE(TOUCH_EVENTS)
-#endif /* TOUCHLIST_H_ */
+#endif /* TouchList_h */
diff --git a/WebCore/dom/XMLDocumentParser.cpp b/WebCore/dom/XMLDocumentParser.cpp
index 987e9b1..ab02bb3 100644
--- a/WebCore/dom/XMLDocumentParser.cpp
+++ b/WebCore/dom/XMLDocumentParser.cpp
@@ -72,10 +72,7 @@ const int maxErrors = 25;
#if ENABLE(WML)
bool XMLDocumentParser::isWMLDocument() const
{
- if (m_doc)
- return m_doc->isWMLDocument();
-
- return false;
+ return document()->isWMLDocument();
}
#endif
@@ -83,7 +80,7 @@ void XMLDocumentParser::pushCurrentNode(Node* n)
{
ASSERT(n);
ASSERT(m_currentNode);
- if (n != m_doc)
+ if (n != document())
n->ref();
m_currentNodeStack.append(m_currentNode);
m_currentNode = n;
@@ -97,7 +94,7 @@ void XMLDocumentParser::popCurrentNode()
return;
ASSERT(m_currentNodeStack.size());
- if (m_currentNode != m_doc)
+ if (m_currentNode != document())
m_currentNode->deref();
m_currentNode = m_currentNodeStack.last();
@@ -106,14 +103,14 @@ void XMLDocumentParser::popCurrentNode()
void XMLDocumentParser::clearCurrentNodeStack()
{
- if (m_currentNode && m_currentNode != m_doc)
+ if (m_currentNode && m_currentNode != document())
m_currentNode->deref();
m_currentNode = 0;
if (m_currentNodeStack.size()) { // Aborted parsing.
for (size_t i = m_currentNodeStack.size() - 1; i != 0; --i)
m_currentNodeStack[i]->deref();
- if (m_currentNodeStack[0] && m_currentNodeStack[0] != m_doc)
+ if (m_currentNodeStack[0] && m_currentNodeStack[0] != document())
m_currentNodeStack[0]->deref();
m_currentNodeStack.clear();
}
@@ -169,7 +166,7 @@ bool XMLDocumentParser::enterText()
#if !USE(QXMLSTREAM)
ASSERT(m_bufferedText.size() == 0);
#endif
- RefPtr<Node> newNode = Text::create(m_doc, "");
+ RefPtr<Node> newNode = Text::create(document(), "");
if (!m_currentNode->addChild(newNode.get()))
return false;
pushCurrentNode(newNode.get());
@@ -217,12 +214,12 @@ void XMLDocumentParser::end()
insertErrorMessageBlock();
else {
exitText();
- m_doc->updateStyleSelector();
+ document()->updateStyleSelector();
}
clearCurrentNodeStack();
if (!m_parsingFragment)
- m_doc->finishedParsing();
+ document()->finishedParsing();
}
void XMLDocumentParser::finish()
@@ -233,6 +230,11 @@ void XMLDocumentParser::finish()
end();
}
+bool XMLDocumentParser::finishWasCalled()
+{
+ return m_finishCalled;
+}
+
static inline RefPtr<Element> createXHTMLParserErrorHeader(Document* doc, const String& errorMessages)
{
RefPtr<Element> reportElement = doc->createElement(QualifiedName(nullAtom, "parsererror", xhtmlNamespaceURI), false);
@@ -267,7 +269,7 @@ void XMLDocumentParser::insertErrorMessageBlock()
// Create elements for display
ExceptionCode ec = 0;
- Document* doc = m_doc;
+ Document* doc = document();
Node* documentElement = doc->documentElement();
if (!documentElement) {
RefPtr<Node> rootElement = doc->createElement(htmlTag, false);
diff --git a/WebCore/dom/XMLDocumentParser.h b/WebCore/dom/XMLDocumentParser.h
index bc10415..9915409 100644
--- a/WebCore/dom/XMLDocumentParser.h
+++ b/WebCore/dom/XMLDocumentParser.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef XMLTokenizer_h
-#define XMLTokenizer_h
+#ifndef XMLDocumentParser_h
+#define XMLDocumentParser_h
#if USE(EXPAT)
@@ -136,10 +136,10 @@ bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
-#include "MappedAttributeEntry.h"
#include "SegmentedString.h"
#include "StringHash.h"
#include "DocumentParser.h"
+#include "FragmentScriptingPermission.h"
#include <wtf/HashMap.h>
#include <wtf/OwnPtr.h>
@@ -185,18 +185,9 @@ namespace WebCore {
XMLDocumentParser(DocumentFragment*, Element*, FragmentScriptingPermission);
~XMLDocumentParser();
+ // Exposed for callbacks:
enum ErrorType { warning, nonFatal, fatal };
-
- // from DocumentParser
- virtual void write(const SegmentedString&, bool appendData);
- virtual void finish();
- virtual bool isWaitingForScripts() const;
- virtual void stopParsing();
-
- void end();
-
- void pauseParsing();
- void resumeParsing();
+ void handleError(ErrorType, const char* message, int lineNumber, int columnNumber);
void setIsXHTMLDocument(bool isXHTML) { m_isXHTMLDocument = isXHTML; }
bool isXHTMLDocument() const { return m_isXHTMLDocument; }
@@ -208,16 +199,24 @@ namespace WebCore {
bool isWMLDocument() const;
#endif
- // from CachedResourceClient
- virtual void notifyFinished(CachedResource* finishedObj);
-
+ private:
+ // From DocumentParser
+ virtual void write(const SegmentedString&, bool appendData);
+ virtual void finish();
+ virtual bool finishWasCalled();
+ virtual bool isWaitingForScripts() const;
+ virtual void stopParsing();
+ virtual bool wellFormed() const { return !m_sawError; }
+ virtual int lineNumber() const;
+ virtual int columnNumber() const;
- void handleError(ErrorType type, const char* m, int lineNumber, int columnNumber);
+ // from CachedResourceClient
+ virtual void notifyFinished(CachedResource*);
- virtual bool wellFormed() const { return !m_sawError; }
+ void end();
- int lineNumber() const;
- int columnNumber() const;
+ void pauseParsing();
+ void resumeParsing();
#if USE(QXMLSTREAM)
private:
@@ -264,7 +263,6 @@ public:
void doWrite(const String&);
void doEnd();
- Document* m_doc;
FrameView* m_view;
String m_originalSourceForTransform;
@@ -321,6 +319,10 @@ bool parseXMLDocumentFragment(const String&, DocumentFragment*, Element* parent
} // namespace WebCore
+<<<<<<< HEAD
#endif // USE(EXPAT)
#endif // XMLTokenizer_h
+=======
+#endif // XMLDocumentParser_h
+>>>>>>> webkit.org at r61871
diff --git a/WebCore/dom/XMLDocumentParserLibxml2.cpp b/WebCore/dom/XMLDocumentParserLibxml2.cpp
index 2a1bac6..33b0a09 100644
--- a/WebCore/dom/XMLDocumentParserLibxml2.cpp
+++ b/WebCore/dom/XMLDocumentParserLibxml2.cpp
@@ -38,13 +38,12 @@
#include "FrameView.h"
#include "HTMLLinkElement.h"
#include "HTMLStyleElement.h"
-#include "HTMLDocumentParser.h" // for decodeNamedEntity
+#include "LegacyHTMLDocumentParser.h" // for decodeNamedEntity
#include "ProcessingInstruction.h"
#include "ResourceError.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "ResourceResponse.h"
-#include "ScriptController.h"
#include "ScriptElement.h"
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
@@ -523,12 +522,12 @@ PassRefPtr<XMLParserContext> XMLParserContext::createMemoryParser(xmlSAXHandlerP
// --------------------------------
-XMLDocumentParser::XMLDocumentParser(Document* _doc, FrameView* _view)
- : m_doc(_doc)
- , m_view(_view)
+XMLDocumentParser::XMLDocumentParser(Document* document, FrameView* frameView)
+ : DocumentParser(document)
+ , m_view(frameView)
, m_context(0)
, m_pendingCallbacks(new PendingCallbacks)
- , m_currentNode(_doc)
+ , m_currentNode(document)
, m_sawError(false)
, m_sawXSLTransform(false)
, m_sawFirstElement(false)
@@ -551,7 +550,7 @@ XMLDocumentParser::XMLDocumentParser(Document* _doc, FrameView* _view)
}
XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parentElement, FragmentScriptingPermission scriptingPermission)
- : m_doc(fragment->document())
+ : DocumentParser(fragment->document())
, m_view(0)
, m_context(0)
, m_pendingCallbacks(new PendingCallbacks)
@@ -576,8 +575,6 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
, m_scriptingPermission(scriptingPermission)
{
fragment->ref();
- if (m_doc)
- m_doc->ref();
// Add namespaces based on the parent node
Vector<Element*> elemStack;
@@ -620,8 +617,6 @@ XMLParserContext::~XMLParserContext()
XMLDocumentParser::~XMLDocumentParser()
{
clearCurrentNodeStack();
- if (m_parsingFragment && m_doc)
- m_doc->deref();
if (m_pendingScript)
m_pendingScript->removeClient(this);
}
@@ -644,11 +639,11 @@ void XMLDocumentParser::doWrite(const String& parseString)
const unsigned char BOMHighByte = *reinterpret_cast<const unsigned char*>(&BOM);
xmlSwitchEncoding(context->context(), BOMHighByte == 0xFF ? XML_CHAR_ENCODING_UTF16LE : XML_CHAR_ENCODING_UTF16BE);
- XMLDocumentParserScope scope(m_doc->docLoader());
+ XMLDocumentParserScope scope(document()->docLoader());
xmlParseChunk(context->context(), reinterpret_cast<const char*>(parseString.characters()), sizeof(UChar) * parseString.length(), 0);
}
- if (m_doc->decoder() && m_doc->decoder()->sawError()) {
+ if (document()->decoder() && document()->decoder()->sawError()) {
// If the decoder saw an error, report it as fatal (stops parsing)
handleError(fatal, "Encoding error", context->context()->input->line, context->context()->input->col);
}
@@ -729,7 +724,7 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
#if ENABLE(XHTMLMP)
// check if the DOCTYPE Declaration of XHTMLMP document exists
- if (!m_hasDocTypeDeclaration && m_doc->isXHTMLMPDocument()) {
+ if (!m_hasDocTypeDeclaration && document()->isXHTMLMPDocument()) {
handleError(fatal, "DOCTYPE declaration lost.", lineNumber(), columnNumber());
return;
}
@@ -770,7 +765,7 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
m_sawFirstElement = true;
QualifiedName qName(prefix, localName, uri);
- RefPtr<Element> newElement = m_doc->createElement(qName, true);
+ RefPtr<Element> newElement = document()->createElement(qName, true);
if (!newElement) {
stopParsing();
return;
@@ -783,19 +778,12 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
return;
}
- ScriptController* jsProxy = m_doc->frame() ? m_doc->frame()->script() : 0;
- if (jsProxy && m_doc->frame()->script()->canExecuteScripts(NotAboutToExecuteScript))
- jsProxy->setEventHandlerLineNumber(lineNumber());
-
handleElementAttributes(newElement.get(), libxmlAttributes, nb_attributes, ec, m_scriptingPermission);
if (ec) {
stopParsing();
return;
}
- if (jsProxy)
- jsProxy->setEventHandlerLineNumber(0);
-
newElement->beginParsingChildren();
ScriptElement* scriptElement = toScriptElement(newElement.get());
@@ -811,8 +799,8 @@ void XMLDocumentParser::startElementNs(const xmlChar* xmlLocalName, const xmlCha
if (m_view && !newElement->attached())
newElement->attach();
- if (!m_parsingFragment && isFirstElement && m_doc->frame())
- m_doc->frame()->loader()->dispatchDocumentElementAvailable();
+ if (!m_parsingFragment && isFirstElement && document()->frame())
+ document()->frame()->loader()->dispatchDocumentElementAvailable();
}
void XMLDocumentParser::endElementNs()
@@ -863,7 +851,7 @@ void XMLDocumentParser::endElementNs()
#if ENABLE(XHTMLMP)
if (!scriptElement->shouldExecuteAsJavaScript())
- m_doc->setShouldProcessNoscriptElement(true);
+ document()->setShouldProcessNoscriptElement(true);
else
#endif
{
@@ -872,7 +860,7 @@ void XMLDocumentParser::endElementNs()
// we have a src attribute
String scriptCharset = scriptElement->scriptCharset();
if (element->dispatchBeforeLoadEvent(scriptHref) &&
- (m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) {
+ (m_pendingScript = document()->docLoader()->requestScript(scriptHref, scriptCharset))) {
m_scriptElement = element;
m_pendingScript->addClient(this);
@@ -882,7 +870,7 @@ void XMLDocumentParser::endElementNs()
} else
m_scriptElement = 0;
} else
- m_view->frame()->script()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine));
+ m_view->frame()->script()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), document()->url(), m_scriptStartLine));
}
m_requestingScript = false;
popCurrentNode();
@@ -940,7 +928,7 @@ void XMLDocumentParser::processingInstruction(const xmlChar* target, const xmlCh
// ### handle exceptions
int exception = 0;
- RefPtr<ProcessingInstruction> pi = m_doc->createProcessingInstruction(
+ RefPtr<ProcessingInstruction> pi = document()->createProcessingInstruction(
toString(target), toString(data), exception);
if (exception)
return;
@@ -956,7 +944,7 @@ void XMLDocumentParser::processingInstruction(const xmlChar* target, const xmlCh
#if ENABLE(XSLT)
m_sawXSLTransform = !m_sawFirstElement && pi->isXSL();
- if (m_sawXSLTransform && !m_doc->transformSourceDocument())
+ if (m_sawXSLTransform && !document()->transformSourceDocument())
stopParsing();
#endif
}
@@ -973,7 +961,7 @@ void XMLDocumentParser::cdataBlock(const xmlChar* s, int len)
exitText();
- RefPtr<Node> newNode = CDATASection::create(m_doc, toString(s, len));
+ RefPtr<Node> newNode = CDATASection::create(document(), toString(s, len));
if (!m_currentNode->addChild(newNode.get()))
return;
if (m_view && !newNode->attached())
@@ -992,7 +980,7 @@ void XMLDocumentParser::comment(const xmlChar* s)
exitText();
- RefPtr<Node> newNode = Comment::create(m_doc, toString(s));
+ RefPtr<Node> newNode = Comment::create(document(), toString(s));
m_currentNode->addChild(newNode.get());
if (m_view && !newNode->attached())
newNode->attach();
@@ -1003,10 +991,10 @@ void XMLDocumentParser::startDocument(const xmlChar* version, const xmlChar* enc
ExceptionCode ec = 0;
if (version)
- m_doc->setXMLVersion(toString(version), ec);
- m_doc->setXMLStandalone(standalone == 1, ec); // possible values are 0, 1, and -1
+ document()->setXMLVersion(toString(version), ec);
+ document()->setXMLStandalone(standalone == 1, ec); // possible values are 0, 1, and -1
if (encoding)
- m_doc->setXMLEncoding(toString(encoding));
+ document()->setXMLEncoding(toString(encoding));
}
void XMLDocumentParser::endDocument()
@@ -1027,7 +1015,7 @@ void XMLDocumentParser::internalSubset(const xmlChar* name, const xmlChar* exter
return;
}
- if (m_doc) {
+ if (document()) {
#if ENABLE(WML) || ENABLE(XHTMLMP)
String extId = toString(externalID);
#endif
@@ -1048,7 +1036,7 @@ void XMLDocumentParser::internalSubset(const xmlChar* name, const xmlChar* exter
return;
}
- if (m_doc->isXHTMLMPDocument())
+ if (document()->isXHTMLMPDocument())
setIsXHTMLMPDocument(true);
else
setIsXHTMLDocument(true);
@@ -1057,7 +1045,7 @@ void XMLDocumentParser::internalSubset(const xmlChar* name, const xmlChar* exter
}
#endif
- m_doc->addChild(DocumentType::create(m_doc, toString(name), toString(externalID), toString(systemID)));
+ document()->addChild(DocumentType::create(document(), toString(name), toString(externalID), toString(systemID)));
}
}
@@ -1283,7 +1271,7 @@ void XMLDocumentParser::initializeParserContext(const char* chunk)
m_sawXSLTransform = false;
m_sawFirstElement = false;
- XMLDocumentParserScope scope(m_doc->docLoader());
+ XMLDocumentParserScope scope(document()->docLoader());
if (m_parsingFragment)
m_context = XMLParserContext::createMemoryParser(&sax, this, chunk);
else
@@ -1294,12 +1282,12 @@ void XMLDocumentParser::doEnd()
{
#if ENABLE(XSLT)
if (m_sawXSLTransform) {
- void* doc = xmlDocPtrForString(m_doc->docLoader(), m_originalSourceForTransform, m_doc->url().string());
- m_doc->setTransformSource(new TransformSource(doc));
+ void* doc = xmlDocPtrForString(document()->docLoader(), m_originalSourceForTransform, document()->url().string());
+ document()->setTransformSource(new TransformSource(doc));
- m_doc->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
- m_doc->updateStyleSelector();
- m_doc->setParsing(true);
+ document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
+ document()->updateStyleSelector();
+ document()->setParsing(true);
m_parserStopped = true;
}
#endif
@@ -1310,7 +1298,7 @@ void XMLDocumentParser::doEnd()
if (m_context) {
// Tell libxml we're done.
{
- XMLDocumentParserScope scope(m_doc->docLoader());
+ XMLDocumentParserScope scope(document()->docLoader());
xmlParseChunk(context(), 0, 0, 1);
}
@@ -1383,6 +1371,8 @@ void XMLDocumentParser::resumeParsing()
end();
}
+// FIXME: This method should be possible to implement using the DocumentParser
+// API, instead of needing to grab at libxml2 state directly.
bool parseXMLDocumentFragment(const String& chunk, DocumentFragment* fragment, Element* parent, FragmentScriptingPermission scriptingPermission)
{
if (!chunk.length())
diff --git a/WebCore/dom/XMLDocumentParserQt.cpp b/WebCore/dom/XMLDocumentParserQt.cpp
index 89f542f..3b657f1 100644
--- a/WebCore/dom/XMLDocumentParserQt.cpp
+++ b/WebCore/dom/XMLDocumentParserQt.cpp
@@ -38,7 +38,7 @@
#include "FrameView.h"
#include "HTMLLinkElement.h"
#include "HTMLStyleElement.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
#include "ProcessingInstruction.h"
#include "ResourceError.h"
#include "ResourceHandle.h"
@@ -77,11 +77,11 @@ QString EntityResolver::resolveUndeclaredEntity(const QString &name)
// --------------------------------
-XMLDocumentParser::XMLDocumentParser(Document* _doc, FrameView* _view)
- : m_doc(_doc)
- , m_view(_view)
+XMLDocumentParser::XMLDocumentParser(Document* document, FrameView* frameView)
+ : DocumentParser(document)
+ , m_view(frameView)
, m_wroteText(false)
- , m_currentNode(_doc)
+ , m_currentNode(document)
, m_sawError(false)
, m_sawXSLTransform(false)
, m_sawFirstElement(false)
@@ -105,7 +105,7 @@ XMLDocumentParser::XMLDocumentParser(Document* _doc, FrameView* _view)
}
XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parentElement, FragmentScriptingPermission permission)
- : m_doc(fragment->document())
+ : DocumentParser(fragment->document())
, m_view(0)
, m_wroteText(false)
, m_currentNode(fragment)
@@ -129,8 +129,6 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
, m_scriptingPermission(permission)
{
fragment->ref();
- if (m_doc)
- m_doc->ref();
// Add namespaces based on the parent node
Vector<Element*> elemStack;
@@ -169,8 +167,6 @@ XMLDocumentParser::XMLDocumentParser(DocumentFragment* fragment, Element* parent
XMLDocumentParser::~XMLDocumentParser()
{
clearCurrentNodeStack();
- if (m_parsingFragment && m_doc)
- m_doc->deref();
if (m_pendingScript)
m_pendingScript->removeClient(this);
delete m_stream.entityResolver();
@@ -180,7 +176,7 @@ void XMLDocumentParser::doWrite(const String& parseString)
{
m_wroteText = true;
- if (m_doc->decoder() && m_doc->decoder()->sawError()) {
+ if (document()->decoder() && document()->decoder()->sawError()) {
// If the decoder saw an error, report it as fatal (stops parsing)
handleError(fatal, "Encoding error", lineNumber(), columnNumber());
return;
@@ -207,10 +203,10 @@ void XMLDocumentParser::doEnd()
{
#if ENABLE(XSLT)
if (m_sawXSLTransform) {
- m_doc->setTransformSource(new TransformSource(m_originalSourceForTransform));
- m_doc->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
- m_doc->updateStyleSelector();
- m_doc->setParsing(true);
+ document()->setTransformSource(new TransformSource(m_originalSourceForTransform));
+ document()->setParsing(false); // Make the doc think it's done, so it will apply xsl sheets.
+ document()->updateStyleSelector();
+ document()->setParsing(true);
m_parserStopped = true;
}
#endif
@@ -365,7 +361,7 @@ void XMLDocumentParser::parse()
break;
case QXmlStreamReader::StartElement: {
#if ENABLE(XHTMLMP)
- if (m_doc->isXHTMLMPDocument() && !m_hasDocTypeDeclaration) {
+ if (document()->isXHTMLMPDocument() && !m_hasDocTypeDeclaration) {
handleError(fatal, "DOCTYPE declaration lost.", lineNumber(), columnNumber());
break;
}
@@ -444,14 +440,14 @@ void XMLDocumentParser::startDocument()
ExceptionCode ec = 0;
if (!m_parsingFragment) {
- m_doc->setXMLStandalone(m_stream.isStandaloneDocument(), ec);
+ document()->setXMLStandalone(m_stream.isStandaloneDocument(), ec);
QStringRef version = m_stream.documentVersion();
if (!version.isEmpty())
- m_doc->setXMLVersion(version, ec);
+ document()->setXMLVersion(version, ec);
QStringRef encoding = m_stream.documentEncoding();
if (!encoding.isEmpty())
- m_doc->setXMLEncoding(encoding);
+ document()->setXMLEncoding(encoding);
}
}
@@ -475,7 +471,7 @@ void XMLDocumentParser::parseStartElement()
}
QualifiedName qName(prefix, localName, uri);
- RefPtr<Element> newElement = m_doc->createElement(qName, true);
+ RefPtr<Element> newElement = document()->createElement(qName, true);
if (!newElement) {
stopParsing();
return;
@@ -529,8 +525,8 @@ void XMLDocumentParser::parseStartElement()
if (m_view && !newElement->attached())
newElement->attach();
- if (isFirstElement && m_doc->frame())
- m_doc->frame()->loader()->dispatchDocumentElementAvailable();
+ if (isFirstElement && document()->frame())
+ document()->frame()->loader()->dispatchDocumentElementAvailable();
}
void XMLDocumentParser::parseEndElement()
@@ -574,7 +570,7 @@ void XMLDocumentParser::parseEndElement()
#if ENABLE(XHTMLMP)
if (!scriptElement->shouldExecuteAsJavaScript())
- m_doc->setShouldProcessNoscriptElement(true);
+ document()->setShouldProcessNoscriptElement(true);
else
#endif
{
@@ -583,7 +579,7 @@ void XMLDocumentParser::parseEndElement()
// we have a src attribute
String scriptCharset = scriptElement->scriptCharset();
if (element->dispatchBeforeLoadEvent(scriptHref) &&
- (m_pendingScript = m_doc->docLoader()->requestScript(scriptHref, scriptCharset))) {
+ (m_pendingScript = document()->docLoader()->requestScript(scriptHref, scriptCharset))) {
m_scriptElement = element;
m_pendingScript->addClient(this);
@@ -593,7 +589,7 @@ void XMLDocumentParser::parseEndElement()
} else
m_scriptElement = 0;
} else
- m_view->frame()->script()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), m_doc->url(), m_scriptStartLine));
+ m_view->frame()->script()->executeScript(ScriptSourceCode(scriptElement->scriptContent(), document()->url(), m_scriptStartLine));
}
m_requestingScript = false;
popCurrentNode();
@@ -613,7 +609,7 @@ void XMLDocumentParser::parseProcessingInstruction()
// ### handle exceptions
int exception = 0;
- RefPtr<ProcessingInstruction> pi = m_doc->createProcessingInstruction(
+ RefPtr<ProcessingInstruction> pi = document()->createProcessingInstruction(
m_stream.processingInstructionTarget(),
m_stream.processingInstructionData(), exception);
if (exception)
@@ -630,7 +626,7 @@ void XMLDocumentParser::parseProcessingInstruction()
#if ENABLE(XSLT)
m_sawXSLTransform = !m_sawFirstElement && pi->isXSL();
- if (m_sawXSLTransform && !m_doc->transformSourceDocument())
+ if (m_sawXSLTransform && !document()->transformSourceDocument())
stopParsing();
#endif
}
@@ -639,7 +635,7 @@ void XMLDocumentParser::parseCdata()
{
exitText();
- RefPtr<Node> newNode = CDATASection::create(m_doc, m_stream.text());
+ RefPtr<Node> newNode = CDATASection::create(document(), m_stream.text());
if (!m_currentNode->addChild(newNode.get()))
return;
if (m_view && !newNode->attached())
@@ -650,7 +646,7 @@ void XMLDocumentParser::parseComment()
{
exitText();
- RefPtr<Node> newNode = Comment::create(m_doc, m_stream.text());
+ RefPtr<Node> newNode = Comment::create(document(), m_stream.text());
m_currentNode->addChild(newNode.get());
if (m_view && !newNode->attached())
newNode->attach();
@@ -695,14 +691,14 @@ void XMLDocumentParser::parseDtd()
return;
}
- if (m_doc->isXHTMLMPDocument()) // check if the MIME type is correct with this method
+ if (document()->isXHTMLMPDocument()) // check if the MIME type is correct with this method
setIsXHTMLMPDocument(true);
else
setIsXHTMLDocument(true);
}
#endif
#if ENABLE(WML)
- else if (m_doc->isWMLDocument()
+ else if (document()->isWMLDocument()
&& publicId != QLatin1String("-//WAPFORUM//DTD WML 1.3//EN")
&& publicId != QLatin1String("-//WAPFORUM//DTD WML 1.2//EN")
&& publicId != QLatin1String("-//WAPFORUM//DTD WML 1.1//EN")
@@ -710,7 +706,7 @@ void XMLDocumentParser::parseDtd()
handleError(fatal, "Invalid DTD Public ID", lineNumber(), columnNumber());
#endif
if (!m_parsingFragment)
- m_doc->addChild(DocumentType::create(m_doc, name, publicId, systemId));
+ document()->addChild(DocumentType::create(document(), name, publicId, systemId));
}
}
diff --git a/WebCore/dom/XMLDocumentParserScope.h b/WebCore/dom/XMLDocumentParserScope.h
index 89740d2..bdf629d 100644
--- a/WebCore/dom/XMLDocumentParserScope.h
+++ b/WebCore/dom/XMLDocumentParserScope.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef XMLTokenizerScope_h
-#define XMLTokenizerScope_h
+#ifndef XMLDocumentParserScope_h
+#define XMLDocumentParserScope_h
#include <wtf/Noncopyable.h>
@@ -59,4 +59,4 @@ namespace WebCore {
} // namespace WebCore
-#endif // XMLTokenizerScope_h
+#endif // XMLDocumentParserScope_h
diff --git a/WebCore/editing/CompositeEditCommand.cpp b/WebCore/editing/CompositeEditCommand.cpp
index e33f143..41d6758 100644
--- a/WebCore/editing/CompositeEditCommand.cpp
+++ b/WebCore/editing/CompositeEditCommand.cpp
@@ -558,7 +558,7 @@ void CompositeEditCommand::deleteInsignificantText(const Position& start, const
if (node->isTextNode()) {
Text* textNode = static_cast<Text*>(node);
int startOffset = node == start.node() ? start.deprecatedEditingOffset() : 0;
- int endOffset = node == end.node() ? end.deprecatedEditingOffset() : textNode->length();
+ int endOffset = node == end.node() ? end.deprecatedEditingOffset() : static_cast<int>(textNode->length());
deleteInsignificantText(textNode, startOffset, endOffset);
}
if (node == end.node())
diff --git a/WebCore/editing/DeleteButton.cpp b/WebCore/editing/DeleteButton.cpp
index a5aaea2..91991cf 100644
--- a/WebCore/editing/DeleteButton.cpp
+++ b/WebCore/editing/DeleteButton.cpp
@@ -45,7 +45,7 @@ inline DeleteButton::DeleteButton(Document* document)
PassRefPtr<DeleteButton> DeleteButton::create(Document* document)
{
- return new DeleteButton(document);
+ return adoptRef(new DeleteButton(document));
}
void DeleteButton::defaultEventHandler(Event* event)
diff --git a/WebCore/editing/Editor.cpp b/WebCore/editing/Editor.cpp
index 8ae1313..773ed90 100644
--- a/WebCore/editing/Editor.cpp
+++ b/WebCore/editing/Editor.cpp
@@ -884,7 +884,7 @@ void Editor::appliedEditing(PassRefPtr<EditCommand> cmd)
VisibleSelection newSelection(cmd->endingSelection());
// Don't clear the typing style with this selection change. We do those things elsewhere if necessary.
- changeSelectionAfterCommand(newSelection, false, false, cmd.get());
+ changeSelectionAfterCommand(newSelection, false, false);
if (!cmd->preservesTypingStyle())
m_frame->setTypingStyle(0);
@@ -909,7 +909,7 @@ void Editor::unappliedEditing(PassRefPtr<EditCommand> cmd)
dispatchEditableContentChangedEvents(*cmd);
VisibleSelection newSelection(cmd->startingSelection());
- changeSelectionAfterCommand(newSelection, true, true, cmd.get());
+ changeSelectionAfterCommand(newSelection, true, true);
m_lastEditCommand = 0;
if (client())
@@ -924,7 +924,7 @@ void Editor::reappliedEditing(PassRefPtr<EditCommand> cmd)
dispatchEditableContentChangedEvents(*cmd);
VisibleSelection newSelection(cmd->endingSelection());
- changeSelectionAfterCommand(newSelection, true, true, cmd.get());
+ changeSelectionAfterCommand(newSelection, true, true);
m_lastEditCommand = 0;
if (client())
@@ -2870,7 +2870,7 @@ PassRefPtr<Range> Editor::nextVisibleRange(Range* currentRange, const String& ta
return lastVisibleRange(target, caseFlag);
}
-void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, bool closeTyping, bool clearTypingStyle, EditCommand* cmd)
+void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, bool closeTyping, bool clearTypingStyle)
{
// If there is no selection change, don't bother sending shouldChangeSelection, but still call setSelection,
// because there is work that it must do in this situation.
@@ -2880,14 +2880,14 @@ void Editor::changeSelectionAfterCommand(const VisibleSelection& newSelection, b
if (selectionDidNotChangeDOMPosition || m_frame->shouldChangeSelection(newSelection))
m_frame->selection()->setSelection(newSelection, closeTyping, clearTypingStyle);
- // Some kinds of deletes and line break insertions change the selection's position within the document without
- // changing its position within the DOM. For example when you press return in the following (the caret is marked by ^):
+ // Some editing operations change the selection visually without affecting its position within the DOM.
+ // For example when you press return in the following (the caret is marked by ^):
// <div contentEditable="true"><div>^Hello</div></div>
// WebCore inserts <div><br></div> *before* the current block, which correctly moves the paragraph down but which doesn't
// change the caret's DOM position (["hello", 0]). In these situations the above SelectionController::setSelection call
// does not call EditorClient::respondToChangedSelection(), which, on the Mac, sends selection change notifications and
// starts a new kill ring sequence, but we want to do these things (matches AppKit).
- if (selectionDidNotChangeDOMPosition && cmd->isTypingCommand())
+ if (selectionDidNotChangeDOMPosition)
client()->respondToChangedSelection();
}
diff --git a/WebCore/editing/Editor.h b/WebCore/editing/Editor.h
index 3e223dc..cd1b204 100644
--- a/WebCore/editing/Editor.h
+++ b/WebCore/editing/Editor.h
@@ -324,7 +324,7 @@ private:
PassRefPtr<Range> firstVisibleRange(const String&, bool caseFlag);
PassRefPtr<Range> lastVisibleRange(const String&, bool caseFlag);
- void changeSelectionAfterCommand(const VisibleSelection& newSelection, bool closeTyping, bool clearTypingStyle, EditCommand*);
+ void changeSelectionAfterCommand(const VisibleSelection& newSelection, bool closeTyping, bool clearTypingStyle);
};
inline void Editor::setStartNewKillRingSequence(bool flag)
diff --git a/WebCore/editing/EditorCommand.cpp b/WebCore/editing/EditorCommand.cpp
index 6bd75d6..0fc0068 100644
--- a/WebCore/editing/EditorCommand.cpp
+++ b/WebCore/editing/EditorCommand.cpp
@@ -898,6 +898,12 @@ static bool executePasteAndMatchStyle(Frame* frame, Event*, EditorCommandSource,
return true;
}
+static bool executePasteAsPlainText(Frame* frame, Event*, EditorCommandSource, const String&)
+{
+ frame->editor()->pasteAsPlainText();
+ return true;
+}
+
static bool executePrint(Frame* frame, Event*, EditorCommandSource, const String&)
{
Page* page = frame->page();
@@ -1419,6 +1425,7 @@ static const CommandMap& createCommandMap()
{ "Outdent", { executeOutdent, supported, enabledInRichlyEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "Paste", { executePaste, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
{ "PasteAndMatchStyle", { executePasteAndMatchStyle, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
+ { "PasteAsPlainText", { executePasteAsPlainText, supportedPaste, enabledPaste, stateNone, valueNull, notTextInsertion, allowExecutionWhenDisabled } },
{ "Print", { executePrint, supported, enabled, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "Redo", { executeRedo, supported, enabledRedo, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
{ "RemoveFormat", { executeRemoveFormat, supported, enabledRangeInEditableText, stateNone, valueNull, notTextInsertion, doNotAllowExecutionWhenDisabled } },
diff --git a/WebCore/editing/InsertListCommand.cpp b/WebCore/editing/InsertListCommand.cpp
index 07b612f..0f7dc77 100644
--- a/WebCore/editing/InsertListCommand.cpp
+++ b/WebCore/editing/InsertListCommand.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -39,7 +39,7 @@ using namespace HTMLNames;
PassRefPtr<HTMLElement> InsertListCommand::insertList(Document* document, Type type)
{
- RefPtr<InsertListCommand> insertCommand = new InsertListCommand(document, type);
+ RefPtr<InsertListCommand> insertCommand = create(document, type);
insertCommand->apply();
return insertCommand->m_listElement;
}
diff --git a/WebCore/editing/ModifySelectionListLevel.cpp b/WebCore/editing/ModifySelectionListLevel.cpp
index 9a7e105..3e6754e 100644
--- a/WebCore/editing/ModifySelectionListLevel.cpp
+++ b/WebCore/editing/ModifySelectionListLevel.cpp
@@ -209,28 +209,28 @@ bool IncreaseSelectionListLevelCommand::canIncreaseSelectionListLevel(Document*
return canIncreaseListLevel(document->frame()->selection()->selection(), startListChild, endListChild);
}
-PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelWithType(Document* document, Type listType)
+PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document, Type type)
{
ASSERT(document);
ASSERT(document->frame());
- RefPtr<IncreaseSelectionListLevelCommand> modCommand = new IncreaseSelectionListLevelCommand(document, listType);
- modCommand->apply();
- return modCommand->m_listElement;
+ RefPtr<IncreaseSelectionListLevelCommand> command = create(document, type);
+ command->apply();
+ return command->m_listElement.release();
}
PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevel(Document* document)
{
- return increaseSelectionListLevelWithType(document, InheritedListType);
+ return increaseSelectionListLevel(document, InheritedListType);
}
PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered(Document* document)
{
- return increaseSelectionListLevelWithType(document, OrderedList);
+ return increaseSelectionListLevel(document, OrderedList);
}
PassRefPtr<Node> IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered(Document* document)
{
- return increaseSelectionListLevelWithType(document, UnorderedList);
+ return increaseSelectionListLevel(document, UnorderedList);
}
DecreaseSelectionListLevelCommand::DecreaseSelectionListLevelCommand(Document* document)
@@ -289,7 +289,7 @@ void DecreaseSelectionListLevelCommand::decreaseSelectionListLevel(Document* doc
{
ASSERT(document);
ASSERT(document->frame());
- applyCommand(new DecreaseSelectionListLevelCommand(document));
+ applyCommand(create(document));
}
}
diff --git a/WebCore/editing/ModifySelectionListLevel.h b/WebCore/editing/ModifySelectionListLevel.h
index 39efff8..feefa91 100644
--- a/WebCore/editing/ModifySelectionListLevel.h
+++ b/WebCore/editing/ModifySelectionListLevel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -55,9 +55,15 @@ public:
private:
enum Type { InheritedListType, OrderedList, UnorderedList };
- static PassRefPtr<Node> increaseSelectionListLevelWithType(Document*, Type listType);
+ static PassRefPtr<Node> increaseSelectionListLevel(Document*, Type);
+ static PassRefPtr<IncreaseSelectionListLevelCommand> create(Document* document, Type type)
+ {
+ return adoptRef(new IncreaseSelectionListLevelCommand(document, type));
+ }
+
IncreaseSelectionListLevelCommand(Document*, Type);
+
virtual void doApply();
Type m_listType;
@@ -71,7 +77,13 @@ public:
static void decreaseSelectionListLevel(Document*);
private:
+ static PassRefPtr<DecreaseSelectionListLevelCommand> create(Document* document)
+ {
+ return adoptRef(new DecreaseSelectionListLevelCommand(document));
+ }
+
DecreaseSelectionListLevelCommand(Document*);
+
virtual void doApply();
};
diff --git a/WebCore/editing/SelectionController.cpp b/WebCore/editing/SelectionController.cpp
index ca18bc1..b17ab10 100644
--- a/WebCore/editing/SelectionController.cpp
+++ b/WebCore/editing/SelectionController.cpp
@@ -131,7 +131,7 @@ void SelectionController::setSelection(const VisibleSelection& s, bool closeTypi
// <http://bugs.webkit.org/show_bug.cgi?id=23464>: Infinite recursion at SelectionController::setSelection
// if document->frame() == m_frame we can get into an infinite loop
- if (document && document->frame() != m_frame && document != m_frame->document()) {
+ if (document && document->frame() && document->frame() != m_frame && document != m_frame->document()) {
document->frame()->selection()->setSelection(s, closeTyping, clearTypingStyle, userTriggered);
return;
}
diff --git a/WebCore/editing/markup.cpp b/WebCore/editing/markup.cpp
index 17f5680..dcb53d6 100644
--- a/WebCore/editing/markup.cpp
+++ b/WebCore/editing/markup.cpp
@@ -392,7 +392,7 @@ static void removeExteriorStyles(CSSMutableStyleDeclaration* style)
enum RangeFullySelectsNode { DoesFullySelectNode, DoesNotFullySelectNode };
-static void appendStartMarkup(Vector<UChar>& result, const Node* node, const Range* range, EAnnotateForInterchange annotate, bool convertBlocksToInlines = false, HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
+static void appendStartMarkup(Vector<UChar>& result, const Node* node, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs, bool convertBlocksToInlines, HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
{
if (namespaces)
namespaces->checkConsistency();
@@ -468,9 +468,14 @@ static void appendStartMarkup(Vector<UChar>& result, const Node* node, const Ran
result.append('=');
- if (el->isURLAttribute(attr))
- appendQuotedURLAttributeValue(result, attr->value());
- else {
+ if (el->isURLAttribute(attr)) {
+ // We don't want to complete file:/// URLs because it may contain sensitive information
+ // about the user's system.
+ if (absoluteURLs == AbsoluteURLs && !node->document()->url().isLocalFile())
+ appendQuotedURLAttributeValue(result, node->document()->completeURL(attr->value()).string());
+ else
+ appendQuotedURLAttributeValue(result, attr->value().string());
+ } else {
result.append('\"');
appendAttributeValue(result, attr->value(), documentIsHTML);
result.append('\"');
@@ -550,10 +555,10 @@ static void appendStartMarkup(Vector<UChar>& result, const Node* node, const Ran
}
}
-static String getStartMarkup(const Node* node, const Range* range, EAnnotateForInterchange annotate, bool convertBlocksToInlines = false, HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
+static String getStartMarkup(const Node* node, const Range* range, EAnnotateForInterchange annotate, EAbsoluteURLs absoluteURLs, bool convertBlocksToInlines = false, HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0, RangeFullySelectsNode rangeFullySelectsNode = DoesFullySelectNode)
{
Vector<UChar> result;
- appendStartMarkup(result, node, range, annotate, convertBlocksToInlines, namespaces, rangeFullySelectsNode);
+ appendStartMarkup(result, node, range, annotate, absoluteURLs, convertBlocksToInlines, namespaces, rangeFullySelectsNode);
return String::adopt(result);
}
@@ -608,7 +613,7 @@ public:
{
}
- void appendMarkup(Node* startNode, EChildrenOnly, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0);
+ void appendMarkup(Node* startNode, EChildrenOnly, EAbsoluteURLs, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces = 0);
String takeResult() { return String::adopt(m_result); }
@@ -619,7 +624,7 @@ private:
};
// FIXME: Would be nice to do this in a non-recursive way.
-void MarkupAccumulator::appendMarkup(Node* startNode, EChildrenOnly childrenOnly, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces)
+void MarkupAccumulator::appendMarkup(Node* startNode, EChildrenOnly childrenOnly, EAbsoluteURLs absoluteURLs, const HashMap<AtomicStringImpl*, AtomicStringImpl*>* namespaces)
{
if (startNode == m_nodeToSkip)
return;
@@ -632,13 +637,13 @@ void MarkupAccumulator::appendMarkup(Node* startNode, EChildrenOnly childrenOnly
if (!childrenOnly) {
if (m_nodes)
m_nodes->append(startNode);
- appendStartMarkup(m_result, startNode, 0, DoNotAnnotateForInterchange, false, &namespaceHash);
+ appendStartMarkup(m_result, startNode, 0, DoNotAnnotateForInterchange, absoluteURLs, false, &namespaceHash);
}
// children
if (!(startNode->document()->isHTMLDocument() && doesHTMLForbidEndTag(startNode))) {
for (Node* current = startNode->firstChild(); current; current = current->nextSibling())
- appendMarkup(current, IncludeNode, &namespaceHash);
+ appendMarkup(current, IncludeNode, absoluteURLs, &namespaceHash);
}
// end tag
@@ -789,7 +794,7 @@ static void addStyleMarkup(Vector<String>& preMarkups, Vector<String>& postMarku
// FIXME: Shouldn't we omit style info when annotate == DoNotAnnotateForInterchange?
// FIXME: At least, annotation and style info should probably not be included in range.markupString()
-String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterchange annotate, bool convertBlocksToInlines)
+String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterchange annotate, bool convertBlocksToInlines, EAbsoluteURLs absoluteURLs)
{
DEFINE_STATIC_LOCAL(const String, interchangeNewlineString, ("<br class=\"" AppleInterchangeNewline "\">"));
@@ -878,7 +883,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
// Add the node to the markup.
if (addMarkupForNode) {
- markups.append(getStartMarkup(n, updatedRange.get(), annotate));
+ markups.append(getStartMarkup(n, updatedRange.get(), annotate, absoluteURLs));
if (nodes)
nodes->append(n);
}
@@ -915,7 +920,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
continue;
// or b) ancestors that we never encountered during a pre-order traversal starting at startNode:
ASSERT(startNode->isDescendantOf(parent));
- preMarkups.append(getStartMarkup(parent, updatedRange.get(), annotate));
+ preMarkups.append(getStartMarkup(parent, updatedRange.get(), annotate, absoluteURLs));
markups.append(getEndMarkup(parent));
if (nodes)
nodes->append(parent);
@@ -1001,7 +1006,7 @@ String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterc
} else {
// Since this node and all the other ancestors are not in the selection we want to set RangeFullySelectsNode to DoesNotFullySelectNode
// so that styles that affect the exterior of the node are not included.
- preMarkups.append(getStartMarkup(ancestor, updatedRange.get(), annotate, convertBlocksToInlines, 0, DoesNotFullySelectNode));
+ preMarkups.append(getStartMarkup(ancestor, updatedRange.get(), annotate, absoluteURLs, convertBlocksToInlines, 0, DoesNotFullySelectNode));
markups.append(getEndMarkup(ancestor));
}
if (nodes)
@@ -1067,7 +1072,7 @@ PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document* document, const
return fragment.release();
}
-String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes)
+String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs absoluteURLs)
{
if (!node)
return "";
@@ -1080,7 +1085,7 @@ String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>*
}
MarkupAccumulator accumulator(deleteButtonContainerElement, nodes);
- accumulator.appendMarkup(const_cast<Node*>(node), childrenOnly);
+ accumulator.appendMarkup(const_cast<Node*>(node), childrenOnly, absoluteURLs);
return accumulator.takeResult();
}
diff --git a/WebCore/editing/markup.h b/WebCore/editing/markup.h
index dd34159..5428097 100644
--- a/WebCore/editing/markup.h
+++ b/WebCore/editing/markup.h
@@ -26,8 +26,8 @@
#ifndef markup_h
#define markup_h
+#include "FragmentScriptingPermission.h"
#include "HTMLInterchange.h"
-#include "MappedAttributeEntry.h"
#include <wtf/Forward.h>
#include <wtf/Vector.h>
@@ -41,6 +41,7 @@ namespace WebCore {
class String;
enum EChildrenOnly { IncludeNode, ChildrenOnly };
+ enum EAbsoluteURLs { DoNotResolveURLs, AbsoluteURLs };
PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String& text);
PassRefPtr<DocumentFragment> createFragmentFromMarkup(Document*, const String& markup, const String& baseURL, FragmentScriptingPermission = FragmentScriptingAllowed);
@@ -49,8 +50,8 @@ namespace WebCore {
bool isPlainTextMarkup(Node *node);
String createMarkup(const Range*,
- Vector<Node*>* = 0, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false);
- String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0);
+ Vector<Node*>* = 0, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false, EAbsoluteURLs = DoNotResolveURLs);
+ String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0, EAbsoluteURLs = DoNotResolveURLs);
String createFullMarkup(const Node*);
String createFullMarkup(const Range*);
diff --git a/WebCore/history/CachedFrame.cpp b/WebCore/history/CachedFrame.cpp
index 8881066..0be6710 100644
--- a/WebCore/history/CachedFrame.cpp
+++ b/WebCore/history/CachedFrame.cpp
@@ -129,9 +129,10 @@ CachedFrame::CachedFrame(Frame* frame)
// Custom scrollbar renderers will get reattached when the document comes out of the page cache
m_view->detachCustomScrollbars();
- m_document->documentWillBecomeInactive();
+ m_document->documentWillBecomeInactive();
frame->clearTimers();
m_document->setInPageCache(true);
+ frame->loader()->stopLoading(UnloadEventPolicyUnloadAndPageHide);
frame->loader()->client()->savePlatformDataToCachedFrame(this);
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp
index 03aa450..3ee423b 100644
--- a/WebCore/history/HistoryItem.cpp
+++ b/WebCore/history/HistoryItem.cpp
@@ -37,7 +37,7 @@
namespace WebCore {
-static long long generateDocumentSequenceNumber()
+static long long generateSequenceNumber()
{
// Initialize to the current time to reduce the likelihood of generating
// identifiers that overlap with those from past/future browser sessions.
@@ -57,7 +57,8 @@ HistoryItem::HistoryItem()
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
}
@@ -70,7 +71,8 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, double ti
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
@@ -85,7 +87,8 @@ HistoryItem::HistoryItem(const String& urlString, const String& title, const Str
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
@@ -101,7 +104,8 @@ HistoryItem::HistoryItem(const KURL& url, const String& target, const String& pa
, m_lastVisitWasFailure(false)
, m_isTargetItem(false)
, m_visitCount(0)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(generateSequenceNumber())
+ , m_documentSequenceNumber(generateSequenceNumber())
{
iconDatabase()->retainIconForPageURL(m_urlString);
}
@@ -133,7 +137,8 @@ inline HistoryItem::HistoryItem(const HistoryItem& item)
, m_visitCount(item.m_visitCount)
, m_dailyVisitCounts(item.m_dailyVisitCounts)
, m_weeklyVisitCounts(item.m_weeklyVisitCounts)
- , m_documentSequenceNumber(generateDocumentSequenceNumber())
+ , m_itemSequenceNumber(item.m_itemSequenceNumber)
+ , m_documentSequenceNumber(item.m_documentSequenceNumber)
, m_formContentType(item.m_formContentType)
{
if (item.m_formData)
diff --git a/WebCore/history/HistoryItem.h b/WebCore/history/HistoryItem.h
index ee8c0c8..ef73c5e 100644
--- a/WebCore/history/HistoryItem.h
+++ b/WebCore/history/HistoryItem.h
@@ -136,6 +136,9 @@ public:
void setStateObject(PassRefPtr<SerializedScriptValue> object);
SerializedScriptValue* stateObject() const { return m_stateObject.get(); }
+ void setItemSequenceNumber(long long number) { m_itemSequenceNumber = number; }
+ long long itemSequenceNumber() const { return m_itemSequenceNumber; }
+
void setDocumentSequenceNumber(long long number) { m_documentSequenceNumber = number; }
long long documentSequenceNumber() const { return m_documentSequenceNumber; }
@@ -242,6 +245,8 @@ private:
OwnPtr<Vector<String> > m_redirectURLs;
+ long long m_itemSequenceNumber;
+
// Support for HTML5 History
RefPtr<SerializedScriptValue> m_stateObject;
long long m_documentSequenceNumber;
diff --git a/WebCore/history/PageCache.cpp b/WebCore/history/PageCache.cpp
index 72fca86..7719187 100644
--- a/WebCore/history/PageCache.cpp
+++ b/WebCore/history/PageCache.cpp
@@ -36,6 +36,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
+#include "FrameLoaderStateMachine.h"
#include "HistoryItem.h"
#include "Logging.h"
#include "Page.h"
@@ -77,7 +78,7 @@ static void pageCacheLog(const String& prefix, const String& message)
static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
{
// Only bother logging for frames that have actually loaded and have content.
- if (frame->loader()->creatingInitialEmptyDocument())
+ if (frame->loader()->stateMachine()->creatingInitialEmptyDocument())
return false;
KURL currentURL = frame->loader()->documentLoader() ? frame->loader()->documentLoader()->url() : KURL();
if (currentURL.isEmpty())
@@ -102,7 +103,7 @@ static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
PCLOG(" -Main document has an error");
cannotCache = true;
}
- if (frame->loader()->containsPlugins()) {
+ if (frame->loader()->subframeLoader()->containsPlugins()) {
PCLOG(" -Frame contains plugins");
cannotCache = true;
}
@@ -175,7 +176,7 @@ static bool logCanCacheFrameDecision(Frame* frame, int indentLevel)
static void logCanCachePageDecision(Page* page)
{
// Only bother logging for main frames that have actually loaded and have content.
- if (page->mainFrame()->loader()->creatingInitialEmptyDocument())
+ if (page->mainFrame()->loader()->stateMachine()->creatingInitialEmptyDocument())
return;
KURL currentURL = page->mainFrame()->loader()->documentLoader() ? page->mainFrame()->loader()->documentLoader()->url() : KURL();
if (currentURL.isEmpty())
@@ -246,7 +247,7 @@ bool PageCache::canCachePageContainingThisFrame(Frame* frame)
// (objects created by the plug-in). Since there is no way to pause/resume a Netscape plug-in,
// they would need to be destroyed and then recreated, and there is no way that we can recreate
// the right NPObjects. See <rdar://problem/5197041> for more information.
- && !frame->loader()->containsPlugins()
+ && !frame->loader()->subframeLoader()->containsPlugins()
&& !frame->loader()->url().protocolIs("https")
&& (!frame->domWindow() || !frame->domWindow()->hasEventListeners(eventNames().unloadEvent))
#if ENABLE(DATABASE)
diff --git a/WebCore/html/AsyncImageResizer.h b/WebCore/html/AsyncImageResizer.h
index 3eeeead..add070a 100644
--- a/WebCore/html/AsyncImageResizer.h
+++ b/WebCore/html/AsyncImageResizer.h
@@ -35,6 +35,7 @@
#include "Blob.h"
#include "CachedResourceClient.h"
+#include "IntSize.h"
#include "ScriptValue.h"
namespace WebCore {
diff --git a/WebCore/html/Blob.cpp b/WebCore/html/Blob.cpp
index 0546f1c..baf3d49 100644
--- a/WebCore/html/Blob.cpp
+++ b/WebCore/html/Blob.cpp
@@ -36,10 +36,17 @@
namespace WebCore {
+Blob::Blob(const String& type, const BlobItemList& items)
+ : m_type(type)
+{
+ for (size_t i = 0; i < items.size(); ++i)
+ m_items.append(items[i]);
+}
+
Blob::Blob(const String& path)
{
// Note: this doesn't initialize the type unlike File(path).
- append(FileBlobItem::create(path));
+ m_items.append(FileBlobItem::create(path));
}
unsigned long long Blob::size() const
@@ -58,13 +65,8 @@ const String& Blob::path() const
return m_items[0]->toFileBlobItem()->path();
}
-void Blob::append(PassRefPtr<BlobItem> item)
-{
- m_items.append(item);
-}
-
#if ENABLE(BLOB_SLICE)
-PassRefPtr<Blob> Blob::slice(long long start, long long length) const
+PassRefPtr<Blob> Blob::slice(long long start, long long length, const String& contentType) const
{
if (start < 0)
start = 0;
@@ -80,15 +82,15 @@ PassRefPtr<Blob> Blob::slice(long long start, long long length) const
length = totalSize - start;
size_t i = 0;
- RefPtr<Blob> blob = Blob::create();
+ BlobItemList items;
for (; i < m_items.size() && static_cast<unsigned long long>(start) >= m_items[i]->size(); ++i)
start -= m_items[i]->size();
for (; length > 0 && i < m_items.size(); ++i) {
- blob->m_items.append(m_items[i]->slice(start, length));
- length -= blob->m_items.last()->size();
+ items.append(m_items[i]->slice(start, length));
+ length -= items.last()->size();
start = 0;
}
- return blob.release();
+ return Blob::create(contentType, items);
}
#endif // ENABLE(BLOB_SLICE)
diff --git a/WebCore/html/Blob.h b/WebCore/html/Blob.h
index 39177b5..ad6c7a6 100644
--- a/WebCore/html/Blob.h
+++ b/WebCore/html/Blob.h
@@ -41,9 +41,9 @@ namespace WebCore {
class Blob : public RefCounted<Blob> {
public:
- static PassRefPtr<Blob> create()
+ static PassRefPtr<Blob> create(const String& type, const BlobItemList& items)
{
- return adoptRef(new Blob());
+ return adoptRef(new Blob(type, items));
}
// FIXME: Deprecated method. This is called only from
@@ -63,15 +63,14 @@ public:
// FIXME: Deprecated method.
const String& path() const;
- void append(PassRefPtr<BlobItem>);
const BlobItemList& items() const { return m_items; }
#if ENABLE(BLOB_SLICE)
- PassRefPtr<Blob> slice(long long start, long long length) const;
+ PassRefPtr<Blob> slice(long long start, long long length, const String& contentType = String()) const;
#endif
protected:
- Blob() { }
+ Blob(const String& type, const BlobItemList&);
// FIXME: Deprecated constructor. See also the comment for Blob::create(path).
Blob(const String& path);
diff --git a/WebCore/html/Blob.idl b/WebCore/html/Blob.idl
index 8db6064..0ae2759 100644
--- a/WebCore/html/Blob.idl
+++ b/WebCore/html/Blob.idl
@@ -32,9 +32,10 @@ module html {
interface Blob {
readonly attribute unsigned long long size;
-
+ readonly attribute DOMString type;
+
#if defined(ENABLE_BLOB_SLICE) && ENABLE_BLOB_SLICE
- Blob slice(in long long start, in long long length);
+ Blob slice(in long long start, in long long length, in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
#endif
};
diff --git a/WebCore/html/BlobBuilder.cpp b/WebCore/html/BlobBuilder.cpp
new file mode 100644
index 0000000..cda1568
--- /dev/null
+++ b/WebCore/html/BlobBuilder.cpp
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "BlobBuilder.h"
+
+#include "AtomicString.h"
+#include "Blob.h"
+#include "ExceptionCode.h"
+#include "TextEncoding.h"
+
+namespace WebCore {
+
+static bool getLineEndingTypeFromString(const AtomicString& typeString, LineEnding& endingType)
+{
+ DEFINE_STATIC_LOCAL(AtomicString, transparent, ("transparent"));
+ DEFINE_STATIC_LOCAL(AtomicString, native, ("native"));
+
+ if (typeString.isEmpty() || typeString == transparent) {
+ endingType = EndingTransparent;
+ return true;
+ }
+ if (typeString == native) {
+ endingType = EndingNative;
+ return true;
+ }
+ return false;
+}
+
+bool BlobBuilder::append(const String& text, const String& type, ExceptionCode& ec)
+{
+ ec = 0;
+ LineEnding endingType;
+ if (!getLineEndingTypeFromString(type, endingType)) {
+ ec = SYNTAX_ERR;
+ return false;
+ }
+ m_items.append(StringBlobItem::create(text, endingType, UTF8Encoding()));
+ return true;
+}
+
+bool BlobBuilder::append(const String& text, ExceptionCode& ec)
+{
+ return append(text, String(), ec);
+}
+
+bool BlobBuilder::append(PassRefPtr<Blob> blob)
+{
+ if (blob) {
+ for (size_t i = 0; i < blob->items().size(); ++i)
+ m_items.append(blob->items()[i]);
+ return true;
+ }
+ return false;
+}
+
+PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType) const
+{
+ return Blob::create(contentType, m_items);
+}
+
+} // namespace WebCore
diff --git a/WebCore/html/BlobBuilder.h b/WebCore/html/BlobBuilder.h
new file mode 100644
index 0000000..1173c04
--- /dev/null
+++ b/WebCore/html/BlobBuilder.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef BlobBuilder_h
+#define BlobBuilder_h
+
+#include "BlobItem.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class Blob;
+
+typedef int ExceptionCode;
+
+class BlobBuilder : public RefCounted<BlobBuilder> {
+public:
+ static PassRefPtr<BlobBuilder> create() { return adoptRef(new BlobBuilder()); }
+
+ bool append(PassRefPtr<Blob>);
+ bool append(const String& text, ExceptionCode&);
+ bool append(const String& text, const String& ending, ExceptionCode&);
+
+ PassRefPtr<Blob> getBlob(const String& contentType = String()) const;
+
+private:
+ BlobItemList m_items;
+};
+
+} // namespace WebCore
+
+#endif // BlobBuilder_h
diff --git a/WebCore/html/BlobBuilder.idl b/WebCore/html/BlobBuilder.idl
new file mode 100644
index 0000000..93cb87f
--- /dev/null
+++ b/WebCore/html/BlobBuilder.idl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 html {
+ interface [
+ CanBeConstructed,
+ GenerateNativeConverter,
+ NoStaticTables
+ ] BlobBuilder {
+ Blob getBlob(in [Optional, ConvertUndefinedOrNullToNullString] DOMString contentType);
+ void append(in Blob blob);
+ void append(in DOMString value, in [Optional, ConvertUndefinedOrNullToNullString] DOMString endings) raises (DOMException);
+ };
+
+}
+
diff --git a/WebCore/html/CSSPreloadScanner.cpp b/WebCore/html/CSSPreloadScanner.cpp
new file mode 100644
index 0000000..729103e
--- /dev/null
+++ b/WebCore/html/CSSPreloadScanner.cpp
@@ -0,0 +1,160 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
+ * Copyright (C) 2010 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CSSPreloadScanner.h"
+
+#include "CSSHelper.h"
+#include "CachedCSSStyleSheet.h"
+#include "DocLoader.h"
+#include "Document.h"
+#include "HTMLToken.h"
+
+namespace WebCore {
+
+static inline bool isWhitespace(UChar c)
+{
+ return c == ' ' || c == '\n' || c == '\r' || c == '\t';
+}
+
+CSSPreloadScanner::CSSPreloadScanner(Document* document)
+ : m_document(document)
+{
+ reset();
+}
+
+void CSSPreloadScanner::reset()
+{
+ m_state = Initial;
+ m_rule.clear();
+ m_ruleValue.clear();
+}
+
+void CSSPreloadScanner::scan(const HTMLToken& token, bool scanningBody)
+{
+ m_scanningBody = scanningBody;
+
+ const HTMLToken::DataVector& characters = token.characters();
+ for (HTMLToken::DataVector::const_iterator iter = characters.begin();
+ iter != characters.end(); ++iter) {
+ tokenize(*iter);
+ }
+}
+
+inline void CSSPreloadScanner::tokenize(UChar c)
+{
+ // We are just interested in @import rules, no need for real tokenization here
+ // Searching for other types of resources is probably low payoff.
+ switch (m_state) {
+ case Initial:
+ if (c == '@')
+ m_state = RuleStart;
+ else if (c == '/')
+ m_state = MaybeComment;
+ break;
+ case MaybeComment:
+ if (c == '*')
+ m_state = Comment;
+ else
+ m_state = Initial;
+ break;
+ case Comment:
+ if (c == '*')
+ m_state = MaybeCommentEnd;
+ break;
+ case MaybeCommentEnd:
+ if (c == '/')
+ m_state = Initial;
+ else if (c == '*')
+ ;
+ else
+ m_state = Comment;
+ break;
+ case RuleStart:
+ if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) {
+ m_rule.clear();
+ m_ruleValue.clear();
+ m_rule.append(c);
+ m_state = Rule;
+ } else
+ m_state = Initial;
+ break;
+ case Rule:
+ if (isWhitespace(c))
+ m_state = AfterRule;
+ else if (c == ';')
+ m_state = Initial;
+ else
+ m_rule.append(c);
+ break;
+ case AfterRule:
+ if (isWhitespace(c))
+ ;
+ else if (c == ';')
+ m_state = Initial;
+ else {
+ m_state = RuleValue;
+ m_ruleValue.append(c);
+ }
+ break;
+ case RuleValue:
+ if (isWhitespace(c))
+ m_state = AfterRuleValue;
+ else if (c == ';') {
+ emitRule();
+ m_state = Initial;
+ } else
+ m_ruleValue.append(c);
+ break;
+ case AfterRuleValue:
+ if (isWhitespace(c))
+ ;
+ else if (c == ';') {
+ emitRule();
+ m_state = Initial;
+ } else {
+ // FIXME: media rules
+ m_state = Initial;
+ }
+ break;
+ }
+}
+
+void CSSPreloadScanner::emitRule()
+{
+ String rule(m_rule.data(), m_rule.size());
+ if (equalIgnoringCase(rule, "import") && !m_ruleValue.isEmpty()) {
+ String value(m_ruleValue.data(), m_ruleValue.size());
+ String url = deprecatedParseURL(value);
+ if (!url.isEmpty())
+ m_document->docLoader()->preload(CachedResource::CSSStyleSheet, url, String(), m_scanningBody);
+ }
+ m_rule.clear();
+ m_ruleValue.clear();
+}
+
+}
diff --git a/WebCore/html/CSSPreloadScanner.h b/WebCore/html/CSSPreloadScanner.h
new file mode 100644
index 0000000..7ac282f
--- /dev/null
+++ b/WebCore/html/CSSPreloadScanner.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2010 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 CSSPreloadScanner_h
+#define CSSPreloadScanner_h
+
+#include "PlatformString.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class Document;
+class HTMLToken;
+
+class CSSPreloadScanner : public Noncopyable {
+public:
+ CSSPreloadScanner(Document*);
+
+ void reset();
+ void scan(const HTMLToken&, bool scanningBody);
+
+private:
+ enum State {
+ Initial,
+ MaybeComment,
+ Comment,
+ MaybeCommentEnd,
+ RuleStart,
+ Rule,
+ AfterRule,
+ RuleValue,
+ AfterRuleValue
+ };
+
+ inline void tokenize(UChar c);
+ void emitRule();
+
+ State m_state;
+ Vector<UChar, 16> m_rule;
+ Vector<UChar> m_ruleValue;
+
+ bool m_scanningBody;
+ Document* m_document;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/File.idl b/WebCore/html/File.idl
index 94287ff..2632a4d 100644
--- a/WebCore/html/File.idl
+++ b/WebCore/html/File.idl
@@ -30,7 +30,6 @@ module html {
GenerateToJS
] File : Blob {
readonly attribute DOMString name;
- readonly attribute DOMString type;
// FIXME: obsolete attributes. To be removed.
readonly attribute DOMString fileName;
diff --git a/WebCore/html/HTML5DocumentParser.cpp b/WebCore/html/HTML5DocumentParser.cpp
deleted file mode 100644
index 28df14e..0000000
--- a/WebCore/html/HTML5DocumentParser.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * Copyright (C) 2010 Google, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 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 "HTML5DocumentParser.h"
-
-#include "Element.h"
-#include "Frame.h"
-#include "HTML5Lexer.h"
-#include "HTML5ScriptRunner.h"
-#include "HTML5TreeBuilder.h"
-#include "HTMLDocument.h"
-#include "Node.h"
-#include "NotImplemented.h"
-#include "XSSAuditor.h"
-
-#if ENABLE(INSPECTOR)
-#include "InspectorTimelineAgent.h"
-#endif
-
-namespace WebCore {
-
-namespace {
-
-class NestingLevelIncrementer : public Noncopyable {
-public:
- NestingLevelIncrementer(int& counter)
- : m_counter(&counter)
- {
- ++(*m_counter);
- }
-
- ~NestingLevelIncrementer()
- {
- --(*m_counter);
- }
-
-private:
- int* m_counter;
-};
-
-} // namespace
-
-HTML5DocumentParser::HTML5DocumentParser(HTMLDocument* document, bool reportErrors)
- : DocumentParser()
- , m_document(document)
- , m_lexer(new HTML5Lexer)
- , m_scriptRunner(new HTML5ScriptRunner(document, this))
- , m_treeConstructor(new HTML5TreeBuilder(m_lexer.get(), document, reportErrors))
- , m_endWasDelayed(false)
- , m_writeNestingLevel(0)
-{
- begin();
-}
-
-HTML5DocumentParser::~HTML5DocumentParser()
-{
- // FIXME: We'd like to ASSERT that normal operation of this class clears
- // out any delayed actions, but we can't because we're unceremoniously
- // deleted. If there were a required call to some sort of cancel function,
- // then we could ASSERT some invariants here.
-}
-
-void HTML5DocumentParser::begin()
-{
- // FIXME: Should we reset the lexer?
-}
-
-void HTML5DocumentParser::pumpLexerIfPossible()
-{
- if (m_parserStopped || m_treeConstructor->isPaused())
- return;
- pumpLexer();
-}
-
-void HTML5DocumentParser::pumpLexer()
-{
- // We tell the InspectorTimelineAgent about every pump, even if we
- // end up pumping nothing. It can filter out empty pumps itself.
- willPumpLexer();
-
- ASSERT(!m_parserStopped);
- ASSERT(!m_treeConstructor->isPaused());
- while (!m_parserStopped && m_lexer->nextToken(m_input.current(), m_token)) {
- if (ScriptController* scriptController = script())
- scriptController->setEventHandlerLineNumber(lineNumber() + 1);
-
- m_treeConstructor->constructTreeFromToken(m_token);
- m_token.clear();
-
- if (ScriptController* scriptController = script())
- scriptController->setEventHandlerLineNumber(0);
-
- if (!m_treeConstructor->isPaused())
- continue;
-
- // The parser will pause itself when waiting on a script to load or run.
- // ScriptRunner executes scripts at the right times and handles reentrancy.
- int scriptStartLine = 0;
- RefPtr<Element> scriptElement = m_treeConstructor->takeScriptToProcess(scriptStartLine);
- bool shouldContinueParsing = m_scriptRunner->execute(scriptElement.release(), scriptStartLine);
- m_treeConstructor->setPaused(!shouldContinueParsing);
- if (!shouldContinueParsing)
- return;
- }
-
- didPumpLexer();
-}
-
-void HTML5DocumentParser::willPumpLexer()
-{
-#if ENABLE(INSPECTOR)
- // FIXME: m_input.current().length() is only accurate if we
- // end up parsing the whole buffer in this pump. We should pass how
- // much we parsed as part of didWriteHTML instead of willWriteHTML.
- if (InspectorTimelineAgent* timelineAgent = m_document->inspectorTimelineAgent())
- timelineAgent->willWriteHTML(m_input.current().length(), m_lexer->lineNumber());
-#endif
-}
-
-void HTML5DocumentParser::didPumpLexer()
-{
-#if ENABLE(INSPECTOR)
- if (InspectorTimelineAgent* timelineAgent = m_document->inspectorTimelineAgent())
- timelineAgent->didWriteHTML(m_lexer->lineNumber());
-#endif
-}
-
-void HTML5DocumentParser::write(const SegmentedString& source, bool appendData)
-{
- if (m_parserStopped)
- return;
-
- NestingLevelIncrementer nestingLevelIncrementer(m_writeNestingLevel);
-
- if (appendData) {
- m_input.appendToEnd(source);
- if (m_writeNestingLevel > 1) {
- // We've gotten data off the network in a nested call to write().
- // We don't want to consume any more of the input stream now. Do
- // not worry. We'll consume this data in a less-nested write().
- return;
- }
- } else
- m_input.insertAtCurrentInsertionPoint(source);
-
- pumpLexerIfPossible();
- endIfDelayed();
-}
-
-void HTML5DocumentParser::end()
-{
- pumpLexerIfPossible();
- // Informs the the rest of WebCore that parsing is really finished.
- m_treeConstructor->finished();
-}
-
-void HTML5DocumentParser::attemptToEnd()
-{
- // finish() indicates we will not receive any more data. If we are waiting on
- // an external script to load, we can't finish parsing quite yet.
-
- if (inWrite() || isWaitingForScripts() || executingScript()) {
- m_endWasDelayed = true;
- return;
- }
- end();
-}
-
-void HTML5DocumentParser::endIfDelayed()
-{
- if (!m_endWasDelayed || isWaitingForScripts() || executingScript())
- return;
-
- m_endWasDelayed = false;
- end();
-}
-
-void HTML5DocumentParser::finish()
-{
- // We're not going to get any more data off the network, so we close the
- // input stream to indicate EOF.
- m_input.close();
- attemptToEnd();
-}
-
-int HTML5DocumentParser::executingScript() const
-{
- return m_scriptRunner->inScriptExecution();
-}
-
-int HTML5DocumentParser::lineNumber() const
-{
- return m_lexer->lineNumber();
-}
-
-int HTML5DocumentParser::columnNumber() const
-{
- return m_lexer->columnNumber();
-}
-
-LegacyHTMLTreeConstructor* HTML5DocumentParser::htmlTreeConstructor() const
-{
- return m_treeConstructor->legacyTreeConstructor();
-}
-
-bool HTML5DocumentParser::isWaitingForScripts() const
-{
- return m_treeConstructor->isPaused();
-}
-
-void HTML5DocumentParser::resumeParsingAfterScriptExecution()
-{
- ASSERT(!m_scriptRunner->inScriptExecution());
- ASSERT(!m_treeConstructor->isPaused());
- pumpLexerIfPossible();
-
- // The document already finished parsing we were just waiting on scripts when finished() was called.
- endIfDelayed();
-}
-
-void HTML5DocumentParser::watchForLoad(CachedResource* cachedScript)
-{
- ASSERT(!cachedScript->isLoaded());
- // addClient would call notifyFinished if the load were complete.
- // Callers do not expect to be re-entered from this call, so they should
- // not an already-loaded CachedResource.
- cachedScript->addClient(this);
-}
-
-void HTML5DocumentParser::stopWatchingForLoad(CachedResource* cachedScript)
-{
- cachedScript->removeClient(this);
-}
-
-bool HTML5DocumentParser::shouldLoadExternalScriptFromSrc(const AtomicString& srcValue)
-{
- if (!m_XSSAuditor)
- return true;
- return m_XSSAuditor->canLoadExternalScriptFromSrc(srcValue);
-}
-
-void HTML5DocumentParser::executeScript(const ScriptSourceCode& sourceCode)
-{
- ASSERT(m_scriptRunner->inScriptExecution());
- if (!m_document->frame())
- return;
- InsertionPointRecord savedInsertionPoint(m_input);
- m_document->frame()->script()->executeScript(sourceCode);
-}
-
-void HTML5DocumentParser::notifyFinished(CachedResource* cachedResource)
-{
- ASSERT(!m_scriptRunner->inScriptExecution());
- ASSERT(m_treeConstructor->isPaused());
- // Note: We only ever wait on one script at a time, so we always know this
- // is the one we were waiting on and can un-pause the tree builder.
- m_treeConstructor->setPaused(false);
- bool shouldContinueParsing = m_scriptRunner->executeScriptsWaitingForLoad(cachedResource);
- m_treeConstructor->setPaused(!shouldContinueParsing);
- if (shouldContinueParsing)
- resumeParsingAfterScriptExecution();
-}
-
-void HTML5DocumentParser::executeScriptsWaitingForStylesheets()
-{
- // Ignore calls unless we have a script blocking the parser waiting on a
- // stylesheet load. Otherwise we are currently parsing and this
- // is a re-entrant call from encountering a </ style> tag.
- if (!m_scriptRunner->hasScriptsWaitingForStylesheets())
- return;
- ASSERT(!m_scriptRunner->inScriptExecution());
- ASSERT(m_treeConstructor->isPaused());
- // Note: We only ever wait on one script at a time, so we always know this
- // is the one we were waiting on and can un-pause the tree builder.
- m_treeConstructor->setPaused(false);
- bool shouldContinueParsing = m_scriptRunner->executeScriptsWaitingForStylesheets();
- m_treeConstructor->setPaused(!shouldContinueParsing);
- if (shouldContinueParsing)
- resumeParsingAfterScriptExecution();
-}
-
-ScriptController* HTML5DocumentParser::script() const
-{
- return m_document->frame() ? m_document->frame()->script() : 0;
-}
-
-}
diff --git a/WebCore/html/HTML5DocumentParser.h b/WebCore/html/HTML5DocumentParser.h
deleted file mode 100644
index 4a75cec..0000000
--- a/WebCore/html/HTML5DocumentParser.h
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright (C) 2010 Google, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 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 HTML5Tokenizer_h
-#define HTML5Tokenizer_h
-
-#include "CachedResourceClient.h"
-#include "HTML5ScriptRunnerHost.h"
-#include "HTML5Token.h"
-#include "SegmentedString.h"
-#include "DocumentParser.h"
-#include <wtf/OwnPtr.h>
-
-namespace WebCore {
-
-class HTMLDocument;
-class LegacyHTMLTreeConstructor;
-class HTML5Lexer;
-class HTML5ScriptRunner;
-class HTML5TreeBuilder;
-class ScriptController;
-class ScriptSourceCode;
-
-class HTML5DocumentParser : public DocumentParser, HTML5ScriptRunnerHost, CachedResourceClient {
-public:
- HTML5DocumentParser(HTMLDocument*, bool reportErrors);
- virtual ~HTML5DocumentParser();
-
- // DocumentParser
- virtual void begin();
- virtual void write(const SegmentedString&, bool appendData);
- virtual void end();
- virtual void finish();
- virtual int executingScript() const;
- virtual bool isWaitingForScripts() const;
- virtual void executeScriptsWaitingForStylesheets();
- virtual int lineNumber() const;
- virtual int columnNumber() const;
- // FIXME: HTMLFormControlElement accesses the LegacyHTMLTreeConstructor via this method.
- // Remove this when the LegacyHTMLTreeConstructor is no longer used.
- virtual LegacyHTMLTreeConstructor* htmlTreeConstructor() const;
-
- // HTML5ScriptRunnerHost
- virtual void watchForLoad(CachedResource*);
- virtual void stopWatchingForLoad(CachedResource*);
- virtual bool shouldLoadExternalScriptFromSrc(const AtomicString&);
- virtual void executeScript(const ScriptSourceCode&);
-
- // CachedResourceClient
- virtual void notifyFinished(CachedResource*);
-
-private:
- // The InputStream is made up of a sequence of SegmentedStrings:
- //
- // [--current--][--next--][--next--] ... [--next--]
- // /\ (also called m_last)
- // L_ current insertion point
- //
- // The current segmented string is stored in InputStream. Each of the
- // afterInsertionPoint buffers are stored in InsertionPointRecords on the
- // stack.
- //
- // We remove characters from the "current" string in the InputStream.
- // document.write() will add characters at the current insertion point,
- // which appends them to the "current" string.
- //
- // m_last is a pointer to the last of the afterInsertionPoint strings.
- // The network adds data at the end of the InputStream, which appends
- // them to the "last" string.
- class InputStream {
- public:
- InputStream()
- : m_last(&m_first)
- {
- }
-
- void appendToEnd(const SegmentedString& string)
- {
- m_last->append(string);
- }
-
- void insertAtCurrentInsertionPoint(const SegmentedString& string)
- {
- m_first.append(string);
- }
-
- void close() { m_last->close(); }
-
- SegmentedString& current() { return m_first; }
-
- void splitInto(SegmentedString& next)
- {
- next = m_first;
- m_first = SegmentedString();
- if (m_last == &m_first) {
- // We used to only have one SegmentedString in the InputStream
- // but now we have two. That means m_first is no longer also
- // the m_last string, |next| is now the last one.
- m_last = &next;
- }
- }
-
- void mergeFrom(SegmentedString& next)
- {
- m_first.append(next);
- if (m_last == &next) {
- // The string |next| used to be the last SegmentedString in
- // the InputStream. Now that it's been merged into m_first,
- // that makes m_first the last one.
- m_last = &m_first;
- }
- if (next.isClosed()) {
- // We also need to merge the "closed" state from next to
- // m_first. Arguably, this work could be done in append().
- m_first.close();
- }
- }
-
- private:
- SegmentedString m_first;
- SegmentedString* m_last;
- };
-
- class InsertionPointRecord {
- public:
- InsertionPointRecord(InputStream& inputStream)
- : m_inputStream(&inputStream)
- {
- m_inputStream->splitInto(m_next);
- }
-
- ~InsertionPointRecord()
- {
- m_inputStream->mergeFrom(m_next);
- }
-
- private:
- InputStream* m_inputStream;
- SegmentedString m_next;
- };
-
- void willPumpLexer();
- void didPumpLexer();
-
- void pumpLexer();
- void pumpLexerIfPossible();
- void resumeParsingAfterScriptExecution();
-
- void attemptToEnd();
- void endIfDelayed();
- bool inWrite() const { return m_writeNestingLevel > 0; }
-
- ScriptController* script() const;
-
- InputStream m_input;
-
- // We hold m_token here because it might be partially complete.
- HTML5Token m_token;
-
- HTMLDocument* m_document;
- OwnPtr<HTML5Lexer> m_lexer;
- OwnPtr<HTML5ScriptRunner> m_scriptRunner;
- OwnPtr<HTML5TreeBuilder> m_treeConstructor;
- bool m_endWasDelayed;
- int m_writeNestingLevel;
-};
-
-}
-
-#endif
diff --git a/WebCore/html/HTML5Lexer.h b/WebCore/html/HTML5Lexer.h
deleted file mode 100644
index fe321e2..0000000
--- a/WebCore/html/HTML5Lexer.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- * Copyright (C) 2010 Google, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 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 HTML5Lexer_h
-#define HTML5Lexer_h
-
-#include "AtomicString.h"
-#include "SegmentedString.h"
-#include <wtf/Noncopyable.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-
- class HTML5Token;
-
- class HTML5Lexer : public Noncopyable {
- public:
- enum State {
- DataState,
- CharacterReferenceInDataState,
- RCDATAState,
- CharacterReferenceInRCDATAState,
- RAWTEXTState,
- ScriptDataState,
- PLAINTEXTState,
- TagOpenState,
- EndTagOpenState,
- TagNameState,
- RCDATALessThanSignState,
- RCDATAEndTagOpenState,
- RCDATAEndTagNameState,
- RAWTEXTLessThanSignState,
- RAWTEXTEndTagOpenState,
- RAWTEXTEndTagNameState,
- ScriptDataLessThanSignState,
- ScriptDataEndTagOpenState,
- ScriptDataEndTagNameState,
- ScriptDataEscapeStartState,
- ScriptDataEscapeStartDashState,
- ScriptDataEscapedState,
- ScriptDataEscapedDashState,
- ScriptDataEscapedDashDashState,
- ScriptDataEscapedLessThanSignState,
- ScriptDataEscapedEndTagOpenState,
- ScriptDataEscapedEndTagNameState,
- ScriptDataDoubleEscapeStartState,
- ScriptDataDoubleEscapedState,
- ScriptDataDoubleEscapedDashState,
- ScriptDataDoubleEscapedDashDashState,
- ScriptDataDoubleEscapedLessThanSignState,
- ScriptDataDoubleEscapeEndState,
- BeforeAttributeNameState,
- AttributeNameState,
- AfterAttributeNameState,
- BeforeAttributeValueState,
- AttributeValueDoubleQuotedState,
- AttributeValueSingleQuotedState,
- AttributeValueUnquotedState,
- CharacterReferenceInAttributeValueState,
- AfterAttributeValueQuotedState,
- SelfClosingStartTagState,
- BogusCommentState,
- MarkupDeclarationOpenState,
- CommentStartState,
- CommentStartDashState,
- CommentState,
- CommentEndDashState,
- CommentEndState,
- CommentEndBangState,
- CommentEndSpaceState,
- DOCTYPEState,
- BeforeDOCTYPENameState,
- DOCTYPENameState,
- AfterDOCTYPENameState,
- AfterDOCTYPEPublicKeywordState,
- BeforeDOCTYPEPublicIdentifierState,
- DOCTYPEPublicIdentifierDoubleQuotedState,
- DOCTYPEPublicIdentifierSingleQuotedState,
- AfterDOCTYPEPublicIdentifierState,
- BetweenDOCTYPEPublicAndSystemIdentifiersState,
- AfterDOCTYPESystemKeywordState,
- BeforeDOCTYPESystemIdentifierState,
- DOCTYPESystemIdentifierDoubleQuotedState,
- DOCTYPESystemIdentifierSingleQuotedState,
- AfterDOCTYPESystemIdentifierState,
- BogusDOCTYPEState,
- CDATASectionState,
- };
-
- HTML5Lexer();
- ~HTML5Lexer();
-
- void reset();
-
- // This function returns true if it emits a token. Otherwise, callers
- // must provide the same (in progress) token on the next call (unless
- // they call reset() first).
- bool nextToken(SegmentedString&, HTML5Token&);
-
- int lineNumber() const { return m_lineNumber; }
- int columnNumber() const { return 1; } // Matches HTMLDocumentParser.h behavior.
-
- void setState(State state) { m_state = state; }
-
- // Hack to skip leading newline in <pre>/<listing> for authoring ease.
- // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
- void skipLeadingNewLineForListing() { m_skipLeadingNewLineForListing = true; }
-
- private:
- // http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
- class InputStreamPreprocessor : public Noncopyable {
- public:
- InputStreamPreprocessor()
- : m_nextInputCharacter('\0')
- , m_skipNextNewLine(false)
- {
- }
-
- UChar nextInputCharacter() const { return m_nextInputCharacter; }
-
- // Returns whether we succeeded in peeking at the next character.
- // The only way we can fail to peek is if there are no more
- // characters in |source| (after collapsing \r\n, etc).
- bool peek(SegmentedString& source, int& lineNumber)
- {
- m_nextInputCharacter = *source;
- if (m_nextInputCharacter == '\n' && m_skipNextNewLine) {
- m_skipNextNewLine = false;
- source.advancePastNewline(lineNumber);
- if (source.isEmpty())
- return false;
- m_nextInputCharacter = *source;
- }
- if (m_nextInputCharacter == '\r') {
- m_nextInputCharacter = '\n';
- m_skipNextNewLine = true;
- } else {
- m_skipNextNewLine = false;
- // FIXME: The spec indicates that the surrogate pair range as well as
- // a number of specific character values are parse errors and should be replaced
- // by the replacement character. We suspect this is a problem with the spec as doing
- // that filtering breaks surrogate pair handling and causes us not to match Minefield.
- if (m_nextInputCharacter == '\0')
- m_nextInputCharacter = 0xFFFD;
- }
- return true;
- }
-
- // Returns whether there are more characters in |source| after advancing.
- bool advance(SegmentedString& source, int& lineNumber)
- {
- source.advance(lineNumber);
- if (source.isEmpty())
- return false;
- return peek(source, lineNumber);
- }
-
- private:
- // http://www.whatwg.org/specs/web-apps/current-work/#next-input-character
- UChar m_nextInputCharacter;
- bool m_skipNextNewLine;
- };
-
- inline void emitCharacter(UChar);
- inline void emitParseError();
- inline void emitCurrentToken();
- inline void emitCodePoint(unsigned);
-
- inline bool processEntity(SegmentedString& source);
-
- inline bool temporaryBufferIs(const String&);
-
- // Sometimes we speculatively consume input characters and we don't
- // know whether they represent end tags or RCDATA, etc. These
- // functions help manage these state.
- inline void addToPossibleEndTag(UChar cc);
- inline bool isAppropriateEndTag();
-
- inline bool shouldEmitBufferedCharacterToken(const SegmentedString&);
-
- State m_state;
-
- Vector<UChar, 32> m_appropriateEndTagName;
-
- // m_token is owned by the caller. If nextToken is not on the stack,
- // this member might be pointing to unallocated memory.
- HTML5Token* m_token;
- int m_lineNumber;
-
- bool m_skipLeadingNewLineForListing;
-
- // http://www.whatwg.org/specs/web-apps/current-work/#temporary-buffer
- Vector<UChar, 32> m_temporaryBuffer;
-
- // We occationally want to emit both a character token and an end tag
- // token (e.g., when lexing script). We buffer the name of the end tag
- // token here so we remember it next time we re-enter the lexer.
- Vector<UChar, 32> m_bufferedEndTagName;
-
- // http://www.whatwg.org/specs/web-apps/current-work/#additional-allowed-character
- UChar m_additionalAllowedCharacter;
-
- // http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
- InputStreamPreprocessor m_inputStreamPreprocessor;
- };
-
-}
-
-#endif
diff --git a/WebCore/html/HTML5TreeBuilder.cpp b/WebCore/html/HTML5TreeBuilder.cpp
deleted file mode 100644
index 79e1e0e..0000000
--- a/WebCore/html/HTML5TreeBuilder.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Copyright (C) 2010 Google, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "HTML5TreeBuilder.h"
-
-#include "Element.h"
-#include "HTML5Lexer.h"
-#include "HTML5Token.h"
-#include "HTMLDocument.h"
-#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
-#include "HTMLDocumentParser.h"
-#include "NotImplemented.h"
-#include <wtf/UnusedParam.h>
-
-namespace WebCore {
-
-using namespace HTMLNames;
-
-static const int uninitializedLineNumberValue = -1;
-
-HTML5TreeBuilder::HTML5TreeBuilder(HTML5Lexer* lexer, HTMLDocument* document, bool reportErrors)
- : m_document(document)
- , m_reportErrors(reportErrors)
- , m_isPaused(false)
- , m_insertionMode(Initial)
- , m_lexer(lexer)
- , m_legacyTreeConstructor(new LegacyHTMLTreeConstructor(document, reportErrors))
- , m_lastScriptElementStartLine(uninitializedLineNumberValue)
- , m_scriptToProcessStartLine(uninitializedLineNumberValue)
-{
-}
-
-HTML5TreeBuilder::~HTML5TreeBuilder()
-{
-}
-
-static void convertToOldStyle(HTML5Token& token, Token& oldStyleToken)
-{
- switch (token.type()) {
- case HTML5Token::Uninitialized:
- case HTML5Token::DOCTYPE:
- ASSERT_NOT_REACHED();
- break;
- case HTML5Token::EndOfFile:
- ASSERT_NOT_REACHED();
- notImplemented();
- break;
- case HTML5Token::StartTag:
- case HTML5Token::EndTag: {
- oldStyleToken.beginTag = (token.type() == HTML5Token::StartTag);
- oldStyleToken.selfClosingTag = token.selfClosing();
- oldStyleToken.tagName = AtomicString(token.name().data(), token.name().size());
- HTML5Token::AttributeList& attributes = token.attributes();
- for (HTML5Token::AttributeList::iterator iter = attributes.begin();
- iter != attributes.end(); ++iter) {
- if (!iter->m_name.isEmpty()) {
- String name = String(StringImpl::adopt(iter->m_name));
- String value = String(StringImpl::adopt(iter->m_value));
- RefPtr<Attribute> mappedAttribute = Attribute::createMapped(name, value);
- if (!oldStyleToken.attrs)
- oldStyleToken.attrs = NamedNodeMap::create();
- oldStyleToken.attrs->insertAttribute(mappedAttribute.release(), false);
- }
- }
- break;
- }
- case HTML5Token::Comment:
- oldStyleToken.tagName = commentAtom;
- oldStyleToken.text = StringImpl::create(token.comment().data(), token.comment().size());
- break;
- case HTML5Token::Character:
- oldStyleToken.tagName = textAtom;
- oldStyleToken.text = StringImpl::create(token.characters().data(), token.characters().size());
- break;
- }
-}
-
-void HTML5TreeBuilder::handleScriptStartTag()
-{
- notImplemented(); // The HTML frgment case?
- m_lexer->setState(HTML5Lexer::ScriptDataState);
- notImplemented(); // Save insertion mode.
-}
-
-void HTML5TreeBuilder::handleScriptEndTag(Element* scriptElement, int scriptStartLine)
-{
- ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess!
- ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess!
- notImplemented(); // Save insertion mode and insertion point?
-
- // Pause ourselves so that parsing stops until the script can be processed by the caller.
- m_isPaused = true;
- m_scriptToProcess = scriptElement;
- // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines,
- // so we convert here before passing the line number off to HTML5ScriptRunner.
- m_scriptToProcessStartLine = scriptStartLine + 1;
-}
-
-PassRefPtr<Element> HTML5TreeBuilder::takeScriptToProcess(int& scriptStartLine)
-{
- // Unpause ourselves, callers may pause us again when processing the script.
- // The HTML5 spec is written as though scripts are executed inside the tree
- // builder. We pause the parser to exit the tree builder, and then resume
- // before running scripts.
- m_isPaused = false;
- scriptStartLine = m_scriptToProcessStartLine;
- m_scriptToProcessStartLine = uninitializedLineNumberValue;
- return m_scriptToProcess.release();
-}
-
-PassRefPtr<Node> HTML5TreeBuilder::passTokenToLegacyParser(HTML5Token& token)
-{
- if (token.type() == HTML5Token::DOCTYPE) {
- DoctypeToken doctypeToken;
- doctypeToken.m_name.append(token.name().data(), token.name().size());
- doctypeToken.m_publicID = token.publicIdentifier();
- doctypeToken.m_systemID = token.systemIdentifier();
- doctypeToken.m_forceQuirks = token.forceQuirks();
-
- m_legacyTreeConstructor->parseDoctypeToken(&doctypeToken);
- return 0;
- }
-
- // For now, we translate into an old-style token for testing.
- Token oldStyleToken;
- convertToOldStyle(token, oldStyleToken);
-
- RefPtr<Node> result = m_legacyTreeConstructor->parseToken(&oldStyleToken);
- if (token.type() == HTML5Token::StartTag) {
- // This work is supposed to be done by the parser, but
- // when using the old parser for we have to do this manually.
- if (oldStyleToken.tagName == scriptTag) {
- handleScriptStartTag();
- m_lastScriptElement = static_pointer_cast<Element>(result);
- m_lastScriptElementStartLine = m_lexer->lineNumber();
- } else if (oldStyleToken.tagName == textareaTag || oldStyleToken.tagName == titleTag)
- m_lexer->setState(HTML5Lexer::RCDATAState);
- else if (oldStyleToken.tagName == styleTag || oldStyleToken.tagName == iframeTag
- || oldStyleToken.tagName == xmpTag || oldStyleToken.tagName == noembedTag) {
- // FIXME: noscript and noframes may conditionally enter this state as well.
- m_lexer->setState(HTML5Lexer::RAWTEXTState);
- } else if (oldStyleToken.tagName == plaintextTag)
- m_lexer->setState(HTML5Lexer::PLAINTEXTState);
- else if (oldStyleToken.tagName == preTag || oldStyleToken.tagName == listingTag)
- m_lexer->skipLeadingNewLineForListing();
- }
- if (token.type() == HTML5Token::EndTag) {
- if (oldStyleToken.tagName == scriptTag && insertionMode() != AfterFrameset) {
- if (m_lastScriptElement) {
- ASSERT(m_lastScriptElementStartLine != uninitializedLineNumberValue);
- handleScriptEndTag(m_lastScriptElement.get(), m_lastScriptElementStartLine);
- m_lastScriptElement = 0;
- m_lastScriptElementStartLine = uninitializedLineNumberValue;
- }
- } else if (oldStyleToken.tagName == framesetTag)
- setInsertionMode(AfterFrameset);
- }
- return result.release();
-}
-
-PassRefPtr<Node> HTML5TreeBuilder::constructTreeFromToken(HTML5Token& token)
-{
- // Make MSVC ignore our unreachable code for now.
- if (true)
- return passTokenToLegacyParser(token);
-
- // HTML5 expects the tokenizer to call the parser every time a character is
- // emitted. We instead collect characters and call the parser with a batch.
- // In order to make our first-pass parser code simple, processToken matches
- // the spec in only handling one character at a time.
- if (token.type() == HTML5Token::Character) {
- HTML5Token::DataVector characters = token.characters();
- HTML5Token::DataVector::const_iterator itr = characters.begin();
- for (;itr; ++itr)
- processToken(token, *itr);
- return 0; // FIXME: Should we be returning the Text node?
- }
- return processToken(token);
-}
-
-PassRefPtr<Node> HTML5TreeBuilder::processToken(HTML5Token& token, UChar currentCharacter)
-{
- UNUSED_PARAM(token);
- UNUSED_PARAM(currentCharacter);
- // Implementation coming in the next patch.
- return 0;
-}
-
-void HTML5TreeBuilder::finished()
-{
- // We should call m_document->finishedParsing() here, except
- // m_legacyTreeConstructor->finished() does it for us.
- m_legacyTreeConstructor->finished();
-}
-
-}
diff --git a/WebCore/html/HTMLAnchorElement.cpp b/WebCore/html/HTMLAnchorElement.cpp
index d5faf8f..6f9b17c 100644
--- a/WebCore/html/HTMLAnchorElement.cpp
+++ b/WebCore/html/HTMLAnchorElement.cpp
@@ -42,7 +42,7 @@ namespace WebCore {
using namespace HTMLNames;
HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document* document)
- : HTMLElement(tagName, document, CreateHTMLElement)
+ : HTMLElement(tagName, document)
, m_wasShiftKeyDownOnMouseDown(false)
, m_linkRelations(0)
{
diff --git a/WebCore/html/HTMLAnchorElement.idl b/WebCore/html/HTMLAnchorElement.idl
index 03b3986..846162f 100644
--- a/WebCore/html/HTMLAnchorElement.idl
+++ b/WebCore/html/HTMLAnchorElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,17 +21,17 @@
module html {
interface HTMLAnchorElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect=accesskey] DOMString accessKey;
- attribute [ConvertNullToNullString, Reflect] DOMString charset;
- attribute [ConvertNullToNullString, Reflect] DOMString coords;
- attribute [ConvertNullToNullString, ReflectURL] DOMString href;
- attribute [ConvertNullToNullString, Reflect] DOMString hreflang;
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString rel;
- attribute [ConvertNullToNullString, Reflect] DOMString rev;
- attribute [ConvertNullToNullString, Reflect] DOMString shape;
- attribute [ConvertNullToNullString, Reflect] DOMString target;
- attribute [ConvertNullToNullString, Reflect] DOMString type;
+ attribute [Reflect] DOMString accessKey;
+ attribute [Reflect] DOMString charset;
+ attribute [Reflect] DOMString coords;
+ attribute [ReflectURL] DOMString href;
+ attribute [Reflect] DOMString hreflang;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString rel;
+ attribute [Reflect] DOMString rev;
+ attribute [Reflect] DOMString shape;
+ attribute [Reflect] DOMString target;
+ attribute [Reflect] DOMString type;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
readonly attribute DOMString hash;
diff --git a/WebCore/html/HTMLAppletElement.idl b/WebCore/html/HTMLAppletElement.idl
index f5984f0..388b5cb 100644
--- a/WebCore/html/HTMLAppletElement.idl
+++ b/WebCore/html/HTMLAppletElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -25,25 +25,25 @@ module html {
DelegatingGetOwnPropertySlot,
CustomCall
] HTMLAppletElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString align;
- attribute [ConvertNullToNullString, Reflect] DOMString alt;
- attribute [ConvertNullToNullString, Reflect] DOMString archive;
- attribute [ConvertNullToNullString, Reflect] DOMString code;
- attribute [ConvertNullToNullString, Reflect=codebase] DOMString codeBase;
- attribute [ConvertNullToNullString, Reflect] DOMString height;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString archive;
+ attribute [Reflect] DOMString code;
+ attribute [Reflect] DOMString codeBase;
+ attribute [Reflect] DOMString height;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- attribute [ConvertNullToNullString, Reflect] DOMString hspace;
+ attribute [Reflect] DOMString hspace;
#else
- attribute [ConvertFromString] long hspace;
+ attribute [Reflect] long hspace;
#endif
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString object;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString object;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- attribute [ConvertNullToNullString, Reflect] DOMString vspace;
+ attribute [Reflect] DOMString vspace;
#else
- attribute [ConvertFromString] long vspace;
+ attribute [Reflect] long vspace;
#endif
- attribute [ConvertNullToNullString, Reflect] DOMString width;
+ attribute [Reflect] DOMString width;
};
}
diff --git a/WebCore/html/HTMLAreaElement.idl b/WebCore/html/HTMLAreaElement.idl
index 210d6e5..0f6fd72 100644
--- a/WebCore/html/HTMLAreaElement.idl
+++ b/WebCore/html/HTMLAreaElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,13 +21,13 @@
module html {
interface HTMLAreaElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect=accesskey] DOMString accessKey;
- attribute [ConvertNullToNullString, Reflect] DOMString alt;
- attribute [ConvertNullToNullString, Reflect] DOMString coords;
- attribute [ConvertNullToNullString, ReflectURL] DOMString href;
- attribute boolean noHref;
- attribute [ConvertNullToNullString, Reflect] DOMString shape;
- attribute [ConvertNullToNullString, Reflect] DOMString target;
+ attribute [Reflect] DOMString accessKey;
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString coords;
+ attribute [ReflectURL] DOMString href;
+ attribute [Reflect] boolean noHref;
+ attribute [Reflect] DOMString shape;
+ attribute [Reflect] DOMString target;
// IE Extensions
readonly attribute DOMString hash;
diff --git a/WebCore/html/HTMLAttributeNames.in b/WebCore/html/HTMLAttributeNames.in
index 90b249a..b45ba9e 100644
--- a/WebCore/html/HTMLAttributeNames.in
+++ b/WebCore/html/HTMLAttributeNames.in
@@ -43,6 +43,7 @@ aria-valuemax
aria-valuemin
aria-valuenow
aria-valuetext
+async
autocomplete
autofocus
autoplay
@@ -254,6 +255,7 @@ size
sortable
sortdirection
span
+speech
spellcheck
src
standby
diff --git a/WebCore/html/HTMLAudioElement.cpp b/WebCore/html/HTMLAudioElement.cpp
index 0b229ff..d94e146 100644
--- a/WebCore/html/HTMLAudioElement.cpp
+++ b/WebCore/html/HTMLAudioElement.cpp
@@ -43,12 +43,12 @@ HTMLAudioElement::HTMLAudioElement(const QualifiedName& tagName, Document* docum
PassRefPtr<HTMLAudioElement> HTMLAudioElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLAudioElement(tagName, document);
+ return adoptRef(new HTMLAudioElement(tagName, document));
}
PassRefPtr<HTMLAudioElement> HTMLAudioElement::createForJSConstructor(Document* document, const String& src)
{
- RefPtr<HTMLAudioElement> audio = new HTMLAudioElement(audioTag, document);
+ RefPtr<HTMLAudioElement> audio = adoptRef(new HTMLAudioElement(audioTag, document));
audio->setPreload("auto");
if (!src.isNull()) {
audio->setSrc(src);
diff --git a/WebCore/html/HTMLBRElement.cpp b/WebCore/html/HTMLBRElement.cpp
index 88ddf3b..e8f4520 100644
--- a/WebCore/html/HTMLBRElement.cpp
+++ b/WebCore/html/HTMLBRElement.cpp
@@ -40,12 +40,12 @@ HTMLBRElement::HTMLBRElement(const QualifiedName& tagName, Document* document)
PassRefPtr<HTMLBRElement> HTMLBRElement::create(Document* document)
{
- return new HTMLBRElement(brTag, document);
+ return adoptRef(new HTMLBRElement(brTag, document));
}
PassRefPtr<HTMLBRElement> HTMLBRElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLBRElement(tagName, document);
+ return adoptRef(new HTMLBRElement(tagName, document));
}
bool HTMLBRElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLBRElement.idl b/WebCore/html/HTMLBRElement.idl
index 4048911..a6d215d 100644
--- a/WebCore/html/HTMLBRElement.idl
+++ b/WebCore/html/HTMLBRElement.idl
@@ -20,7 +20,7 @@
module html {
interface HTMLBRElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString clear;
+ attribute [Reflect] DOMString clear;
};
}
diff --git a/WebCore/html/HTMLBaseElement.cpp b/WebCore/html/HTMLBaseElement.cpp
index 184b9fc..a3095d1 100644
--- a/WebCore/html/HTMLBaseElement.cpp
+++ b/WebCore/html/HTMLBaseElement.cpp
@@ -42,7 +42,7 @@ inline HTMLBaseElement::HTMLBaseElement(const QualifiedName& tagName, Document*
PassRefPtr<HTMLBaseElement> HTMLBaseElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLBaseElement(tagName, document);
+ return adoptRef(new HTMLBaseElement(tagName, document));
}
void HTMLBaseElement::parseMappedAttribute(Attribute* attr)
diff --git a/WebCore/html/HTMLBaseElement.idl b/WebCore/html/HTMLBaseElement.idl
index 087faca..8bf82a9 100644
--- a/WebCore/html/HTMLBaseElement.idl
+++ b/WebCore/html/HTMLBaseElement.idl
@@ -20,8 +20,8 @@
module html {
interface HTMLBaseElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString href;
- attribute [ConvertNullToNullString, Reflect] DOMString target;
+ attribute [Reflect] DOMString href;
+ attribute [Reflect] DOMString target;
};
}
diff --git a/WebCore/html/HTMLBaseFontElement.cpp b/WebCore/html/HTMLBaseFontElement.cpp
index 1ac9ce6..39a5591 100644
--- a/WebCore/html/HTMLBaseFontElement.cpp
+++ b/WebCore/html/HTMLBaseFontElement.cpp
@@ -37,7 +37,7 @@ inline HTMLBaseFontElement::HTMLBaseFontElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLBaseFontElement> HTMLBaseFontElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLBaseFontElement(tagName, document);
+ return adoptRef(new HTMLBaseFontElement(tagName, document));
}
int HTMLBaseFontElement::size() const
diff --git a/WebCore/html/HTMLBaseFontElement.idl b/WebCore/html/HTMLBaseFontElement.idl
index d55654e..a0ac127 100644
--- a/WebCore/html/HTMLBaseFontElement.idl
+++ b/WebCore/html/HTMLBaseFontElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,12 +20,12 @@
module html {
interface HTMLBaseFontElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString color;
- attribute [ConvertNullToNullString, Reflect] DOMString face;
+ attribute [Reflect] DOMString color;
+ attribute [Reflect] DOMString face;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
attribute [ConvertToString] DOMString size; // this changed to a long, but our existing API is a string
#else
- attribute long size;
+ attribute [Reflect] long size;
#endif
};
}
diff --git a/WebCore/html/HTMLBlockquoteElement.cpp b/WebCore/html/HTMLBlockquoteElement.cpp
index 88437d8..cacd8b4 100644
--- a/WebCore/html/HTMLBlockquoteElement.cpp
+++ b/WebCore/html/HTMLBlockquoteElement.cpp
@@ -37,12 +37,12 @@ HTMLBlockquoteElement::HTMLBlockquoteElement(const QualifiedName& tagName, Docum
PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(Document* document)
{
- return new HTMLBlockquoteElement(blockquoteTag, document);
+ return adoptRef(new HTMLBlockquoteElement(blockquoteTag, document));
}
PassRefPtr<HTMLBlockquoteElement> HTMLBlockquoteElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLBlockquoteElement(tagName, document);
+ return adoptRef(new HTMLBlockquoteElement(tagName, document));
}
}
diff --git a/WebCore/html/HTMLBlockquoteElement.idl b/WebCore/html/HTMLBlockquoteElement.idl
index b819236..f0045c7 100644
--- a/WebCore/html/HTMLBlockquoteElement.idl
+++ b/WebCore/html/HTMLBlockquoteElement.idl
@@ -20,7 +20,7 @@
module html {
interface HTMLBlockquoteElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString cite;
+ attribute [Reflect] DOMString cite;
};
}
diff --git a/WebCore/html/HTMLBodyElement.cpp b/WebCore/html/HTMLBodyElement.cpp
index d52ab6e..35dbd9d 100644
--- a/WebCore/html/HTMLBodyElement.cpp
+++ b/WebCore/html/HTMLBodyElement.cpp
@@ -52,12 +52,12 @@ HTMLBodyElement::HTMLBodyElement(const QualifiedName& tagName, Document* documen
PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(Document* document)
{
- return new HTMLBodyElement(bodyTag, document);
+ return adoptRef(new HTMLBodyElement(bodyTag, document));
}
PassRefPtr<HTMLBodyElement> HTMLBodyElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLBodyElement(tagName, document);
+ return adoptRef(new HTMLBodyElement(tagName, document));
}
HTMLBodyElement::~HTMLBodyElement()
diff --git a/WebCore/html/HTMLBodyElement.idl b/WebCore/html/HTMLBodyElement.idl
index c92dcd3..4709e3f 100644
--- a/WebCore/html/HTMLBodyElement.idl
+++ b/WebCore/html/HTMLBodyElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,12 +21,12 @@
module html {
interface HTMLBodyElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect=alink] DOMString aLink;
- attribute [ConvertNullToNullString, Reflect] DOMString background;
- attribute [ConvertNullToNullString, Reflect=bgcolor] DOMString bgColor;
- attribute [ConvertNullToNullString, Reflect] DOMString link;
- attribute [ConvertNullToNullString, Reflect] DOMString text;
- attribute [ConvertNullToNullString, Reflect=vlink] DOMString vLink;
+ attribute [Reflect] DOMString aLink;
+ attribute [Reflect] DOMString background;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect] DOMString link;
+ attribute [Reflect] DOMString text;
+ attribute [Reflect] DOMString vLink;
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
// Event handler attributes
diff --git a/WebCore/html/HTMLButtonElement.cpp b/WebCore/html/HTMLButtonElement.cpp
index 2775b82..9f2cc9d 100644
--- a/WebCore/html/HTMLButtonElement.cpp
+++ b/WebCore/html/HTMLButtonElement.cpp
@@ -50,7 +50,7 @@ inline HTMLButtonElement::HTMLButtonElement(const QualifiedName& tagName, Docume
PassRefPtr<HTMLButtonElement> HTMLButtonElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLButtonElement(tagName, document, form);
+ return adoptRef(new HTMLButtonElement(tagName, document, form));
}
RenderObject* HTMLButtonElement::createRenderer(RenderArena* arena, RenderStyle*)
diff --git a/WebCore/html/HTMLButtonElement.idl b/WebCore/html/HTMLButtonElement.idl
index cf9f648..279e858 100644
--- a/WebCore/html/HTMLButtonElement.idl
+++ b/WebCore/html/HTMLButtonElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,21 +21,26 @@
module html {
interface HTMLButtonElement : HTMLElement {
- readonly attribute HTMLFormElement form;
- attribute boolean formNoValidate;
- readonly attribute ValidityState validity;
- attribute [ConvertNullToNullString] DOMString accessKey;
- attribute boolean disabled;
- attribute boolean autofocus;
- attribute [ConvertNullToNullString] DOMString name;
- readonly attribute DOMString type;
- attribute [ConvertNullToNullString] DOMString value;
- readonly attribute boolean willValidate;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
+ readonly attribute HTMLFormElement form;
+
+ attribute [Reflect] boolean formNoValidate;
+ readonly attribute ValidityState validity;
+
+ attribute [Reflect] DOMString accessKey;
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] boolean autofocus;
+ attribute [Reflect] DOMString name;
+ readonly attribute DOMString type;
+ attribute [Reflect] DOMString value;
+
+ readonly attribute boolean willValidate;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+
void click();
- readonly attribute NodeList labels;
+
+ readonly attribute NodeList labels;
};
}
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 72343aa..c1bf8ec 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -65,12 +65,12 @@ HTMLCanvasElement::HTMLCanvasElement(const QualifiedName& tagName, Document* doc
PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(Document* document)
{
- return new HTMLCanvasElement(canvasTag, document);
+ return adoptRef(new HTMLCanvasElement(canvasTag, document));
}
PassRefPtr<HTMLCanvasElement> HTMLCanvasElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLCanvasElement(tagName, document);
+ return adoptRef(new HTMLCanvasElement(tagName, document));
}
HTMLCanvasElement::~HTMLCanvasElement()
diff --git a/WebCore/html/HTMLDListElement.cpp b/WebCore/html/HTMLDListElement.cpp
index e3720e0..1a9d5a2 100644
--- a/WebCore/html/HTMLDListElement.cpp
+++ b/WebCore/html/HTMLDListElement.cpp
@@ -37,7 +37,7 @@ inline HTMLDListElement::HTMLDListElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLDListElement> HTMLDListElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLDListElement(tagName, document);
+ return adoptRef(new HTMLDListElement(tagName, document));
}
bool HTMLDListElement::compact() const
diff --git a/WebCore/html/HTMLDListElement.idl b/WebCore/html/HTMLDListElement.idl
index 57c5c57..1a9326f 100644
--- a/WebCore/html/HTMLDListElement.idl
+++ b/WebCore/html/HTMLDListElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLDListElement : HTMLElement {
- attribute boolean compact;
+ attribute [Reflect] boolean compact;
};
}
diff --git a/WebCore/html/HTMLDataGridCellElement.cpp b/WebCore/html/HTMLDataGridCellElement.cpp
index 3085680..9596d63 100644
--- a/WebCore/html/HTMLDataGridCellElement.cpp
+++ b/WebCore/html/HTMLDataGridCellElement.cpp
@@ -42,7 +42,7 @@ inline HTMLDataGridCellElement::HTMLDataGridCellElement(const QualifiedName& nam
PassRefPtr<HTMLDataGridCellElement> HTMLDataGridCellElement::create(const QualifiedName& name, Document* document)
{
- return new HTMLDataGridCellElement(name, document);
+ return adoptRef(new HTMLDataGridCellElement(name, document));
}
String HTMLDataGridCellElement::label() const
diff --git a/WebCore/html/HTMLDataGridColElement.cpp b/WebCore/html/HTMLDataGridColElement.cpp
index 8486d4d..196c7b6 100644
--- a/WebCore/html/HTMLDataGridColElement.cpp
+++ b/WebCore/html/HTMLDataGridColElement.cpp
@@ -46,7 +46,7 @@ inline HTMLDataGridColElement::HTMLDataGridColElement(const QualifiedName& name,
PassRefPtr<HTMLDataGridColElement> HTMLDataGridColElement::create(const QualifiedName& name, Document* document)
{
- return new HTMLDataGridColElement(name, document);
+ return adoptRef(new HTMLDataGridColElement(name, document));
}
HTMLDataGridElement* HTMLDataGridColElement::findDataGridAncestor() const
diff --git a/WebCore/html/HTMLDataGridElement.cpp b/WebCore/html/HTMLDataGridElement.cpp
index 5753748..82edf8f 100644
--- a/WebCore/html/HTMLDataGridElement.cpp
+++ b/WebCore/html/HTMLDataGridElement.cpp
@@ -47,7 +47,7 @@ inline HTMLDataGridElement::HTMLDataGridElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLDataGridElement> HTMLDataGridElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLDataGridElement(tagName, document);
+ return adoptRef(new HTMLDataGridElement(tagName, document));
}
HTMLDataGridElement::~HTMLDataGridElement()
diff --git a/WebCore/html/HTMLDataGridRowElement.cpp b/WebCore/html/HTMLDataGridRowElement.cpp
index bab2a92..8e08c7c 100644
--- a/WebCore/html/HTMLDataGridRowElement.cpp
+++ b/WebCore/html/HTMLDataGridRowElement.cpp
@@ -42,7 +42,7 @@ inline HTMLDataGridRowElement::HTMLDataGridRowElement(const QualifiedName& name,
PassRefPtr<HTMLDataGridRowElement> HTMLDataGridRowElement::create(const QualifiedName& name, Document* document)
{
- return new HTMLDataGridRowElement(name, document);
+ return adoptRef(new HTMLDataGridRowElement(name, document));
}
bool HTMLDataGridRowElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLDataListElement.cpp b/WebCore/html/HTMLDataListElement.cpp
index a9a60a1..3404348 100644
--- a/WebCore/html/HTMLDataListElement.cpp
+++ b/WebCore/html/HTMLDataListElement.cpp
@@ -44,7 +44,7 @@ inline HTMLDataListElement::HTMLDataListElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLDataListElement> HTMLDataListElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLDataListElement(tagName, document);
+ return adoptRef(new HTMLDataListElement(tagName, document));
}
bool HTMLDataListElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLDirectoryElement.idl b/WebCore/html/HTMLDirectoryElement.idl
index c88e2e0..b096974 100644
--- a/WebCore/html/HTMLDirectoryElement.idl
+++ b/WebCore/html/HTMLDirectoryElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLDirectoryElement : HTMLElement {
- attribute boolean compact;
+ attribute [Reflect] boolean compact;
};
}
diff --git a/WebCore/html/HTMLDivElement.cpp b/WebCore/html/HTMLDivElement.cpp
index 72f532f..f35b25b 100644
--- a/WebCore/html/HTMLDivElement.cpp
+++ b/WebCore/html/HTMLDivElement.cpp
@@ -40,12 +40,12 @@ HTMLDivElement::HTMLDivElement(const QualifiedName& tagName, Document* document)
PassRefPtr<HTMLDivElement> HTMLDivElement::create(Document* document)
{
- return new HTMLDivElement(divTag, document);
+ return adoptRef(new HTMLDivElement(divTag, document));
}
PassRefPtr<HTMLDivElement> HTMLDivElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLDivElement(tagName, document);
+ return adoptRef(new HTMLDivElement(tagName, document));
}
bool HTMLDivElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLDivElement.idl b/WebCore/html/HTMLDivElement.idl
index 9f0b581..90fb84f 100644
--- a/WebCore/html/HTMLDivElement.idl
+++ b/WebCore/html/HTMLDivElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLDivElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString align;
+ attribute [Reflect] DOMString align;
};
}
diff --git a/WebCore/html/HTMLDocument.cpp b/WebCore/html/HTMLDocument.cpp
index b066f8a..bc9de97 100644
--- a/WebCore/html/HTMLDocument.cpp
+++ b/WebCore/html/HTMLDocument.cpp
@@ -64,11 +64,11 @@
#include "FrameLoader.h"
#include "FrameTree.h"
#include "FrameView.h"
-#include "HTML5DocumentParser.h"
+#include "HTMLDocumentParser.h"
#include "HTMLBodyElement.h"
#include "HTMLElementFactory.h"
#include "HTMLNames.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
#include "InspectorController.h"
#include "KURL.h"
#include "Page.h"
@@ -81,8 +81,8 @@ namespace WebCore {
using namespace HTMLNames;
-HTMLDocument::HTMLDocument(Frame* frame)
- : Document(frame, false, true)
+HTMLDocument::HTMLDocument(Frame* frame, const KURL& url)
+ : Document(frame, url, false, true)
{
clearXMLVersion();
setParseMode(Compat);
@@ -292,9 +292,9 @@ DocumentParser* HTMLDocument::createParser()
#endif
if (settings() && settings()->html5ParserEnabled())
- return new HTML5DocumentParser(this, reportErrors);
+ return new HTMLDocumentParser(this, reportErrors);
- return new HTMLDocumentParser(this, reportErrors);
+ return new LegacyHTMLDocumentParser(this, reportErrors);
}
// --------------------------------------------------------------------------
diff --git a/WebCore/html/HTMLDocument.h b/WebCore/html/HTMLDocument.h
index 5b1f636..646e100 100644
--- a/WebCore/html/HTMLDocument.h
+++ b/WebCore/html/HTMLDocument.h
@@ -35,9 +35,9 @@ class HTMLElement;
class HTMLDocument : public Document, public CachedResourceClient {
public:
- static PassRefPtr<HTMLDocument> create(Frame* frame)
+ static PassRefPtr<HTMLDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new HTMLDocument(frame));
+ return adoptRef(new HTMLDocument(frame, url));
}
virtual ~HTMLDocument();
@@ -80,7 +80,7 @@ public:
bool hasExtraNamedItem(AtomicStringImpl* name);
protected:
- HTMLDocument(Frame*);
+ HTMLDocument(Frame*, const KURL&);
#ifdef ANDROID_INSTRUMENT
// Overridden to resolve the ambiguous
diff --git a/WebCore/html/HTMLDocumentParser.cpp b/WebCore/html/HTMLDocumentParser.cpp
index e59cb74..79ca805 100644
--- a/WebCore/html/HTMLDocumentParser.cpp
+++ b/WebCore/html/HTMLDocumentParser.cpp
@@ -1,60 +1,44 @@
/*
- Copyright (C) 1997 Martin Jones (mjones@kde.org)
- (C) 1997 Torben Weis (weis@kde.org)
- (C) 1998 Waldo Bastian (bastian@kde.org)
- (C) 1999 Lars Knoll (knoll@kde.org)
- (C) 1999 Antti Koivisto (koivisto@kde.org)
- (C) 2001 Dirk Mueller (mueller@kde.org)
- Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
- Copyright (C) 2005, 2006 Alexey Proskuryakov (ap@nypop.com)
- Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
#include "config.h"
#include "HTMLDocumentParser.h"
-#include "Attribute.h"
-#include "CSSHelper.h"
-#include "Cache.h"
-#include "CachedScript.h"
-#include "DocLoader.h"
#include "DocumentFragment.h"
-#include "Event.h"
-#include "EventNames.h"
+#include "Element.h"
#include "Frame.h"
-#include "FrameLoader.h"
-#include "FrameView.h"
-#include "HTMLElement.h"
-#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
-#include "HTMLScriptElement.h"
-#include "HTMLViewSourceDocument.h"
-#include "ImageLoader.h"
-#include "InspectorTimelineAgent.h"
-#include "Page.h"
-#include "PreloadScanner.h"
-#include "ScriptController.h"
-#include "ScriptSourceCode.h"
-#include "ScriptValue.h"
+#include "HTMLParserScheduler.h"
+#include "HTMLTokenizer.h"
+#include "HTMLPreloadScanner.h"
+#include "HTMLScriptRunner.h"
+#include "HTMLTreeBuilder.h"
+#include "HTMLDocument.h"
#include "XSSAuditor.h"
-#include <wtf/ASCIICType.h>
#include <wtf/CurrentTime.h>
+<<<<<<< HEAD
#include "HTMLEntityNames.cpp"
#ifdef ANDROID_INSTRUMENT
@@ -65,361 +49,86 @@
using namespace WTF;
using namespace std;
+=======
+#if ENABLE(INSPECTOR)
+#include "InspectorTimelineAgent.h"
+#endif
+>>>>>>> webkit.org at r61871
namespace WebCore {
-using namespace HTMLNames;
-
-// This value is used to define how many characters the parser will process before
-// yeilding control.
-// To increase responsivness reduce the parser chunk size.
-static const int defaultTokenizerChunkSize = 4096;
-
-// FIXME: We would like this constant to be 200ms.
-// Yielding more aggressively results in increased responsiveness and better incremental rendering.
-// It slows down overall page-load on slower machines, though, so for now we set a value of 500.
-// For smaller chunks (above) decrease the value of TimerDelay as the the parser should not
-// yield for as long a period otherwise it will take way to long to load a page.
-static const double defaultTokenizerTimeDelay = 0.500;
-
-static const char commentStart [] = "<!--";
-static const char doctypeStart [] = "<!doctype";
-static const char publicStart [] = "public";
-static const char systemStart [] = "system";
-static const char scriptEnd [] = "</script";
-static const char xmpEnd [] = "</xmp";
-static const char styleEnd [] = "</style";
-static const char textareaEnd [] = "</textarea";
-static const char titleEnd [] = "</title";
-static const char iframeEnd [] = "</iframe";
-
-// Full support for MS Windows extensions to Latin-1.
-// Technically these extensions should only be activated for pages
-// marked "windows-1252" or "cp1252", but
-// in the standard Microsoft way, these extensions infect hundreds of thousands
-// of web pages. Note that people with non-latin-1 Microsoft extensions
-// are SOL.
-//
-// See: http://www.microsoft.com/globaldev/reference/WinCP.asp
-// http://www.bbsinc.com/iso8859.html
-// http://www.obviously.com/
-//
-// There may be better equivalents
-
-// We only need this for entities. For non-entity text, we handle this in the text encoding.
-
-static const UChar windowsLatin1ExtensionArray[32] = {
- 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, // 80-87
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, // 88-8F
- 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, // 90-97
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178 // 98-9F
-};
-
-static inline UChar fixUpChar(UChar c)
-{
- if ((c & ~0x1F) != 0x0080)
- return c;
- return windowsLatin1ExtensionArray[c - 0x80];
-}
+namespace {
-static inline bool tagMatch(const char* s1, const UChar* s2, unsigned length)
-{
- for (unsigned i = 0; i != length; ++i) {
- unsigned char c1 = s1[i];
- unsigned char uc1 = toASCIIUpper(static_cast<char>(c1));
- UChar c2 = s2[i];
- if (c1 != c2 && uc1 != c2)
- return false;
+class NestingLevelIncrementer : public Noncopyable {
+public:
+ explicit NestingLevelIncrementer(int& counter)
+ : m_counter(&counter)
+ {
+ ++(*m_counter);
}
- return true;
-}
-inline void Token::addAttribute(AtomicString& attrName, const AtomicString& attributeValue, bool viewSourceMode)
-{
- if (!attrName.isEmpty()) {
- ASSERT(!attrName.contains('/'));
- RefPtr<Attribute> a = Attribute::createMapped(attrName, attributeValue);
- if (!attrs) {
- attrs = NamedNodeMap::create();
- attrs->reserveInitialCapacity(10);
- }
- attrs->insertAttribute(a.release(), viewSourceMode);
+ ~NestingLevelIncrementer()
+ {
+ --(*m_counter);
}
- attrName = emptyAtom;
-}
+private:
+ int* m_counter;
+};
-// ----------------------------------------------------------------------------
-
-HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* doc, bool reportErrors)
- : DocumentParser()
- , m_buffer(0)
- , m_scriptCode(0)
- , m_scriptCodeSize(0)
- , m_scriptCodeCapacity(0)
- , m_scriptCodeResync(0)
- , m_executingScript(0)
- , m_requestingScript(false)
- , m_hasScriptsWaitingForStylesheets(false)
- , m_timer(this, &HTMLDocumentParser::timerFired)
- , m_externalScriptsTimer(this, &HTMLDocumentParser::executeExternalScriptsTimerFired)
- , m_doc(doc)
- , m_treeConstructor(new LegacyHTMLTreeConstructor(doc, reportErrors))
- , m_inWrite(false)
- , m_fragment(false)
- , m_scriptingPermission(FragmentScriptingAllowed)
-{
- begin();
-}
+} // namespace
-HTMLDocumentParser::HTMLDocumentParser(HTMLViewSourceDocument* doc)
- : DocumentParser(true)
- , m_buffer(0)
- , m_scriptCode(0)
- , m_scriptCodeSize(0)
- , m_scriptCodeCapacity(0)
- , m_scriptCodeResync(0)
- , m_executingScript(0)
- , m_requestingScript(false)
- , m_hasScriptsWaitingForStylesheets(false)
- , m_timer(this, &HTMLDocumentParser::timerFired)
- , m_externalScriptsTimer(this, &HTMLDocumentParser::executeExternalScriptsTimerFired)
- , m_doc(doc)
- , m_inWrite(false)
- , m_fragment(false)
- , m_scriptingPermission(FragmentScriptingAllowed)
+HTMLDocumentParser::HTMLDocumentParser(HTMLDocument* document, bool reportErrors)
+ : DocumentParser(document)
+ , m_tokenizer(new HTMLTokenizer)
+ , m_scriptRunner(new HTMLScriptRunner(document, this))
+ , m_treeBuilder(new HTMLTreeBuilder(m_tokenizer.get(), document, reportErrors))
+ , m_parserScheduler(new HTMLParserScheduler(this))
+ , m_endWasDelayed(false)
+ , m_writeNestingLevel(0)
{
begin();
}
-HTMLDocumentParser::HTMLDocumentParser(DocumentFragment* frag, FragmentScriptingPermission scriptingPermission)
- : m_buffer(0)
- , m_scriptCode(0)
- , m_scriptCodeSize(0)
- , m_scriptCodeCapacity(0)
- , m_scriptCodeResync(0)
- , m_executingScript(0)
- , m_requestingScript(false)
- , m_hasScriptsWaitingForStylesheets(false)
- , m_timer(this, &HTMLDocumentParser::timerFired)
- , m_externalScriptsTimer(this, &HTMLDocumentParser::executeExternalScriptsTimerFired)
- , m_doc(frag->document())
- , m_treeConstructor(new LegacyHTMLTreeConstructor(frag, scriptingPermission))
- , m_inWrite(false)
- , m_fragment(true)
- , m_scriptingPermission(scriptingPermission)
+// FIXME: Member variables should be grouped into self-initializing structs to
+// minimize code duplication between these constructors.
+HTMLDocumentParser::HTMLDocumentParser(DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
+ : DocumentParser(fragment->document())
+ , m_tokenizer(new HTMLTokenizer)
+ , m_treeBuilder(new HTMLTreeBuilder(m_tokenizer.get(), fragment, scriptingPermission))
+ , m_endWasDelayed(false)
+ , m_writeNestingLevel(0)
{
begin();
}
-void HTMLDocumentParser::reset()
+HTMLDocumentParser::~HTMLDocumentParser()
{
- ASSERT(m_executingScript == 0);
-
- while (!m_pendingScripts.isEmpty()) {
- CachedScript* cs = m_pendingScripts.takeFirst().get();
- ASSERT(cache()->disabled() || cs->accessCount() > 0);
- cs->removeClient(this);
- }
-
- fastFree(m_buffer);
- m_buffer = m_dest = 0;
- m_bufferSize = 0;
-
- fastFree(m_scriptCode);
- m_scriptCode = 0;
- m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
-
- m_timer.stop();
- m_externalScriptsTimer.stop();
-
- m_state.setAllowYield(false);
- m_state.setForceSynchronous(false);
-
- m_currentToken.reset();
- m_doctypeToken.reset();
- m_doctypeSearchCount = 0;
- m_doctypeSecondarySearchCount = 0;
- m_hasScriptsWaitingForStylesheets = false;
+ // FIXME: We'd like to ASSERT that normal operation of this class clears
+ // out any delayed actions, but we can't because we're unceremoniously
+ // deleted. If there were a required call to some sort of cancel function,
+ // then we could ASSERT some invariants here.
}
void HTMLDocumentParser::begin()
{
- m_executingScript = 0;
- m_requestingScript = false;
- m_hasScriptsWaitingForStylesheets = false;
- m_state.setLoadingExtScript(false);
- reset();
- m_bufferSize = 254;
- m_buffer = static_cast<UChar*>(fastMalloc(sizeof(UChar) * 254));
- m_dest = m_buffer;
- tquote = NoQuote;
- searchCount = 0;
- m_state.setEntityState(NoEntity);
- m_scriptTagSrcAttrValue = String();
- m_pendingSrc.clear();
- m_currentPrependingSrc = 0;
- m_noMoreData = false;
- m_brokenComments = false;
- m_brokenServer = false;
- m_lineNumber = 0;
- m_currentScriptTagStartLineNumber = 0;
- m_currentTagStartLineNumber = 0;
- m_state.setForceSynchronous(false);
-
- Page* page = m_doc->page();
- if (page && page->hasCustomHTMLTokenizerTimeDelay())
- m_tokenizerTimeDelay = page->customHTMLTokenizerTimeDelay();
- else
- m_tokenizerTimeDelay = defaultTokenizerTimeDelay;
-
- if (page && page->hasCustomHTMLTokenizerChunkSize())
- m_tokenizerChunkSize = page->customHTMLTokenizerChunkSize();
- else
- m_tokenizerChunkSize = defaultTokenizerChunkSize;
-}
-
-void HTMLDocumentParser::setForceSynchronous(bool force)
-{
- m_state.setForceSynchronous(force);
+ // FIXME: Should we reset the tokenizer?
}
-HTMLDocumentParser::State HTMLDocumentParser::processListing(SegmentedString list, State state)
+void HTMLDocumentParser::stopParsing()
{
- // This function adds the listing 'list' as
- // preformatted text-tokens to the token-collection
- while (!list.isEmpty()) {
- if (state.skipLF()) {
- state.setSkipLF(false);
- if (*list == '\n') {
- list.advance();
- continue;
- }
- }
-
- checkBuffer();
-
- if (*list == '\n' || *list == '\r') {
- if (state.discardLF())
- // Ignore this LF
- state.setDiscardLF(false); // We have discarded 1 LF
- else
- *m_dest++ = '\n';
-
- /* Check for MS-DOS CRLF sequence */
- if (*list == '\r')
- state.setSkipLF(true);
-
- list.advance();
- } else {
- state.setDiscardLF(false);
- *m_dest++ = *list;
- list.advance();
- }
- }
-
- return state;
+ DocumentParser::stopParsing();
+ m_parserScheduler.clear(); // Deleting the scheduler will clear any timers.
}
-HTMLDocumentParser::State HTMLDocumentParser::parseNonHTMLText(SegmentedString& src, State state)
+bool HTMLDocumentParser::processingData() const
{
- ASSERT(state.inTextArea() || state.inTitle() || state.inIFrame() || !state.hasEntityState());
- ASSERT(!state.hasTagState());
- ASSERT(state.inXmp() + state.inTextArea() + state.inTitle() + state.inStyle() + state.inScript() + state.inIFrame() == 1);
- if (state.inScript() && !m_currentScriptTagStartLineNumber)
- m_currentScriptTagStartLineNumber = m_lineNumber;
-
- if (state.inComment())
- state = parseComment(src, state);
-
- int lastDecodedEntityPosition = -1;
- while (!src.isEmpty()) {
- checkScriptBuffer();
- UChar ch = *src;
-
- if (!m_scriptCodeResync && !m_brokenComments &&
- !state.inXmp() && ch == '-' && m_scriptCodeSize >= 3 && !src.escaped() &&
- m_scriptCode[m_scriptCodeSize - 3] == '<' && m_scriptCode[m_scriptCodeSize - 2] == '!' && m_scriptCode[m_scriptCodeSize - 1] == '-' &&
- (lastDecodedEntityPosition < m_scriptCodeSize - 3)) {
- state.setInComment(true);
- state = parseComment(src, state);
- continue;
- }
- if (m_scriptCodeResync && !tquote && ch == '>') {
- src.advancePastNonNewline();
- m_scriptCodeSize = m_scriptCodeResync - 1;
- m_scriptCodeResync = 0;
- m_scriptCode[m_scriptCodeSize] = m_scriptCode[m_scriptCodeSize + 1] = 0;
- if (state.inScript())
- state = scriptHandler(state);
- else {
- state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize), state);
- processToken();
- if (state.inStyle()) {
- m_currentToken.tagName = styleTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inTextArea()) {
- m_currentToken.tagName = textareaTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inTitle()) {
- m_currentToken.tagName = titleTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inXmp()) {
- m_currentToken.tagName = xmpTag.localName();
- m_currentToken.beginTag = false;
- } else if (state.inIFrame()) {
- m_currentToken.tagName = iframeTag.localName();
- m_currentToken.beginTag = false;
- }
- processToken();
- state.setInStyle(false);
- state.setInScript(false);
- state.setInTextArea(false);
- state.setInTitle(false);
- state.setInXmp(false);
- state.setInIFrame(false);
- tquote = NoQuote;
- m_scriptCodeSize = m_scriptCodeResync = 0;
- }
- return state;
- }
- // possible end of tagname, lets check.
- if (!m_scriptCodeResync && !state.escaped() && !src.escaped() && (ch == '>' || ch == '/' || isASCIISpace(ch)) &&
- m_scriptCodeSize >= m_searchStopperLength &&
- tagMatch(m_searchStopper, m_scriptCode + m_scriptCodeSize - m_searchStopperLength, m_searchStopperLength) &&
- (lastDecodedEntityPosition < m_scriptCodeSize - m_searchStopperLength)) {
- m_scriptCodeResync = m_scriptCodeSize-m_searchStopperLength+1;
- tquote = NoQuote;
- continue;
- }
- if (m_scriptCodeResync && !state.escaped()) {
- if (ch == '\"')
- tquote = (tquote == NoQuote) ? DoubleQuote : ((tquote == SingleQuote) ? SingleQuote : NoQuote);
- else if (ch == '\'')
- tquote = (tquote == NoQuote) ? SingleQuote : (tquote == DoubleQuote) ? DoubleQuote : NoQuote;
- else if (tquote != NoQuote && (ch == '\r' || ch == '\n'))
- tquote = NoQuote;
- }
- state.setEscaped(!state.escaped() && ch == '\\');
- if (!m_scriptCodeResync && (state.inTextArea() || state.inTitle() || state.inIFrame()) && !src.escaped() && ch == '&') {
- UChar* scriptCodeDest = m_scriptCode + m_scriptCodeSize;
- src.advancePastNonNewline();
- state = parseEntity(src, scriptCodeDest, state, m_cBufferPos, true, false);
- if (scriptCodeDest == m_scriptCode + m_scriptCodeSize)
- lastDecodedEntityPosition = m_scriptCodeSize;
- else
- m_scriptCodeSize = scriptCodeDest - m_scriptCode;
- } else {
- m_scriptCode[m_scriptCodeSize++] = ch;
- src.advance(m_lineNumber);
- }
- }
-
- return state;
+ return isScheduledForResume() || inWrite();
}
-HTMLDocumentParser::State HTMLDocumentParser::scriptHandler(State state)
+void HTMLDocumentParser::pumpTokenizerIfPossible(SynchronousMode mode)
{
+<<<<<<< HEAD
// We are inside a <script>
bool doScriptExec = false;
int startLine = m_currentScriptTagStartLineNumber + 1; // Script line numbers are 1 based, HTMLTokenzier line numbers are 0 based
@@ -613,1156 +322,152 @@ HTMLDocumentParser::State HTMLDocumentParser::scriptExecution(const ScriptSource
return state;
}
+=======
+ if (m_parserStopped || m_treeBuilder->isPaused())
+ return;
+>>>>>>> webkit.org at r61871
-HTMLDocumentParser::State HTMLDocumentParser::parseComment(SegmentedString& src, State state)
-{
- // FIXME: Why does this code even run for comments inside <script> and <style>? This seems bogus.
- checkScriptBuffer(src.length());
- while (!src.isEmpty()) {
- UChar ch = *src;
- m_scriptCode[m_scriptCodeSize++] = ch;
- if (ch == '>') {
- bool handleBrokenComments = m_brokenComments && !(state.inScript() || state.inStyle());
- int endCharsCount = 1; // start off with one for the '>' character
- if (m_scriptCodeSize > 2 && m_scriptCode[m_scriptCodeSize-3] == '-' && m_scriptCode[m_scriptCodeSize-2] == '-') {
- endCharsCount = 3;
- } else if (m_scriptCodeSize > 3 && m_scriptCode[m_scriptCodeSize-4] == '-' && m_scriptCode[m_scriptCodeSize-3] == '-' &&
- m_scriptCode[m_scriptCodeSize-2] == '!') {
- // Other browsers will accept --!> as a close comment, even though it's
- // not technically valid.
- endCharsCount = 4;
- }
- if (handleBrokenComments || endCharsCount > 1) {
- src.advancePastNonNewline();
- if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() || state.inIFrame())) {
- checkScriptBuffer();
- m_scriptCode[m_scriptCodeSize] = 0;
- m_scriptCode[m_scriptCodeSize + 1] = 0;
- m_currentToken.tagName = commentAtom;
- m_currentToken.beginTag = true;
- state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize - endCharsCount), state);
- processToken();
- m_currentToken.tagName = commentAtom;
- m_currentToken.beginTag = false;
- processToken();
- m_scriptCodeSize = 0;
- }
- state.setInComment(false);
- return state; // Finished parsing comment
- }
- }
- src.advance(m_lineNumber);
+ // Once a resume is scheduled, HTMLParserScheduler controls when we next pump.
+ if (isScheduledForResume()) {
+ ASSERT(mode == AllowYield);
+ return;
}
- return state;
+ pumpTokenizer(mode);
}
-HTMLDocumentParser::State HTMLDocumentParser::parseServer(SegmentedString& src, State state)
+bool HTMLDocumentParser::isScheduledForResume() const
{
- checkScriptBuffer(src.length());
- while (!src.isEmpty()) {
- UChar ch = *src;
- m_scriptCode[m_scriptCodeSize++] = ch;
- if (ch == '>' && m_scriptCodeSize > 1 && m_scriptCode[m_scriptCodeSize - 2] == '%') {
- src.advancePastNonNewline();
- state.setInServer(false);
- m_scriptCodeSize = 0;
- return state; // Finished parsing server include
- }
- src.advance(m_lineNumber);
- }
- return state;
+ return m_parserScheduler && m_parserScheduler->isScheduledForResume();
}
-HTMLDocumentParser::State HTMLDocumentParser::parseProcessingInstruction(SegmentedString& src, State state)
+// Used by HTMLParserScheduler
+void HTMLDocumentParser::resumeParsingAfterYield()
{
- UChar oldchar = 0;
- while (!src.isEmpty()) {
- UChar chbegin = *src;
- if (chbegin == '\'')
- tquote = tquote == SingleQuote ? NoQuote : SingleQuote;
- else if (chbegin == '\"')
- tquote = tquote == DoubleQuote ? NoQuote : DoubleQuote;
- // Look for '?>'
- // Some crappy sites omit the "?" before it, so
- // we look for an unquoted '>' instead. (IE compatible)
- else if (chbegin == '>' && (!tquote || oldchar == '?')) {
- // We got a '?>' sequence
- state.setInProcessingInstruction(false);
- src.advancePastNonNewline();
- state.setDiscardLF(true);
- return state; // Finished parsing comment!
- }
- src.advance(m_lineNumber);
- oldchar = chbegin;
- }
-
- return state;
+ // We should never be here unless we can pump immediately. Call pumpTokenizer()
+ // directly so that ASSERTS will fire if we're wrong.
+ pumpTokenizer(AllowYield);
}
-HTMLDocumentParser::State HTMLDocumentParser::parseText(SegmentedString& src, State state)
+bool HTMLDocumentParser::runScriptsForPausedTreeBuilder()
{
- while (!src.isEmpty()) {
- UChar cc = *src;
-
- if (state.skipLF()) {
- state.setSkipLF(false);
- if (cc == '\n') {
- src.advancePastNewline(m_lineNumber);
- continue;
- }
- }
-
- // do we need to enlarge the buffer?
- checkBuffer();
+ ASSERT(m_treeBuilder->isPaused());
- if (cc == '\r') {
- state.setSkipLF(true);
- *m_dest++ = '\n';
- } else
- *m_dest++ = cc;
- src.advance(m_lineNumber);
- }
-
- return state;
+ int scriptStartLine = 0;
+ RefPtr<Element> scriptElement = m_treeBuilder->takeScriptToProcess(scriptStartLine);
+ // We will not have a scriptRunner when parsing a DocumentFragment.
+ if (!m_scriptRunner)
+ return true;
+ return m_scriptRunner->execute(scriptElement.release(), scriptStartLine);
}
-
-HTMLDocumentParser::State HTMLDocumentParser::parseEntity(SegmentedString& src, UChar*& dest, State state, unsigned& cBufferPos, bool start, bool parsingTag)
+void HTMLDocumentParser::pumpTokenizer(SynchronousMode mode)
{
- if (start) {
- cBufferPos = 0;
- state.setEntityState(SearchEntity);
- EntityUnicodeValue = 0;
- }
+ ASSERT(!m_parserStopped);
+ ASSERT(!m_treeBuilder->isPaused());
+ ASSERT(!isScheduledForResume());
- while (!src.isEmpty()) {
- UChar cc = *src;
- switch (state.entityState()) {
- case NoEntity:
- ASSERT(state.entityState() != NoEntity);
- return state;
-
- case SearchEntity:
- if (cc == '#') {
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- state.setEntityState(NumericSearch);
- } else
- state.setEntityState(EntityName);
- break;
+ // We tell the InspectorTimelineAgent about every pump, even if we
+ // end up pumping nothing. It can filter out empty pumps itself.
+ willPumpLexer();
- case NumericSearch:
- if (cc == 'x' || cc == 'X') {
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- state.setEntityState(Hexadecimal);
- } else if (cc >= '0' && cc <= '9')
- state.setEntityState(Decimal);
- else
- state.setEntityState(SearchSemicolon);
+ HTMLParserScheduler::PumpSession session;
+ // FIXME: This loop body has is now too long and needs cleanup.
+ while (mode == ForceSynchronous || (!m_parserStopped && m_parserScheduler->shouldContinueParsing(session))) {
+ if (!m_tokenizer->nextToken(m_input.current(), m_token))
break;
- case Hexadecimal: {
- int ll = min(src.length(), 10 - cBufferPos);
- while (ll--) {
- cc = *src;
- if (!((cc >= '0' && cc <= '9') || (cc >= 'a' && cc <= 'f') || (cc >= 'A' && cc <= 'F'))) {
- state.setEntityState(SearchSemicolon);
- break;
- }
- int digit;
- if (cc < 'A')
- digit = cc - '0';
- else
- digit = (cc - 'A' + 10) & 0xF; // handle both upper and lower case without a branch
- EntityUnicodeValue = EntityUnicodeValue * 16 + digit;
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- }
- if (cBufferPos == 10)
- state.setEntityState(SearchSemicolon);
- break;
- }
- case Decimal:
- {
- int ll = min(src.length(), 9-cBufferPos);
- while (ll--) {
- cc = *src;
-
- if (!(cc >= '0' && cc <= '9')) {
- state.setEntityState(SearchSemicolon);
- break;
- }
-
- EntityUnicodeValue = EntityUnicodeValue * 10 + (cc - '0');
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- }
- if (cBufferPos == 9)
- state.setEntityState(SearchSemicolon);
+ m_treeBuilder->constructTreeFromToken(m_token);
+ m_token.clear();
+
+ // The parser will pause itself when waiting on a script to load or run.
+ if (!m_treeBuilder->isPaused())
+ continue;
+
+ // If we're paused waiting for a script, we try to execute scripts before continuing.
+ bool shouldContinueParsing = runScriptsForPausedTreeBuilder();
+ m_treeBuilder->setPaused(!shouldContinueParsing);
+ if (!shouldContinueParsing)
break;
+ }
+
+ if (isWaitingForScripts()) {
+ ASSERT(m_tokenizer->state() == HTMLTokenizer::DataState);
+ if (!m_preloadScanner) {
+ m_preloadScanner.set(new HTMLPreloadScanner(m_document));
+ m_preloadScanner->appendToEnd(m_input.current());
}
- case EntityName:
- {
- int ll = min(src.length(), 9-cBufferPos);
- while (ll--) {
- cc = *src;
-
- if (!((cc >= 'a' && cc <= 'z') || (cc >= '0' && cc <= '9') || (cc >= 'A' && cc <= 'Z'))) {
- state.setEntityState(SearchSemicolon);
- break;
- }
-
- m_cBuffer[cBufferPos++] = cc;
- src.advancePastNonNewline();
- }
- if (cBufferPos == 9)
- state.setEntityState(SearchSemicolon);
- if (state.entityState() == SearchSemicolon) {
- if (cBufferPos > 1) {
- // Since the maximum length of entity name is 9,
- // so a single char array which is allocated on
- // the stack, its length is 10, should be OK.
- // Also if we have an illegal character, we treat it
- // as illegal entity name.
- unsigned testedEntityNameLen = 0;
- char tmpEntityNameBuffer[10];
-
- ASSERT(cBufferPos < 10);
- for (; testedEntityNameLen < cBufferPos; ++testedEntityNameLen) {
- if (m_cBuffer[testedEntityNameLen] > 0x7e)
- break;
- tmpEntityNameBuffer[testedEntityNameLen] = m_cBuffer[testedEntityNameLen];
- }
-
- const Entity *e;
-
- if (testedEntityNameLen == cBufferPos)
- e = findEntity(tmpEntityNameBuffer, cBufferPos);
- else
- e = 0;
-
- if (e)
- EntityUnicodeValue = e->code;
-
- // be IE compatible
- if (parsingTag && EntityUnicodeValue > 255 && *src != ';')
- EntityUnicodeValue = 0;
- }
- }
- else
- break;
- }
- case SearchSemicolon:
- // Don't allow values that are more than 21 bits.
- if (EntityUnicodeValue > 0 && EntityUnicodeValue <= 0x10FFFF) {
- if (!inViewSourceMode()) {
- if (*src == ';')
- src.advancePastNonNewline();
- if (EntityUnicodeValue <= 0xFFFF) {
- checkBuffer();
- src.push(fixUpChar(EntityUnicodeValue));
- } else {
- // Convert to UTF-16, using surrogate code points.
- checkBuffer(2);
- src.push(U16_LEAD(EntityUnicodeValue));
- src.push(U16_TRAIL(EntityUnicodeValue));
- }
- } else {
- // FIXME: We should eventually colorize entities by sending them as a special token.
- // 12 bytes required: up to 10 bytes in m_cBuffer plus the
- // leading '&' and trailing ';'
- checkBuffer(12);
- *dest++ = '&';
- for (unsigned i = 0; i < cBufferPos; i++)
- dest[i] = m_cBuffer[i];
- dest += cBufferPos;
- if (*src == ';') {
- *dest++ = ';';
- src.advancePastNonNewline();
- }
- }
- } else {
- // 11 bytes required: up to 10 bytes in m_cBuffer plus the
- // leading '&'
- checkBuffer(11);
- // ignore the sequence, add it to the buffer as plaintext
- *dest++ = '&';
- for (unsigned i = 0; i < cBufferPos; i++)
- dest[i] = m_cBuffer[i];
- dest += cBufferPos;
- }
-
- state.setEntityState(NoEntity);
- return state;
- }
+ m_preloadScanner->scan();
}
- return state;
+ didPumpLexer();
}
-HTMLDocumentParser::State HTMLDocumentParser::parseDoctype(SegmentedString& src, State state)
+void HTMLDocumentParser::willPumpLexer()
{
- ASSERT(state.inDoctype());
- while (!src.isEmpty() && state.inDoctype()) {
- UChar c = *src;
- bool isWhitespace = c == '\r' || c == '\n' || c == '\t' || c == ' ';
- switch (m_doctypeToken.state()) {
- case DoctypeBegin: {
- m_doctypeToken.setState(DoctypeBeforeName);
- if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeBeforeName: {
- if (c == '>') {
- // Malformed. Just exit.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeName);
- break;
- }
- case DoctypeName: {
- if (c == '>') {
- // Valid doctype. Emit it.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (isWhitespace) {
- m_doctypeSearchCount = 0; // Used now to scan for PUBLIC
- m_doctypeSecondarySearchCount = 0; // Used now to scan for SYSTEM
- m_doctypeToken.setState(DoctypeAfterName);
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else {
- src.advancePastNonNewline();
- m_doctypeToken.m_name.append(c);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeAfterName: {
- if (c == '>') {
- // Valid doctype. Emit it.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (!isWhitespace) {
- src.advancePastNonNewline();
- if (toASCIILower(c) == publicStart[m_doctypeSearchCount]) {
- m_doctypeSearchCount++;
- if (m_doctypeSearchCount == 6)
- // Found 'PUBLIC' sequence
- m_doctypeToken.setState(DoctypeBeforePublicID);
- } else if (m_doctypeSearchCount > 0) {
- m_doctypeSearchCount = 0;
- m_doctypeToken.setState(DoctypeBogus);
- } else if (toASCIILower(c) == systemStart[m_doctypeSecondarySearchCount]) {
- m_doctypeSecondarySearchCount++;
- if (m_doctypeSecondarySearchCount == 6)
- // Found 'SYSTEM' sequence
- m_doctypeToken.setState(DoctypeBeforeSystemID);
- } else {
- m_doctypeSecondarySearchCount = 0;
- m_doctypeToken.setState(DoctypeBogus);
- }
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else {
- src.advance(m_lineNumber); // Whitespace keeps us in the after name state.
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeBeforePublicID: {
- if (c == '\"' || c == '\'') {
- tquote = c == '\"' ? DoubleQuote : SingleQuote;
- m_doctypeToken.setState(DoctypePublicID);
- src.advancePastNonNewline();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- }
- case DoctypePublicID: {
- if ((c == '\"' && tquote == DoubleQuote) || (c == '\'' && tquote == SingleQuote)) {
- src.advancePastNonNewline();
- m_doctypeToken.setState(DoctypeAfterPublicID);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else {
- m_doctypeToken.m_publicID.append(c);
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- }
- case DoctypeAfterPublicID:
- if (c == '\"' || c == '\'') {
- tquote = c == '\"' ? DoubleQuote : SingleQuote;
- m_doctypeToken.setState(DoctypeSystemID);
- src.advancePastNonNewline();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Valid doctype. Emit it now.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- case DoctypeBeforeSystemID:
- if (c == '\"' || c == '\'') {
- tquote = c == '\"' ? DoubleQuote : SingleQuote;
- m_doctypeToken.setState(DoctypeSystemID);
- src.advancePastNonNewline();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- case DoctypeSystemID:
- if ((c == '\"' && tquote == DoubleQuote) || (c == '\'' && tquote == SingleQuote)) {
- src.advancePastNonNewline();
- m_doctypeToken.setState(DoctypeAfterSystemID);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else if (c == '>') {
- // Considered bogus. Don't process the doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else {
- m_doctypeToken.m_systemID.append(c);
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- case DoctypeAfterSystemID:
- if (c == '>') {
- // Valid doctype. Emit it now.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- processDoctypeToken();
- } else if (isWhitespace) {
- src.advance(m_lineNumber);
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- } else
- m_doctypeToken.setState(DoctypeBogus);
- break;
- case DoctypeBogus:
- if (c == '>') {
- // Done with the bogus doctype.
- src.advancePastNonNewline();
- state.setInDoctype(false);
- if (inViewSourceMode())
- processDoctypeToken();
- } else {
- src.advance(m_lineNumber); // Just keep scanning for '>'
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(c);
- }
- break;
- default:
- break;
- }
- }
- return state;
+#if ENABLE(INSPECTOR)
+ // FIXME: m_input.current().length() is only accurate if we
+ // end up parsing the whole buffer in this pump. We should pass how
+ // much we parsed as part of didWriteHTML instead of willWriteHTML.
+ if (InspectorTimelineAgent* timelineAgent = m_document->inspectorTimelineAgent())
+ timelineAgent->willWriteHTML(m_input.current().length(), m_tokenizer->lineNumber());
+#endif
}
-HTMLDocumentParser::State HTMLDocumentParser::parseTag(SegmentedString& src, State state)
+void HTMLDocumentParser::didPumpLexer()
{
- ASSERT(!state.hasEntityState());
-
- unsigned cBufferPos = m_cBufferPos;
-
- bool lastIsSlash = false;
-
- while (!src.isEmpty()) {
- checkBuffer();
- switch (state.tagState()) {
- case NoTag:
- {
- m_cBufferPos = cBufferPos;
- return state;
- }
- case TagName:
- {
- if (searchCount > 0) {
- if (*src == commentStart[searchCount]) {
- searchCount++;
- if (searchCount == 2)
- m_doctypeSearchCount++; // A '!' is also part of a doctype, so we are moving through that still as well.
- else
- m_doctypeSearchCount = 0;
- if (searchCount == 4) {
- // Found '<!--' sequence
- src.advancePastNonNewline();
- m_dest = m_buffer; // ignore the previous part of this tag
- state.setInComment(true);
- state.setTagState(NoTag);
-
- // Fix bug 34302 at kde.bugs.org. Go ahead and treat
- // <!--> as a valid comment, since both mozilla and IE on windows
- // can handle this case. Only do this in quirks mode. -dwh
- if (!src.isEmpty() && *src == '>' && m_doc->inCompatMode()) {
- state.setInComment(false);
- src.advancePastNonNewline();
- if (!src.isEmpty())
- m_cBuffer[cBufferPos++] = *src;
- } else
- state = parseComment(src, state);
-
- m_cBufferPos = cBufferPos;
- return state; // Finished parsing tag!
- }
- m_cBuffer[cBufferPos++] = *src;
- src.advancePastNonNewline();
- break;
- } else
- searchCount = 0; // Stop looking for '<!--' sequence
- }
-
- if (m_doctypeSearchCount > 0) {
- if (toASCIILower(*src) == doctypeStart[m_doctypeSearchCount]) {
- m_doctypeSearchCount++;
- m_cBuffer[cBufferPos++] = *src;
- src.advancePastNonNewline();
- if (m_doctypeSearchCount == 9) {
- // Found '<!DOCTYPE' sequence
- state.setInDoctype(true);
- state.setTagState(NoTag);
- m_doctypeToken.reset();
- if (inViewSourceMode())
- m_doctypeToken.m_source.append(m_cBuffer, cBufferPos);
- state = parseDoctype(src, state);
- m_cBufferPos = cBufferPos;
- return state;
- }
- break;
- } else
- m_doctypeSearchCount = 0; // Stop looking for '<!DOCTYPE' sequence
- }
-
- bool finish = false;
- unsigned int ll = min(src.length(), CBUFLEN - cBufferPos);
- while (ll--) {
- UChar curchar = *src;
- if (isASCIISpace(curchar) || curchar == '>' || curchar == '<') {
- finish = true;
- break;
- }
-
- // tolower() shows up on profiles. This is faster!
- if (curchar >= 'A' && curchar <= 'Z' && !inViewSourceMode())
- m_cBuffer[cBufferPos++] = curchar + ('a' - 'A');
- else
- m_cBuffer[cBufferPos++] = curchar;
- src.advancePastNonNewline();
- }
-
- // Disadvantage: we add the possible rest of the tag
- // as attribute names. ### judge if this causes problems
- if (finish || CBUFLEN == cBufferPos) {
- bool beginTag;
- UChar* ptr = m_cBuffer;
- unsigned int len = cBufferPos;
- m_cBuffer[cBufferPos] = '\0';
- if ((cBufferPos > 0) && (*ptr == '/')) {
- // End Tag
- beginTag = false;
- ptr++;
- len--;
- }
- else
- // Start Tag
- beginTag = true;
-
- // Ignore the / in fake xml tags like <br/>. We trim off the "/" so that we'll get "br" as the tag name and not "br/".
- if (len > 1 && ptr[len-1] == '/' && !inViewSourceMode())
- ptr[--len] = '\0';
-
- // Now that we've shaved off any invalid / that might have followed the name), make the tag.
- // FIXME: FireFox and WinIE turn !foo nodes into comments, we ignore comments. (fast/parser/tag-with-exclamation-point.html)
- if (ptr[0] != '!' || inViewSourceMode()) {
- m_currentToken.tagName = AtomicString(ptr);
- m_currentToken.beginTag = beginTag;
- }
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- cBufferPos = 0;
- }
- break;
- }
- case SearchAttribute:
- while (!src.isEmpty()) {
- UChar curchar = *src;
- // In this mode just ignore any quotes we encounter and treat them like spaces.
- if (!isASCIISpace(curchar) && curchar != '\'' && curchar != '"') {
- if (curchar == '<' || curchar == '>')
- state.setTagState(SearchEnd);
- else
- state.setTagState(AttributeName);
-
- cBufferPos = 0;
- break;
- }
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- src.advance(m_lineNumber);
- }
- break;
- case AttributeName:
- {
- m_rawAttributeBeforeValue.clear();
- int ll = min(src.length(), CBUFLEN - cBufferPos);
- while (ll--) {
- UChar curchar = *src;
- // If we encounter a "/" when scanning an attribute name, treat it as a delimiter. This allows the
- // cases like <input type=checkbox checked/> to work (and accommodates XML-style syntax as per HTML5).
- if (curchar <= '>' && (curchar >= '<' || isASCIISpace(curchar) || curchar == '/')) {
- m_cBuffer[cBufferPos] = '\0';
- m_attrName = AtomicString(m_cBuffer);
- m_dest = m_buffer;
- *m_dest++ = 0;
- state.setTagState(SearchEqual);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('a');
- break;
- }
-
- // tolower() shows up on profiles. This is faster!
- if (curchar >= 'A' && curchar <= 'Z' && !inViewSourceMode())
- m_cBuffer[cBufferPos++] = curchar + ('a' - 'A');
- else
- m_cBuffer[cBufferPos++] = curchar;
-
- m_rawAttributeBeforeValue.append(curchar);
- src.advance(m_lineNumber);
- }
- if (cBufferPos == CBUFLEN) {
- m_cBuffer[cBufferPos] = '\0';
- m_attrName = AtomicString(m_cBuffer);
- m_dest = m_buffer;
- *m_dest++ = 0;
- state.setTagState(SearchEqual);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('a');
- }
- break;
- }
- case SearchEqual:
- while (!src.isEmpty()) {
- UChar curchar = *src;
-
- if (lastIsSlash && curchar == '>') {
- // This is a quirk (with a long sad history). We have to do this
- // since widgets do <script src="foo.js"/> and expect the tag to close.
- if (m_currentToken.tagName == scriptTag)
- m_currentToken.selfClosingTag = true;
- m_currentToken.brokenXMLStyle = true;
- }
-
- // In this mode just ignore any quotes or slashes we encounter and treat them like spaces.
- if (!isASCIISpace(curchar) && curchar != '\'' && curchar != '"' && curchar != '/') {
- if (curchar == '=') {
- state.setTagState(SearchValue);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advancePastNonNewline();
- } else {
- m_currentToken.addAttribute(m_attrName, emptyAtom, inViewSourceMode());
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- lastIsSlash = false;
- }
- break;
- }
-
- lastIsSlash = curchar == '/';
-
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advance(m_lineNumber);
- }
- break;
- case SearchValue:
- while (!src.isEmpty()) {
- UChar curchar = *src;
- if (!isASCIISpace(curchar)) {
- if (curchar == '\'' || curchar == '\"') {
- tquote = curchar == '\"' ? DoubleQuote : SingleQuote;
- state.setTagState(QuotedValue);
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advancePastNonNewline();
- } else
- state.setTagState(Value);
-
- break;
- }
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- m_rawAttributeBeforeValue.append(curchar);
- src.advance(m_lineNumber);
- }
- break;
- case QuotedValue:
- while (!src.isEmpty()) {
- checkBuffer();
-
- UChar curchar = *src;
- if (curchar <= '>' && !src.escaped()) {
- if (curchar == '>' && m_attrName.isEmpty()) {
- // Handle a case like <img '>. Just go ahead and be willing
- // to close the whole tag. Don't consume the character and
- // just go back into SearchEnd while ignoring the whole
- // value.
- // FIXME: Note that this is actually not a very good solution.
- // It doesn't handle the general case of
- // unmatched quotes among attributes that have names. -dwh
- while (m_dest > m_buffer + 1 && (m_dest[-1] == '\n' || m_dest[-1] == '\r'))
- m_dest--; // remove trailing newlines
- AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
- if (!attributeValue.contains('/'))
- m_attrName = attributeValue; // Just make the name/value match. (FIXME: Is this some WinIE quirk?)
- m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('x');
- state.setTagState(SearchAttribute);
- m_dest = m_buffer;
- tquote = NoQuote;
- break;
- }
-
- if (curchar == '&') {
- src.advancePastNonNewline();
- state = parseEntity(src, m_dest, state, cBufferPos, true, true);
- break;
- }
-
- if ((tquote == SingleQuote && curchar == '\'') || (tquote == DoubleQuote && curchar == '\"')) {
- // some <input type=hidden> rely on trailing spaces. argh
- while (m_dest > m_buffer + 1 && (m_dest[-1] == '\n' || m_dest[-1] == '\r'))
- m_dest--; // remove trailing newlines
- AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
- if (m_attrName.isEmpty() && !attributeValue.contains('/')) {
- m_attrName = attributeValue; // Make the name match the value. (FIXME: Is this a WinIE quirk?)
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('x');
- } else if (inViewSourceMode())
- m_currentToken.addViewSourceChar('v');
-
- if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeConstructor->skipMode() && m_attrName == srcAttr) {
- String context(m_rawAttributeBeforeValue.data(), m_rawAttributeBeforeValue.size());
- if (m_XSSAuditor && !m_XSSAuditor->canLoadExternalScriptFromSrc(attributeValue))
- attributeValue = blankURL().string();
- }
-
- m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- tquote = NoQuote;
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(curchar);
- src.advancePastNonNewline();
- break;
- }
- }
-
- *m_dest++ = curchar;
- src.advance(m_lineNumber);
- }
- break;
- case Value:
- while (!src.isEmpty()) {
- checkBuffer();
- UChar curchar = *src;
- if (curchar <= '>' && !src.escaped()) {
- // parse Entities
- if (curchar == '&') {
- src.advancePastNonNewline();
- state = parseEntity(src, m_dest, state, cBufferPos, true, true);
- break;
- }
- // no quotes. Every space means end of value
- // '/' does not delimit in IE!
- if (isASCIISpace(curchar) || curchar == '>') {
- AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
-
- if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeConstructor->skipMode() && m_attrName == srcAttr) {
- String context(m_rawAttributeBeforeValue.data(), m_rawAttributeBeforeValue.size());
- if (m_XSSAuditor && !m_XSSAuditor->canLoadExternalScriptFromSrc(attributeValue))
- attributeValue = blankURL().string();
- }
-
- m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar('v');
- m_dest = m_buffer;
- state.setTagState(SearchAttribute);
- break;
- }
- }
-
- *m_dest++ = curchar;
- src.advance(m_lineNumber);
- }
- break;
- case SearchEnd:
- {
- while (!src.isEmpty()) {
- UChar ch = *src;
- if (ch == '>' || ch == '<')
- break;
- if (ch == '/')
- m_currentToken.selfClosingTag = true;
- if (inViewSourceMode())
- m_currentToken.addViewSourceChar(ch);
- src.advance(m_lineNumber);
- }
- if (src.isEmpty())
- break;
-
- searchCount = 0; // Stop looking for '<!--' sequence
- state.setTagState(NoTag);
- tquote = NoQuote;
-
- if (*src != '<')
- src.advance(m_lineNumber);
-
- if (m_currentToken.tagName == nullAtom) { //stop if tag is unknown
- m_cBufferPos = cBufferPos;
- return state;
- }
-
- AtomicString tagName = m_currentToken.tagName;
-
- // Handle <script src="foo"/> like Mozilla/Opera. We have to do this now for Dashboard
- // compatibility.
- bool isSelfClosingScript = m_currentToken.selfClosingTag && m_currentToken.beginTag && m_currentToken.tagName == scriptTag;
- bool beginTag = !m_currentToken.selfClosingTag && m_currentToken.beginTag;
- if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeConstructor->skipMode()) {
- Attribute* a = 0;
- m_scriptTagSrcAttrValue = String();
- m_scriptTagCharsetAttrValue = String();
- if (m_currentToken.attrs && !m_fragment) {
- if (m_doc->frame() && m_doc->frame()->script()->canExecuteScripts(NotAboutToExecuteScript)) {
- if ((a = m_currentToken.attrs->getAttributeItem(srcAttr)))
- m_scriptTagSrcAttrValue = m_doc->completeURL(deprecatedParseURL(a->value())).string();
- }
- }
- }
-
- RefPtr<Node> n = processToken();
- m_cBufferPos = cBufferPos;
- if (n || inViewSourceMode()) {
- State savedState = state;
- SegmentedString savedSrc = src;
- long savedLineno = m_lineNumber;
- if ((tagName == preTag || tagName == listingTag) && !inViewSourceMode()) {
- if (beginTag)
- state.setDiscardLF(true); // Discard the first LF after we open a pre.
- } else if (tagName == scriptTag) {
- ASSERT(!m_scriptNode);
- m_scriptNode = static_pointer_cast<HTMLScriptElement>(n);
- if (m_scriptNode)
- m_scriptTagCharsetAttrValue = m_scriptNode->scriptCharset();
- if (beginTag) {
- m_searchStopper = scriptEnd;
- m_searchStopperLength = 8;
- state.setInScript(true);
- state = parseNonHTMLText(src, state);
- } else if (isSelfClosingScript) { // Handle <script src="foo"/>
- state.setInScript(true);
- state = scriptHandler(state);
- }
- } else if (tagName == styleTag) {
- if (beginTag) {
- m_searchStopper = styleEnd;
- m_searchStopperLength = 7;
- state.setInStyle(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == textareaTag) {
- if (beginTag) {
- m_searchStopper = textareaEnd;
- m_searchStopperLength = 10;
- state.setInTextArea(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == titleTag) {
- if (beginTag) {
- m_searchStopper = titleEnd;
- m_searchStopperLength = 7;
- state.setInTitle(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == xmpTag) {
- if (beginTag) {
- m_searchStopper = xmpEnd;
- m_searchStopperLength = 5;
- state.setInXmp(true);
- state = parseNonHTMLText(src, state);
- }
- } else if (tagName == iframeTag) {
- if (beginTag) {
- m_searchStopper = iframeEnd;
- m_searchStopperLength = 8;
- state.setInIFrame(true);
- state = parseNonHTMLText(src, state);
- }
- }
- if (src.isEmpty() && (state.inTitle() || inViewSourceMode()) && !state.inComment() && !(state.inScript() && m_currentScriptTagStartLineNumber)) {
- // We just ate the rest of the document as the #text node under the special tag!
- // Reset the state then retokenize without special handling.
- // Let the parser clean up the missing close tag.
- // FIXME: This is incorrect, because src.isEmpty() doesn't mean we're
- // at the end of the document unless m_noMoreData is also true. We need
- // to detect this case elsewhere, and save the state somewhere other
- // than a local variable.
- state = savedState;
- src = savedSrc;
- m_lineNumber = savedLineno;
- m_scriptCodeSize = 0;
- }
- }
- if (tagName == plaintextTag)
- state.setInPlainText(beginTag);
- return state; // Finished parsing tag!
- }
- } // end switch
- }
- m_cBufferPos = cBufferPos;
- return state;
+#if ENABLE(INSPECTOR)
+ if (InspectorTimelineAgent* timelineAgent = m_document->inspectorTimelineAgent())
+ timelineAgent->didWriteHTML(m_tokenizer->lineNumber());
+#endif
}
-inline bool HTMLDocumentParser::continueProcessing(int& processedCount, double startTime, State &state)
+void HTMLDocumentParser::write(const SegmentedString& source, bool isFromNetwork)
{
- // We don't want to be checking elapsed time with every character, so we only check after we've
- // processed a certain number of characters.
- bool allowedYield = state.allowYield();
- state.setAllowYield(false);
- if (!state.loadingExtScript() && !state.forceSynchronous() && !m_executingScript && (processedCount > m_tokenizerChunkSize || allowedYield)) {
- processedCount = 0;
- if (currentTime() - startTime > m_tokenizerTimeDelay) {
- /* FIXME: We'd like to yield aggressively to give stylesheets the opportunity to
- load, but this hurts overall performance on slower machines. For now turn this
- off.
- || (!m_doc->haveStylesheetsLoaded() &&
- (m_doc->documentElement()->id() != ID_HTML || m_doc->body()))) {*/
- // Schedule the timer to keep processing as soon as possible.
- m_timer.startOneShot(0);
- return false;
- }
- }
+ if (m_parserStopped)
+ return;
- processedCount++;
- return true;
-}
+ NestingLevelIncrementer nestingLevelIncrementer(m_writeNestingLevel);
-// Turns the statemachine one crank using the passed in State object.
-// This does not modify m_state directly in order to be reentrant.
-ALWAYS_INLINE void HTMLDocumentParser::advance(State& state)
-{
- // do we need to enlarge the buffer?
- checkBuffer();
-
- UChar cc = *m_src;
-
- bool wasSkipLF = state.skipLF();
- if (wasSkipLF)
- state.setSkipLF(false);
-
- if (wasSkipLF && (cc == '\n'))
- m_src.advance();
- else if (state.needsSpecialWriteHandling()) {
- // it's important to keep needsSpecialWriteHandling with the flags this block tests
- if (state.hasEntityState())
- state = parseEntity(m_src, m_dest, state, m_cBufferPos, false, state.hasTagState());
- else if (state.inPlainText())
- state = parseText(m_src, state);
- else if (state.inAnyNonHTMLText())
- state = parseNonHTMLText(m_src, state);
- else if (state.inComment())
- state = parseComment(m_src, state);
- else if (state.inDoctype())
- state = parseDoctype(m_src, state);
- else if (state.inServer())
- state = parseServer(m_src, state);
- else if (state.inProcessingInstruction())
- state = parseProcessingInstruction(m_src, state);
- else if (state.hasTagState())
- state = parseTag(m_src, state);
- else if (state.startTag()) {
- state.setStartTag(false);
-
- switch (cc) {
- case '/':
- break;
- case '!': {
- // <!-- comment --> or <!DOCTYPE ...>
- searchCount = 1; // Look for '<!--' sequence to start comment or '<!DOCTYPE' sequence to start doctype
- m_doctypeSearchCount = 1;
- break;
- }
- case '?': {
- // xml processing instruction
- state.setInProcessingInstruction(true);
- tquote = NoQuote;
- state = parseProcessingInstruction(m_src, state);
- return;
- }
- case '%':
- if (!m_brokenServer) {
- // <% server stuff, handle as comment %>
- state.setInServer(true);
- tquote = NoQuote;
- state = parseServer(m_src, state);
- return;
- }
- // else fall through
- default: {
- if (((cc >= 'a') && (cc <= 'z')) || ((cc >= 'A') && (cc <= 'Z'))) {
- // Start of a Start-Tag
- } else {
- // Invalid tag
- // Add as is
- *m_dest = '<';
- m_dest++;
- return;
- }
- }
- }; // end case
-
- processToken();
-
- m_cBufferPos = 0;
- state.setTagState(TagName);
- state = parseTag(m_src, state);
- }
- } else if (cc == '&' && !m_src.escaped()) {
- m_src.advancePastNonNewline();
- state = parseEntity(m_src, m_dest, state, m_cBufferPos, true, state.hasTagState());
- } else if (cc == '<' && !m_src.escaped()) {
- m_currentTagStartLineNumber = m_lineNumber;
- m_src.advancePastNonNewline();
- state.setStartTag(true);
- state.setDiscardLF(false);
- } else if (cc == '\n' || cc == '\r') {
- if (state.discardLF())
- // Ignore this LF
- state.setDiscardLF(false); // We have discarded 1 LF
- else {
- // Process this LF
- *m_dest++ = '\n';
- if (cc == '\r' && !m_src.excludeLineNumbers())
- m_lineNumber++;
+ if (isFromNetwork) {
+ m_input.appendToEnd(source);
+ if (m_preloadScanner)
+ m_preloadScanner->appendToEnd(source);
+
+ if (m_writeNestingLevel > 1) {
+ // We've gotten data off the network in a nested call to write().
+ // We don't want to consume any more of the input stream now. Do
+ // not worry. We'll consume this data in a less-nested write().
+ return;
}
+ } else
+ m_input.insertAtCurrentInsertionPoint(source);
- /* Check for MS-DOS CRLF sequence */
- if (cc == '\r')
- state.setSkipLF(true);
- m_src.advance(m_lineNumber);
- } else {
- state.setDiscardLF(false);
- *m_dest++ = cc;
- m_src.advancePastNonNewline();
- }
+ pumpTokenizerIfPossible(isFromNetwork ? AllowYield : ForceSynchronous);
+ endIfDelayed();
}
-void HTMLDocumentParser::willWriteHTML(const SegmentedString& source)
+void HTMLDocumentParser::end()
{
- #if ENABLE(INSPECTOR)
- if (InspectorTimelineAgent* timelineAgent = m_doc->inspectorTimelineAgent())
- timelineAgent->willWriteHTML(source.length(), m_lineNumber);
- #endif
-}
+ ASSERT(!isScheduledForResume());
+ // NOTE: This pump should only ever emit buffered character tokens,
+ // so ForceSynchronous vs. AllowYield should be meaningless.
+ pumpTokenizerIfPossible(ForceSynchronous);
-void HTMLDocumentParser::didWriteHTML()
-{
- #if ENABLE(INSPECTOR)
- if (InspectorTimelineAgent* timelineAgent = m_doc->inspectorTimelineAgent())
- timelineAgent->didWriteHTML(m_lineNumber);
- #endif
+ // Informs the the rest of WebCore that parsing is really finished (and deletes this).
+ m_treeBuilder->finished();
}
-void HTMLDocumentParser::write(const SegmentedString& str, bool appendData)
+void HTMLDocumentParser::attemptToEnd()
{
- if (!m_buffer)
- return;
-
- if (m_parserStopped)
- return;
+ // finish() indicates we will not receive any more data. If we are waiting on
+ // an external script to load, we can't finish parsing quite yet.
- SegmentedString source(str);
- if (m_executingScript)
- source.setExcludeLineNumbers();
-
- if ((m_executingScript && appendData) || !m_pendingScripts.isEmpty()) {
- // don't parse; we will do this later
- if (m_currentPrependingSrc)
- m_currentPrependingSrc->append(source);
- else {
- m_pendingSrc.append(source);
-#if PRELOAD_SCANNER_ENABLED
- if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
- m_preloadScanner->write(source);
-#endif
- }
+ if (inWrite() || isWaitingForScripts() || inScriptExecution() || isScheduledForResume()) {
+ m_endWasDelayed = true;
return;
}
+<<<<<<< HEAD
#if PRELOAD_SCANNER_ENABLED
if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
@@ -1812,321 +517,151 @@ void HTMLDocumentParser::write(const SegmentedString& str, bool appendData)
// After parsing, go ahead and dispatch image beforeload events.
ImageLoader::dispatchPendingBeforeLoadEvents();
+=======
+ end();
+>>>>>>> webkit.org at r61871
}
-void HTMLDocumentParser::stopParsing()
+void HTMLDocumentParser::endIfDelayed()
{
- DocumentParser::stopParsing();
- m_timer.stop();
+ // We don't check inWrite() here since inWrite() will be true if this was
+ // called from write().
+ if (!m_endWasDelayed || isWaitingForScripts() || inScriptExecution() || isScheduledForResume())
+ return;
- // FIXME: Why is HTMLDocumentParser the only DocumentParser which calls checkCompleted?
- // The FrameLoader needs to know that the parser has finished with its data,
- // regardless of whether it happened naturally or due to manual intervention.
- if (!m_fragment && m_doc->frame())
- m_doc->frame()->loader()->checkCompleted();
+ m_endWasDelayed = false;
+ end();
}
-bool HTMLDocumentParser::processingData() const
+void HTMLDocumentParser::finish()
{
- return m_timer.isActive() || m_inWrite;
+ // We're not going to get any more data off the network, so we close the
+ // input stream to indicate EOF.
+ m_input.close();
+ attemptToEnd();
}
-void HTMLDocumentParser::timerFired(Timer<HTMLDocumentParser>*)
+bool HTMLDocumentParser::finishWasCalled()
{
- if (m_doc->view() && m_doc->view()->layoutPending() && !m_doc->minimumLayoutDelay()) {
- // Restart the timer and let layout win. This is basically a way of ensuring that the layout
- // timer has higher priority than our timer.
- m_timer.startOneShot(0);
- return;
- }
-
- // Invoke write() as though more data came in. This might cause us to get deleted.
- write(SegmentedString(), true);
+ return m_input.isClosed();
}
-void HTMLDocumentParser::end()
+// This function is virtual and just for the DocumentParser interface.
+bool HTMLDocumentParser::isExecutingScript() const
{
- ASSERT(!m_timer.isActive());
- m_timer.stop(); // Only helps if assertion above fires, but do it anyway.
-
- if (m_buffer) {
- // parseTag is using the buffer for different matters
- if (!m_state.hasTagState())
- processToken();
-
- fastFree(m_scriptCode);
- m_scriptCode = 0;
- m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
-
- fastFree(m_buffer);
- m_buffer = 0;
- }
-
- if (!inViewSourceMode())
- m_treeConstructor->finished();
- else
- m_doc->finishedParsing();
+ return inScriptExecution();
}
-void HTMLDocumentParser::finish()
+// This function is non-virtual and used throughout the implementation.
+bool HTMLDocumentParser::inScriptExecution() const
{
- // do this as long as we don't find matching comment ends
- while ((m_state.inComment() || m_state.inServer()) && m_scriptCode && m_scriptCodeSize) {
- // we've found an unmatched comment start
- if (m_state.inComment())
- m_brokenComments = true;
- else
- m_brokenServer = true;
- checkScriptBuffer();
- m_scriptCode[m_scriptCodeSize] = 0;
- m_scriptCode[m_scriptCodeSize + 1] = 0;
- int pos;
- String food;
- if (m_state.inScript() || m_state.inStyle() || m_state.inTextArea())
- food = String(m_scriptCode, m_scriptCodeSize);
- else if (m_state.inServer()) {
- food = "<";
- food.append(m_scriptCode, m_scriptCodeSize);
- } else {
- pos = find(m_scriptCode, m_scriptCodeSize, '>');
- food = String(m_scriptCode + pos + 1, m_scriptCodeSize - pos - 1);
- }
- fastFree(m_scriptCode);
- m_scriptCode = 0;
- m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
- m_state.setInComment(false);
- m_state.setInServer(false);
- if (!food.isEmpty())
- write(food, true);
- }
- // this indicates we will not receive any more data... but if we are waiting on
- // an external script to load, we can't finish parsing until that is done
- m_noMoreData = true;
- if (!m_inWrite && !m_state.loadingExtScript() && !m_executingScript && !m_timer.isActive())
- end(); // this actually causes us to be deleted
+ if (!m_scriptRunner)
+ return false;
+ return m_scriptRunner->inScriptExecution();
}
-PassRefPtr<Node> HTMLDocumentParser::processToken()
+int HTMLDocumentParser::lineNumber() const
{
- ScriptController* scriptController = (!m_fragment && m_doc->frame()) ? m_doc->frame()->script() : 0;
- if (scriptController && scriptController->canExecuteScripts(NotAboutToExecuteScript))
- // FIXME: Why isn't this m_currentScriptTagStartLineNumber? I suspect this is wrong.
- scriptController->setEventHandlerLineNumber(m_currentTagStartLineNumber + 1); // Script line numbers are 1 based.
- if (m_dest > m_buffer) {
- m_currentToken.text = StringImpl::createStrippingNullCharacters(m_buffer, m_dest - m_buffer);
- if (m_currentToken.tagName != commentAtom)
- m_currentToken.tagName = textAtom;
- } else if (m_currentToken.tagName == nullAtom) {
- m_currentToken.reset();
- if (scriptController)
- scriptController->setEventHandlerLineNumber(m_lineNumber + 1); // Script line numbers are 1 based.
- return 0;
- }
-
- m_dest = m_buffer;
-
- RefPtr<Node> n;
-
- if (!m_parserStopped) {
- if (NamedNodeMap* map = m_currentToken.attrs.get())
- map->shrinkToLength();
- if (inViewSourceMode())
- static_cast<HTMLViewSourceDocument*>(m_doc)->addViewSourceToken(&m_currentToken);
- else
- // pass the token over to the parser, the parser DOES NOT delete the token
- n = m_treeConstructor->parseToken(&m_currentToken);
- }
- m_currentToken.reset();
- if (scriptController)
- scriptController->setEventHandlerLineNumber(0);
-
- return n.release();
+ return m_tokenizer->lineNumber();
}
-void HTMLDocumentParser::processDoctypeToken()
+int HTMLDocumentParser::columnNumber() const
{
- if (inViewSourceMode())
- static_cast<HTMLViewSourceDocument*>(m_doc)->addViewSourceDoctypeToken(&m_doctypeToken);
- else
- m_treeConstructor->parseDoctypeToken(&m_doctypeToken);
+ return m_tokenizer->columnNumber();
}
-HTMLDocumentParser::~HTMLDocumentParser()
+LegacyHTMLTreeBuilder* HTMLDocumentParser::htmlTreeBuilder() const
{
- ASSERT(!m_inWrite);
- reset();
+ return m_treeBuilder->legacyTreeBuilder();
}
-
-void HTMLDocumentParser::enlargeBuffer(int len)
+bool HTMLDocumentParser::isWaitingForScripts() const
{
- // Resize policy: Always at least double the size of the buffer each time.
- int delta = max(len, m_bufferSize);
-
- // Check for overflow.
- // For now, handle overflow the same way we handle fastRealloc failure, with CRASH.
- static const int maxSize = INT_MAX / sizeof(UChar);
- if (delta > maxSize - m_bufferSize)
- CRASH();
-
- int newSize = m_bufferSize + delta;
- int oldOffset = m_dest - m_buffer;
- m_buffer = static_cast<UChar*>(fastRealloc(m_buffer, newSize * sizeof(UChar)));
- m_dest = m_buffer + oldOffset;
- m_bufferSize = newSize;
+ return m_treeBuilder->isPaused();
}
-void HTMLDocumentParser::enlargeScriptBuffer(int len)
+void HTMLDocumentParser::resumeParsingAfterScriptExecution()
{
- // Resize policy: Always at least double the size of the buffer each time.
- int delta = max(len, m_scriptCodeCapacity);
-
- // Check for overflow.
- // For now, handle overflow the same way we handle fastRealloc failure, with CRASH.
- static const int maxSize = INT_MAX / sizeof(UChar);
- if (delta > maxSize - m_scriptCodeCapacity)
- CRASH();
-
- int newSize = m_scriptCodeCapacity + delta;
- // If we allow fastRealloc(ptr, 0), it will call CRASH(). We run into this
- // case if the HTML being parsed begins with "<!--" and there's more data
- // coming.
- if (!newSize) {
- ASSERT(!m_scriptCode);
- return;
- }
+ ASSERT(!inScriptExecution());
+ ASSERT(!m_treeBuilder->isPaused());
- m_scriptCode = static_cast<UChar*>(fastRealloc(m_scriptCode, newSize * sizeof(UChar)));
- m_scriptCodeCapacity = newSize;
-}
+ pumpTokenizerIfPossible(AllowYield);
-void HTMLDocumentParser::executeScriptsWaitingForStylesheets()
-{
- ASSERT(m_doc->haveStylesheetsLoaded());
-
- if (m_hasScriptsWaitingForStylesheets)
- notifyFinished(0);
+ // The document already finished parsing we were just waiting on scripts when finished() was called.
+ endIfDelayed();
}
-void HTMLDocumentParser::notifyFinished(CachedResource*)
+void HTMLDocumentParser::watchForLoad(CachedResource* cachedScript)
{
- executeExternalScriptsIfReady();
+ cachedScript->addClient(this);
}
-void HTMLDocumentParser::executeExternalScriptsIfReady()
+void HTMLDocumentParser::stopWatchingForLoad(CachedResource* cachedScript)
{
- ASSERT(!m_pendingScripts.isEmpty());
-
- // Make external scripts wait for external stylesheets.
- // FIXME: This needs to be done for inline scripts too.
- m_hasScriptsWaitingForStylesheets = !m_doc->haveStylesheetsLoaded();
- if (m_hasScriptsWaitingForStylesheets)
- return;
-
- bool finished = false;
-
- double startTime = currentTime();
- while (!finished && m_pendingScripts.first()->isLoaded()) {
- if (!continueExecutingExternalScripts(startTime))
- break;
-
- CachedScript* cs = m_pendingScripts.takeFirst().get();
- ASSERT(cache()->disabled() || cs->accessCount() > 0);
-
- setSrc(SegmentedString());
-
- // make sure we forget about the script before we execute the new one
- // infinite recursion might happen otherwise
- ScriptSourceCode sourceCode(cs);
- bool errorOccurred = cs->errorOccurred();
- cs->removeClient(this);
-
- RefPtr<Node> n = m_scriptNode.release();
-
- if (errorOccurred)
- n->dispatchEvent(Event::create(eventNames().errorEvent, true, false));
- else {
- if (static_cast<HTMLScriptElement*>(n.get())->shouldExecuteAsJavaScript())
- m_state = scriptExecution(sourceCode, m_state);
-#if ENABLE(XHTMLMP)
- else
- m_doc->setShouldProcessNoscriptElement(true);
-#endif
- n->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
- }
-
- // The state of m_pendingScripts.isEmpty() can change inside the scriptExecution()
- // call above, so test afterwards.
- finished = m_pendingScripts.isEmpty();
- if (finished) {
- ASSERT(!m_hasScriptsWaitingForStylesheets);
- m_state.setLoadingExtScript(false);
- } else if (m_hasScriptsWaitingForStylesheets) {
- // m_hasScriptsWaitingForStylesheets flag might have changed during the script execution.
- // If it did we are now blocked waiting for stylesheets and should not execute more scripts until they arrive.
- finished = true;
- }
-
- // 'm_requestingScript' is true when we are called synchronously from
- // scriptHandler(). In that case scriptHandler() will take care
- // of m_pendingSrc.
- if (!m_requestingScript) {
- SegmentedString rest = m_pendingSrc;
- m_pendingSrc.clear();
- write(rest, false);
- // we might be deleted at this point, do not access any members.
- }
- }
+ cachedScript->removeClient(this);
}
-void HTMLDocumentParser::executeExternalScriptsTimerFired(Timer<HTMLDocumentParser>*)
+bool HTMLDocumentParser::shouldLoadExternalScriptFromSrc(const AtomicString& srcValue)
{
- if (m_doc->view() && m_doc->view()->layoutPending() && !m_doc->minimumLayoutDelay()) {
- // Restart the timer and do layout first.
- m_externalScriptsTimer.startOneShot(0);
- return;
- }
-
- // Continue executing external scripts.
- executeExternalScriptsIfReady();
+ if (!m_XSSAuditor)
+ return true;
+ return m_XSSAuditor->canLoadExternalScriptFromSrc(srcValue);
}
-bool HTMLDocumentParser::continueExecutingExternalScripts(double startTime)
+void HTMLDocumentParser::notifyFinished(CachedResource* cachedResource)
{
- if (m_externalScriptsTimer.isActive())
- return false;
-
- if (currentTime() - startTime > m_tokenizerTimeDelay) {
- // Schedule the timer to keep processing as soon as possible.
- m_externalScriptsTimer.startOneShot(0);
- return false;
+ ASSERT(m_scriptRunner);
+ // Ignore calls unless we have a script blocking the parser waiting
+ // for its own load. Otherwise this may be a load callback from
+ // CachedResource::addClient because the script was already in the cache.
+ // HTMLScriptRunner may not be ready to handle running that script yet.
+ if (!m_scriptRunner->hasScriptsWaitingForLoad()) {
+ ASSERT(m_scriptRunner->inScriptExecution());
+ return;
}
- return true;
+ ASSERT(!inScriptExecution());
+ ASSERT(m_treeBuilder->isPaused());
+ // Note: We only ever wait on one script at a time, so we always know this
+ // is the one we were waiting on and can un-pause the tree builder.
+ m_treeBuilder->setPaused(false);
+ bool shouldContinueParsing = m_scriptRunner->executeScriptsWaitingForLoad(cachedResource);
+ m_treeBuilder->setPaused(!shouldContinueParsing);
+ if (shouldContinueParsing)
+ resumeParsingAfterScriptExecution();
}
-bool HTMLDocumentParser::isWaitingForScripts() const
+void HTMLDocumentParser::executeScriptsWaitingForStylesheets()
{
- return m_state.loadingExtScript();
+ // Document only calls this when the Document owns the DocumentParser
+ // so this will not be called in the DocumentFragment case.
+ ASSERT(m_scriptRunner);
+ // Ignore calls unless we have a script blocking the parser waiting on a
+ // stylesheet load. Otherwise we are currently parsing and this
+ // is a re-entrant call from encountering a </ style> tag.
+ if (!m_scriptRunner->hasScriptsWaitingForStylesheets())
+ return;
+ ASSERT(!m_scriptRunner->inScriptExecution());
+ ASSERT(m_treeBuilder->isPaused());
+ // Note: We only ever wait on one script at a time, so we always know this
+ // is the one we were waiting on and can un-pause the tree builder.
+ m_treeBuilder->setPaused(false);
+ bool shouldContinueParsing = m_scriptRunner->executeScriptsWaitingForStylesheets();
+ m_treeBuilder->setPaused(!shouldContinueParsing);
+ if (shouldContinueParsing)
+ resumeParsingAfterScriptExecution();
}
-void HTMLDocumentParser::setSrc(const SegmentedString& source)
+ScriptController* HTMLDocumentParser::script() const
{
- m_src = source;
+ return m_document->frame() ? m_document->frame()->script() : 0;
}
-void parseHTMLDocumentFragment(const String& source, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
+void HTMLDocumentParser::parseDocumentFragment(const String& source, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
{
HTMLDocumentParser parser(fragment, scriptingPermission);
- parser.setForceSynchronous(true);
- parser.write(source, true);
+ parser.write(source, false);
parser.finish();
- ASSERT(!parser.processingData()); // make sure we're done (see 3963151)
-}
-
-UChar decodeNamedEntity(const char* name)
-{
- const Entity* e = findEntity(name, strlen(name));
- return e ? e->code : 0;
+ ASSERT(!parser.processingData()); // Make sure we're done. <rdar://problem/3963151>
}
}
diff --git a/WebCore/html/HTMLDocumentParser.h b/WebCore/html/HTMLDocumentParser.h
index 6072a7e..c2e752f 100644
--- a/WebCore/html/HTMLDocumentParser.h
+++ b/WebCore/html/HTMLDocumentParser.h
@@ -1,448 +1,131 @@
/*
- Copyright (C) 1997 Martin Jones (mjones@kde.org)
- (C) 1997 Torben Weis (weis@kde.org)
- (C) 1998 Waldo Bastian (bastian@kde.org)
- (C) 2001 Dirk Mueller (mueller@kde.org)
- Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
-#ifndef HTMLTokenizer_h
-#define HTMLTokenizer_h
+#ifndef HTMLDocumentParser_h
+#define HTMLDocumentParser_h
#include "CachedResourceClient.h"
-#include "CachedResourceHandle.h"
-#include "MappedAttributeEntry.h"
-#include "NamedNodeMap.h"
+#include "FragmentScriptingPermission.h"
+#include "HTMLScriptRunnerHost.h"
+#include "HTMLToken.h"
+#include "HTMLInputStream.h"
#include "SegmentedString.h"
-#include "Timer.h"
#include "DocumentParser.h"
-#include <wtf/Deque.h>
+#include "Timer.h"
#include <wtf/OwnPtr.h>
-#include <wtf/Vector.h>
namespace WebCore {
-class CachedScript;
-class DocumentFragment;
class Document;
+class DocumentFragment;
class HTMLDocument;
-class HTMLScriptElement;
-class HTMLViewSourceDocument;
-class FrameView;
-class LegacyHTMLTreeConstructor;
-class Node;
-class PreloadScanner;
+class HTMLParserScheduler;
+class HTMLTokenizer;
+class HTMLScriptRunner;
+class HTMLTreeBuilder;
+class HTMLPreloadScanner;
+class LegacyHTMLTreeBuilder;
+class ScriptController;
class ScriptSourceCode;
-/**
- * @internal
- * represents one HTML tag. Consists of a numerical id, and the list
- * of attributes. Can also represent text. In this case the id = 0 and
- * text contains the text.
- */
-struct Token {
- Token()
- : beginTag(true)
- , selfClosingTag(false)
- , brokenXMLStyle(false)
- , m_sourceInfo(0)
- { }
- ~Token() { }
-
- void addAttribute(AtomicString& attrName, const AtomicString& v, bool viewSourceMode);
-
- bool isOpenTag(const QualifiedName& fullName) const { return beginTag && fullName.localName() == tagName; }
- bool isCloseTag(const QualifiedName& fullName) const { return !beginTag && fullName.localName() == tagName; }
-
- void reset()
- {
- attrs = 0;
- text = 0;
- tagName = nullAtom;
- beginTag = true;
- selfClosingTag = false;
- brokenXMLStyle = false;
- if (m_sourceInfo)
- m_sourceInfo->clear();
- }
-
- void addViewSourceChar(UChar c) { if (!m_sourceInfo.get()) m_sourceInfo.set(new Vector<UChar>); m_sourceInfo->append(c); }
-
- RefPtr<NamedNodeMap> attrs;
- RefPtr<StringImpl> text;
- AtomicString tagName;
- bool beginTag;
- bool selfClosingTag;
- bool brokenXMLStyle;
- OwnPtr<Vector<UChar> > m_sourceInfo;
-};
-
-enum DoctypeState {
- DoctypeBegin,
- DoctypeBeforeName,
- DoctypeName,
- DoctypeAfterName,
- DoctypeBeforePublicID,
- DoctypePublicID,
- DoctypeAfterPublicID,
- DoctypeBeforeSystemID,
- DoctypeSystemID,
- DoctypeAfterSystemID,
- DoctypeBogus
-};
-
-class DoctypeToken {
-public:
- DoctypeToken() {}
-
- void reset()
- {
- m_name.clear();
- m_publicID.clear();
- m_systemID.clear();
- m_state = DoctypeBegin;
- m_source.clear();
- m_forceQuirks = false;
- }
-
- DoctypeState state() { return m_state; }
- void setState(DoctypeState s) { m_state = s; }
-
- Vector<UChar> m_name;
- Vector<UChar> m_publicID;
- Vector<UChar> m_systemID;
- DoctypeState m_state;
-
- Vector<UChar> m_source;
-
- bool m_forceQuirks; // Used by the HTML5 parser.
-};
-
-//-----------------------------------------------------------------------------
-
-// FIXME: This class does too much. Right now it is both an HTML lexer as well
-// as handling all of the non-lexer-specific junk related to tokenizing HTML
-// (like dealing with <script> tags). The HTML lexer bits should be pushed
-// down into a separate HTML lexer class.
-
-class HTMLDocumentParser : public DocumentParser, public CachedResourceClient {
+class HTMLDocumentParser : public DocumentParser, HTMLScriptRunnerHost, CachedResourceClient {
public:
+ // FIXME: These constructors should be made private and replaced by create() methods.
HTMLDocumentParser(HTMLDocument*, bool reportErrors);
- HTMLDocumentParser(HTMLViewSourceDocument*);
- HTMLDocumentParser(DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
+ HTMLDocumentParser(DocumentFragment*, FragmentScriptingPermission);
virtual ~HTMLDocumentParser();
- virtual void write(const SegmentedString&, bool appendData);
- virtual void finish();
- virtual bool forceSynchronous() const { return m_state.forceSynchronous(); }
- virtual void setForceSynchronous(bool force);
- virtual bool isWaitingForScripts() const;
- virtual void stopParsing();
- virtual bool processingData() const;
- virtual int executingScript() const { return m_executingScript; }
-
- virtual int lineNumber() const { return m_lineNumber; }
- virtual int columnNumber() const { return 1; }
-
- bool processingContentWrittenByScript() const { return m_src.excludeLineNumbers(); }
-
- virtual void executeScriptsWaitingForStylesheets();
+ // Exposed for HTMLParserScheduler
+ void resumeParsingAfterYield();
- virtual LegacyHTMLTreeConstructor* htmlTreeConstructor() const { return m_treeConstructor.get(); }
- virtual HTMLDocumentParser* asHTMLDocumentParser() { return this; }
+ static void parseDocumentFragment(const String&, DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
private:
- class State;
-
- // Where we are in parsing a tag
- void begin();
- void end();
-
- void reset();
-
- void willWriteHTML(const SegmentedString&);
- ALWAYS_INLINE void advance(State&);
- void didWriteHTML();
-
- PassRefPtr<Node> processToken();
- void processDoctypeToken();
-
- State processListing(SegmentedString, State);
- State parseComment(SegmentedString&, State);
- State parseDoctype(SegmentedString&, State);
- State parseServer(SegmentedString&, State);
- State parseText(SegmentedString&, State);
- State parseNonHTMLText(SegmentedString&, State);
- State parseTag(SegmentedString&, State);
- State parseEntity(SegmentedString&, UChar*& dest, State, unsigned& cBufferPos, bool start, bool parsingTag);
- State parseProcessingInstruction(SegmentedString&, State);
- State scriptHandler(State);
- State scriptExecution(const ScriptSourceCode&, State);
- void setSrc(const SegmentedString&);
-
- // check if we have enough space in the buffer.
- // if not enlarge it
- inline void checkBuffer(int len = 10)
- {
- if ((m_dest - m_buffer) > m_bufferSize - len)
- enlargeBuffer(len);
- }
-
- inline void checkScriptBuffer(int len = 10)
- {
- if (m_scriptCodeSize + len >= m_scriptCodeCapacity)
- enlargeScriptBuffer(len);
- }
-
- void enlargeBuffer(int len);
- void enlargeScriptBuffer(int len);
-
- bool continueProcessing(int& processedCount, double startTime, State&);
- void timerFired(Timer<HTMLDocumentParser>*);
- void allDataProcessed();
-
- // from CachedResourceClient
- void notifyFinished(CachedResource*);
-
- void executeExternalScriptsIfReady();
- void executeExternalScriptsTimerFired(Timer<HTMLDocumentParser>*);
- bool continueExecutingExternalScripts(double startTime);
-
- // Internal buffers
- ///////////////////
- UChar* m_buffer;
- int m_bufferSize;
- UChar* m_dest;
-
- Token m_currentToken;
-
- // This buffer holds the raw characters we've seen between the beginning of
- // the attribute name and the first character of the attribute value.
- Vector<UChar, 32> m_rawAttributeBeforeValue;
-
- // DocumentParser flags
- //////////////////
- // are we in quotes within a html tag
- enum { NoQuote, SingleQuote, DoubleQuote } tquote;
-
- // Are we in a &... character entity description?
- enum EntityState {
- NoEntity = 0,
- SearchEntity = 1,
- NumericSearch = 2,
- Hexadecimal = 3,
- Decimal = 4,
- EntityName = 5,
- SearchSemicolon = 6
- };
- unsigned EntityUnicodeValue;
-
- enum TagState {
- NoTag = 0,
- TagName = 1,
- SearchAttribute = 2,
- AttributeName = 3,
- SearchEqual = 4,
- SearchValue = 5,
- QuotedValue = 6,
- Value = 7,
- SearchEnd = 8
- };
-
- class State {
- public:
- State() : m_bits(0) { }
-
- TagState tagState() const { return static_cast<TagState>(m_bits & TagMask); }
- void setTagState(TagState t) { m_bits = (m_bits & ~TagMask) | t; }
- EntityState entityState() const { return static_cast<EntityState>((m_bits & EntityMask) >> EntityShift); }
- void setEntityState(EntityState e) { m_bits = (m_bits & ~EntityMask) | (e << EntityShift); }
-
- bool inScript() const { return testBit(InScript); }
- void setInScript(bool v) { setBit(InScript, v); }
- bool inStyle() const { return testBit(InStyle); }
- void setInStyle(bool v) { setBit(InStyle, v); }
- bool inXmp() const { return testBit(InXmp); }
- void setInXmp(bool v) { setBit(InXmp, v); }
- bool inTitle() const { return testBit(InTitle); }
- void setInTitle(bool v) { setBit(InTitle, v); }
- bool inIFrame() const { return testBit(InIFrame); }
- void setInIFrame(bool v) { setBit(InIFrame, v); }
- bool inPlainText() const { return testBit(InPlainText); }
- void setInPlainText(bool v) { setBit(InPlainText, v); }
- bool inProcessingInstruction() const { return testBit(InProcessingInstruction); }
- void setInProcessingInstruction(bool v) { return setBit(InProcessingInstruction, v); }
- bool inComment() const { return testBit(InComment); }
- void setInComment(bool v) { setBit(InComment, v); }
- bool inDoctype() const { return testBit(InDoctype); }
- void setInDoctype(bool v) { setBit(InDoctype, v); }
- bool inTextArea() const { return testBit(InTextArea); }
- void setInTextArea(bool v) { setBit(InTextArea, v); }
- bool escaped() const { return testBit(Escaped); }
- void setEscaped(bool v) { setBit(Escaped, v); }
- bool inServer() const { return testBit(InServer); }
- void setInServer(bool v) { setBit(InServer, v); }
- bool skipLF() const { return testBit(SkipLF); }
- void setSkipLF(bool v) { setBit(SkipLF, v); }
- bool startTag() const { return testBit(StartTag); }
- void setStartTag(bool v) { setBit(StartTag, v); }
- bool discardLF() const { return testBit(DiscardLF); }
- void setDiscardLF(bool v) { setBit(DiscardLF, v); }
- bool allowYield() const { return testBit(AllowYield); }
- void setAllowYield(bool v) { setBit(AllowYield, v); }
- bool loadingExtScript() const { return testBit(LoadingExtScript); }
- void setLoadingExtScript(bool v) { setBit(LoadingExtScript, v); }
- bool forceSynchronous() const { return testBit(ForceSynchronous); }
- void setForceSynchronous(bool v) { setBit(ForceSynchronous, v); }
-
- bool inAnyNonHTMLText() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame); }
- bool hasTagState() const { return m_bits & TagMask; }
- bool hasEntityState() const { return m_bits & EntityMask; }
-
- bool needsSpecialWriteHandling() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame | TagMask | EntityMask | InPlainText | InComment | InDoctype | InServer | InProcessingInstruction | StartTag); }
-
- private:
- static const int EntityShift = 4;
- enum StateBits {
- TagMask = (1 << 4) - 1,
- EntityMask = (1 << 7) - (1 << 4),
- InScript = 1 << 7,
- InStyle = 1 << 8,
- // Bit 9 unused
- InXmp = 1 << 10,
- InTitle = 1 << 11,
- InPlainText = 1 << 12,
- InProcessingInstruction = 1 << 13,
- InComment = 1 << 14,
- InTextArea = 1 << 15,
- Escaped = 1 << 16,
- InServer = 1 << 17,
- SkipLF = 1 << 18,
- StartTag = 1 << 19,
- DiscardLF = 1 << 20, // FIXME: should clarify difference between skip and discard
- AllowYield = 1 << 21,
- LoadingExtScript = 1 << 22,
- ForceSynchronous = 1 << 23,
- InIFrame = 1 << 24,
- InDoctype = 1 << 25
- };
-
- void setBit(StateBits bit, bool value)
- {
- if (value)
- m_bits |= bit;
- else
- m_bits &= ~bit;
- }
- bool testBit(StateBits bit) const { return m_bits & bit; }
-
- unsigned m_bits;
+ // DocumentParser
+ virtual void begin();
+ virtual void write(const SegmentedString&, bool isFromNetwork);
+ virtual void finish();
+ virtual bool finishWasCalled();
+ virtual bool processingData() const;
+ virtual void stopParsing();
+ virtual bool isWaitingForScripts() const;
+ virtual bool isExecutingScript() const;
+ virtual void executeScriptsWaitingForStylesheets();
+ virtual int lineNumber() const;
+ virtual int columnNumber() const;
+ // FIXME: HTMLFormControlElement accesses the LegacyHTMLTreeBuilder via this method.
+ // Remove this when the LegacyHTMLTreeBuilder is no longer used.
+ virtual LegacyHTMLTreeBuilder* htmlTreeBuilder() const;
+
+ // HTMLScriptRunnerHost
+ virtual void watchForLoad(CachedResource*);
+ virtual void stopWatchingForLoad(CachedResource*);
+ virtual bool shouldLoadExternalScriptFromSrc(const AtomicString&);
+ virtual HTMLInputStream& inputStream() { return m_input; }
+
+ // CachedResourceClient
+ virtual void notifyFinished(CachedResource*);
+
+ void willPumpLexer();
+ void didPumpLexer();
+
+ enum SynchronousMode {
+ AllowYield,
+ ForceSynchronous,
};
+ void pumpTokenizer(SynchronousMode);
+ void pumpTokenizerIfPossible(SynchronousMode);
- State m_state;
-
- DoctypeToken m_doctypeToken;
- int m_doctypeSearchCount;
- int m_doctypeSecondarySearchCount;
-
- bool m_brokenServer;
-
- // Name of an attribute that we just scanned.
- AtomicString m_attrName;
+ bool runScriptsForPausedTreeBuilder();
+ void resumeParsingAfterScriptExecution();
- // Used to store the code of a scripting sequence
- UChar* m_scriptCode;
- // Size of the script sequenze stored in @ref #scriptCode
- int m_scriptCodeSize;
- // Maximal size that can be stored in @ref #scriptCode
- int m_scriptCodeCapacity;
- // resync point of script code size
- int m_scriptCodeResync;
-
- // Stores characters if we are scanning for a string like "</script>"
- UChar searchBuffer[10];
-
- // Counts where we are in the string we are scanning for
- int searchCount;
- // the stopper string
- const char* m_searchStopper;
- int m_searchStopperLength;
-
- // if no more data is coming, just parse what we have (including ext scripts that
- // may be still downloading) and finish
- bool m_noMoreData;
- // URL to get source code of script from
- String m_scriptTagSrcAttrValue;
- String m_scriptTagCharsetAttrValue;
- // the HTML code we will parse after the external script we are waiting for has loaded
- SegmentedString m_pendingSrc;
-
- // the HTML code we will parse after this particular script has
- // loaded, but before all pending HTML
- SegmentedString* m_currentPrependingSrc;
-
- // true if we are executing a script while parsing a document. This causes the parsing of
- // the output of the script to be postponed until after the script has finished executing
- int m_executingScript;
- Deque<CachedResourceHandle<CachedScript> > m_pendingScripts;
- RefPtr<HTMLScriptElement> m_scriptNode;
-
- bool m_requestingScript;
- bool m_hasScriptsWaitingForStylesheets;
-
- // if we found one broken comment, there are most likely others as well
- // store a flag to get rid of the O(n^2) behaviour in such a case.
- bool m_brokenComments;
- // current line number
- int m_lineNumber;
- int m_currentScriptTagStartLineNumber;
- int m_currentTagStartLineNumber;
+ void attemptToEnd();
+ void endIfDelayed();
+ void end();
- double m_tokenizerTimeDelay;
- int m_tokenizerChunkSize;
+ bool isScheduledForResume() const;
+ bool inScriptExecution() const;
+ bool inWrite() const { return m_writeNestingLevel > 0; }
- // The timer for continued processing.
- Timer<HTMLDocumentParser> m_timer;
+ ScriptController* script() const;
- // The timer for continued executing external scripts.
- Timer<HTMLDocumentParser> m_externalScriptsTimer;
+ HTMLInputStream m_input;
-// This buffer can hold arbitrarily long user-defined attribute names, such as in EMBED tags.
-// So any fixed number might be too small, but rather than rewriting all usage of this buffer
-// we'll just make it large enough to handle all imaginable cases.
-#define CBUFLEN 1024
- UChar m_cBuffer[CBUFLEN + 2];
- unsigned int m_cBufferPos;
+ // We hold m_token here because it might be partially complete.
+ HTMLToken m_token;
- SegmentedString m_src;
- Document* m_doc;
- OwnPtr<LegacyHTMLTreeConstructor> m_treeConstructor;
- bool m_inWrite;
- bool m_fragment;
- FragmentScriptingPermission m_scriptingPermission;
+ OwnPtr<HTMLTokenizer> m_tokenizer;
+ OwnPtr<HTMLScriptRunner> m_scriptRunner;
+ OwnPtr<HTMLTreeBuilder> m_treeBuilder;
+ OwnPtr<HTMLPreloadScanner> m_preloadScanner;
+ OwnPtr<HTMLParserScheduler> m_parserScheduler;
- OwnPtr<PreloadScanner> m_preloadScanner;
+ bool m_endWasDelayed;
+ int m_writeNestingLevel;
};
-void parseHTMLDocumentFragment(const String&, DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
-
-UChar decodeNamedEntity(const char*);
-
-} // namespace WebCore
+}
-#endif // HTMLTokenizer_h
+#endif
diff --git a/WebCore/html/HTMLElement.cpp b/WebCore/html/HTMLElement.cpp
index 8f2bead..0726977 100644
--- a/WebCore/html/HTMLElement.cpp
+++ b/WebCore/html/HTMLElement.cpp
@@ -39,13 +39,11 @@
#include "HTMLElementFactory.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
-#include "HTMLDocumentParser.h"
#include "RenderWordBreak.h"
#include "ScriptEventListener.h"
#include "Settings.h"
#include "Text.h"
#include "TextIterator.h"
-#include "XMLDocumentParser.h"
#include "markup.h"
#include <wtf/StdLibExtras.h>
@@ -58,7 +56,7 @@ using std::max;
PassRefPtr<HTMLElement> HTMLElement::create(const QualifiedName& tagName, Document* document)
{
- return adoptRef(new HTMLElement(tagName, document, CreateHTMLElement));
+ return adoptRef(new HTMLElement(tagName, document));
}
String HTMLElement::nodeName() const
@@ -549,13 +547,13 @@ Element* HTMLElement::insertAdjacentElement(const String& where, Element* newChi
return static_cast<Element*>(returnValue);
}
-void HTMLElement::insertAdjacentHTML(const String& where, const String& html, ExceptionCode& ec)
+void HTMLElement::insertAdjacentHTML(const String& where, const String& markup, ExceptionCode& ec)
{
RefPtr<DocumentFragment> fragment = document()->createDocumentFragment();
if (document()->isHTMLDocument())
- parseHTMLDocumentFragment(html, fragment.get());
+ fragment->parseHTML(markup);
else {
- if (!parseXMLDocumentFragment(html, fragment.get(), this))
+ if (!fragment->parseXML(markup, this))
// FIXME: We should propagate a syntax error exception out here.
return;
}
diff --git a/WebCore/html/HTMLElement.h b/WebCore/html/HTMLElement.h
index db9cb98..03449c9 100644
--- a/WebCore/html/HTMLElement.h
+++ b/WebCore/html/HTMLElement.h
@@ -82,7 +82,7 @@ public:
static void addHTMLAlignmentToStyledElement(StyledElement*, Attribute*);
protected:
- HTMLElement(const QualifiedName& tagName, Document*, ConstructionType = CreateHTMLElementZeroRefCount);
+ HTMLElement(const QualifiedName& tagName, Document*);
void addHTMLAlignment(Attribute*);
@@ -111,8 +111,8 @@ private:
Node* insertAdjacent(const String& where, Node* newChild, ExceptionCode&);
};
-inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document, ConstructionType type)
- : StyledElement(tagName, document, type)
+inline HTMLElement::HTMLElement(const QualifiedName& tagName, Document* document)
+ : StyledElement(tagName, document, CreateHTMLElement)
{
ASSERT(tagName.localName().impl());
}
diff --git a/WebCore/html/HTMLElement.idl b/WebCore/html/HTMLElement.idl
index 627dda2..863f28c 100644
--- a/WebCore/html/HTMLElement.idl
+++ b/WebCore/html/HTMLElement.idl
@@ -26,14 +26,15 @@ module html {
] HTMLElement : Element {
// iht.com relies on id returning the empty string when no id is present.
// Other browsers do this as well. So we don't convert null to JS null.
- attribute [ConvertNullToNullString, Reflect] DOMString id;
- attribute [ConvertNullToNullString, Reflect] DOMString title;
- attribute [ConvertNullToNullString, Reflect] DOMString lang;
- attribute [ConvertNullToNullString, Reflect] DOMString dir;
- attribute [ConvertNullToNullString, Reflect=class] DOMString className;
+ attribute [Reflect] DOMString id;
+ attribute [Reflect] DOMString title;
+ attribute [Reflect] DOMString lang;
+ attribute [Reflect] DOMString dir;
+ attribute [Reflect=class] DOMString className;
- attribute long tabIndex;
- attribute boolean draggable;
+ attribute long tabIndex;
+ attribute boolean draggable;
+ attribute [Reflect] boolean hidden;
// Extensions
attribute [ConvertNullToNullString] DOMString innerHTML
diff --git a/WebCore/html/HTMLEmbedElement.idl b/WebCore/html/HTMLEmbedElement.idl
index 576bca9..4997210 100644
--- a/WebCore/html/HTMLEmbedElement.idl
+++ b/WebCore/html/HTMLEmbedElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -25,25 +25,24 @@ module html {
DelegatingGetOwnPropertySlot,
CustomCall
] HTMLEmbedElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString align;
+ attribute [Reflect] DOMString align;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- attribute [ConvertNullToNullString, Reflect] DOMString height;
+ attribute [Reflect] DOMString height;
#else
- attribute [ConvertFromString] long height;
+ attribute [Reflect] long height;
#endif
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString src;
- attribute [ConvertNullToNullString, Reflect] DOMString type;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString src;
+ attribute [Reflect] DOMString type;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- attribute [ConvertNullToNullString, Reflect] DOMString width;
+ attribute [Reflect] DOMString width;
#else
- attribute [ConvertFromString] long width;
+ attribute [Reflect] long width;
#endif
#if defined(ENABLE_SVG) && ENABLE_SVG
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
- [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
- raises(DOMException);
+ [SVGCheckSecurityDocument] SVGDocument getSVGDocument() raises(DOMException);
#endif
#endif
};
diff --git a/WebCore/html/HTML5EntityParser.cpp b/WebCore/html/HTMLEntityParser.cpp
index f168245..3d8d48d 100644
--- a/WebCore/html/HTML5EntityParser.cpp
+++ b/WebCore/html/HTMLEntityParser.cpp
@@ -26,7 +26,7 @@
*/
#include "config.h"
-#include "HTML5EntityParser.h"
+#include "HTMLEntityParser.h"
#include <wtf/Vector.h>
@@ -96,7 +96,7 @@ void unconsumeCharacters(SegmentedString& source, const Vector<UChar, 10>& consu
}
-unsigned consumeHTML5Entity(SegmentedString& source, bool& notEnoughCharacters, UChar additionalAllowedCharacter)
+unsigned consumeHTMLEntity(SegmentedString& source, bool& notEnoughCharacters, UChar additionalAllowedCharacter)
{
ASSERT(!additionalAllowedCharacter || additionalAllowedCharacter == '"' || additionalAllowedCharacter == '\'' || additionalAllowedCharacter == '>');
ASSERT(!notEnoughCharacters);
diff --git a/WebCore/html/HTML5EntityParser.h b/WebCore/html/HTMLEntityParser.h
index f0a921f..d37b0c3 100644
--- a/WebCore/html/HTML5EntityParser.h
+++ b/WebCore/html/HTMLEntityParser.h
@@ -24,14 +24,14 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTML5EntityParser_h
-#define HTML5EntityParser_h
+#ifndef HTMLEntityParser_h
+#define HTMLEntityParser_h
#include "SegmentedString.h"
namespace WebCore {
-unsigned consumeHTML5Entity(SegmentedString&, bool& notEnoughCharacters, UChar additionalAllowedCharacter = '\0');
+unsigned consumeHTMLEntity(SegmentedString&, bool& notEnoughCharacters, UChar additionalAllowedCharacter = '\0');
}
diff --git a/WebCore/html/HTMLFieldSetElement.cpp b/WebCore/html/HTMLFieldSetElement.cpp
index 5e27786..ae0f8e7 100644
--- a/WebCore/html/HTMLFieldSetElement.cpp
+++ b/WebCore/html/HTMLFieldSetElement.cpp
@@ -41,7 +41,7 @@ inline HTMLFieldSetElement::HTMLFieldSetElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLFieldSetElement> HTMLFieldSetElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLFieldSetElement(tagName, document, form);
+ return adoptRef(new HTMLFieldSetElement(tagName, document, form));
}
bool HTMLFieldSetElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLFontElement.cpp b/WebCore/html/HTMLFontElement.cpp
index ab103b1..74320de 100644
--- a/WebCore/html/HTMLFontElement.cpp
+++ b/WebCore/html/HTMLFontElement.cpp
@@ -42,7 +42,7 @@ HTMLFontElement::HTMLFontElement(const QualifiedName& tagName, Document* documen
PassRefPtr<HTMLFontElement> HTMLFontElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLFontElement(tagName, document);
+ return adoptRef(new HTMLFontElement(tagName, document));
}
// Allows leading spaces.
diff --git a/WebCore/html/HTMLFontElement.idl b/WebCore/html/HTMLFontElement.idl
index fa7d908..141816d 100644
--- a/WebCore/html/HTMLFontElement.idl
+++ b/WebCore/html/HTMLFontElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,9 +20,9 @@
module html {
interface HTMLFontElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString color;
- attribute [ConvertNullToNullString] DOMString face;
- attribute [ConvertNullToNullString] DOMString size;
+ attribute [Reflect] DOMString color;
+ attribute [Reflect] DOMString face;
+ attribute [Reflect] DOMString size;
};
}
diff --git a/WebCore/html/HTMLFormControlElement.cpp b/WebCore/html/HTMLFormControlElement.cpp
index 62474cc..0b1c55a 100644
--- a/WebCore/html/HTMLFormControlElement.cpp
+++ b/WebCore/html/HTMLFormControlElement.cpp
@@ -38,8 +38,8 @@
#include "HTMLFormElement.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLTreeBuilder.h"
+#include "LegacyHTMLDocumentParser.h"
#include "LabelsNodeList.h"
#include "Page.h"
#include "RenderBox.h"
@@ -53,9 +53,9 @@ namespace WebCore {
using namespace HTMLNames;
-HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* doc, HTMLFormElement* f, ConstructionType constructionType)
- : HTMLElement(tagName, doc, constructionType)
- , m_form(f)
+HTMLFormControlElement::HTMLFormControlElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
+ : HTMLElement(tagName, document)
+ , m_form(form)
, m_disabled(false)
, m_readOnly(false)
, m_required(false)
@@ -178,11 +178,11 @@ void HTMLFormControlElement::removedFromTree(bool deep)
{
// 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.
- LegacyHTMLTreeConstructor* treeConstructor = 0;
+ LegacyHTMLTreeBuilder* treeBuilder = 0;
if (DocumentParser* parser = document()->parser())
- treeConstructor = parser->htmlTreeConstructor();
+ treeBuilder = parser->htmlTreeBuilder();
- if (m_form && !(treeConstructor && treeConstructor->isHandlingResidualStyleAcrossBlocks()) && findRoot(this) != findRoot(m_form)) {
+ if (m_form && !(treeBuilder && treeBuilder->isHandlingResidualStyleAcrossBlocks()) && findRoot(this) != findRoot(m_form)) {
m_form->removeFormElement(this);
m_form = 0;
}
@@ -223,7 +223,7 @@ bool HTMLFormControlElement::autofocus() const
void HTMLFormControlElement::setAutofocus(bool b)
{
- setAttribute(autofocusAttr, b ? "autofocus" : 0);
+ setAttribute(autofocusAttr, b ? "" : 0);
}
bool HTMLFormControlElement::required() const
@@ -233,7 +233,7 @@ bool HTMLFormControlElement::required() const
void HTMLFormControlElement::setRequired(bool b)
{
- setAttribute(requiredAttr, b ? "required" : 0);
+ setAttribute(requiredAttr, b ? "" : 0);
}
static void updateFromElementCallback(Node* node)
diff --git a/WebCore/html/HTMLFormControlElement.h b/WebCore/html/HTMLFormControlElement.h
index b960381..87f6376 100644
--- a/WebCore/html/HTMLFormControlElement.h
+++ b/WebCore/html/HTMLFormControlElement.h
@@ -34,6 +34,8 @@ class RenderTextControl;
class ValidityState;
class VisibleSelection;
+// FIXME: The HTML5 specification calls these form-associated elements.
+// So consider renaming this to HTMLFormAssociatedElement.
class HTMLFormControlElement : public HTMLElement {
public:
virtual ~HTMLFormControlElement();
@@ -44,7 +46,7 @@ public:
bool formNoValidate() const;
void setFormNoValidate(bool);
- virtual void reset() {}
+ virtual void reset() { }
virtual bool formControlValueMatchesRenderer() const { return m_valueMatchesRenderer; }
virtual void setFormControlValueMatchesRenderer(bool b) { m_valueMatchesRenderer = b; }
@@ -77,9 +79,8 @@ public:
virtual bool isRadioButton() const { return false; }
virtual bool canTriggerImplicitSubmission() const { return false; }
- /* Override in derived classes to get the encoded name=value pair for submitting.
- * Return true for a successful control (see HTML4-17.13.2).
- */
+ // Override in derived classes to get the encoded name=value pair for submitting.
+ // Return true for a successful control (see HTML4-17.13.2).
virtual bool appendFormData(FormDataList&, bool) { return false; }
virtual bool isSuccessfulSubmitButton() const { return false; }
@@ -104,7 +105,7 @@ public:
bool readOnly() const { return m_readOnly; }
protected:
- HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*, ConstructionType = CreateHTMLElementZeroRefCount);
+ HTMLFormControlElement(const QualifiedName& tagName, Document*, HTMLFormElement*);
virtual void parseMappedAttribute(Attribute*);
virtual void attach();
@@ -120,6 +121,7 @@ protected:
virtual void dispatchBlurEvent();
void removeFromForm();
+
// This must be called any time the result of willValidate() has changed.
void setNeedsWillValidateCheck();
virtual bool recalcWillValidate() const;
@@ -147,16 +149,19 @@ private:
bool m_readOnly : 1;
bool m_required : 1;
bool m_valueMatchesRenderer : 1;
- // The initial value of m_willValidate depends on a subclass, and we can't
+
+ // The initial value of m_willValidate depends on the derived class. We can't
// initialize it with a virtual function in the constructor. m_willValidate
- // is not deterministic during m_willValidateInitialized=false.
+ // is not deterministic as long as m_willValidateInitialized is false.
mutable bool m_willValidateInitialized: 1;
mutable bool m_willValidate : 1;
+
// Cache of validity()->valid().
- // "candidate for constraint validation" doesn't affect to m_isValid.
+ // But "candidate for constraint validation" doesn't affect m_isValid.
bool m_isValid : 1;
};
+// FIXME: Give this class its own header file.
class HTMLFormControlElementWithState : public HTMLFormControlElement {
public:
virtual ~HTMLFormControlElementWithState();
@@ -175,6 +180,7 @@ private:
virtual void finishParsingChildren();
};
+// FIXME: Give this class its own header file.
class HTMLTextFormControlElement : public HTMLFormControlElementWithState {
public:
virtual ~HTMLTextFormControlElement();
@@ -206,14 +212,15 @@ private:
virtual int cachedSelectionStart() const = 0;
virtual int cachedSelectionEnd() const = 0;
- // A subclass should return true if placeholder processing is needed.
+ // The derived class should return true if placeholder processing is needed.
virtual bool supportsPlaceholder() const = 0;
- // Returns true if user-editable value is empty. This is used to check placeholder visibility.
+ // Returns true if user-editable value is empty. Used to check placeholder visibility.
virtual bool isEmptyValue() const = 0;
// Called in dispatchFocusEvent(), after placeholder process, before calling parent's dispatchFocusEvent().
virtual void handleFocusEvent() { }
// Called in dispatchBlurEvent(), after placeholder process, before calling parent's dispatchBlurEvent().
virtual void handleBlurEvent() { }
+
RenderTextControl* textRendererAfterUpdateLayout();
};
diff --git a/WebCore/html/HTMLFormElement.cpp b/WebCore/html/HTMLFormElement.cpp
index 084470c..9d58934 100644
--- a/WebCore/html/HTMLFormElement.cpp
+++ b/WebCore/html/HTMLFormElement.cpp
@@ -26,7 +26,6 @@
#include "HTMLFormElement.h"
#include "Attribute.h"
-#include "CSSHelper.h"
#include "DOMFormData.h"
#include "DOMWindow.h"
#include "Document.h"
@@ -37,6 +36,7 @@
#include "FormData.h"
#include "FormDataList.h"
#include "FormState.h"
+#include "FormSubmission.h"
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
@@ -86,12 +86,12 @@ HTMLFormElement::HTMLFormElement(const QualifiedName& tagName, Document* documen
PassRefPtr<HTMLFormElement> HTMLFormElement::create(Document* document)
{
- return new HTMLFormElement(formTag, document);
+ return adoptRef(new HTMLFormElement(formTag, document));
}
PassRefPtr<HTMLFormElement> HTMLFormElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLFormElement(tagName, document);
+ return adoptRef(new HTMLFormElement(tagName, document));
}
HTMLFormElement::~HTMLFormElement()
@@ -192,32 +192,77 @@ void HTMLFormElement::submitImplicitly(Event* event, bool fromImplicitSubmission
prepareSubmit(event);
}
-TextEncoding HTMLFormElement::dataEncoding() const
+static void appendMailtoPostFormDataToURL(KURL& url, const FormData& data, const String& encodingType)
{
- if (isMailtoForm())
- return UTF8Encoding();
+ String body = data.flattenToString();
- return m_formDataBuilder.dataEncoding(document());
+ if (equalIgnoringCase(encodingType, "text/plain")) {
+ // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded as %20.
+ body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', ' ') + "\r\n");
+ }
+
+ Vector<char> bodyData;
+ bodyData.append("body=", 5);
+ FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8());
+ body = String(bodyData.data(), bodyData.size()).replace('+', "%20");
+
+ String query = url.query();
+ if (!query.isEmpty())
+ query.append('&');
+ query.append(body);
+ url.setQuery(query);
}
-PassRefPtr<FormData> HTMLFormElement::createFormData()
+PassRefPtr<FormSubmission> HTMLFormElement::prepareFormSubmission(Event* event, bool lockHistory, FormSubmissionTrigger trigger)
{
- RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding().encodingForFormSubmission());
+ KURL actionURL = document()->completeURL(m_formDataBuilder.action().isEmpty() ? document()->url().string() : m_formDataBuilder.action());
+ bool isMailtoForm = actionURL.protocolIs("mailto");
+
+ if (m_formDataBuilder.isPostMethod()) {
+ if (m_formDataBuilder.isMultiPartForm() && isMailtoForm) {
+ m_formDataBuilder.parseEncodingType("application/x-www-form-urlencoded");
+ ASSERT(!m_formDataBuilder.isMultiPartForm());
+ }
+ } else
+ m_formDataBuilder.setIsMultiPartForm(false);
+
+ TextEncoding dataEncoding = isMailtoForm ? UTF8Encoding() : m_formDataBuilder.dataEncoding(document());
+ RefPtr<DOMFormData> domFormData = DOMFormData::create(dataEncoding.encodingForFormSubmission());
+ Vector<pair<String, String> > formValues;
+
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
HTMLFormControlElement* control = m_associatedElements[i];
if (!control->disabled())
control->appendFormData(*domFormData, m_formDataBuilder.isMultiPartForm());
+ if (control->hasLocalName(inputTag)) {
+ HTMLInputElement* input = static_cast<HTMLInputElement*>(control);
+ if (input->isTextField()) {
+ formValues.append(pair<String, String>(input->name(), input->value()));
+ if (input->isSearchField())
+ input->addSearchResult();
+ }
+ }
}
- RefPtr<FormData> result = (m_formDataBuilder.isMultiPartForm()) ? FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document()) : FormData::create(domFormData->items(), domFormData->encoding());
+ RefPtr<FormData> formData;
+ String boundary;
- result->setIdentifier(generateFormDataIdentifier());
- return result;
-}
+ if (m_formDataBuilder.isMultiPartForm()) {
+ formData = FormData::createMultiPart(domFormData->items(), domFormData->encoding(), document());
+ boundary = formData->boundary().data();
+ } else {
+ formData = FormData::create(domFormData->items(), domFormData->encoding());
+ if (m_formDataBuilder.isPostMethod() && isMailtoForm) {
+ // Convert the form data into a string that we put into the URL.
+ appendMailtoPostFormDataToURL(actionURL, *formData, m_formDataBuilder.encodingType());
+ formData = FormData::create();
+ }
+ }
-bool HTMLFormElement::isMailtoForm() const
-{
- return protocolIs(m_url, "mailto");
+ formData->setIdentifier(generateFormDataIdentifier());
+ FormSubmission::Method method = m_formDataBuilder.isPostMethod() ? FormSubmission::PostMethod : FormSubmission::GetMethod;
+ String targetOrBaseTarget = m_formDataBuilder.target().isEmpty() ? document()->baseTarget() : m_formDataBuilder.target();
+ return FormSubmission::create(method, actionURL, targetOrBaseTarget, m_formDataBuilder.encodingType(), FormState::create(this, formValues, document()->frame(), trigger), formData.release(), boundary, lockHistory, event);
}
static inline HTMLFormControlElement* submitElementFromEvent(const Event* event)
@@ -304,28 +349,6 @@ bool HTMLFormElement::prepareSubmit(Event* event)
return m_doingsubmit;
}
-static void transferMailtoPostFormDataToURL(RefPtr<FormData>& data, KURL& url, const String& encodingType)
-{
- String body = data->flattenToString();
- data = FormData::create();
-
- if (equalIgnoringCase(encodingType, "text/plain")) {
- // Convention seems to be to decode, and s/&/\r\n/. Also, spaces are encoded as %20.
- body = decodeURLEscapeSequences(body.replace('&', "\r\n").replace('+', ' ') + "\r\n");
- }
-
- Vector<char> bodyData;
- bodyData.append("body=", 5);
- FormDataBuilder::encodeStringAsFormData(bodyData, body.utf8());
- body = String(bodyData.data(), bodyData.size()).replace('+', "%20");
-
- String query = url.query();
- if (!query.isEmpty())
- query.append('&');
- query.append(body);
- url.setQuery(query);
-}
-
void HTMLFormElement::submit(Frame* javaScriptActiveFrame)
{
if (javaScriptActiveFrame)
@@ -351,18 +374,8 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
HTMLFormControlElement* firstSuccessfulSubmitButton = 0;
bool needButtonActivation = activateSubmitButton; // do we need to activate a submit button?
- Vector<pair<String, String> > formValues;
-
for (unsigned i = 0; i < m_associatedElements.size(); ++i) {
HTMLFormControlElement* control = m_associatedElements[i];
- if (control->hasLocalName(inputTag)) {
- HTMLInputElement* input = static_cast<HTMLInputElement*>(control);
- if (input->isTextField()) {
- formValues.append(pair<String, String>(input->name(), input->value()));
- if (input->isSearchField())
- input->addSearchResult();
- }
- }
if (needButtonActivation) {
if (control->isActivatedSubmit())
needButtonActivation = false;
@@ -371,37 +384,10 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool lockH
}
}
- RefPtr<FormState> formState = FormState::create(this, formValues, frame, formSubmissionTrigger);
-
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(true);
-
- if (m_url.isEmpty())
- m_url = document()->url().string();
- if (m_formDataBuilder.isPostMethod()) {
- if (m_formDataBuilder.isMultiPartForm() && isMailtoForm()) {
- setEnctype("application/x-www-form-urlencoded");
- ASSERT(!m_formDataBuilder.isMultiPartForm());
- }
-
- RefPtr<FormData> data = createFormData();
- if (!m_formDataBuilder.isMultiPartForm()) {
-
- if (isMailtoForm()) {
- // Convert the form data into a string that we put into the URL.
- KURL url = document()->completeURL(m_url);
- transferMailtoPostFormDataToURL(data, url, m_formDataBuilder.encodingType());
- m_url = url.string();
- }
-
- frame->loader()->submitForm("POST", m_url, data.release(), m_target, m_formDataBuilder.encodingType(), String(), lockHistory, event, formState.release());
- } else
- frame->loader()->submitForm("POST", m_url, data.get(), m_target, m_formDataBuilder.encodingType(), data->boundary().data(), lockHistory, event, formState.release());
- } else {
- m_formDataBuilder.setIsMultiPartForm(false);
- frame->loader()->submitForm("GET", m_url, createFormData(), m_target, String(), String(), lockHistory, event, formState.release());
- }
+ frame->loader()->submitForm(prepareFormSubmission(event, lockHistory, formSubmissionTrigger));
if (needButtonActivation && firstSuccessfulSubmitButton)
firstSuccessfulSubmitButton->setActivatedSubmit(false);
@@ -433,9 +419,9 @@ void HTMLFormElement::reset()
void HTMLFormElement::parseMappedAttribute(Attribute* attr)
{
if (attr->name() == actionAttr)
- m_url = deprecatedParseURL(attr->value());
+ m_formDataBuilder.parseAction(attr->value());
else if (attr->name() == targetAttr)
- m_target = attr->value();
+ m_formDataBuilder.setTarget(attr->value());
else if (attr->name() == methodAttr)
m_formDataBuilder.parseMethodType(attr->value());
else if (attr->name() == enctypeAttr)
@@ -648,7 +634,7 @@ void HTMLFormElement::getNamedElements(const AtomicString& name, Vector<RefPtr<N
// see if we have seen something with this name before
RefPtr<HTMLFormControlElement> aliasElem;
- if (aliasElem = elementForAlias(name)) {
+ if ((aliasElem = elementForAlias(name))) {
bool found = false;
for (unsigned n = 0; n < namedItems.size(); n++) {
if (namedItems[n] == aliasElem.get()) {
diff --git a/WebCore/html/HTMLFormElement.h b/WebCore/html/HTMLFormElement.h
index a49f443..b19ff07 100644
--- a/WebCore/html/HTMLFormElement.h
+++ b/WebCore/html/HTMLFormElement.h
@@ -34,6 +34,7 @@ namespace WebCore {
class Event;
class FormData;
+class FormSubmission;
class HTMLFormControlElement;
class HTMLImageElement;
class HTMLInputElement;
@@ -135,9 +136,7 @@ private:
void submit(Event*, bool activateSubmitButton, bool lockHistory, FormSubmissionTrigger);
- bool isMailtoForm() const;
- TextEncoding dataEncoding() const;
- PassRefPtr<FormData> createFormData();
+ PassRefPtr<FormSubmission> prepareFormSubmission(Event*, bool lockHistory, FormSubmissionTrigger);
unsigned formElementIndex(HTMLFormControlElement*);
// Returns true if the submission should be proceeded.
bool validateInteractively(Event*);
@@ -158,8 +157,6 @@ private:
Vector<HTMLFormControlElement*> m_associatedElements;
Vector<HTMLImageElement*> m_imageElements;
- String m_url;
- String m_target;
bool m_autocomplete : 1;
bool m_insubmit : 1;
bool m_doingsubmit : 1;
diff --git a/WebCore/html/HTMLFormElement.idl b/WebCore/html/HTMLFormElement.idl
index 0654a7d..c5162f9 100644
--- a/WebCore/html/HTMLFormElement.idl
+++ b/WebCore/html/HTMLFormElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -24,19 +24,20 @@ module html {
HasIndexGetter,
HasOverridingNameGetter
] HTMLFormElement : HTMLElement {
- readonly attribute HTMLCollection elements;
- readonly attribute long length;
- attribute [ConvertNullToNullString] DOMString name;
- attribute boolean noValidate;
- attribute [ConvertNullToNullString] DOMString acceptCharset;
- attribute [ConvertNullToNullString] DOMString action;
- attribute [ConvertNullToNullString] DOMString encoding; /* Netscape/Firefox legacy attribute. Same as enctype. */
- attribute [ConvertNullToNullString] DOMString enctype;
- attribute [ConvertNullToNullString] DOMString method;
- attribute [ConvertNullToNullString] DOMString target;
+ readonly attribute HTMLCollection elements;
+ readonly attribute long length;
+
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] boolean noValidate;
+ attribute [Reflect=accept_charset] DOMString acceptCharset;
+ attribute [Reflect] DOMString action;
+ attribute [ConvertNullToNullString] DOMString encoding; /* Netscape/Firefox legacy attribute. Same as enctype. */
+ attribute [ConvertNullToNullString] DOMString enctype;
+ attribute [Reflect] DOMString method;
+ attribute [Reflect] DOMString target;
[CallWith=DynamicFrame] void submit();
void reset();
- boolean checkValidity();
+ boolean checkValidity();
};
}
diff --git a/WebCore/html/HTMLFrameElement.idl b/WebCore/html/HTMLFrameElement.idl
index 453de0a..8f618c6 100644
--- a/WebCore/html/HTMLFrameElement.idl
+++ b/WebCore/html/HTMLFrameElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -22,17 +22,17 @@ module html {
interface HTMLFrameElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect=frameborder] DOMString frameBorder;
- attribute [ConvertNullToNullString, Reflect=longdesc] DOMString longDesc;
- attribute [ConvertNullToNullString, Reflect=marginheight] DOMString marginHeight;
- attribute [ConvertNullToNullString, Reflect=marginwidth] DOMString marginWidth;
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute boolean noResize;
- attribute [ConvertNullToNullString, Reflect] DOMString scrolling;
- attribute [ConvertNullToNullString, CustomSetter, ReflectURL] DOMString src;
+ attribute [Reflect] DOMString frameBorder;
+ attribute [Reflect] DOMString longDesc;
+ attribute [Reflect] DOMString marginHeight;
+ attribute [Reflect] DOMString marginWidth;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] boolean noResize;
+ attribute [Reflect] DOMString scrolling;
+ attribute [ReflectURL, CustomSetter] DOMString src;
// Introduced in DOM Level 2:
- readonly attribute [CheckFrameSecurity] Document contentDocument;
+ readonly attribute [CheckFrameSecurity] Document contentDocument;
// Extensions
readonly attribute DOMWindow contentWindow;
@@ -44,9 +44,10 @@ module html {
#endif
#endif
- attribute [ConvertNullToNullString, CustomSetter] DOMString location;
- readonly attribute long width;
- readonly attribute long height;
+ attribute [ConvertNullToNullString, CustomSetter] DOMString location;
+
+ readonly attribute long width;
+ readonly attribute long height;
};
diff --git a/WebCore/html/HTMLFrameElementBase.cpp b/WebCore/html/HTMLFrameElementBase.cpp
index b21bf92..6cae891 100644
--- a/WebCore/html/HTMLFrameElementBase.cpp
+++ b/WebCore/html/HTMLFrameElementBase.cpp
@@ -104,7 +104,7 @@ void HTMLFrameElementBase::openURL(bool lockHistory, bool lockBackForwardList)
if (!parentFrame)
return;
- parentFrame->loader()->requestFrame(this, m_URL, m_frameName, lockHistory, lockBackForwardList);
+ parentFrame->loader()->subframeLoader()->requestFrame(this, m_URL, m_frameName, lockHistory, lockBackForwardList);
if (contentFrame())
contentFrame()->setInViewSourceMode(viewSourceMode());
}
diff --git a/WebCore/html/HTMLFrameOwnerElement.cpp b/WebCore/html/HTMLFrameOwnerElement.cpp
index a9538fd..a1a69f3 100644
--- a/WebCore/html/HTMLFrameOwnerElement.cpp
+++ b/WebCore/html/HTMLFrameOwnerElement.cpp
@@ -33,7 +33,7 @@
namespace WebCore {
HTMLFrameOwnerElement::HTMLFrameOwnerElement(const QualifiedName& tagName, Document* document)
- : HTMLElement(tagName, document, CreateHTMLElement)
+ : HTMLElement(tagName, document)
, m_contentFrame(0)
, m_sandboxFlags(SandboxNone)
{
diff --git a/WebCore/html/HTMLFrameSetElement.cpp b/WebCore/html/HTMLFrameSetElement.cpp
index 0181cc9..7be3fdd 100644
--- a/WebCore/html/HTMLFrameSetElement.cpp
+++ b/WebCore/html/HTMLFrameSetElement.cpp
@@ -56,7 +56,7 @@ HTMLFrameSetElement::HTMLFrameSetElement(const QualifiedName& tagName, Document*
PassRefPtr<HTMLFrameSetElement> HTMLFrameSetElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLFrameSetElement(tagName, document);
+ return adoptRef(new HTMLFrameSetElement(tagName, document));
}
bool HTMLFrameSetElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLFrameSetElement.idl b/WebCore/html/HTMLFrameSetElement.idl
index 9763460..06aab6a 100644
--- a/WebCore/html/HTMLFrameSetElement.idl
+++ b/WebCore/html/HTMLFrameSetElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserve
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserve
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -23,8 +23,8 @@ module html {
interface [
HasOverridingNameGetter
] HTMLFrameSetElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString cols;
- attribute [ConvertNullToNullString] DOMString rows;
+ attribute [Reflect] DOMString cols;
+ attribute [Reflect] DOMString rows;
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
// Event handler attributes
diff --git a/WebCore/html/HTMLHRElement.cpp b/WebCore/html/HTMLHRElement.cpp
index b0fc6ff..c4ab28f 100644
--- a/WebCore/html/HTMLHRElement.cpp
+++ b/WebCore/html/HTMLHRElement.cpp
@@ -40,12 +40,12 @@ HTMLHRElement::HTMLHRElement(const QualifiedName& tagName, Document* document)
PassRefPtr<HTMLHRElement> HTMLHRElement::create(Document* document)
{
- return new HTMLHRElement(hrTag, document);
+ return adoptRef(new HTMLHRElement(hrTag, document));
}
PassRefPtr<HTMLHRElement> HTMLHRElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLHRElement(tagName, document);
+ return adoptRef(new HTMLHRElement(tagName, document));
}
bool HTMLHRElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLHRElement.idl b/WebCore/html/HTMLHRElement.idl
index bb1fdcf..23a57da 100644
--- a/WebCore/html/HTMLHRElement.idl
+++ b/WebCore/html/HTMLHRElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,10 +20,10 @@
module html {
interface HTMLHRElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString align;
- attribute boolean noShade;
- attribute [ConvertNullToNullString] DOMString size;
- attribute [ConvertNullToNullString] DOMString width;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] boolean noShade;
+ attribute [Reflect] DOMString size;
+ attribute [Reflect] DOMString width;
};
}
diff --git a/WebCore/html/HTMLHeadElement.cpp b/WebCore/html/HTMLHeadElement.cpp
index df5acb4..0fb7a47 100644
--- a/WebCore/html/HTMLHeadElement.cpp
+++ b/WebCore/html/HTMLHeadElement.cpp
@@ -39,12 +39,12 @@ HTMLHeadElement::HTMLHeadElement(const QualifiedName& tagName, Document* documen
PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(Document* document)
{
- return new HTMLHeadElement(headTag, document);
+ return adoptRef(new HTMLHeadElement(headTag, document));
}
PassRefPtr<HTMLHeadElement> HTMLHeadElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLHeadElement(tagName, document);
+ return adoptRef(new HTMLHeadElement(tagName, document));
}
String HTMLHeadElement::profile() const
diff --git a/WebCore/html/HTMLHeadElement.idl b/WebCore/html/HTMLHeadElement.idl
index 8559dd3..59bdbf0 100644
--- a/WebCore/html/HTMLHeadElement.idl
+++ b/WebCore/html/HTMLHeadElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLHeadElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString profile;
+ attribute [Reflect] DOMString profile;
};
}
diff --git a/WebCore/html/HTMLHeadingElement.cpp b/WebCore/html/HTMLHeadingElement.cpp
index dd5ae66..484dea6 100644
--- a/WebCore/html/HTMLHeadingElement.cpp
+++ b/WebCore/html/HTMLHeadingElement.cpp
@@ -36,7 +36,7 @@ inline HTMLHeadingElement::HTMLHeadingElement(const QualifiedName& tagName, Docu
PassRefPtr<HTMLHeadingElement> HTMLHeadingElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLHeadingElement(tagName, document);
+ return adoptRef(new HTMLHeadingElement(tagName, document));
}
bool HTMLHeadingElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLHeadingElement.idl b/WebCore/html/HTMLHeadingElement.idl
index 486a5bd..e419c1c 100644
--- a/WebCore/html/HTMLHeadingElement.idl
+++ b/WebCore/html/HTMLHeadingElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLHeadingElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString align;
+ attribute [Reflect] DOMString align;
};
}
diff --git a/WebCore/html/HTMLHtmlElement.cpp b/WebCore/html/HTMLHtmlElement.cpp
index 1949b59..46913a1 100644
--- a/WebCore/html/HTMLHtmlElement.cpp
+++ b/WebCore/html/HTMLHtmlElement.cpp
@@ -42,12 +42,12 @@ HTMLHtmlElement::HTMLHtmlElement(const QualifiedName& tagName, Document* documen
PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(Document* document)
{
- return new HTMLHtmlElement(htmlTag, document);
+ return adoptRef(new HTMLHtmlElement(htmlTag, document));
}
PassRefPtr<HTMLHtmlElement> HTMLHtmlElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLHtmlElement(tagName, document);
+ return adoptRef(new HTMLHtmlElement(tagName, document));
}
String HTMLHtmlElement::version() const
diff --git a/WebCore/html/HTMLHtmlElement.idl b/WebCore/html/HTMLHtmlElement.idl
index 9cee000..42ba861 100644
--- a/WebCore/html/HTMLHtmlElement.idl
+++ b/WebCore/html/HTMLHtmlElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,9 +20,7 @@
module html {
interface HTMLHtmlElement : HTMLElement {
-
- attribute [ConvertNullToNullString] DOMString version;
-
+ attribute [Reflect] DOMString version;
};
}
diff --git a/WebCore/html/HTMLIFrameElement.idl b/WebCore/html/HTMLIFrameElement.idl
index e1aed03..86abaf5 100644
--- a/WebCore/html/HTMLIFrameElement.idl
+++ b/WebCore/html/HTMLIFrameElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,21 +21,20 @@
module html {
interface HTMLIFrameElement : HTMLElement {
-
- attribute [ConvertNullToNullString, Reflect] DOMString align;
- attribute [ConvertNullToNullString, Reflect=frameborder] DOMString frameBorder;
- attribute [ConvertNullToNullString, Reflect] DOMString height;
- attribute [ConvertNullToNullString, Reflect=longdesc] DOMString longDesc;
- attribute [ConvertNullToNullString, Reflect=marginheight] DOMString marginHeight;
- attribute [ConvertNullToNullString, Reflect=marginwidth] DOMString marginWidth;
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString sandbox;
- attribute [ConvertNullToNullString, Reflect] DOMString scrolling;
- attribute [ConvertNullToNullString, CustomSetter, Reflect] DOMString src;
- attribute [ConvertNullToNullString, Reflect] DOMString width;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString frameBorder;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] DOMString longDesc;
+ attribute [Reflect] DOMString marginHeight;
+ attribute [Reflect] DOMString marginWidth;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString sandbox;
+ attribute [Reflect] DOMString scrolling;
+ attribute [CustomSetter, Reflect] DOMString src;
+ attribute [Reflect] DOMString width;
// Introduced in DOM Level 2:
- readonly attribute [CheckFrameSecurity] Document contentDocument;
+ readonly attribute [CheckFrameSecurity] Document contentDocument;
// Extensions
readonly attribute DOMWindow contentWindow;
@@ -46,7 +45,6 @@ module html {
raises(DOMException);
#endif
#endif
-
};
}
diff --git a/WebCore/html/HTMLImageElement.cpp b/WebCore/html/HTMLImageElement.cpp
index b149c95..5d5923d 100644
--- a/WebCore/html/HTMLImageElement.cpp
+++ b/WebCore/html/HTMLImageElement.cpp
@@ -55,12 +55,12 @@ HTMLImageElement::HTMLImageElement(const QualifiedName& tagName, Document* docum
PassRefPtr<HTMLImageElement> HTMLImageElement::create(Document* document)
{
- return new HTMLImageElement(imgTag, document);
+ return adoptRef(new HTMLImageElement(imgTag, document));
}
PassRefPtr<HTMLImageElement> HTMLImageElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLImageElement(tagName, document, form);
+ return adoptRef(new HTMLImageElement(tagName, document, form));
}
HTMLImageElement::~HTMLImageElement()
@@ -71,7 +71,7 @@ HTMLImageElement::~HTMLImageElement()
PassRefPtr<HTMLImageElement> HTMLImageElement::createForJSConstructor(Document* document, const int* optionalWidth, const int* optionalHeight)
{
- RefPtr<HTMLImageElement> image = new HTMLImageElement(imgTag, document);
+ RefPtr<HTMLImageElement> image = adoptRef(new HTMLImageElement(imgTag, document));
if (optionalWidth)
image->setWidth(*optionalWidth);
if (optionalHeight > 0)
diff --git a/WebCore/html/HTMLImageElement.idl b/WebCore/html/HTMLImageElement.idl
index a5a468e..0fc7271 100644
--- a/WebCore/html/HTMLImageElement.idl
+++ b/WebCore/html/HTMLImageElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -23,22 +23,22 @@ module html {
interface [
GenerateNativeConverter
] HTMLImageElement : HTMLElement {
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString align;
- attribute [ConvertNullToNullString, Reflect] DOMString alt;
- attribute [ConvertNullToNullString, Reflect] DOMString border;
- attribute long height;
- attribute long hspace;
- attribute boolean isMap;
- attribute [ConvertNullToNullString, ReflectURL=longdesc] DOMString longDesc;
- attribute [ConvertNullToNullString, ReflectURL] DOMString src;
- attribute [ConvertNullToNullString, Reflect=usemap] DOMString useMap;
- attribute long vspace;
- attribute long width;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString alt;
+ attribute [Reflect] DOMString border;
+ attribute long height;
+ attribute [Reflect] long hspace;
+ attribute [Reflect] boolean isMap;
+ attribute [ReflectURL=longdesc] DOMString longDesc;
+ attribute [ReflectURL] DOMString src;
+ attribute [Reflect] DOMString useMap;
+ attribute [Reflect] long vspace;
+ attribute long width;
// Extensions
readonly attribute boolean complete;
- attribute [ConvertNullToNullString, ReflectURL] DOMString lowsrc;
+ attribute [ReflectURL] DOMString lowsrc;
readonly attribute long naturalHeight;
readonly attribute long naturalWidth;
readonly attribute long x;
diff --git a/WebCore/html/HTMLInputElement.cpp b/WebCore/html/HTMLInputElement.cpp
index 9be9bff..5e27449 100644
--- a/WebCore/html/HTMLInputElement.cpp
+++ b/WebCore/html/HTMLInputElement.cpp
@@ -5,6 +5,7 @@
* Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* (C) 2006 Alexey Proskuryakov (ap@nypop.com)
* Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -47,7 +48,7 @@
#include "HTMLImageLoader.h"
#include "HTMLNames.h"
#include "HTMLOptionElement.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "KeyboardEvent.h"
#include "LocalizedStrings.h"
#include "MouseEvent.h"
@@ -128,7 +129,7 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document* docum
PassRefPtr<HTMLInputElement> HTMLInputElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLInputElement(tagName, document, form);
+ return adoptRef(new HTMLInputElement(tagName, document, form));
}
HTMLInputElement::~HTMLInputElement()
@@ -2828,6 +2829,40 @@ void HTMLInputElement::setWapInputFormat(String& mask)
}
#endif
-
+#if ENABLE(INPUT_SPEECH)
+bool HTMLInputElement::isSpeechEnabled() const
+{
+ switch (inputType()) {
+ // FIXME: Add support for RANGE, EMAIL, URL, COLOR and DATE/TIME input types.
+ case NUMBER:
+ case PASSWORD:
+ case SEARCH:
+ case TELEPHONE:
+ case TEXT:
+ return hasAttribute(speechAttr);
+ case BUTTON:
+ case CHECKBOX:
+ case COLOR:
+ case DATE:
+ case DATETIME:
+ case DATETIMELOCAL:
+ case EMAIL:
+ case FILE:
+ case HIDDEN:
+ case IMAGE:
+ case ISINDEX:
+ case MONTH:
+ case RADIO:
+ case RANGE:
+ case RESET:
+ case SUBMIT:
+ case TIME:
+ case URL:
+ case WEEK:
+ return false;
+ }
+ return false;
+}
+#endif
} // namespace
diff --git a/WebCore/html/HTMLInputElement.h b/WebCore/html/HTMLInputElement.h
index a9a7bb0..5bcf01f 100644
--- a/WebCore/html/HTMLInputElement.h
+++ b/WebCore/html/HTMLInputElement.h
@@ -105,6 +105,9 @@ public:
bool isNumberField() const { return m_type == NUMBER; }
bool isEmailField() const { return m_type == EMAIL; }
bool isUrlField() const { return m_type == URL; }
+#if ENABLE(INPUT_SPEECH)
+ virtual bool isSpeechEnabled() const;
+#endif
bool checked() const { return m_checked; }
void setChecked(bool, bool sendChangeEvent = false);
@@ -207,6 +210,10 @@ public:
HTMLOptionElement* selectedOption() const;
#endif
+#if ENABLE(WCSS)
+ void setWapInputFormat(String& mask);
+#endif
+
protected:
HTMLInputElement(const QualifiedName&, Document*, HTMLFormElement* = 0);
@@ -334,7 +341,6 @@ private:
#endif
#if ENABLE(WCSS)
- void setWapInputFormat(String& mask);
virtual InputElementData data() const { return m_data; }
#endif
diff --git a/WebCore/html/HTMLInputElement.idl b/WebCore/html/HTMLInputElement.idl
index 237d4c3..9b6bbbf 100644
--- a/WebCore/html/HTMLInputElement.idl
+++ b/WebCore/html/HTMLInputElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,83 +21,80 @@
module html {
interface HTMLInputElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString defaultValue;
- attribute boolean defaultChecked;
+ attribute [ConvertNullToNullString] DOMString defaultValue;
+ attribute [Reflect=checked] boolean defaultChecked;
readonly attribute HTMLFormElement form;
- attribute boolean formNoValidate;
- readonly attribute ValidityState validity;
- attribute [ConvertNullToNullString] DOMString accept;
- attribute [ConvertNullToNullString] DOMString accessKey;
- attribute [ConvertNullToNullString] DOMString align;
- attribute [ConvertNullToNullString] DOMString alt;
- attribute boolean checked;
- attribute boolean disabled;
- attribute boolean autofocus;
+ attribute [Reflect] boolean formNoValidate;
+ readonly attribute ValidityState validity;
+ attribute [Reflect] DOMString accept;
+ attribute [Reflect] DOMString accessKey;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString alt;
+ attribute boolean checked;
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] boolean autofocus;
#if defined(ENABLE_DATALIST) && ENABLE_DATALIST
readonly attribute HTMLElement list;
#endif
- attribute [ConvertNullToNullString, Reflect] DOMString max;
- attribute long maxLength
- setter raises(DOMException);
- attribute [ConvertNullToNullString, Reflect] DOMString min;
- attribute boolean multiple;
- attribute [ConvertNullToNullString] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString pattern;
- attribute DOMString placeholder;
- attribute boolean readOnly;
- attribute boolean required;
+ attribute [Reflect] DOMString max;
+ attribute long maxLength setter raises(DOMException);
+ attribute [Reflect] DOMString min;
+ attribute [Reflect] boolean multiple;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString pattern;
+ attribute [Reflect] DOMString placeholder;
+ attribute [Reflect] boolean readOnly;
+ attribute [Reflect] boolean required;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
- attribute [ConvertToString] DOMString size; // DOM level 2 changed this to a long, but our existing API is a string
+ attribute [ConvertToString] DOMString size; // DOM level 2 changed this to a long, but our existing API is a string
#else
- // FIXME: the spec says this should be a long, not an unsigned long
- attribute unsigned long size; // Changed string -> long as part of DOM level 2
+ // FIXME: The spec says this should be a long, not an unsigned long.
+ attribute unsigned long size; // Changed string -> long as part of DOM level 2
#endif
- attribute [ConvertNullToNullString] DOMString src;
- attribute [ConvertNullToNullString, Reflect] DOMString step;
- attribute [ConvertNullToNullString, JSCCustomGetter] DOMString type; // readonly dropped as part of DOM level 2
- attribute [ConvertNullToNullString] DOMString useMap;
- attribute [ConvertNullToNullString] DOMString value;
+ attribute [ReflectURL] DOMString src;
+ attribute [Reflect] DOMString step;
+ attribute [ConvertNullToNullString, JSCCustomGetter] DOMString type; // readonly dropped as part of DOM level 2
+ attribute [Reflect] DOMString useMap;
+ attribute [ConvertNullToNullString] DOMString value;
#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
- attribute Date valueAsDate setter raises(DOMException);
+ attribute Date valueAsDate setter raises(DOMException);
#endif
- attribute double valueAsNumber setter raises(DOMException);
+ attribute double valueAsNumber setter raises(DOMException);
#if defined(ENABLE_DATALIST) && ENABLE_DATALIST
readonly attribute HTMLOptionElement selectedOption;
#endif
- void stepUp(in [Optional] long n)
- raises(DOMException);
- void stepDown(in [Optional] long n)
- raises(DOMException);
+ void stepUp(in [Optional] long n) raises(DOMException);
+ void stepDown(in [Optional] long n) raises(DOMException);
- readonly attribute boolean willValidate;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
- void select();
- void click();
+ readonly attribute boolean willValidate;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+ void select();
+ void click();
#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
- void setValueForUser(in [ConvertNullToNullString] DOMString value);
+ void setValueForUser(in [ConvertNullToNullString] DOMString value);
#endif
// WinIE extension:
- attribute boolean indeterminate;
+ attribute boolean indeterminate;
// WinIE & FireFox extension:
- attribute [Custom] long selectionStart;
- attribute [Custom] long selectionEnd;
+ attribute [Custom] long selectionStart;
+ attribute [Custom] long selectionEnd;
[Custom] void setSelectionRange(in long start, in long end);
#if defined(LANGUAGE_OBJECTIVE_C)
// Objective-C extension:
- readonly attribute DOMString altDisplayString;
- readonly attribute URL absoluteImageURL;
+ readonly attribute DOMString altDisplayString;
+ readonly attribute URL absoluteImageURL;
#endif
readonly attribute FileList files;
- readonly attribute NodeList labels;
+ readonly attribute NodeList labels;
};
}
diff --git a/WebCore/html/HTMLInputStream.h b/WebCore/html/HTMLInputStream.h
new file mode 100644
index 0000000..9620388
--- /dev/null
+++ b/WebCore/html/HTMLInputStream.h
@@ -0,0 +1,125 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR 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 HTMLInputStream_h
+#define HTMLInputStream_h
+
+#include "SegmentedString.h"
+
+namespace WebCore {
+
+// The InputStream is made up of a sequence of SegmentedStrings:
+//
+// [--current--][--next--][--next--] ... [--next--]
+// /\ (also called m_last)
+// L_ current insertion point
+//
+// The current segmented string is stored in InputStream. Each of the
+// afterInsertionPoint buffers are stored in InsertionPointRecords on the
+// stack.
+//
+// We remove characters from the "current" string in the InputStream.
+// document.write() will add characters at the current insertion point,
+// which appends them to the "current" string.
+//
+// m_last is a pointer to the last of the afterInsertionPoint strings.
+// The network adds data at the end of the InputStream, which appends
+// them to the "last" string.
+class HTMLInputStream : public Noncopyable {
+public:
+ HTMLInputStream()
+ : m_last(&m_first)
+ {
+ }
+
+ void appendToEnd(const SegmentedString& string)
+ {
+ m_last->append(string);
+ }
+
+ void insertAtCurrentInsertionPoint(const SegmentedString& string)
+ {
+ m_first.append(string);
+ }
+
+ void close() { m_last->close(); }
+ bool isClosed() { return m_last->isClosed(); }
+
+ SegmentedString& current() { return m_first; }
+
+ void splitInto(SegmentedString& next)
+ {
+ next = m_first;
+ m_first = SegmentedString();
+ if (m_last == &m_first) {
+ // We used to only have one SegmentedString in the InputStream
+ // but now we have two. That means m_first is no longer also
+ // the m_last string, |next| is now the last one.
+ m_last = &next;
+ }
+ }
+
+ void mergeFrom(SegmentedString& next)
+ {
+ m_first.append(next);
+ if (m_last == &next) {
+ // The string |next| used to be the last SegmentedString in
+ // the InputStream. Now that it's been merged into m_first,
+ // that makes m_first the last one.
+ m_last = &m_first;
+ }
+ if (next.isClosed()) {
+ // We also need to merge the "closed" state from next to
+ // m_first. Arguably, this work could be done in append().
+ m_first.close();
+ }
+ }
+
+private:
+ SegmentedString m_first;
+ SegmentedString* m_last;
+};
+
+class InsertionPointRecord : public Noncopyable {
+public:
+ explicit InsertionPointRecord(HTMLInputStream& inputStream)
+ : m_inputStream(&inputStream)
+ {
+ m_inputStream->splitInto(m_next);
+ }
+
+ ~InsertionPointRecord()
+ {
+ m_inputStream->mergeFrom(m_next);
+ }
+
+private:
+ HTMLInputStream* m_inputStream;
+ SegmentedString m_next;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/HTMLIsIndexElement.cpp b/WebCore/html/HTMLIsIndexElement.cpp
index d382af5..dce67f6 100644
--- a/WebCore/html/HTMLIsIndexElement.cpp
+++ b/WebCore/html/HTMLIsIndexElement.cpp
@@ -41,12 +41,12 @@ HTMLIsIndexElement::HTMLIsIndexElement(const QualifiedName& tagName, Document* d
PassRefPtr<HTMLIsIndexElement> HTMLIsIndexElement::create(Document* document, HTMLFormElement* form)
{
- return new HTMLIsIndexElement(isindexTag, document, form);
+ return adoptRef(new HTMLIsIndexElement(isindexTag, document, form));
}
PassRefPtr<HTMLIsIndexElement> HTMLIsIndexElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLIsIndexElement(tagName, document, form);
+ return adoptRef(new HTMLIsIndexElement(tagName, document, form));
}
void HTMLIsIndexElement::parseMappedAttribute(Attribute* attr)
diff --git a/WebCore/html/HTMLIsIndexElement.idl b/WebCore/html/HTMLIsIndexElement.idl
index d968fa7..028a180 100644
--- a/WebCore/html/HTMLIsIndexElement.idl
+++ b/WebCore/html/HTMLIsIndexElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,7 +21,7 @@ module html {
interface HTMLIsIndexElement : HTMLInputElement {
readonly attribute HTMLFormElement form;
- attribute [ConvertNullToNullString] DOMString prompt;
+ attribute [Reflect] DOMString prompt;
};
}
diff --git a/WebCore/html/HTMLKeygenElement.cpp b/WebCore/html/HTMLKeygenElement.cpp
index 4318c65..74b3a0f 100644
--- a/WebCore/html/HTMLKeygenElement.cpp
+++ b/WebCore/html/HTMLKeygenElement.cpp
@@ -57,7 +57,7 @@ inline HTMLKeygenElement::HTMLKeygenElement(const QualifiedName& tagName, Docume
PassRefPtr<HTMLKeygenElement> HTMLKeygenElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLKeygenElement(tagName, document, form);
+ return adoptRef(new HTMLKeygenElement(tagName, document, form));
}
const AtomicString& HTMLKeygenElement::formControlType() const
diff --git a/WebCore/html/HTMLLIElement.cpp b/WebCore/html/HTMLLIElement.cpp
index 74c3468..ae96cc3 100644
--- a/WebCore/html/HTMLLIElement.cpp
+++ b/WebCore/html/HTMLLIElement.cpp
@@ -42,12 +42,12 @@ HTMLLIElement::HTMLLIElement(const QualifiedName& tagName, Document* document)
PassRefPtr<HTMLLIElement> HTMLLIElement::create(Document* document)
{
- return new HTMLLIElement(liTag, document);
+ return adoptRef(new HTMLLIElement(liTag, document));
}
PassRefPtr<HTMLLIElement> HTMLLIElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLLIElement(tagName, document);
+ return adoptRef(new HTMLLIElement(tagName, document));
}
bool HTMLLIElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLLIElement.idl b/WebCore/html/HTMLLIElement.idl
index 946ec18..2dc541b 100644
--- a/WebCore/html/HTMLLIElement.idl
+++ b/WebCore/html/HTMLLIElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,8 +20,8 @@
module html {
interface HTMLLIElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString type;
- attribute long value;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] long value;
};
}
diff --git a/WebCore/html/HTMLLabelElement.cpp b/WebCore/html/HTMLLabelElement.cpp
index ed0fab6..6b3069a 100644
--- a/WebCore/html/HTMLLabelElement.cpp
+++ b/WebCore/html/HTMLLabelElement.cpp
@@ -56,7 +56,7 @@ inline HTMLLabelElement::HTMLLabelElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLLabelElement> HTMLLabelElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLLabelElement(tagName, document);
+ return adoptRef(new HTMLLabelElement(tagName, document));
}
bool HTMLLabelElement::isFocusable() const
diff --git a/WebCore/html/HTMLLabelElement.idl b/WebCore/html/HTMLLabelElement.idl
index dddc89c..c946bc4 100644
--- a/WebCore/html/HTMLLabelElement.idl
+++ b/WebCore/html/HTMLLabelElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -22,8 +22,8 @@ module html {
interface HTMLLabelElement : HTMLElement {
readonly attribute HTMLFormElement form;
- attribute [ConvertNullToNullString] DOMString accessKey;
- attribute [ConvertNullToNullString] DOMString htmlFor;
+ attribute [Reflect] DOMString accessKey;
+ attribute [Reflect=for] DOMString htmlFor;
readonly attribute HTMLElement control;
};
diff --git a/WebCore/html/HTMLLegendElement.cpp b/WebCore/html/HTMLLegendElement.cpp
index 0aa4142..4249fb1 100644
--- a/WebCore/html/HTMLLegendElement.cpp
+++ b/WebCore/html/HTMLLegendElement.cpp
@@ -40,7 +40,7 @@ inline HTMLLegendElement::HTMLLegendElement(const QualifiedName& tagName, Docume
PassRefPtr<HTMLLegendElement> HTMLLegendElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLLegendElement(tagName, document, form);
+ return adoptRef(new HTMLLegendElement(tagName, document, form));
}
bool HTMLLegendElement::supportsFocus() const
diff --git a/WebCore/html/HTMLLegendElement.idl b/WebCore/html/HTMLLegendElement.idl
index ee21e4c..750f32a 100644
--- a/WebCore/html/HTMLLegendElement.idl
+++ b/WebCore/html/HTMLLegendElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -22,8 +22,8 @@ module html {
interface HTMLLegendElement : HTMLElement {
readonly attribute HTMLFormElement form;
- attribute [ConvertNullToNullString] DOMString accessKey;
- attribute [ConvertNullToNullString] DOMString align;
+ attribute [Reflect] DOMString accessKey;
+ attribute [Reflect] DOMString align;
};
}
diff --git a/WebCore/html/HTMLLinkElement.cpp b/WebCore/html/HTMLLinkElement.cpp
index a687852..b3a1c89 100644
--- a/WebCore/html/HTMLLinkElement.cpp
+++ b/WebCore/html/HTMLLinkElement.cpp
@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* (C) 2001 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -54,14 +54,18 @@ inline HTMLLinkElement::HTMLLinkElement(const QualifiedName& tagName, Document*
, m_disabledState(Unset)
, m_loading(false)
, m_createdByParser(createdByParser)
+<<<<<<< HEAD
, m_timer(this, &HTMLLinkElement::timerFired)
+=======
+ , m_shouldProcessAfterAttach(false)
+>>>>>>> webkit.org at r61871
{
ASSERT(hasTagName(linkTag));
}
PassRefPtr<HTMLLinkElement> HTMLLinkElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
{
- return new HTMLLinkElement(tagName, document, createdByParser);
+ return adoptRef(new HTMLLinkElement(tagName, document, createdByParser));
}
HTMLLinkElement::~HTMLLinkElement()
@@ -270,12 +274,24 @@ void HTMLLinkElement::process()
document()->updateStyleSelector();
}
}
+
+void HTMLLinkElement::processCallback(Node* node)
+{
+ ASSERT_ARG(node, node && node->hasTagName(linkTag));
+ static_cast<HTMLLinkElement*>(node)->process();
+}
void HTMLLinkElement::insertedIntoDocument()
{
HTMLElement::insertedIntoDocument();
document()->addStyleSheetCandidateNode(this, m_createdByParser);
- process();
+
+ // Since processing a stylesheet link causes a beforeload event
+ // to fire, it is possible for JavaScript to remove the element in the midst
+ // of it being inserted into the DOM, which can lead to assertion failures
+ // and crashes. Avoid this by postponing the beforeload/load until after
+ // attach.
+ m_shouldProcessAfterAttach = true;
}
void HTMLLinkElement::removedFromDocument()
@@ -287,8 +303,20 @@ void HTMLLinkElement::removedFromDocument()
// FIXME: It's terrible to do a synchronous update of the style selector just because a <style> or <link> element got removed.
if (document()->renderer())
document()->updateStyleSelector();
+
+ m_shouldProcessAfterAttach = false;
}
+void HTMLLinkElement::attach()
+{
+ if (m_shouldProcessAfterAttach) {
+ m_shouldProcessAfterAttach = false;
+ queuePostAttachCallback(&HTMLLinkElement::processCallback, this);
+ }
+
+ HTMLElement::attach();
+}
+
void HTMLLinkElement::finishParsingChildren()
{
m_createdByParser = false;
diff --git a/WebCore/html/HTMLLinkElement.h b/WebCore/html/HTMLLinkElement.h
index bf40ca5..f19741f 100644
--- a/WebCore/html/HTMLLinkElement.h
+++ b/WebCore/html/HTMLLinkElement.h
@@ -1,7 +1,7 @@
/*
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -97,6 +97,9 @@ public:
bool isDisabled() const { return m_disabledState == Disabled; }
bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript; }
bool isIcon() const { return m_relAttribute.m_isIcon; }
+
+ virtual void attach();
+ virtual bool canLazyAttach() { return false; }
private:
virtual HTMLTagStatus endTagRequirement() const { return TagStatusForbidden; }
@@ -105,6 +108,7 @@ private:
virtual void parseMappedAttribute(Attribute*);
void process();
+ static void processCallback(Node*);
virtual void insertedIntoDocument();
virtual void removedFromDocument();
@@ -120,7 +124,7 @@ private:
void setDisabledState(bool _disabled);
virtual bool isURLAttribute(Attribute*) const;
-
+
public:
static void tokenizeRelAttribute(const AtomicString& value, RelAttribute&);
@@ -159,7 +163,11 @@ private:
RelAttribute m_relAttribute;
bool m_loading;
bool m_createdByParser;
+<<<<<<< HEAD
Timer<HTMLLinkElement> m_timer;
+=======
+ bool m_shouldProcessAfterAttach;
+>>>>>>> webkit.org at r61871
};
} //namespace
diff --git a/WebCore/html/HTMLLinkElement.idl b/WebCore/html/HTMLLinkElement.idl
index dc700df..a7e7d32 100644
--- a/WebCore/html/HTMLLinkElement.idl
+++ b/WebCore/html/HTMLLinkElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,18 +21,18 @@
module html {
interface HTMLLinkElement : HTMLElement {
- attribute boolean disabled;
- attribute [ConvertNullToNullString] DOMString charset;
- attribute [ConvertNullToNullString] DOMString href;
- attribute [ConvertNullToNullString] DOMString hreflang;
- attribute [ConvertNullToNullString] DOMString media;
- attribute [ConvertNullToNullString] DOMString rel;
- attribute [ConvertNullToNullString] DOMString rev;
- attribute [ConvertNullToNullString] DOMString target;
- attribute [ConvertNullToNullString] DOMString type;
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] DOMString charset;
+ attribute [ReflectURL] DOMString href;
+ attribute [Reflect] DOMString hreflang;
+ attribute [Reflect] DOMString media;
+ attribute [Reflect] DOMString rel;
+ attribute [Reflect] DOMString rev;
+ attribute [Reflect] DOMString target;
+ attribute [Reflect] DOMString type;
// DOM Level 2 Style
- readonly attribute StyleSheet sheet;
+ readonly attribute StyleSheet sheet;
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
// Objective-C extension:
diff --git a/WebCore/html/HTMLMapElement.cpp b/WebCore/html/HTMLMapElement.cpp
index 07fcb5c..14c0feb 100644
--- a/WebCore/html/HTMLMapElement.cpp
+++ b/WebCore/html/HTMLMapElement.cpp
@@ -46,12 +46,12 @@ HTMLMapElement::HTMLMapElement(const QualifiedName& tagName, Document* document)
PassRefPtr<HTMLMapElement> HTMLMapElement::create(Document* document)
{
- return new HTMLMapElement(mapTag, document);
+ return adoptRef(new HTMLMapElement(mapTag, document));
}
PassRefPtr<HTMLMapElement> HTMLMapElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLMapElement(tagName, document);
+ return adoptRef(new HTMLMapElement(tagName, document));
}
HTMLMapElement::~HTMLMapElement()
diff --git a/WebCore/html/HTMLMapElement.idl b/WebCore/html/HTMLMapElement.idl
index 1a760d1..7811c9a 100644
--- a/WebCore/html/HTMLMapElement.idl
+++ b/WebCore/html/HTMLMapElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -22,7 +22,7 @@ module html {
interface HTMLMapElement : HTMLElement {
readonly attribute HTMLCollection areas;
- attribute [ConvertNullToNullString] DOMString name;
+ attribute [Reflect] DOMString name;
};
}
diff --git a/WebCore/html/HTMLMarqueeElement.cpp b/WebCore/html/HTMLMarqueeElement.cpp
index c16b069..ada26c1 100644
--- a/WebCore/html/HTMLMarqueeElement.cpp
+++ b/WebCore/html/HTMLMarqueeElement.cpp
@@ -47,7 +47,7 @@ inline HTMLMarqueeElement::HTMLMarqueeElement(const QualifiedName& tagName, Docu
PassRefPtr<HTMLMarqueeElement> HTMLMarqueeElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLMarqueeElement(tagName, document);
+ return adoptRef(new HTMLMarqueeElement(tagName, document));
}
bool HTMLMarqueeElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLMediaElement.cpp b/WebCore/html/HTMLMediaElement.cpp
index 34679e7..fb024e0 100644
--- a/WebCore/html/HTMLMediaElement.cpp
+++ b/WebCore/html/HTMLMediaElement.cpp
@@ -1998,7 +1998,7 @@ void HTMLMediaElement::createMediaPlayerProxy()
// Hang onto the proxy widget so it won't be destroyed if the plug-in is set to
// display:none
- m_proxyWidget = loader->loadMediaPlayerProxyPlugin(this, url, paramNames, paramValues);
+ m_proxyWidget = loader->subframeLoader()->loadMediaPlayerProxyPlugin(this, url, paramNames, paramValues);
if (m_proxyWidget)
m_needWidgetUpdate = false;
}
@@ -2080,6 +2080,11 @@ void HTMLMediaElement::mediaCanStart()
loadInternal();
}
+bool HTMLMediaElement::isURLAttribute(Attribute* attribute) const
+{
+ return attribute->name() == srcAttr;
+}
+
}
#endif
diff --git a/WebCore/html/HTMLMediaElement.h b/WebCore/html/HTMLMediaElement.h
index 35c2235..7d83f94 100644
--- a/WebCore/html/HTMLMediaElement.h
+++ b/WebCore/html/HTMLMediaElement.h
@@ -174,6 +174,7 @@ protected:
virtual ~HTMLMediaElement();
virtual void parseMappedAttribute(Attribute*);
+ virtual bool isURLAttribute(Attribute*) const;
virtual void attach();
virtual void willMoveToNewOwnerDocument();
diff --git a/WebCore/html/HTMLMediaElement.idl b/WebCore/html/HTMLMediaElement.idl
index 5cd3293..93430b4 100644
--- a/WebCore/html/HTMLMediaElement.idl
+++ b/WebCore/html/HTMLMediaElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
readonly attribute MediaError error;
// network state
- attribute DOMString src;
+ attribute [ReflectURL] DOMString src;
readonly attribute DOMString currentSrc;
const unsigned short NETWORK_EMPTY = 0;
@@ -66,8 +66,8 @@ interface [Conditional=VIDEO] HTMLMediaElement : HTMLElement {
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
- attribute boolean autoplay;
- attribute boolean loop;
+ attribute [Reflect] boolean autoplay;
+ attribute [Reflect] boolean loop;
[NeedsUserGestureCheck] void play();
[NeedsUserGestureCheck] void pause();
diff --git a/WebCore/html/HTMLMenuElement.cpp b/WebCore/html/HTMLMenuElement.cpp
index 92030b5..7acef0f 100644
--- a/WebCore/html/HTMLMenuElement.cpp
+++ b/WebCore/html/HTMLMenuElement.cpp
@@ -37,7 +37,7 @@ inline HTMLMenuElement::HTMLMenuElement(const QualifiedName& tagName, Document*
PassRefPtr<HTMLMenuElement> HTMLMenuElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLMenuElement(tagName, document);
+ return adoptRef(new HTMLMenuElement(tagName, document));
}
bool HTMLMenuElement::compact() const
diff --git a/WebCore/html/HTMLMenuElement.idl b/WebCore/html/HTMLMenuElement.idl
index 238263a..ff14754 100644
--- a/WebCore/html/HTMLMenuElement.idl
+++ b/WebCore/html/HTMLMenuElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLMenuElement : HTMLElement {
- attribute boolean compact;
+ attribute [Reflect] boolean compact;
};
}
diff --git a/WebCore/html/HTMLMetaElement.cpp b/WebCore/html/HTMLMetaElement.cpp
index e6ddc0c..a7f2978 100644
--- a/WebCore/html/HTMLMetaElement.cpp
+++ b/WebCore/html/HTMLMetaElement.cpp
@@ -48,7 +48,7 @@ inline HTMLMetaElement::HTMLMetaElement(const QualifiedName& tagName, Document*
PassRefPtr<HTMLMetaElement> HTMLMetaElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLMetaElement(tagName, document);
+ return adoptRef(new HTMLMetaElement(tagName, document));
}
void HTMLMetaElement::parseMappedAttribute(Attribute* attr)
diff --git a/WebCore/html/HTMLMetaElement.idl b/WebCore/html/HTMLMetaElement.idl
index ef7e4ab..f4ffb2d 100644
--- a/WebCore/html/HTMLMetaElement.idl
+++ b/WebCore/html/HTMLMetaElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,10 +20,10 @@
module html {
interface HTMLMetaElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString content;
- attribute [ConvertNullToNullString] DOMString httpEquiv;
- attribute [ConvertNullToNullString] DOMString name;
- attribute [ConvertNullToNullString] DOMString scheme;
+ attribute [Reflect] DOMString content;
+ attribute [Reflect=http_equiv] DOMString httpEquiv;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString scheme;
};
}
diff --git a/WebCore/html/HTMLMeterElement.cpp b/WebCore/html/HTMLMeterElement.cpp
index 1e8956d..7c025f7 100644
--- a/WebCore/html/HTMLMeterElement.cpp
+++ b/WebCore/html/HTMLMeterElement.cpp
@@ -28,7 +28,7 @@
#include "FormDataList.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "RenderMeter.h"
#include <wtf/StdLibExtras.h>
@@ -36,8 +36,10 @@ namespace WebCore {
using namespace HTMLNames;
+// FIXME: This constructor should take an explicit form element pointer passed from the
+// parser like the constructors for all the other classes derived from HTMLFormControlElement.
HTMLMeterElement::HTMLMeterElement(const QualifiedName& tagName, Document* document)
- : HTMLFormControlElement(tagName, document, 0, CreateHTMLElement)
+ : HTMLFormControlElement(tagName, document, 0)
{
ASSERT(hasTagName(meterTag));
}
@@ -189,7 +191,7 @@ HTMLMeterElement::GaugeRegion HTMLMeterElement::gaugeRegion() const
}
// The optimum range stays between high and low
- if (lowValue < highValue && theValue < highValue)
+ if (lowValue < theValue && theValue < highValue)
return GaugeRegionOptimum;
if (theValue == min() || max() == theValue)
return GaugeRegionEvenLessGood;
diff --git a/WebCore/html/HTMLModElement.cpp b/WebCore/html/HTMLModElement.cpp
index a745e44..cb6da83 100644
--- a/WebCore/html/HTMLModElement.cpp
+++ b/WebCore/html/HTMLModElement.cpp
@@ -36,7 +36,7 @@ inline HTMLModElement::HTMLModElement(const QualifiedName& tagName, Document* do
PassRefPtr<HTMLModElement> HTMLModElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLModElement(tagName, document);
+ return adoptRef(new HTMLModElement(tagName, document));
}
String HTMLModElement::cite() const
diff --git a/WebCore/html/HTMLModElement.idl b/WebCore/html/HTMLModElement.idl
index a6e3a02..e9e996d 100644
--- a/WebCore/html/HTMLModElement.idl
+++ b/WebCore/html/HTMLModElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,8 +20,8 @@
module html {
interface HTMLModElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString cite;
- attribute [ConvertNullToNullString] DOMString dateTime;
+ attribute [Reflect] DOMString cite;
+ attribute [Reflect] DOMString dateTime;
};
}
diff --git a/WebCore/html/HTMLNoScriptElement.cpp b/WebCore/html/HTMLNoScriptElement.cpp
index eda2110..f232340 100644
--- a/WebCore/html/HTMLNoScriptElement.cpp
+++ b/WebCore/html/HTMLNoScriptElement.cpp
@@ -39,7 +39,7 @@ inline HTMLNoScriptElement::HTMLNoScriptElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLNoScriptElement> HTMLNoScriptElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLNoScriptElement(tagName, document);
+ return adoptRef(new HTMLNoScriptElement(tagName, document));
}
bool HTMLNoScriptElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLOListElement.cpp b/WebCore/html/HTMLOListElement.cpp
index 277b809..c40f216 100644
--- a/WebCore/html/HTMLOListElement.cpp
+++ b/WebCore/html/HTMLOListElement.cpp
@@ -42,12 +42,12 @@ HTMLOListElement::HTMLOListElement(const QualifiedName& tagName, Document* docum
PassRefPtr<HTMLOListElement> HTMLOListElement::create(Document* document)
{
- return new HTMLOListElement(olTag, document);
+ return adoptRef(new HTMLOListElement(olTag, document));
}
PassRefPtr<HTMLOListElement> HTMLOListElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLOListElement(tagName, document);
+ return adoptRef(new HTMLOListElement(tagName, document));
}
bool HTMLOListElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLOListElement.idl b/WebCore/html/HTMLOListElement.idl
index 32d81f2..63e06b2 100644
--- a/WebCore/html/HTMLOListElement.idl
+++ b/WebCore/html/HTMLOListElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,9 +20,9 @@
module html {
interface HTMLOListElement : HTMLElement {
- attribute boolean compact;
+ attribute [Reflect] boolean compact;
attribute long start;
- attribute [ConvertNullToNullString] DOMString type;
+ attribute [Reflect] DOMString type;
};
}
diff --git a/WebCore/html/HTMLObjectElement.cpp b/WebCore/html/HTMLObjectElement.cpp
index bd9fc1c..45586d1 100644
--- a/WebCore/html/HTMLObjectElement.cpp
+++ b/WebCore/html/HTMLObjectElement.cpp
@@ -243,6 +243,9 @@ void HTMLObjectElement::renderFallbackContent()
{
if (m_useFallbackContent)
return;
+
+ if (!inDocument())
+ return;
// Before we give up and use fallback content, check to see if this is a MIME type issue.
if (m_imageLoader && m_imageLoader->image()) {
diff --git a/WebCore/html/HTMLObjectElement.idl b/WebCore/html/HTMLObjectElement.idl
index be91dc4..ee0f1c6 100644
--- a/WebCore/html/HTMLObjectElement.idl
+++ b/WebCore/html/HTMLObjectElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -26,37 +26,36 @@ module html {
CustomCall
] HTMLObjectElement : HTMLElement {
readonly attribute HTMLFormElement form;
- attribute [ConvertNullToNullString, Reflect] DOMString code;
- attribute [ConvertNullToNullString, Reflect] DOMString align;
- attribute [ConvertNullToNullString, Reflect] DOMString archive;
- attribute [ConvertNullToNullString, Reflect] DOMString border;
- attribute [ConvertNullToNullString, Reflect=codebase] DOMString codeBase;
- attribute [ConvertNullToNullString, Reflect=codetype] DOMString codeType;
- attribute [ConvertNullToNullString, ReflectURL] DOMString data;
- attribute boolean declare;
- attribute [ConvertNullToNullString, Reflect] DOMString height;
- attribute long hspace;
- attribute [ConvertNullToNullString, Reflect] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString standby;
- attribute [ConvertNullToNullString, Reflect] DOMString type;
- attribute [ConvertNullToNullString, Reflect=usemap] DOMString useMap;
- attribute long vspace;
- attribute [ConvertNullToNullString, Reflect] DOMString width;
- readonly attribute boolean willValidate;
+ attribute [Reflect] DOMString code;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString archive;
+ attribute [Reflect] DOMString border;
+ attribute [Reflect] DOMString codeBase;
+ attribute [Reflect] DOMString codeType;
+ attribute [ReflectURL] DOMString data;
+ attribute [Reflect] boolean declare;
+ attribute [Reflect] DOMString height;
+ attribute [Reflect] long hspace;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString standby;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] DOMString useMap;
+ attribute [Reflect] long vspace;
+ attribute [Reflect] DOMString width;
+ readonly attribute boolean willValidate;
// Introduced in DOM Level 2:
- readonly attribute [CheckFrameSecurity] Document contentDocument;
+ readonly attribute [CheckFrameSecurity] Document contentDocument;
#if defined(ENABLE_SVG) && ENABLE_SVG
#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C || defined(ENABLE_SVG_DOM_OBJC_BINDINGS) && ENABLE_SVG_DOM_OBJC_BINDINGS
- [SVGCheckSecurityDocument] SVGDocument getSVGDocument()
- raises(DOMException);
+ [SVGCheckSecurityDocument] SVGDocument getSVGDocument() raises(DOMException);
#endif
#endif
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
// Objective-C extension:
- readonly attribute URL absoluteImageURL;
+ readonly attribute URL absoluteImageURL;
#endif
};
diff --git a/WebCore/html/HTMLOptGroupElement.cpp b/WebCore/html/HTMLOptGroupElement.cpp
index b98b668..27bc40e 100644
--- a/WebCore/html/HTMLOptGroupElement.cpp
+++ b/WebCore/html/HTMLOptGroupElement.cpp
@@ -45,7 +45,7 @@ inline HTMLOptGroupElement::HTMLOptGroupElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLOptGroupElement> HTMLOptGroupElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLOptGroupElement(tagName, document, form);
+ return adoptRef(new HTMLOptGroupElement(tagName, document, form));
}
bool HTMLOptGroupElement::supportsFocus() const
diff --git a/WebCore/html/HTMLOptGroupElement.idl b/WebCore/html/HTMLOptGroupElement.idl
index 691bd13..75cead0 100644
--- a/WebCore/html/HTMLOptGroupElement.idl
+++ b/WebCore/html/HTMLOptGroupElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,8 +20,8 @@
module html {
interface HTMLOptGroupElement : HTMLElement {
- attribute boolean disabled;
- attribute [ConvertNullToNullString] DOMString label;
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] DOMString label;
};
}
diff --git a/WebCore/html/HTMLOptionElement.cpp b/WebCore/html/HTMLOptionElement.cpp
index 1be0746..dfee748 100644
--- a/WebCore/html/HTMLOptionElement.cpp
+++ b/WebCore/html/HTMLOptionElement.cpp
@@ -50,18 +50,18 @@ HTMLOptionElement::HTMLOptionElement(const QualifiedName& tagName, Document* doc
PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(Document* document, HTMLFormElement* form)
{
- return new HTMLOptionElement(optionTag, document, form);
+ return adoptRef(new HTMLOptionElement(optionTag, document, form));
}
PassRefPtr<HTMLOptionElement> HTMLOptionElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLOptionElement(tagName, document, form);
+ return adoptRef(new HTMLOptionElement(tagName, document, form));
}
PassRefPtr<HTMLOptionElement> HTMLOptionElement::createForJSConstructor(Document* document, const String& data, const String& value,
bool defaultSelected, bool selected, ExceptionCode& ec)
{
- RefPtr<HTMLOptionElement> element = new HTMLOptionElement(optionTag, document);
+ RefPtr<HTMLOptionElement> element = adoptRef(new HTMLOptionElement(optionTag, document));
RefPtr<Text> text = Text::create(document, data.isNull() ? "" : data);
diff --git a/WebCore/html/HTMLOptionElement.idl b/WebCore/html/HTMLOptionElement.idl
index c43132e..eb299ef 100644
--- a/WebCore/html/HTMLOptionElement.idl
+++ b/WebCore/html/HTMLOptionElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple, Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple, Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -23,19 +23,18 @@ module html {
interface [
GenerateNativeConverter
] HTMLOptionElement : HTMLElement {
- readonly attribute HTMLFormElement form;
- attribute boolean defaultSelected;
+ readonly attribute HTMLFormElement form;
+ attribute [Reflect=selected] boolean defaultSelected;
#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
- attribute [ConvertNullToNullString] DOMString text
- setter raises(DOMException);
+ attribute [ConvertNullToNullString] DOMString text setter raises(DOMException);
#else
- readonly attribute DOMString text;
+ readonly attribute DOMString text;
#endif
- readonly attribute long index;
- attribute boolean disabled;
- attribute [ConvertNullToNullString] DOMString label;
- attribute boolean selected;
- attribute [ConvertNullToNullString] DOMString value;
+ readonly attribute long index;
+ attribute [Reflect] boolean disabled;
+ attribute [Reflect] DOMString label;
+ attribute boolean selected;
+ attribute [ConvertNullToNullString] DOMString value;
};
}
diff --git a/WebCore/html/HTMLParagraphElement.cpp b/WebCore/html/HTMLParagraphElement.cpp
index fd04a30..4afa9f8 100644
--- a/WebCore/html/HTMLParagraphElement.cpp
+++ b/WebCore/html/HTMLParagraphElement.cpp
@@ -41,7 +41,7 @@ inline HTMLParagraphElement::HTMLParagraphElement(const QualifiedName& tagName,
PassRefPtr<HTMLParagraphElement> HTMLParagraphElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLParagraphElement(tagName, document);
+ return adoptRef(new HTMLParagraphElement(tagName, document));
}
bool HTMLParagraphElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLParagraphElement.idl b/WebCore/html/HTMLParagraphElement.idl
index cd3b940..246e9e9 100644
--- a/WebCore/html/HTMLParagraphElement.idl
+++ b/WebCore/html/HTMLParagraphElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,7 +20,7 @@
module html {
interface HTMLParagraphElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString align;
+ attribute [Reflect] DOMString align;
};
}
diff --git a/WebCore/html/HTMLParamElement.cpp b/WebCore/html/HTMLParamElement.cpp
index a637d5b..13a37d6 100644
--- a/WebCore/html/HTMLParamElement.cpp
+++ b/WebCore/html/HTMLParamElement.cpp
@@ -39,7 +39,7 @@ inline HTMLParamElement::HTMLParamElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLParamElement> HTMLParamElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLParamElement(tagName, document);
+ return adoptRef(new HTMLParamElement(tagName, document));
}
void HTMLParamElement::parseMappedAttribute(Attribute* attr)
diff --git a/WebCore/html/HTMLParamElement.idl b/WebCore/html/HTMLParamElement.idl
index 2473381..1f0c0de 100644
--- a/WebCore/html/HTMLParamElement.idl
+++ b/WebCore/html/HTMLParamElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,10 +20,10 @@
module html {
interface HTMLParamElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString name;
- attribute [ConvertNullToNullString] DOMString type;
- attribute [ConvertNullToNullString] DOMString value;
- attribute [ConvertNullToNullString] DOMString valueType;
+ attribute [Reflect] DOMString name;
+ attribute [Reflect] DOMString type;
+ attribute [Reflect] DOMString value;
+ attribute [Reflect] DOMString valueType;
};
}
diff --git a/WebCore/html/HTMLParserScheduler.cpp b/WebCore/html/HTMLParserScheduler.cpp
new file mode 100644
index 0000000..6e67697
--- /dev/null
+++ b/WebCore/html/HTMLParserScheduler.cpp
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "HTMLParserScheduler.h"
+
+#include "FrameView.h" // Only for isLayoutTimerActive
+#include "HTMLDocumentParser.h"
+#include "Document.h"
+
+// defaultParserChunkSize is used to define how many tokens the parser will
+// process before checking against parserTimeLimit and possibly yielding.
+// This is a performance optimization to prevent checking after every token.
+static const int defaultParserChunkSize = 4096;
+
+// defaultParserTimeLimit is the seconds the parser will run in one write() call
+// before yielding. Inline <script> execution can cause it to excede the limit.
+// FIXME: We would like this value to be 0.2.
+static const double defaultParserTimeLimit = 0.500;
+
+namespace WebCore {
+
+static double parserTimeLimit(Page* page)
+{
+ // We're using the poorly named customHTMLTokenizerTimeDelay setting.
+ if (page && page->hasCustomHTMLTokenizerTimeDelay())
+ return page->customHTMLTokenizerTimeDelay();
+ return defaultParserTimeLimit;
+}
+
+static int parserChunkSize(Page* page)
+{
+ // FIXME: We may need to divide the value from customHTMLTokenizerChunkSize
+ // by some constant to translate from the "character" based behavior of the
+ // old LegacyHTMLDocumentParser to the token-based behavior of this parser.
+ if (page && page->hasCustomHTMLTokenizerChunkSize())
+ return page->customHTMLTokenizerChunkSize();
+ return defaultParserChunkSize;
+}
+
+HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser* parser)
+ : m_parser(parser)
+ , m_parserTimeLimit(parserTimeLimit(m_parser->document()->page()))
+ , m_parserChunkSize(parserChunkSize(m_parser->document()->page()))
+ , m_continueNextChunkTimer(this, &HTMLParserScheduler::continueNextChunkTimerFired)
+{
+}
+
+HTMLParserScheduler::~HTMLParserScheduler()
+{
+ m_continueNextChunkTimer.stop();
+}
+
+// FIXME: This belongs on Document.
+static bool isLayoutTimerActive(Document* doc)
+{
+ ASSERT(doc);
+ return doc->view() && doc->view()->layoutPending() && !doc->minimumLayoutDelay();
+}
+
+void HTMLParserScheduler::continueNextChunkTimerFired(Timer<HTMLParserScheduler>* timer)
+{
+ ASSERT_UNUSED(timer, timer == &m_continueNextChunkTimer);
+ // FIXME: The timer class should handle timer priorities instead of this code.
+ // If a layout is scheduled, wait again to let the layout timer run first.
+ if (isLayoutTimerActive(m_parser->document())) {
+ m_continueNextChunkTimer.startOneShot(0);
+ return;
+ }
+ m_parser->resumeParsingAfterYield();
+}
+
+}
diff --git a/WebCore/html/HTMLParserScheduler.h b/WebCore/html/HTMLParserScheduler.h
new file mode 100644
index 0000000..1ea2c65
--- /dev/null
+++ b/WebCore/html/HTMLParserScheduler.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR 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 HTMLParserScheduler_h
+#define HTMLParserScheduler_h
+
+#include "Timer.h"
+#include <wtf/CurrentTime.h>
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+class HTMLDocumentParser;
+
+class HTMLParserScheduler : public Noncopyable {
+public:
+ HTMLParserScheduler(HTMLDocumentParser*);
+ ~HTMLParserScheduler();
+
+ struct PumpSession {
+ PumpSession()
+ : processedTokens(0)
+ , startTime(currentTime())
+ {
+ }
+
+ int processedTokens;
+ double startTime;
+ };
+
+ // Inline as this is called after every token in the parser.
+ bool shouldContinueParsing(PumpSession& session)
+ {
+ if (session.processedTokens > m_parserChunkSize) {
+ session.processedTokens = 0;
+ double elapsedTime = currentTime() - session.startTime;
+ if (elapsedTime > m_parserTimeLimit) {
+ // Schedule the parser to continue and yield from the parser.
+ m_continueNextChunkTimer.startOneShot(0);
+ return false;
+ }
+ }
+
+ ++session.processedTokens;
+ return true;
+ }
+
+ bool isScheduledForResume() const { return m_continueNextChunkTimer.isActive(); }
+
+private:
+ void continueNextChunkTimerFired(Timer<HTMLParserScheduler>*);
+
+ HTMLDocumentParser* m_parser;
+
+ double m_parserTimeLimit;
+ int m_parserChunkSize;
+ Timer<HTMLParserScheduler> m_continueNextChunkTimer;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/HTMLPreElement.cpp b/WebCore/html/HTMLPreElement.cpp
index 68522e5..b13c801 100644
--- a/WebCore/html/HTMLPreElement.cpp
+++ b/WebCore/html/HTMLPreElement.cpp
@@ -39,7 +39,7 @@ inline HTMLPreElement::HTMLPreElement(const QualifiedName& tagName, Document* do
PassRefPtr<HTMLPreElement> HTMLPreElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLPreElement(tagName, document);
+ return adoptRef(new HTMLPreElement(tagName, document));
}
bool HTMLPreElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLPreElement.idl b/WebCore/html/HTMLPreElement.idl
index 5dc0e9e..ae137f0 100644
--- a/WebCore/html/HTMLPreElement.idl
+++ b/WebCore/html/HTMLPreElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All right reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -23,10 +23,10 @@ module html {
interface HTMLPreElement : HTMLElement {
// FIXME: DOM spec says that width should be of type DOMString
// see http://bugs.webkit.org/show_bug.cgi?id=8992
- attribute long width;
+ attribute [Reflect] long width;
// Extensions
- attribute boolean wrap;
+ attribute [Reflect] boolean wrap;
};
}
diff --git a/WebCore/html/HTMLPreloadScanner.cpp b/WebCore/html/HTMLPreloadScanner.cpp
new file mode 100644
index 0000000..57ac408
--- /dev/null
+++ b/WebCore/html/HTMLPreloadScanner.cpp
@@ -0,0 +1,180 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2009 Torch Mobile, Inc. http://www.torchmobile.com/
+ * Copyright (C) 2010 Google Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "HTMLPreloadScanner.h"
+
+#include "CSSHelper.h"
+#include "DocLoader.h"
+#include "Document.h"
+#include "HTMLTreeBuilder.h"
+#include "HTMLLinkElement.h"
+#include "HTMLNames.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+namespace {
+
+class PreloadTask {
+public:
+ PreloadTask(const HTMLToken& token)
+ : m_tagName(token.name().data(), token.name().size())
+ , m_linkIsStyleSheet(false)
+ {
+ processAttributes(token.attributes());
+ }
+
+ void processAttributes(const HTMLToken::AttributeList& attributes)
+ {
+ if (m_tagName != scriptTag && m_tagName != imgTag && m_tagName != linkTag)
+ return;
+
+ for (HTMLToken::AttributeList::const_iterator iter = attributes.begin();
+ iter != attributes.end(); ++iter) {
+ AtomicString attributeName(iter->m_name.data(), iter->m_name.size());
+ String attributeValue(iter->m_value.data(), iter->m_value.size());
+
+ if (attributeName == charsetAttr)
+ m_charset = attributeValue;
+
+ if (m_tagName == scriptTag || m_tagName == imgTag) {
+ if (attributeName == srcAttr)
+ setUrlToLoad(attributeValue);
+ } else if (m_tagName == linkTag) {
+ if (attributeName == hrefAttr)
+ setUrlToLoad(attributeValue);
+ else if (attributeName == relAttr)
+ m_linkIsStyleSheet = relAttributeIsStyleSheet(attributeValue);
+ }
+ }
+ }
+
+ bool relAttributeIsStyleSheet(const String& attributeValue)
+ {
+ ASSERT(m_tagName == linkTag);
+ HTMLLinkElement::RelAttribute rel;
+ HTMLLinkElement::tokenizeRelAttribute(attributeValue, rel);
+ return rel.m_isStyleSheet && !rel.m_isAlternate && !rel.m_isIcon && !rel.m_isDNSPrefetch;
+ }
+
+ void setUrlToLoad(const String& attributeValue)
+ {
+ // We only respect the first src/href, per HTML5:
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#attribute-name-state
+ if (!m_urlToLoad.isEmpty())
+ return;
+ m_urlToLoad = deprecatedParseURL(attributeValue);
+ }
+
+ void preload(Document* document, bool scanningBody)
+ {
+ if (m_urlToLoad.isEmpty())
+ return;
+
+ DocLoader* docLoader = document->docLoader();
+ if (m_tagName == scriptTag)
+ docLoader->preload(CachedResource::Script, m_urlToLoad, m_charset, scanningBody);
+ else if (m_tagName == imgTag)
+ docLoader->preload(CachedResource::ImageResource, m_urlToLoad, String(), scanningBody);
+ else if (m_tagName == linkTag && m_linkIsStyleSheet)
+ docLoader->preload(CachedResource::CSSStyleSheet, m_urlToLoad, m_charset, scanningBody);
+ }
+
+ const AtomicString& tagName() const { return m_tagName; }
+
+private:
+ AtomicString m_tagName;
+ String m_urlToLoad;
+ String m_charset;
+ bool m_linkIsStyleSheet;
+};
+
+} // namespace
+
+HTMLPreloadScanner::HTMLPreloadScanner(Document* document)
+ : m_document(document)
+ , m_cssScanner(document)
+ , m_bodySeen(false)
+ , m_inStyle(false)
+{
+}
+
+void HTMLPreloadScanner::appendToEnd(const SegmentedString& source)
+{
+ m_source.append(source);
+}
+
+void HTMLPreloadScanner::scan()
+{
+ // FIXME: We should save and re-use these tokens in HTMLDocumentParser if
+ // the pending script doesn't end up calling document.write.
+ while (m_tokenizer.nextToken(m_source, m_token)) {
+ processToken();
+ m_token.clear();
+ }
+}
+
+void HTMLPreloadScanner::processToken()
+{
+ if (m_inStyle) {
+ if (m_token.type() == HTMLToken::Character)
+ m_cssScanner.scan(m_token, scanningBody());
+ else if (m_token.type() == HTMLToken::EndTag) {
+ m_inStyle = false;
+ m_cssScanner.reset();
+ }
+ }
+
+ if (m_token.type() != HTMLToken::StartTag)
+ return;
+
+ PreloadTask task(m_token);
+ m_tokenizer.setState(HTMLTreeBuilder::adjustedLexerState(m_tokenizer.state(), task.tagName(), m_document->frame()));
+ if (task.tagName() == scriptTag) {
+ // The tree builder handles scriptTag separately from the other tokenizer
+ // state adjustments, so we need to handle it separately too.
+ ASSERT(m_tokenizer.state() == HTMLTokenizer::DataState);
+ m_tokenizer.setState(HTMLTokenizer::ScriptDataState);
+ }
+
+ if (task.tagName() == bodyTag)
+ m_bodySeen = true;
+
+ if (task.tagName() == styleTag)
+ m_inStyle = true;
+
+ task.preload(m_document, scanningBody());
+}
+
+bool HTMLPreloadScanner::scanningBody() const
+{
+ return m_document->body() || m_bodySeen;
+}
+
+}
diff --git a/WebCore/bindings/js/JSMessageChannelConstructor.h b/WebCore/html/HTMLPreloadScanner.h
index decf05b..ee49ee0 100644
--- a/WebCore/bindings/js/JSMessageChannelConstructor.h
+++ b/WebCore/html/HTMLPreloadScanner.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2010 Google Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,25 +24,41 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSMessageChannelConstructor_h
-#define JSMessageChannelConstructor_h
+#ifndef HTMLPreloadScanner_h
+#define HTMLPreloadScanner_h
-#include "JSDOMBinding.h"
+#include "CSSPreloadScanner.h"
+#include "HTMLTokenizer.h"
+#include "HTMLToken.h"
+#include "SegmentedString.h"
+#include <wtf/Noncopyable.h>
namespace WebCore {
- class JSMessageChannelConstructor : public DOMConstructorObject {
- public:
- JSMessageChannelConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- virtual ~JSMessageChannelConstructor();
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- static const JSC::ClassInfo s_info;
+class Document;
+class HTMLToken;
+class SegmentedString;
- virtual bool implementsHasInstance() const { return true; }
- static JSC::EncodedJSValue JSC_HOST_CALL construct(JSC::ExecState*);
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- };
+class HTMLPreloadScanner : public Noncopyable {
+public:
+ HTMLPreloadScanner(Document*);
-} // namespace WebCore
+ void appendToEnd(const SegmentedString&);
+ void scan();
-#endif // JSMessageChannelConstructor_h
+private:
+ void processToken();
+ bool scanningBody() const;
+
+ Document* m_document;
+ SegmentedString m_source;
+ HTMLTokenizer m_tokenizer;
+ HTMLToken m_token;
+ CSSPreloadScanner m_cssScanner;
+ bool m_bodySeen;
+ bool m_inStyle;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/HTMLProgressElement.cpp b/WebCore/html/HTMLProgressElement.cpp
index 22226d9..5cf7714 100644
--- a/WebCore/html/HTMLProgressElement.cpp
+++ b/WebCore/html/HTMLProgressElement.cpp
@@ -28,7 +28,7 @@
#include "FormDataList.h"
#include "HTMLFormElement.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "RenderProgress.h"
#include <wtf/StdLibExtras.h>
@@ -37,7 +37,7 @@ namespace WebCore {
using namespace HTMLNames;
HTMLProgressElement::HTMLProgressElement(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
- : HTMLFormControlElement(tagName, document, form, CreateHTMLElement)
+ : HTMLFormControlElement(tagName, document, form)
{
ASSERT(hasTagName(progressTag));
}
diff --git a/WebCore/html/HTMLQuoteElement.cpp b/WebCore/html/HTMLQuoteElement.cpp
index b646fc0..2d0013a 100644
--- a/WebCore/html/HTMLQuoteElement.cpp
+++ b/WebCore/html/HTMLQuoteElement.cpp
@@ -38,7 +38,7 @@ inline HTMLQuoteElement::HTMLQuoteElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLQuoteElement> HTMLQuoteElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLQuoteElement(tagName, document);
+ return adoptRef(new HTMLQuoteElement(tagName, document));
}
void HTMLQuoteElement::insertedIntoDocument()
diff --git a/WebCore/html/HTMLQuoteElement.idl b/WebCore/html/HTMLQuoteElement.idl
index f95dc20..a4e6005 100644
--- a/WebCore/html/HTMLQuoteElement.idl
+++ b/WebCore/html/HTMLQuoteElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -20,6 +20,6 @@
module html {
interface HTMLQuoteElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString cite;
+ attribute [Reflect] DOMString cite;
};
}
diff --git a/WebCore/html/HTMLScriptElement.cpp b/WebCore/html/HTMLScriptElement.cpp
index f4c3ae8..48da4b9 100644
--- a/WebCore/html/HTMLScriptElement.cpp
+++ b/WebCore/html/HTMLScriptElement.cpp
@@ -45,12 +45,12 @@ inline HTMLScriptElement::HTMLScriptElement(const QualifiedName& tagName, Docume
PassRefPtr<HTMLScriptElement> HTMLScriptElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
{
- return new HTMLScriptElement(tagName, document, createdByParser);
+ return adoptRef(new HTMLScriptElement(tagName, document, createdByParser));
}
bool HTMLScriptElement::isURLAttribute(Attribute* attr) const
{
- return attr->name() == sourceAttributeValue();
+ return attr->name() == srcAttr;
}
bool HTMLScriptElement::shouldExecuteAsJavaScript() const
@@ -149,9 +149,19 @@ void HTMLScriptElement::setCharset(const String &value)
setAttribute(charsetAttr, value);
}
+bool HTMLScriptElement::async() const
+{
+ return asyncAttributeValue();
+}
+
+void HTMLScriptElement::setAsync(bool async)
+{
+ setAttribute(asyncAttr, async ? "" : 0);
+}
+
bool HTMLScriptElement::defer() const
{
- return !getAttribute(deferAttr).isNull();
+ return deferAttributeValue();
}
void HTMLScriptElement::setDefer(bool defer)
@@ -226,6 +236,16 @@ String HTMLScriptElement::eventAttributeValue() const
return getAttribute(eventAttr).string();
}
+bool HTMLScriptElement::asyncAttributeValue() const
+{
+ return !getAttribute(asyncAttr).isNull();
+}
+
+bool HTMLScriptElement::deferAttributeValue() const
+{
+ return !getAttribute(deferAttr).isNull();
+}
+
void HTMLScriptElement::dispatchLoadEvent()
{
ASSERT(!m_data.haveFiredLoadEvent());
diff --git a/WebCore/html/HTMLScriptElement.h b/WebCore/html/HTMLScriptElement.h
index 14a1264..3c8e8ce 100644
--- a/WebCore/html/HTMLScriptElement.h
+++ b/WebCore/html/HTMLScriptElement.h
@@ -47,6 +47,9 @@ public:
String charset() const;
void setCharset(const String&);
+ bool async() const;
+ void setAsync(bool);
+
bool defer() const;
void setDefer(bool);
@@ -85,6 +88,8 @@ private:
virtual String languageAttributeValue() const;
virtual String forAttributeValue() const;
virtual String eventAttributeValue() const;
+ virtual bool asyncAttributeValue() const;
+ virtual bool deferAttributeValue() const;
virtual void dispatchLoadEvent();
virtual void dispatchErrorEvent();
diff --git a/WebCore/html/HTMLScriptElement.idl b/WebCore/html/HTMLScriptElement.idl
index 8985512..399b5cd 100644
--- a/WebCore/html/HTMLScriptElement.idl
+++ b/WebCore/html/HTMLScriptElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,11 +21,12 @@ module html {
interface HTMLScriptElement : HTMLElement {
attribute [ConvertNullToNullString] DOMString text;
- attribute [ConvertNullToNullString] DOMString htmlFor;
- attribute [ConvertNullToNullString] DOMString event;
- attribute [ConvertNullToNullString] DOMString charset;
- attribute boolean defer;
- attribute [ConvertNullToNullString] DOMString src;
- attribute [ConvertNullToNullString] DOMString type;
+ attribute [Reflect=for] DOMString htmlFor;
+ attribute [Reflect] DOMString event;
+ attribute [Reflect] DOMString charset;
+ attribute [Reflect] boolean async;
+ attribute [Reflect] boolean defer;
+ attribute [ReflectURL] DOMString src;
+ attribute [Reflect] DOMString type;
};
}
diff --git a/WebCore/html/HTML5ScriptRunner.cpp b/WebCore/html/HTMLScriptRunner.cpp
index aef5ce4..ab35449 100644
--- a/WebCore/html/HTML5ScriptRunner.cpp
+++ b/WebCore/html/HTMLScriptRunner.cpp
@@ -24,7 +24,7 @@
*/
#include "config.h"
-#include "HTML5ScriptRunner.h"
+#include "HTMLScriptRunner.h"
#include "Attribute.h"
#include "CachedScript.h"
@@ -32,7 +32,8 @@
#include "Element.h"
#include "Event.h"
#include "Frame.h"
-#include "HTML5ScriptRunnerHost.h"
+#include "HTMLScriptRunnerHost.h"
+#include "HTMLInputStream.h"
#include "HTMLNames.h"
#include "NotImplemented.h"
#include "ScriptElement.h"
@@ -42,7 +43,26 @@ namespace WebCore {
using namespace HTMLNames;
-HTML5ScriptRunner::HTML5ScriptRunner(Document* document, HTML5ScriptRunnerHost* host)
+class NestScript : public Noncopyable {
+public:
+ NestScript(unsigned& nestingLevel, HTMLInputStream& inputStream)
+ : m_nestingLevel(&nestingLevel)
+ , m_savedInsertionPoint(inputStream)
+ {
+ ++(*m_nestingLevel);
+ }
+
+ ~NestScript()
+ {
+ --(*m_nestingLevel);
+ }
+
+private:
+ unsigned* m_nestingLevel;
+ InsertionPointRecord m_savedInsertionPoint;
+};
+
+HTMLScriptRunner::HTMLScriptRunner(Document* document, HTMLScriptRunnerHost* host)
: m_document(document)
, m_host(host)
, m_scriptNestingLevel(0)
@@ -51,10 +71,10 @@ HTML5ScriptRunner::HTML5ScriptRunner(Document* document, HTML5ScriptRunnerHost*
ASSERT(m_host);
}
-HTML5ScriptRunner::~HTML5ScriptRunner()
+HTMLScriptRunner::~HTMLScriptRunner()
{
// FIXME: Should we be passed a "done loading/parsing" callback sooner than destruction?
- if (m_parsingBlockingScript.cachedScript && m_parsingBlockingScript.watchingForLoad)
+ if (m_parsingBlockingScript.cachedScript && m_parsingBlockingScript.watchingForLoad())
stopWatchingForLoad(m_parsingBlockingScript);
}
@@ -77,7 +97,7 @@ inline PassRefPtr<Event> createScriptErrorEvent()
return Event::create(eventNames().errorEvent, true, false);
}
-ScriptSourceCode HTML5ScriptRunner::sourceFromPendingScript(const PendingScript& script, bool& errorOccurred)
+ScriptSourceCode HTMLScriptRunner::sourceFromPendingScript(const PendingScript& script, bool& errorOccurred)
{
if (script.cachedScript) {
errorOccurred = script.cachedScript->errorOccurred();
@@ -88,7 +108,7 @@ ScriptSourceCode HTML5ScriptRunner::sourceFromPendingScript(const PendingScript&
return ScriptSourceCode(script.element->textContent(), documentURLForScriptExecution(m_document), script.startingLineNumber);
}
-bool HTML5ScriptRunner::isPendingScriptReady(const PendingScript& script)
+bool HTMLScriptRunner::isPendingScriptReady(const PendingScript& script)
{
m_hasScriptsWaitingForStylesheets = !m_document->haveStylesheetsLoaded();
if (m_hasScriptsWaitingForStylesheets)
@@ -98,7 +118,7 @@ bool HTML5ScriptRunner::isPendingScriptReady(const PendingScript& script)
return true;
}
-void HTML5ScriptRunner::executePendingScript()
+void HTMLScriptRunner::executePendingScript()
{
ASSERT(!m_scriptNestingLevel);
ASSERT(m_document->haveStylesheetsLoaded());
@@ -107,25 +127,25 @@ void HTML5ScriptRunner::executePendingScript()
ScriptSourceCode sourceCode = sourceFromPendingScript(m_parsingBlockingScript, errorOccurred);
// Stop watching loads before executeScript to prevent recursion if the script reloads itself.
- if (m_parsingBlockingScript.cachedScript && m_parsingBlockingScript.watchingForLoad)
+ if (m_parsingBlockingScript.cachedScript && m_parsingBlockingScript.watchingForLoad())
stopWatchingForLoad(m_parsingBlockingScript);
// Clear the pending script before possible rentrancy from executeScript()
RefPtr<Element> scriptElement = m_parsingBlockingScript.element.release();
m_parsingBlockingScript = PendingScript();
-
- m_scriptNestingLevel++;
- if (errorOccurred)
- scriptElement->dispatchEvent(createScriptErrorEvent());
- else {
- executeScript(scriptElement.get(), sourceCode);
- scriptElement->dispatchEvent(createScriptLoadEvent());
+ {
+ NestScript nestingLevel(m_scriptNestingLevel, m_host->inputStream());
+ if (errorOccurred)
+ scriptElement->dispatchEvent(createScriptErrorEvent());
+ else {
+ executeScript(scriptElement.get(), sourceCode);
+ scriptElement->dispatchEvent(createScriptLoadEvent());
+ }
}
- m_scriptNestingLevel--;
ASSERT(!m_scriptNestingLevel);
}
-void HTML5ScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode)
+void HTMLScriptRunner::executeScript(Element* element, const ScriptSourceCode& sourceCode)
{
// FIXME: We do not block inline <script> tags on stylesheets for now.
// When we do, || !element->hasAttribute(srcAttr) should be removed from
@@ -135,29 +155,41 @@ void HTML5ScriptRunner::executeScript(Element* element, const ScriptSourceCode&
ASSERT(scriptElement);
if (!scriptElement->shouldExecuteAsJavaScript())
return;
+ ASSERT(inScriptExecution());
+ if (!m_document->frame())
+ return;
+ m_document->frame()->script()->executeScript(sourceCode);
+}
- // Always use the delegate to execute the script so that it can save any
- // necessary state to prepare for rentrancy.
- m_host->executeScript(sourceCode);
+bool HTMLScriptRunner::hasScriptsWaitingForLoad() const
+{
+ // We're only actually waiting for a load. This allows us to ignore load
+ // callbacks when CachedResource::addClient calls notifyFinished because
+ // of a cache hit (not because of a load we were set up to wait for).
+ return m_parsingBlockingScript.watchingForLoadState == PendingScript::WatchingForLoad;
}
-void HTML5ScriptRunner::watchForLoad(PendingScript& pendingScript)
+void HTMLScriptRunner::watchForLoad(PendingScript& pendingScript)
{
- ASSERT(!pendingScript.watchingForLoad);
+ ASSERT(!pendingScript.watchingForLoad());
+ // CachedResource::addClient will call notifyFinished if the load is already
+ // complete. We set watchingForLoadState to RegisteringForWatch so that we
+ // know to ignore any notifyFinished call during addClient.
+ pendingScript.watchingForLoadState = PendingScript::RegisteringForWatch;
m_host->watchForLoad(pendingScript.cachedScript.get());
- pendingScript.watchingForLoad = true;
+ pendingScript.watchingForLoadState = PendingScript::WatchingForLoad;
}
-void HTML5ScriptRunner::stopWatchingForLoad(PendingScript& pendingScript)
+void HTMLScriptRunner::stopWatchingForLoad(PendingScript& pendingScript)
{
- ASSERT(pendingScript.watchingForLoad);
+ ASSERT(pendingScript.watchingForLoad());
m_host->stopWatchingForLoad(pendingScript.cachedScript.get());
- pendingScript.watchingForLoad = false;
+ pendingScript.watchingForLoadState = PendingScript::NotWatchingForLoad;
}
// This function should match 10.2.5.11 "An end tag whose tag name is 'script'"
// Script handling lives outside the tree builder to keep the each class simple.
-bool HTML5ScriptRunner::execute(PassRefPtr<Element> scriptElement, int startLine)
+bool HTMLScriptRunner::execute(PassRefPtr<Element> scriptElement, int startLine)
{
ASSERT(scriptElement);
// FIXME: If scripting is disabled, always just return true;
@@ -167,19 +199,19 @@ bool HTML5ScriptRunner::execute(PassRefPtr<Element> scriptElement, int startLine
if (haveParsingBlockingScript()) {
if (m_scriptNestingLevel)
- return false; // Block the parser. Unwind to the outermost HTML5ScriptRunner::execute before continuing parsing.
+ return false; // Block the parser. Unwind to the outermost HTMLScriptRunner::execute before continuing parsing.
if (!executeParsingBlockingScripts())
return false; // We still have a parsing blocking script, block the parser.
}
return true; // Scripts executed as expected, continue parsing.
}
-bool HTML5ScriptRunner::haveParsingBlockingScript() const
+bool HTMLScriptRunner::haveParsingBlockingScript() const
{
return !!m_parsingBlockingScript.element;
}
-bool HTML5ScriptRunner::executeParsingBlockingScripts()
+bool HTMLScriptRunner::executeParsingBlockingScripts()
{
while (haveParsingBlockingScript()) {
// We only really need to check once.
@@ -190,36 +222,40 @@ bool HTML5ScriptRunner::executeParsingBlockingScripts()
return true;
}
-bool HTML5ScriptRunner::executeScriptsWaitingForLoad(CachedResource*)
+bool HTMLScriptRunner::executeScriptsWaitingForLoad(CachedResource* cachedScript)
{
+ // Callers should check hasScriptsWaitingForLoad() before calling
+ // to prevent parser or script re-entry during due to
+ // CachedResource::addClient calling notifyFinished on cache-hits.
+ ASSERT(hasScriptsWaitingForLoad());
ASSERT(!m_scriptNestingLevel);
ASSERT(haveParsingBlockingScript());
+ ASSERT_UNUSED(cachedScript, m_parsingBlockingScript.cachedScript == cachedScript);
ASSERT(m_parsingBlockingScript.cachedScript->isLoaded());
return executeParsingBlockingScripts();
}
-bool HTML5ScriptRunner::executeScriptsWaitingForStylesheets()
+bool HTMLScriptRunner::executeScriptsWaitingForStylesheets()
{
// Callers should check hasScriptsWaitingForStylesheets() before calling
// to prevent parser or script re-entry during </style> parsing.
- ASSERT(m_hasScriptsWaitingForStylesheets);
+ ASSERT(hasScriptsWaitingForStylesheets());
ASSERT(!m_scriptNestingLevel);
ASSERT(m_document->haveStylesheetsLoaded());
return executeParsingBlockingScripts();
}
-void HTML5ScriptRunner::requestScript(Element* script)
+void HTMLScriptRunner::requestScript(Element* script)
{
ASSERT(!m_parsingBlockingScript.element);
AtomicString srcValue = script->getAttribute(srcAttr);
// Allow the host to disllow script loads (using the XSSAuditor, etc.)
if (!m_host->shouldLoadExternalScriptFromSrc(srcValue))
return;
-
// FIXME: We need to resolve the url relative to the element.
- m_parsingBlockingScript.element = script;
- if (!script->dispatchBeforeLoadEvent(srcValue)) // Part of HTML5?
+ if (!script->dispatchBeforeLoadEvent(srcValue))
return;
+ m_parsingBlockingScript.element = script;
// This should correctly return 0 for empty or invalid srcValues.
CachedScript* cachedScript = m_document->docLoader()->requestScript(srcValue, toScriptElement(script)->scriptCharset());
if (!cachedScript) {
@@ -228,32 +264,37 @@ void HTML5ScriptRunner::requestScript(Element* script)
}
m_parsingBlockingScript.cachedScript = cachedScript;
- // We only care about a load callback if cachedScript is not already
- // in the cache. Callers will attempt to run the m_parsingBlockingScript
- // if possible before returning control to the parser.
- if (!m_parsingBlockingScript.cachedScript->isLoaded())
- watchForLoad(m_parsingBlockingScript);
+ // Always call watchForLoad, even if the script is already loaded.
+ // CachedResource may purge its data if it has no clients, which would cause
+ // later script execution to fail. watchForLoad sets m_parsingBlockingScript
+ // to the RegisteringForWatch state so we know to ignore any
+ // executeScriptsWaitingForLoad callbacks during the watchForLoad call.
+ watchForLoad(m_parsingBlockingScript);
+ // Callers will attempt to run the m_parsingBlockingScript if possible
+ // before returning control to the parser.
}
// This method is meant to match the HTML5 definition of "running a script"
// http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#running-a-script
-void HTML5ScriptRunner::runScript(Element* script, int startingLineNumber)
+void HTMLScriptRunner::runScript(Element* script, int startingLineNumber)
{
ASSERT(!haveParsingBlockingScript());
- m_scriptNestingLevel++;
- // Check script type and language, current code uses ScriptElement::shouldExecuteAsJavaScript(), but that may not be HTML5 compliant.
- notImplemented(); // event for support
-
- if (script->hasAttribute(srcAttr)) {
- // FIXME: Handle defer and async
- requestScript(script);
- } else {
- // FIXME: We do not block inline <script> tags on stylesheets to match the
- // old parser for now. See https://bugs.webkit.org/show_bug.cgi?id=40047
- ScriptSourceCode sourceCode(script->textContent(), documentURLForScriptExecution(m_document), startingLineNumber);
- executeScript(script, sourceCode);
+ {
+ NestScript nestingLevel(m_scriptNestingLevel, m_host->inputStream());
+
+ // Check script type and language, current code uses ScriptElement::shouldExecuteAsJavaScript(), but that may not be HTML5 compliant.
+ notImplemented(); // event for support
+
+ if (script->hasAttribute(srcAttr)) {
+ // FIXME: Handle defer and async
+ requestScript(script);
+ } else {
+ // FIXME: We do not block inline <script> tags on stylesheets to match the
+ // old parser for now. See https://bugs.webkit.org/show_bug.cgi?id=40047
+ ScriptSourceCode sourceCode(script->textContent(), documentURLForScriptExecution(m_document), startingLineNumber);
+ executeScript(script, sourceCode);
+ }
}
- m_scriptNestingLevel--;
}
}
diff --git a/WebCore/html/HTML5ScriptRunner.h b/WebCore/html/HTMLScriptRunner.h
index 19e70a6..7260007 100644
--- a/WebCore/html/HTML5ScriptRunner.h
+++ b/WebCore/html/HTMLScriptRunner.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTML5ScriptRunner_h
-#define HTML5ScriptRunner_h
+#ifndef HTMLScriptRunner_h
+#define HTMLScriptRunner_h
#include "CachedResourceClient.h"
#include "CachedResourceHandle.h"
@@ -38,18 +38,20 @@ class CachedScript;
class Document;
class Element;
class Frame;
-class HTML5ScriptRunnerHost;
+class HTMLScriptRunnerHost;
class ScriptSourceCode;
-class HTML5ScriptRunner : public Noncopyable {
+class HTMLScriptRunner : public Noncopyable {
public:
- HTML5ScriptRunner(Document*, HTML5ScriptRunnerHost*);
- ~HTML5ScriptRunner();
+ HTMLScriptRunner(Document*, HTMLScriptRunnerHost*);
+ ~HTMLScriptRunner();
// Processes the passed in script and any pending scripts if possible.
bool execute(PassRefPtr<Element> scriptToProcess, int scriptStartLine);
- // Processes any pending scripts.
+
+ bool hasScriptsWaitingForLoad() const;
bool executeScriptsWaitingForLoad(CachedResource*);
+
bool hasScriptsWaitingForStylesheets() const { return m_hasScriptsWaitingForStylesheets; }
bool executeScriptsWaitingForStylesheets();
@@ -57,15 +59,29 @@ public:
private:
struct PendingScript {
+ // This state controls whether we need to do anything with this script
+ // when we get a executeScriptsWaitingForLoad callback.
+ // We ignore callbacks during RegisteringForWatch.
+ enum WatchingForLoadState {
+ NotWatchingForLoad,
+ RegisteringForWatch,
+ WatchingForLoad,
+ };
+
PendingScript()
- : watchingForLoad(false)
+ : watchingForLoadState(NotWatchingForLoad)
, startingLineNumber(0)
{
}
+ bool watchingForLoad()
+ {
+ return watchingForLoadState != NotWatchingForLoad;
+ }
+
RefPtr<Element> element;
CachedResourceHandle<CachedScript> cachedScript;
- bool watchingForLoad; // Did we pass the cachedScript to the HTML5ScriptRunnerHost.
+ WatchingForLoadState watchingForLoadState;
int startingLineNumber; // Only used for inline script tags.
// HTML5 has an isReady parameter, however isReady ends up equivalent to
// m_document->haveStylesheetsLoaded() && cachedScript->isLoaded()
@@ -80,7 +96,7 @@ private:
void requestScript(Element*);
void runScript(Element*, int startingLineNumber);
- // Helpers for dealing with HTML5ScriptRunnerHost
+ // Helpers for dealing with HTMLScriptRunnerHost
void watchForLoad(PendingScript&);
void stopWatchingForLoad(PendingScript&);
void executeScript(Element*, const ScriptSourceCode&);
@@ -89,13 +105,13 @@ private:
ScriptSourceCode sourceFromPendingScript(const PendingScript&, bool& errorOccurred);
Document* m_document;
- HTML5ScriptRunnerHost* m_host;
+ HTMLScriptRunnerHost* m_host;
PendingScript m_parsingBlockingScript;
unsigned m_scriptNestingLevel;
// We only want stylesheet loads to trigger script execution if script
// execution is currently stopped due to stylesheet loads, otherwise we'd
- // cause nested sript execution when parsing <style> tags since </style>
+ // cause nested script execution when parsing <style> tags since </style>
// tags can cause Document to call executeScriptsWaitingForStylesheets.
bool m_hasScriptsWaitingForStylesheets;
};
diff --git a/WebCore/html/HTML5ScriptRunnerHost.h b/WebCore/html/HTMLScriptRunnerHost.h
index 9a77385..82ad70d 100644
--- a/WebCore/html/HTML5ScriptRunnerHost.h
+++ b/WebCore/html/HTMLScriptRunnerHost.h
@@ -23,28 +23,29 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTML5ScriptRunnerHost_h
-#define HTML5ScriptRunnerHost_h
+#ifndef HTMLScriptRunnerHost_h
+#define HTMLScriptRunnerHost_h
namespace WebCore {
class AtomicString;
class CachedResource;
+class Element;
+class HTMLInputStream;
class ScriptSourceCode;
-class HTML5ScriptRunnerHost {
+class HTMLScriptRunnerHost {
public:
- virtual ~HTML5ScriptRunnerHost() { }
+ virtual ~HTMLScriptRunnerHost() { }
- // Implementors should call cachedResource->addClient() here or soon after.
+ // Implementors must call cachedResource->addClient() immediately.
virtual void watchForLoad(CachedResource*) = 0;
// Implementors must call cachedResource->removeClient() immediately.
virtual void stopWatchingForLoad(CachedResource*) = 0;
// Implementors can block certain script loads (for XSSAuditor, etc.)
virtual bool shouldLoadExternalScriptFromSrc(const AtomicString&) = 0;
- // Implementors should handle possible rentry before/after calling ScriptController::executeScript
- virtual void executeScript(const ScriptSourceCode&) = 0;
+ virtual HTMLInputStream& inputStream() = 0;
};
}
diff --git a/WebCore/html/HTMLSelectElement.cpp b/WebCore/html/HTMLSelectElement.cpp
index 4c124e0..2dcac59 100644
--- a/WebCore/html/HTMLSelectElement.cpp
+++ b/WebCore/html/HTMLSelectElement.cpp
@@ -55,7 +55,7 @@ HTMLSelectElement::HTMLSelectElement(const QualifiedName& tagName, Document* doc
PassRefPtr<HTMLSelectElement> HTMLSelectElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
ASSERT(tagName.matches(selectTag));
- return new HTMLSelectElement(tagName, document, form);
+ return adoptRef(new HTMLSelectElement(tagName, document, form));
}
bool HTMLSelectElement::checkDTD(const Node* newChild)
@@ -107,7 +107,7 @@ void HTMLSelectElement::setSelectedIndexByUser(int optionIndex, bool deselect, b
void HTMLSelectElement::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
{
if (!multiple())
- setSelectedIndexByUser(listIndex, true, fireOnChangeNow);
+ setSelectedIndexByUser(listToOptionIndex(listIndex), true, fireOnChangeNow);
else {
updateSelectedState(m_data, this, listIndex, allowMultiplySelections, shift);
if (fireOnChangeNow)
diff --git a/WebCore/html/HTMLSourceElement.cpp b/WebCore/html/HTMLSourceElement.cpp
index 8378bc8..f6ffd9f 100644
--- a/WebCore/html/HTMLSourceElement.cpp
+++ b/WebCore/html/HTMLSourceElement.cpp
@@ -49,7 +49,7 @@ inline HTMLSourceElement::HTMLSourceElement(const QualifiedName& tagName, Docume
PassRefPtr<HTMLSourceElement> HTMLSourceElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLSourceElement(tagName, document);
+ return adoptRef(new HTMLSourceElement(tagName, document));
}
void HTMLSourceElement::insertedIntoDocument()
diff --git a/WebCore/html/HTMLStyleElement.cpp b/WebCore/html/HTMLStyleElement.cpp
index b67bfa3..a8ea42e 100644
--- a/WebCore/html/HTMLStyleElement.cpp
+++ b/WebCore/html/HTMLStyleElement.cpp
@@ -42,7 +42,7 @@ inline HTMLStyleElement::HTMLStyleElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLStyleElement> HTMLStyleElement::create(const QualifiedName& tagName, Document* document, bool createdByParser)
{
- return new HTMLStyleElement(tagName, document, createdByParser);
+ return adoptRef(new HTMLStyleElement(tagName, document, createdByParser));
}
// other stuff...
diff --git a/WebCore/html/HTMLStyleElement.idl b/WebCore/html/HTMLStyleElement.idl
index 562d01b..c98629c 100644
--- a/WebCore/html/HTMLStyleElement.idl
+++ b/WebCore/html/HTMLStyleElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,9 +21,9 @@
module html {
interface HTMLStyleElement : HTMLElement {
- attribute boolean disabled;
- attribute [ConvertNullToNullString] DOMString media;
- attribute [ConvertNullToNullString] DOMString type;
+ attribute boolean disabled;
+ attribute [Reflect] DOMString media;
+ attribute [Reflect] DOMString type;
// DOM Level 2 Style
readonly attribute StyleSheet sheet;
diff --git a/WebCore/html/HTMLTableCaptionElement.cpp b/WebCore/html/HTMLTableCaptionElement.cpp
index 3713ca1..40f2ab6 100644
--- a/WebCore/html/HTMLTableCaptionElement.cpp
+++ b/WebCore/html/HTMLTableCaptionElement.cpp
@@ -41,7 +41,7 @@ inline HTMLTableCaptionElement::HTMLTableCaptionElement(const QualifiedName& tag
PassRefPtr<HTMLTableCaptionElement> HTMLTableCaptionElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTableCaptionElement(tagName, document);
+ return adoptRef(new HTMLTableCaptionElement(tagName, document));
}
bool HTMLTableCaptionElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLTableCaptionElement.idl b/WebCore/html/HTMLTableCaptionElement.idl
index 86a197f..c56c456 100644
--- a/WebCore/html/HTMLTableCaptionElement.idl
+++ b/WebCore/html/HTMLTableCaptionElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -23,9 +23,7 @@ module html {
interface [
GenerateNativeConverter
] HTMLTableCaptionElement : HTMLElement {
-
- attribute [ConvertNullToNullString] DOMString align;
-
+ attribute [Reflect] DOMString align;
};
}
diff --git a/WebCore/html/HTMLTableCellElement.cpp b/WebCore/html/HTMLTableCellElement.cpp
index e4871f0..3fa8946 100644
--- a/WebCore/html/HTMLTableCellElement.cpp
+++ b/WebCore/html/HTMLTableCellElement.cpp
@@ -58,7 +58,7 @@ inline HTMLTableCellElement::HTMLTableCellElement(const QualifiedName& tagName,
PassRefPtr<HTMLTableCellElement> HTMLTableCellElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTableCellElement(tagName, document);
+ return adoptRef(new HTMLTableCellElement(tagName, document));
}
int HTMLTableCellElement::cellIndex() const
@@ -99,21 +99,22 @@ void HTMLTableCellElement::parseMappedAttribute(Attribute* attr)
if (renderer() && renderer()->isTableCell())
toRenderTableCell(renderer())->updateFromElement();
} else if (attr->name() == nowrapAttr) {
+<<<<<<< HEAD
#ifdef ANDROID_LAYOUT
if (!(document()->frame()) || document()->frame()->settings()->layoutAlgorithm() != Settings::kLayoutSSR)
#endif
// FIXME: What about removing the property when the attribute becomes null?
+=======
+>>>>>>> webkit.org at r61871
if (!attr->isNull())
addCSSProperty(attr, CSSPropertyWhiteSpace, CSSValueWebkitNowrap);
} else if (attr->name() == widthAttr) {
- // FIXME: What about removing the property when the attribute becomes empty, zero or negative?
if (!attr->value().isEmpty()) {
int widthInt = attr->value().toInt();
if (widthInt > 0) // width="0" is ignored for compatibility with WinIE.
addCSSLength(attr, CSSPropertyWidth, attr->value());
}
} else if (attr->name() == heightAttr) {
- // FIXME: What about removing the property when the attribute becomes empty, zero or negative?
if (!attr->value().isEmpty()) {
int heightInt = attr->value().toInt();
if (heightInt > 0) // height="0" is ignored for compatibility with WinIE.
diff --git a/WebCore/html/HTMLTableCellElement.idl b/WebCore/html/HTMLTableCellElement.idl
index a89149f..037581f 100644
--- a/WebCore/html/HTMLTableCellElement.idl
+++ b/WebCore/html/HTMLTableCellElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,23 +21,21 @@
module html {
interface HTMLTableCellElement : HTMLElement {
-
- readonly attribute long cellIndex;
- attribute [ConvertNullToNullString] DOMString abbr;
- attribute [ConvertNullToNullString] DOMString align;
- attribute [ConvertNullToNullString] DOMString axis;
- attribute [ConvertNullToNullString] DOMString bgColor;
- attribute [ConvertNullToNullString] DOMString ch;
- attribute [ConvertNullToNullString] DOMString chOff;
- attribute long colSpan;
- attribute [ConvertNullToNullString] DOMString headers;
- attribute [ConvertNullToNullString] DOMString height;
- attribute boolean noWrap;
- attribute long rowSpan;
- attribute [ConvertNullToNullString] DOMString scope;
- attribute [ConvertNullToNullString] DOMString vAlign;
- attribute [ConvertNullToNullString] DOMString width;
-
+ readonly attribute long cellIndex;
+ attribute [Reflect] DOMString abbr;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString axis;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute long colSpan;
+ attribute [Reflect] DOMString headers;
+ attribute [Reflect] DOMString height;
+ attribute boolean noWrap;
+ attribute long rowSpan;
+ attribute [Reflect] DOMString scope;
+ attribute [Reflect] DOMString vAlign;
+ attribute [Reflect] DOMString width;
};
}
diff --git a/WebCore/html/HTMLTableColElement.cpp b/WebCore/html/HTMLTableColElement.cpp
index d21b307..5269aaa 100644
--- a/WebCore/html/HTMLTableColElement.cpp
+++ b/WebCore/html/HTMLTableColElement.cpp
@@ -44,7 +44,7 @@ inline HTMLTableColElement::HTMLTableColElement(const QualifiedName& tagName, Do
PassRefPtr<HTMLTableColElement> HTMLTableColElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTableColElement(tagName, document);
+ return adoptRef(new HTMLTableColElement(tagName, document));
}
HTMLTagStatus HTMLTableColElement::endTagRequirement() const
diff --git a/WebCore/html/HTMLTableColElement.idl b/WebCore/html/HTMLTableColElement.idl
index 453ff3f..a6e6654 100644
--- a/WebCore/html/HTMLTableColElement.idl
+++ b/WebCore/html/HTMLTableColElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,14 +21,12 @@
module html {
interface HTMLTableColElement : HTMLElement {
-
- attribute [ConvertNullToNullString] DOMString align;
- attribute [ConvertNullToNullString] DOMString ch;
- attribute [ConvertNullToNullString] DOMString chOff;
- attribute long span;
- attribute [ConvertNullToNullString] DOMString vAlign;
- attribute [ConvertNullToNullString] DOMString width;
-
+ attribute [Reflect] DOMString align;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute long span;
+ attribute [Reflect] DOMString vAlign;
+ attribute [Reflect] DOMString width;
};
}
diff --git a/WebCore/html/HTMLTableElement.cpp b/WebCore/html/HTMLTableElement.cpp
index 7532b35..0cb33e1 100644
--- a/WebCore/html/HTMLTableElement.cpp
+++ b/WebCore/html/HTMLTableElement.cpp
@@ -55,12 +55,12 @@ HTMLTableElement::HTMLTableElement(const QualifiedName& tagName, Document* docum
PassRefPtr<HTMLTableElement> HTMLTableElement::create(Document* document)
{
- return new HTMLTableElement(tableTag, document);
+ return adoptRef(new HTMLTableElement(tableTag, document));
}
PassRefPtr<HTMLTableElement> HTMLTableElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTableElement(tagName, document);
+ return adoptRef(new HTMLTableElement(tagName, document));
}
bool HTMLTableElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLTableElement.idl b/WebCore/html/HTMLTableElement.idl
index 9cd72b0..fddb27a 100644
--- a/WebCore/html/HTMLTableElement.idl
+++ b/WebCore/html/HTMLTableElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,43 +21,33 @@
module html {
interface HTMLTableElement : HTMLElement {
-
- // could raise excepetions on setting.
- attribute HTMLTableCaptionElement caption
- setter raises(DOMException);
- attribute HTMLTableSectionElement tHead
- setter raises(DOMException);
- attribute HTMLTableSectionElement tFoot
- setter raises(DOMException);
+ attribute HTMLTableCaptionElement caption setter raises(DOMException);
+ attribute HTMLTableSectionElement tHead setter raises(DOMException);
+ attribute HTMLTableSectionElement tFoot setter raises(DOMException);
readonly attribute HTMLCollection rows;
readonly attribute HTMLCollection tBodies;
- attribute [ConvertNullToNullString] DOMString align;
- attribute [ConvertNullToNullString] DOMString bgColor;
- attribute [ConvertNullToNullString] DOMString border;
- attribute [ConvertNullToNullString] DOMString cellPadding;
- attribute [ConvertNullToNullString] DOMString cellSpacing;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect] DOMString border;
+ attribute [Reflect] DOMString cellPadding;
+ attribute [Reflect] DOMString cellSpacing;
- // FIXME: the obj-c attribute is called frameBorders
- attribute [ConvertNullToNullString] DOMString frame;
+ attribute [Reflect] DOMString frame;
- attribute [ConvertNullToNullString] DOMString rules;
- attribute [ConvertNullToNullString] DOMString summary;
- attribute [ConvertNullToNullString] DOMString width;
+ attribute [Reflect] DOMString rules;
+ attribute [Reflect] DOMString summary;
+ attribute [Reflect] DOMString width;
- HTMLElement createTHead();
- void deleteTHead();
+ HTMLElement createTHead();
+ void deleteTHead();
HTMLElement createTFoot();
- void deleteTFoot();
- HTMLElement createCaption();
- void deleteCaption();
-
- HTMLElement insertRow(in long index)
- raises(DOMException);
-
- void deleteRow(in long index)
- raises(DOMException);
+ void deleteTFoot();
+ HTMLElement createCaption();
+ void deleteCaption();
+ HTMLElement insertRow(in long index) raises(DOMException);
+ void deleteRow(in long index) raises(DOMException);
};
}
diff --git a/WebCore/html/HTMLTableRowElement.cpp b/WebCore/html/HTMLTableRowElement.cpp
index 49f85ce..cba2d48 100644
--- a/WebCore/html/HTMLTableRowElement.cpp
+++ b/WebCore/html/HTMLTableRowElement.cpp
@@ -46,12 +46,12 @@ HTMLTableRowElement::HTMLTableRowElement(const QualifiedName& tagName, Document*
PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(Document* document)
{
- return new HTMLTableRowElement(trTag, document);
+ return adoptRef(new HTMLTableRowElement(trTag, document));
}
PassRefPtr<HTMLTableRowElement> HTMLTableRowElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTableRowElement(tagName, document);
+ return adoptRef(new HTMLTableRowElement(tagName, document));
}
bool HTMLTableRowElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLTableRowElement.idl b/WebCore/html/HTMLTableRowElement.idl
index 052b516..4eb348e 100644
--- a/WebCore/html/HTMLTableRowElement.idl
+++ b/WebCore/html/HTMLTableRowElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. ALl rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,21 +21,16 @@
module html {
interface HTMLTableRowElement : HTMLElement {
-
- readonly attribute long rowIndex;
- readonly attribute long sectionRowIndex;
- readonly attribute HTMLCollection cells;
- attribute [ConvertNullToNullString] DOMString align;
- attribute [ConvertNullToNullString] DOMString bgColor;
- attribute [ConvertNullToNullString] DOMString ch;
- attribute [ConvertNullToNullString] DOMString chOff;
- attribute [ConvertNullToNullString] DOMString vAlign;
-
- HTMLElement insertCell(in long index)
- raises(DOMException);
- void deleteCell(in long index)
- raises(DOMException);
-
+ readonly attribute long rowIndex;
+ readonly attribute long sectionRowIndex;
+ readonly attribute HTMLCollection cells;
+ attribute [Reflect] DOMString align;
+ attribute [Reflect] DOMString bgColor;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute [Reflect] DOMString vAlign;
+ HTMLElement insertCell(in long index) raises(DOMException);
+ void deleteCell(in long index) raises(DOMException);
};
}
diff --git a/WebCore/html/HTMLTableSectionElement.cpp b/WebCore/html/HTMLTableSectionElement.cpp
index 96a0d9e..122af8a 100644
--- a/WebCore/html/HTMLTableSectionElement.cpp
+++ b/WebCore/html/HTMLTableSectionElement.cpp
@@ -44,7 +44,7 @@ inline HTMLTableSectionElement::HTMLTableSectionElement(const QualifiedName& tag
PassRefPtr<HTMLTableSectionElement> HTMLTableSectionElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTableSectionElement(tagName, document);
+ return adoptRef(new HTMLTableSectionElement(tagName, document));
}
bool HTMLTableSectionElement::checkDTD(const Node* newChild)
diff --git a/WebCore/html/HTMLTableSectionElement.idl b/WebCore/html/HTMLTableSectionElement.idl
index 57e4293..2065d6e 100644
--- a/WebCore/html/HTMLTableSectionElement.idl
+++ b/WebCore/html/HTMLTableSectionElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006, 2007 Apple Inc.
+ * Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -23,18 +23,13 @@ module html {
interface [
GenerateNativeConverter
] HTMLTableSectionElement : HTMLElement {
-
- attribute [ConvertNullToNullString] DOMString align;
- attribute [ConvertNullToNullString] DOMString ch;
- attribute [ConvertNullToNullString] DOMString chOff;
- attribute [ConvertNullToNullString] DOMString vAlign;
- readonly attribute HTMLCollection rows;
-
- HTMLElement insertRow(in long index)
- raises(DOMException);
- void deleteRow(in long index)
- raises(DOMException);
-
+ attribute [Reflect] DOMString align;
+ attribute [Reflect=char] DOMString ch;
+ attribute [Reflect=charoff] DOMString chOff;
+ attribute [Reflect] DOMString vAlign;
+ readonly attribute HTMLCollection rows;
+ HTMLElement insertRow(in long index) raises(DOMException);
+ void deleteRow(in long index) raises(DOMException);
};
}
diff --git a/WebCore/html/HTMLTextAreaElement.cpp b/WebCore/html/HTMLTextAreaElement.cpp
index dd82aea..47acc54 100644
--- a/WebCore/html/HTMLTextAreaElement.cpp
+++ b/WebCore/html/HTMLTextAreaElement.cpp
@@ -83,7 +83,7 @@ HTMLTextAreaElement::HTMLTextAreaElement(const QualifiedName& tagName, Document*
PassRefPtr<HTMLTextAreaElement> HTMLTextAreaElement::create(const QualifiedName& tagName, Document* document, HTMLFormElement* form)
{
- return new HTMLTextAreaElement(tagName, document, form);
+ return adoptRef(new HTMLTextAreaElement(tagName, document, form));
}
const AtomicString& HTMLTextAreaElement::formControlType() const
diff --git a/WebCore/html/HTMLTextAreaElement.idl b/WebCore/html/HTMLTextAreaElement.idl
index a17f2ec..4229450 100644
--- a/WebCore/html/HTMLTextAreaElement.idl
+++ b/WebCore/html/HTMLTextAreaElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com>
*
* This library is free software; you can redistribute it and/or
@@ -21,36 +21,35 @@
module html {
interface HTMLTextAreaElement : HTMLElement {
- attribute [ConvertNullToNullString] DOMString defaultValue;
- readonly attribute HTMLFormElement form;
- readonly attribute ValidityState validity;
- attribute [ConvertNullToNullString] DOMString accessKey;
- attribute long cols;
- attribute boolean disabled;
- attribute boolean autofocus;
- attribute long maxLength
- setter raises(DOMException);
- attribute [ConvertNullToNullString] DOMString name;
- attribute [ConvertNullToNullString, Reflect] DOMString placeholder;
- attribute boolean readOnly;
- attribute boolean required;
- attribute long rows;
- readonly attribute DOMString type;
- attribute [ConvertNullToNullString] DOMString value;
- readonly attribute unsigned long textLength;
-
- void select();
+ attribute [ConvertNullToNullString] DOMString defaultValue;
+ readonly attribute HTMLFormElement form;
+ readonly attribute ValidityState validity;
+ attribute [Reflect] DOMString accessKey;
+ attribute long cols;
+ attribute boolean disabled;
+ attribute boolean autofocus;
+ attribute long maxLength setter raises(DOMException);
+ attribute [ConvertNullToNullString] DOMString name;
+ attribute [Reflect] DOMString placeholder;
+ attribute boolean readOnly;
+ attribute boolean required;
+ attribute long rows;
+ readonly attribute DOMString type;
+ attribute [ConvertNullToNullString] DOMString value;
+ readonly attribute unsigned long textLength;
- readonly attribute boolean willValidate;
- readonly attribute DOMString validationMessage;
- boolean checkValidity();
- void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+ void select();
- // WinIE & FireFox extension:
- attribute long selectionStart;
- attribute long selectionEnd;
+ readonly attribute boolean willValidate;
+ readonly attribute DOMString validationMessage;
+ boolean checkValidity();
+ void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error);
+
+ // WinIE & FireFox extension:
+ attribute long selectionStart;
+ attribute long selectionEnd;
void setSelectionRange(in long start, in long end);
- readonly attribute NodeList labels;
+ readonly attribute NodeList labels;
};
}
diff --git a/WebCore/html/HTMLTitleElement.cpp b/WebCore/html/HTMLTitleElement.cpp
index 40c9f8b..776c37c 100644
--- a/WebCore/html/HTMLTitleElement.cpp
+++ b/WebCore/html/HTMLTitleElement.cpp
@@ -40,7 +40,7 @@ inline HTMLTitleElement::HTMLTitleElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLTitleElement> HTMLTitleElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLTitleElement(tagName, document);
+ return adoptRef(new HTMLTitleElement(tagName, document));
}
void HTMLTitleElement::insertedIntoDocument()
diff --git a/WebCore/html/HTML5Token.h b/WebCore/html/HTMLToken.h
index 6b0fdc8..321b103 100644
--- a/WebCore/html/HTML5Token.h
+++ b/WebCore/html/HTMLToken.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTML5Token_h
-#define HTML5Token_h
+#ifndef HTMLToken_h
+#define HTMLToken_h
#include "NamedNodeMap.h"
#include <wtf/Noncopyable.h>
@@ -32,7 +32,7 @@
namespace WebCore {
-class HTML5Token : public Noncopyable {
+class HTMLToken : public Noncopyable {
public:
enum Type {
Uninitialized,
@@ -53,7 +53,7 @@ public:
typedef WTF::Vector<Attribute, 10> AttributeList;
typedef WTF::Vector<UChar, 1024> DataVector;
- HTML5Token() { clear(); }
+ HTMLToken() { clear(); }
void clear()
{
@@ -160,39 +160,39 @@ public:
return m_selfClosing;
}
- AttributeList& attributes()
+ const AttributeList& attributes() const
{
ASSERT(m_type == StartTag || m_type == EndTag);
return m_attributes;
}
- const DataVector& name()
+ const DataVector& name() const
{
ASSERT(m_type == StartTag || m_type == EndTag || m_type == DOCTYPE);
return m_data;
}
- const DataVector& characters()
+ const DataVector& characters() const
{
ASSERT(m_type == Character);
return m_data;
}
- const DataVector& comment()
+ const DataVector& comment() const
{
ASSERT(m_type == Comment);
return m_data;
}
// FIXME: Distinguish between a missing public identifer and an empty one.
- const WTF::Vector<UChar>& publicIdentifier()
+ const WTF::Vector<UChar>& publicIdentifier() const
{
ASSERT(m_type == DOCTYPE);
return m_doctypeData->m_publicIdentifier;
}
// FIXME: Distinguish between a missing system identifer and an empty one.
- const WTF::Vector<UChar>& systemIdentifier()
+ const WTF::Vector<UChar>& systemIdentifier() const
{
ASSERT(m_type == DOCTYPE);
return m_doctypeData->m_systemIdentifier;
@@ -212,7 +212,7 @@ public:
m_doctypeData->m_systemIdentifier.clear();
}
- bool forceQuirks()
+ bool forceQuirks() const
{
ASSERT(m_type == DOCTYPE);
return m_doctypeData->m_forceQuirks;
@@ -239,6 +239,11 @@ public:
}
private:
+ // FIXME: I'm not sure what the final relationship between HTMLToken and
+ // AtomicHTMLToken will be. I'm marking this a friend for now, but we'll
+ // want to end up with a cleaner interface between the two classes.
+ friend class AtomicHTMLToken;
+
class DoctypeData {
public:
DoctypeData()
@@ -273,6 +278,127 @@ private:
Attribute* m_currentAttribute;
};
+// FIXME: This class should eventually be named HTMLToken once we move the
+// exiting HTMLToken to be internal to the HTMLTokenizer.
+class AtomicHTMLToken : public Noncopyable {
+public:
+ AtomicHTMLToken(HTMLToken& token)
+ : m_type(token.type())
+ {
+ switch (m_type) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::DOCTYPE:
+ m_name = AtomicString(token.name().data(), token.name().size());
+ m_doctypeData.set(token.m_doctypeData.release());
+ break;
+ case HTMLToken::EndOfFile:
+ break;
+ case HTMLToken::StartTag:
+ case HTMLToken::EndTag: {
+ m_selfClosing = token.selfClosing();
+ m_name = AtomicString(token.name().data(), token.name().size());
+ const HTMLToken::AttributeList& attributes = token.attributes();
+ for (HTMLToken::AttributeList::const_iterator iter = attributes.begin();
+ iter != attributes.end(); ++iter) {
+ if (!iter->m_name.isEmpty()) {
+ String name(iter->m_name.data(), iter->m_name.size());
+ String value(iter->m_value.data(), iter->m_value.size());
+ RefPtr<Attribute> mappedAttribute = Attribute::createMapped(name, value);
+ if (!m_attributes)
+ m_attributes = NamedNodeMap::create();
+ m_attributes->insertAttribute(mappedAttribute.release(), false);
+ }
+ }
+ break;
+ }
+ case HTMLToken::Comment:
+ m_data = String(token.comment().data(), token.comment().size());
+ break;
+ case HTMLToken::Character:
+ m_data = String(token.characters().data(), token.characters().size());
+ break;
+ }
+ }
+
+ AtomicHTMLToken(HTMLToken::Type type, AtomicString name)
+ : m_type(type)
+ , m_name(name)
+ {
+ }
+
+ HTMLToken::Type type() const { return m_type; }
+
+ const AtomicString& name() const
+ {
+ ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag || m_type == HTMLToken::DOCTYPE);
+ return m_name;
+ }
+
+ bool selfClosing() const
+ {
+ ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
+ return m_selfClosing;
+ }
+
+ NamedNodeMap* attributes() const
+ {
+ ASSERT(m_type == HTMLToken::StartTag || m_type == HTMLToken::EndTag);
+ return m_attributes.get();
+ }
+
+ const String& characters() const
+ {
+ ASSERT(m_type == HTMLToken::Character);
+ return m_data;
+ }
+
+ const String& comment() const
+ {
+ ASSERT(m_type == HTMLToken::Comment);
+ return m_data;
+ }
+
+ // FIXME: Distinguish between a missing public identifer and an empty one.
+ const WTF::Vector<UChar>& publicIdentifier() const
+ {
+ ASSERT(m_type == HTMLToken::DOCTYPE);
+ return m_doctypeData->m_publicIdentifier;
+ }
+
+ // FIXME: Distinguish between a missing system identifer and an empty one.
+ const WTF::Vector<UChar>& systemIdentifier() const
+ {
+ ASSERT(m_type == HTMLToken::DOCTYPE);
+ return m_doctypeData->m_systemIdentifier;
+ }
+
+ bool forceQuirks() const
+ {
+ ASSERT(m_type == HTMLToken::DOCTYPE);
+ return m_doctypeData->m_forceQuirks;
+ }
+
+private:
+ HTMLToken::Type m_type;
+
+ // "name" for DOCTYPE, StartTag, and EndTag
+ AtomicString m_name;
+
+ // "characters" for Character
+ // "data" for Comment
+ String m_data;
+
+ // For DOCTYPE
+ OwnPtr<HTMLToken::DoctypeData> m_doctypeData;
+
+ // For StartTag and EndTag
+ bool m_selfClosing;
+
+ RefPtr<NamedNodeMap> m_attributes;
+};
+
}
#endif
diff --git a/WebCore/html/HTML5Lexer.cpp b/WebCore/html/HTMLTokenizer.cpp
index 0cc4ed1..84894ff 100644
--- a/WebCore/html/HTML5Lexer.cpp
+++ b/WebCore/html/HTMLTokenizer.cpp
@@ -26,11 +26,11 @@
*/
#include "config.h"
-#include "HTML5Lexer.h"
+#include "HTMLTokenizer.h"
#include "AtomicString.h"
-#include "HTML5EntityParser.h"
-#include "HTML5Token.h"
+#include "HTMLEntityParser.h"
+#include "HTMLToken.h"
#include "HTMLNames.h"
#include "NotImplemented.h"
#include <wtf/CurrentTime.h>
@@ -69,30 +69,35 @@ inline bool vectorEqualsString(const Vector<UChar, 32>& vector, const String& st
return !memcmp(stringData, vectorData, vector.size() * sizeof(UChar));
}
-inline bool isEndTagBufferingState(HTML5Lexer::State state)
+inline bool isEndTagBufferingState(HTMLTokenizer::State state)
{
- return state == HTML5Lexer::RCDATAEndTagOpenState
- || state == HTML5Lexer::RCDATAEndTagNameState
- || state == HTML5Lexer::RAWTEXTEndTagOpenState
- || state == HTML5Lexer::RAWTEXTEndTagNameState
- || state == HTML5Lexer::ScriptDataEndTagOpenState
- || state == HTML5Lexer::ScriptDataEndTagNameState
- || state == HTML5Lexer::ScriptDataEscapedEndTagOpenState
- || state == HTML5Lexer::ScriptDataEscapedEndTagNameState;
+ switch (state) {
+ case HTMLTokenizer::RCDATAEndTagOpenState:
+ case HTMLTokenizer::RCDATAEndTagNameState:
+ case HTMLTokenizer::RAWTEXTEndTagOpenState:
+ case HTMLTokenizer::RAWTEXTEndTagNameState:
+ case HTMLTokenizer::ScriptDataEndTagOpenState:
+ case HTMLTokenizer::ScriptDataEndTagNameState:
+ case HTMLTokenizer::ScriptDataEscapedEndTagOpenState:
+ case HTMLTokenizer::ScriptDataEscapedEndTagNameState:
+ return true;
+ default:
+ return false;
+ }
}
}
-HTML5Lexer::HTML5Lexer()
+HTMLTokenizer::HTMLTokenizer()
{
reset();
}
-HTML5Lexer::~HTML5Lexer()
+HTMLTokenizer::~HTMLTokenizer()
{
}
-void HTML5Lexer::reset()
+void HTMLTokenizer::reset()
{
m_state = DataState;
m_token = 0;
@@ -101,10 +106,10 @@ void HTML5Lexer::reset()
m_additionalAllowedCharacter = '\0';
}
-inline bool HTML5Lexer::processEntity(SegmentedString& source)
+inline bool HTMLTokenizer::processEntity(SegmentedString& source)
{
bool notEnoughCharacters = false;
- unsigned value = consumeHTML5Entity(source, notEnoughCharacters);
+ unsigned value = consumeHTMLEntity(source, notEnoughCharacters);
if (notEnoughCharacters)
return false;
if (!value)
@@ -149,7 +154,7 @@ inline bool HTML5Lexer::processEntity(SegmentedString& source)
#define SWITCH_TO(stateName) \
do { \
m_state = stateName; \
- if (!m_inputStreamPreprocessor.peek(source, m_lineNumber)) \
+ if (source.isEmpty() || !m_inputStreamPreprocessor.peek(source, m_lineNumber)) \
return shouldEmitBufferedCharacterToken(source); \
cc = m_inputStreamPreprocessor.nextInputCharacter(); \
goto stateName; \
@@ -169,10 +174,10 @@ inline bool HTML5Lexer::processEntity(SegmentedString& source)
#define _FLUSH_BUFFERED_END_TAG() \
do { \
- ASSERT(m_token->type() == HTML5Token::Character || \
- m_token->type() == HTML5Token::Uninitialized); \
+ ASSERT(m_token->type() == HTMLToken::Character || \
+ m_token->type() == HTMLToken::Uninitialized); \
source.advance(m_lineNumber); \
- if (m_token->type() == HTML5Token::Character) \
+ if (m_token->type() == HTMLToken::Character) \
return true; \
m_token->beginEndTag(m_bufferedEndTagName); \
m_bufferedEndTagName.clear(); \
@@ -196,11 +201,11 @@ inline bool HTML5Lexer::processEntity(SegmentedString& source)
return true; \
} while (false)
-bool HTML5Lexer::nextToken(SegmentedString& source, HTML5Token& token)
+bool HTMLTokenizer::nextToken(SegmentedString& source, HTMLToken& token)
{
// If we have a token in progress, then we're supposed to be called back
// with the same token so we can finish it.
- ASSERT(!m_token || m_token == &token || token.type() == HTML5Token::Uninitialized);
+ ASSERT(!m_token || m_token == &token || token.type() == HTMLToken::Uninitialized);
m_token = &token;
if (!m_bufferedEndTagName.isEmpty() && !isEndTagBufferingState(m_state)) {
@@ -241,7 +246,7 @@ bool HTML5Lexer::nextToken(SegmentedString& source, HTML5Token& token)
if (cc == '&')
ADVANCE_TO(CharacterReferenceInDataState);
else if (cc == '<') {
- if (m_token->type() == HTML5Token::Character) {
+ if (m_token->type() == HTMLToken::Character) {
// We have a bunch of character tokens queued up that we
// are emitting lazily here.
return true;
@@ -913,7 +918,7 @@ bool HTML5Lexer::nextToken(SegmentedString& source, HTML5Token& token)
BEGIN_STATE(CharacterReferenceInAttributeValueState) {
bool notEnoughCharacters = false;
- unsigned value = consumeHTML5Entity(source, notEnoughCharacters, m_additionalAllowedCharacter);
+ unsigned value = consumeHTMLEntity(source, notEnoughCharacters, m_additionalAllowedCharacter);
if (notEnoughCharacters)
return shouldEmitBufferedCharacterToken(source);
if (!value)
@@ -1288,11 +1293,11 @@ bool HTML5Lexer::nextToken(SegmentedString& source, HTML5Token& token)
EMIT_AND_RESUME_IN(DataState);
else if (cc == '"') {
emitParseError();
- m_token->setPublicIdentifierToEmptyString();
+ m_token->setSystemIdentifierToEmptyString();
ADVANCE_TO(DOCTYPESystemIdentifierDoubleQuotedState);
} else if (cc == '\'') {
emitParseError();
- m_token->setPublicIdentifierToEmptyString();
+ m_token->setSystemIdentifierToEmptyString();
ADVANCE_TO(DOCTYPESystemIdentifierSingleQuotedState);
} else {
emitParseError();
@@ -1432,32 +1437,32 @@ bool HTML5Lexer::nextToken(SegmentedString& source, HTML5Token& token)
return false;
}
-inline bool HTML5Lexer::temporaryBufferIs(const String& expectedString)
+inline bool HTMLTokenizer::temporaryBufferIs(const String& expectedString)
{
return vectorEqualsString(m_temporaryBuffer, expectedString);
}
-inline void HTML5Lexer::addToPossibleEndTag(UChar cc)
+inline void HTMLTokenizer::addToPossibleEndTag(UChar cc)
{
ASSERT(isEndTagBufferingState(m_state));
m_bufferedEndTagName.append(cc);
}
-inline bool HTML5Lexer::isAppropriateEndTag()
+inline bool HTMLTokenizer::isAppropriateEndTag()
{
return m_bufferedEndTagName == m_appropriateEndTagName;
}
-inline void HTML5Lexer::emitCharacter(UChar character)
+inline void HTMLTokenizer::emitCharacter(UChar character)
{
- if (m_token->type() != HTML5Token::Character) {
+ if (m_token->type() != HTMLToken::Character) {
m_token->beginCharacter(character);
return;
}
m_token->appendToCharacter(character);
}
-inline void HTML5Lexer::emitCodePoint(unsigned value)
+inline void HTMLTokenizer::emitCodePoint(unsigned value)
{
if (value < 0xFFFF) {
emitCharacter(value);
@@ -1467,21 +1472,21 @@ inline void HTML5Lexer::emitCodePoint(unsigned value)
emitCharacter(U16_TRAIL(value));
}
-inline void HTML5Lexer::emitParseError()
+inline void HTMLTokenizer::emitParseError()
{
notImplemented();
}
-inline void HTML5Lexer::emitCurrentToken()
+inline void HTMLTokenizer::emitCurrentToken()
{
- ASSERT(m_token->type() != HTML5Token::Uninitialized);
- if (m_token->type() == HTML5Token::StartTag)
+ ASSERT(m_token->type() != HTMLToken::Uninitialized);
+ if (m_token->type() == HTMLToken::StartTag)
m_appropriateEndTagName = m_token->name();
}
-inline bool HTML5Lexer::shouldEmitBufferedCharacterToken(const SegmentedString& source)
+inline bool HTMLTokenizer::shouldEmitBufferedCharacterToken(const SegmentedString& source)
{
- return source.isClosed() && m_token->type() == HTML5Token::Character;
+ return source.isClosed() && m_token->type() == HTMLToken::Character;
}
}
diff --git a/WebCore/html/HTMLTokenizer.h b/WebCore/html/HTMLTokenizer.h
new file mode 100644
index 0000000..c2e52ab
--- /dev/null
+++ b/WebCore/html/HTMLTokenizer.h
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 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 HTMLTokenizer_h
+#define HTMLTokenizer_h
+
+#include "AtomicString.h"
+#include "SegmentedString.h"
+#include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class HTMLToken;
+
+class HTMLTokenizer : public Noncopyable {
+public:
+ enum State {
+ DataState,
+ CharacterReferenceInDataState,
+ RCDATAState,
+ CharacterReferenceInRCDATAState,
+ RAWTEXTState,
+ ScriptDataState,
+ PLAINTEXTState,
+ TagOpenState,
+ EndTagOpenState,
+ TagNameState,
+ RCDATALessThanSignState,
+ RCDATAEndTagOpenState,
+ RCDATAEndTagNameState,
+ RAWTEXTLessThanSignState,
+ RAWTEXTEndTagOpenState,
+ RAWTEXTEndTagNameState,
+ ScriptDataLessThanSignState,
+ ScriptDataEndTagOpenState,
+ ScriptDataEndTagNameState,
+ ScriptDataEscapeStartState,
+ ScriptDataEscapeStartDashState,
+ ScriptDataEscapedState,
+ ScriptDataEscapedDashState,
+ ScriptDataEscapedDashDashState,
+ ScriptDataEscapedLessThanSignState,
+ ScriptDataEscapedEndTagOpenState,
+ ScriptDataEscapedEndTagNameState,
+ ScriptDataDoubleEscapeStartState,
+ ScriptDataDoubleEscapedState,
+ ScriptDataDoubleEscapedDashState,
+ ScriptDataDoubleEscapedDashDashState,
+ ScriptDataDoubleEscapedLessThanSignState,
+ ScriptDataDoubleEscapeEndState,
+ BeforeAttributeNameState,
+ AttributeNameState,
+ AfterAttributeNameState,
+ BeforeAttributeValueState,
+ AttributeValueDoubleQuotedState,
+ AttributeValueSingleQuotedState,
+ AttributeValueUnquotedState,
+ CharacterReferenceInAttributeValueState,
+ AfterAttributeValueQuotedState,
+ SelfClosingStartTagState,
+ BogusCommentState,
+ MarkupDeclarationOpenState,
+ CommentStartState,
+ CommentStartDashState,
+ CommentState,
+ CommentEndDashState,
+ CommentEndState,
+ CommentEndBangState,
+ CommentEndSpaceState,
+ DOCTYPEState,
+ BeforeDOCTYPENameState,
+ DOCTYPENameState,
+ AfterDOCTYPENameState,
+ AfterDOCTYPEPublicKeywordState,
+ BeforeDOCTYPEPublicIdentifierState,
+ DOCTYPEPublicIdentifierDoubleQuotedState,
+ DOCTYPEPublicIdentifierSingleQuotedState,
+ AfterDOCTYPEPublicIdentifierState,
+ BetweenDOCTYPEPublicAndSystemIdentifiersState,
+ AfterDOCTYPESystemKeywordState,
+ BeforeDOCTYPESystemIdentifierState,
+ DOCTYPESystemIdentifierDoubleQuotedState,
+ DOCTYPESystemIdentifierSingleQuotedState,
+ AfterDOCTYPESystemIdentifierState,
+ BogusDOCTYPEState,
+ CDATASectionState,
+ };
+
+ HTMLTokenizer();
+ ~HTMLTokenizer();
+
+ void reset();
+
+ // This function returns true if it emits a token. Otherwise, callers
+ // must provide the same (in progress) token on the next call (unless
+ // they call reset() first).
+ bool nextToken(SegmentedString&, HTMLToken&);
+
+ int lineNumber() const { return m_lineNumber; }
+ int columnNumber() const { return 1; } // Matches LegacyHTMLDocumentParser.h behavior.
+
+ State state() const { return m_state; }
+ void setState(State state) { m_state = state; }
+
+ // Hack to skip leading newline in <pre>/<listing> for authoring ease.
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#parsing-main-inbody
+ void skipLeadingNewLineForListing() { m_skipLeadingNewLineForListing = true; }
+
+private:
+ // http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
+ class InputStreamPreprocessor : public Noncopyable {
+ public:
+ InputStreamPreprocessor()
+ : m_nextInputCharacter('\0')
+ , m_skipNextNewLine(false)
+ {
+ }
+
+ UChar nextInputCharacter() const { return m_nextInputCharacter; }
+
+ // Returns whether we succeeded in peeking at the next character.
+ // The only way we can fail to peek is if there are no more
+ // characters in |source| (after collapsing \r\n, etc).
+ bool peek(SegmentedString& source, int& lineNumber)
+ {
+ m_nextInputCharacter = *source;
+ if (m_nextInputCharacter == '\n' && m_skipNextNewLine) {
+ m_skipNextNewLine = false;
+ source.advancePastNewline(lineNumber);
+ if (source.isEmpty())
+ return false;
+ m_nextInputCharacter = *source;
+ }
+ if (m_nextInputCharacter == '\r') {
+ m_nextInputCharacter = '\n';
+ m_skipNextNewLine = true;
+ } else {
+ m_skipNextNewLine = false;
+ // FIXME: The spec indicates that the surrogate pair range as well as
+ // a number of specific character values are parse errors and should be replaced
+ // by the replacement character. We suspect this is a problem with the spec as doing
+ // that filtering breaks surrogate pair handling and causes us not to match Minefield.
+ if (m_nextInputCharacter == '\0')
+ m_nextInputCharacter = 0xFFFD;
+ }
+ return true;
+ }
+
+ // Returns whether there are more characters in |source| after advancing.
+ bool advance(SegmentedString& source, int& lineNumber)
+ {
+ source.advance(lineNumber);
+ if (source.isEmpty())
+ return false;
+ return peek(source, lineNumber);
+ }
+
+ private:
+ // http://www.whatwg.org/specs/web-apps/current-work/#next-input-character
+ UChar m_nextInputCharacter;
+ bool m_skipNextNewLine;
+ };
+
+ inline void emitCharacter(UChar);
+ inline void emitParseError();
+ inline void emitCurrentToken();
+ inline void emitCodePoint(unsigned);
+
+ inline bool processEntity(SegmentedString& source);
+
+ inline bool temporaryBufferIs(const String&);
+
+ // Sometimes we speculatively consume input characters and we don't
+ // know whether they represent end tags or RCDATA, etc. These
+ // functions help manage these state.
+ inline void addToPossibleEndTag(UChar cc);
+ inline bool isAppropriateEndTag();
+
+ inline bool shouldEmitBufferedCharacterToken(const SegmentedString&);
+
+ State m_state;
+
+ Vector<UChar, 32> m_appropriateEndTagName;
+
+ // m_token is owned by the caller. If nextToken is not on the stack,
+ // this member might be pointing to unallocated memory.
+ HTMLToken* m_token;
+ int m_lineNumber;
+
+ bool m_skipLeadingNewLineForListing;
+
+ // http://www.whatwg.org/specs/web-apps/current-work/#temporary-buffer
+ Vector<UChar, 32> m_temporaryBuffer;
+
+ // We occationally want to emit both a character token and an end tag
+ // token (e.g., when lexing script). We buffer the name of the end tag
+ // token here so we remember it next time we re-enter the tokenizer.
+ Vector<UChar, 32> m_bufferedEndTagName;
+
+ // http://www.whatwg.org/specs/web-apps/current-work/#additional-allowed-character
+ UChar m_additionalAllowedCharacter;
+
+ // http://www.whatwg.org/specs/web-apps/current-work/#preprocessing-the-input-stream
+ InputStreamPreprocessor m_inputStreamPreprocessor;
+};
+
+}
+
+#endif
diff --git a/WebCore/html/HTMLTreeBuilder.cpp b/WebCore/html/HTMLTreeBuilder.cpp
new file mode 100644
index 0000000..6e40fd7
--- /dev/null
+++ b/WebCore/html/HTMLTreeBuilder.cpp
@@ -0,0 +1,593 @@
+/*
+ * Copyright (C) 2010 Google, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GOOGLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "HTMLTreeBuilder.h"
+
+#include "DocumentFragment.h"
+#include "Element.h"
+#include "Frame.h"
+#include "HTMLTokenizer.h"
+#include "HTMLToken.h"
+#include "HTMLDocument.h"
+#include "LegacyHTMLDocumentParser.h"
+#include "HTMLNames.h"
+#include "LegacyHTMLTreeBuilder.h"
+#include "NotImplemented.h"
+#include "ScriptController.h"
+#include <wtf/UnusedParam.h>
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+static const int uninitializedLineNumberValue = -1;
+
+namespace {
+
+inline bool isTreeBuilderWhiteSpace(UChar cc)
+{
+ return cc == '\t' || cc == '\x0A' || cc == '\x0C' || cc == '\x0D' || cc == ' ';
+}
+
+} // namespace
+
+HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, HTMLDocument* document, bool reportErrors)
+ : m_framesetOk(true)
+ , m_document(document)
+ , m_reportErrors(reportErrors)
+ , m_isPaused(false)
+ , m_insertionMode(InitialMode)
+ , m_tokenizer(tokenizer)
+ , m_legacyTreeBuilder(new LegacyHTMLTreeBuilder(document, reportErrors))
+ , m_lastScriptElementStartLine(uninitializedLineNumberValue)
+ , m_scriptToProcessStartLine(uninitializedLineNumberValue)
+ , m_fragmentScriptingPermission(FragmentScriptingAllowed)
+{
+}
+
+// FIXME: Member variables should be grouped into self-initializing structs to
+// minimize code duplication between these constructors.
+HTMLTreeBuilder::HTMLTreeBuilder(HTMLTokenizer* tokenizer, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
+ : m_framesetOk(true)
+ , m_document(fragment->document())
+ , m_reportErrors(false) // FIXME: Why not report errors in fragments?
+ , m_isPaused(false)
+ , m_insertionMode(InitialMode)
+ , m_tokenizer(tokenizer)
+ , m_legacyTreeBuilder(new LegacyHTMLTreeBuilder(fragment, scriptingPermission))
+ , m_lastScriptElementStartLine(uninitializedLineNumberValue)
+ , m_scriptToProcessStartLine(uninitializedLineNumberValue)
+ , m_fragmentScriptingPermission(scriptingPermission)
+{
+}
+
+HTMLTreeBuilder::~HTMLTreeBuilder()
+{
+}
+
+static void convertToOldStyle(const AtomicHTMLToken& token, Token& oldStyleToken)
+{
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ case HTMLToken::DOCTYPE:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::EndOfFile:
+ ASSERT_NOT_REACHED();
+ notImplemented();
+ break;
+ case HTMLToken::StartTag:
+ case HTMLToken::EndTag: {
+ oldStyleToken.beginTag = (token.type() == HTMLToken::StartTag);
+ oldStyleToken.selfClosingTag = token.selfClosing();
+ oldStyleToken.tagName = token.name();
+ oldStyleToken.attrs = token.attributes();
+ break;
+ }
+ case HTMLToken::Comment:
+ oldStyleToken.tagName = commentAtom;
+ oldStyleToken.text = token.comment().impl();
+ break;
+ case HTMLToken::Character:
+ oldStyleToken.tagName = textAtom;
+ oldStyleToken.text = token.characters().impl();
+ break;
+ }
+}
+
+void HTMLTreeBuilder::handleScriptStartTag()
+{
+ notImplemented(); // The HTML frgment case?
+ m_tokenizer->setState(HTMLTokenizer::ScriptDataState);
+ notImplemented(); // Save insertion mode.
+}
+
+void HTMLTreeBuilder::handleScriptEndTag(Element* scriptElement, int scriptStartLine)
+{
+ ASSERT(!m_scriptToProcess); // Caller never called takeScriptToProcess!
+ ASSERT(m_scriptToProcessStartLine == uninitializedLineNumberValue); // Caller never called takeScriptToProcess!
+ notImplemented(); // Save insertion mode and insertion point?
+
+ // Pause ourselves so that parsing stops until the script can be processed by the caller.
+ m_isPaused = true;
+ m_scriptToProcess = scriptElement;
+ // Lexer line numbers are 0-based, ScriptSourceCode expects 1-based lines,
+ // so we convert here before passing the line number off to HTMLScriptRunner.
+ m_scriptToProcessStartLine = scriptStartLine + 1;
+}
+
+PassRefPtr<Element> HTMLTreeBuilder::takeScriptToProcess(int& scriptStartLine)
+{
+ // Unpause ourselves, callers may pause us again when processing the script.
+ // The HTML5 spec is written as though scripts are executed inside the tree
+ // builder. We pause the parser to exit the tree builder, and then resume
+ // before running scripts.
+ m_isPaused = false;
+ scriptStartLine = m_scriptToProcessStartLine;
+ m_scriptToProcessStartLine = uninitializedLineNumberValue;
+ return m_scriptToProcess.release();
+}
+
+HTMLTokenizer::State HTMLTreeBuilder::adjustedLexerState(HTMLTokenizer::State state, const AtomicString& tagName, Frame* frame)
+{
+ if (tagName == textareaTag || tagName == titleTag)
+ return HTMLTokenizer::RCDATAState;
+
+ if (tagName == styleTag || tagName == iframeTag || tagName == xmpTag || tagName == noembedTag
+ || tagName == noframesTag || (tagName == noscriptTag && isScriptingFlagEnabled(frame)))
+ return HTMLTokenizer::RAWTEXTState;
+
+ if (tagName == plaintextTag)
+ return HTMLTokenizer::PLAINTEXTState;
+
+ return state;
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::passTokenToLegacyParser(HTMLToken& token)
+{
+ if (token.type() == HTMLToken::DOCTYPE) {
+ DoctypeToken doctypeToken;
+ doctypeToken.m_name.append(token.name().data(), token.name().size());
+ doctypeToken.m_publicID = token.publicIdentifier();
+ doctypeToken.m_systemID = token.systemIdentifier();
+ doctypeToken.m_forceQuirks = token.forceQuirks();
+
+ m_legacyTreeBuilder->parseDoctypeToken(&doctypeToken);
+ return 0;
+ }
+
+ // For now, we translate into an old-style token for testing.
+ Token oldStyleToken;
+ AtomicHTMLToken atomicToken(token);
+ convertToOldStyle(atomicToken, oldStyleToken);
+
+ RefPtr<Node> result = m_legacyTreeBuilder->parseToken(&oldStyleToken);
+ if (token.type() == HTMLToken::StartTag) {
+ // This work is supposed to be done by the parser, but
+ // when using the old parser for we have to do this manually.
+ if (oldStyleToken.tagName == scriptTag) {
+ handleScriptStartTag();
+ m_lastScriptElement = static_pointer_cast<Element>(result);
+ m_lastScriptElementStartLine = m_tokenizer->lineNumber();
+ } else if (oldStyleToken.tagName == preTag || oldStyleToken.tagName == listingTag)
+ m_tokenizer->skipLeadingNewLineForListing();
+ else
+ m_tokenizer->setState(adjustedLexerState(m_tokenizer->state(), oldStyleToken.tagName, m_document->frame()));
+ } else if (token.type() == HTMLToken::EndTag) {
+ if (oldStyleToken.tagName == scriptTag) {
+ if (m_lastScriptElement) {
+ ASSERT(m_lastScriptElementStartLine != uninitializedLineNumberValue);
+ if (m_fragmentScriptingPermission == FragmentScriptingNotAllowed) {
+ // FIXME: This is a horrible hack for platform/Pasteboard.
+ // Clear the <script> tag when using the Parser to create
+ // a DocumentFragment for pasting so that javascript content
+ // does not show up in pasted HTML.
+ m_lastScriptElement->removeChildren();
+ } else if (insertionMode() != AfterFramesetMode)
+ handleScriptEndTag(m_lastScriptElement.get(), m_lastScriptElementStartLine);
+ m_lastScriptElement = 0;
+ m_lastScriptElementStartLine = uninitializedLineNumberValue;
+ }
+ } else if (oldStyleToken.tagName == framesetTag)
+ setInsertionMode(AfterFramesetMode);
+ }
+ return result.release();
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::constructTreeFromToken(HTMLToken& rawToken)
+{
+ // Make MSVC ignore our unreachable code for now.
+ if (true)
+ return passTokenToLegacyParser(rawToken);
+
+ AtomicHTMLToken token(rawToken);
+
+ // HTML5 expects the tokenizer to call the parser every time a character is
+ // emitted. We instead collect characters and call the parser with a batch.
+ // In order to make our first-pass parser code simple, processToken matches
+ // the spec in only handling one character at a time.
+ if (token.type() == HTMLToken::Character) {
+ StringImpl* characters = token.characters().impl();
+ // FIXME: Calling processToken for each character is probably slow.
+ for (unsigned i = 0; i < characters->length(); ++i)
+ processToken(token, (*characters)[i]);
+ return 0; // FIXME: Should we be returning the Text node?
+ }
+ return processToken(token);
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::processToken(AtomicHTMLToken& token, UChar cc)
+{
+reprocessToken:
+ switch (insertionMode()) {
+ case InitialMode: {
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::DOCTYPE:
+ return insertDoctype(token);
+ case HTMLToken::Comment:
+ return insertComment(token);
+ case HTMLToken::Character:
+ if (isTreeBuilderWhiteSpace(cc))
+ return 0;
+ break;
+ case HTMLToken::StartTag:
+ case HTMLToken::EndTag:
+ case HTMLToken::EndOfFile:
+ break;
+ }
+ notImplemented();
+ parseError(token);
+ setInsertionMode(BeforeHTMLMode);
+ goto reprocessToken;
+ }
+ case BeforeHTMLMode: {
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::DOCTYPE:
+ parseError(token);
+ return 0;
+ case HTMLToken::Comment:
+ return insertComment(token);
+ case HTMLToken::Character:
+ if (isTreeBuilderWhiteSpace(cc))
+ return 0;
+ break;
+ case HTMLToken::StartTag:
+ if (token.name() == htmlTag) {
+ notImplemented();
+ setInsertionMode(BeforeHeadMode);
+ return 0;
+ }
+ break;
+ case HTMLToken::EndTag:
+ if (token.name() == headTag || token.name() == bodyTag || token.name() == htmlTag || token.name() == brTag)
+ break;
+ parseError(token);
+ return 0;
+ case HTMLToken::EndOfFile:
+ break;
+ }
+ notImplemented();
+ setInsertionMode(BeforeHeadMode);
+ goto reprocessToken;
+ }
+ case BeforeHeadMode: {
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::Character:
+ if (isTreeBuilderWhiteSpace(cc))
+ return 0;
+ break;
+ case HTMLToken::Comment:
+ return insertComment(token);
+ case HTMLToken::DOCTYPE:
+ parseError(token);
+ return 0;
+ case HTMLToken::StartTag:
+ if (token.name() == htmlTag) {
+ notImplemented();
+ return 0;
+ }
+ if (token.name() == headTag) {
+ m_headElement = insertElement(token);
+ setInsertionMode(InHeadMode);
+ return m_headElement;
+ }
+ break;
+ case HTMLToken::EndTag:
+ if (token.name() == headTag || token.name() == bodyTag || token.name() == brTag) {
+ AtomicHTMLToken fakeHead(HTMLToken::StartTag, headTag.localName());
+ processToken(fakeHead);
+ goto reprocessToken;
+ }
+ parseError(token);
+ return 0;
+ case HTMLToken::EndOfFile:
+ break;
+ }
+ AtomicHTMLToken fakeHead(HTMLToken::StartTag, headTag.localName());
+ processToken(fakeHead);
+ goto reprocessToken;
+ }
+ case InHeadMode: {
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::Character:
+ insertCharacter(cc);
+ break;
+ case HTMLToken::Comment:
+ return insertComment(token);
+ case HTMLToken::DOCTYPE:
+ parseError(token);
+ return 0;
+ case HTMLToken::StartTag:
+ if (token.name() == htmlTag) {
+ notImplemented();
+ return 0;
+ }
+ // FIXME: Atomize "command".
+ if (token.name() == baseTag || token.name() == "command" || token.name() == linkTag) {
+ PassRefPtr<Node> node = insertElement(token);
+ m_openElements.pop();
+ notImplemented();
+ return node;
+ }
+ if (token.name() == metaTag) {
+ PassRefPtr<Node> node = insertElement(token);
+ m_openElements.pop();
+ notImplemented();
+ return node;
+ }
+ if (token.name() == titleTag)
+ return insertGenericRCDATAElement(token);
+ if (token.name() == noscriptTag) {
+ if (isScriptingFlagEnabled(m_document->frame()))
+ return insertGenericRawTextElement(token);
+ PassRefPtr<Node> node = insertElement(token);
+ setInsertionMode(InHeadNoscriptMode);
+ return node;
+ }
+ if (token.name() == noframesTag || token.name() == styleTag)
+ return insertGenericRawTextElement(token);
+ if (token.name() == scriptTag)
+ return insertScriptElement(token);
+ if (token.name() == headTag) {
+ notImplemented();
+ return 0;
+ }
+ break;
+ case HTMLToken::EndTag:
+ if (token.name() == headTag) {
+ ASSERT(m_openElements.top()->tagQName() == headTag);
+ m_openElements.pop();
+ setInsertionMode(AfterHeadMode);
+ return 0;
+ }
+ if (token.name() == bodyTag || token.name() == htmlTag || token.name() == brTag)
+ break;
+ parseError(token);
+ return 0;
+ break;
+ case HTMLToken::EndOfFile:
+ break;
+ }
+ AtomicHTMLToken fakeHead(HTMLToken::EndTag, headTag.localName());
+ processToken(fakeHead);
+ goto reprocessToken;
+ }
+ case InHeadNoscriptMode: {
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::DOCTYPE:
+ parseError(token);
+ return 0;
+ case HTMLToken::StartTag:
+ if (token.name() == htmlTag) {
+ notImplemented();
+ return 0;
+ }
+ if (token.name() == linkTag || token.name() == metaTag || token.name() == noframesTag || token.name() == styleTag) {
+ notImplemented();
+ return 0;
+ }
+ if (token.name() == htmlTag || token.name() == noscriptTag) {
+ parseError(token);
+ return 0;
+ }
+ break;
+ case HTMLToken::EndTag:
+ if (token.name() == noscriptTag) {
+ ASSERT(m_openElements.top()->tagQName() == noscriptTag);
+ m_openElements.pop();
+ ASSERT(m_openElements.top()->tagQName() == headTag);
+ setInsertionMode(InHeadMode);
+ return 0;
+ }
+ if (token.name() == brTag)
+ break;
+ parseError(token);
+ return 0;
+ case HTMLToken::Character:
+ notImplemented();
+ break;
+ case HTMLToken::Comment:
+ notImplemented();
+ return 0;
+ case HTMLToken::EndOfFile:
+ break;
+ }
+ AtomicHTMLToken fakeNoscript(HTMLToken::EndTag, noscriptTag.localName());
+ processToken(fakeNoscript);
+ goto reprocessToken;
+ }
+ case AfterHeadMode: {
+ switch (token.type()) {
+ case HTMLToken::Uninitialized:
+ ASSERT_NOT_REACHED();
+ break;
+ case HTMLToken::Character:
+ if (isTreeBuilderWhiteSpace(cc)) {
+ insertCharacter(cc);
+ return 0;
+ }
+ break;
+ case HTMLToken::Comment:
+ return insertComment(token);
+ case HTMLToken::DOCTYPE:
+ parseError(token);
+ return 0;
+ case HTMLToken::StartTag:
+ if (token.name() == htmlTag) {
+ notImplemented();
+ return 0;
+ }
+ if (token.name() == bodyTag) {
+ m_framesetOk = false;
+ return insertElement(token);
+ }
+ if (token.name() == framesetTag) {
+ PassRefPtr<Node> node = insertElement(token);
+ setInsertionMode(InFramesetMode);
+ return node;
+ }
+ if (token.name() == baseTag || token.name() == linkTag || token.name() == metaTag || token.name() == noframesTag || token.name() == scriptTag || token.name() == styleTag || token.name() == titleTag) {
+ parseError(token);
+ ASSERT(m_headElement);
+ m_openElements.push(m_headElement.get());
+ notImplemented();
+ m_openElements.remove(m_headElement.get());
+ }
+ if (token.name() == headTag) {
+ parseError(token);
+ return 0;
+ }
+ break;
+ case HTMLToken::EndTag:
+ if (token.name() == bodyTag || token.name() == htmlTag || token.name() == brTag)
+ break;
+ parseError(token);
+ return 0;
+ case HTMLToken::EndOfFile:
+ break;
+ }
+ AtomicHTMLToken fakeBody(HTMLToken::StartTag, bodyTag.localName());
+ processToken(fakeBody);
+ m_framesetOk = true;
+ goto reprocessToken;
+ }
+ case InBodyMode:
+ case TextMode:
+ case InTableMode:
+ case InTableTextMode:
+ case InCaptionMode:
+ case InColumnGroupMode:
+ case InTableBodyMode:
+ case InRowMode:
+ case InCellMode:
+ case InSelectMode:
+ case InSelectInTableMode:
+ case InForeignContentMode:
+ case AfterBodyMode:
+ case InFramesetMode:
+ case AfterFramesetMode:
+ case AfterAfterBodyMode:
+ case AfterAfterFramesetMode:
+ ASSERT_NOT_REACHED();
+ }
+
+ // Implementation coming in the next patch.
+ return 0;
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::insertDoctype(AtomicHTMLToken& token)
+{
+ ASSERT_UNUSED(token, token.type() == HTMLToken::DOCTYPE);
+ return 0;
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::insertComment(AtomicHTMLToken& token)
+{
+ ASSERT_UNUSED(token, token.type() == HTMLToken::Comment);
+ return 0;
+}
+
+PassRefPtr<Element> HTMLTreeBuilder::insertElement(AtomicHTMLToken& token)
+{
+ ASSERT_UNUSED(token, token.type() == HTMLToken::StartTag);
+ return 0;
+}
+
+void HTMLTreeBuilder::insertCharacter(UChar cc)
+{
+ ASSERT_UNUSED(cc, cc);
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::insertGenericRCDATAElement(AtomicHTMLToken& token)
+{
+ ASSERT_UNUSED(token, token.type() == HTMLToken::StartTag);
+ return 0;
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::insertGenericRawTextElement(AtomicHTMLToken& token)
+{
+ ASSERT_UNUSED(token, token.type() == HTMLToken::StartTag);
+ return 0;
+}
+
+PassRefPtr<Node> HTMLTreeBuilder::insertScriptElement(AtomicHTMLToken& token)
+{
+ ASSERT_UNUSED(token, token.type() == HTMLToken::StartTag);
+ return 0;
+}
+
+void HTMLTreeBuilder::finished()
+{
+ // We should call m_document->finishedParsing() here, except
+ // m_legacyTreeBuilder->finished() does it for us.
+ m_legacyTreeBuilder->finished();
+}
+
+bool HTMLTreeBuilder::isScriptingFlagEnabled(Frame* frame)
+{
+ if (!frame)
+ return false;
+ if (ScriptController* scriptController = frame->script())
+ return scriptController->canExecuteScripts(NotAboutToExecuteScript);
+ return false;
+}
+
+}
diff --git a/WebCore/html/HTML5TreeBuilder.h b/WebCore/html/HTMLTreeBuilder.h
index a61bb7f..76360ae 100644
--- a/WebCore/html/HTML5TreeBuilder.h
+++ b/WebCore/html/HTMLTreeBuilder.h
@@ -23,9 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef HTML5TreeBuilder_h
-#define HTML5TreeBuilder_h
+#ifndef HTMLTreeBuilder_h
+#define HTMLTreeBuilder_h
+#include "FragmentScriptingPermission.h"
+#include "HTMLTokenizer.h"
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -33,65 +35,116 @@
#include <wtf/unicode/Unicode.h>
namespace WebCore {
+
+class AtomicHTMLToken;
class Document;
+class DocumentFragment;
class Element;
class Frame;
-class HTML5Lexer;
-class HTML5Token;
+class HTMLToken;
class HTMLDocument;
-class LegacyHTMLTreeConstructor;
+class LegacyHTMLTreeBuilder;
class Node;
-class HTML5TreeBuilder : public Noncopyable {
+class HTMLTreeBuilder : public Noncopyable {
public:
- HTML5TreeBuilder(HTML5Lexer*, HTMLDocument*, bool reportErrors);
- ~HTML5TreeBuilder();
+ // FIXME: Replace constructors with create() functions returning PassOwnPtrs
+ HTMLTreeBuilder(HTMLTokenizer*, HTMLDocument*, bool reportErrors);
+ HTMLTreeBuilder(HTMLTokenizer*, DocumentFragment*, FragmentScriptingPermission);
+ ~HTMLTreeBuilder();
void setPaused(bool paused) { m_isPaused = paused; }
- bool isPaused() { return m_isPaused; }
+ bool isPaused() const { return m_isPaused; }
// The token really should be passed as a const& since it's never modified.
- PassRefPtr<Node> constructTreeFromToken(HTML5Token&);
+ PassRefPtr<Node> constructTreeFromToken(HTMLToken&);
// Must be called when parser is paused before calling the parser again.
PassRefPtr<Element> takeScriptToProcess(int& scriptStartLine);
// Done, close any open tags, etc.
void finished();
+ static HTMLTokenizer::State adjustedLexerState(HTMLTokenizer::State, const AtomicString& tagName, Frame*);
+
// FIXME: This is a dirty, rotten hack to keep HTMLFormControlElement happy
// until we stop using the legacy parser. DO NOT CALL THIS METHOD.
- LegacyHTMLTreeConstructor* legacyTreeConstructor() const { return m_legacyTreeConstructor.get(); }
+ LegacyHTMLTreeBuilder* legacyTreeBuilder() const { return m_legacyTreeBuilder.get(); }
private:
// Represents HTML5 "insertion mode"
- // http://www.w3.org/TR/html5/syntax.html#insertion-mode
- // FIXME: Implement remainder of states.
+ // http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#insertion-mode
enum InsertionMode {
- Initial,
- AfterFrameset,
+ InitialMode,
+ BeforeHTMLMode,
+ BeforeHeadMode,
+ InHeadMode,
+ InHeadNoscriptMode,
+ AfterHeadMode,
+ InBodyMode,
+ TextMode,
+ InTableMode,
+ InTableTextMode,
+ InCaptionMode,
+ InColumnGroupMode,
+ InTableBodyMode,
+ InRowMode,
+ InCellMode,
+ InSelectMode,
+ InSelectInTableMode,
+ InForeignContentMode,
+ AfterBodyMode,
+ InFramesetMode,
+ AfterFramesetMode,
+ AfterAfterBodyMode,
+ AfterAfterFramesetMode,
};
- PassRefPtr<Node> passTokenToLegacyParser(HTML5Token&);
- PassRefPtr<Node> processToken(HTML5Token&, UChar currentCharacter = 0);
-
+ class ElementStack : public Noncopyable {
+ public:
+ void pop() { }
+ void push(Element*) { }
+ void remove(Element*) { }
+ Element* top() const { return 0; }
+ };
+
+ PassRefPtr<Node> passTokenToLegacyParser(HTMLToken&);
+ PassRefPtr<Node> processToken(AtomicHTMLToken&, UChar cc = 0);
+
+ PassRefPtr<Node> insertDoctype(AtomicHTMLToken&);
+ PassRefPtr<Node> insertComment(AtomicHTMLToken&);
+ PassRefPtr<Element> insertElement(AtomicHTMLToken&);
+ void insertCharacter(UChar cc);
+ PassRefPtr<Node> insertGenericRCDATAElement(AtomicHTMLToken&);
+ PassRefPtr<Node> insertGenericRawTextElement(AtomicHTMLToken&);
+ PassRefPtr<Node> insertScriptElement(AtomicHTMLToken&);
+
+ RefPtr<Element> m_headElement;
+ ElementStack m_openElements;
+ bool m_framesetOk;
+
+ // FIXME: Implement error reporting.
+ void parseError(AtomicHTMLToken&) { }
+
void handleScriptStartTag();
void handleScriptEndTag(Element*, int scriptStartLine);
void setInsertionMode(InsertionMode value) { m_insertionMode = value; }
InsertionMode insertionMode() const { return m_insertionMode; }
+ static bool isScriptingFlagEnabled(Frame* frame);
+
Document* m_document; // This is only used by the m_legacyParser for now.
bool m_reportErrors;
bool m_isPaused;
InsertionMode m_insertionMode;
- // HTML5 spec requires that we be able to change the state of the lexer
+ // HTML5 spec requires that we be able to change the state of the tokenizer
// from within parser actions.
- HTML5Lexer* m_lexer;
+ HTMLTokenizer* m_tokenizer;
- // We're re-using logic from the old LegacyHTMLTreeConstructor while this class is being written.
- OwnPtr<LegacyHTMLTreeConstructor> m_legacyTreeConstructor;
+ // We're re-using logic from the old LegacyHTMLTreeBuilder while this class is being written.
+ OwnPtr<LegacyHTMLTreeBuilder> m_legacyTreeBuilder;
// These members are intentionally duplicated as the first set is a hack
// on top of the legacy parser which will eventually be removed.
@@ -100,6 +153,11 @@ private:
RefPtr<Element> m_scriptToProcess; // <script> tag which needs processing before resuming the parser.
int m_scriptToProcessStartLine; // Starting line number of the script tag needing processing.
+
+ // FIXME: FragmentScriptingPermission is a HACK for platform/Pasteboard.
+ // FragmentScriptingNotAllowed causes the Parser to remove children
+ // from <script> tags (so javascript doesn't show up in pastes).
+ FragmentScriptingPermission m_fragmentScriptingPermission;
};
}
diff --git a/WebCore/html/HTMLUListElement.cpp b/WebCore/html/HTMLUListElement.cpp
index fcc20bc..e022ba9 100644
--- a/WebCore/html/HTMLUListElement.cpp
+++ b/WebCore/html/HTMLUListElement.cpp
@@ -39,12 +39,12 @@ HTMLUListElement::HTMLUListElement(const QualifiedName& tagName, Document* docum
PassRefPtr<HTMLUListElement> HTMLUListElement::create(Document* document)
{
- return new HTMLUListElement(ulTag, document);
+ return adoptRef(new HTMLUListElement(ulTag, document));
}
PassRefPtr<HTMLUListElement> HTMLUListElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLUListElement(tagName, document);
+ return adoptRef(new HTMLUListElement(tagName, document));
}
bool HTMLUListElement::mapToEntry(const QualifiedName& attrName, MappedAttributeEntry& result) const
diff --git a/WebCore/html/HTMLUListElement.idl b/WebCore/html/HTMLUListElement.idl
index 38434f1..f6d3b78 100644
--- a/WebCore/html/HTMLUListElement.idl
+++ b/WebCore/html/HTMLUListElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -21,7 +21,7 @@ module html {
interface HTMLUListElement : HTMLElement {
attribute boolean compact;
- attribute [ConvertNullToNullString] DOMString type;
+ attribute [Reflect] DOMString type;
};
}
diff --git a/WebCore/html/HTMLVideoElement.cpp b/WebCore/html/HTMLVideoElement.cpp
index 0389b54..9fd1a09 100644
--- a/WebCore/html/HTMLVideoElement.cpp
+++ b/WebCore/html/HTMLVideoElement.cpp
@@ -54,7 +54,7 @@ inline HTMLVideoElement::HTMLVideoElement(const QualifiedName& tagName, Document
PassRefPtr<HTMLVideoElement> HTMLVideoElement::create(const QualifiedName& tagName, Document* document)
{
- return new HTMLVideoElement(tagName, document);
+ return adoptRef(new HTMLVideoElement(tagName, document));
}
bool HTMLVideoElement::rendererIsNeeded(RenderStyle* style)
@@ -177,9 +177,10 @@ void HTMLVideoElement::setPoster(const String& value)
setAttribute(posterAttr, value);
}
-bool HTMLVideoElement::isURLAttribute(Attribute* attr) const
+bool HTMLVideoElement::isURLAttribute(Attribute* attribute) const
{
- return attr->name() == posterAttr;
+ return HTMLMediaElement::isURLAttribute(attribute)
+ || attribute->name() == posterAttr;
}
const QualifiedName& HTMLVideoElement::imageSourceAttributeName() const
@@ -258,4 +259,5 @@ void HTMLVideoElement::willMoveToNewOwnerDocument()
}
}
+
#endif
diff --git a/WebCore/html/HTMLVideoElement.idl b/WebCore/html/HTMLVideoElement.idl
index 953e447..1f56db9 100644
--- a/WebCore/html/HTMLVideoElement.idl
+++ b/WebCore/html/HTMLVideoElement.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,22 +28,19 @@ module html {
Conditional=VIDEO,
GenerateNativeConverter
] HTMLVideoElement : HTMLMediaElement {
- attribute unsigned long width;
- attribute unsigned long height;
+ attribute [Reflect] unsigned long width;
+ attribute [Reflect] unsigned long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
- attribute [ConvertNullToNullString] DOMString poster;
+ attribute [ReflectURL] DOMString poster;
readonly attribute boolean webkitSupportsFullscreen;
readonly attribute boolean webkitDisplayingFullscreen;
- [NeedsUserGestureCheck] void webkitEnterFullscreen()
- raises (DOMException);
+ [NeedsUserGestureCheck] void webkitEnterFullscreen() raises (DOMException);
void webkitExitFullscreen();
- [NeedsUserGestureCheck] void webkitEnterFullScreen()
- raises (DOMException);
+ [NeedsUserGestureCheck] void webkitEnterFullScreen() raises (DOMException);
void webkitExitFullScreen();
-
};
}
diff --git a/WebCore/html/HTMLViewSourceDocument.cpp b/WebCore/html/HTMLViewSourceDocument.cpp
index 5391ddc..f66703a 100644
--- a/WebCore/html/HTMLViewSourceDocument.cpp
+++ b/WebCore/html/HTMLViewSourceDocument.cpp
@@ -36,7 +36,7 @@
#include "HTMLTableElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLTableSectionElement.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
#include "Text.h"
#include "TextDocument.h"
@@ -44,8 +44,8 @@ namespace WebCore {
using namespace HTMLNames;
-HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const String& mimeType)
- : HTMLDocument(frame)
+HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const KURL& url, const String& mimeType)
+ : HTMLDocument(frame, url)
, m_type(mimeType)
{
setUsesBeforeAfterRules(true);
@@ -53,14 +53,14 @@ HTMLViewSourceDocument::HTMLViewSourceDocument(Frame* frame, const String& mimeT
DocumentParser* HTMLViewSourceDocument::createParser()
{
- // Use HTMLDocumentParser if applicable, otherwise use TextDocumentParser.
+ // Use LegacyHTMLDocumentParser if applicable, otherwise use TextDocumentParser.
if (m_type == "text/html" || m_type == "application/xhtml+xml" || m_type == "image/svg+xml" || DOMImplementation::isXMLMIMEType(m_type)
#if ENABLE(XHTMLMP)
|| m_type == "application/vnd.wap.xhtml+xml"
#endif
) {
// FIXME: Should respect Settings::html5ParserEnabled()
- return new HTMLDocumentParser(this);
+ return new LegacyHTMLDocumentParser(this);
}
return createTextDocumentParser(this);
@@ -157,7 +157,7 @@ void HTMLViewSourceDocument::addViewSourceToken(Token* token)
} else {
const String& value = attr->value().string();
- // Compare ignoring case since HTMLDocumentParser doesn't
+ // Compare ignoring case since LegacyHTMLDocumentParser doesn't
// lower names when passing in tokens to
// HTMLViewSourceDocument.
if (equalIgnoringCase(token->tagName, "base") && equalIgnoringCase(attr->name().localName(), "href")) {
diff --git a/WebCore/html/HTMLViewSourceDocument.h b/WebCore/html/HTMLViewSourceDocument.h
index 7de7f31..cf6cfc1 100644
--- a/WebCore/html/HTMLViewSourceDocument.h
+++ b/WebCore/html/HTMLViewSourceDocument.h
@@ -37,19 +37,19 @@ struct Token;
class HTMLViewSourceDocument : public HTMLDocument {
public:
- static PassRefPtr<HTMLViewSourceDocument> create(Frame* frame, const String& mimeType)
+ static PassRefPtr<HTMLViewSourceDocument> create(Frame* frame, const KURL& url, const String& mimeType)
{
- return adoptRef(new HTMLViewSourceDocument(frame, mimeType));
+ return adoptRef(new HTMLViewSourceDocument(frame, url, mimeType));
}
- void addViewSourceToken(Token*); // Used by the HTMLDocumentParser.
+ void addViewSourceToken(Token*); // Used by the LegacyHTMLDocumentParser.
void addViewSourceText(const String&); // Used by the TextDocumentParser.
void addViewSourceDoctypeToken(DoctypeToken*);
private:
- HTMLViewSourceDocument(Frame*, const String& mimeType);
+ HTMLViewSourceDocument(Frame*, const KURL&, const String& mimeType);
- // Returns HTMLDocumentParser or TextDocumentParser based on m_type.
+ // Returns LegacyHTMLDocumentParser or TextDocumentParser based on m_type.
virtual DocumentParser* createParser();
void createContainingTable();
diff --git a/WebCore/html/LegacyHTMLDocumentParser.cpp b/WebCore/html/LegacyHTMLDocumentParser.cpp
new file mode 100644
index 0000000..38c8a75
--- /dev/null
+++ b/WebCore/html/LegacyHTMLDocumentParser.cpp
@@ -0,0 +1,2106 @@
+/*
+ Copyright (C) 1997 Martin Jones (mjones@kde.org)
+ (C) 1997 Torben Weis (weis@kde.org)
+ (C) 1998 Waldo Bastian (bastian@kde.org)
+ (C) 1999 Lars Knoll (knoll@kde.org)
+ (C) 1999 Antti Koivisto (koivisto@kde.org)
+ (C) 2001 Dirk Mueller (mueller@kde.org)
+ Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ Copyright (C) 2005, 2006 Alexey Proskuryakov (ap@nypop.com)
+ Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "LegacyHTMLDocumentParser.h"
+
+#include "Attribute.h"
+#include "CSSHelper.h"
+#include "Cache.h"
+#include "CachedScript.h"
+#include "DocLoader.h"
+#include "DocumentFragment.h"
+#include "Event.h"
+#include "EventNames.h"
+#include "Frame.h"
+#include "FrameLoader.h"
+#include "FrameView.h"
+#include "HTMLElement.h"
+#include "HTMLNames.h"
+#include "LegacyHTMLTreeBuilder.h"
+#include "HTMLScriptElement.h"
+#include "HTMLViewSourceDocument.h"
+#include "ImageLoader.h"
+#include "InspectorTimelineAgent.h"
+#include "Page.h"
+#include "LegacyPreloadScanner.h"
+#include "ScriptSourceCode.h"
+#include "ScriptValue.h"
+#include "XSSAuditor.h"
+#include <wtf/ASCIICType.h>
+#include <wtf/CurrentTime.h>
+
+#include "HTMLEntityNames.cpp"
+
+#define PRELOAD_SCANNER_ENABLED 1
+
+using namespace WTF;
+using namespace std;
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+// This value is used to define how many loops (approximately tokens)
+// the parser will make before checking if it should yield.
+// To increase responsiveness reduce both ChunkSize and TimeDelay contants.
+static const int defaultTokenizerChunkSize = 4096;
+
+// FIXME: We would like this constant to be 200ms.
+// Yielding more aggressively results in increased responsiveness and better incremental rendering.
+// It slows down overall page-load on slower machines, though, so for now we set a value of 500.
+// TimeDelay controls the maximum time the parser will run before yielding.
+// Inline script execution can cause the parser to excede this limit.
+static const double defaultTokenizerTimeDelay = 0.500;
+
+static const char commentStart [] = "<!--";
+static const char doctypeStart [] = "<!doctype";
+static const char publicStart [] = "public";
+static const char systemStart [] = "system";
+static const char scriptEnd [] = "</script";
+static const char xmpEnd [] = "</xmp";
+static const char styleEnd [] = "</style";
+static const char textareaEnd [] = "</textarea";
+static const char titleEnd [] = "</title";
+static const char iframeEnd [] = "</iframe";
+
+// Full support for MS Windows extensions to Latin-1.
+// Technically these extensions should only be activated for pages
+// marked "windows-1252" or "cp1252", but
+// in the standard Microsoft way, these extensions infect hundreds of thousands
+// of web pages. Note that people with non-latin-1 Microsoft extensions
+// are SOL.
+//
+// See: http://www.microsoft.com/globaldev/reference/WinCP.asp
+// http://www.bbsinc.com/iso8859.html
+// http://www.obviously.com/
+//
+// There may be better equivalents
+
+// We only need this for entities. For non-entity text, we handle this in the text encoding.
+
+static const UChar windowsLatin1ExtensionArray[32] = {
+ 0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, // 80-87
+ 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F, // 88-8F
+ 0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, // 90-97
+ 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178 // 98-9F
+};
+
+static inline UChar fixUpChar(UChar c)
+{
+ if ((c & ~0x1F) != 0x0080)
+ return c;
+ return windowsLatin1ExtensionArray[c - 0x80];
+}
+
+static inline bool tagMatch(const char* s1, const UChar* s2, unsigned length)
+{
+ for (unsigned i = 0; i != length; ++i) {
+ unsigned char c1 = s1[i];
+ unsigned char uc1 = toASCIIUpper(static_cast<char>(c1));
+ UChar c2 = s2[i];
+ if (c1 != c2 && uc1 != c2)
+ return false;
+ }
+ return true;
+}
+
+inline void Token::addAttribute(AtomicString& attrName, const AtomicString& attributeValue, bool viewSourceMode)
+{
+ if (!attrName.isEmpty()) {
+ ASSERT(!attrName.contains('/'));
+ RefPtr<Attribute> a = Attribute::createMapped(attrName, attributeValue);
+ if (!attrs) {
+ attrs = NamedNodeMap::create();
+ attrs->reserveInitialCapacity(10);
+ }
+ attrs->insertAttribute(a.release(), viewSourceMode);
+ }
+
+ attrName = emptyAtom;
+}
+
+// ----------------------------------------------------------------------------
+
+LegacyHTMLDocumentParser::LegacyHTMLDocumentParser(HTMLDocument* document, bool reportErrors)
+ : DocumentParser(document)
+ , m_buffer(0)
+ , m_scriptCode(0)
+ , m_scriptCodeSize(0)
+ , m_scriptCodeCapacity(0)
+ , m_scriptCodeResync(0)
+ , m_executingScript(0)
+ , m_requestingScript(false)
+ , m_hasScriptsWaitingForStylesheets(false)
+ , m_timer(this, &LegacyHTMLDocumentParser::timerFired)
+ , m_externalScriptsTimer(this, &LegacyHTMLDocumentParser::executeExternalScriptsTimerFired)
+ , m_treeBuilder(new LegacyHTMLTreeBuilder(document, reportErrors))
+ , m_inWrite(false)
+ , m_fragment(false)
+ , m_scriptingPermission(FragmentScriptingAllowed)
+{
+ begin();
+}
+
+LegacyHTMLDocumentParser::LegacyHTMLDocumentParser(HTMLViewSourceDocument* document)
+ : DocumentParser(document, true)
+ , m_buffer(0)
+ , m_scriptCode(0)
+ , m_scriptCodeSize(0)
+ , m_scriptCodeCapacity(0)
+ , m_scriptCodeResync(0)
+ , m_executingScript(0)
+ , m_requestingScript(false)
+ , m_hasScriptsWaitingForStylesheets(false)
+ , m_timer(this, &LegacyHTMLDocumentParser::timerFired)
+ , m_externalScriptsTimer(this, &LegacyHTMLDocumentParser::executeExternalScriptsTimerFired)
+ , m_inWrite(false)
+ , m_fragment(false)
+ , m_scriptingPermission(FragmentScriptingAllowed)
+{
+ begin();
+}
+
+LegacyHTMLDocumentParser::LegacyHTMLDocumentParser(DocumentFragment* frag, FragmentScriptingPermission scriptingPermission)
+ : DocumentParser(frag->document())
+ , m_buffer(0)
+ , m_scriptCode(0)
+ , m_scriptCodeSize(0)
+ , m_scriptCodeCapacity(0)
+ , m_scriptCodeResync(0)
+ , m_executingScript(0)
+ , m_requestingScript(false)
+ , m_hasScriptsWaitingForStylesheets(false)
+ , m_timer(this, &LegacyHTMLDocumentParser::timerFired)
+ , m_externalScriptsTimer(this, &LegacyHTMLDocumentParser::executeExternalScriptsTimerFired)
+ , m_treeBuilder(new LegacyHTMLTreeBuilder(frag, scriptingPermission))
+ , m_inWrite(false)
+ , m_fragment(true)
+ , m_scriptingPermission(scriptingPermission)
+{
+ begin();
+}
+
+void LegacyHTMLDocumentParser::reset()
+{
+ ASSERT(m_executingScript == 0);
+
+ while (!m_pendingScripts.isEmpty()) {
+ CachedResourceHandle<CachedScript> cs = m_pendingScripts.takeFirst();
+ ASSERT(cache()->disabled() || cs->accessCount() > 0);
+ cs->removeClient(this);
+ }
+
+ fastFree(m_buffer);
+ m_buffer = m_dest = 0;
+ m_bufferSize = 0;
+
+ fastFree(m_scriptCode);
+ m_scriptCode = 0;
+ m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
+
+ m_timer.stop();
+ m_externalScriptsTimer.stop();
+
+ m_state.setAllowYield(false);
+ m_state.setForceSynchronous(false);
+
+ m_currentToken.reset();
+ m_doctypeToken.reset();
+ m_doctypeSearchCount = 0;
+ m_doctypeSecondarySearchCount = 0;
+ m_hasScriptsWaitingForStylesheets = false;
+}
+
+void LegacyHTMLDocumentParser::begin()
+{
+ m_executingScript = 0;
+ m_requestingScript = false;
+ m_hasScriptsWaitingForStylesheets = false;
+ m_state.setLoadingExtScript(false);
+ reset();
+ m_bufferSize = 254;
+ m_buffer = static_cast<UChar*>(fastMalloc(sizeof(UChar) * 254));
+ m_dest = m_buffer;
+ tquote = NoQuote;
+ searchCount = 0;
+ m_state.setEntityState(NoEntity);
+ m_scriptTagSrcAttrValue = String();
+ m_pendingSrc.clear();
+ m_currentPrependingSrc = 0;
+ m_noMoreData = false;
+ m_brokenComments = false;
+ m_brokenServer = false;
+ m_lineNumber = 0;
+ m_currentScriptTagStartLineNumber = 0;
+ m_currentTagStartLineNumber = 0;
+ m_state.setForceSynchronous(false);
+
+ Page* page = document()->page();
+ if (page && page->hasCustomHTMLTokenizerTimeDelay())
+ m_tokenizerTimeDelay = page->customHTMLTokenizerTimeDelay();
+ else
+ m_tokenizerTimeDelay = defaultTokenizerTimeDelay;
+
+ if (page && page->hasCustomHTMLTokenizerChunkSize())
+ m_tokenizerChunkSize = page->customHTMLTokenizerChunkSize();
+ else
+ m_tokenizerChunkSize = defaultTokenizerChunkSize;
+}
+
+void LegacyHTMLDocumentParser::setForceSynchronous(bool force)
+{
+ m_state.setForceSynchronous(force);
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::processListing(SegmentedString list, State state)
+{
+ // This function adds the listing 'list' as
+ // preformatted text-tokens to the token-collection
+ while (!list.isEmpty()) {
+ if (state.skipLF()) {
+ state.setSkipLF(false);
+ if (*list == '\n') {
+ list.advance();
+ continue;
+ }
+ }
+
+ checkBuffer();
+
+ if (*list == '\n' || *list == '\r') {
+ if (state.discardLF())
+ // Ignore this LF
+ state.setDiscardLF(false); // We have discarded 1 LF
+ else
+ *m_dest++ = '\n';
+
+ /* Check for MS-DOS CRLF sequence */
+ if (*list == '\r')
+ state.setSkipLF(true);
+
+ list.advance();
+ } else {
+ state.setDiscardLF(false);
+ *m_dest++ = *list;
+ list.advance();
+ }
+ }
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseNonHTMLText(SegmentedString& src, State state)
+{
+ ASSERT(state.inTextArea() || state.inTitle() || state.inIFrame() || !state.hasEntityState());
+ ASSERT(!state.hasTagState());
+ ASSERT(state.inXmp() + state.inTextArea() + state.inTitle() + state.inStyle() + state.inScript() + state.inIFrame() == 1);
+ if (state.inScript() && !m_currentScriptTagStartLineNumber)
+ m_currentScriptTagStartLineNumber = m_lineNumber;
+
+ if (state.inComment())
+ state = parseComment(src, state);
+
+ int lastDecodedEntityPosition = -1;
+ while (!src.isEmpty()) {
+ checkScriptBuffer();
+ UChar ch = *src;
+
+ if (!m_scriptCodeResync && !m_brokenComments &&
+ !state.inXmp() && ch == '-' && m_scriptCodeSize >= 3 && !src.escaped() &&
+ m_scriptCode[m_scriptCodeSize - 3] == '<' && m_scriptCode[m_scriptCodeSize - 2] == '!' && m_scriptCode[m_scriptCodeSize - 1] == '-' &&
+ (lastDecodedEntityPosition < m_scriptCodeSize - 3)) {
+ state.setInComment(true);
+ state = parseComment(src, state);
+ continue;
+ }
+ if (m_scriptCodeResync && !tquote && ch == '>') {
+ src.advancePastNonNewline();
+ m_scriptCodeSize = m_scriptCodeResync - 1;
+ m_scriptCodeResync = 0;
+ m_scriptCode[m_scriptCodeSize] = m_scriptCode[m_scriptCodeSize + 1] = 0;
+ if (state.inScript())
+ state = scriptHandler(state);
+ else {
+ state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize), state);
+ processToken();
+ if (state.inStyle()) {
+ m_currentToken.tagName = styleTag.localName();
+ m_currentToken.beginTag = false;
+ } else if (state.inTextArea()) {
+ m_currentToken.tagName = textareaTag.localName();
+ m_currentToken.beginTag = false;
+ } else if (state.inTitle()) {
+ m_currentToken.tagName = titleTag.localName();
+ m_currentToken.beginTag = false;
+ } else if (state.inXmp()) {
+ m_currentToken.tagName = xmpTag.localName();
+ m_currentToken.beginTag = false;
+ } else if (state.inIFrame()) {
+ m_currentToken.tagName = iframeTag.localName();
+ m_currentToken.beginTag = false;
+ }
+ processToken();
+ state.setInStyle(false);
+ state.setInScript(false);
+ state.setInTextArea(false);
+ state.setInTitle(false);
+ state.setInXmp(false);
+ state.setInIFrame(false);
+ tquote = NoQuote;
+ m_scriptCodeSize = m_scriptCodeResync = 0;
+ }
+ return state;
+ }
+ // possible end of tagname, lets check.
+ if (!m_scriptCodeResync && !state.escaped() && !src.escaped() && (ch == '>' || ch == '/' || isASCIISpace(ch)) &&
+ m_scriptCodeSize >= m_searchStopperLength &&
+ tagMatch(m_searchStopper, m_scriptCode + m_scriptCodeSize - m_searchStopperLength, m_searchStopperLength) &&
+ (lastDecodedEntityPosition < m_scriptCodeSize - m_searchStopperLength)) {
+ m_scriptCodeResync = m_scriptCodeSize-m_searchStopperLength+1;
+ tquote = NoQuote;
+ continue;
+ }
+ if (m_scriptCodeResync && !state.escaped()) {
+ if (ch == '\"')
+ tquote = (tquote == NoQuote) ? DoubleQuote : ((tquote == SingleQuote) ? SingleQuote : NoQuote);
+ else if (ch == '\'')
+ tquote = (tquote == NoQuote) ? SingleQuote : (tquote == DoubleQuote) ? DoubleQuote : NoQuote;
+ else if (tquote != NoQuote && (ch == '\r' || ch == '\n'))
+ tquote = NoQuote;
+ }
+ state.setEscaped(!state.escaped() && ch == '\\');
+ if (!m_scriptCodeResync && (state.inTextArea() || state.inTitle() || state.inIFrame()) && !src.escaped() && ch == '&') {
+ UChar* scriptCodeDest = m_scriptCode + m_scriptCodeSize;
+ src.advancePastNonNewline();
+ state = parseEntity(src, scriptCodeDest, state, m_cBufferPos, true, false);
+ if (scriptCodeDest == m_scriptCode + m_scriptCodeSize)
+ lastDecodedEntityPosition = m_scriptCodeSize;
+ else
+ m_scriptCodeSize = scriptCodeDest - m_scriptCode;
+ } else {
+ m_scriptCode[m_scriptCodeSize++] = ch;
+ src.advance(m_lineNumber);
+ }
+ }
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::scriptHandler(State state)
+{
+ // We are inside a <script>
+ bool doScriptExec = false;
+ int startLine = m_currentScriptTagStartLineNumber + 1; // Script line numbers are 1 based, HTMLTokenzier line numbers are 0 based
+
+ // Reset m_currentScriptTagStartLineNumber to indicate that we've finished parsing the current script element
+ m_currentScriptTagStartLineNumber = 0;
+
+ // (Bugzilla 3837) Scripts following a frameset element should not execute or,
+ // in the case of extern scripts, even load.
+ bool followingFrameset = (document()->body() && document()->body()->hasTagName(framesetTag));
+
+ CachedScript* cs = 0;
+ // don't load external scripts for standalone documents (for now)
+ if (!inViewSourceMode()) {
+ if (!m_scriptTagSrcAttrValue.isEmpty() && document()->frame()) {
+ // forget what we just got; load from src url instead
+ if (!m_treeBuilder->skipMode() && !followingFrameset) {
+ // The parser might have been stopped by for example a window.close call in an earlier script.
+ // If so, we don't want to load scripts.
+ if (!m_parserStopped && m_scriptNode->dispatchBeforeLoadEvent(m_scriptTagSrcAttrValue) &&
+ (cs = document()->docLoader()->requestScript(m_scriptTagSrcAttrValue, m_scriptTagCharsetAttrValue)))
+ m_pendingScripts.append(cs);
+ else
+ m_scriptNode = 0;
+ } else
+ m_scriptNode = 0;
+ m_scriptTagSrcAttrValue = String();
+ } else {
+ // Parse m_scriptCode containing <script> info
+ doScriptExec = m_scriptNode->shouldExecuteAsJavaScript();
+#if ENABLE(XHTMLMP)
+ if (!doScriptExec)
+ document()->setShouldProcessNoscriptElement(true);
+#endif
+ m_scriptNode = 0;
+ }
+ }
+
+ state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize), state);
+ RefPtr<Node> node = processToken();
+
+ if (node && m_scriptingPermission == FragmentScriptingNotAllowed) {
+ ExceptionCode ec;
+ node->remove(ec);
+ node = 0;
+ }
+
+ String scriptString = node ? node->textContent() : "";
+ m_currentToken.tagName = scriptTag.localName();
+ m_currentToken.beginTag = false;
+ processToken();
+
+ state.setInScript(false);
+ m_scriptCodeSize = m_scriptCodeResync = 0;
+
+ // FIXME: The script should be syntax highlighted.
+ if (inViewSourceMode())
+ return state;
+
+ SegmentedString* savedPrependingSrc = m_currentPrependingSrc;
+ SegmentedString prependingSrc;
+ m_currentPrependingSrc = &prependingSrc;
+
+ if (!m_treeBuilder->skipMode() && !followingFrameset) {
+ if (cs) {
+ if (savedPrependingSrc)
+ savedPrependingSrc->append(m_src);
+ else
+ m_pendingSrc.prepend(m_src);
+ setSrc(SegmentedString());
+
+ // the ref() call below may call notifyFinished if the script is already in cache,
+ // and that mucks with the state directly, so we must write it back to the object.
+ m_state = state;
+ bool savedRequestingScript = m_requestingScript;
+ m_requestingScript = true;
+ cs->addClient(this);
+ m_requestingScript = savedRequestingScript;
+ state = m_state;
+ // will be 0 if script was already loaded and ref() executed it
+ if (!m_pendingScripts.isEmpty())
+ state.setLoadingExtScript(true);
+ } else if (!m_fragment && doScriptExec) {
+ if (!m_executingScript)
+ m_pendingSrc.prepend(m_src);
+ else
+ prependingSrc = m_src;
+ setSrc(SegmentedString());
+ state = scriptExecution(ScriptSourceCode(scriptString, document()->frame() ? document()->frame()->document()->url() : KURL(), startLine), state);
+ }
+ }
+
+ if (!m_executingScript && !state.loadingExtScript()) {
+ m_src.append(m_pendingSrc);
+ m_pendingSrc.clear();
+ } else if (!prependingSrc.isEmpty()) {
+ // restore first so that the write appends in the right place
+ // (does not hurt to do it again below)
+ m_currentPrependingSrc = savedPrependingSrc;
+
+ // we need to do this slightly modified bit of one of the write() cases
+ // because we want to prepend to m_pendingSrc rather than appending
+ // if there's no previous prependingSrc
+ if (!m_pendingScripts.isEmpty()) {
+ if (m_currentPrependingSrc)
+ m_currentPrependingSrc->append(prependingSrc);
+ else
+ m_pendingSrc.prepend(prependingSrc);
+ } else {
+ m_state = state;
+ write(prependingSrc, false);
+ state = m_state;
+ }
+ }
+
+#if PRELOAD_SCANNER_ENABLED
+ if (!m_pendingScripts.isEmpty() && !m_executingScript) {
+ if (!m_preloadScanner)
+ m_preloadScanner.set(new LegacyPreloadScanner(document()));
+ if (!m_preloadScanner->inProgress()) {
+ m_preloadScanner->begin();
+ m_preloadScanner->write(m_pendingSrc);
+ }
+ }
+#endif
+ m_currentPrependingSrc = savedPrependingSrc;
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::scriptExecution(const ScriptSourceCode& sourceCode, State state)
+{
+ if (m_fragment || !document()->frame())
+ return state;
+ m_executingScript++;
+
+ SegmentedString* savedPrependingSrc = m_currentPrependingSrc;
+ SegmentedString prependingSrc;
+ m_currentPrependingSrc = &prependingSrc;
+
+ m_state = state;
+ document()->frame()->script()->executeScript(sourceCode);
+ state = m_state;
+
+ state.setAllowYield(true);
+
+ m_executingScript--;
+
+ if (!m_executingScript && !state.loadingExtScript()) {
+ m_pendingSrc.prepend(prependingSrc);
+ m_src.append(m_pendingSrc);
+ m_pendingSrc.clear();
+ } else if (!prependingSrc.isEmpty()) {
+ // restore first so that the write appends in the right place
+ // (does not hurt to do it again below)
+ m_currentPrependingSrc = savedPrependingSrc;
+
+ // we need to do this slightly modified bit of one of the write() cases
+ // because we want to prepend to m_pendingSrc rather than appending
+ // if there's no previous prependingSrc
+ if (!m_pendingScripts.isEmpty()) {
+ if (m_currentPrependingSrc)
+ m_currentPrependingSrc->append(prependingSrc);
+ else
+ m_pendingSrc.prepend(prependingSrc);
+
+#if PRELOAD_SCANNER_ENABLED
+ // We are stuck waiting for another script. Lets check the source that
+ // was just document.write()n for anything to load.
+ LegacyPreloadScanner documentWritePreloadScanner(document());
+ documentWritePreloadScanner.begin();
+ documentWritePreloadScanner.write(prependingSrc);
+ documentWritePreloadScanner.end();
+#endif
+ } else {
+ m_state = state;
+ write(prependingSrc, false);
+ state = m_state;
+ }
+ }
+
+ m_currentPrependingSrc = savedPrependingSrc;
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseComment(SegmentedString& src, State state)
+{
+ // FIXME: Why does this code even run for comments inside <script> and <style>? This seems bogus.
+ checkScriptBuffer(src.length());
+ while (!src.isEmpty()) {
+ UChar ch = *src;
+ m_scriptCode[m_scriptCodeSize++] = ch;
+ if (ch == '>') {
+ bool handleBrokenComments = m_brokenComments && !(state.inScript() || state.inStyle());
+ int endCharsCount = 1; // start off with one for the '>' character
+ if (m_scriptCodeSize > 2 && m_scriptCode[m_scriptCodeSize-3] == '-' && m_scriptCode[m_scriptCodeSize-2] == '-') {
+ endCharsCount = 3;
+ } else if (m_scriptCodeSize > 3 && m_scriptCode[m_scriptCodeSize-4] == '-' && m_scriptCode[m_scriptCodeSize-3] == '-' &&
+ m_scriptCode[m_scriptCodeSize-2] == '!') {
+ // Other browsers will accept --!> as a close comment, even though it's
+ // not technically valid.
+ endCharsCount = 4;
+ }
+ if (handleBrokenComments || endCharsCount > 1) {
+ src.advancePastNonNewline();
+ if (!(state.inTitle() || state.inScript() || state.inXmp() || state.inTextArea() || state.inStyle() || state.inIFrame())) {
+ checkScriptBuffer();
+ m_scriptCode[m_scriptCodeSize] = 0;
+ m_scriptCode[m_scriptCodeSize + 1] = 0;
+ m_currentToken.tagName = commentAtom;
+ m_currentToken.beginTag = true;
+ state = processListing(SegmentedString(m_scriptCode, m_scriptCodeSize - endCharsCount), state);
+ processToken();
+ m_currentToken.tagName = commentAtom;
+ m_currentToken.beginTag = false;
+ processToken();
+ m_scriptCodeSize = 0;
+ }
+ state.setInComment(false);
+ return state; // Finished parsing comment
+ }
+ }
+ src.advance(m_lineNumber);
+ }
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseServer(SegmentedString& src, State state)
+{
+ checkScriptBuffer(src.length());
+ while (!src.isEmpty()) {
+ UChar ch = *src;
+ m_scriptCode[m_scriptCodeSize++] = ch;
+ if (ch == '>' && m_scriptCodeSize > 1 && m_scriptCode[m_scriptCodeSize - 2] == '%') {
+ src.advancePastNonNewline();
+ state.setInServer(false);
+ m_scriptCodeSize = 0;
+ return state; // Finished parsing server include
+ }
+ src.advance(m_lineNumber);
+ }
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseProcessingInstruction(SegmentedString& src, State state)
+{
+ UChar oldchar = 0;
+ while (!src.isEmpty()) {
+ UChar chbegin = *src;
+ if (chbegin == '\'')
+ tquote = tquote == SingleQuote ? NoQuote : SingleQuote;
+ else if (chbegin == '\"')
+ tquote = tquote == DoubleQuote ? NoQuote : DoubleQuote;
+ // Look for '?>'
+ // Some crappy sites omit the "?" before it, so
+ // we look for an unquoted '>' instead. (IE compatible)
+ else if (chbegin == '>' && (!tquote || oldchar == '?')) {
+ // We got a '?>' sequence
+ state.setInProcessingInstruction(false);
+ src.advancePastNonNewline();
+ state.setDiscardLF(true);
+ return state; // Finished parsing comment!
+ }
+ src.advance(m_lineNumber);
+ oldchar = chbegin;
+ }
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseText(SegmentedString& src, State state)
+{
+ while (!src.isEmpty()) {
+ UChar cc = *src;
+
+ if (state.skipLF()) {
+ state.setSkipLF(false);
+ if (cc == '\n') {
+ src.advancePastNewline(m_lineNumber);
+ continue;
+ }
+ }
+
+ // do we need to enlarge the buffer?
+ checkBuffer();
+
+ if (cc == '\r') {
+ state.setSkipLF(true);
+ *m_dest++ = '\n';
+ } else
+ *m_dest++ = cc;
+ src.advance(m_lineNumber);
+ }
+
+ return state;
+}
+
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseEntity(SegmentedString& src, UChar*& dest, State state, unsigned& cBufferPos, bool start, bool parsingTag)
+{
+ if (start) {
+ cBufferPos = 0;
+ state.setEntityState(SearchEntity);
+ EntityUnicodeValue = 0;
+ }
+
+ while (!src.isEmpty()) {
+ UChar cc = *src;
+ switch (state.entityState()) {
+ case NoEntity:
+ ASSERT(state.entityState() != NoEntity);
+ return state;
+
+ case SearchEntity:
+ if (cc == '#') {
+ m_cBuffer[cBufferPos++] = cc;
+ src.advancePastNonNewline();
+ state.setEntityState(NumericSearch);
+ } else
+ state.setEntityState(EntityName);
+ break;
+
+ case NumericSearch:
+ if (cc == 'x' || cc == 'X') {
+ m_cBuffer[cBufferPos++] = cc;
+ src.advancePastNonNewline();
+ state.setEntityState(Hexadecimal);
+ } else if (cc >= '0' && cc <= '9')
+ state.setEntityState(Decimal);
+ else
+ state.setEntityState(SearchSemicolon);
+ break;
+
+ case Hexadecimal: {
+ int ll = min(src.length(), 10 - cBufferPos);
+ while (ll--) {
+ cc = *src;
+ if (!((cc >= '0' && cc <= '9') || (cc >= 'a' && cc <= 'f') || (cc >= 'A' && cc <= 'F'))) {
+ state.setEntityState(SearchSemicolon);
+ break;
+ }
+ int digit;
+ if (cc < 'A')
+ digit = cc - '0';
+ else
+ digit = (cc - 'A' + 10) & 0xF; // handle both upper and lower case without a branch
+ EntityUnicodeValue = EntityUnicodeValue * 16 + digit;
+ m_cBuffer[cBufferPos++] = cc;
+ src.advancePastNonNewline();
+ }
+ if (cBufferPos == 10)
+ state.setEntityState(SearchSemicolon);
+ break;
+ }
+ case Decimal:
+ {
+ int ll = min(src.length(), 9-cBufferPos);
+ while (ll--) {
+ cc = *src;
+
+ if (!(cc >= '0' && cc <= '9')) {
+ state.setEntityState(SearchSemicolon);
+ break;
+ }
+
+ EntityUnicodeValue = EntityUnicodeValue * 10 + (cc - '0');
+ m_cBuffer[cBufferPos++] = cc;
+ src.advancePastNonNewline();
+ }
+ if (cBufferPos == 9)
+ state.setEntityState(SearchSemicolon);
+ break;
+ }
+ case EntityName:
+ {
+ int ll = min(src.length(), 9-cBufferPos);
+ while (ll--) {
+ cc = *src;
+
+ if (!((cc >= 'a' && cc <= 'z') || (cc >= '0' && cc <= '9') || (cc >= 'A' && cc <= 'Z'))) {
+ state.setEntityState(SearchSemicolon);
+ break;
+ }
+
+ m_cBuffer[cBufferPos++] = cc;
+ src.advancePastNonNewline();
+ }
+ if (cBufferPos == 9)
+ state.setEntityState(SearchSemicolon);
+ if (state.entityState() == SearchSemicolon) {
+ if (cBufferPos > 1) {
+ // Since the maximum length of entity name is 9,
+ // so a single char array which is allocated on
+ // the stack, its length is 10, should be OK.
+ // Also if we have an illegal character, we treat it
+ // as illegal entity name.
+ unsigned testedEntityNameLen = 0;
+ char tmpEntityNameBuffer[10];
+
+ ASSERT(cBufferPos < 10);
+ for (; testedEntityNameLen < cBufferPos; ++testedEntityNameLen) {
+ if (m_cBuffer[testedEntityNameLen] > 0x7e)
+ break;
+ tmpEntityNameBuffer[testedEntityNameLen] = m_cBuffer[testedEntityNameLen];
+ }
+
+ const Entity *e;
+
+ if (testedEntityNameLen == cBufferPos)
+ e = findEntity(tmpEntityNameBuffer, cBufferPos);
+ else
+ e = 0;
+
+ if (e)
+ EntityUnicodeValue = e->code;
+
+ // be IE compatible
+ if (parsingTag && EntityUnicodeValue > 255 && *src != ';')
+ EntityUnicodeValue = 0;
+ }
+ }
+ else
+ break;
+ }
+ case SearchSemicolon:
+ // Don't allow values that are more than 21 bits.
+ if (EntityUnicodeValue > 0 && EntityUnicodeValue <= 0x10FFFF) {
+ if (!inViewSourceMode()) {
+ if (*src == ';')
+ src.advancePastNonNewline();
+ if (EntityUnicodeValue <= 0xFFFF) {
+ checkBuffer();
+ src.push(fixUpChar(EntityUnicodeValue));
+ } else {
+ // Convert to UTF-16, using surrogate code points.
+ checkBuffer(2);
+ src.push(U16_LEAD(EntityUnicodeValue));
+ src.push(U16_TRAIL(EntityUnicodeValue));
+ }
+ } else {
+ // FIXME: We should eventually colorize entities by sending them as a special token.
+ // 12 bytes required: up to 10 bytes in m_cBuffer plus the
+ // leading '&' and trailing ';'
+ checkBuffer(12);
+ *dest++ = '&';
+ for (unsigned i = 0; i < cBufferPos; i++)
+ dest[i] = m_cBuffer[i];
+ dest += cBufferPos;
+ if (*src == ';') {
+ *dest++ = ';';
+ src.advancePastNonNewline();
+ }
+ }
+ } else {
+ // 11 bytes required: up to 10 bytes in m_cBuffer plus the
+ // leading '&'
+ checkBuffer(11);
+ // ignore the sequence, add it to the buffer as plaintext
+ *dest++ = '&';
+ for (unsigned i = 0; i < cBufferPos; i++)
+ dest[i] = m_cBuffer[i];
+ dest += cBufferPos;
+ }
+
+ state.setEntityState(NoEntity);
+ return state;
+ }
+ }
+
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseDoctype(SegmentedString& src, State state)
+{
+ ASSERT(state.inDoctype());
+ while (!src.isEmpty() && state.inDoctype()) {
+ UChar c = *src;
+ bool isWhitespace = c == '\r' || c == '\n' || c == '\t' || c == ' ';
+ switch (m_doctypeToken.state()) {
+ case DoctypeBegin: {
+ m_doctypeToken.setState(DoctypeBeforeName);
+ if (isWhitespace) {
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ }
+ break;
+ }
+ case DoctypeBeforeName: {
+ if (c == '>') {
+ // Malformed. Just exit.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ if (inViewSourceMode())
+ processDoctypeToken();
+ } else if (isWhitespace) {
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else
+ m_doctypeToken.setState(DoctypeName);
+ break;
+ }
+ case DoctypeName: {
+ if (c == '>') {
+ // Valid doctype. Emit it.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ processDoctypeToken();
+ } else if (isWhitespace) {
+ m_doctypeSearchCount = 0; // Used now to scan for PUBLIC
+ m_doctypeSecondarySearchCount = 0; // Used now to scan for SYSTEM
+ m_doctypeToken.setState(DoctypeAfterName);
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else {
+ src.advancePastNonNewline();
+ m_doctypeToken.m_name.append(c);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ }
+ break;
+ }
+ case DoctypeAfterName: {
+ if (c == '>') {
+ // Valid doctype. Emit it.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ processDoctypeToken();
+ } else if (!isWhitespace) {
+ src.advancePastNonNewline();
+ if (toASCIILower(c) == publicStart[m_doctypeSearchCount]) {
+ m_doctypeSearchCount++;
+ if (m_doctypeSearchCount == 6)
+ // Found 'PUBLIC' sequence
+ m_doctypeToken.setState(DoctypeBeforePublicID);
+ } else if (m_doctypeSearchCount > 0) {
+ m_doctypeSearchCount = 0;
+ m_doctypeToken.setState(DoctypeBogus);
+ } else if (toASCIILower(c) == systemStart[m_doctypeSecondarySearchCount]) {
+ m_doctypeSecondarySearchCount++;
+ if (m_doctypeSecondarySearchCount == 6)
+ // Found 'SYSTEM' sequence
+ m_doctypeToken.setState(DoctypeBeforeSystemID);
+ } else {
+ m_doctypeSecondarySearchCount = 0;
+ m_doctypeToken.setState(DoctypeBogus);
+ }
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else {
+ src.advance(m_lineNumber); // Whitespace keeps us in the after name state.
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ }
+ break;
+ }
+ case DoctypeBeforePublicID: {
+ if (c == '\"' || c == '\'') {
+ tquote = c == '\"' ? DoubleQuote : SingleQuote;
+ m_doctypeToken.setState(DoctypePublicID);
+ src.advancePastNonNewline();
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else if (c == '>') {
+ // Considered bogus. Don't process the doctype.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ if (inViewSourceMode())
+ processDoctypeToken();
+ } else if (isWhitespace) {
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else
+ m_doctypeToken.setState(DoctypeBogus);
+ break;
+ }
+ case DoctypePublicID: {
+ if ((c == '\"' && tquote == DoubleQuote) || (c == '\'' && tquote == SingleQuote)) {
+ src.advancePastNonNewline();
+ m_doctypeToken.setState(DoctypeAfterPublicID);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else if (c == '>') {
+ // Considered bogus. Don't process the doctype.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ if (inViewSourceMode())
+ processDoctypeToken();
+ } else {
+ m_doctypeToken.m_publicID.append(c);
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ }
+ break;
+ }
+ case DoctypeAfterPublicID:
+ if (c == '\"' || c == '\'') {
+ tquote = c == '\"' ? DoubleQuote : SingleQuote;
+ m_doctypeToken.setState(DoctypeSystemID);
+ src.advancePastNonNewline();
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else if (c == '>') {
+ // Valid doctype. Emit it now.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ processDoctypeToken();
+ } else if (isWhitespace) {
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else
+ m_doctypeToken.setState(DoctypeBogus);
+ break;
+ case DoctypeBeforeSystemID:
+ if (c == '\"' || c == '\'') {
+ tquote = c == '\"' ? DoubleQuote : SingleQuote;
+ m_doctypeToken.setState(DoctypeSystemID);
+ src.advancePastNonNewline();
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else if (c == '>') {
+ // Considered bogus. Don't process the doctype.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ } else if (isWhitespace) {
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else
+ m_doctypeToken.setState(DoctypeBogus);
+ break;
+ case DoctypeSystemID:
+ if ((c == '\"' && tquote == DoubleQuote) || (c == '\'' && tquote == SingleQuote)) {
+ src.advancePastNonNewline();
+ m_doctypeToken.setState(DoctypeAfterSystemID);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else if (c == '>') {
+ // Considered bogus. Don't process the doctype.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ if (inViewSourceMode())
+ processDoctypeToken();
+ } else {
+ m_doctypeToken.m_systemID.append(c);
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ }
+ break;
+ case DoctypeAfterSystemID:
+ if (c == '>') {
+ // Valid doctype. Emit it now.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ processDoctypeToken();
+ } else if (isWhitespace) {
+ src.advance(m_lineNumber);
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ } else
+ m_doctypeToken.setState(DoctypeBogus);
+ break;
+ case DoctypeBogus:
+ if (c == '>') {
+ // Done with the bogus doctype.
+ src.advancePastNonNewline();
+ state.setInDoctype(false);
+ if (inViewSourceMode())
+ processDoctypeToken();
+ } else {
+ src.advance(m_lineNumber); // Just keep scanning for '>'
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(c);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return state;
+}
+
+LegacyHTMLDocumentParser::State LegacyHTMLDocumentParser::parseTag(SegmentedString& src, State state)
+{
+ ASSERT(!state.hasEntityState());
+
+ unsigned cBufferPos = m_cBufferPos;
+
+ bool lastIsSlash = false;
+
+ while (!src.isEmpty()) {
+ checkBuffer();
+ switch (state.tagState()) {
+ case NoTag:
+ {
+ m_cBufferPos = cBufferPos;
+ return state;
+ }
+ case TagName:
+ {
+ if (searchCount > 0) {
+ if (*src == commentStart[searchCount]) {
+ searchCount++;
+ if (searchCount == 2)
+ m_doctypeSearchCount++; // A '!' is also part of a doctype, so we are moving through that still as well.
+ else
+ m_doctypeSearchCount = 0;
+ if (searchCount == 4) {
+ // Found '<!--' sequence
+ src.advancePastNonNewline();
+ m_dest = m_buffer; // ignore the previous part of this tag
+ state.setInComment(true);
+ state.setTagState(NoTag);
+
+ // Fix bug 34302 at kde.bugs.org. Go ahead and treat
+ // <!--> as a valid comment, since both mozilla and IE on windows
+ // can handle this case. Only do this in quirks mode. -dwh
+ if (!src.isEmpty() && *src == '>' && document()->inCompatMode()) {
+ state.setInComment(false);
+ src.advancePastNonNewline();
+ if (!src.isEmpty())
+ m_cBuffer[cBufferPos++] = *src;
+ } else
+ state = parseComment(src, state);
+
+ m_cBufferPos = cBufferPos;
+ return state; // Finished parsing tag!
+ }
+ m_cBuffer[cBufferPos++] = *src;
+ src.advancePastNonNewline();
+ break;
+ } else
+ searchCount = 0; // Stop looking for '<!--' sequence
+ }
+
+ if (m_doctypeSearchCount > 0) {
+ if (toASCIILower(*src) == doctypeStart[m_doctypeSearchCount]) {
+ m_doctypeSearchCount++;
+ m_cBuffer[cBufferPos++] = *src;
+ src.advancePastNonNewline();
+ if (m_doctypeSearchCount == 9) {
+ // Found '<!DOCTYPE' sequence
+ state.setInDoctype(true);
+ state.setTagState(NoTag);
+ m_doctypeToken.reset();
+ if (inViewSourceMode())
+ m_doctypeToken.m_source.append(m_cBuffer, cBufferPos);
+ state = parseDoctype(src, state);
+ m_cBufferPos = cBufferPos;
+ return state;
+ }
+ break;
+ } else
+ m_doctypeSearchCount = 0; // Stop looking for '<!DOCTYPE' sequence
+ }
+
+ bool finish = false;
+ unsigned int ll = min(src.length(), CBUFLEN - cBufferPos);
+ while (ll--) {
+ UChar curchar = *src;
+ if (isASCIISpace(curchar) || curchar == '>' || curchar == '<') {
+ finish = true;
+ break;
+ }
+
+ // tolower() shows up on profiles. This is faster!
+ if (curchar >= 'A' && curchar <= 'Z' && !inViewSourceMode())
+ m_cBuffer[cBufferPos++] = curchar + ('a' - 'A');
+ else
+ m_cBuffer[cBufferPos++] = curchar;
+ src.advancePastNonNewline();
+ }
+
+ // Disadvantage: we add the possible rest of the tag
+ // as attribute names. ### judge if this causes problems
+ if (finish || CBUFLEN == cBufferPos) {
+ bool beginTag;
+ UChar* ptr = m_cBuffer;
+ unsigned int len = cBufferPos;
+ m_cBuffer[cBufferPos] = '\0';
+ if ((cBufferPos > 0) && (*ptr == '/')) {
+ // End Tag
+ beginTag = false;
+ ptr++;
+ len--;
+ }
+ else
+ // Start Tag
+ beginTag = true;
+
+ // Ignore the / in fake xml tags like <br/>. We trim off the "/" so that we'll get "br" as the tag name and not "br/".
+ if (len > 1 && ptr[len-1] == '/' && !inViewSourceMode())
+ ptr[--len] = '\0';
+
+ // Now that we've shaved off any invalid / that might have followed the name), make the tag.
+ // FIXME: FireFox and WinIE turn !foo nodes into comments, we ignore comments. (fast/parser/tag-with-exclamation-point.html)
+ if (ptr[0] != '!' || inViewSourceMode()) {
+ m_currentToken.tagName = AtomicString(ptr);
+ m_currentToken.beginTag = beginTag;
+ }
+ m_dest = m_buffer;
+ state.setTagState(SearchAttribute);
+ cBufferPos = 0;
+ }
+ break;
+ }
+ case SearchAttribute:
+ while (!src.isEmpty()) {
+ UChar curchar = *src;
+ // In this mode just ignore any quotes we encounter and treat them like spaces.
+ if (!isASCIISpace(curchar) && curchar != '\'' && curchar != '"') {
+ if (curchar == '<' || curchar == '>')
+ state.setTagState(SearchEnd);
+ else
+ state.setTagState(AttributeName);
+
+ cBufferPos = 0;
+ break;
+ }
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(curchar);
+ src.advance(m_lineNumber);
+ }
+ break;
+ case AttributeName:
+ {
+ m_rawAttributeBeforeValue.clear();
+ int ll = min(src.length(), CBUFLEN - cBufferPos);
+ while (ll--) {
+ UChar curchar = *src;
+ // If we encounter a "/" when scanning an attribute name, treat it as a delimiter. This allows the
+ // cases like <input type=checkbox checked/> to work (and accommodates XML-style syntax as per HTML5).
+ if (curchar <= '>' && (curchar >= '<' || isASCIISpace(curchar) || curchar == '/')) {
+ m_cBuffer[cBufferPos] = '\0';
+ m_attrName = AtomicString(m_cBuffer);
+ m_dest = m_buffer;
+ *m_dest++ = 0;
+ state.setTagState(SearchEqual);
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar('a');
+ break;
+ }
+
+ // tolower() shows up on profiles. This is faster!
+ if (curchar >= 'A' && curchar <= 'Z' && !inViewSourceMode())
+ m_cBuffer[cBufferPos++] = curchar + ('a' - 'A');
+ else
+ m_cBuffer[cBufferPos++] = curchar;
+
+ m_rawAttributeBeforeValue.append(curchar);
+ src.advance(m_lineNumber);
+ }
+ if (cBufferPos == CBUFLEN) {
+ m_cBuffer[cBufferPos] = '\0';
+ m_attrName = AtomicString(m_cBuffer);
+ m_dest = m_buffer;
+ *m_dest++ = 0;
+ state.setTagState(SearchEqual);
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar('a');
+ }
+ break;
+ }
+ case SearchEqual:
+ while (!src.isEmpty()) {
+ UChar curchar = *src;
+
+ if (lastIsSlash && curchar == '>') {
+ // This is a quirk (with a long sad history). We have to do this
+ // since widgets do <script src="foo.js"/> and expect the tag to close.
+ if (m_currentToken.tagName == scriptTag)
+ m_currentToken.selfClosingTag = true;
+ m_currentToken.brokenXMLStyle = true;
+ }
+
+ // In this mode just ignore any quotes or slashes we encounter and treat them like spaces.
+ if (!isASCIISpace(curchar) && curchar != '\'' && curchar != '"' && curchar != '/') {
+ if (curchar == '=') {
+ state.setTagState(SearchValue);
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(curchar);
+ m_rawAttributeBeforeValue.append(curchar);
+ src.advancePastNonNewline();
+ } else {
+ m_currentToken.addAttribute(m_attrName, emptyAtom, inViewSourceMode());
+ m_dest = m_buffer;
+ state.setTagState(SearchAttribute);
+ lastIsSlash = false;
+ }
+ break;
+ }
+
+ lastIsSlash = curchar == '/';
+
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(curchar);
+ m_rawAttributeBeforeValue.append(curchar);
+ src.advance(m_lineNumber);
+ }
+ break;
+ case SearchValue:
+ while (!src.isEmpty()) {
+ UChar curchar = *src;
+ if (!isASCIISpace(curchar)) {
+ if (curchar == '\'' || curchar == '\"') {
+ tquote = curchar == '\"' ? DoubleQuote : SingleQuote;
+ state.setTagState(QuotedValue);
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(curchar);
+ m_rawAttributeBeforeValue.append(curchar);
+ src.advancePastNonNewline();
+ } else
+ state.setTagState(Value);
+
+ break;
+ }
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(curchar);
+ m_rawAttributeBeforeValue.append(curchar);
+ src.advance(m_lineNumber);
+ }
+ break;
+ case QuotedValue:
+ while (!src.isEmpty()) {
+ checkBuffer();
+
+ UChar curchar = *src;
+ if (curchar <= '>' && !src.escaped()) {
+ if (curchar == '>' && m_attrName.isEmpty()) {
+ // Handle a case like <img '>. Just go ahead and be willing
+ // to close the whole tag. Don't consume the character and
+ // just go back into SearchEnd while ignoring the whole
+ // value.
+ // FIXME: Note that this is actually not a very good solution.
+ // It doesn't handle the general case of
+ // unmatched quotes among attributes that have names. -dwh
+ while (m_dest > m_buffer + 1 && (m_dest[-1] == '\n' || m_dest[-1] == '\r'))
+ m_dest--; // remove trailing newlines
+ AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
+ if (!attributeValue.contains('/'))
+ m_attrName = attributeValue; // Just make the name/value match. (FIXME: Is this some WinIE quirk?)
+ m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar('x');
+ state.setTagState(SearchAttribute);
+ m_dest = m_buffer;
+ tquote = NoQuote;
+ break;
+ }
+
+ if (curchar == '&') {
+ src.advancePastNonNewline();
+ state = parseEntity(src, m_dest, state, cBufferPos, true, true);
+ break;
+ }
+
+ if ((tquote == SingleQuote && curchar == '\'') || (tquote == DoubleQuote && curchar == '\"')) {
+ // some <input type=hidden> rely on trailing spaces. argh
+ while (m_dest > m_buffer + 1 && (m_dest[-1] == '\n' || m_dest[-1] == '\r'))
+ m_dest--; // remove trailing newlines
+ AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
+ if (m_attrName.isEmpty() && !attributeValue.contains('/')) {
+ m_attrName = attributeValue; // Make the name match the value. (FIXME: Is this a WinIE quirk?)
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar('x');
+ } else if (inViewSourceMode())
+ m_currentToken.addViewSourceChar('v');
+
+ if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeBuilder->skipMode() && m_attrName == srcAttr) {
+ String context(m_rawAttributeBeforeValue.data(), m_rawAttributeBeforeValue.size());
+ if (m_XSSAuditor && !m_XSSAuditor->canLoadExternalScriptFromSrc(attributeValue))
+ attributeValue = blankURL().string();
+ }
+
+ m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
+ m_dest = m_buffer;
+ state.setTagState(SearchAttribute);
+ tquote = NoQuote;
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(curchar);
+ src.advancePastNonNewline();
+ break;
+ }
+ }
+
+ *m_dest++ = curchar;
+ src.advance(m_lineNumber);
+ }
+ break;
+ case Value:
+ while (!src.isEmpty()) {
+ checkBuffer();
+ UChar curchar = *src;
+ if (curchar <= '>' && !src.escaped()) {
+ // parse Entities
+ if (curchar == '&') {
+ src.advancePastNonNewline();
+ state = parseEntity(src, m_dest, state, cBufferPos, true, true);
+ break;
+ }
+ // no quotes. Every space means end of value
+ // '/' does not delimit in IE!
+ if (isASCIISpace(curchar) || curchar == '>') {
+ AtomicString attributeValue(m_buffer + 1, m_dest - m_buffer - 1);
+
+ if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeBuilder->skipMode() && m_attrName == srcAttr) {
+ String context(m_rawAttributeBeforeValue.data(), m_rawAttributeBeforeValue.size());
+ if (m_XSSAuditor && !m_XSSAuditor->canLoadExternalScriptFromSrc(attributeValue))
+ attributeValue = blankURL().string();
+ }
+
+ m_currentToken.addAttribute(m_attrName, attributeValue, inViewSourceMode());
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar('v');
+ m_dest = m_buffer;
+ state.setTagState(SearchAttribute);
+ break;
+ }
+ }
+
+ *m_dest++ = curchar;
+ src.advance(m_lineNumber);
+ }
+ break;
+ case SearchEnd:
+ {
+ while (!src.isEmpty()) {
+ UChar ch = *src;
+ if (ch == '>' || ch == '<')
+ break;
+ if (ch == '/')
+ m_currentToken.selfClosingTag = true;
+ if (inViewSourceMode())
+ m_currentToken.addViewSourceChar(ch);
+ src.advance(m_lineNumber);
+ }
+ if (src.isEmpty())
+ break;
+
+ searchCount = 0; // Stop looking for '<!--' sequence
+ state.setTagState(NoTag);
+ tquote = NoQuote;
+
+ if (*src != '<')
+ src.advance(m_lineNumber);
+
+ if (m_currentToken.tagName == nullAtom) { //stop if tag is unknown
+ m_cBufferPos = cBufferPos;
+ return state;
+ }
+
+ AtomicString tagName = m_currentToken.tagName;
+
+ // Handle <script src="foo"/> like Mozilla/Opera. We have to do this now for Dashboard
+ // compatibility.
+ bool isSelfClosingScript = m_currentToken.selfClosingTag && m_currentToken.beginTag && m_currentToken.tagName == scriptTag;
+ bool beginTag = !m_currentToken.selfClosingTag && m_currentToken.beginTag;
+ if (m_currentToken.beginTag && m_currentToken.tagName == scriptTag && !inViewSourceMode() && !m_treeBuilder->skipMode()) {
+ Attribute* a = 0;
+ m_scriptTagSrcAttrValue = String();
+ m_scriptTagCharsetAttrValue = String();
+ if (m_currentToken.attrs && !m_fragment) {
+ if (document()->frame() && document()->frame()->script()->canExecuteScripts(NotAboutToExecuteScript)) {
+ if ((a = m_currentToken.attrs->getAttributeItem(srcAttr)))
+ m_scriptTagSrcAttrValue = document()->completeURL(deprecatedParseURL(a->value())).string();
+ }
+ }
+ }
+
+ RefPtr<Node> n = processToken();
+ m_cBufferPos = cBufferPos;
+ if (n || inViewSourceMode()) {
+ State savedState = state;
+ SegmentedString savedSrc = src;
+ long savedLineno = m_lineNumber;
+ if ((tagName == preTag || tagName == listingTag) && !inViewSourceMode()) {
+ if (beginTag)
+ state.setDiscardLF(true); // Discard the first LF after we open a pre.
+ } else if (tagName == scriptTag) {
+ ASSERT(!m_scriptNode);
+ m_scriptNode = static_pointer_cast<HTMLScriptElement>(n);
+ if (m_scriptNode)
+ m_scriptTagCharsetAttrValue = m_scriptNode->scriptCharset();
+ if (beginTag) {
+ m_searchStopper = scriptEnd;
+ m_searchStopperLength = 8;
+ state.setInScript(true);
+ state = parseNonHTMLText(src, state);
+ } else if (isSelfClosingScript) { // Handle <script src="foo"/>
+ state.setInScript(true);
+ state = scriptHandler(state);
+ }
+ } else if (tagName == styleTag) {
+ if (beginTag) {
+ m_searchStopper = styleEnd;
+ m_searchStopperLength = 7;
+ state.setInStyle(true);
+ state = parseNonHTMLText(src, state);
+ }
+ } else if (tagName == textareaTag) {
+ if (beginTag) {
+ m_searchStopper = textareaEnd;
+ m_searchStopperLength = 10;
+ state.setInTextArea(true);
+ state = parseNonHTMLText(src, state);
+ }
+ } else if (tagName == titleTag) {
+ if (beginTag) {
+ m_searchStopper = titleEnd;
+ m_searchStopperLength = 7;
+ state.setInTitle(true);
+ state = parseNonHTMLText(src, state);
+ }
+ } else if (tagName == xmpTag) {
+ if (beginTag) {
+ m_searchStopper = xmpEnd;
+ m_searchStopperLength = 5;
+ state.setInXmp(true);
+ state = parseNonHTMLText(src, state);
+ }
+ } else if (tagName == iframeTag) {
+ if (beginTag) {
+ m_searchStopper = iframeEnd;
+ m_searchStopperLength = 8;
+ state.setInIFrame(true);
+ state = parseNonHTMLText(src, state);
+ }
+ }
+ if (src.isEmpty() && (state.inTitle() || inViewSourceMode()) && !state.inComment() && !(state.inScript() && m_currentScriptTagStartLineNumber)) {
+ // We just ate the rest of the document as the #text node under the special tag!
+ // Reset the state then retokenize without special handling.
+ // Let the parser clean up the missing close tag.
+ // FIXME: This is incorrect, because src.isEmpty() doesn't mean we're
+ // at the end of the document unless m_noMoreData is also true. We need
+ // to detect this case elsewhere, and save the state somewhere other
+ // than a local variable.
+ state = savedState;
+ src = savedSrc;
+ m_lineNumber = savedLineno;
+ m_scriptCodeSize = 0;
+ }
+ }
+ if (tagName == plaintextTag)
+ state.setInPlainText(beginTag);
+ return state; // Finished parsing tag!
+ }
+ } // end switch
+ }
+ m_cBufferPos = cBufferPos;
+ return state;
+}
+
+inline bool LegacyHTMLDocumentParser::continueProcessing(int& processedCount, double startTime, State &state)
+{
+ // We don't want to be checking elapsed time with every character, so we only check after we've
+ // processed a certain number of characters.
+ bool allowedYield = state.allowYield();
+ state.setAllowYield(false);
+ if (!state.loadingExtScript() && !state.forceSynchronous() && !m_executingScript && (processedCount > m_tokenizerChunkSize || allowedYield)) {
+ processedCount = 0;
+ if (currentTime() - startTime > m_tokenizerTimeDelay) {
+ /* FIXME: We'd like to yield aggressively to give stylesheets the opportunity to
+ load, but this hurts overall performance on slower machines. For now turn this
+ off.
+ || (!document()->haveStylesheetsLoaded() &&
+ (document()->documentElement()->id() != ID_HTML || document()->body()))) {*/
+ // Schedule the timer to keep processing as soon as possible.
+ m_timer.startOneShot(0);
+ return false;
+ }
+ }
+
+ processedCount++;
+ return true;
+}
+
+// Turns the statemachine one crank using the passed in State object.
+// This does not modify m_state directly in order to be reentrant.
+ALWAYS_INLINE void LegacyHTMLDocumentParser::advance(State& state)
+{
+ // do we need to enlarge the buffer?
+ checkBuffer();
+
+ UChar cc = *m_src;
+
+ bool wasSkipLF = state.skipLF();
+ if (wasSkipLF)
+ state.setSkipLF(false);
+
+ if (wasSkipLF && (cc == '\n'))
+ m_src.advance();
+ else if (state.needsSpecialWriteHandling()) {
+ // it's important to keep needsSpecialWriteHandling with the flags this block tests
+ if (state.hasEntityState())
+ state = parseEntity(m_src, m_dest, state, m_cBufferPos, false, state.hasTagState());
+ else if (state.inPlainText())
+ state = parseText(m_src, state);
+ else if (state.inAnyNonHTMLText())
+ state = parseNonHTMLText(m_src, state);
+ else if (state.inComment())
+ state = parseComment(m_src, state);
+ else if (state.inDoctype())
+ state = parseDoctype(m_src, state);
+ else if (state.inServer())
+ state = parseServer(m_src, state);
+ else if (state.inProcessingInstruction())
+ state = parseProcessingInstruction(m_src, state);
+ else if (state.hasTagState())
+ state = parseTag(m_src, state);
+ else if (state.startTag()) {
+ state.setStartTag(false);
+
+ switch (cc) {
+ case '/':
+ break;
+ case '!': {
+ // <!-- comment --> or <!DOCTYPE ...>
+ searchCount = 1; // Look for '<!--' sequence to start comment or '<!DOCTYPE' sequence to start doctype
+ m_doctypeSearchCount = 1;
+ break;
+ }
+ case '?': {
+ // xml processing instruction
+ state.setInProcessingInstruction(true);
+ tquote = NoQuote;
+ state = parseProcessingInstruction(m_src, state);
+ return;
+ }
+ case '%':
+ if (!m_brokenServer) {
+ // <% server stuff, handle as comment %>
+ state.setInServer(true);
+ tquote = NoQuote;
+ state = parseServer(m_src, state);
+ return;
+ }
+ // else fall through
+ default: {
+ if (((cc >= 'a') && (cc <= 'z')) || ((cc >= 'A') && (cc <= 'Z'))) {
+ // Start of a Start-Tag
+ } else {
+ // Invalid tag
+ // Add as is
+ *m_dest = '<';
+ m_dest++;
+ return;
+ }
+ }
+ }; // end case
+
+ processToken();
+
+ m_cBufferPos = 0;
+ state.setTagState(TagName);
+ state = parseTag(m_src, state);
+ }
+ } else if (cc == '&' && !m_src.escaped()) {
+ m_src.advancePastNonNewline();
+ state = parseEntity(m_src, m_dest, state, m_cBufferPos, true, state.hasTagState());
+ } else if (cc == '<' && !m_src.escaped()) {
+ m_currentTagStartLineNumber = m_lineNumber;
+ m_src.advancePastNonNewline();
+ state.setStartTag(true);
+ state.setDiscardLF(false);
+ } else if (cc == '\n' || cc == '\r') {
+ if (state.discardLF())
+ // Ignore this LF
+ state.setDiscardLF(false); // We have discarded 1 LF
+ else {
+ // Process this LF
+ *m_dest++ = '\n';
+ if (cc == '\r' && !m_src.excludeLineNumbers())
+ m_lineNumber++;
+ }
+
+ /* Check for MS-DOS CRLF sequence */
+ if (cc == '\r')
+ state.setSkipLF(true);
+ m_src.advance(m_lineNumber);
+ } else {
+ state.setDiscardLF(false);
+ *m_dest++ = cc;
+ m_src.advancePastNonNewline();
+ }
+}
+
+void LegacyHTMLDocumentParser::willWriteHTML(const SegmentedString& source)
+{
+ #if ENABLE(INSPECTOR)
+ if (InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent())
+ timelineAgent->willWriteHTML(source.length(), m_lineNumber);
+ #endif
+}
+
+void LegacyHTMLDocumentParser::didWriteHTML()
+{
+ #if ENABLE(INSPECTOR)
+ if (InspectorTimelineAgent* timelineAgent = document()->inspectorTimelineAgent())
+ timelineAgent->didWriteHTML(m_lineNumber);
+ #endif
+}
+
+void LegacyHTMLDocumentParser::write(const SegmentedString& str, bool appendData)
+{
+ if (!m_buffer)
+ return;
+
+ if (m_parserStopped)
+ return;
+
+ SegmentedString source(str);
+ if (m_executingScript)
+ source.setExcludeLineNumbers();
+
+ if ((m_executingScript && appendData) || !m_pendingScripts.isEmpty()) {
+ // don't parse; we will do this later
+ if (m_currentPrependingSrc)
+ m_currentPrependingSrc->append(source);
+ else {
+ m_pendingSrc.append(source);
+#if PRELOAD_SCANNER_ENABLED
+ if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
+ m_preloadScanner->write(source);
+#endif
+ }
+ return;
+ }
+
+#if PRELOAD_SCANNER_ENABLED
+ if (m_preloadScanner && m_preloadScanner->inProgress() && appendData)
+ m_preloadScanner->end();
+#endif
+
+ if (!m_src.isEmpty())
+ m_src.append(source);
+ else
+ setSrc(source);
+
+ // Once a timer is set, it has control of when the parser continues.
+ if (m_timer.isActive())
+ return;
+
+ bool wasInWrite = m_inWrite;
+ m_inWrite = true;
+
+ willWriteHTML(source);
+
+ Frame* frame = document()->frame();
+ State state = m_state;
+ int processedCount = 0;
+ double startTime = currentTime();
+
+ while (!m_src.isEmpty() && (!frame || !frame->redirectScheduler()->locationChangePending())) {
+ if (!continueProcessing(processedCount, startTime, state))
+ break;
+ advance(state);
+ }
+
+ didWriteHTML();
+
+ m_inWrite = wasInWrite;
+ m_state = state;
+
+ if (m_noMoreData && !m_inWrite && !state.loadingExtScript() && !m_executingScript && !m_timer.isActive())
+ end(); // this actually causes us to be deleted
+
+ // After parsing, go ahead and dispatch image beforeload events.
+ ImageLoader::dispatchPendingBeforeLoadEvents();
+}
+
+void LegacyHTMLDocumentParser::stopParsing()
+{
+ DocumentParser::stopParsing();
+ m_timer.stop();
+
+ // FIXME: Why is LegacyHTMLDocumentParser the only DocumentParser which calls checkCompleted?
+ // The FrameLoader needs to know that the parser has finished with its data,
+ // regardless of whether it happened naturally or due to manual intervention.
+ if (!m_fragment && document()->frame())
+ document()->frame()->loader()->checkCompleted();
+}
+
+bool LegacyHTMLDocumentParser::processingData() const
+{
+ return m_timer.isActive() || m_inWrite;
+}
+
+void LegacyHTMLDocumentParser::timerFired(Timer<LegacyHTMLDocumentParser>*)
+{
+ if (document()->view() && document()->view()->layoutPending() && !document()->minimumLayoutDelay()) {
+ // Restart the timer and let layout win. This is basically a way of ensuring that the layout
+ // timer has higher priority than our timer.
+ m_timer.startOneShot(0);
+ return;
+ }
+
+ // Invoke write() as though more data came in. This might cause us to get deleted.
+ write(SegmentedString(), true);
+}
+
+void LegacyHTMLDocumentParser::end()
+{
+ ASSERT(!m_timer.isActive());
+ m_timer.stop(); // Only helps if assertion above fires, but do it anyway.
+
+ if (m_buffer) {
+ // parseTag is using the buffer for different matters
+ if (!m_state.hasTagState())
+ processToken();
+
+ fastFree(m_scriptCode);
+ m_scriptCode = 0;
+ m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
+
+ fastFree(m_buffer);
+ m_buffer = 0;
+ }
+
+ if (!inViewSourceMode())
+ m_treeBuilder->finished();
+ else
+ document()->finishedParsing();
+}
+
+void LegacyHTMLDocumentParser::finish()
+{
+ // do this as long as we don't find matching comment ends
+ while ((m_state.inComment() || m_state.inServer()) && m_scriptCode && m_scriptCodeSize) {
+ // we've found an unmatched comment start
+ if (m_state.inComment())
+ m_brokenComments = true;
+ else
+ m_brokenServer = true;
+ checkScriptBuffer();
+ m_scriptCode[m_scriptCodeSize] = 0;
+ m_scriptCode[m_scriptCodeSize + 1] = 0;
+ int pos;
+ String food;
+ if (m_state.inScript() || m_state.inStyle() || m_state.inTextArea())
+ food = String(m_scriptCode, m_scriptCodeSize);
+ else if (m_state.inServer()) {
+ food = "<";
+ food.append(m_scriptCode, m_scriptCodeSize);
+ } else {
+ pos = find(m_scriptCode, m_scriptCodeSize, '>');
+ food = String(m_scriptCode + pos + 1, m_scriptCodeSize - pos - 1);
+ }
+ fastFree(m_scriptCode);
+ m_scriptCode = 0;
+ m_scriptCodeSize = m_scriptCodeCapacity = m_scriptCodeResync = 0;
+ m_state.setInComment(false);
+ m_state.setInServer(false);
+ if (!food.isEmpty())
+ write(food, true);
+ }
+ // this indicates we will not receive any more data... but if we are waiting on
+ // an external script to load, we can't finish parsing until that is done
+ m_noMoreData = true;
+ if (!m_inWrite && !m_state.loadingExtScript() && !m_executingScript && !m_timer.isActive())
+ end(); // this actually causes us to be deleted
+}
+
+bool LegacyHTMLDocumentParser::finishWasCalled()
+{
+ return m_noMoreData;
+}
+
+PassRefPtr<Node> LegacyHTMLDocumentParser::processToken()
+{
+ if (m_dest > m_buffer) {
+ m_currentToken.text = StringImpl::createStrippingNullCharacters(m_buffer, m_dest - m_buffer);
+ if (m_currentToken.tagName != commentAtom)
+ m_currentToken.tagName = textAtom;
+ } else if (m_currentToken.tagName == nullAtom) {
+ m_currentToken.reset();
+ return 0;
+ }
+
+ m_dest = m_buffer;
+
+ RefPtr<Node> n;
+
+ if (!m_parserStopped) {
+ if (NamedNodeMap* map = m_currentToken.attrs.get())
+ map->shrinkToLength();
+ if (inViewSourceMode())
+ static_cast<HTMLViewSourceDocument*>(document())->addViewSourceToken(&m_currentToken);
+ else
+ // pass the token over to the parser, the parser DOES NOT delete the token
+ n = m_treeBuilder->parseToken(&m_currentToken);
+ }
+ m_currentToken.reset();
+
+ return n.release();
+}
+
+void LegacyHTMLDocumentParser::processDoctypeToken()
+{
+ if (inViewSourceMode())
+ static_cast<HTMLViewSourceDocument*>(document())->addViewSourceDoctypeToken(&m_doctypeToken);
+ else
+ m_treeBuilder->parseDoctypeToken(&m_doctypeToken);
+}
+
+LegacyHTMLDocumentParser::~LegacyHTMLDocumentParser()
+{
+ ASSERT(!m_inWrite);
+ reset();
+}
+
+
+void LegacyHTMLDocumentParser::enlargeBuffer(int len)
+{
+ // Resize policy: Always at least double the size of the buffer each time.
+ int delta = max(len, m_bufferSize);
+
+ // Check for overflow.
+ // For now, handle overflow the same way we handle fastRealloc failure, with CRASH.
+ static const int maxSize = INT_MAX / sizeof(UChar);
+ if (delta > maxSize - m_bufferSize)
+ CRASH();
+
+ int newSize = m_bufferSize + delta;
+ int oldOffset = m_dest - m_buffer;
+ m_buffer = static_cast<UChar*>(fastRealloc(m_buffer, newSize * sizeof(UChar)));
+ m_dest = m_buffer + oldOffset;
+ m_bufferSize = newSize;
+}
+
+void LegacyHTMLDocumentParser::enlargeScriptBuffer(int len)
+{
+ // Resize policy: Always at least double the size of the buffer each time.
+ int delta = max(len, m_scriptCodeCapacity);
+
+ // Check for overflow.
+ // For now, handle overflow the same way we handle fastRealloc failure, with CRASH.
+ static const int maxSize = INT_MAX / sizeof(UChar);
+ if (delta > maxSize - m_scriptCodeCapacity)
+ CRASH();
+
+ int newSize = m_scriptCodeCapacity + delta;
+ // If we allow fastRealloc(ptr, 0), it will call CRASH(). We run into this
+ // case if the HTML being parsed begins with "<!--" and there's more data
+ // coming.
+ if (!newSize) {
+ ASSERT(!m_scriptCode);
+ return;
+ }
+
+ m_scriptCode = static_cast<UChar*>(fastRealloc(m_scriptCode, newSize * sizeof(UChar)));
+ m_scriptCodeCapacity = newSize;
+}
+
+void LegacyHTMLDocumentParser::executeScriptsWaitingForStylesheets()
+{
+ ASSERT(document()->haveStylesheetsLoaded());
+
+ if (m_hasScriptsWaitingForStylesheets)
+ notifyFinished(0);
+}
+
+void LegacyHTMLDocumentParser::notifyFinished(CachedResource*)
+{
+ executeExternalScriptsIfReady();
+}
+
+void LegacyHTMLDocumentParser::executeExternalScriptsIfReady()
+{
+ ASSERT(!m_pendingScripts.isEmpty());
+
+ // Make external scripts wait for external stylesheets.
+ // FIXME: This needs to be done for inline scripts too.
+ m_hasScriptsWaitingForStylesheets = !document()->haveStylesheetsLoaded();
+ if (m_hasScriptsWaitingForStylesheets)
+ return;
+
+ bool finished = false;
+
+ double startTime = currentTime();
+ while (!finished && m_pendingScripts.first()->isLoaded()) {
+ if (!continueExecutingExternalScripts(startTime))
+ break;
+
+ CachedResourceHandle<CachedScript> cs = m_pendingScripts.takeFirst();
+ ASSERT(cache()->disabled() || cs->accessCount() > 0);
+
+ setSrc(SegmentedString());
+
+ // make sure we forget about the script before we execute the new one
+ // infinite recursion might happen otherwise
+ ScriptSourceCode sourceCode(cs.get());
+ bool errorOccurred = cs->errorOccurred();
+ cs->removeClient(this);
+
+ RefPtr<Node> n = m_scriptNode.release();
+
+ if (errorOccurred)
+ n->dispatchEvent(Event::create(eventNames().errorEvent, true, false));
+ else {
+ if (static_cast<HTMLScriptElement*>(n.get())->shouldExecuteAsJavaScript())
+ m_state = scriptExecution(sourceCode, m_state);
+#if ENABLE(XHTMLMP)
+ else
+ document()->setShouldProcessNoscriptElement(true);
+#endif
+ n->dispatchEvent(Event::create(eventNames().loadEvent, false, false));
+ }
+
+ // The state of m_pendingScripts.isEmpty() can change inside the scriptExecution()
+ // call above, so test afterwards.
+ finished = m_pendingScripts.isEmpty();
+ if (finished) {
+ ASSERT(!m_hasScriptsWaitingForStylesheets);
+ m_state.setLoadingExtScript(false);
+ } else if (m_hasScriptsWaitingForStylesheets) {
+ // m_hasScriptsWaitingForStylesheets flag might have changed during the script execution.
+ // If it did we are now blocked waiting for stylesheets and should not execute more scripts until they arrive.
+ finished = true;
+ }
+
+ // 'm_requestingScript' is true when we are called synchronously from
+ // scriptHandler(). In that case scriptHandler() will take care
+ // of m_pendingSrc.
+ if (!m_requestingScript) {
+ SegmentedString rest = m_pendingSrc;
+ m_pendingSrc.clear();
+ write(rest, false);
+ // we might be deleted at this point, do not access any members.
+ }
+ }
+}
+
+void LegacyHTMLDocumentParser::executeExternalScriptsTimerFired(Timer<LegacyHTMLDocumentParser>*)
+{
+ if (document()->view() && document()->view()->layoutPending() && !document()->minimumLayoutDelay()) {
+ // Restart the timer and do layout first.
+ m_externalScriptsTimer.startOneShot(0);
+ return;
+ }
+
+ // Continue executing external scripts.
+ executeExternalScriptsIfReady();
+}
+
+bool LegacyHTMLDocumentParser::continueExecutingExternalScripts(double startTime)
+{
+ if (m_externalScriptsTimer.isActive())
+ return false;
+
+ if (currentTime() - startTime > m_tokenizerTimeDelay) {
+ // Schedule the timer to keep processing as soon as possible.
+ m_externalScriptsTimer.startOneShot(0);
+ return false;
+ }
+ return true;
+}
+
+bool LegacyHTMLDocumentParser::isWaitingForScripts() const
+{
+ return m_state.loadingExtScript();
+}
+
+void LegacyHTMLDocumentParser::setSrc(const SegmentedString& source)
+{
+ m_src = source;
+}
+
+void LegacyHTMLDocumentParser::parseDocumentFragment(const String& source, DocumentFragment* fragment, FragmentScriptingPermission scriptingPermission)
+{
+ LegacyHTMLDocumentParser parser(fragment, scriptingPermission);
+ parser.setForceSynchronous(true);
+ parser.write(source, true);
+ parser.finish();
+ ASSERT(!parser.processingData()); // make sure we're done (see 3963151)
+}
+
+UChar decodeNamedEntity(const char* name)
+{
+ const Entity* e = findEntity(name, strlen(name));
+ return e ? e->code : 0;
+}
+
+}
diff --git a/WebCore/html/LegacyHTMLDocumentParser.h b/WebCore/html/LegacyHTMLDocumentParser.h
new file mode 100644
index 0000000..5b96bc3
--- /dev/null
+++ b/WebCore/html/LegacyHTMLDocumentParser.h
@@ -0,0 +1,452 @@
+/*
+ Copyright (C) 1997 Martin Jones (mjones@kde.org)
+ (C) 1997 Torben Weis (weis@kde.org)
+ (C) 1998 Waldo Bastian (bastian@kde.org)
+ (C) 2001 Dirk Mueller (mueller@kde.org)
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#ifndef LegacyHTMLDocumentParser_h
+#define LegacyHTMLDocumentParser_h
+
+#include "CachedResourceClient.h"
+#include "CachedResourceHandle.h"
+#include "FragmentScriptingPermission.h"
+#include "NamedNodeMap.h"
+#include "SegmentedString.h"
+#include "Timer.h"
+#include "DocumentParser.h"
+#include <wtf/Deque.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class CachedScript;
+class DocumentFragment;
+class Document;
+class HTMLDocument;
+class HTMLScriptElement;
+class HTMLViewSourceDocument;
+class FrameView;
+class LegacyHTMLTreeBuilder;
+class Node;
+class LegacyPreloadScanner;
+class ScriptSourceCode;
+
+/**
+ * @internal
+ * represents one HTML tag. Consists of a numerical id, and the list
+ * of attributes. Can also represent text. In this case the id = 0 and
+ * text contains the text.
+ */
+struct Token {
+ Token()
+ : beginTag(true)
+ , selfClosingTag(false)
+ , brokenXMLStyle(false)
+ , m_sourceInfo(0)
+ { }
+ ~Token() { }
+
+ void addAttribute(AtomicString& attrName, const AtomicString& v, bool viewSourceMode);
+
+ bool isOpenTag(const QualifiedName& fullName) const { return beginTag && fullName.localName() == tagName; }
+ bool isCloseTag(const QualifiedName& fullName) const { return !beginTag && fullName.localName() == tagName; }
+
+ void reset()
+ {
+ attrs = 0;
+ text = 0;
+ tagName = nullAtom;
+ beginTag = true;
+ selfClosingTag = false;
+ brokenXMLStyle = false;
+ if (m_sourceInfo)
+ m_sourceInfo->clear();
+ }
+
+ void addViewSourceChar(UChar c) { if (!m_sourceInfo.get()) m_sourceInfo.set(new Vector<UChar>); m_sourceInfo->append(c); }
+
+ RefPtr<NamedNodeMap> attrs;
+ RefPtr<StringImpl> text;
+ AtomicString tagName;
+ bool beginTag;
+ bool selfClosingTag;
+ bool brokenXMLStyle;
+ OwnPtr<Vector<UChar> > m_sourceInfo;
+};
+
+enum DoctypeState {
+ DoctypeBegin,
+ DoctypeBeforeName,
+ DoctypeName,
+ DoctypeAfterName,
+ DoctypeBeforePublicID,
+ DoctypePublicID,
+ DoctypeAfterPublicID,
+ DoctypeBeforeSystemID,
+ DoctypeSystemID,
+ DoctypeAfterSystemID,
+ DoctypeBogus
+};
+
+class DoctypeToken {
+public:
+ DoctypeToken() {}
+
+ void reset()
+ {
+ m_name.clear();
+ m_publicID.clear();
+ m_systemID.clear();
+ m_state = DoctypeBegin;
+ m_source.clear();
+ m_forceQuirks = false;
+ }
+
+ DoctypeState state() { return m_state; }
+ void setState(DoctypeState s) { m_state = s; }
+
+ Vector<UChar> m_name;
+ Vector<UChar> m_publicID;
+ Vector<UChar> m_systemID;
+ DoctypeState m_state;
+
+ Vector<UChar> m_source;
+
+ bool m_forceQuirks; // Used by the HTML5 parser.
+};
+
+//-----------------------------------------------------------------------------
+
+// FIXME: This class does too much. Right now it is both an HTML tokenizer as well
+// as handling all of the non-tokenizer-specific junk related to tokenizing HTML
+// (like dealing with <script> tags). The HTML tokenizer bits should be pushed
+// down into a separate HTML tokenizer class.
+
+class LegacyHTMLDocumentParser : public DocumentParser, public CachedResourceClient {
+public:
+ LegacyHTMLDocumentParser(HTMLDocument*, bool reportErrors);
+ LegacyHTMLDocumentParser(HTMLViewSourceDocument*);
+ LegacyHTMLDocumentParser(DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
+ virtual ~LegacyHTMLDocumentParser();
+
+ bool forceSynchronous() const { return m_state.forceSynchronous(); }
+ void setForceSynchronous(bool force);
+
+ // Exposed for LegacyHTMLTreeBuilder::reportErrorToConsole
+ bool processingContentWrittenByScript() const { return m_src.excludeLineNumbers(); }
+
+ static void parseDocumentFragment(const String&, DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
+
+protected:
+ // Exposed for FTPDirectoryDocumentParser
+ virtual void write(const SegmentedString&, bool appendData);
+ virtual void finish();
+
+private:
+ // DocumentParser
+ virtual bool finishWasCalled();
+ virtual bool isWaitingForScripts() const;
+ virtual void stopParsing();
+ virtual bool processingData() const;
+ virtual bool isExecutingScript() const { return !!m_executingScript; }
+
+ virtual int lineNumber() const { return m_lineNumber; }
+ virtual int columnNumber() const { return 1; }
+
+ virtual void executeScriptsWaitingForStylesheets();
+
+ virtual LegacyHTMLTreeBuilder* htmlTreeBuilder() const { return m_treeBuilder.get(); }
+ virtual LegacyHTMLDocumentParser* asHTMLDocumentParser() { return this; }
+
+ class State;
+
+ void begin();
+ void end();
+ void reset();
+
+ void willWriteHTML(const SegmentedString&);
+ ALWAYS_INLINE void advance(State&);
+ void didWriteHTML();
+
+ PassRefPtr<Node> processToken();
+ void processDoctypeToken();
+
+ State processListing(SegmentedString, State);
+ State parseComment(SegmentedString&, State);
+ State parseDoctype(SegmentedString&, State);
+ State parseServer(SegmentedString&, State);
+ State parseText(SegmentedString&, State);
+ State parseNonHTMLText(SegmentedString&, State);
+ State parseTag(SegmentedString&, State);
+ State parseEntity(SegmentedString&, UChar*& dest, State, unsigned& cBufferPos, bool start, bool parsingTag);
+ State parseProcessingInstruction(SegmentedString&, State);
+ State scriptHandler(State);
+ State scriptExecution(const ScriptSourceCode&, State);
+ void setSrc(const SegmentedString&);
+
+ // check if we have enough space in the buffer.
+ // if not enlarge it
+ inline void checkBuffer(int len = 10)
+ {
+ if ((m_dest - m_buffer) > m_bufferSize - len)
+ enlargeBuffer(len);
+ }
+
+ inline void checkScriptBuffer(int len = 10)
+ {
+ if (m_scriptCodeSize + len >= m_scriptCodeCapacity)
+ enlargeScriptBuffer(len);
+ }
+
+ void enlargeBuffer(int len);
+ void enlargeScriptBuffer(int len);
+
+ bool continueProcessing(int& processedCount, double startTime, State&);
+ void timerFired(Timer<LegacyHTMLDocumentParser>*);
+ void allDataProcessed();
+
+ // from CachedResourceClient
+ void notifyFinished(CachedResource*);
+
+ void executeExternalScriptsIfReady();
+ void executeExternalScriptsTimerFired(Timer<LegacyHTMLDocumentParser>*);
+ bool continueExecutingExternalScripts(double startTime);
+
+ // Internal buffers
+ ///////////////////
+ UChar* m_buffer;
+ int m_bufferSize;
+ UChar* m_dest;
+
+ Token m_currentToken;
+
+ // This buffer holds the raw characters we've seen between the beginning of
+ // the attribute name and the first character of the attribute value.
+ Vector<UChar, 32> m_rawAttributeBeforeValue;
+
+ // DocumentParser flags
+ //////////////////
+ // are we in quotes within a html tag
+ enum { NoQuote, SingleQuote, DoubleQuote } tquote;
+
+ // Are we in a &... character entity description?
+ enum EntityState {
+ NoEntity = 0,
+ SearchEntity = 1,
+ NumericSearch = 2,
+ Hexadecimal = 3,
+ Decimal = 4,
+ EntityName = 5,
+ SearchSemicolon = 6
+ };
+ unsigned EntityUnicodeValue;
+
+ enum TagState {
+ NoTag = 0,
+ TagName = 1,
+ SearchAttribute = 2,
+ AttributeName = 3,
+ SearchEqual = 4,
+ SearchValue = 5,
+ QuotedValue = 6,
+ Value = 7,
+ SearchEnd = 8
+ };
+
+ class State {
+ public:
+ State() : m_bits(0) { }
+
+ TagState tagState() const { return static_cast<TagState>(m_bits & TagMask); }
+ void setTagState(TagState t) { m_bits = (m_bits & ~TagMask) | t; }
+ EntityState entityState() const { return static_cast<EntityState>((m_bits & EntityMask) >> EntityShift); }
+ void setEntityState(EntityState e) { m_bits = (m_bits & ~EntityMask) | (e << EntityShift); }
+
+ bool inScript() const { return testBit(InScript); }
+ void setInScript(bool v) { setBit(InScript, v); }
+ bool inStyle() const { return testBit(InStyle); }
+ void setInStyle(bool v) { setBit(InStyle, v); }
+ bool inXmp() const { return testBit(InXmp); }
+ void setInXmp(bool v) { setBit(InXmp, v); }
+ bool inTitle() const { return testBit(InTitle); }
+ void setInTitle(bool v) { setBit(InTitle, v); }
+ bool inIFrame() const { return testBit(InIFrame); }
+ void setInIFrame(bool v) { setBit(InIFrame, v); }
+ bool inPlainText() const { return testBit(InPlainText); }
+ void setInPlainText(bool v) { setBit(InPlainText, v); }
+ bool inProcessingInstruction() const { return testBit(InProcessingInstruction); }
+ void setInProcessingInstruction(bool v) { return setBit(InProcessingInstruction, v); }
+ bool inComment() const { return testBit(InComment); }
+ void setInComment(bool v) { setBit(InComment, v); }
+ bool inDoctype() const { return testBit(InDoctype); }
+ void setInDoctype(bool v) { setBit(InDoctype, v); }
+ bool inTextArea() const { return testBit(InTextArea); }
+ void setInTextArea(bool v) { setBit(InTextArea, v); }
+ bool escaped() const { return testBit(Escaped); }
+ void setEscaped(bool v) { setBit(Escaped, v); }
+ bool inServer() const { return testBit(InServer); }
+ void setInServer(bool v) { setBit(InServer, v); }
+ bool skipLF() const { return testBit(SkipLF); }
+ void setSkipLF(bool v) { setBit(SkipLF, v); }
+ bool startTag() const { return testBit(StartTag); }
+ void setStartTag(bool v) { setBit(StartTag, v); }
+ bool discardLF() const { return testBit(DiscardLF); }
+ void setDiscardLF(bool v) { setBit(DiscardLF, v); }
+ bool allowYield() const { return testBit(AllowYield); }
+ void setAllowYield(bool v) { setBit(AllowYield, v); }
+ bool loadingExtScript() const { return testBit(LoadingExtScript); }
+ void setLoadingExtScript(bool v) { setBit(LoadingExtScript, v); }
+ bool forceSynchronous() const { return testBit(ForceSynchronous); }
+ void setForceSynchronous(bool v) { setBit(ForceSynchronous, v); }
+
+ bool inAnyNonHTMLText() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame); }
+ bool hasTagState() const { return m_bits & TagMask; }
+ bool hasEntityState() const { return m_bits & EntityMask; }
+
+ bool needsSpecialWriteHandling() const { return m_bits & (InScript | InStyle | InXmp | InTextArea | InTitle | InIFrame | TagMask | EntityMask | InPlainText | InComment | InDoctype | InServer | InProcessingInstruction | StartTag); }
+
+ private:
+ static const int EntityShift = 4;
+ enum StateBits {
+ TagMask = (1 << 4) - 1,
+ EntityMask = (1 << 7) - (1 << 4),
+ InScript = 1 << 7,
+ InStyle = 1 << 8,
+ // Bit 9 unused
+ InXmp = 1 << 10,
+ InTitle = 1 << 11,
+ InPlainText = 1 << 12,
+ InProcessingInstruction = 1 << 13,
+ InComment = 1 << 14,
+ InTextArea = 1 << 15,
+ Escaped = 1 << 16,
+ InServer = 1 << 17,
+ SkipLF = 1 << 18,
+ StartTag = 1 << 19,
+ DiscardLF = 1 << 20, // FIXME: should clarify difference between skip and discard
+ AllowYield = 1 << 21,
+ LoadingExtScript = 1 << 22,
+ ForceSynchronous = 1 << 23,
+ InIFrame = 1 << 24,
+ InDoctype = 1 << 25
+ };
+
+ void setBit(StateBits bit, bool value)
+ {
+ if (value)
+ m_bits |= bit;
+ else
+ m_bits &= ~bit;
+ }
+ bool testBit(StateBits bit) const { return m_bits & bit; }
+
+ unsigned m_bits;
+ };
+
+ State m_state;
+
+ DoctypeToken m_doctypeToken;
+ int m_doctypeSearchCount;
+ int m_doctypeSecondarySearchCount;
+
+ bool m_brokenServer;
+
+ // Name of an attribute that we just scanned.
+ AtomicString m_attrName;
+
+ // Used to store the code of a scripting sequence
+ UChar* m_scriptCode;
+ // Size of the script sequenze stored in @ref #scriptCode
+ int m_scriptCodeSize;
+ // Maximal size that can be stored in @ref #scriptCode
+ int m_scriptCodeCapacity;
+ // resync point of script code size
+ int m_scriptCodeResync;
+
+ // Stores characters if we are scanning for a string like "</script>"
+ UChar searchBuffer[10];
+
+ // Counts where we are in the string we are scanning for
+ int searchCount;
+ // the stopper string
+ const char* m_searchStopper;
+ int m_searchStopperLength;
+
+ // if no more data is coming, just parse what we have (including ext scripts that
+ // may be still downloading) and finish
+ bool m_noMoreData;
+ // URL to get source code of script from
+ String m_scriptTagSrcAttrValue;
+ String m_scriptTagCharsetAttrValue;
+ // the HTML code we will parse after the external script we are waiting for has loaded
+ SegmentedString m_pendingSrc;
+
+ // the HTML code we will parse after this particular script has
+ // loaded, but before all pending HTML
+ SegmentedString* m_currentPrependingSrc;
+
+ // true if we are executing a script while parsing a document. This causes the parsing of
+ // the output of the script to be postponed until after the script has finished executing
+ int m_executingScript;
+ Deque<CachedResourceHandle<CachedScript> > m_pendingScripts;
+ RefPtr<HTMLScriptElement> m_scriptNode;
+
+ bool m_requestingScript;
+ bool m_hasScriptsWaitingForStylesheets;
+
+ // if we found one broken comment, there are most likely others as well
+ // store a flag to get rid of the O(n^2) behaviour in such a case.
+ bool m_brokenComments;
+ // current line number
+ int m_lineNumber;
+ int m_currentScriptTagStartLineNumber;
+ int m_currentTagStartLineNumber;
+
+ double m_tokenizerTimeDelay;
+ int m_tokenizerChunkSize;
+
+ // The timer for continued processing.
+ Timer<LegacyHTMLDocumentParser> m_timer;
+
+ // The timer for continued executing external scripts.
+ Timer<LegacyHTMLDocumentParser> m_externalScriptsTimer;
+
+// This buffer can hold arbitrarily long user-defined attribute names, such as in EMBED tags.
+// So any fixed number might be too small, but rather than rewriting all usage of this buffer
+// we'll just make it large enough to handle all imaginable cases.
+#define CBUFLEN 1024
+ UChar m_cBuffer[CBUFLEN + 2];
+ unsigned int m_cBufferPos;
+
+ SegmentedString m_src;
+ OwnPtr<LegacyHTMLTreeBuilder> m_treeBuilder;
+ bool m_inWrite;
+ bool m_fragment;
+ FragmentScriptingPermission m_scriptingPermission;
+
+ OwnPtr<LegacyPreloadScanner> m_preloadScanner;
+};
+
+UChar decodeNamedEntity(const char*);
+
+} // namespace WebCore
+
+#endif // LegacyHTMLDocumentParser_h
diff --git a/WebCore/html/LegacyHTMLTreeConstructor.cpp b/WebCore/html/LegacyHTMLTreeBuilder.cpp
index 1db0bb6..7b44943 100644
--- a/WebCore/html/LegacyHTMLTreeConstructor.cpp
+++ b/WebCore/html/LegacyHTMLTreeBuilder.cpp
@@ -23,7 +23,7 @@
*/
#include "config.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "CharacterNames.h"
#include "CSSPropertyNames.h"
@@ -52,7 +52,7 @@
#include "HTMLTableCellElement.h"
#include "HTMLTableRowElement.h"
#include "HTMLTableSectionElement.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
#include "LocalizedStrings.h"
#include "Page.h"
#include "Settings.h"
@@ -140,7 +140,7 @@ struct HTMLStackElem : Noncopyable {
*
*/
-LegacyHTMLTreeConstructor::LegacyHTMLTreeConstructor(HTMLDocument* doc, bool reportErrors)
+LegacyHTMLTreeBuilder::LegacyHTMLTreeBuilder(HTMLDocument* doc, bool reportErrors)
: m_document(doc)
, m_current(doc)
, m_didRefCurrent(false)
@@ -160,7 +160,7 @@ LegacyHTMLTreeConstructor::LegacyHTMLTreeConstructor(HTMLDocument* doc, bool rep
{
}
-LegacyHTMLTreeConstructor::LegacyHTMLTreeConstructor(DocumentFragment* frag, FragmentScriptingPermission scriptingPermission)
+LegacyHTMLTreeBuilder::LegacyHTMLTreeBuilder(DocumentFragment* frag, FragmentScriptingPermission scriptingPermission)
: m_document(frag->document())
, m_current(frag)
, m_didRefCurrent(true)
@@ -182,14 +182,14 @@ LegacyHTMLTreeConstructor::LegacyHTMLTreeConstructor(DocumentFragment* frag, Fra
frag->ref();
}
-LegacyHTMLTreeConstructor::~LegacyHTMLTreeConstructor()
+LegacyHTMLTreeBuilder::~LegacyHTMLTreeBuilder()
{
freeBlock();
if (m_didRefCurrent)
m_current->deref();
}
-void LegacyHTMLTreeConstructor::reset()
+void LegacyHTMLTreeBuilder::reset()
{
ASSERT(!m_isParsingFragment);
@@ -214,7 +214,7 @@ void LegacyHTMLTreeConstructor::reset()
m_parserQuirks->reset();
}
-void LegacyHTMLTreeConstructor::setCurrent(Node* newCurrent)
+void LegacyHTMLTreeBuilder::setCurrent(Node* newCurrent)
{
bool didRefNewCurrent = newCurrent && newCurrent != m_document;
if (didRefNewCurrent)
@@ -230,7 +230,7 @@ inline static int tagPriorityOfNode(Node* n)
return n->isHTMLElement() ? static_cast<HTMLElement*>(n)->tagPriority() : 0;
}
-inline void LegacyHTMLTreeConstructor::limitDepth(int tagPriority)
+inline void LegacyHTMLTreeBuilder::limitDepth(int tagPriority)
{
while (m_treeDepth >= maxDOMTreeDepth)
popBlock(m_blockStack->tagName);
@@ -240,13 +240,13 @@ inline void LegacyHTMLTreeConstructor::limitDepth(int tagPriority)
}
}
-inline bool LegacyHTMLTreeConstructor::insertNodeAfterLimitDepth(Node* n, bool flat)
+inline bool LegacyHTMLTreeBuilder::insertNodeAfterLimitDepth(Node* n, bool flat)
{
limitDepth(tagPriorityOfNode(n));
return insertNode(n, flat);
}
-PassRefPtr<Node> LegacyHTMLTreeConstructor::parseToken(Token* t)
+PassRefPtr<Node> LegacyHTMLTreeBuilder::parseToken(Token* t)
{
if (!m_skipModeTag.isNull()) {
if (!t->beginTag && t->tagName == m_skipModeTag)
@@ -337,7 +337,7 @@ PassRefPtr<Node> LegacyHTMLTreeConstructor::parseToken(Token* t)
return n;
}
-void LegacyHTMLTreeConstructor::parseDoctypeToken(DoctypeToken* t)
+void LegacyHTMLTreeBuilder::parseDoctypeToken(DoctypeToken* t)
{
// Ignore any doctype after the first. Ignore doctypes in fragments.
if (m_document->doctype() || m_isParsingFragment || m_current != m_document)
@@ -372,7 +372,7 @@ static bool isScopingTag(const AtomicString& tagName)
|| tagName == objectTag || tagName == tableTag || tagName == htmlTag;
}
-bool LegacyHTMLTreeConstructor::insertNode(Node* n, bool flat)
+bool LegacyHTMLTreeBuilder::insertNode(Node* n, bool flat)
{
RefPtr<Node> protectNode(n);
@@ -429,7 +429,7 @@ bool LegacyHTMLTreeConstructor::insertNode(Node* n, bool flat)
return true;
}
-bool LegacyHTMLTreeConstructor::handleError(Node* n, bool flat, const AtomicString& localName, int tagPriority)
+bool LegacyHTMLTreeBuilder::handleError(Node* n, bool flat, const AtomicString& localName, int tagPriority)
{
// Error handling code. This is just ad hoc handling of specific parent/child combinations.
bool handled = false;
@@ -724,22 +724,22 @@ bool LegacyHTMLTreeConstructor::handleError(Node* n, bool flat, const AtomicStri
return insertNode(n);
}
-typedef bool (LegacyHTMLTreeConstructor::*CreateErrorCheckFunc)(Token* t, RefPtr<Node>&);
+typedef bool (LegacyHTMLTreeBuilder::*CreateErrorCheckFunc)(Token* t, RefPtr<Node>&);
typedef HashMap<AtomicStringImpl*, CreateErrorCheckFunc> FunctionMap;
-bool LegacyHTMLTreeConstructor::textCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::textCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
result = Text::create(m_document, t->text.get());
return false;
}
-bool LegacyHTMLTreeConstructor::commentCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::commentCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
result = Comment::create(m_document, t->text.get());
return false;
}
-bool LegacyHTMLTreeConstructor::headCreateErrorCheck(Token*, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::headCreateErrorCheck(Token*, RefPtr<Node>& result)
{
if (!m_head || m_current->localName() == htmlTag) {
m_head = HTMLHeadElement::create(m_document);
@@ -749,7 +749,7 @@ bool LegacyHTMLTreeConstructor::headCreateErrorCheck(Token*, RefPtr<Node>& resul
return false;
}
-bool LegacyHTMLTreeConstructor::bodyCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::bodyCreateErrorCheck(Token*, RefPtr<Node>&)
{
// body no longer allowed if we have a frameset
if (m_haveFrameSet)
@@ -765,7 +765,7 @@ bool LegacyHTMLTreeConstructor::bodyCreateErrorCheck(Token*, RefPtr<Node>&)
return true;
}
-bool LegacyHTMLTreeConstructor::framesetCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::framesetCreateErrorCheck(Token*, RefPtr<Node>&)
{
popBlock(headTag);
if (m_inBody && !m_haveFrameSet && !m_haveContent) {
@@ -785,7 +785,7 @@ bool LegacyHTMLTreeConstructor::framesetCreateErrorCheck(Token*, RefPtr<Node>&)
return true;
}
-bool LegacyHTMLTreeConstructor::formCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::formCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
// Only create a new form if we're not already inside one.
// This is consistent with other browsers' behavior.
@@ -797,7 +797,7 @@ bool LegacyHTMLTreeConstructor::formCreateErrorCheck(Token* t, RefPtr<Node>& res
return false;
}
-bool LegacyHTMLTreeConstructor::isindexCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::isindexCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
RefPtr<Node> n = handleIsindex(t);
if (!m_inBody)
@@ -809,12 +809,12 @@ bool LegacyHTMLTreeConstructor::isindexCreateErrorCheck(Token* t, RefPtr<Node>&
return false;
}
-bool LegacyHTMLTreeConstructor::selectCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::selectCreateErrorCheck(Token*, RefPtr<Node>&)
{
return true;
}
-bool LegacyHTMLTreeConstructor::ddCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::ddCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
pCloserCreateErrorCheck(t, result);
popBlock(dtTag);
@@ -822,7 +822,7 @@ bool LegacyHTMLTreeConstructor::ddCreateErrorCheck(Token* t, RefPtr<Node>& resul
return true;
}
-bool LegacyHTMLTreeConstructor::dtCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::dtCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
pCloserCreateErrorCheck(t, result);
popBlock(ddTag);
@@ -830,46 +830,46 @@ bool LegacyHTMLTreeConstructor::dtCreateErrorCheck(Token* t, RefPtr<Node>& resul
return true;
}
-bool LegacyHTMLTreeConstructor::rpCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::rpCreateErrorCheck(Token*, RefPtr<Node>&)
{
popBlock(rpTag);
popBlock(rtTag);
return true;
}
-bool LegacyHTMLTreeConstructor::rtCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::rtCreateErrorCheck(Token*, RefPtr<Node>&)
{
popBlock(rpTag);
popBlock(rtTag);
return true;
}
-bool LegacyHTMLTreeConstructor::nestedCreateErrorCheck(Token* t, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::nestedCreateErrorCheck(Token* t, RefPtr<Node>&)
{
popBlock(t->tagName);
return true;
}
-bool LegacyHTMLTreeConstructor::nestedPCloserCreateErrorCheck(Token* t, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::nestedPCloserCreateErrorCheck(Token* t, RefPtr<Node>& result)
{
pCloserCreateErrorCheck(t, result);
popBlock(t->tagName);
return true;
}
-bool LegacyHTMLTreeConstructor::nestedStyleCreateErrorCheck(Token* t, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::nestedStyleCreateErrorCheck(Token* t, RefPtr<Node>&)
{
return allowNestedRedundantTag(t->tagName);
}
-bool LegacyHTMLTreeConstructor::tableCellCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::tableCellCreateErrorCheck(Token*, RefPtr<Node>&)
{
popBlock(tdTag);
popBlock(thTag);
return true;
}
-bool LegacyHTMLTreeConstructor::tableSectionCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::tableSectionCreateErrorCheck(Token*, RefPtr<Node>&)
{
popBlock(theadTag);
popBlock(tbodyTag);
@@ -877,19 +877,19 @@ bool LegacyHTMLTreeConstructor::tableSectionCreateErrorCheck(Token*, RefPtr<Node
return true;
}
-bool LegacyHTMLTreeConstructor::noembedCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::noembedCreateErrorCheck(Token*, RefPtr<Node>&)
{
setSkipMode(noembedTag);
return true;
}
-bool LegacyHTMLTreeConstructor::noframesCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::noframesCreateErrorCheck(Token*, RefPtr<Node>&)
{
setSkipMode(noframesTag);
return true;
}
-bool LegacyHTMLTreeConstructor::noscriptCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::noscriptCreateErrorCheck(Token*, RefPtr<Node>&)
{
if (!m_isParsingFragment) {
Frame* frame = m_document->frame();
@@ -899,14 +899,14 @@ bool LegacyHTMLTreeConstructor::noscriptCreateErrorCheck(Token*, RefPtr<Node>&)
return true;
}
-bool LegacyHTMLTreeConstructor::pCloserCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::pCloserCreateErrorCheck(Token*, RefPtr<Node>&)
{
if (hasPElementInScope())
popBlock(pTag);
return true;
}
-bool LegacyHTMLTreeConstructor::pCloserStrictCreateErrorCheck(Token*, RefPtr<Node>&)
+bool LegacyHTMLTreeBuilder::pCloserStrictCreateErrorCheck(Token*, RefPtr<Node>&)
{
if (m_document->inCompatMode())
return true;
@@ -915,7 +915,7 @@ bool LegacyHTMLTreeConstructor::pCloserStrictCreateErrorCheck(Token*, RefPtr<Nod
return true;
}
-bool LegacyHTMLTreeConstructor::mapCreateErrorCheck(Token*, RefPtr<Node>& result)
+bool LegacyHTMLTreeBuilder::mapCreateErrorCheck(Token*, RefPtr<Node>& result)
{
m_currentMapElement = HTMLMapElement::create(m_document);
result = m_currentMapElement;
@@ -936,48 +936,48 @@ static void mapTagsToFunc(FunctionMap& map, QualifiedName (&names)[ArraySize], C
}
}
-PassRefPtr<Node> LegacyHTMLTreeConstructor::getNode(Token* t)
+PassRefPtr<Node> LegacyHTMLTreeBuilder::getNode(Token* t)
{
// Init our error handling table.
DEFINE_STATIC_LOCAL(FunctionMap, gFunctionMap, ());
if (gFunctionMap.isEmpty()) {
QualifiedName nestedCreateErrorTags[] = { aTag, buttonTag, nobrTag, trTag };
- mapTagsToFunc(gFunctionMap, nestedCreateErrorTags, &LegacyHTMLTreeConstructor::nestedCreateErrorCheck);
+ mapTagsToFunc(gFunctionMap, nestedCreateErrorTags, &LegacyHTMLTreeBuilder::nestedCreateErrorCheck);
QualifiedName nestedStyleCreateErrorTags[] = { bTag, bigTag, iTag, sTag, smallTag, strikeTag, ttTag, uTag };
- mapTagsToFunc(gFunctionMap, nestedStyleCreateErrorTags, &LegacyHTMLTreeConstructor::nestedStyleCreateErrorCheck);
+ mapTagsToFunc(gFunctionMap, nestedStyleCreateErrorTags, &LegacyHTMLTreeBuilder::nestedStyleCreateErrorCheck);
QualifiedName pCloserCreateErrorTags[] = { addressTag, articleTag,
asideTag, blockquoteTag, centerTag, dirTag, divTag, dlTag,
fieldsetTag, footerTag, h1Tag, h2Tag, h3Tag, h4Tag, h5Tag, h6Tag,
headerTag, hgroupTag, hrTag, listingTag, menuTag, navTag, olTag,
pTag, plaintextTag, preTag, sectionTag, ulTag };
- mapTagsToFunc(gFunctionMap, pCloserCreateErrorTags, &LegacyHTMLTreeConstructor::pCloserCreateErrorCheck);
-
- mapTagToFunc(gFunctionMap, bodyTag, &LegacyHTMLTreeConstructor::bodyCreateErrorCheck);
- mapTagToFunc(gFunctionMap, ddTag, &LegacyHTMLTreeConstructor::ddCreateErrorCheck);
- mapTagToFunc(gFunctionMap, dtTag, &LegacyHTMLTreeConstructor::dtCreateErrorCheck);
- mapTagToFunc(gFunctionMap, formTag, &LegacyHTMLTreeConstructor::formCreateErrorCheck);
- mapTagToFunc(gFunctionMap, framesetTag, &LegacyHTMLTreeConstructor::framesetCreateErrorCheck);
- mapTagToFunc(gFunctionMap, headTag, &LegacyHTMLTreeConstructor::headCreateErrorCheck);
- mapTagToFunc(gFunctionMap, isindexTag, &LegacyHTMLTreeConstructor::isindexCreateErrorCheck);
- mapTagToFunc(gFunctionMap, mapTag, &LegacyHTMLTreeConstructor::mapCreateErrorCheck);
- mapTagToFunc(gFunctionMap, liTag, &LegacyHTMLTreeConstructor::nestedPCloserCreateErrorCheck);
- mapTagToFunc(gFunctionMap, noembedTag, &LegacyHTMLTreeConstructor::noembedCreateErrorCheck);
- mapTagToFunc(gFunctionMap, noframesTag, &LegacyHTMLTreeConstructor::noframesCreateErrorCheck);
- mapTagToFunc(gFunctionMap, noscriptTag, &LegacyHTMLTreeConstructor::noscriptCreateErrorCheck);
- mapTagToFunc(gFunctionMap, tableTag, &LegacyHTMLTreeConstructor::pCloserStrictCreateErrorCheck);
- mapTagToFunc(gFunctionMap, rpTag, &LegacyHTMLTreeConstructor::rpCreateErrorCheck);
- mapTagToFunc(gFunctionMap, rtTag, &LegacyHTMLTreeConstructor::rtCreateErrorCheck);
- mapTagToFunc(gFunctionMap, selectTag, &LegacyHTMLTreeConstructor::selectCreateErrorCheck);
- mapTagToFunc(gFunctionMap, tdTag, &LegacyHTMLTreeConstructor::tableCellCreateErrorCheck);
- mapTagToFunc(gFunctionMap, thTag, &LegacyHTMLTreeConstructor::tableCellCreateErrorCheck);
- mapTagToFunc(gFunctionMap, tbodyTag, &LegacyHTMLTreeConstructor::tableSectionCreateErrorCheck);
- mapTagToFunc(gFunctionMap, tfootTag, &LegacyHTMLTreeConstructor::tableSectionCreateErrorCheck);
- mapTagToFunc(gFunctionMap, theadTag, &LegacyHTMLTreeConstructor::tableSectionCreateErrorCheck);
-
- gFunctionMap.set(commentAtom.impl(), &LegacyHTMLTreeConstructor::commentCreateErrorCheck);
- gFunctionMap.set(textAtom.impl(), &LegacyHTMLTreeConstructor::textCreateErrorCheck);
+ mapTagsToFunc(gFunctionMap, pCloserCreateErrorTags, &LegacyHTMLTreeBuilder::pCloserCreateErrorCheck);
+
+ mapTagToFunc(gFunctionMap, bodyTag, &LegacyHTMLTreeBuilder::bodyCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, ddTag, &LegacyHTMLTreeBuilder::ddCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, dtTag, &LegacyHTMLTreeBuilder::dtCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, formTag, &LegacyHTMLTreeBuilder::formCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, framesetTag, &LegacyHTMLTreeBuilder::framesetCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, headTag, &LegacyHTMLTreeBuilder::headCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, isindexTag, &LegacyHTMLTreeBuilder::isindexCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, mapTag, &LegacyHTMLTreeBuilder::mapCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, liTag, &LegacyHTMLTreeBuilder::nestedPCloserCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, noembedTag, &LegacyHTMLTreeBuilder::noembedCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, noframesTag, &LegacyHTMLTreeBuilder::noframesCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, noscriptTag, &LegacyHTMLTreeBuilder::noscriptCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, tableTag, &LegacyHTMLTreeBuilder::pCloserStrictCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, rpTag, &LegacyHTMLTreeBuilder::rpCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, rtTag, &LegacyHTMLTreeBuilder::rtCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, selectTag, &LegacyHTMLTreeBuilder::selectCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, tdTag, &LegacyHTMLTreeBuilder::tableCellCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, thTag, &LegacyHTMLTreeBuilder::tableCellCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, tbodyTag, &LegacyHTMLTreeBuilder::tableSectionCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, tfootTag, &LegacyHTMLTreeBuilder::tableSectionCreateErrorCheck);
+ mapTagToFunc(gFunctionMap, theadTag, &LegacyHTMLTreeBuilder::tableSectionCreateErrorCheck);
+
+ gFunctionMap.set(commentAtom.impl(), &LegacyHTMLTreeBuilder::commentCreateErrorCheck);
+ gFunctionMap.set(textAtom.impl(), &LegacyHTMLTreeBuilder::textCreateErrorCheck);
}
bool proceed = true;
@@ -989,7 +989,7 @@ PassRefPtr<Node> LegacyHTMLTreeConstructor::getNode(Token* t)
return result.release();
}
-bool LegacyHTMLTreeConstructor::allowNestedRedundantTag(const AtomicString& tagName)
+bool LegacyHTMLTreeBuilder::allowNestedRedundantTag(const AtomicString& tagName)
{
// www.liceo.edu.mx is an example of a site that achieves a level of nesting of
// about 1500 tags, all from a bunch of <b>s. We will only allow at most 20
@@ -1001,7 +1001,7 @@ bool LegacyHTMLTreeConstructor::allowNestedRedundantTag(const AtomicString& tagN
return i != cMaxRedundantTagDepth;
}
-void LegacyHTMLTreeConstructor::processCloseTag(Token* t)
+void LegacyHTMLTreeBuilder::processCloseTag(Token* t)
{
// Support for really broken html.
// we never close the body tag, since some stupid web pages close it before the actual end of the doc.
@@ -1031,7 +1031,7 @@ void LegacyHTMLTreeConstructor::processCloseTag(Token* t)
}
}
-bool LegacyHTMLTreeConstructor::isHeadingTag(const AtomicString& tagName)
+bool LegacyHTMLTreeBuilder::isHeadingTag(const AtomicString& tagName)
{
DEFINE_STATIC_LOCAL(TagNameSet, headingTags, ());
if (headingTags.isEmpty()) {
@@ -1041,7 +1041,7 @@ bool LegacyHTMLTreeConstructor::isHeadingTag(const AtomicString& tagName)
return headingTags.contains(tagName.impl());
}
-bool LegacyHTMLTreeConstructor::isInline(Node* node) const
+bool LegacyHTMLTreeBuilder::isInline(Node* node) const
{
if (node->isTextNode())
return true;
@@ -1071,7 +1071,7 @@ bool LegacyHTMLTreeConstructor::isInline(Node* node) const
return false;
}
-bool LegacyHTMLTreeConstructor::isResidualStyleTag(const AtomicString& tagName)
+bool LegacyHTMLTreeBuilder::isResidualStyleTag(const AtomicString& tagName)
{
DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, residualStyleTags, ());
if (residualStyleTags.isEmpty()) {
@@ -1083,7 +1083,7 @@ bool LegacyHTMLTreeConstructor::isResidualStyleTag(const AtomicString& tagName)
return residualStyleTags.contains(tagName.impl());
}
-bool LegacyHTMLTreeConstructor::isAffectedByResidualStyle(const AtomicString& tagName)
+bool LegacyHTMLTreeBuilder::isAffectedByResidualStyle(const AtomicString& tagName)
{
DEFINE_STATIC_LOCAL(HashSet<AtomicStringImpl*>, unaffectedTags, ());
if (unaffectedTags.isEmpty()) {
@@ -1095,7 +1095,7 @@ bool LegacyHTMLTreeConstructor::isAffectedByResidualStyle(const AtomicString& ta
return !unaffectedTags.contains(tagName.impl());
}
-void LegacyHTMLTreeConstructor::handleResidualStyleCloseTagAcrossBlocks(HTMLStackElem* elem)
+void LegacyHTMLTreeBuilder::handleResidualStyleCloseTagAcrossBlocks(HTMLStackElem* elem)
{
HTMLStackElem* maxElem = 0;
bool finished = false;
@@ -1326,7 +1326,7 @@ void LegacyHTMLTreeConstructor::handleResidualStyleCloseTagAcrossBlocks(HTMLStac
m_handlingResidualStyleAcrossBlocks = false;
}
-void LegacyHTMLTreeConstructor::reopenResidualStyleTags(HTMLStackElem* elem, Node* malformedTableParent)
+void LegacyHTMLTreeBuilder::reopenResidualStyleTags(HTMLStackElem* elem, Node* malformedTableParent)
{
// Loop for each tag that needs to be reopened.
while (elem) {
@@ -1367,7 +1367,7 @@ void LegacyHTMLTreeConstructor::reopenResidualStyleTags(HTMLStackElem* elem, Nod
}
}
-void LegacyHTMLTreeConstructor::pushBlock(const AtomicString& tagName, int level)
+void LegacyHTMLTreeBuilder::pushBlock(const AtomicString& tagName, int level)
{
m_blockStack = new HTMLStackElem(tagName, level, m_current, m_didRefCurrent, m_blockStack);
if (level >= minBlockLevelTagPriority)
@@ -1380,7 +1380,7 @@ void LegacyHTMLTreeConstructor::pushBlock(const AtomicString& tagName, int level
m_hasPElementInScope = NotInScope;
}
-void LegacyHTMLTreeConstructor::popBlock(const AtomicString& tagName, bool reportErrors)
+void LegacyHTMLTreeBuilder::popBlock(const AtomicString& tagName, bool reportErrors)
{
HTMLStackElem* elem = m_blockStack;
@@ -1469,7 +1469,7 @@ void LegacyHTMLTreeConstructor::popBlock(const AtomicString& tagName, bool repor
reopenResidualStyleTags(residualStyleStack, malformedTableParent);
}
-inline HTMLStackElem* LegacyHTMLTreeConstructor::popOneBlockCommon()
+inline HTMLStackElem* LegacyHTMLTreeBuilder::popOneBlockCommon()
{
HTMLStackElem* elem = m_blockStack;
@@ -1498,7 +1498,7 @@ inline HTMLStackElem* LegacyHTMLTreeConstructor::popOneBlockCommon()
return elem;
}
-void LegacyHTMLTreeConstructor::popOneBlock()
+void LegacyHTMLTreeBuilder::popOneBlock()
{
// Store the current node before popOneBlockCommon overwrites it.
Node* lastCurrent = m_current;
@@ -1510,7 +1510,7 @@ void LegacyHTMLTreeConstructor::popOneBlock()
lastCurrent->deref();
}
-void LegacyHTMLTreeConstructor::moveOneBlockToStack(HTMLStackElem*& head)
+void LegacyHTMLTreeBuilder::moveOneBlockToStack(HTMLStackElem*& head)
{
// We'll be using the stack element we're popping, but for the current node.
// See the two callers for details.
@@ -1532,7 +1532,7 @@ void LegacyHTMLTreeConstructor::moveOneBlockToStack(HTMLStackElem*& head)
head = elem;
}
-void LegacyHTMLTreeConstructor::checkIfHasPElementInScope()
+void LegacyHTMLTreeBuilder::checkIfHasPElementInScope()
{
m_hasPElementInScope = NotInScope;
HTMLStackElem* elem = m_blockStack;
@@ -1547,13 +1547,13 @@ void LegacyHTMLTreeConstructor::checkIfHasPElementInScope()
}
}
-void LegacyHTMLTreeConstructor::popInlineBlocks()
+void LegacyHTMLTreeBuilder::popInlineBlocks()
{
while (m_blockStack && isInline(m_current))
popOneBlock();
}
-void LegacyHTMLTreeConstructor::freeBlock()
+void LegacyHTMLTreeBuilder::freeBlock()
{
while (m_blockStack)
popOneBlock();
@@ -1561,7 +1561,7 @@ void LegacyHTMLTreeConstructor::freeBlock()
ASSERT(!m_treeDepth);
}
-void LegacyHTMLTreeConstructor::createHead()
+void LegacyHTMLTreeBuilder::createHead()
{
if (m_head)
return;
@@ -1589,7 +1589,7 @@ void LegacyHTMLTreeConstructor::createHead()
}
}
-PassRefPtr<Node> LegacyHTMLTreeConstructor::handleIsindex(Token* t)
+PassRefPtr<Node> LegacyHTMLTreeBuilder::handleIsindex(Token* t)
{
RefPtr<Node> n = HTMLDivElement::create(m_document);
@@ -1614,7 +1614,7 @@ PassRefPtr<Node> LegacyHTMLTreeConstructor::handleIsindex(Token* t)
return n.release();
}
-void LegacyHTMLTreeConstructor::startBody()
+void LegacyHTMLTreeBuilder::startBody()
{
if (m_inBody)
return;
@@ -1627,7 +1627,7 @@ void LegacyHTMLTreeConstructor::startBody()
}
}
-void LegacyHTMLTreeConstructor::finished()
+void LegacyHTMLTreeBuilder::finished()
{
// In the case of a completely empty document, here's the place to create the HTML element.
if (m_current && m_current->isDocumentNode() && !m_document->documentElement())
@@ -1642,14 +1642,13 @@ void LegacyHTMLTreeConstructor::finished()
m_document->finishedParsing();
}
-void LegacyHTMLTreeConstructor::reportErrorToConsole(HTMLParserErrorCode errorCode, const AtomicString* tagName1, const AtomicString* tagName2, bool closeTags)
+void LegacyHTMLTreeBuilder::reportErrorToConsole(HTMLParserErrorCode errorCode, const AtomicString* tagName1, const AtomicString* tagName2, bool closeTags)
{
Frame* frame = m_document->frame();
if (!frame)
return;
- HTMLDocumentParser* htmlTokenizer = static_cast<HTMLDocumentParser*>(m_document->parser());
- int lineNumber = htmlTokenizer->lineNumber() + 1;
+ int lineNumber = m_document->parser()->lineNumber() + 1;
AtomicString tag1;
AtomicString tag2;
@@ -1673,9 +1672,11 @@ void LegacyHTMLTreeConstructor::reportErrorToConsole(HTMLParserErrorCode errorCo
const char* errorMsg = htmlParserErrorMessageTemplate(errorCode);
if (!errorMsg)
return;
-
+
String message;
- if (htmlTokenizer->processingContentWrittenByScript())
+ // FIXME: This doesn't work for the new HTMLDocumentParser and should.
+ LegacyHTMLDocumentParser* htmlParser = m_document->parser()->asHTMLDocumentParser();
+ if (htmlParser && htmlParser->processingContentWrittenByScript())
message += htmlParserDocumentWriteMessage();
message += errorMsg;
message.replace("%tag1", tag1);
diff --git a/WebCore/html/LegacyHTMLTreeConstructor.h b/WebCore/html/LegacyHTMLTreeBuilder.h
index ab1f5aa..cfd9519 100644
--- a/WebCore/html/LegacyHTMLTreeConstructor.h
+++ b/WebCore/html/LegacyHTMLTreeBuilder.h
@@ -21,11 +21,11 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef HTMLParser_h
-#define HTMLParser_h
+#ifndef LegacyHTMLTreeBuilder_h
+#define LegacyHTMLTreeBuilder_h
+#include "FragmentScriptingPermission.h"
#include "HTMLParserErrorCodes.h"
-#include "MappedAttributeEntry.h"
#include "QualifiedName.h"
#include <wtf/Forward.h>
#include <wtf/OwnPtr.h>
@@ -47,14 +47,14 @@ struct HTMLStackElem;
struct Token;
/**
- * The parser for HTML. It receives a stream of tokens from the HTMLDocumentParser, and
+ * The parser for HTML. It receives a stream of tokens from the LegacyHTMLDocumentParser, and
* builds up the Document structure from it.
*/
-class LegacyHTMLTreeConstructor : public Noncopyable {
+class LegacyHTMLTreeBuilder : public Noncopyable {
public:
- LegacyHTMLTreeConstructor(HTMLDocument*, bool reportErrors);
- LegacyHTMLTreeConstructor(DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
- virtual ~LegacyHTMLTreeConstructor();
+ LegacyHTMLTreeBuilder(HTMLDocument*, bool reportErrors);
+ LegacyHTMLTreeBuilder(DocumentFragment*, FragmentScriptingPermission = FragmentScriptingAllowed);
+ virtual ~LegacyHTMLTreeBuilder();
/**
* parses one token delivered by the tokenizer
@@ -211,4 +211,4 @@ String serializeForNumberType(double);
}
-#endif // HTMLParser_h
+#endif // LegacyHTMLTreeBuilder_h
diff --git a/WebCore/html/PreloadScanner.cpp b/WebCore/html/LegacyPreloadScanner.cpp
index d39092a..c9fda4f 100644
--- a/WebCore/html/PreloadScanner.cpp
+++ b/WebCore/html/LegacyPreloadScanner.cpp
@@ -25,7 +25,7 @@
*/
#include "config.h"
-#include "PreloadScanner.h"
+#include "LegacyPreloadScanner.h"
#include "AtomicString.h"
#include "CachedCSSStyleSheet.h"
@@ -65,7 +65,7 @@ namespace WebCore {
using namespace HTMLNames;
-PreloadScanner::PreloadScanner(Document* doc)
+LegacyPreloadScanner::LegacyPreloadScanner(Document* doc)
: m_inProgress(false)
, m_timeUsed(0)
, m_bodySeen(false)
@@ -76,7 +76,7 @@ PreloadScanner::PreloadScanner(Document* doc)
#endif
}
-PreloadScanner::~PreloadScanner()
+LegacyPreloadScanner::~LegacyPreloadScanner()
{
#if PRELOAD_DEBUG
printf("DELETING PRELOAD SCANNER FOR %s\n", m_document->url().string().latin1().data());
@@ -84,20 +84,20 @@ PreloadScanner::~PreloadScanner()
#endif
}
-void PreloadScanner::begin()
+void LegacyPreloadScanner::begin()
{
ASSERT(!m_inProgress);
reset();
m_inProgress = true;
}
-void PreloadScanner::end()
+void LegacyPreloadScanner::end()
{
ASSERT(m_inProgress);
m_inProgress = false;
}
-void PreloadScanner::reset()
+void LegacyPreloadScanner::reset()
{
m_source.clear();
@@ -123,12 +123,12 @@ void PreloadScanner::reset()
m_cssRuleValue.clear();
}
-bool PreloadScanner::scanningBody() const
+bool LegacyPreloadScanner::scanningBody() const
{
return m_document->body() || m_bodySeen;
}
-void PreloadScanner::write(const SegmentedString& source)
+void LegacyPreloadScanner::write(const SegmentedString& source)
{
#if PRELOAD_DEBUG
double startTime = currentTime();
@@ -144,18 +144,18 @@ static inline bool isWhitespace(UChar c)
return c == ' ' || c == '\n' || c == '\r' || c == '\t';
}
-inline void PreloadScanner::clearLastCharacters()
+inline void LegacyPreloadScanner::clearLastCharacters()
{
memset(m_lastCharacters, 0, lastCharactersBufferSize * sizeof(UChar));
}
-inline void PreloadScanner::rememberCharacter(UChar c)
+inline void LegacyPreloadScanner::rememberCharacter(UChar c)
{
m_lastCharacterIndex = (m_lastCharacterIndex + 1) % lastCharactersBufferSize;
m_lastCharacters[m_lastCharacterIndex] = c;
}
-inline bool PreloadScanner::lastCharactersMatch(const char* chars, unsigned count) const
+inline bool LegacyPreloadScanner::lastCharactersMatch(const char* chars, unsigned count) const
{
unsigned pos = m_lastCharacterIndex;
while (count) {
@@ -177,7 +177,7 @@ static inline unsigned legalEntityFor(unsigned value)
return value;
}
-unsigned PreloadScanner::consumeEntity(SegmentedString& source, bool& notEnoughCharacters)
+unsigned LegacyPreloadScanner::consumeEntity(SegmentedString& source, bool& notEnoughCharacters)
{
enum EntityState {
Initial,
@@ -295,7 +295,7 @@ outOfCharacters:
return 0;
}
-void PreloadScanner::tokenize(const SegmentedString& source)
+void LegacyPreloadScanner::tokenize(const SegmentedString& source)
{
ASSERT(m_inProgress);
@@ -688,7 +688,7 @@ void PreloadScanner::tokenize(const SegmentedString& source)
}
}
-void PreloadScanner::processAttribute()
+void LegacyPreloadScanner::processAttribute()
{
AtomicString tag = AtomicString(m_tagName.data(), m_tagName.size());
AtomicString attribute = AtomicString(m_attributeName.data(), m_attributeName.size());
@@ -711,13 +711,13 @@ void PreloadScanner::processAttribute()
}
}
-inline void PreloadScanner::emitCharacter(UChar c)
+inline void LegacyPreloadScanner::emitCharacter(UChar c)
{
if (m_contentModel == CDATA && m_lastStartTag == styleTag)
tokenizeCSS(c);
}
-inline void PreloadScanner::tokenizeCSS(UChar c)
+inline void LegacyPreloadScanner::tokenizeCSS(UChar c)
{
// We are just interested in @import rules, no need for real tokenization here
// Searching for other types of resources is probably low payoff
@@ -796,7 +796,7 @@ inline void PreloadScanner::tokenizeCSS(UChar c)
}
}
-void PreloadScanner::emitTag()
+void LegacyPreloadScanner::emitTag()
{
if (m_closeTag) {
m_contentModel = PCDATA;
@@ -840,7 +840,7 @@ void PreloadScanner::emitTag()
m_linkIsStyleSheet = false;
}
-void PreloadScanner::emitCSSRule()
+void LegacyPreloadScanner::emitCSSRule()
{
String rule(m_cssRule.data(), m_cssRule.size());
if (equalIgnoringCase(rule, "import") && !m_cssRuleValue.isEmpty()) {
diff --git a/WebCore/html/PreloadScanner.h b/WebCore/html/LegacyPreloadScanner.h
index 6022ee7..95710ab 100644
--- a/WebCore/html/PreloadScanner.h
+++ b/WebCore/html/LegacyPreloadScanner.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PreloadScanner_h
-#define PreloadScanner_h
+#ifndef LegacyPreloadScanner_h
+#define LegacyPreloadScanner_h
#include "AtomicString.h"
#include "SegmentedString.h"
@@ -37,10 +37,10 @@ namespace WebCore {
class CachedResourceClient;
class Document;
- class PreloadScanner : public Noncopyable {
+ class LegacyPreloadScanner : public Noncopyable {
public:
- PreloadScanner(Document*);
- ~PreloadScanner();
+ LegacyPreloadScanner(Document*);
+ ~LegacyPreloadScanner();
void begin();
void write(const SegmentedString&);
void end();
diff --git a/WebCore/html/StepRange.cpp b/WebCore/html/StepRange.cpp
index 3923abe..9afde1b 100644
--- a/WebCore/html/StepRange.cpp
+++ b/WebCore/html/StepRange.cpp
@@ -23,7 +23,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "PlatformString.h"
#include <wtf/MathExtras.h>
diff --git a/WebCore/html/ValidityState.cpp b/WebCore/html/ValidityState.cpp
index 7f6b8be..6a159e8 100644
--- a/WebCore/html/ValidityState.cpp
+++ b/WebCore/html/ValidityState.cpp
@@ -26,7 +26,7 @@
#include "HTMLInputElement.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "KURL.h"
#include "LocalizedStrings.h"
#include "RegularExpression.h"
diff --git a/WebCore/html/canvas/ArrayBuffer.idl b/WebCore/html/canvas/ArrayBuffer.idl
index 3165494..92098e5 100644
--- a/WebCore/html/canvas/ArrayBuffer.idl
+++ b/WebCore/html/canvas/ArrayBuffer.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -24,7 +24,14 @@
*/
module html {
- interface [Conditional=3D_CANVAS, CustomConstructor] ArrayBuffer {
+
+ interface [
+ Conditional=3D_CANVAS,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor
+ ] ArrayBuffer {
readonly attribute int byteLength;
};
+
}
diff --git a/WebCore/html/canvas/CanvasRenderingContext2D.cpp b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
index 8531bd5..522e51d 100644
--- a/WebCore/html/canvas/CanvasRenderingContext2D.cpp
+++ b/WebCore/html/canvas/CanvasRenderingContext2D.cpp
@@ -929,7 +929,7 @@ void CanvasRenderingContext2D::applyShadow()
float width = state().m_shadowOffset.width();
float height = state().m_shadowOffset.height();
- c->setShadow(IntSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
+ c->setShadow(FloatSize(width, -height), state().m_shadowBlur, state().m_shadowColor, DeviceColorSpace);
}
static IntSize size(HTMLImageElement* image)
diff --git a/WebCore/html/canvas/Float32Array.idl b/WebCore/html/canvas/Float32Array.idl
index 91a9f4e..651e74f 100644
--- a/WebCore/html/canvas/Float32Array.idl
+++ b/WebCore/html/canvas/Float32Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,10 +27,12 @@
module html {
interface [
Conditional=3D_CANVAS,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomConstructor,
CustomToJS
] Float32Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 4;
diff --git a/WebCore/html/canvas/Int16Array.idl b/WebCore/html/canvas/Int16Array.idl
index 95c8204..095611b 100644
--- a/WebCore/html/canvas/Int16Array.idl
+++ b/WebCore/html/canvas/Int16Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006, 2010 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -26,10 +26,12 @@
module html {
interface [
Conditional=3D_CANVAS,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomConstructor,
CustomToJS
] Int16Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 2;
diff --git a/WebCore/html/canvas/Int32Array.idl b/WebCore/html/canvas/Int32Array.idl
index 9c9a50f..9d1e8ee 100644
--- a/WebCore/html/canvas/Int32Array.idl
+++ b/WebCore/html/canvas/Int32Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,10 +27,12 @@
module html {
interface [
Conditional=3D_CANVAS,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomConstructor,
CustomToJS
] Int32Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 4;
diff --git a/WebCore/html/canvas/Int8Array.idl b/WebCore/html/canvas/Int8Array.idl
index 9aefd34..43c83f5 100644
--- a/WebCore/html/canvas/Int8Array.idl
+++ b/WebCore/html/canvas/Int8Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,10 +27,12 @@
module html {
interface [
Conditional=3D_CANVAS,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomConstructor,
CustomToJS
] Int8Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 1;
diff --git a/WebCore/html/canvas/TypedArrayBase.h b/WebCore/html/canvas/TypedArrayBase.h
index 06d7ed5..a8bebd9 100644
--- a/WebCore/html/canvas/TypedArrayBase.h
+++ b/WebCore/html/canvas/TypedArrayBase.h
@@ -61,6 +61,8 @@ class TypedArrayBase : public ArrayBufferView {
static PassRefPtr<Subclass> create(unsigned length)
{
RefPtr<ArrayBuffer> buffer = ArrayBuffer::create(length, sizeof(T));
+ if (!buffer.get())
+ return 0;
return create<Subclass>(buffer, 0, length);
}
@@ -68,8 +70,9 @@ class TypedArrayBase : public ArrayBufferView {
static PassRefPtr<Subclass> create(T* array, unsigned length)
{
RefPtr<Subclass> a = create<Subclass>(length);
- for (unsigned i = 0; i < length; ++i)
- a->set(i, array[i]);
+ if (a)
+ for (unsigned i = 0; i < length; ++i)
+ a->set(i, array[i]);
return a;
}
diff --git a/WebCore/html/canvas/Uint16Array.idl b/WebCore/html/canvas/Uint16Array.idl
index baba0d9..4c369a0 100644
--- a/WebCore/html/canvas/Uint16Array.idl
+++ b/WebCore/html/canvas/Uint16Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,9 @@
module html {
interface [
Conditional=3D_CANVAS,
- CustomConstructor,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
diff --git a/WebCore/html/canvas/Uint32Array.idl b/WebCore/html/canvas/Uint32Array.idl
index b7573e6..25f5b71 100644
--- a/WebCore/html/canvas/Uint32Array.idl
+++ b/WebCore/html/canvas/Uint32Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,7 +27,9 @@
module html {
interface [
Conditional=3D_CANVAS,
- CustomConstructor,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
diff --git a/WebCore/html/canvas/Uint8Array.idl b/WebCore/html/canvas/Uint8Array.idl
index ea4c0f5..76b8cdd 100644
--- a/WebCore/html/canvas/Uint8Array.idl
+++ b/WebCore/html/canvas/Uint8Array.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2009 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -27,10 +27,12 @@
module html {
interface [
Conditional=3D_CANVAS,
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor,
HasNumericIndexGetter,
HasCustomIndexSetter,
GenerateNativeConverter,
- CustomConstructor,
CustomToJS
] Uint8Array : ArrayBufferView {
const unsigned int BYTES_PER_ELEMENT = 1;
diff --git a/WebCore/html/canvas/WebGLBuffer.cpp b/WebCore/html/canvas/WebGLBuffer.cpp
index 192967e..8790b1a 100644
--- a/WebCore/html/canvas/WebGLBuffer.cpp
+++ b/WebCore/html/canvas/WebGLBuffer.cpp
@@ -37,11 +37,6 @@ PassRefPtr<WebGLBuffer> WebGLBuffer::create(WebGLRenderingContext* ctx)
return adoptRef(new WebGLBuffer(ctx));
}
-PassRefPtr<WebGLBuffer> WebGLBuffer::create(WebGLRenderingContext* ctx, Platform3DObject obj)
-{
- return adoptRef(new WebGLBuffer(ctx, obj));
-}
-
WebGLBuffer::WebGLBuffer(WebGLRenderingContext* ctx)
: CanvasObject(ctx)
, m_elementArrayBufferByteLength(0)
@@ -52,14 +47,6 @@ WebGLBuffer::WebGLBuffer(WebGLRenderingContext* ctx)
clearCachedMaxIndices();
}
-WebGLBuffer::WebGLBuffer(WebGLRenderingContext* ctx, Platform3DObject obj)
- : CanvasObject(ctx)
- , m_nextAvailableCacheEntry(0)
-{
- setObject(obj, false);
- clearCachedMaxIndices();
-}
-
void WebGLBuffer::_deleteObject(Platform3DObject object)
{
context()->graphicsContext3D()->deleteBuffer(object);
diff --git a/WebCore/html/canvas/WebGLBuffer.h b/WebCore/html/canvas/WebGLBuffer.h
index feaadbb..bd9f190 100644
--- a/WebCore/html/canvas/WebGLBuffer.h
+++ b/WebCore/html/canvas/WebGLBuffer.h
@@ -39,10 +39,6 @@ namespace WebCore {
virtual ~WebGLBuffer() { deleteObject(); }
static PassRefPtr<WebGLBuffer> create(WebGLRenderingContext*);
-
- // For querying previously created objects via e.g. getFramebufferAttachmentParameter
- // FIXME: should consider canonicalizing these objects
- static PassRefPtr<WebGLBuffer> create(WebGLRenderingContext*, Platform3DObject);
bool associateBufferData(unsigned long target, int size);
bool associateBufferData(unsigned long target, ArrayBufferView* array);
@@ -59,8 +55,7 @@ namespace WebCore {
protected:
WebGLBuffer(WebGLRenderingContext*);
- WebGLBuffer(WebGLRenderingContext*, Platform3DObject obj);
-
+
virtual void _deleteObject(Platform3DObject o);
private:
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index db88b1c..a3d4681 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -91,7 +91,7 @@ unsigned long WebGLFramebuffer::getColorBufferFormat()
{
if (object() && m_colorAttachment && m_colorAttachment->object()) {
if (m_colorAttachment->isRenderbuffer()) {
- unsigned long format = (reinterpret_cast<WebGLRenderbuffer*>(m_colorAttachment))->getInternalformat();
+ unsigned long format = (reinterpret_cast<WebGLRenderbuffer*>(m_colorAttachment))->getInternalFormat();
switch (format) {
case GraphicsContext3D::RGBA4:
case GraphicsContext3D::RGB5_A1:
@@ -100,7 +100,7 @@ unsigned long WebGLFramebuffer::getColorBufferFormat()
return GraphicsContext3D::RGB;
}
} else if (m_colorAttachment->isTexture())
- return (reinterpret_cast<WebGLTexture*>(m_colorAttachment))->getInternalformat();
+ return (reinterpret_cast<WebGLTexture*>(m_colorAttachment))->getInternalFormat();
}
return 0;
}
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.cpp b/WebCore/html/canvas/WebGLRenderbuffer.cpp
index 8d23b33..701e2c9 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.cpp
+++ b/WebCore/html/canvas/WebGLRenderbuffer.cpp
@@ -39,7 +39,7 @@ PassRefPtr<WebGLRenderbuffer> WebGLRenderbuffer::create(WebGLRenderingContext* c
WebGLRenderbuffer::WebGLRenderbuffer(WebGLRenderingContext* ctx)
: CanvasObject(ctx)
- , m_internalformat(GraphicsContext3D::RGBA4)
+ , m_internalFormat(GraphicsContext3D::RGBA4)
, m_initialized(false)
{
setObject(context()->graphicsContext3D()->createRenderbuffer());
diff --git a/WebCore/html/canvas/WebGLRenderbuffer.h b/WebCore/html/canvas/WebGLRenderbuffer.h
index 4b6fc3e..dbb08c1 100644
--- a/WebCore/html/canvas/WebGLRenderbuffer.h
+++ b/WebCore/html/canvas/WebGLRenderbuffer.h
@@ -39,8 +39,8 @@ namespace WebCore {
static PassRefPtr<WebGLRenderbuffer> create(WebGLRenderingContext*);
- void setInternalformat(unsigned long internalformat) { m_internalformat = internalformat; }
- unsigned long getInternalformat() const { return m_internalformat; }
+ void setInternalFormat(unsigned long internalformat) { m_internalFormat = internalformat; }
+ unsigned long getInternalFormat() const { return m_internalFormat; }
bool isInitialized() const { return m_initialized; }
void setInitialized() { m_initialized = true; }
@@ -53,7 +53,7 @@ namespace WebCore {
private:
virtual bool isRenderbuffer() const { return true; }
- unsigned long m_internalformat;
+ unsigned long m_internalFormat;
bool m_initialized;
};
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 82a0f8f..2124506 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -52,7 +52,6 @@
#include "WebGLUniformLocation.h"
#include <wtf/ByteArray.h>
-#include <wtf/MathExtras.h>
namespace WebCore {
@@ -399,6 +398,14 @@ void WebGLRenderingContext::bufferSubData(unsigned long target, long offset, Arr
unsigned long WebGLRenderingContext::checkFramebufferStatus(unsigned long target)
{
+ if (!isGLES2Compliant()) {
+ if (target != GraphicsContext3D::FRAMEBUFFER) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return 0;
+ }
+ }
+ if (!m_framebufferBinding || !m_framebufferBinding->object())
+ return GraphicsContext3D::FRAMEBUFFER_COMPLETE;
return m_context->checkFramebufferStatus(target);
cleanupAfterGraphicsCall(false);
}
@@ -456,7 +463,7 @@ void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, uns
return;
if (!isGLES2Compliant()) {
if (m_framebufferBinding && m_framebufferBinding->object()
- && !isTexInternalformatColorBufferCombinationValid(internalformat,
+ && !isTexInternalFormatColorBufferCombinationValid(internalformat,
m_framebufferBinding->getColorBufferFormat())) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
@@ -473,7 +480,7 @@ void WebGLRenderingContext::copyTexImage2D(unsigned long target, long level, uns
if (tex && !level) // only for level 0
tex->setSize(target, width, height);
if (tex)
- tex->setInternalformat(internalformat);
+ tex->setInternalFormat(internalformat);
}
if (m_framebufferBinding && tex)
m_framebufferBinding->onAttachedObjectChange(tex);
@@ -485,7 +492,7 @@ void WebGLRenderingContext::copyTexSubImage2D(unsigned long target, long level,
if (!isGLES2Compliant()) {
WebGLTexture* tex = getTextureBinding(target);
if (m_framebufferBinding && m_framebufferBinding->object() && tex
- && !isTexInternalformatColorBufferCombinationValid(tex->getInternalformat(),
+ && !isTexInternalFormatColorBufferCombinationValid(tex->getInternalFormat(),
m_framebufferBinding->getColorBufferFormat())) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
@@ -908,10 +915,16 @@ void WebGLRenderingContext::flush()
void WebGLRenderingContext::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, WebGLRenderbuffer* buffer, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
+ if (!validateFramebufferFuncParameters(target, attachment))
+ return;
+ if (renderbuffertarget != GraphicsContext3D::RENDERBUFFER) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return;
+ }
if (buffer && buffer->context() != this) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
- }
+ }
// Don't allow the default framebuffer to be mutated; all current
// implementations use an FBO internally in place of the default
// FBO.
@@ -925,19 +938,19 @@ void WebGLRenderingContext::framebufferRenderbuffer(unsigned long target, unsign
case GraphicsContext3D::DEPTH_ATTACHMENT:
if (m_framebufferBinding->isDepthStencilAttached() || m_framebufferBinding->isStencilAttached())
isConflicted = true;
- if (buffer->getInternalformat() != GraphicsContext3D::DEPTH_COMPONENT16)
+ if (buffer->getInternalFormat() != GraphicsContext3D::DEPTH_COMPONENT16)
isConflicted = true;
break;
case GraphicsContext3D::STENCIL_ATTACHMENT:
if (m_framebufferBinding->isDepthStencilAttached() || m_framebufferBinding->isDepthAttached())
isConflicted = true;
- if (buffer->getInternalformat() != GraphicsContext3D::STENCIL_INDEX8)
+ if (buffer->getInternalFormat() != GraphicsContext3D::STENCIL_INDEX8)
isConflicted = true;
break;
case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
if (m_framebufferBinding->isDepthAttached() || m_framebufferBinding->isStencilAttached())
isConflicted = true;
- if (buffer->getInternalformat() != GraphicsContext3D::DEPTH_STENCIL)
+ if (buffer->getInternalFormat() != GraphicsContext3D::DEPTH_STENCIL)
isConflicted = true;
break;
}
@@ -954,6 +967,12 @@ void WebGLRenderingContext::framebufferRenderbuffer(unsigned long target, unsign
void WebGLRenderingContext::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, WebGLTexture* texture, long level, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
+ if (!validateFramebufferFuncParameters(target, attachment))
+ return;
+ if (level) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
+ return;
+ }
if (texture && texture->context() != this) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
@@ -1063,19 +1082,24 @@ unsigned long WebGLRenderingContext::getError()
WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned long target, unsigned long attachment, unsigned long pname, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
- if (target != GraphicsContext3D::FRAMEBUFFER
- || (attachment != GraphicsContext3D::COLOR_ATTACHMENT0
- && attachment != GraphicsContext3D::DEPTH_ATTACHMENT
- && attachment != GraphicsContext3D::STENCIL_ATTACHMENT
- && attachment != GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT)
- || (pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
- && pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
- && pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
- && pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE)) {
+ if (!validateFramebufferFuncParameters(target, attachment))
+ return WebGLGetInfo();
+ switch (pname) {
+ case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
+ case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
+ case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:
+ case GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
+ break;
+ default:
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return WebGLGetInfo();
}
+ if (!m_framebufferBinding || !m_framebufferBinding->object()) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return WebGLGetInfo();
+ }
+
if (pname != GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME) {
WebGLStateRestorer(this, false);
int value;
@@ -1092,9 +1116,9 @@ WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned l
m_context->getFramebufferAttachmentParameteriv(target, attachment, GraphicsContext3D::FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &value);
switch (type) {
case GraphicsContext3D::RENDERBUFFER:
- return WebGLGetInfo(findRenderbuffer(static_cast<Platform3DObject>(value)));
+ return WebGLGetInfo(PassRefPtr<WebGLRenderbuffer>(findRenderbuffer(static_cast<Platform3DObject>(value))));
case GraphicsContext3D::TEXTURE:
- return WebGLGetInfo(findTexture(static_cast<Platform3DObject>(value)));
+ return WebGLGetInfo(PassRefPtr<WebGLTexture>(findTexture(static_cast<Platform3DObject>(value))));
default:
// FIXME: raise exception?
return WebGLGetInfo();
@@ -1347,7 +1371,7 @@ WebGLGetInfo WebGLRenderingContext::getRenderbufferParameter(unsigned long targe
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return WebGLGetInfo();
}
- return WebGLGetInfo(m_renderbufferBinding->getInternalformat());
+ return WebGLGetInfo(m_renderbufferBinding->getInternalFormat());
default:
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return WebGLGetInfo();
@@ -1577,11 +1601,7 @@ WebGLGetInfo WebGLRenderingContext::getVertexAttrib(unsigned long index, unsigne
case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: {
int name = 0;
m_context->getVertexAttribiv(index, pname, &name);
- if (name == 0)
- return WebGLGetInfo();
- RefPtr<WebGLBuffer> tmp = WebGLBuffer::create(this, name);
- addObject(tmp.get());
- return WebGLGetInfo(PassRefPtr<WebGLBuffer>(tmp));
+ return WebGLGetInfo(PassRefPtr<WebGLBuffer>(findBuffer(static_cast<Platform3DObject>(name))));
}
case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_ENABLED:
case GraphicsContext3D::VERTEX_ATTRIB_ARRAY_NORMALIZED: {
@@ -1725,33 +1745,8 @@ void WebGLRenderingContext::polygonOffset(double factor, double units)
void WebGLRenderingContext::readPixels(long x, long y, long width, long height, unsigned long format, unsigned long type, ArrayBufferView* pixels)
{
// Validate input parameters.
- unsigned long componentsPerPixel = 0;
- switch (format) {
- case GraphicsContext3D::ALPHA:
- componentsPerPixel = 1;
- break;
- case GraphicsContext3D::RGB:
- componentsPerPixel = 3;
- break;
- case GraphicsContext3D::RGBA:
- componentsPerPixel = 4;
- break;
- default:
- m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
- return;
- }
- unsigned long bytesPerComponent = 0;
- switch (type) {
- case GraphicsContext3D::UNSIGNED_BYTE:
- bytesPerComponent = sizeof(unsigned char);
- break;
- case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
- case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
- case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
- componentsPerPixel = 1;
- bytesPerComponent = sizeof(unsigned short);
- break;
- default:
+ unsigned long componentsPerPixel, bytesPerComponent;
+ if (!m_context->computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
return;
}
@@ -1827,7 +1822,7 @@ void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned l
case GraphicsContext3D::DEPTH_STENCIL:
m_context->renderbufferStorage(target, internalformat, width, height);
if (m_renderbufferBinding) {
- m_renderbufferBinding->setInternalformat(internalformat);
+ m_renderbufferBinding->setInternalFormat(internalformat);
if (m_framebufferBinding)
m_framebufferBinding->onAttachedObjectChange(m_renderbufferBinding.get());
}
@@ -1916,7 +1911,7 @@ void WebGLRenderingContext::texImage2DBase(unsigned target, unsigned level, unsi
if (tex && !level) // only for level 0
tex->setSize(target, width, height);
if (tex)
- tex->setInternalformat(internalformat);
+ tex->setInternalFormat(internalformat);
}
if (m_framebufferBinding && tex)
m_framebufferBinding->onAttachedObjectChange(tex);
@@ -1927,17 +1922,18 @@ void WebGLRenderingContext::texImage2DImpl(unsigned target, unsigned level, unsi
unsigned format, unsigned type, Image* image,
bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
{
- // FIXME: pay attention to the user's supplied internalformat, format and type
- // FIXME: pay attention to UNPACK_ROW_WIDTH
- UNUSED_PARAM(type);
ec = 0;
Vector<uint8_t> data;
- if (!m_context->extractImageData(image, flipY, premultiplyAlpha, data, &format, &internalformat)) {
+ if (!m_context->extractImageData(image, format, type, flipY, premultiplyAlpha, data)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
+ if (m_unpackAlignment != 1)
+ m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
texImage2DBase(target, level, internalformat, image->width(), image->height(), 0,
- format, GraphicsContext3D::UNSIGNED_BYTE, data.data(), ec);
+ format, type, data.data(), ec);
+ if (m_unpackAlignment != 1)
+ m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
}
void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned internalformat,
@@ -1952,18 +1948,18 @@ void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned
void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned internalformat,
unsigned format, unsigned type, ImageData* pixels, ExceptionCode& ec)
{
- UNUSED_PARAM(internalformat);
- UNUSED_PARAM(format);
- UNUSED_PARAM(type);
- // FIXME: pay attention to the user's supplied internalformat, format and type
ec = 0;
Vector<uint8_t> data;
- if (!m_context->extractImageData(pixels, m_unpackFlipY, m_unpackPremultiplyAlpha, data)) {
+ if (!m_context->extractImageData(pixels, format, type, m_unpackFlipY, m_unpackPremultiplyAlpha, data)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
- texImage2DBase(target, level, GraphicsContext3D::RGBA, pixels->width(), pixels->height(), 0,
- GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, data.data(), ec);
+ if (m_unpackAlignment != 1)
+ m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, 1);
+ texImage2DBase(target, level, internalformat, pixels->width(), pixels->height(), 0,
+ format, type, data.data(), ec);
+ if (m_unpackAlignment != 1)
+ m_context->pixelStorei(GraphicsContext3D::UNPACK_ALIGNMENT, m_unpackAlignment);
}
void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, unsigned internalformat,
@@ -2027,7 +2023,7 @@ void WebGLRenderingContext::texImage2D(unsigned target, unsigned level, ImageDat
printWarningToConsole("Calling obsolete texImage2D(GLenum target, GLint level, ImageData pixels, GLboolean flipY, GLboolean premultiplyAlpha)");
ec = 0;
Vector<uint8_t> data;
- if (!m_context->extractImageData(pixels, flipY, premultiplyAlpha, data)) {
+ if (!m_context->extractImageData(pixels, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, flipY, premultiplyAlpha, data)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
@@ -2186,18 +2182,14 @@ void WebGLRenderingContext::texSubImage2DImpl(unsigned target, unsigned level, u
unsigned format, unsigned type,
Image* image, bool flipY, bool premultiplyAlpha, ExceptionCode& ec)
{
- UNUSED_PARAM(type);
- // FIXME: pay attention to the user's supplied format and type
- // FIXME: pay attention to UNPACK_ROW_WIDTH
ec = 0;
Vector<uint8_t> data;
- unsigned int internalformat;
- if (!m_context->extractImageData(image, flipY, premultiplyAlpha, data, &format, &internalformat)) {
+ if (!m_context->extractImageData(image, format, type, flipY, premultiplyAlpha, data)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
texSubImage2DBase(target, level, xoffset, yoffset, image->width(), image->height(),
- format, GraphicsContext3D::UNSIGNED_BYTE, data.data(), ec);
+ format, type, data.data(), ec);
}
void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
@@ -2211,17 +2203,14 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
unsigned format, unsigned type, ImageData* pixels, ExceptionCode& ec)
{
- UNUSED_PARAM(format);
- UNUSED_PARAM(type);
- // FIXME: pay attention to the user's supplied format and type
ec = 0;
Vector<uint8_t> data;
- if (!m_context->extractImageData(pixels, m_unpackFlipY, m_unpackPremultiplyAlpha, data)) {
+ if (!m_context->extractImageData(pixels, format, type, m_unpackFlipY, m_unpackPremultiplyAlpha, data)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
texSubImage2DBase(target, level, xoffset, yoffset, pixels->width(), pixels->height(),
- GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, data.data(), ec);
+ format, type, data.data(), ec);
}
void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsigned xoffset, unsigned yoffset,
@@ -2285,7 +2274,7 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
printWarningToConsole("Calling obsolete texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, ImageData pixels, GLboolean flipY, GLboolean premultiplyAlpha)");
ec = 0;
Vector<uint8_t> data;
- if (!m_context->extractImageData(pixels, flipY, premultiplyAlpha, data)) {
+ if (!m_context->extractImageData(pixels, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, flipY, premultiplyAlpha, data)) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
@@ -3116,26 +3105,38 @@ void WebGLRenderingContext::detachAndRemoveAllObjects()
m_canvasObjects.clear();
}
-PassRefPtr<WebGLTexture> WebGLRenderingContext::findTexture(Platform3DObject obj)
+WebGLTexture* WebGLRenderingContext::findTexture(Platform3DObject obj)
{
+ if (!obj)
+ return 0;
HashSet<RefPtr<CanvasObject> >::iterator pend = m_canvasObjects.end();
for (HashSet<RefPtr<CanvasObject> >::iterator it = m_canvasObjects.begin(); it != pend; ++it) {
- if ((*it)->isTexture() && (*it)->object() == obj) {
- RefPtr<WebGLTexture> tex = reinterpret_cast<WebGLTexture*>((*it).get());
- return tex.release();
- }
+ if ((*it)->isTexture() && (*it)->object() == obj)
+ return reinterpret_cast<WebGLTexture*>((*it).get());
}
return 0;
}
-PassRefPtr<WebGLRenderbuffer> WebGLRenderingContext::findRenderbuffer(Platform3DObject obj)
+WebGLRenderbuffer* WebGLRenderingContext::findRenderbuffer(Platform3DObject obj)
{
+ if (!obj)
+ return 0;
HashSet<RefPtr<CanvasObject> >::iterator pend = m_canvasObjects.end();
for (HashSet<RefPtr<CanvasObject> >::iterator it = m_canvasObjects.begin(); it != pend; ++it) {
- if ((*it)->isRenderbuffer() && (*it)->object() == obj) {
- RefPtr<WebGLRenderbuffer> buffer = reinterpret_cast<WebGLRenderbuffer*>((*it).get());
- return buffer.release();
- }
+ if ((*it)->isRenderbuffer() && (*it)->object() == obj)
+ return reinterpret_cast<WebGLRenderbuffer*>((*it).get());
+ }
+ return 0;
+}
+
+WebGLBuffer* WebGLRenderingContext::findBuffer(Platform3DObject obj)
+{
+ if (!obj)
+ return 0;
+ HashSet<RefPtr<CanvasObject> >::iterator pend = m_canvasObjects.end();
+ for (HashSet<RefPtr<CanvasObject> >::iterator it = m_canvasObjects.begin(); it != pend; ++it) {
+ if ((*it)->isBuffer() && (*it)->object() == obj)
+ return reinterpret_cast<WebGLBuffer*>((*it).get());
}
return 0;
}
@@ -3292,17 +3293,17 @@ void WebGLRenderingContext::createFallbackBlackTextures1x1()
m_context->bindTexture(GraphicsContext3D::TEXTURE_CUBE_MAP, 0);
}
-bool WebGLRenderingContext::isTexInternalformatColorBufferCombinationValid(unsigned long texInternalformat,
+bool WebGLRenderingContext::isTexInternalFormatColorBufferCombinationValid(unsigned long texInternalFormat,
unsigned long colorBufferFormat)
{
switch (colorBufferFormat) {
case GraphicsContext3D::ALPHA:
- if (texInternalformat == GraphicsContext3D::ALPHA)
+ if (texInternalFormat == GraphicsContext3D::ALPHA)
return true;
break;
case GraphicsContext3D::RGB:
- if (texInternalformat == GraphicsContext3D::LUMINANCE
- || texInternalformat == GraphicsContext3D::RGB)
+ if (texInternalFormat == GraphicsContext3D::LUMINANCE
+ || texInternalFormat == GraphicsContext3D::RGB)
return true;
break;
case GraphicsContext3D::RGBA:
@@ -3357,6 +3358,35 @@ bool WebGLRenderingContext::validateTexFuncFormatAndType(unsigned long format, u
return false;
}
+ // Verify that the combination of format and type is supported.
+ switch (format) {
+ case GraphicsContext3D::ALPHA:
+ case GraphicsContext3D::LUMINANCE:
+ case GraphicsContext3D::LUMINANCE_ALPHA:
+ if (type != GraphicsContext3D::UNSIGNED_BYTE) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return false;
+ }
+ break;
+ case GraphicsContext3D::RGB:
+ if (type != GraphicsContext3D::UNSIGNED_BYTE
+ && type != GraphicsContext3D::UNSIGNED_SHORT_5_6_5) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return false;
+ }
+ break;
+ case GraphicsContext3D::RGBA:
+ if (type != GraphicsContext3D::UNSIGNED_BYTE
+ && type != GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4
+ && type != GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
+ return false;
+ }
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
return true;
}
@@ -3365,6 +3395,12 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
long width, long height, long border,
unsigned long format, unsigned long type)
{
+ // We absolutely have to validate the format and type combination.
+ // The texImage2D entry points taking HTMLImage, etc. will produce
+ // temporary data based on this combination, so it must be legal.
+ if (!validateTexFuncFormatAndType(format, type))
+ return false;
+
if (isGLES2Compliant())
return true;
@@ -3375,9 +3411,7 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
switch (target) {
case GraphicsContext3D::TEXTURE_2D:
- if (width > m_maxTextureSize ||
- height > m_maxTextureSize ||
- level > log(static_cast<double>(m_maxTextureSize)) / log(2.0)) {
+ if (width > m_maxTextureSize || height > m_maxTextureSize) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return false;
}
@@ -3388,9 +3422,7 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GraphicsContext3D::TEXTURE_CUBE_MAP_POSITIVE_Z:
case GraphicsContext3D::TEXTURE_CUBE_MAP_NEGATIVE_Z:
- if (width != height ||
- width > m_maxCubeMapTextureSize ||
- level > log(static_cast<double>(m_maxCubeMapTextureSize)) / log(2.0)) {
+ if (width != height || width > m_maxCubeMapTextureSize) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return false;
}
@@ -3410,7 +3442,7 @@ bool WebGLRenderingContext::validateTexFuncParameters(unsigned long target, long
return false;
}
- return validateTexFuncFormatAndType(format, type);
+ return true;
}
bool WebGLRenderingContext::validateDrawMode(unsigned long mode)
@@ -3436,6 +3468,25 @@ void WebGLRenderingContext::printWarningToConsole(const String& message)
message, 0, canvas()->document()->url().string());
}
+bool WebGLRenderingContext::validateFramebufferFuncParameters(unsigned long target, unsigned long attachment)
+{
+ if (target != GraphicsContext3D::FRAMEBUFFER) {
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return false;
+ }
+ switch (attachment) {
+ case GraphicsContext3D::COLOR_ATTACHMENT0:
+ case GraphicsContext3D::DEPTH_ATTACHMENT:
+ case GraphicsContext3D::STENCIL_ATTACHMENT:
+ case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+ break;
+ default:
+ m_context->synthesizeGLError(GraphicsContext3D::INVALID_ENUM);
+ return false;
+ }
+ return true;
+}
+
} // namespace WebCore
#endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/html/canvas/WebGLRenderingContext.h b/WebCore/html/canvas/WebGLRenderingContext.h
index 552efa9..d05d60b 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.h
+++ b/WebCore/html/canvas/WebGLRenderingContext.h
@@ -315,8 +315,9 @@ class WebKitCSSMatrix;
void addObject(CanvasObject*);
void detachAndRemoveAllObjects();
- PassRefPtr<WebGLTexture> findTexture(Platform3DObject);
- PassRefPtr<WebGLRenderbuffer> findRenderbuffer(Platform3DObject);
+ WebGLTexture* findTexture(Platform3DObject);
+ WebGLRenderbuffer* findRenderbuffer(Platform3DObject);
+ WebGLBuffer* findBuffer(Platform3DObject);
void markContextChanged();
void cleanupAfterGraphicsCall(bool changed)
@@ -416,7 +417,7 @@ class WebKitCSSMatrix;
// Helper function for copyTex{Sub}Image, check whether the internalformat
// and the color buffer format of the current bound framebuffer combination
// is valid.
- bool isTexInternalformatColorBufferCombinationValid(unsigned long texInternalformat,
+ bool isTexInternalFormatColorBufferCombinationValid(unsigned long texInternalFormat,
unsigned long colorBufferFormat);
// Helper function to get the current bound texture.
@@ -443,6 +444,10 @@ class WebKitCSSMatrix;
// used only to warn about use of obsolete functions.
void printWarningToConsole(const String& message);
+ // Helper function to validate input parameters for framebuffer functions.
+ // Generate GL error if parameters are illegal.
+ bool validateFramebufferFuncParameters(unsigned long target, unsigned long attachment);
+
friend class WebGLStateRestorer;
};
diff --git a/WebCore/html/canvas/WebGLTexture.cpp b/WebCore/html/canvas/WebGLTexture.cpp
index d24405a..1cc7d5d 100644
--- a/WebCore/html/canvas/WebGLTexture.cpp
+++ b/WebCore/html/canvas/WebGLTexture.cpp
@@ -45,7 +45,7 @@ WebGLTexture::WebGLTexture(WebGLRenderingContext* ctx)
, m_magFilter(GraphicsContext3D::LINEAR)
, m_wrapS(GraphicsContext3D::REPEAT)
, m_wrapT(GraphicsContext3D::REPEAT)
- , m_internalformat(0)
+ , m_internalFormat(0)
, m_isNPOT(false)
, m_needToUseBlackTexture(false)
{
diff --git a/WebCore/html/canvas/WebGLTexture.h b/WebCore/html/canvas/WebGLTexture.h
index 889e902..4d16b59 100644
--- a/WebCore/html/canvas/WebGLTexture.h
+++ b/WebCore/html/canvas/WebGLTexture.h
@@ -52,8 +52,8 @@ namespace WebCore {
void setParameterf(unsigned long pname, float param);
void setSize(unsigned long target, unsigned width, unsigned height);
- void setInternalformat(unsigned long internalformat) { m_internalformat = internalformat; }
- unsigned long getInternalformat() const { return m_internalformat; }
+ void setInternalFormat(unsigned long internalformat) { m_internalFormat = internalformat; }
+ unsigned long getInternalFormat() const { return m_internalFormat; }
static bool isNPOT(unsigned, unsigned);
@@ -80,7 +80,7 @@ namespace WebCore {
int m_wrapS;
int m_wrapT;
- unsigned long m_internalformat;
+ unsigned long m_internalFormat;
unsigned m_width[6];
unsigned m_height[6];
diff --git a/WebCore/inspector/InjectedScriptHost.cpp b/WebCore/inspector/InjectedScriptHost.cpp
index 4c3c7ae..e8a9fee 100644
--- a/WebCore/inspector/InjectedScriptHost.cpp
+++ b/WebCore/inspector/InjectedScriptHost.cpp
@@ -110,17 +110,13 @@ long InjectedScriptHost::pushNodePathToFrontend(Node* node, bool withChildren, b
return id;
}
-long InjectedScriptHost::pushNodeByPathToFrontend(const String& path)
+long InjectedScriptHost::inspectedNode(unsigned long num)
{
InspectorDOMAgent* domAgent = inspectorDOMAgent();
if (!domAgent)
return 0;
- Node* node = domAgent->nodeForPath(path);
- if (!node)
- return 0;
-
- return domAgent->pushNodePathToFrontend(node);
+ return domAgent->inspectedNode(num);
}
#if ENABLE(DATABASE)
diff --git a/WebCore/inspector/InjectedScriptHost.h b/WebCore/inspector/InjectedScriptHost.h
index 66cf41e..b942148 100644
--- a/WebCore/inspector/InjectedScriptHost.h
+++ b/WebCore/inspector/InjectedScriptHost.h
@@ -68,8 +68,7 @@ public:
void copyText(const String& text);
Node* nodeForId(long nodeId);
long pushNodePathToFrontend(Node* node, bool withChildren, bool selectInUI);
-
- long pushNodeByPathToFrontend(const String& path);
+ long inspectedNode(unsigned long num);
#if ENABLE(DATABASE)
Database* databaseForId(long databaseId);
diff --git a/WebCore/inspector/InjectedScriptHost.idl b/WebCore/inspector/InjectedScriptHost.idl
index 5a4ce19..21af938 100644
--- a/WebCore/inspector/InjectedScriptHost.idl
+++ b/WebCore/inspector/InjectedScriptHost.idl
@@ -37,8 +37,7 @@ module core {
void copyText(in DOMString text);
[Custom] DOMObject nodeForId(in long nodeId);
[Custom] int pushNodePathToFrontend(in DOMObject node, in boolean withChildren, in boolean selectInUI);
-
- long pushNodeByPathToFrontend(in DOMString path);
+ long inspectedNode(in unsigned long num);
#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
[Custom] DOMObject currentCallFrame();
diff --git a/WebCore/inspector/InspectorBackend.cpp b/WebCore/inspector/InspectorBackend.cpp
index 1eedda1..8e9e330 100644
--- a/WebCore/inspector/InspectorBackend.cpp
+++ b/WebCore/inspector/InspectorBackend.cpp
@@ -109,6 +109,18 @@ void InspectorBackend::disableSearchingForNode()
m_inspectorController->setSearchingForNode(false);
}
+void InspectorBackend::enableMonitoringXHR()
+{
+ if (m_inspectorController)
+ m_inspectorController->setMonitoringXHR(true);
+}
+
+void InspectorBackend::disableMonitoringXHR()
+{
+ if (m_inspectorController)
+ m_inspectorController->setMonitoringXHR(false);
+}
+
void InspectorBackend::enableResourceTracking(bool always)
{
if (m_inspectorController)
@@ -280,6 +292,12 @@ void InspectorBackend::clearProfiles()
if (m_inspectorController)
m_inspectorController->clearProfiles();
}
+
+void InspectorBackend::takeHeapSnapshot()
+{
+ if (m_inspectorController)
+ m_inspectorController->takeHeapSnapshot();
+}
#endif
void InspectorBackend::setInjectedScriptSource(const String& source)
@@ -359,10 +377,28 @@ void InspectorBackend::removeNode(long callId, long nodeId)
domAgent->removeNode(callId, nodeId);
}
-void InspectorBackend::changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded)
+void InspectorBackend::changeTagName(long callId, long nodeId, const String& tagName)
+{
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ domAgent->changeTagName(callId, nodeId, tagName);
+}
+
+void InspectorBackend::getOuterHTML(long callId, long nodeId)
{
if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
- domAgent->changeTagName(callId, nodeId, tagName, expanded);
+ domAgent->getOuterHTML(callId, nodeId);
+}
+
+void InspectorBackend::setOuterHTML(long callId, long nodeId, const String& outerHTML)
+{
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ domAgent->setOuterHTML(callId, nodeId, outerHTML);
+}
+
+void InspectorBackend::addInspectedNode(long nodeId)
+{
+ if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
+ domAgent->addInspectedNode(nodeId);
}
void InspectorBackend::performSearch(const String& query, bool runSynchronously)
@@ -377,6 +413,23 @@ void InspectorBackend::searchCanceled()
domAgent->searchCanceled();
}
+void InspectorBackend::pushNodeByPathToFrontend(long callId, const String& path)
+{
+ InspectorDOMAgent* domAgent = inspectorDOMAgent();
+ InspectorFrontend* frontend = inspectorFrontend();
+ if (!domAgent || !frontend)
+ return;
+
+ long id = domAgent->pushNodeByPathToFrontend(path);
+ frontend->didPushNodeByPathToFrontend(callId, id);
+}
+
+void InspectorBackend::clearConsoleMessages()
+{
+ if (m_inspectorController)
+ m_inspectorController->clearConsoleMessages();
+}
+
void InspectorBackend::getStyles(long callId, long nodeId, bool authorOnly)
{
if (InspectorDOMAgent* domAgent = inspectorDOMAgent())
diff --git a/WebCore/inspector/InspectorBackend.h b/WebCore/inspector/InspectorBackend.h
index 61d73b8..ce5dd99 100644
--- a/WebCore/inspector/InspectorBackend.h
+++ b/WebCore/inspector/InspectorBackend.h
@@ -65,6 +65,9 @@ public:
void enableSearchingForNode();
void disableSearchingForNode();
+ void enableMonitoringXHR();
+ void disableMonitoringXHR();
+
void enableResourceTracking(bool always);
void disableResourceTracking(bool always);
void getResourceContent(long callId, unsigned long identifier);
@@ -105,6 +108,8 @@ public:
void removeProfile(unsigned uid);
void clearProfiles();
+
+ void takeHeapSnapshot();
#endif
void setInjectedScriptSource(const String& source);
@@ -119,9 +124,15 @@ public:
void getEventListenersForNode(long callId, long nodeId);
void copyNode(long nodeId);
void removeNode(long callId, long nodeId);
- void changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded);
+ void changeTagName(long callId, long nodeId, const String& tagName);
+ void getOuterHTML(long callId, long nodeId);
+ void setOuterHTML(long callId, long nodeId, const String& outerHTML);
+ void addInspectedNode(long nodeId);
void performSearch(const String& query, bool runSynchronously);
void searchCanceled();
+ void pushNodeByPathToFrontend(long callId, const String& path);
+
+ void clearConsoleMessages();
void getStyles(long callId, long nodeId, bool authOnly);
void getAllStyles(long callId);
diff --git a/WebCore/inspector/InspectorBackend.idl b/WebCore/inspector/InspectorBackend.idl
index c0078ee..eaacaf0 100644
--- a/WebCore/inspector/InspectorBackend.idl
+++ b/WebCore/inspector/InspectorBackend.idl
@@ -40,6 +40,9 @@ module core {
void enableSearchingForNode();
void disableSearchingForNode();
+ void enableMonitoringXHR();
+ void disableMonitoringXHR();
+
void enableResourceTracking(in boolean always);
void disableResourceTracking(in boolean always);
void getResourceContent(in long callId, in unsigned long identifier);
@@ -80,6 +83,8 @@ module core {
void removeProfile(in unsigned long uid);
void clearProfiles();
+
+ void takeHeapSnapshot();
#endif
void setInjectedScriptSource(in DOMString scriptSource);
void dispatchOnInjectedScript(in long callId, in long injectedScriptId, in DOMString methodName, in DOMString arguments, in boolean async);
@@ -94,9 +99,15 @@ module core {
void getEventListenersForNode(in long callId, in long nodeId);
void copyNode(in long nodeId);
void removeNode(in long callId, in long nodeId);
- void changeTagName(in long callId, in long nodeId, in DOMString newTagName, in boolean expanded);
+ void changeTagName(in long callId, in long nodeId, in DOMString newTagName);
+ void getOuterHTML(in long callId, in long nodeId);
+ void setOuterHTML(in long callId, in long nodeId, in DOMString outerHTML);
+ void addInspectedNode(in long nodeId);
void performSearch(in DOMString query, in boolean runSynchronously);
void searchCanceled();
+ void pushNodeByPathToFrontend(in long callId, in DOMString path);
+
+ void clearConsoleMessages();
void highlightDOMNode(in long nodeId);
void hideDOMNodeHighlight();
diff --git a/WebCore/inspector/InspectorCSSStore.cpp b/WebCore/inspector/InspectorCSSStore.cpp
index a080eda..7bc947a 100644
--- a/WebCore/inspector/InspectorCSSStore.cpp
+++ b/WebCore/inspector/InspectorCSSStore.cpp
@@ -29,6 +29,8 @@
#include "config.h"
#include "InspectorCSSStore.h"
+#if ENABLE(INSPECTOR)
+
#include "CSSMutableStyleDeclaration.h"
#include "CSSParser.h"
#include "CSSRuleList.h"
@@ -220,3 +222,5 @@ long InspectorCSSStore::bindRule(CSSStyleRule* rule)
}
} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/InspectorClient.h b/WebCore/inspector/InspectorClient.h
index 2ce3a09..61900bb 100644
--- a/WebCore/inspector/InspectorClient.h
+++ b/WebCore/inspector/InspectorClient.h
@@ -50,6 +50,14 @@ public:
virtual void storeSetting(const String& key, const String& value) = 0;
virtual bool sendMessageToFrontend(const String& message) = 0;
+
+ // Navigation can cause some WebKit implementations to change the view / page / inspector controller instance.
+ // However, there are some inspector controller states that should survive navigation (such as tracking resources
+ // or recording timeline). Following callbacks allow embedders to track these states.
+ virtual void resourceTrackingWasEnabled() { };
+ virtual void resourceTrackingWasDisabled() { };
+ virtual void timelineProfilerWasStarted() { };
+ virtual void timelineProfilerWasStopped() { };
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 7916cd0..5020634 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -62,6 +62,7 @@
#include "InspectorDatabaseResource.h"
#include "InspectorFrontend.h"
#include "InspectorResource.h"
+#include "InspectorValues.h"
#include "InspectorWorkerResource.h"
#include "InspectorTimelineAgent.h"
#include "Page.h"
@@ -86,6 +87,7 @@
#include <wtf/text/CString.h>
#include <wtf/CurrentTime.h>
#include <wtf/ListHashSet.h>
+#include <wtf/MD5.h>
#include <wtf/RefCounted.h>
#include <wtf/StdLibExtras.h>
@@ -120,6 +122,7 @@ static const char* const debuggerEnabledSettingName = "debuggerEnabled";
static const char* const profilerEnabledSettingName = "profilerEnabled";
static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
static const char* const lastActivePanelSettingName = "lastActivePanel";
+static const char* const monitoringXHRSettingName = "xhrMonitor";
const String& InspectorController::frontendSettingsSettingName()
{
@@ -141,6 +144,27 @@ static const unsigned expireConsoleMessagesStep = 100;
static unsigned s_inspectorControllerCount;
+namespace {
+
+String md5Base16(const String& string)
+{
+ static const char digits[] = "0123456789abcdef";
+
+ MD5 md5;
+ md5.addBytes(reinterpret_cast<const uint8_t*>(string.characters()), string.length() * 2);
+ Vector<uint8_t, 16> digest;
+ md5.checksum(digest);
+
+ Vector<char, 32> result;
+ for (int i = 0; i < 16; ++i) {
+ result.append(digits[(digest[i] >> 4) & 0xf]);
+ result.append(digits[digest[i] & 0xf]);
+ }
+ return String(result.data(), result.size());
+}
+
+}
+
InspectorController::InspectorController(Page* page, InspectorClient* client)
: m_inspectedPage(page)
, m_client(client)
@@ -151,15 +175,17 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
, m_sessionSettings(InspectorObject::create())
, m_groupLevel(0)
, m_searchingForNode(false)
+ , m_monitoringXHR(false)
, m_previousMessage(0)
, m_resourceTrackingEnabled(false)
- , m_resourceTrackingSettingsLoaded(false)
+ , m_settingsLoaded(false)
, m_inspectorBackend(InspectorBackend::create(this))
, m_injectedScriptHost(InjectedScriptHost::create(this))
#if ENABLE(JAVASCRIPT_DEBUGGER)
, m_debuggerEnabled(false)
, m_attachDebuggerWhenShown(false)
, m_pausedScriptState(0)
+ , m_breakpointsLoaded(false)
, m_profilerEnabled(!WTF_USE_JSC)
, m_recordingUserInitiatedProfile(false)
, m_currentUserInitiatedProfileNumber(-1)
@@ -232,7 +258,7 @@ void InspectorController::setSetting(const String& key, const String& value)
void InspectorController::setSessionSettings(const String& settingsJSON)
{
- m_sessionSettings = InspectorValue::readJSON(settingsJSON);
+ m_sessionSettings = InspectorValue::parseJSON(settingsJSON);
}
void InspectorController::inspect(Node* node)
@@ -431,6 +457,20 @@ void InspectorController::setSearchingForNode(bool enabled)
}
}
+void InspectorController::setMonitoringXHR(bool enabled)
+{
+ if (m_monitoringXHR == enabled)
+ return;
+ m_monitoringXHR = enabled;
+ setSetting(monitoringXHRSettingName, enabled ? "true" : "false");
+ if (m_frontend) {
+ if (enabled)
+ m_frontend->monitoringXHRWasEnabled();
+ else
+ m_frontend->monitoringXHRWasDisabled();
+ }
+}
+
void InspectorController::connectFrontend(const ScriptObject& webInspector)
{
m_openingFrontend = false;
@@ -439,6 +479,12 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
m_domAgent = InspectorDOMAgent::create(m_cssStore.get(), m_frontend.get());
if (m_timelineAgent)
m_timelineAgent->resetFrontendProxyObject(m_frontend.get());
+
+ // Initialize Web Inspector title.
+ m_frontend->inspectedURLChanged(m_inspectedPage->mainFrame()->loader()->url().string());
+
+ populateScriptObjects();
+
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (ScriptDebugServer::shared().isDebuggerAlwaysEnabled()) {
// FIXME (40364): This will force pushing script sources to frontend even if script
@@ -446,7 +492,7 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
enableDebuggerFromFrontend(false);
} else {
String debuggerEnabled = setting(debuggerEnabledSettingName);
- if (debuggerEnabled == "true")
+ if (debuggerEnabled == "true" || m_attachDebuggerWhenShown)
enableDebugger();
String profilerEnabled = setting(profilerEnabledSettingName);
if (profilerEnabled == "true")
@@ -454,11 +500,6 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
}
#endif
- // Initialize Web Inspector title.
- m_frontend->inspectedURLChanged(m_inspectedPage->mainFrame()->loader()->url().string());
-
- populateScriptObjects();
-
if (m_showAfterVisible == CurrentPanel) {
String lastActivePanelSetting = setting(lastActivePanelSettingName);
m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting);
@@ -466,10 +507,6 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
if (m_nodeToFocus)
focusNode();
-#if ENABLE(JAVASCRIPT_DEBUGGER)
- if (m_attachDebuggerWhenShown)
- enableDebugger();
-#endif
showPanel(m_showAfterVisible);
}
@@ -526,8 +563,7 @@ void InspectorController::disconnectFrontend()
// opening.
bool debuggerWasEnabled = m_debuggerEnabled;
disableDebugger();
- if (debuggerWasEnabled)
- m_attachDebuggerWhenShown = true;
+ m_attachDebuggerWhenShown = debuggerWasEnabled;
#endif
setSearchingForNode(false);
unbindAllResources();
@@ -567,8 +603,9 @@ void InspectorController::populateScriptObjects()
if (m_searchingForNode)
m_frontend->searchingForNodeWasEnabled();
- else
- m_frontend->searchingForNodeWasDisabled();
+
+ if (m_monitoringXHR)
+ m_frontend->monitoringXHRWasEnabled();
#if ENABLE(JAVASCRIPT_DEBUGGER)
if (m_profilerEnabled)
@@ -674,11 +711,15 @@ void InspectorController::didCommitLoad(DocumentLoader* loader)
#if ENABLE(JAVASCRIPT_DEBUGGER)
m_sourceIDToURL.clear();
m_scriptIDToContent.clear();
+ m_stickyBreakpoints.clear();
+ m_breakpointsLoaded = false;
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER) && USE(JSC)
m_profiles.clear();
m_currentUserInitiatedProfileNumber = 1;
m_nextUserInitiatedProfileNumber = 1;
+ if (m_frontend)
+ m_frontend->resetProfilesPanel();
#endif
// unbindAllResources should be called before database and DOM storage
// resources are cleared so that it has a chance to unbind them.
@@ -812,7 +853,7 @@ void InspectorController::didLoadResourceFromMemoryCache(DocumentLoader* loader,
ASSERT(m_inspectedPage);
bool isMainResource = isMainResourceLoader(loader, KURL(ParsedURLString, cachedResource->url()));
- ensureResourceTrackingSettingsLoaded();
+ ensureSettingsLoaded();
if (!isMainResource && !m_resourceTrackingEnabled)
return;
@@ -836,7 +877,7 @@ void InspectorController::identifierForInitialRequest(unsigned long identifier,
ASSERT(m_inspectedPage);
bool isMainResource = isMainResourceLoader(loader, request.url());
- ensureResourceTrackingSettingsLoaded();
+ ensureSettingsLoaded();
if (!isMainResource && !m_resourceTrackingEnabled)
return;
@@ -1006,9 +1047,15 @@ void InspectorController::didFailLoading(unsigned long identifier, const Resourc
resource->updateScriptObject(m_frontend.get());
}
-void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString)
+void InspectorController::resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber)
{
- if (!enabled() || !m_resourceTrackingEnabled)
+ if (!enabled())
+ return;
+
+ if (m_monitoringXHR)
+ addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, "XHR finished loading: \"" + url + "\".", sendLineNumber, sendURL);
+
+ if (!m_resourceTrackingEnabled)
return;
InspectorResource* resource = m_resources.get(identifier).get();
@@ -1051,6 +1098,7 @@ void InspectorController::enableResourceTracking(bool always, bool reload)
m_resourceTrackingEnabled = true;
if (m_frontend)
m_frontend->resourceTrackingWasEnabled();
+ m_client->resourceTrackingWasEnabled();
if (reload)
m_inspectedPage->mainFrame()->redirectScheduler()->scheduleRefresh(true);
@@ -1068,17 +1116,23 @@ void InspectorController::disableResourceTracking(bool always)
m_resourceTrackingEnabled = false;
if (m_frontend)
m_frontend->resourceTrackingWasDisabled();
+ m_client->resourceTrackingWasDisabled();
}
-void InspectorController::ensureResourceTrackingSettingsLoaded()
+void InspectorController::ensureSettingsLoaded()
{
- if (m_resourceTrackingSettingsLoaded)
+ if (m_settingsLoaded)
return;
- m_resourceTrackingSettingsLoaded = true;
+ m_settingsLoaded = true;
String resourceTracking = setting(resourceTrackingEnabledSettingName);
if (resourceTracking == "true")
m_resourceTrackingEnabled = true;
+ m_client->resourceTrackingWasEnabled();
+
+ String monitoringXHR = setting(monitoringXHRSettingName);
+ if (monitoringXHR == "true")
+ m_monitoringXHR = true;
}
void InspectorController::startTimelineProfiler()
@@ -1092,6 +1146,7 @@ void InspectorController::startTimelineProfiler()
m_timelineAgent = new InspectorTimelineAgent(m_frontend.get());
if (m_frontend)
m_frontend->timelineProfilerWasStarted();
+ m_client->timelineProfilerWasStarted();
}
void InspectorController::stopTimelineProfiler()
@@ -1105,6 +1160,7 @@ void InspectorController::stopTimelineProfiler()
m_timelineAgent = 0;
if (m_frontend)
m_frontend->timelineProfilerWasStopped();
+ m_client->timelineProfilerWasStopped();
}
#if ENABLE(WORKERS)
@@ -1580,18 +1636,27 @@ void InspectorController::disableProfiler(bool always)
if (m_frontend)
m_frontend->profilerWasDisabled();
}
+
+void InspectorController::takeHeapSnapshot()
+{
+ if (!enabled())
+ return;
+
+ ScriptProfiler::takeHeapSnapshot();
+}
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER)
void InspectorController::enableDebuggerFromFrontend(bool always)
{
+ ASSERT(!m_debuggerEnabled);
if (always)
setSetting(debuggerEnabledSettingName, "true");
ASSERT(m_inspectedPage);
- ScriptDebugServer::shared().addListener(this, m_inspectedPage);
ScriptDebugServer::shared().clearBreakpoints();
+ ScriptDebugServer::shared().addListener(this, m_inspectedPage);
m_debuggerEnabled = true;
m_frontend->debuggerWasEnabled();
@@ -1678,10 +1743,12 @@ void InspectorController::setBreakpoint(const String& sourceID, unsigned lineNum
if (url.isEmpty())
return;
- HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(url);
+ String key = md5Base16(url);
+ HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(key);
if (it == m_stickyBreakpoints.end())
- it = m_stickyBreakpoints.set(url, SourceBreakpoints()).first;
+ it = m_stickyBreakpoints.set(key, SourceBreakpoints()).first;
it->second.set(lineNumber, breakpoint);
+ saveBreakpoints();
}
void InspectorController::removeBreakpoint(const String& sourceID, unsigned lineNumber)
@@ -1692,9 +1759,10 @@ void InspectorController::removeBreakpoint(const String& sourceID, unsigned line
if (url.isEmpty())
return;
- HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(url);
+ HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(md5Base16(url));
if (it != m_stickyBreakpoints.end())
it->second.remove(lineNumber);
+ saveBreakpoints();
}
// JavaScriptDebugListener functions
@@ -1704,10 +1772,13 @@ void InspectorController::didParseSource(const String& sourceID, const String& u
// Don't send script content to the front end until it's really needed.
m_frontend->parsedScriptSource(sourceID, url, "", firstLine, worldType);
+ m_scriptIDToContent.set(sourceID, data);
+
if (url.isEmpty())
return;
- HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(url);
+ loadBreakpoints();
+ HashMap<String, SourceBreakpoints>::iterator it = m_stickyBreakpoints.find(md5Base16(url));
if (it != m_stickyBreakpoints.end()) {
for (SourceBreakpoints::iterator breakpointIt = it->second.begin(); breakpointIt != it->second.end(); ++breakpointIt) {
if (firstLine <= breakpointIt->first) {
@@ -1716,9 +1787,7 @@ void InspectorController::didParseSource(const String& sourceID, const String& u
}
}
}
-
m_sourceIDToURL.set(sourceID, url);
- m_scriptIDToContent.set(sourceID, data);
}
void InspectorController::failedToParseSource(const String& url, const String& data, int firstLine, int errorLine, const String& errorMessage)
@@ -1761,6 +1830,47 @@ void InspectorController::didEvaluateForTestInFrontend(long callId, const String
function.call();
}
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+String InspectorController::breakpointsSettingKey()
+{
+ DEFINE_STATIC_LOCAL(String, keyPrefix, ("breakpoints:"));
+ return keyPrefix + md5Base16(m_mainResource->requestURL());
+}
+
+void InspectorController::loadBreakpoints()
+{
+ if (m_breakpointsLoaded)
+ return;
+ m_breakpointsLoaded = true;
+
+ RefPtr<InspectorValue> parsedSetting = InspectorValue::parseJSON(setting(breakpointsSettingKey()));
+ if (!parsedSetting)
+ return;
+ RefPtr<InspectorObject> breakpoints = parsedSetting->asObject();
+ if (!breakpoints)
+ return;
+ for (InspectorObject::iterator it = breakpoints->begin(); it != breakpoints->end(); ++it) {
+ RefPtr<InspectorObject> breakpointsForURL = it->second->asObject();
+ if (!breakpointsForURL)
+ continue;
+ HashMap<String, SourceBreakpoints>::iterator sourceBreakpointsIt = m_stickyBreakpoints.set(it->first, SourceBreakpoints()).first;
+ ScriptBreakpoint::sourceBreakpointsFromInspectorObject(breakpointsForURL, &sourceBreakpointsIt->second);
+ }
+}
+
+void InspectorController::saveBreakpoints()
+{
+ RefPtr<InspectorObject> breakpoints = InspectorObject::create();
+ for (HashMap<String, SourceBreakpoints>::iterator it(m_stickyBreakpoints.begin()); it != m_stickyBreakpoints.end(); ++it) {
+ if (it->second.isEmpty())
+ continue;
+ RefPtr<InspectorObject> breakpointsForURL = ScriptBreakpoint::inspectorObjectFromSourceBreakpoints(it->second);
+ breakpoints->set(it->first, breakpointsForURL);
+ }
+ setSetting(breakpointsSettingKey(), breakpoints->toJSONString());
+}
+#endif
+
static Path quadToPath(const FloatQuad& quad)
{
Path quadPath;
@@ -1826,7 +1936,7 @@ static void drawHighlightForBox(GraphicsContext& context, const FloatQuad& conte
drawOutlinedQuad(context, contentQuad, contentBoxColor);
}
-static void drawHighlightForLineBoxes(GraphicsContext& context, const Vector<FloatQuad>& lineBoxQuads)
+static void drawHighlightForLineBoxesOrSVGRenderer(GraphicsContext& context, const Vector<FloatQuad>& lineBoxQuads)
{
static const Color lineBoxColor(125, 173, 217, 128);
@@ -1867,7 +1977,14 @@ void InspectorController::drawNodeHighlight(GraphicsContext& context) const
overlayRect = view->visibleContentRect();
context.translate(-overlayRect.x(), -overlayRect.y());
- if (renderer->isBox()) {
+ // RenderSVGRoot should be highlighted through the isBox() code path, all other SVG elements should just dump their absoluteQuads().
+#if ENABLE(SVG)
+ bool isSVGRenderer = renderer->node() && renderer->node()->isSVGElement() && !renderer->isSVGRoot();
+#else
+ bool isSVGRenderer = false;
+#endif
+
+ if (renderer->isBox() && !isSVGRenderer) {
RenderBox* renderBox = toRenderBox(renderer);
IntRect contentBox = renderBox->contentBoxRect();
@@ -1890,16 +2007,14 @@ void InspectorController::drawNodeHighlight(GraphicsContext& context) const
absMarginQuad.move(mainFrameOffset);
drawHighlightForBox(context, absContentQuad, absPaddingQuad, absBorderQuad, absMarginQuad);
- } else if (renderer->isRenderInline()) {
- RenderInline* renderInline = toRenderInline(renderer);
-
+ } else if (renderer->isRenderInline() || isSVGRenderer) {
// FIXME: We should show margins/padding/border for inlines.
Vector<FloatQuad> lineBoxQuads;
- renderInline->absoluteQuads(lineBoxQuads);
+ renderer->absoluteQuads(lineBoxQuads);
for (unsigned i = 0; i < lineBoxQuads.size(); ++i)
lineBoxQuads[i] += mainFrameOffset;
- drawHighlightForLineBoxes(context, lineBoxQuads);
+ drawHighlightForLineBoxesOrSVGRenderer(context, lineBoxQuads);
}
}
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 346a8dc..b2d1d5a 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -170,13 +170,14 @@ public:
void didReceiveContentLength(unsigned long identifier, int lengthReceived);
void didFinishLoading(unsigned long identifier);
void didFailLoading(unsigned long identifier, const ResourceError&);
- void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
+ void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber);
void scriptImported(unsigned long identifier, const String& sourceString);
void enableResourceTracking(bool always = false, bool reload = true);
void disableResourceTracking(bool always = false);
bool resourceTrackingEnabled() const { return m_resourceTrackingEnabled; }
- void ensureResourceTrackingSettingsLoaded();
+
+ void ensureSettingsLoaded();
void startTimelineProfiler();
void stopTimelineProfiler();
@@ -240,6 +241,8 @@ public:
void enableProfiler(bool always = false, bool skipRecompile = false);
void disableProfiler(bool always = false);
bool profilerEnabled() const { return enabled() && m_profilerEnabled; }
+
+ void takeHeapSnapshot();
#endif
#if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -278,6 +281,7 @@ private:
// Following are used from InspectorBackend and internally.
void setSearchingForNode(bool enabled);
+ void setMonitoringXHR(bool enabled);
void storeLastActivePanel(const String& panelName);
InspectorDOMAgent* domAgent() { return m_domAgent.get(); }
void releaseDOMAgent();
@@ -325,6 +329,12 @@ private:
void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+ String breakpointsSettingKey();
+ void loadBreakpoints();
+ void saveBreakpoints();
+#endif
+
Page* m_inspectedPage;
InspectorClient* m_client;
OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
@@ -350,12 +360,15 @@ private:
#endif
SpecialPanels m_showAfterVisible;
RefPtr<Node> m_highlightedNode;
+#if ENABLE(INSPECTOR)
RefPtr<InspectorValue> m_sessionSettings;
+#endif
unsigned m_groupLevel;
bool m_searchingForNode;
+ bool m_monitoringXHR;
ConsoleMessage* m_previousMessage;
bool m_resourceTrackingEnabled;
- bool m_resourceTrackingSettingsLoaded;
+ bool m_settingsLoaded;
RefPtr<InspectorBackend> m_inspectorBackend;
RefPtr<InjectedScriptHost> m_injectedScriptHost;
@@ -371,6 +384,7 @@ private:
HashMap<String, String> m_sourceIDToURL;
HashMap<String, String> m_scriptIDToContent;
HashMap<String, SourceBreakpoints> m_stickyBreakpoints;
+ bool m_breakpointsLoaded;
bool m_profilerEnabled;
bool m_recordingUserInitiatedProfile;
diff --git a/WebCore/inspector/InspectorDOMAgent.cpp b/WebCore/inspector/InspectorDOMAgent.cpp
index b152dc3..a2f2e15 100644
--- a/WebCore/inspector/InspectorDOMAgent.cpp
+++ b/WebCore/inspector/InspectorDOMAgent.cpp
@@ -53,9 +53,9 @@
#include "EventTarget.h"
#include "Frame.h"
#include "FrameTree.h"
+#include "HTMLElement.h"
#include "HTMLFrameOwnerElement.h"
#include "InspectorFrontend.h"
-#include "markup.h"
#include "MutationEvent.h"
#include "Node.h"
#include "NodeList.h"
@@ -355,12 +355,28 @@ void InspectorDOMAgent::pushChildNodesToFrontend(long nodeId)
m_frontend->setChildNodes(nodeId, children);
}
+long InspectorDOMAgent::pushNodeByPathToFrontend(const String& path)
+{
+ Node* node = nodeForPath(path);
+ if (!node)
+ return 0;
+ return pushNodePathToFrontend(node);
+}
+
+long InspectorDOMAgent::inspectedNode(unsigned long num)
+{
+ if (num < m_inspectedNodes.size())
+ return m_inspectedNodes[num];
+ return 0;
+}
+
void InspectorDOMAgent::discardBindings()
{
m_documentNodeToIdMap.clear();
m_idToNode.clear();
releaseDanglingNodes();
m_childrenRequested.clear();
+ m_inspectedNodes.clear();
}
Node* InspectorDOMAgent::nodeForId(long id)
@@ -374,35 +390,6 @@ Node* InspectorDOMAgent::nodeForId(long id)
return 0;
}
-Node* InspectorDOMAgent::nodeForPath(const String& path)
-{
- // The path is of form "1,HTML,2,BODY,1,DIV"
- Node* node = mainFrameDocument();
- if (!node)
- return 0;
-
- Vector<String> pathTokens;
- path.split(",", false, pathTokens);
- for (size_t i = 0; i < pathTokens.size() - 1; i += 2) {
- bool success = true;
- unsigned childNumber = pathTokens[i].toUInt(&success);
- if (!success)
- return 0;
- if (childNumber >= innerChildNodeCount(node))
- return 0;
-
- Node* child = innerFirstChild(node);
- String childName = pathTokens[i + 1];
- for (size_t j = 0; child && j < childNumber; ++j)
- child = innerNextSibling(child);
-
- if (!child || child->nodeName() != childName)
- return 0;
- node = child;
- }
- return node;
-}
-
void InspectorDOMAgent::getChildNodes(long callId, long nodeId)
{
pushChildNodesToFrontend(nodeId);
@@ -481,40 +468,40 @@ void InspectorDOMAgent::removeNode(long callId, long nodeId)
{
Node* node = nodeForId(nodeId);
if (!node) {
- // Use -1 to denote an error condition.
- m_frontend->didRemoveNode(callId, -1);
+ m_frontend->didRemoveNode(callId, 0);
return;
}
Node* parentNode = node->parentNode();
if (!parentNode) {
- m_frontend->didRemoveNode(callId, -1);
+ m_frontend->didRemoveNode(callId, 0);
return;
}
- ExceptionCode code;
- parentNode->removeChild(node, code);
- if (code) {
- m_frontend->didRemoveNode(callId, -1);
+ ExceptionCode ec = 0;
+ parentNode->removeChild(node, ec);
+ if (ec) {
+ m_frontend->didRemoveNode(callId, 0);
return;
}
m_frontend->didRemoveNode(callId, nodeId);
}
-void InspectorDOMAgent::changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded)
+void InspectorDOMAgent::changeTagName(long callId, long nodeId, const String& tagName)
{
Node* oldNode = nodeForId(nodeId);
if (!oldNode || !oldNode->isElementNode()) {
- // Use -1 to denote an error condition.
- m_frontend->didChangeTagName(callId, -1);
+ m_frontend->didChangeTagName(callId, 0);
return;
}
- ExceptionCode code = 0;
- RefPtr<Element> newElem = oldNode->document()->createElement(tagName, code);
- if (code) {
- m_frontend->didChangeTagName(callId, -1);
+ bool childrenRequested = m_childrenRequested.contains(nodeId);
+
+ ExceptionCode ec = 0;
+ RefPtr<Element> newElem = oldNode->document()->createElement(tagName, ec);
+ if (ec) {
+ m_frontend->didChangeTagName(callId, 0);
return;
}
@@ -527,24 +514,63 @@ void InspectorDOMAgent::changeTagName(long callId, long nodeId, const AtomicStri
// Copy over the original node's children.
Node* child;
while ((child = oldNode->firstChild()))
- newElem->appendChild(child, code);
+ newElem->appendChild(child, ec);
// Replace the old node with the new node
Node* parent = oldNode->parentNode();
- parent->insertBefore(newElem, oldNode->nextSibling(), code);
- parent->removeChild(oldNode, code);
+ parent->insertBefore(newElem, oldNode->nextSibling(), ec);
+ parent->removeChild(oldNode, ec);
- if (code) {
- m_frontend->didChangeTagName(callId, -1);
+ if (ec) {
+ m_frontend->didChangeTagName(callId, 0);
return;
}
long newId = pushNodePathToFrontend(newElem.get());
- if (expanded)
+ if (childrenRequested)
pushChildNodesToFrontend(newId);
m_frontend->didChangeTagName(callId, newId);
}
+void InspectorDOMAgent::getOuterHTML(long callId, long nodeId)
+{
+ Node* node = nodeForId(nodeId);
+ if (!node || !node->isHTMLElement()) {
+ m_frontend->didGetOuterHTML(callId, "");
+ return;
+ }
+
+ HTMLElement* htmlElement = static_cast<HTMLElement*>(node);
+ m_frontend->didGetOuterHTML(callId, htmlElement->outerHTML());
+}
+
+void InspectorDOMAgent::setOuterHTML(long callId, long nodeId, const String& outerHTML)
+{
+ Node* node = nodeForId(nodeId);
+ if (!node || !node->isHTMLElement()) {
+ m_frontend->didSetOuterHTML(callId, 0);
+ return;
+ }
+
+ bool childrenRequested = m_childrenRequested.contains(nodeId);
+ Node* previousSibling = node->previousSibling();
+ Node* parentNode = node->parentNode();
+
+ HTMLElement* htmlElement = static_cast<HTMLElement*>(node);
+ ExceptionCode ec = 0;
+ htmlElement->setOuterHTML(outerHTML, ec);
+ if (ec)
+ m_frontend->didSetOuterHTML(callId, 0);
+
+ Node* newNode = previousSibling ? previousSibling->nextSibling() : parentNode->firstChild();
+
+ long newId = pushNodePathToFrontend(newNode);
+ if (childrenRequested)
+ pushChildNodesToFrontend(newId);
+
+ m_frontend->didSetOuterHTML(callId, newId);
+}
+
void InspectorDOMAgent::setTextNodeValue(long callId, long nodeId, const String& value)
{
Node* node = nodeForId(nodeId);
@@ -632,6 +658,13 @@ void InspectorDOMAgent::getEventListenersForNode(long callId, long nodeId)
m_frontend->didGetEventListenersForNode(callId, nodeId, listenersArray);
}
+void InspectorDOMAgent::addInspectedNode(long nodeId)
+{
+ m_inspectedNodes.prepend(nodeId);
+ while (m_inspectedNodes.size() > 5)
+ m_inspectedNodes.removeLast();
+}
+
void InspectorDOMAgent::performSearch(const String& whitespaceTrimmedQuery, bool runSynchronously)
{
// FIXME: Few things are missing here:
@@ -1531,6 +1564,35 @@ bool InspectorDOMAgent::ruleAffectsNode(CSSStyleRule* rule, Node* node)
return false;
}
+Node* InspectorDOMAgent::nodeForPath(const String& path)
+{
+ // The path is of form "1,HTML,2,BODY,1,DIV"
+ Node* node = mainFrameDocument();
+ if (!node)
+ return 0;
+
+ Vector<String> pathTokens;
+ path.split(",", false, pathTokens);
+ for (size_t i = 0; i < pathTokens.size() - 1; i += 2) {
+ bool success = true;
+ unsigned childNumber = pathTokens[i].toUInt(&success);
+ if (!success)
+ return 0;
+ if (childNumber >= innerChildNodeCount(node))
+ return 0;
+
+ Node* child = innerFirstChild(node);
+ String childName = pathTokens[i + 1];
+ for (size_t j = 0; child && j < childNumber; ++j)
+ child = innerNextSibling(child);
+
+ if (!child || child->nodeName() != childName)
+ return 0;
+ node = child;
+ }
+ return node;
+}
+
ScriptArray InspectorDOMAgent::toArray(const Vector<String>& data)
{
ScriptArray result = m_frontend->newScriptArray();
diff --git a/WebCore/inspector/InspectorDOMAgent.h b/WebCore/inspector/InspectorDOMAgent.h
index a962569..70d5b94 100644
--- a/WebCore/inspector/InspectorDOMAgent.h
+++ b/WebCore/inspector/InspectorDOMAgent.h
@@ -102,9 +102,12 @@ namespace WebCore {
void setAttribute(long callId, long elementId, const String& name, const String& value);
void removeAttribute(long callId, long elementId, const String& name);
void removeNode(long callId, long nodeId);
- void changeTagName(long callId, long nodeId, const AtomicString& tagName, bool expanded);
+ void changeTagName(long callId, long nodeId, const String& tagName);
+ void getOuterHTML(long callId, long nodeId);
+ void setOuterHTML(long callId, long nodeId, const String& outerHTML);
void setTextNodeValue(long callId, long nodeId, const String& value);
void getEventListenersForNode(long callId, long nodeId);
+ void addInspectedNode(long nodeId);
void performSearch(const String& whitespaceTrimmedQuery, bool runSynchronously);
void searchCanceled();
@@ -131,9 +134,10 @@ namespace WebCore {
void didModifyDOMAttr(Element*);
Node* nodeForId(long nodeId);
- Node* nodeForPath(const String& path);
long pushNodePathToFrontend(Node* node);
void pushChildNodesToFrontend(long nodeId);
+ long pushNodeByPathToFrontend(const String& path);
+ long inspectedNode(unsigned long num);
private:
static CSSStyleSheet* getParentStyleSheet(CSSStyleDeclaration*);
@@ -183,6 +187,7 @@ namespace WebCore {
String shorthandValue(CSSStyleDeclaration*, const String& shorthandProperty);
String shorthandPriority(CSSStyleDeclaration*, const String& shorthandProperty);
bool ruleAffectsNode(CSSStyleRule*, Node*);
+ Node* nodeForPath(const String& path);
ScriptArray toArray(const Vector<String>& data);
void discardBindings();
@@ -200,6 +205,7 @@ namespace WebCore {
Deque<MatchJob*> m_pendingMatchJobs;
Timer<InspectorDOMAgent> m_matchJobsTimer;
HashSet<RefPtr<Node> > m_searchResults;
+ Vector<long> m_inspectedNodes;
};
} // namespace WebCore
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index c9aa730..cde5a70 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -184,14 +184,6 @@ void InspectorFrontend::updateFocusedNode(long nodeId)
function.call();
}
-void InspectorFrontend::setAttachedWindow(bool attached)
-{
- ScriptFunctionCall function(m_webInspector, "dispatch");
- function.appendArgument("setAttachedWindow");
- function.appendArgument(attached);
- function.call();
-}
-
void InspectorFrontend::showPanel(int panel)
{
const char* showFunctionName;
@@ -239,6 +231,11 @@ void InspectorFrontend::reset()
callSimpleFunction("reset");
}
+void InspectorFrontend::resetProfilesPanel()
+{
+ callSimpleFunction("resetProfilesPanel");
+}
+
void InspectorFrontend::bringToFront()
{
callSimpleFunction("bringToFront");
@@ -262,7 +259,6 @@ void InspectorFrontend::resourceTrackingWasDisabled()
callSimpleFunction("resourceTrackingWasDisabled");
}
-
void InspectorFrontend::searchingForNodeWasEnabled()
{
callSimpleFunction("searchingForNodeWasEnabled");
@@ -273,6 +269,16 @@ void InspectorFrontend::searchingForNodeWasDisabled()
callSimpleFunction("searchingForNodeWasDisabled");
}
+void InspectorFrontend::monitoringXHRWasEnabled()
+{
+ callSimpleFunction("monitoringXHRWasEnabled");
+}
+
+void InspectorFrontend::monitoringXHRWasDisabled()
+{
+ callSimpleFunction("monitoringXHRWasDisabled");
+}
+
void InspectorFrontend::updatePauseOnExceptionsState(long state)
{
ScriptFunctionCall function(m_webInspector, "dispatch");
@@ -514,6 +520,33 @@ void InspectorFrontend::didChangeTagName(long callId, long nodeId)
function.call();
}
+void InspectorFrontend::didGetOuterHTML(long callId, const String& outerHTML)
+{
+ ScriptFunctionCall function(m_webInspector, "dispatch");
+ function.appendArgument("didGetOuterHTML");
+ function.appendArgument(callId);
+ function.appendArgument(outerHTML);
+ function.call();
+}
+
+void InspectorFrontend::didSetOuterHTML(long callId, long nodeId)
+{
+ ScriptFunctionCall function(m_webInspector, "dispatch");
+ function.appendArgument("didSetOuterHTML");
+ function.appendArgument(callId);
+ function.appendArgument(nodeId);
+ function.call();
+}
+
+void InspectorFrontend::didPushNodeByPathToFrontend(long callId, long nodeId)
+{
+ ScriptFunctionCall function(m_webInspector, "dispatch");
+ function.appendArgument("didPushNodeByPathToFrontend");
+ function.appendArgument(callId);
+ function.appendArgument(nodeId);
+ function.call();
+}
+
void InspectorFrontend::didGetChildNodes(long callId)
{
ScriptFunctionCall function(m_webInspector, "dispatch");
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index 1762014..0b19983 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -77,10 +77,10 @@ namespace WebCore {
void didGetResourceContent(long callId, const String& content);
void updateFocusedNode(long nodeId);
- void setAttachedWindow(bool attached);
void showPanel(int panel);
void populateInterface();
void reset();
+ void resetProfilesPanel();
void bringToFront();
void inspectedURLChanged(const String&);
@@ -91,6 +91,9 @@ namespace WebCore {
void searchingForNodeWasEnabled();
void searchingForNodeWasDisabled();
+ void monitoringXHRWasEnabled();
+ void monitoringXHRWasDisabled();
+
void updatePauseOnExceptionsState(long state);
#if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -142,6 +145,9 @@ namespace WebCore {
void didGetEventListenersForNode(long callId, long nodeId, const ScriptArray& listenersArray);
void didRemoveNode(long callId, long nodeId);
void didChangeTagName(long callId, long nodeId);
+ void didGetOuterHTML(long callId, const String& outerHTML);
+ void didSetOuterHTML(long callId, long nodeId);
+ void didPushNodeByPathToFrontend(long callId, long nodeId);
void didGetStyles(long callId, const ScriptValue& styles);
void didGetAllStyles(long callId, const ScriptArray& styles);
diff --git a/WebCore/inspector/InspectorFrontendClientLocal.cpp b/WebCore/inspector/InspectorFrontendClientLocal.cpp
index 188566f..16a6a8b 100644
--- a/WebCore/inspector/InspectorFrontendClientLocal.cpp
+++ b/WebCore/inspector/InspectorFrontendClientLocal.cpp
@@ -148,7 +148,7 @@ void InspectorFrontendClientLocal::restoreAttachedWindowHeight()
String attachedHeight = m_inspectorController->setting(inspectorAttachedHeightName);
bool success = true;
int height = attachedHeight.toInt(&success);
- unsigned preferredHeight = success ? height : defaultAttachedHeight;
+ unsigned preferredHeight = success ? static_cast<unsigned>(height) : defaultAttachedHeight;
// This call might not go through (if the window starts out detached), but if the window is initially created attached,
// InspectorController::attachWindow is never called, so we need to make sure to set the attachedWindowHeight.
diff --git a/WebCore/inspector/InspectorValues.cpp b/WebCore/inspector/InspectorValues.cpp
index 5c7d0c8..f95116c 100644
--- a/WebCore/inspector/InspectorValues.cpp
+++ b/WebCore/inspector/InspectorValues.cpp
@@ -499,7 +499,7 @@ PassRefPtr<InspectorArray> InspectorValue::asArray()
return 0;
}
-PassRefPtr<InspectorValue> InspectorValue::readJSON(const String& json)
+PassRefPtr<InspectorValue> InspectorValue::parseJSON(const String& json)
{
const UChar* start = json.characters();
const UChar* end = json.characters() + json.length();
@@ -599,7 +599,7 @@ PassRefPtr<InspectorObject> InspectorObject::getObject(const String& name) const
{
PassRefPtr<InspectorValue> value = get(name);
if (!value)
- return false;
+ return 0;
return value->asObject();
}
@@ -607,7 +607,7 @@ PassRefPtr<InspectorArray> InspectorObject::getArray(const String& name) const
{
PassRefPtr<InspectorValue> value = get(name);
if (!value)
- return false;
+ return 0;
return value->asArray();
}
diff --git a/WebCore/inspector/InspectorValues.h b/WebCore/inspector/InspectorValues.h
index b9920c4..30ba95a 100644
--- a/WebCore/inspector/InspectorValues.h
+++ b/WebCore/inspector/InspectorValues.h
@@ -73,7 +73,7 @@ public:
virtual PassRefPtr<InspectorObject> asObject();
virtual PassRefPtr<InspectorArray> asArray();
- static PassRefPtr<InspectorValue> readJSON(const String& json);
+ static PassRefPtr<InspectorValue> parseJSON(const String& json);
String toJSONString() const;
virtual void writeJSON(Vector<UChar>* output) const;
diff --git a/WebCore/inspector/ScriptBreakpoint.cpp b/WebCore/inspector/ScriptBreakpoint.cpp
new file mode 100644
index 0000000..ce0d18a
--- /dev/null
+++ b/WebCore/inspector/ScriptBreakpoint.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "ScriptBreakpoint.h"
+
+#if ENABLE(INSPECTOR)
+
+#include "InspectorValues.h"
+
+namespace WebCore {
+
+void ScriptBreakpoint::sourceBreakpointsFromInspectorObject(PassRefPtr<InspectorObject> breakpoints, SourceBreakpoints* sourceBreakpoints)
+{
+ for (InspectorObject::iterator it = breakpoints->begin(); it != breakpoints->end(); ++it) {
+ bool ok;
+ int lineNumber = it->first.toInt(&ok);
+ if (!ok)
+ continue;
+ RefPtr<InspectorObject> breakpoint = it->second->asObject();
+ if (!breakpoint)
+ continue;
+ bool enabled;
+ RefPtr<InspectorValue> enabledValue = breakpoint->get("enabled");
+ if (!enabledValue || !enabledValue->asBool(&enabled))
+ continue;
+ String condition;
+ RefPtr<InspectorValue> conditionValue = breakpoint->get("condition");
+ if (!conditionValue || !conditionValue->asString(&condition))
+ continue;
+ sourceBreakpoints->set(lineNumber, ScriptBreakpoint(enabled, condition));
+ }
+}
+
+PassRefPtr<InspectorObject> ScriptBreakpoint::inspectorObjectFromSourceBreakpoints(const SourceBreakpoints& sourceBreakpoints)
+{
+ RefPtr<InspectorObject> breakpoints = InspectorObject::create();
+ for (SourceBreakpoints::const_iterator it = sourceBreakpoints.begin(); it != sourceBreakpoints.end(); ++it) {
+ RefPtr<InspectorObject> breakpoint = InspectorObject::create();
+ breakpoint->setBool("enabled", it->second.enabled);
+ breakpoint->setString("condition", it->second.condition);
+ breakpoints->set(String::number(it->first), breakpoint);
+ }
+ return breakpoints.release();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
diff --git a/WebCore/inspector/ScriptBreakpoint.h b/WebCore/inspector/ScriptBreakpoint.h
index 8775901..b7c7a37 100644
--- a/WebCore/inspector/ScriptBreakpoint.h
+++ b/WebCore/inspector/ScriptBreakpoint.h
@@ -35,6 +35,11 @@
namespace WebCore {
+class InspectorObject;
+struct ScriptBreakpoint;
+
+typedef HashMap<int, ScriptBreakpoint> SourceBreakpoints;
+
struct ScriptBreakpoint {
ScriptBreakpoint(bool enabled, const String& condition)
: enabled(enabled)
@@ -48,9 +53,10 @@ struct ScriptBreakpoint {
bool enabled;
String condition;
-};
-typedef HashMap<int, ScriptBreakpoint> SourceBreakpoints;
+ static void sourceBreakpointsFromInspectorObject(PassRefPtr<InspectorObject>, SourceBreakpoints*);
+ static PassRefPtr<InspectorObject> inspectorObjectFromSourceBreakpoints(const SourceBreakpoints&);
+};
} // namespace WebCore
diff --git a/WebCore/inspector/front-end/BreakpointManager.js b/WebCore/inspector/front-end/BreakpointManager.js
index 3ccccac..4f6965a 100644
--- a/WebCore/inspector/front-end/BreakpointManager.js
+++ b/WebCore/inspector/front-end/BreakpointManager.js
@@ -38,6 +38,7 @@ WebInspector.BreakpointManager.prototype = {
if (this._oneTimeBreakpoint)
this._removeBreakpointFromBackend(this._oneTimeBreakpoint);
this._oneTimeBreakpoint = breakpoint;
+ // FIXME(40669): one time breakpoint will be persisted in inspector settings if not hit.
this._saveBreakpointOnBackend(breakpoint);
},
@@ -51,15 +52,15 @@ WebInspector.BreakpointManager.prototype = {
addBreakpoint: function(sourceID, sourceURL, line, enabled, condition)
{
- var breakpoint = new WebInspector.Breakpoint(this, sourceID, sourceURL, line, enabled, condition);
- if (this._breakpoints[breakpoint.id])
- return;
- if (this._oneTimeBreakpoint && (this._oneTimeBreakpoint.id == breakpoint.id))
- delete this._oneTimeBreakpoint;
- this._breakpoints[breakpoint.id] = breakpoint;
- this._saveBreakpointOnBackend(breakpoint);
- this.dispatchEventToListeners("breakpoint-added", breakpoint);
- },
+ var breakpoint = this._addBreakpoint(sourceID, sourceURL, line, enabled, condition);
+ if (breakpoint)
+ this._saveBreakpointOnBackend(breakpoint);
+ },
+
+ restoredBreakpoint: function(sourceID, sourceURL, line, enabled, condition)
+ {
+ this._addBreakpoint(sourceID, sourceURL, line, enabled, condition);
+ },
removeBreakpoint: function(breakpoint)
{
@@ -78,7 +79,7 @@ WebInspector.BreakpointManager.prototype = {
breakpoints.push(this._breakpoints[id]);
}
return breakpoints;
- },
+ },
breakpointsForURL: function(url)
{
@@ -87,7 +88,7 @@ WebInspector.BreakpointManager.prototype = {
if (this._breakpoints[id].url === url)
breakpoints.push(this._breakpoints[id]);
}
- return breakpoints;
+ return breakpoints;
},
reset: function()
@@ -96,6 +97,18 @@ WebInspector.BreakpointManager.prototype = {
delete this._oneTimeBreakpoint;
},
+ _addBreakpoint: function(sourceID, sourceURL, line, enabled, condition)
+ {
+ var breakpoint = new WebInspector.Breakpoint(this, sourceID, sourceURL, line, enabled, condition);
+ if (this._breakpoints[breakpoint.id])
+ return;
+ if (this._oneTimeBreakpoint && (this._oneTimeBreakpoint.id == breakpoint.id))
+ delete this._oneTimeBreakpoint;
+ this._breakpoints[breakpoint.id] = breakpoint;
+ this.dispatchEventToListeners("breakpoint-added", breakpoint);
+ return breakpoint;
+ },
+
_saveBreakpointOnBackend: function(breakpoint)
{
InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition);
diff --git a/WebCore/inspector/front-end/CSSCompletions.js b/WebCore/inspector/front-end/CSSCompletions.js
new file mode 100644
index 0000000..5485464
--- /dev/null
+++ b/WebCore/inspector/front-end/CSSCompletions.js
@@ -0,0 +1,102 @@
+WebInspector.CSSCompletions = (function() {
+ var used = {};
+ var properties = [];
+ var style = document.documentElement.style;
+ var list = document.defaultView.getComputedStyle(document.documentElement, "");
+ var length = list.length;
+ for (var i = 0; i < length; ++i)
+ used[properties[i] = list[i]] = true;
+
+ for (var i = 0, end = length; i < length; ++i) {
+ var propertyWords = properties[i].split("-");
+ var j = propertyWords.length;
+ while (--j) {
+ propertyWords.pop();
+ var shorthand = propertyWords.join("-");
+ if (!(shorthand in used) && style[shorthand] !== undefined) {
+ used[shorthand] = true;
+ properties[end++] = shorthand;
+ }
+ }
+ }
+
+ return properties.sort();
+})();
+
+WebInspector.CSSCompletions.startsWith = function(prefix)
+{
+ var firstIndex = this._firstIndexOfPrefix(prefix);
+ if (firstIndex === -1)
+ return [];
+
+ var results = [];
+ while (this[firstIndex].indexOf(prefix) === 0)
+ results.push(this[firstIndex++]);
+ return results;
+}
+
+WebInspector.CSSCompletions.firstStartsWith = function(prefix)
+{
+ var foundIndex = this._firstIndexOfPrefix(prefix);
+ return (foundIndex === -1 ? "" : this[foundIndex]);
+}
+
+WebInspector.CSSCompletions._firstIndexOfPrefix = function(prefix)
+{
+ if (!prefix)
+ return -1;
+
+ var maxIndex = this.length - 1;
+ var minIndex = 0;
+ var foundIndex;
+
+ do {
+ var middleIndex = (maxIndex + minIndex) >> 1;
+ if (this[middleIndex].indexOf(prefix) === 0) {
+ foundIndex = middleIndex;
+ break;
+ }
+ if (this[middleIndex] < prefix)
+ minIndex = middleIndex + 1;
+ else
+ maxIndex = middleIndex - 1;
+ } while (minIndex <= maxIndex);
+
+ if (!foundIndex)
+ return -1;
+
+ while (foundIndex && this[foundIndex - 1].indexOf(prefix) === 0)
+ foundIndex--;
+
+ return foundIndex;
+}
+
+WebInspector.CSSCompletions.next = function(str, prefix)
+{
+ return WebInspector.CSSCompletions._closest(str, prefix, 1);
+}
+
+WebInspector.CSSCompletions.previous = function(str, prefix)
+{
+ return WebInspector.CSSCompletions._closest(str, prefix, -1);
+}
+
+WebInspector.CSSCompletions._closest = function(str, prefix, shift)
+{
+ if (!str)
+ return "";
+
+ var index = this.indexOf(str);
+ if (index === -1)
+ return "";
+
+ if (!prefix) {
+ index = (index + this.length + shift) % this.length;
+ return this[index];
+ }
+
+ var propertiesWithPrefix = this.startsWith(prefix);
+ var j = propertiesWithPrefix.indexOf(str);
+ j = (j + propertiesWithPrefix.length + shift) % propertiesWithPrefix.length;
+ return propertiesWithPrefix[j];
+}
diff --git a/WebCore/inspector/front-end/ConsoleView.js b/WebCore/inspector/front-end/ConsoleView.js
index d1f347b..8bb71e6 100644
--- a/WebCore/inspector/front-end/ConsoleView.js
+++ b/WebCore/inspector/front-end/ConsoleView.js
@@ -296,7 +296,7 @@ WebInspector.ConsoleView.prototype = {
requestClearMessages: function()
{
- InjectedScriptAccess.getDefault().clearConsoleMessages(function() {});
+ InspectorBackend.clearConsoleMessages();
},
clearMessages: function()
@@ -399,7 +399,13 @@ WebInspector.ConsoleView.prototype = {
return;
}
- this._contextMenu.show(event);
+ var contextMenu = new WebInspector.ContextMenu();
+ if (!WebInspector.monitoringXHREnabled)
+ contextMenu.appendItem(WebInspector.UIString("Enable XMLHttpRequest logging"), InspectorBackend.enableMonitoringXHR.bind(InspectorBackend));
+ else
+ contextMenu.appendItem(WebInspector.UIString("Disable XMLHttpRequest logging"), InspectorBackend.disableMonitoringXHR.bind(InspectorBackend));
+ contextMenu.appendItem(WebInspector.UIString("Clear Console"), this.requestClearMessages.bind(this));
+ contextMenu.show(event);
},
_messagesSelectStart: function(event)
@@ -444,8 +450,6 @@ WebInspector.ConsoleView.prototype = {
var clearConsoleHandler = this.requestClearMessages.bind(this);
var shortcutL = shortcut.makeDescriptor("l", WebInspector.KeyboardShortcut.Modifiers.Ctrl);
this._shortcuts[shortcutL.key] = clearConsoleHandler;
- this._contextMenu = new WebInspector.ContextMenu();
- this._contextMenu.appendItem(WebInspector.UIString("Clear Console"), clearConsoleHandler);
var section = WebInspector.shortcutsHelp.section(WebInspector.UIString("Console"));
var keys = WebInspector.isMac() ? [ shortcutK.name, shortcutL.name ] : [ shortcutL.name ];
diff --git a/WebCore/inspector/front-end/DOMAgent.js b/WebCore/inspector/front-end/DOMAgent.js
index 5bde12f..ee85d1c 100644
--- a/WebCore/inspector/front-end/DOMAgent.js
+++ b/WebCore/inspector/front-end/DOMAgent.js
@@ -669,6 +669,9 @@ WebInspector.didRemoveAttribute = WebInspector.Callback.processCallback;
WebInspector.didSetTextNodeValue = WebInspector.Callback.processCallback;
WebInspector.didRemoveNode = WebInspector.Callback.processCallback;
WebInspector.didChangeTagName = WebInspector.Callback.processCallback;
+WebInspector.didGetOuterHTML = WebInspector.Callback.processCallback;
+WebInspector.didSetOuterHTML = WebInspector.Callback.processCallback;
+WebInspector.didPushNodeByPathToFrontend = WebInspector.Callback.processCallback;
WebInspector.didGetEventListenersForNode = WebInspector.Callback.processCallback;
WebInspector.didGetStyles = WebInspector.Callback.processCallback;
diff --git a/WebCore/inspector/front-end/ElementsPanel.js b/WebCore/inspector/front-end/ElementsPanel.js
index 55ba82d..c8eb3dd 100644
--- a/WebCore/inspector/front-end/ElementsPanel.js
+++ b/WebCore/inspector/front-end/ElementsPanel.js
@@ -59,7 +59,7 @@ WebInspector.ElementsPanel = function()
this.panel.updateEventListeners();
if (this._focusedDOMNode)
- InjectedScriptAccess.get(this._focusedDOMNode.injectedScriptId).addInspectedNode(this._focusedDOMNode.id, function() {});
+ InspectorBackend.addInspectedNode(this._focusedDOMNode.id);
};
this.contentElement.appendChild(this.treeOutline.element);
@@ -224,9 +224,10 @@ WebInspector.ElementsPanel.prototype = {
selectNode.call(this, node);
}
- if (this._selectedPathOnReset)
- InjectedScriptAccess.getDefault().nodeByPath(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
- else
+ if (this._selectedPathOnReset) {
+ var callId = WebInspector.Callback.wrap(selectLastSelectedNode.bind(this));
+ InspectorBackend.pushNodeByPathToFrontend(callId, this._selectedPathOnReset);
+ } else
selectNode.call(this);
delete this._selectedPathOnReset;
},
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index e8fecb0..1b84b83 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -1094,7 +1094,7 @@ WebInspector.ElementsTreeElement.prototype = {
function changeTagNameCallback(nodeId)
{
- if (nodeId === -1) {
+ if (!nodeId) {
cancel();
return;
}
@@ -1111,7 +1111,7 @@ WebInspector.ElementsTreeElement.prototype = {
}
var callId = WebInspector.Callback.wrap(changeTagNameCallback);
- InspectorBackend.changeTagName(callId, this.representedObject.id, newText, wasExpanded);
+ InspectorBackend.changeTagName(callId, this.representedObject.id, newText);
},
_textNodeEditingCommitted: function(element, newText)
@@ -1382,10 +1382,12 @@ WebInspector.ElementsTreeElement.prototype = {
function commitChange(value)
{
- InjectedScriptAccess.get(node.injectedScriptId).setOuterHTML(node.id, value, wasExpanded, selectNode.bind(this));
+ var setCallId = WebInspector.Callback.wrap(selectNode);
+ InspectorBackend.setOuterHTML(setCallId, node.id, value);
}
- InjectedScriptAccess.get(node.injectedScriptId).getNodePropertyValue(node.id, "outerHTML", this._startEditingAsHTML.bind(this, commitChange));
+ var getCallId = WebInspector.Callback.wrap(this._startEditingAsHTML.bind(this, commitChange));
+ InspectorBackend.getOuterHTML(getCallId, node.id);
},
_copyHTML: function()
diff --git a/WebCore/inspector/front-end/InjectedScript.js b/WebCore/inspector/front-end/InjectedScript.js
index e62a916..26495e8 100644
--- a/WebCore/inspector/front-end/InjectedScript.js
+++ b/WebCore/inspector/front-end/InjectedScript.js
@@ -80,13 +80,6 @@ InjectedScript.releaseWrapperObjectGroup = function(objectGroupName) {
delete InjectedScript.objectGroups[objectGroupName];
};
-// Called from within InspectorController on the 'inspected page' side.
-InjectedScript.reset = function()
-{
-}
-
-InjectedScript.reset();
-
InjectedScript.dispatch = function(methodName, args, callId)
{
var argsArray = eval("(" + args + ")");
@@ -218,29 +211,6 @@ InjectedScript.setPropertyValue = function(objectProxy, propertyName, expression
}
}
-InjectedScript.getNodePropertyValue = function(nodeId, propertyName)
-{
- var node = InjectedScript._nodeForId(nodeId);
- if (!node)
- return false;
- var result = node[propertyName];
- return result !== undefined ? result : false;
-}
-
-InjectedScript.setOuterHTML = function(nodeId, value, expanded)
-{
- var node = InjectedScript._nodeForId(nodeId);
- if (!node)
- return false;
-
- var parent = node.parentNode;
- var prevSibling = node.previousSibling;
- node.outerHTML = value;
- var newNode = prevSibling ? prevSibling.nextSibling : parent.firstChild;
-
- return InjectedScriptHost.pushNodePathToFrontend(newNode, expanded, false);
-}
-
InjectedScript._populatePropertyNames = function(object, resultSet)
{
for (var o = object; o; o = o.__proto__) {
@@ -281,14 +251,15 @@ InjectedScript.getCompletions = function(expression, includeInspectorCommandLine
} else {
if (!expression)
expression = "this";
- expressionResult = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression);
+ expressionResult = InjectedScript._evaluateOn(inspectedWindow.eval, inspectedWindow, expression, false);
}
- if (typeof expressionResult == "object")
+ if (typeof expressionResult === "object")
InjectedScript._populatePropertyNames(expressionResult, props);
- if (includeInspectorCommandLineAPI)
- for (var prop in inspectedWindow.console._inspectorCommandLineAPI)
- if (prop.charAt(0) !== '_')
- props[prop] = true;
+
+ if (includeInspectorCommandLineAPI) {
+ for (var prop in InjectedScript._commandLineAPI)
+ props[prop] = true;
+ }
} catch(e) {
}
return props;
@@ -319,14 +290,21 @@ InjectedScript._evaluateAndWrap = function(evalFunction, object, expression, obj
InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseCommandLineAPI)
{
- InjectedScript._ensureCommandLineAPIInstalled(evalFunction, object);
- // Surround the expression in with statements to inject our command line API so that
- // the window object properties still take more precedent than our API functions.
- if (!dontUseCommandLineAPI)
- expression = "with (window.console._inspectorCommandLineAPI) { with (window) {\n" + expression + "\n} }";
+ if (!dontUseCommandLineAPI) {
+ // Only install command line api object for the time of evaluation.
+
+ // Surround the expression in with statements to inject our command line API so that
+ // the window object properties still take more precedent than our API functions.
+ inspectedWindow.console._commandLineAPI = InjectedScript._commandLineAPI;
+
+ expression = "with (window.console._commandLineAPI) { with (window) {\n" + expression + "\n} }";
+ }
var value = evalFunction.call(object, expression);
+ if (!dontUseCommandLineAPI)
+ delete inspectedWindow.console._commandLineAPI;
+
// When evaluating on call frame error is not thrown, but returned as a value.
if (InjectedScript._type(value) === "error")
throw value.toString();
@@ -334,20 +312,6 @@ InjectedScript._evaluateOn = function(evalFunction, object, expression, dontUseC
return value;
}
-InjectedScript.addInspectedNode = function(nodeId)
-{
- var node = InjectedScript._nodeForId(nodeId);
- if (!node)
- return false;
-
- InjectedScript._ensureCommandLineAPIInstalled(inspectedWindow.eval, inspectedWindow);
- var inspectedNodes = inspectedWindow.console._inspectorCommandLineAPI._inspectedNodes;
- inspectedNodes.unshift(node);
- if (inspectedNodes.length >= 5)
- inspectedNodes.pop();
- return true;
-}
-
InjectedScript.getNodeId = function(node)
{
return InjectedScriptHost.pushNodePathToFrontend(node, false, false);
@@ -392,125 +356,10 @@ InjectedScript._callFrameForId = function(id)
return callFrame;
}
-InjectedScript.clearConsoleMessages = function()
-{
- InjectedScriptHost.clearConsoleMessages();
- return true;
-}
-
-InjectedScript._inspectObject = function(o)
-{
- if (arguments.length === 0)
- return;
-
- inspectedWindow.console.log(o);
- if (InjectedScript._type(o) === "node") {
- InjectedScriptHost.pushNodePathToFrontend(o, false, true);
- } else {
- switch (InjectedScript._describe(o)) {
- case "Database":
- InjectedScriptHost.selectDatabase(o);
- break;
- case "Storage":
- InjectedScriptHost.selectDOMStorage(o);
- break;
- }
- }
-}
-
-InjectedScript._copy = function(o)
-{
- if (InjectedScript._type(o) === "node") {
- var nodeId = InjectedScriptHost.pushNodePathToFrontend(o, false, false);
- InjectedScriptHost.copyNode(nodeId);
- } else {
- InjectedScriptHost.copyText(o);
- }
-}
-
-InjectedScript._ensureCommandLineAPIInstalled = function(evalFunction, evalObject)
-{
- if (evalFunction.call(evalObject, "window.console._inspectorCommandLineAPI"))
- return;
- var inspectorCommandLineAPI = evalFunction.call(evalObject, "window.console._inspectorCommandLineAPI = { \n\
- $: function() { return document.getElementById.apply(document, arguments) }, \n\
- $$: function() { return document.querySelectorAll.apply(document, arguments) }, \n\
- $x: function(xpath, context) \n\
- { \n\
- var nodes = []; \n\
- try { \n\
- var doc = context || document; \n\
- var results = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null); \n\
- var node; \n\
- while (node = results.iterateNext()) nodes.push(node); \n\
- } catch (e) {} \n\
- return nodes; \n\
- }, \n\
- dir: function() { return console.dir.apply(console, arguments) }, \n\
- dirxml: function() { return console.dirxml.apply(console, arguments) }, \n\
- keys: function(o) { var a = []; for (var k in o) a.push(k); return a; }, \n\
- values: function(o) { var a = []; for (var k in o) a.push(o[k]); return a; }, \n\
- profile: function() { return console.profile.apply(console, arguments) }, \n\
- profileEnd: function() { return console.profileEnd.apply(console, arguments) }, \n\
- _logEvent: function _inspectorCommandLineAPI_logEvent(e) { console.log(e.type, e); }, \n\
- _allEventTypes: [\"mouse\", \"key\", \"load\", \"unload\", \"abort\", \"error\", \n\
- \"select\", \"change\", \"submit\", \"reset\", \"focus\", \"blur\", \n\
- \"resize\", \"scroll\"], \n\
- _normalizeEventTypes: function(t) \n\
- { \n\
- if (typeof t === \"undefined\") \n\
- t = console._inspectorCommandLineAPI._allEventTypes; \n\
- else if (typeof t === \"string\") \n\
- t = [t]; \n\
- var i, te = []; \n\
- for (i = 0; i < t.length; i++) { \n\
- if (t[i] === \"mouse\") \n\
- te.splice(0, 0, \"mousedown\", \"mouseup\", \"click\", \"dblclick\", \n\
- \"mousemove\", \"mouseover\", \"mouseout\"); \n\
- else if (t[i] === \"key\") \n\
- te.splice(0, 0, \"keydown\", \"keyup\", \"keypress\"); \n\
- else \n\
- te.push(t[i]); \n\
- } \n\
- return te; \n\
- }, \n\
- monitorEvents: function(o, t) \n\
- { \n\
- if (!o || !o.addEventListener || !o.removeEventListener) \n\
- return; \n\
- t = console._inspectorCommandLineAPI._normalizeEventTypes(t); \n\
- for (i = 0; i < t.length; i++) { \n\
- o.removeEventListener(t[i], console._inspectorCommandLineAPI._logEvent, false); \n\
- o.addEventListener(t[i], console._inspectorCommandLineAPI._logEvent, false); \n\
- } \n\
- }, \n\
- unmonitorEvents: function(o, t) \n\
- { \n\
- if (!o || !o.removeEventListener) \n\
- return; \n\
- t = console._inspectorCommandLineAPI._normalizeEventTypes(t); \n\
- for (i = 0; i < t.length; i++) { \n\
- o.removeEventListener(t[i], console._inspectorCommandLineAPI._logEvent, false); \n\
- } \n\
- }, \n\
- _inspectedNodes: [], \n\
- get $0() { return console._inspectorCommandLineAPI._inspectedNodes[0] }, \n\
- get $1() { return console._inspectorCommandLineAPI._inspectedNodes[1] }, \n\
- get $2() { return console._inspectorCommandLineAPI._inspectedNodes[2] }, \n\
- get $3() { return console._inspectorCommandLineAPI._inspectedNodes[3] }, \n\
- get $4() { return console._inspectorCommandLineAPI._inspectedNodes[4] }, \n\
- };");
-
- inspectorCommandLineAPI.clear = InjectedScript.clearConsoleMessages;
- inspectorCommandLineAPI.inspect = InjectedScript._inspectObject;
- inspectorCommandLineAPI.copy = InjectedScript._copy;
-}
-
InjectedScript._resolveObject = function(objectProxy)
{
var object = InjectedScript._objectForId(objectProxy.objectId);
var path = objectProxy.path;
- var protoDepth = objectProxy.protoDepth;
// Follow the property path.
for (var i = 0; InjectedScript._isDefined(object) && path && i < path.length; ++i)
@@ -532,11 +381,11 @@ InjectedScript._objectForId = function(objectId)
// - numbers point to DOM Node via the InspectorDOMAgent mapping
// - strings point to console objects cached in InspectorController for lazy evaluation upon them
// - objects contain complex ids and are currently used for scoped objects
- if (typeof objectId === "number") {
+ if (typeof objectId === "number")
return InjectedScript._nodeForId(objectId);
- } else if (typeof objectId === "string") {
+ else if (typeof objectId === "string")
return InjectedScript.unwrapObject(objectId);
- } else if (typeof objectId === "object") {
+ else if (typeof objectId === "object") {
var callFrame = InjectedScript._callFrameForId(objectId.callFrame);
if (objectId.thisObject)
return callFrame.thisObject;
@@ -554,13 +403,6 @@ InjectedScript.pushNodeToFrontend = function(objectProxy)
return InjectedScriptHost.pushNodePathToFrontend(object, false, false);
}
-InjectedScript.nodeByPath = function(path)
-{
- // We make this call through the injected script only to get a nice
- // callback for it.
- return InjectedScriptHost.pushNodeByPathToFrontend(path.join(","));
-}
-
// Called from within InspectorController on the 'inspected page' side.
InjectedScript.createProxyObject = function(object, objectId, abbreviate)
{
@@ -736,14 +578,13 @@ InjectedScript._type = function(obj)
InjectedScript._describe = function(obj, abbreviated)
{
- var type1 = InjectedScript._type(obj);
- var type2 = InjectedScript._className(obj);
+ var type = InjectedScript._type(obj);
- switch (type1) {
+ switch (type) {
case "object":
case "node":
case "array":
- return type2;
+ return InjectedScript._className(obj);
case "string":
if (!abbreviated)
return obj;
@@ -752,10 +593,8 @@ InjectedScript._describe = function(obj, abbreviated)
return "\"" + obj + "\"";
case "function":
var objectText = InjectedScript._toString(obj);
- if (!/^function /.test(objectText))
- objectText = (type2 == "object") ? type1 : type2;
- else if (abbreviated)
- objectText = /.*/.exec(obj)[0].replace(/ +$/g, "");
+ if (abbreviated)
+ objectText = /.*/.exec(objectText)[0].replace(/ +$/g, "");
return objectText;
default:
return InjectedScript._toString(obj);
@@ -779,11 +618,185 @@ InjectedScript._className = function(obj)
return str.replace(/^\[object (.*)\]$/i, "$1");
} else {
// V8
- if (typeof obj !== "object")
- return "null";
- return obj.constructor.name || "Object";
+ return obj.constructor && obj.constructor.name || "Object";
+ }
+}
+
+InjectedScript._logEvent = function(event)
+{
+ console.log(event.type, event);
+}
+
+InjectedScript._normalizeEventTypes = function(types)
+{
+ if (typeof types === "undefined")
+ types = [ "mouse", "key", "load", "unload", "abort", "error", "select", "change", "submit", "reset", "focus", "blur", "resize", "scroll" ];
+ else if (typeof types === "string")
+ types = [ types ];
+
+ var result = [];
+ for (var i = 0; i < types.length; i++) {
+ if (types[i] === "mouse")
+ result.splice(0, 0, "mousedown", "mouseup", "click", "dblclick", "mousemove", "mouseover", "mouseout");
+ else if (types[i] === "key")
+ result.splice(0, 0, "keydown", "keyup", "keypress");
+ else
+ result.push(types[i]);
+ }
+ return result;
+}
+
+InjectedScript._inspectedNode = function(num)
+{
+ var nodeId = InjectedScriptHost.inspectedNode(num);
+ return InjectedScript._nodeForId(nodeId);
+}
+
+function CommandLineAPI()
+{
+}
+
+CommandLineAPI.prototype = {
+ // Only add API functions here, private stuff should go to
+ // InjectedScript so that it is not suggested by the completion.
+ $: function()
+ {
+ return document.getElementById.apply(document, arguments)
+ },
+
+ $$: function()
+ {
+ return document.querySelectorAll.apply(document, arguments)
+ },
+
+ $x: function(xpath, context)
+ {
+ var nodes = [];
+ try {
+ var doc = context || document;
+ var results = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null);
+ var node;
+ while (node = results.iterateNext())
+ nodes.push(node);
+ } catch (e) {
+ }
+ return nodes;
+ },
+
+ dir: function()
+ {
+ return console.dir.apply(console, arguments)
+ },
+
+ dirxml: function()
+ {
+ return console.dirxml.apply(console, arguments)
+ },
+
+ keys: function(object)
+ {
+ return Object.keys(object);
+ },
+
+ values: function(object)
+ {
+ var result = [];
+ for (var key in object)
+ result.push(object[key]);
+ return result;
+ },
+
+ profile: function()
+ {
+ return console.profile.apply(console, arguments)
+ },
+
+ profileEnd: function()
+ {
+ return console.profileEnd.apply(console, arguments)
+ },
+
+ monitorEvents: function(object, types)
+ {
+ if (!object || !object.addEventListener || !object.removeEventListener)
+ return;
+ types = InjectedScript._normalizeEventTypes(types);
+ for (var i = 0; i < types.length; ++i) {
+ object.removeEventListener(types[i], InjectedScript._logEvent, false);
+ object.addEventListener(types[i], InjectedScript._logEvent, false);
+ }
+ },
+
+ unmonitorEvents: function(object, types)
+ {
+ if (!object || !object.addEventListener || !object.removeEventListener)
+ return;
+ types = InjectedScript._normalizeEventTypes(types);
+ for (var i = 0; i < types.length; ++i)
+ object.removeEventListener(types[i], InjectedScript._logEvent, false);
+ },
+
+ inspect: function(object)
+ {
+ if (arguments.length === 0)
+ return;
+
+ inspectedWindow.console.log(object);
+ if (InjectedScript._type(object) === "node")
+ InjectedScriptHost.pushNodePathToFrontend(object, false, true);
+ else {
+ switch (InjectedScript._describe(object)) {
+ case "Database":
+ InjectedScriptHost.selectDatabase(object);
+ break;
+ case "Storage":
+ InjectedScriptHost.selectDOMStorage(object);
+ break;
+ }
+ }
+ },
+
+ copy: function(object)
+ {
+ if (InjectedScript._type(object) === "node") {
+ var nodeId = InjectedScriptHost.pushNodePathToFrontend(object, false, false);
+ InjectedScriptHost.copyNode(nodeId);
+ } else
+ InjectedScriptHost.copyText(object);
+ },
+
+ clear: function()
+ {
+ InjectedScriptHost.clearConsoleMessages();
+ },
+
+ get $0()
+ {
+ return InjectedScript._inspectedNode(0);
+ },
+
+ get $1()
+ {
+ return InjectedScript._inspectedNode(1);
+ },
+
+ get $2()
+ {
+ return InjectedScript._inspectedNode(2);
+ },
+
+ get $3()
+ {
+ return InjectedScript._inspectedNode(3);
+ },
+
+ get $4()
+ {
+ return InjectedScript._inspectedNode(4);
}
}
+InjectedScript._commandLineAPI = new CommandLineAPI();
+
return InjectedScript;
});
diff --git a/WebCore/inspector/front-end/InjectedScriptAccess.js b/WebCore/inspector/front-end/InjectedScriptAccess.js
index c388213..90daab7 100644
--- a/WebCore/inspector/front-end/InjectedScriptAccess.js
+++ b/WebCore/inspector/front-end/InjectedScriptAccess.js
@@ -70,18 +70,13 @@ InjectedScriptAccess._installHandler = function(methodName, async)
// - Make sure corresponding methods in InjectedScript return non-null and non-undefined values,
// - Make sure last parameter of all the InjectedSriptAccess.* calls is a callback function.
// We keep these sorted.
-InjectedScriptAccess._installHandler("addInspectedNode");
-InjectedScriptAccess._installHandler("clearConsoleMessages");
InjectedScriptAccess._installHandler("evaluate");
InjectedScriptAccess._installHandler("evaluateInCallFrame");
InjectedScriptAccess._installHandler("getCompletions");
-InjectedScriptAccess._installHandler("getNodePropertyValue");
InjectedScriptAccess._installHandler("getProperties");
InjectedScriptAccess._installHandler("getPrototypes");
InjectedScriptAccess._installHandler("openInInspectedWindow");
InjectedScriptAccess._installHandler("pushNodeToFrontend");
-InjectedScriptAccess._installHandler("nodeByPath");
-InjectedScriptAccess._installHandler("setOuterHTML");
InjectedScriptAccess._installHandler("setPropertyValue");
InjectedScriptAccess._installHandler("evaluateOnSelf");
diff --git a/WebCore/inspector/front-end/InspectorBackendStub.js b/WebCore/inspector/front-end/InspectorBackendStub.js
index 492bf87..1ae32b5 100644
--- a/WebCore/inspector/front-end/InspectorBackendStub.js
+++ b/WebCore/inspector/front-end/InspectorBackendStub.js
@@ -32,7 +32,6 @@ if (!window.InspectorBackend) {
WebInspector.InspectorBackendStub = function()
{
- this._searchingForNode = false;
this._attachedWindowHeight = 0;
this._timelineEnabled = false;
}
@@ -60,25 +59,23 @@ WebInspector.InspectorBackendStub.prototype = {
{
},
- clearMessages: function()
+ clearConsoleMessages: function()
{
},
- searchingForNode: function()
+ getOuterHTML: function()
{
- return this._searchingForNode;
},
- search: function(sourceRow, query)
+ setOuterHTML: function()
{
},
- toggleNodeSearch: function()
+ addInspectedNode: function()
{
- this._searchingForNode = !this._searchingForNode;
},
- setAttachedWindowHeight: function(height)
+ search: function(sourceRow, query)
{
},
@@ -144,6 +141,16 @@ WebInspector.InspectorBackendStub.prototype = {
WebInspector.searchingForNodeWasDisabled();
},
+ enableMonitoringXHR: function()
+ {
+ WebInspector.monitoringXHRWasEnabled();
+ },
+
+ disableMonitoringXHR: function()
+ {
+ WebInspector.monitoringXHRWasDisabled();
+ },
+
reloadPage: function()
{
},
diff --git a/WebCore/inspector/front-end/InspectorFrontendHostStub.js b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
index 5456069..39bbe02 100644
--- a/WebCore/inspector/front-end/InspectorFrontendHostStub.js
+++ b/WebCore/inspector/front-end/InspectorFrontendHostStub.js
@@ -40,7 +40,13 @@ WebInspector._platformFlavor = WebInspector.PlatformFlavor.MacLeopard;
WebInspector.InspectorFrontendHostStub.prototype = {
platform: function()
{
- return "mac";
+ var match = navigator.userAgent.match(/Windows NT/);
+ if (match)
+ return "windows";
+ match = navigator.userAgent.match(/Mac OS X/);
+ if (match)
+ return "mac";
+ return "linux";
},
port: function()
diff --git a/WebCore/inspector/front-end/ProfilesPanel.js b/WebCore/inspector/front-end/ProfilesPanel.js
index 1980fa5..b5122af 100644
--- a/WebCore/inspector/front-end/ProfilesPanel.js
+++ b/WebCore/inspector/front-end/ProfilesPanel.js
@@ -124,7 +124,7 @@ WebInspector.ProfilesPanel = function()
this._profiles = [];
this._profilerEnabled = Preferences.profilerAlwaysEnabled;
- this.reset();
+ this._reset();
}
WebInspector.ProfilesPanel.prototype = {
@@ -167,7 +167,7 @@ WebInspector.ProfilesPanel.prototype = {
populateInterface: function()
{
- this.reset();
+ this._reset();
if (this.visible)
this._populateProfiles();
else
@@ -189,10 +189,15 @@ WebInspector.ProfilesPanel.prototype = {
return;
this._profilerEnabled = false;
- this.reset();
+ this._reset();
},
- reset: function()
+ resetProfiles: function()
+ {
+ this._reset();
+ },
+
+ _reset: function()
{
for (var i = 0; i < this._profiles.length; ++i)
delete this._profiles[i]._profileView;
@@ -222,7 +227,7 @@ WebInspector.ProfilesPanel.prototype = {
_clearProfiles: function()
{
InspectorBackend.clearProfiles();
- this.reset();
+ this._reset();
},
registerProfileType: function(profileType)
@@ -618,7 +623,8 @@ WebInspector.ProfileGroupSidebarTreeElement = function(title, subtitle)
WebInspector.ProfileGroupSidebarTreeElement.prototype = {
onselect: function()
{
- WebInspector.panels.profiles.showProfile(this.children[this.children.length - 1].profile);
+ if (this.children.length > 0)
+ WebInspector.panels.profiles.showProfile(this.children[this.children.length - 1].profile);
}
}
diff --git a/WebCore/inspector/front-end/ScriptView.js b/WebCore/inspector/front-end/ScriptView.js
index fb0bb4b..1883fb3 100644
--- a/WebCore/inspector/front-end/ScriptView.js
+++ b/WebCore/inspector/front-end/ScriptView.js
@@ -105,7 +105,12 @@ WebInspector.ScriptView.prototype = {
this.sourceFrame.updateContent(this._prependWhitespace(newBody));
},
- // The follow methods are pulled from SourceView, since they are
+ _sourceIDForLine: function(line)
+ {
+ return this.script.sourceID;
+ },
+
+ // The following methods are pulled from SourceView, since they are
// generic and work with ScriptView just fine.
hide: WebInspector.SourceView.prototype.hide,
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 4504d57..c23db14 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -169,8 +169,6 @@ WebInspector.ScriptsPanel = function()
this._registerShortcuts();
this._debuggerEnabled = Preferences.debuggerAlwaysEnabled;
- if (Preferences.debuggerAlwaysEnabled)
- this._attachDebuggerWhenShown = true;
WebInspector.breakpointManager.addEventListener("breakpoint-added", this._breakpointAdded, this);
WebInspector.breakpointManager.addEventListener("breakpoint-removed", this._breakpointRemoved, this);
diff --git a/WebCore/inspector/front-end/Section.js b/WebCore/inspector/front-end/Section.js
index 7710192..913d495 100644
--- a/WebCore/inspector/front-end/Section.js
+++ b/WebCore/inspector/front-end/Section.js
@@ -82,7 +82,22 @@ WebInspector.Section.prototype = {
if (this._subtitle === x)
return;
this._subtitle = x;
- this.subtitleElement.innerHTML = x;
+ this.subtitleElement.setAttribute("data-uncopyable", x);
+ },
+
+ get subtitleAsText()
+ {
+ var result = "";
+ var data = this.subtitleElement.getAttribute("data-uncopyable");
+ if (data)
+ result += data;
+ var child = this.subtitleElement.querySelector("[data-uncopyable]");
+ if (child) {
+ var linkData = child.getAttribute("data-uncopyable");
+ if (linkData)
+ result += linkData;
+ }
+ return result;
},
get expanded()
diff --git a/WebCore/inspector/front-end/StoragePanel.js b/WebCore/inspector/front-end/StoragePanel.js
index ca1b276..fef7802 100644
--- a/WebCore/inspector/front-end/StoragePanel.js
+++ b/WebCore/inspector/front-end/StoragePanel.js
@@ -289,6 +289,7 @@ WebInspector.StoragePanel.prototype = {
var column = {};
column.width = columnIdentifier.length;
column.title = columnIdentifier;
+ column.sortable = true;
columns[columnIdentifier] = column;
++numColumns;
@@ -313,9 +314,45 @@ WebInspector.StoragePanel.prototype = {
for (var i = 0; i < length; ++i)
dataGrid.appendChild(nodes[i]);
+ dataGrid.addEventListener("sorting changed", this._sortDataGrid.bind(this, dataGrid), this);
return dataGrid;
},
+ _sortDataGrid: function(dataGrid)
+ {
+ var nodes = dataGrid.children.slice();
+ var sortColumnIdentifier = dataGrid.sortColumnIdentifier;
+ var sortDirection = dataGrid.sortOrder === "ascending" ? 1 : -1;
+ var columnIsNumeric = true;
+
+ for (var i = 0; i < nodes.length; i++) {
+ if (isNaN(Number(nodes[i].data[sortColumnIdentifier])))
+ columnIsNumeric = false;
+ }
+
+ function comparator(dataGridNode1, dataGridNode2)
+ {
+ var item1 = dataGridNode1.data[sortColumnIdentifier];
+ var item2 = dataGridNode2.data[sortColumnIdentifier];
+
+ var comparison;
+ if (columnIsNumeric) {
+ // Sort numbers based on comparing their values rather than a lexicographical comparison.
+ var number1 = parseFloat(item1);
+ var number2 = parseFloat(item2);
+ comparison = number1 < number2 ? -1 : (number1 > number2 ? 1 : 0);
+ } else
+ comparison = item1 < item2 ? -1 : (item1 > item2 ? 1 : 0);
+
+ return sortDirection * comparison;
+ }
+
+ nodes.sort(comparator);
+ dataGrid.removeChildren();
+ for (var i = 0; i < nodes.length; i++)
+ dataGrid.appendChild(nodes[i]);
+ },
+
updateDOMStorage: function(storageId)
{
var domStorage = this._domStorageForId(storageId);
diff --git a/WebCore/inspector/front-end/StylesSidebarPane.js b/WebCore/inspector/front-end/StylesSidebarPane.js
index 18b7f0f..649b9d0 100644
--- a/WebCore/inspector/front-end/StylesSidebarPane.js
+++ b/WebCore/inspector/front-end/StylesSidebarPane.js
@@ -651,7 +651,10 @@ WebInspector.StylePropertiesSection = function(styleRule, subtitle, computedStyl
if (!subtitle) {
if (this.styleRule.parentStyleSheet && this.styleRule.parentStyleSheet.href) {
var url = this.styleRule.parentStyleSheet.href;
- this.subtitleElement.appendChild(WebInspector.linkifyResourceAsNode(url, "resources", this.rule.sourceLine + 1));
+ var link = WebInspector.linkifyResourceAsNode(url, "resources", this.rule.sourceLine + 1);
+ link.setAttribute("data-uncopyable", link.textContent);
+ link.textContent = "";
+ this.subtitleElement.appendChild(link);
} else if (isUserAgent)
subtitle = WebInspector.UIString("user agent stylesheet");
else if (isUser)
@@ -669,7 +672,7 @@ WebInspector.StylePropertiesSection = function(styleRule, subtitle, computedStyl
this.identifier = styleRule.selectorText;
if (this.subtitle)
- this.identifier += ":" + this.subtitleElement.textContent;
+ this.identifier += ":" + this.subtitle;
}
WebInspector.StylePropertiesSection.prototype = {
@@ -1315,6 +1318,18 @@ WebInspector.StylePropertyTreeElement.prototype = {
event.stopPropagation();
},
+ restoreNameElement: function()
+ {
+ // Restore <span class="webkit-css-property"> if it doesn't yet exist or was accidentally deleted.
+ if (this.nameElement === this.listItemElement.querySelector(".webkit-css-property"))
+ return;
+
+ this.nameElement = document.createElement("span");
+ this.nameElement.className = "webkit-css-property";
+ this.nameElement.textContent = "";
+ this.listItemElement.insertBefore(this.nameElement, this.listItemElement.firstChild);
+ },
+
startEditing: function(selectElement)
{
// FIXME: we don't allow editing of longhand properties under a shorthand right now.
@@ -1324,7 +1339,12 @@ WebInspector.StylePropertyTreeElement.prototype = {
if (WebInspector.isBeingEdited(this.listItemElement) || (this.treeOutline.section && !this.treeOutline.section.editable))
return;
- var context = { expanded: this.expanded, hasChildren: this.hasChildren, keyDownListener: this.editingKeyDown.bind(this) };
+ var context = {
+ expanded: this.expanded,
+ hasChildren: this.hasChildren,
+ keyDownListener: this.editingKeyDown.bind(this),
+ keyPressListener: this.editingKeyPress.bind(this)
+ };
// Lie about our children to prevent expanding on double click and to collapse shorthands.
this.hasChildren = false;
@@ -1333,11 +1353,42 @@ WebInspector.StylePropertyTreeElement.prototype = {
selectElement = this.listItemElement;
this.listItemElement.addEventListener("keydown", context.keyDownListener, false);
+ this.listItemElement.addEventListener("keypress", context.keyPressListener, false);
WebInspector.startEditing(this.listItemElement, this.editingCommitted.bind(this), this.editingCancelled.bind(this), context);
window.getSelection().setBaseAndExtent(selectElement, 0, selectElement, 1);
},
+ editingKeyPress: function(event)
+ {
+ var selection = window.getSelection();
+ var colonIndex = this.listItemElement.textContent.indexOf(":");
+ var selectionLeftOffset = event.target.selectionLeftOffset;
+
+ if (colonIndex < 0 || selectionLeftOffset <= colonIndex) {
+ // Complete property names.
+ var character = event.data.toLowerCase();
+ if (character && /[a-z-]/.test(character)) {
+ var prefix = selection.anchorNode.textContent.substring(0, selection.anchorOffset);
+ var property = WebInspector.CSSCompletions.firstStartsWith(prefix + character);
+
+ if (!selection.isCollapsed)
+ selection.deleteFromDocument();
+
+ this.restoreNameElement();
+
+ if (property) {
+ if (property !== this.nameElement.textContent)
+ this.nameElement.textContent = property;
+ this.nameElement.firstChild.select(prefix.length + 1);
+ event.preventDefault();
+ }
+ }
+ } else {
+ // FIXME: This should complete property values.
+ }
+ },
+
editingKeyDown: function(event)
{
var arrowKeyPressed = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down");
@@ -1396,9 +1447,24 @@ WebInspector.StylePropertyTreeElement.prototype = {
}
replacementString = prefix + number + suffix;
- } else {
- // FIXME: this should cycle through known keywords for the current property name.
+ } else if (selection.containsNode(this.nameElement, true)) {
+ var prefix = selectionRange.startContainer.textContent.substring(0, selectionRange.startOffset);
+ var property;
+
+ if (event.keyIdentifier === "Up")
+ property = WebInspector.CSSCompletions.previous(wordString, prefix);
+ else if (event.keyIdentifier === "Down")
+ property = WebInspector.CSSCompletions.next(wordString, prefix);
+
+ var startOffset = selectionRange.startOffset;
+ if (property) {
+ this.nameElement.textContent = property;
+ this.nameElement.firstChild.select(startOffset);
+ }
+ event.preventDefault();
return;
+ } else {
+ // FIXME: this should cycle through known keywords for the current property value.
}
var replacementTextNode = document.createTextNode(replacementString);
@@ -1434,6 +1500,7 @@ WebInspector.StylePropertyTreeElement.prototype = {
if (context.expanded)
this.expand();
this.listItemElement.removeEventListener("keydown", context.keyDownListener, false);
+ this.listItemElement.removeEventListener("keypress", context.keyPressListener, false);
delete this.originalCSSText;
},
diff --git a/WebCore/inspector/front-end/WebKit.qrc b/WebCore/inspector/front-end/WebKit.qrc
index fd84586..add50e1 100644
--- a/WebCore/inspector/front-end/WebKit.qrc
+++ b/WebCore/inspector/front-end/WebKit.qrc
@@ -19,6 +19,7 @@
<file>ConsoleView.js</file>
<file>ContextMenu.js</file>
<file>CookieItemsView.js</file>
+ <file>CSSCompletions.js</file>
<file>CSSStyleModel.js</file>
<file>Database.js</file>
<file>DatabaseQueryView.js</file>
diff --git a/WebCore/inspector/front-end/inspector.css b/WebCore/inspector/front-end/inspector.css
index 52b85bc..b92672a 100644
--- a/WebCore/inspector/front-end/inspector.css
+++ b/WebCore/inspector/front-end/inspector.css
@@ -27,6 +27,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+html {
+ height: 100%;
+}
+
body {
cursor: default;
position: absolute;
@@ -4038,6 +4042,10 @@ a.worker-item {
color: inherit;
}
+.styles-section .subtitle::before, .styles-section .subtitle a::before {
+ content: attr(data-uncopyable);
+}
+
.styles-section .properties {
display: none;
margin: 0;
diff --git a/WebCore/inspector/front-end/inspector.html b/WebCore/inspector/front-end/inspector.html
index 4c51634..8a8b7d5 100644
--- a/WebCore/inspector/front-end/inspector.html
+++ b/WebCore/inspector/front-end/inspector.html
@@ -82,6 +82,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<script type="text/javascript" src="PropertiesSidebarPane.js"></script>
<script type="text/javascript" src="EventListenersSidebarPane.js"></script>
<script type="text/javascript" src="Color.js"></script>
+ <script type="text/javascript" src="CSSCompletions.js"></script>
<script type="text/javascript" src="StylesSidebarPane.js"></script>
<script type="text/javascript" src="PanelEnablerView.js"></script>
<script type="text/javascript" src="WelcomeView.js"></script>
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index e8108af..3bb4180 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -1297,6 +1297,16 @@ WebInspector.searchingForNodeWasDisabled = function()
this.panels.elements.searchingForNodeWasDisabled();
}
+WebInspector.monitoringXHRWasEnabled = function()
+{
+ this.monitoringXHREnabled = true;
+}
+
+WebInspector.monitoringXHRWasDisabled = function()
+{
+ this.monitoringXHREnabled = false;
+}
+
WebInspector.attachDebuggerWhenShown = function()
{
this.panels.scripts.attachDebuggerWhenShown();
@@ -1334,7 +1344,7 @@ WebInspector.parsedScriptSource = function(sourceID, sourceURL, source, starting
WebInspector.restoredBreakpoint = function(sourceID, sourceURL, line, enabled, condition)
{
- this.breakpointManager.addBreakpoint(sourceID, sourceURL, line, enabled, condition);
+ this.breakpointManager.restoredBreakpoint(sourceID, sourceURL, line, enabled, condition);
}
WebInspector.failedToParseScriptSource = function(sourceURL, source, startingLine, errorLine, errorMessage)
@@ -1385,6 +1395,12 @@ WebInspector.reset = function()
this.console.clearMessages();
}
+WebInspector.resetProfilesPanel = function()
+{
+ if (WebInspector.panels.profiles)
+ WebInspector.panels.profiles.resetProfiles();
+}
+
WebInspector.bringToFront = function()
{
InspectorFrontendHost.bringToFront();
diff --git a/WebCore/inspector/front-end/utilities.js b/WebCore/inspector/front-end/utilities.js
index bb19dbd..1312e5b 100644
--- a/WebCore/inspector/front-end/utilities.js
+++ b/WebCore/inspector/front-end/utilities.js
@@ -328,6 +328,63 @@ Element.prototype.offsetRelativeToWindow = function(targetWindow)
return elementOffset;
}
+KeyboardEvent.prototype.__defineGetter__("data", function()
+{
+ // Emulate "data" attribute from DOM 3 TextInput event.
+ // See http://www.w3.org/TR/DOM-Level-3-Events/#events-Events-TextEvent-data
+ switch (this.type) {
+ case "keypress":
+ if (!this.ctrlKey && !this.metaKey)
+ return String.fromCharCode(this.charCode);
+ else
+ return "";
+ case "keydown":
+ case "keyup":
+ if (!this.ctrlKey && !this.metaKey && !this.altKey)
+ return String.fromCharCode(this.which);
+ else
+ return "";
+ }
+});
+
+Text.prototype.select = function(start, end)
+{
+ start = start || 0;
+ end = end || this.textContent.length;
+
+ if (start < 0)
+ start = end + start;
+
+ var selection = window.getSelection();
+ selection.removeAllRanges();
+ var range = document.createRange();
+ range.setStart(this, start);
+ range.setEnd(this, end);
+ selection.addRange(range);
+ return this;
+}
+
+Element.prototype.__defineGetter__("selectionLeftOffset", function() {
+ // Calculate selection offset relative to the current element.
+
+ var selection = window.getSelection();
+ if (!selection.containsNode(this, true))
+ return null;
+
+ var leftOffset = selection.anchorOffset;
+ var node = selection.anchorNode;
+
+ while (node !== this) {
+ while (node.previousSibling) {
+ node = node.previousSibling;
+ leftOffset += node.textContent.length;
+ }
+ node = node.parentNode;
+ }
+
+ return leftOffset;
+});
+
Node.prototype.isWhitespace = isNodeWhitespace;
Node.prototype.displayName = nodeDisplayName;
Node.prototype.isAncestor = function(node)
@@ -672,6 +729,12 @@ Array.prototype.keySet = function()
return keys;
}
+Array.convert = function(list)
+{
+ // Cast array-like object to an array.
+ return Array.prototype.slice.call(list);
+}
+
function insertionIndexForObjectInListSortedByFunction(anObject, aList, aFunction)
{
// indexOf returns (-lowerBound - 1). Taking (-result - 1) works out to lowerBound.
diff --git a/WebCore/loader/CachedFont.cpp b/WebCore/loader/CachedFont.cpp
index af0c235..71dd8f9 100644
--- a/WebCore/loader/CachedFont.cpp
+++ b/WebCore/loader/CachedFont.cpp
@@ -136,7 +136,7 @@ bool CachedFont::ensureSVGFontData()
{
ASSERT(m_isSVGFont);
if (!m_externalSVGDocument && !errorOccurred() && !isLoading() && m_data) {
- m_externalSVGDocument = SVGDocument::create(0);
+ m_externalSVGDocument = SVGDocument::create(0, KURL());
m_externalSVGDocument->open();
RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create("application/xml");
diff --git a/WebCore/loader/CrossOriginPreflightResultCache.h b/WebCore/loader/CrossOriginPreflightResultCache.h
index f8a7c55..8e5b239 100644
--- a/WebCore/loader/CrossOriginPreflightResultCache.h
+++ b/WebCore/loader/CrossOriginPreflightResultCache.h
@@ -24,8 +24,8 @@
*
*/
-#ifndef CrossOriginPreflightResultCacheItem_h
-#define CrossOriginPreflightResultCacheItem_h
+#ifndef CrossOriginPreflightResultCache_h
+#define CrossOriginPreflightResultCache_h
#include "KURLHash.h"
#include "StringHash.h"
diff --git a/WebCore/loader/DocumentWriter.cpp b/WebCore/loader/DocumentWriter.cpp
index cc2632b..2ea1afd 100644
--- a/WebCore/loader/DocumentWriter.cpp
+++ b/WebCore/loader/DocumentWriter.cpp
@@ -34,6 +34,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
+#include "FrameLoaderStateMachine.h"
#include "FrameView.h"
#include "PlaceholderDocument.h"
#include "PluginDocument.h"
@@ -58,11 +59,26 @@ DocumentWriter::DocumentWriter(Frame* frame)
{
}
-void DocumentWriter::replaceDocument(const String& html)
+// This is only called by ScriptController::executeIfJavaScriptURL
+// and always contains the result of evaluating a javascript: url.
+// This is the <iframe src="javascript:'html'"> case.
+void DocumentWriter::replaceDocument(const String& source)
{
m_frame->loader()->stopAllLoaders();
begin(m_frame->loader()->url(), true, m_frame->document()->securityOrigin());
- addData(html);
+
+ if (!source.isNull()) {
+ if (!m_receivedData) {
+ m_receivedData = true;
+ m_frame->document()->setParseMode(Document::Strict);
+ }
+
+ // FIXME: If we wanted to support the <img src='javascript:'imagedata'>
+ // case then we would need to call addData(char*, int) instead.
+ if (DocumentParser* parser = m_frame->document()->parser())
+ parser->write(source, true);
+ }
+
end();
}
@@ -79,13 +95,13 @@ void DocumentWriter::begin()
begin(KURL());
}
-PassRefPtr<Document> DocumentWriter::createDocument()
+PassRefPtr<Document> DocumentWriter::createDocument(const KURL& url)
{
- if (!m_frame->loader()->isDisplayingInitialEmptyDocument() && m_frame->loader()->client()->shouldUsePluginDocument(m_mimeType))
- return PluginDocument::create(m_frame);
+ if (!m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader()->client()->shouldUsePluginDocument(m_mimeType))
+ return PluginDocument::create(m_frame, url);
if (!m_frame->loader()->client()->hasHTMLView())
- return PlaceholderDocument::create(m_frame);
- return DOMImplementation::createDocument(m_mimeType, m_frame, m_frame->inViewSourceMode());
+ return PlaceholderDocument::create(m_frame, url);
+ return DOMImplementation::createDocument(m_mimeType, m_frame, url, m_frame->inViewSourceMode());
}
void DocumentWriter::begin(const KURL& url, bool dispatch, SecurityOrigin* origin)
@@ -96,20 +112,19 @@ void DocumentWriter::begin(const KURL& url, bool dispatch, SecurityOrigin* origi
// Create a new document before clearing the frame, because it may need to
// inherit an aliased security context.
- RefPtr<Document> document = createDocument();
+ RefPtr<Document> document = createDocument(url);
// If the new document is for a Plugin but we're supposed to be sandboxed from Plugins,
// then replace the document with one whose parser will ignore the incoming data (bug 39323)
if (document->isPluginDocument() && m_frame->loader()->isSandboxed(SandboxPlugins))
- document = SinkDocument::create(m_frame);
+ document = SinkDocument::create(m_frame, url);
- bool resetScripting = !(m_frame->loader()->isDisplayingInitialEmptyDocument() && m_frame->document()->securityOrigin()->isSecureTransitionTo(url));
+ bool resetScripting = !(m_frame->loader()->stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->document()->securityOrigin()->isSecureTransitionTo(url));
m_frame->loader()->clear(resetScripting, resetScripting);
if (resetScripting)
m_frame->script()->updatePlatformScriptObjects();
m_frame->loader()->setURL(url);
- document->setURL(url);
m_frame->setDocument(document);
if (m_decoder)
@@ -192,20 +207,6 @@ void DocumentWriter::addData(const char* str, int len, bool flush)
}
}
-void DocumentWriter::addData(const String& str)
-{
- if (str.isNull())
- return;
-
- if (!m_receivedData) {
- m_receivedData = true;
- m_frame->document()->setParseMode(Document::Strict);
- }
-
- if (DocumentParser* parser = m_frame->document()->parser())
- parser->write(str, true);
-}
-
void DocumentWriter::end()
{
m_frame->loader()->didEndDocument();
diff --git a/WebCore/loader/DocumentWriter.h b/WebCore/loader/DocumentWriter.h
index a06fb7f..6644093 100644
--- a/WebCore/loader/DocumentWriter.h
+++ b/WebCore/loader/DocumentWriter.h
@@ -43,12 +43,13 @@ class DocumentWriter : public Noncopyable {
public:
DocumentWriter(Frame*);
+ // This is only called by ScriptController::executeIfJavaScriptURL
+ // and always contains the result of evaluating a javascript: url.
void replaceDocument(const String&);
void begin();
void begin(const KURL&, bool dispatchWindowObjectAvailable = true, SecurityOrigin* forcedSecurityOrigin = 0);
void addData(const char* string, int length = -1, bool flush = false);
- void addData(const String&);
void end();
void endIfNotLoadingMainResource();
void clear();
@@ -67,7 +68,7 @@ public:
void setDecoder(TextResourceDecoder*);
private:
- PassRefPtr<Document> createDocument();
+ PassRefPtr<Document> createDocument(const KURL&);
Frame* m_frame;
diff --git a/WebCore/loader/FTPDirectoryDocument.cpp b/WebCore/loader/FTPDirectoryDocument.cpp
index 5d1b2bf..2a19fa3 100644
--- a/WebCore/loader/FTPDirectoryDocument.cpp
+++ b/WebCore/loader/FTPDirectoryDocument.cpp
@@ -29,7 +29,7 @@
#include "CharacterNames.h"
#include "HTMLNames.h"
#include "HTMLTableElement.h"
-#include "HTMLDocumentParser.h"
+#include "LegacyHTMLDocumentParser.h"
#include "LocalizedStrings.h"
#include "Logging.h"
#include "FTPDirectoryParser.h"
@@ -48,7 +48,7 @@ namespace WebCore {
using namespace HTMLNames;
-class FTPDirectoryDocumentParser : public HTMLDocumentParser {
+class FTPDirectoryDocumentParser : public LegacyHTMLDocumentParser {
public:
FTPDirectoryDocumentParser(HTMLDocument*);
@@ -80,7 +80,6 @@ private:
void appendEntry(const String& name, const String& size, const String& date, bool isDirectory);
PassRefPtr<Element> createTDForFilename(const String&);
- Document* m_doc;
RefPtr<HTMLTableElement> m_tableElement;
bool m_skipLF;
@@ -94,9 +93,8 @@ private:
ListState m_listState;
};
-FTPDirectoryDocumentParser::FTPDirectoryDocumentParser(HTMLDocument* doc)
- : HTMLDocumentParser(doc, false)
- , m_doc(doc)
+FTPDirectoryDocumentParser::FTPDirectoryDocumentParser(HTMLDocument* document)
+ : LegacyHTMLDocumentParser(document, false)
, m_skipLF(false)
, m_parsedTemplate(false)
, m_size(254)
@@ -112,8 +110,8 @@ void FTPDirectoryDocumentParser::appendEntry(const String& filename, const Strin
RefPtr<Element> rowElement = m_tableElement->insertRow(-1, ec);
rowElement->setAttribute("class", "ftpDirectoryEntryRow", ec);
- RefPtr<Element> element = m_doc->createElement(tdTag, false);
- element->appendChild(Text::create(m_doc, String(&noBreakSpace, 1)), ec);
+ RefPtr<Element> element = document()->createElement(tdTag, false);
+ element->appendChild(Text::create(document(), String(&noBreakSpace, 1)), ec);
if (isDirectory)
element->setAttribute("class", "ftpDirectoryIcon ftpDirectoryTypeDirectory", ec);
else
@@ -124,13 +122,13 @@ void FTPDirectoryDocumentParser::appendEntry(const String& filename, const Strin
element->setAttribute("class", "ftpDirectoryFileName", ec);
rowElement->appendChild(element, ec);
- element = m_doc->createElement(tdTag, false);
- element->appendChild(Text::create(m_doc, date), ec);
+ element = document()->createElement(tdTag, false);
+ element->appendChild(Text::create(document(), date), ec);
element->setAttribute("class", "ftpDirectoryFileDate", ec);
rowElement->appendChild(element, ec);
- element = m_doc->createElement(tdTag, false);
- element->appendChild(Text::create(m_doc, size), ec);
+ element = document()->createElement(tdTag, false);
+ element->appendChild(Text::create(document(), size), ec);
element->setAttribute("class", "ftpDirectoryFileSize", ec);
rowElement->appendChild(element, ec);
}
@@ -139,17 +137,17 @@ PassRefPtr<Element> FTPDirectoryDocumentParser::createTDForFilename(const String
{
ExceptionCode ec;
- String fullURL = m_doc->baseURL().string();
+ String fullURL = document()->baseURL().string();
if (fullURL[fullURL.length() - 1] == '/')
fullURL.append(filename);
else
fullURL.append("/" + filename);
- RefPtr<Element> anchorElement = m_doc->createElement(aTag, false);
+ RefPtr<Element> anchorElement = document()->createElement(aTag, false);
anchorElement->setAttribute("href", fullURL, ec);
- anchorElement->appendChild(Text::create(m_doc, filename), ec);
+ anchorElement->appendChild(Text::create(document(), filename), ec);
- RefPtr<Element> tdElement = m_doc->createElement(tdTag, false);
+ RefPtr<Element> tdElement = document()->createElement(tdTag, false);
tdElement->appendChild(anchorElement, ec);
return tdElement.release();
@@ -294,7 +292,7 @@ static inline PassRefPtr<SharedBuffer> createTemplateDocumentData(Settings* sett
bool FTPDirectoryDocumentParser::loadDocumentTemplate()
{
- DEFINE_STATIC_LOCAL(RefPtr<SharedBuffer>, templateDocumentData, (createTemplateDocumentData(m_doc->settings())));
+ DEFINE_STATIC_LOCAL(RefPtr<SharedBuffer>, templateDocumentData, (createTemplateDocumentData(document()->settings())));
// FIXME: Instead of storing the data, we'd rather actually parse the template data into the template Document once,
// store that document, then "copy" it whenever we get an FTP directory listing. There are complexities with this
// approach that make it worth putting this off.
@@ -306,10 +304,10 @@ bool FTPDirectoryDocumentParser::loadDocumentTemplate()
// Tokenize the template as an HTML document synchronously
setForceSynchronous(true);
- HTMLDocumentParser::write(String(templateDocumentData->data(), templateDocumentData->size()), true);
+ LegacyHTMLDocumentParser::write(String(templateDocumentData->data(), templateDocumentData->size()), true);
setForceSynchronous(false);
- RefPtr<Element> tableElement = m_doc->getElementById("ftpDirectoryTable");
+ RefPtr<Element> tableElement = document()->getElementById("ftpDirectoryTable");
if (!tableElement)
LOG_ERROR("Unable to find element by id \"ftpDirectoryTable\" in the template document.");
else if (!tableElement->hasTagName(tableTag))
@@ -322,7 +320,7 @@ bool FTPDirectoryDocumentParser::loadDocumentTemplate()
return true;
// Otherwise create one manually
- tableElement = m_doc->createElement(tableTag, false);
+ tableElement = document()->createElement(tableTag, false);
m_tableElement = static_cast<HTMLTableElement*>(tableElement.get());
ExceptionCode ec;
m_tableElement->setAttribute("id", "ftpDirectoryTable", ec);
@@ -330,10 +328,10 @@ bool FTPDirectoryDocumentParser::loadDocumentTemplate()
// If we didn't find the table element, lets try to append our own to the body
// If that fails for some reason, cram it on the end of the document as a last
// ditch effort
- if (Element* body = m_doc->body())
+ if (Element* body = document()->body())
body->appendChild(m_tableElement, ec);
else
- m_doc->appendChild(m_tableElement, ec);
+ document()->appendChild(m_tableElement, ec);
return true;
}
@@ -344,13 +342,12 @@ void FTPDirectoryDocumentParser::createBasicDocument()
// FIXME: Make this "basic document" more acceptable
-
- RefPtr<Element> bodyElement = m_doc->createElement(bodyTag, false);
+ RefPtr<Element> bodyElement = document()->createElement(bodyTag, false);
ExceptionCode ec;
- m_doc->appendChild(bodyElement, ec);
+ document()->appendChild(bodyElement, ec);
- RefPtr<Element> tableElement = m_doc->createElement(tableTag, false);
+ RefPtr<Element> tableElement = document()->createElement(tableTag, false);
m_tableElement = static_cast<HTMLTableElement*>(tableElement.get());
m_tableElement->setAttribute("id", "ftpDirectoryTable", ec);
@@ -431,11 +428,11 @@ void FTPDirectoryDocumentParser::finish()
m_tableElement = 0;
fastFree(m_buffer);
- HTMLDocumentParser::finish();
+ LegacyHTMLDocumentParser::finish();
}
-FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame)
- : HTMLDocument(frame)
+FTPDirectoryDocument::FTPDirectoryDocument(Frame* frame, const KURL& url)
+ : HTMLDocument(frame, url)
{
#ifndef NDEBUG
LogFTP.state = WTFLogChannelOn;
diff --git a/WebCore/loader/FTPDirectoryDocument.h b/WebCore/loader/FTPDirectoryDocument.h
index f74508c..920f870 100644
--- a/WebCore/loader/FTPDirectoryDocument.h
+++ b/WebCore/loader/FTPDirectoryDocument.h
@@ -33,13 +33,13 @@ class DOMImplementation;
class FTPDirectoryDocument : public HTMLDocument {
public:
- static PassRefPtr<FTPDirectoryDocument> create(Frame* frame)
+ static PassRefPtr<FTPDirectoryDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new FTPDirectoryDocument(frame));
+ return adoptRef(new FTPDirectoryDocument(frame, url));
}
private:
- FTPDirectoryDocument(Frame*);
+ FTPDirectoryDocument(Frame*, const KURL&);
virtual DocumentParser* createParser();
};
diff --git a/WebCore/loader/FormSubmission.cpp b/WebCore/loader/FormSubmission.cpp
new file mode 100644
index 0000000..4d44174
--- /dev/null
+++ b/WebCore/loader/FormSubmission.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FormSubmission.h"
+
+#include "Event.h"
+#include "FormData.h"
+#include "FormState.h"
+#include "Frame.h"
+#include "FrameLoadRequest.h"
+#include "FrameLoader.h"
+#include "HTMLFormElement.h"
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+FormSubmission::FormSubmission(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event)
+ : m_method(method)
+ , m_action(action)
+ , m_target(target)
+ , m_contentType(contentType)
+ , m_formState(state)
+ , m_formData(data)
+ , m_boundary(boundary)
+ , m_lockHistory(lockHistory)
+ , m_event(event)
+{
+}
+
+PassRefPtr<FormSubmission> FormSubmission::create(Method method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState> state, PassRefPtr<FormData> data, const String& boundary, bool lockHistory, PassRefPtr<Event> event)
+{
+ return adoptRef(new FormSubmission(method, action, target, contentType, state, data, boundary, lockHistory, event));
+}
+
+void FormSubmission::populateFrameLoadRequest(FrameLoadRequest& frameRequest)
+{
+ if (!m_target.isEmpty())
+ frameRequest.setFrameName(m_target);
+
+ if (!m_referrer.isEmpty())
+ frameRequest.resourceRequest().setHTTPReferrer(m_referrer);
+
+ if (m_method == FormSubmission::GetMethod)
+ m_action.setQuery(m_formData->flattenToString());
+ else {
+ frameRequest.resourceRequest().setHTTPMethod("POST");
+ frameRequest.resourceRequest().setHTTPBody(m_formData);
+
+ // construct some user headers if necessary
+ if (m_contentType.isNull() || m_contentType == "application/x-www-form-urlencoded")
+ frameRequest.resourceRequest().setHTTPContentType(m_contentType);
+ else // contentType must be "multipart/form-data"
+ frameRequest.resourceRequest().setHTTPContentType(m_contentType + "; boundary=" + m_boundary);
+ }
+
+ frameRequest.resourceRequest().setURL(m_action);
+ FrameLoader::addHTTPOriginIfNeeded(frameRequest.resourceRequest(), m_origin);
+}
+
+}
diff --git a/WebCore/loader/FormSubmission.h b/WebCore/loader/FormSubmission.h
new file mode 100644
index 0000000..647c6c6
--- /dev/null
+++ b/WebCore/loader/FormSubmission.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FormSubmission_h
+#define FormSubmission_h
+
+#include "KURL.h"
+
+namespace WebCore {
+
+class Event;
+class FormData;
+class FormState;
+struct FrameLoadRequest;
+
+class FormSubmission : public RefCounted<FormSubmission> {
+public:
+ enum Method {
+ GetMethod,
+ PostMethod
+ };
+
+ static PassRefPtr<FormSubmission> create(Method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>);
+
+ void populateFrameLoadRequest(FrameLoadRequest&);
+
+ Method method() const { return m_method; }
+ const KURL& action() const { return m_action; }
+ String target() const { return m_target; }
+ void clearTarget() { m_target = String(); }
+ String contentType() const { return m_contentType; }
+ FormState* state() const { return m_formState.get(); }
+ FormData* data() const { return m_formData.get(); }
+ String boundary() const { return m_boundary; }
+ bool lockHistory() const { return m_lockHistory; }
+ Event* event() const { return m_event.get(); }
+
+ const String& referrer() const { return m_referrer; }
+ void setReferrer(const String& referrer) { m_referrer = referrer; }
+ const String& origin() const { return m_origin; }
+ void setOrigin(const String& origin) { m_origin = origin; }
+
+private:
+ FormSubmission(Method, const KURL& action, const String& target, const String& contentType, PassRefPtr<FormState>, PassRefPtr<FormData>, const String& boundary, bool lockHistory, PassRefPtr<Event>);
+
+ Method m_method;
+ KURL m_action;
+ String m_target;
+ String m_contentType;
+ RefPtr<FormState> m_formState;
+ RefPtr<FormData> m_formData;
+ String m_boundary;
+ bool m_lockHistory;
+ RefPtr<Event> m_event;
+ String m_referrer;
+ String m_origin;
+};
+
+}
+
+#endif // FormSubmission_h
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 7920e2e..3c622ee 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -55,6 +55,7 @@
#include "EventNames.h"
#include "FloatRect.h"
#include "FormState.h"
+#include "FormSubmission.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameLoaderClient.h"
@@ -64,12 +65,7 @@
#include "Geolocation.h"
#endif // PLATFORM(ANDROID)
#include "HTMLAnchorElement.h"
-#include "HTMLAppletElement.h"
#include "HTMLFormElement.h"
-#include "HTMLFrameElement.h"
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-#include "HTMLMediaElement.h"
-#endif
#include "HTMLNames.h"
#include "HTMLObjectElement.h"
#include "HTTPParsers.h"
@@ -92,11 +88,6 @@
#include "PluginDatabase.h"
#include "PluginDocument.h"
#include "ProgressTracker.h"
-#include "RenderEmbeddedObject.h"
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-#include "RenderVideo.h"
-#endif
-#include "RenderView.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
#include "ScriptController.h"
@@ -106,20 +97,21 @@
#include "SecurityOrigin.h"
#include "SegmentedString.h"
#include "Settings.h"
-
-#if ENABLE(SHARED_WORKERS)
-#include "SharedWorkerRepository.h"
-#endif
-
#include "TextResourceDecoder.h"
#include "WindowFeatures.h"
-#include "XMLHttpRequest.h"
#include "XMLDocumentParser.h"
-#include "XSSAuditor.h"
-#include <wtf/text/CString.h>
#include <wtf/CurrentTime.h>
#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLMediaElement.h"
+#include "RenderVideo.h"
+#endif
+#if ENABLE(SHARED_WORKERS)
+#include "SharedWorkerRepository.h"
+#endif
#if ENABLE(SVG)
#include "SVGDocument.h"
@@ -138,16 +130,18 @@
namespace WebCore {
+using namespace HTMLNames;
+
#if ENABLE(SVG)
using namespace SVGNames;
#endif
-using namespace HTMLNames;
#if ENABLE(XHTMLMP)
static const char defaultAcceptHeader[] = "application/xml,application/vnd.wap.xhtml+xml,application/xhtml+xml;profile='http://www.wapforum.org/xhtml',text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
#else
static const char defaultAcceptHeader[] = "application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
#endif
+
static double storedTimeOfLastCompletedLoad;
bool isBackForwardLoadType(FrameLoadType type)
@@ -202,10 +196,10 @@ FrameLoader::FrameLoader(Frame* frame, FrameLoaderClient* client)
, m_history(frame)
, m_notifer(frame)
, m_writer(frame)
+ , m_subframeLoader(frame)
, m_state(FrameStateCommittedPage)
, m_loadType(FrameLoadTypeStandard)
, m_delegateIsHandlingProvisionalLoadError(false)
- , m_firstLayoutDone(false)
, m_quickRedirectComing(false)
, m_sentRedirectNotification(false)
, m_inStopAllLoaders(false)
@@ -216,15 +210,10 @@ FrameLoader::FrameLoader(Frame* frame, FrameLoaderClient* client)
, m_isComplete(false)
, m_isLoadingMainResource(false)
, m_needsClear(false)
- , m_receivedData(false)
- , m_containsPlugIns(false)
, m_checkTimer(this, &FrameLoader::checkTimerFired)
, m_shouldCallCheckCompleted(false)
, m_shouldCallCheckLoadComplete(false)
, m_opener(0)
- , m_creatingInitialEmptyDocument(false)
- , m_isDisplayingInitialEmptyDocument(false)
- , m_committedFirstRealDocumentLoad(false)
, m_didPerformFirstNavigation(false)
, m_loadingFromCachedPage(false)
, m_suppressOpenerInNewFrame(false)
@@ -254,8 +243,7 @@ void FrameLoader::init()
updateSandboxFlags();
// this somewhat odd set of steps is needed to give the frame an initial empty document
- m_isDisplayingInitialEmptyDocument = false;
- m_creatingInitialEmptyDocument = true;
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::CreatingInitialEmptyDocument);
setPolicyDocumentLoader(m_client->createDocumentLoader(ResourceRequest(KURL(ParsedURLString, "")), SubstituteData()).get());
setProvisionalDocumentLoader(m_policyDocumentLoader.get());
setState(FrameStateProvisional);
@@ -264,7 +252,7 @@ void FrameLoader::init()
writer()->begin(KURL(), false);
writer()->end();
m_frame->document()->cancelParsing();
- m_creatingInitialEmptyDocument = false;
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocument);
m_didCallImplicitClose = true;
}
@@ -400,114 +388,32 @@ void FrameLoader::urlSelected(const ResourceRequest& request, const String& pass
m_suppressOpenerInNewFrame = false;
}
-bool FrameLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const String& urlString, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList)
-{
- // Support for <frame src="javascript:string">
- KURL scriptURL;
- KURL url;
- if (protocolIsJavaScript(urlString)) {
- scriptURL = completeURL(urlString); // completeURL() encodes the URL.
- url = blankURL();
- } else
- url = completeURL(urlString);
-
- Frame* frame = ownerElement->contentFrame();
- if (frame)
- frame->redirectScheduler()->scheduleLocationChange(url.string(), m_outgoingReferrer, lockHistory, lockBackForwardList, isProcessingUserGesture());
- else
- frame = loadSubframe(ownerElement, url, frameName, m_outgoingReferrer);
-
- if (!frame)
- return false;
-
- if (!scriptURL.isEmpty())
- frame->script()->executeIfJavaScriptURL(scriptURL);
-
- return true;
-}
-
-Frame* FrameLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const KURL& url, const String& name, const String& referrer)
+void FrameLoader::submitForm(PassRefPtr<FormSubmission> submission)
{
- bool allowsScrolling = true;
- int marginWidth = -1;
- int marginHeight = -1;
- if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag)) {
- HTMLFrameElementBase* o = static_cast<HTMLFrameElementBase*>(ownerElement);
- allowsScrolling = o->scrollingMode() != ScrollbarAlwaysOff;
- marginWidth = o->getMarginWidth();
- marginHeight = o->getMarginHeight();
- }
-
- if (!SecurityOrigin::canLoad(url, referrer, 0)) {
- FrameLoader::reportLocalLoadFailed(m_frame, url.string());
- return 0;
- }
-
- bool hideReferrer = SecurityOrigin::shouldHideReferrer(url, referrer);
- RefPtr<Frame> frame = m_client->createFrame(url, name, ownerElement, hideReferrer ? String() : referrer, allowsScrolling, marginWidth, marginHeight);
+ ASSERT(submission->method() == FormSubmission::PostMethod || submission->method() == FormSubmission::GetMethod);
- if (!frame) {
- checkCallImplicitClose();
- return 0;
- }
-
- // All new frames will have m_isComplete set to true at this point due to synchronously loading
- // an empty document in FrameLoader::init(). But many frames will now be starting an
- // asynchronous load of url, so we set m_isComplete to false and then check if the load is
- // actually completed below. (Note that we set m_isComplete to false even for synchronous
- // loads, so that checkCompleted() below won't bail early.)
- // FIXME: Can we remove this entirely? m_isComplete normally gets set to false when a load is committed.
- frame->loader()->m_isComplete = false;
-
- RenderObject* renderer = ownerElement->renderer();
- FrameView* view = frame->view();
- if (renderer && renderer->isWidget() && view)
- toRenderWidget(renderer)->setWidget(view);
-
- checkCallImplicitClose();
-
- // Some loads are performed synchronously (e.g., about:blank and loads
- // cancelled by returning a null ResourceRequest from requestFromDelegate).
- // In these cases, the synchronous load would have finished
- // before we could connect the signals, so make sure to send the
- // completed() signal for the child by hand and mark the load as being
- // complete.
- // FIXME: In this case the Frame will have finished loading before
- // it's being added to the child list. It would be a good idea to
- // create the child first, then invoke the loader separately.
- if (frame->loader()->state() == FrameStateComplete)
- frame->loader()->checkCompleted();
-
- return frame.get();
-}
-
-void FrameLoader::submitForm(const char* action, const String& url, PassRefPtr<FormData> formData,
- const String& target, const String& contentType, const String& boundary,
- bool lockHistory, PassRefPtr<Event> event, PassRefPtr<FormState> formState)
-{
- ASSERT(action);
- ASSERT(strcmp(action, "GET") == 0 || strcmp(action, "POST") == 0);
- ASSERT(formData);
- ASSERT(formState);
- ASSERT(formState->sourceFrame() == m_frame);
+ // FIXME: Find a good spot for these.
+ ASSERT(submission->data());
+ ASSERT(submission->state());
+ ASSERT(submission->state()->sourceFrame() == m_frame);
if (!m_frame->page())
return;
- KURL u = completeURL(url.isNull() ? "" : url);
- if (u.isEmpty())
+ if (submission->action().isEmpty())
return;
if (isDocumentSandboxed(m_frame, SandboxForms))
return;
- if (protocolIsJavaScript(u)) {
+ if (protocolIsJavaScript(submission->action())) {
m_isExecutingJavaScriptFormAction = true;
- m_frame->script()->executeIfJavaScriptURL(u, false, DoNotReplaceDocumentIfJavaScriptURL);
+ m_frame->script()->executeIfJavaScriptURL(submission->action(), false, DoNotReplaceDocumentIfJavaScriptURL);
m_isExecutingJavaScriptFormAction = false;
return;
}
+<<<<<<< HEAD
FrameLoadRequest frameRequest;
#ifdef ANDROID_USER_GESTURE
frameRequest.resourceRequest().setUserGesture(isProcessingUserGesture());
@@ -515,6 +421,9 @@ void FrameLoader::submitForm(const char* action, const String& url, PassRefPtr<F
String targetOrBaseTarget = target.isEmpty() ? m_frame->document()->baseTarget() : target;
Frame* targetFrame = m_frame->tree()->find(targetOrBaseTarget);
+=======
+ Frame* targetFrame = m_frame->tree()->find(submission->target());
+>>>>>>> webkit.org at r61871
if (!shouldAllowNavigation(targetFrame))
return;
if (!targetFrame) {
@@ -522,8 +431,9 @@ void FrameLoader::submitForm(const char* action, const String& url, PassRefPtr<F
return;
targetFrame = m_frame;
- frameRequest.setFrameName(targetOrBaseTarget);
- }
+ } else
+ submission->clearTarget();
+
if (!targetFrame->page())
return;
@@ -540,33 +450,16 @@ void FrameLoader::submitForm(const char* action, const String& url, PassRefPtr<F
// needed any more now that we reset m_submittedFormURL on each mouse or key down event.
if (m_frame->tree()->isDescendantOf(targetFrame)) {
- if (m_submittedFormURL == u)
+ if (m_submittedFormURL == submission->action())
return;
- m_submittedFormURL = u;
- }
-
- formData->generateFiles(m_frame->document());
-
- if (!m_outgoingReferrer.isEmpty())
- frameRequest.resourceRequest().setHTTPReferrer(m_outgoingReferrer);
-
- if (strcmp(action, "GET") == 0)
- u.setQuery(formData->flattenToString());
- else {
- frameRequest.resourceRequest().setHTTPMethod("POST");
- frameRequest.resourceRequest().setHTTPBody(formData);
-
- // construct some user headers if necessary
- if (contentType.isNull() || contentType == "application/x-www-form-urlencoded")
- frameRequest.resourceRequest().setHTTPContentType(contentType);
- else // contentType must be "multipart/form-data"
- frameRequest.resourceRequest().setHTTPContentType(contentType + "; boundary=" + boundary);
+ m_submittedFormURL = submission->action();
}
- frameRequest.resourceRequest().setURL(u);
- addHTTPOriginIfNeeded(frameRequest.resourceRequest(), outgoingOrigin());
+ submission->data()->generateFiles(m_frame->document());
+ submission->setReferrer(m_outgoingReferrer);
+ submission->setOrigin(outgoingOrigin());
- targetFrame->redirectScheduler()->scheduleFormSubmission(frameRequest, lockHistory, event, formState);
+ targetFrame->redirectScheduler()->scheduleFormSubmission(submission);
}
void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolicy databasePolicy)
@@ -597,7 +490,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
// Dispatching the unload event could have made m_frame->document() null.
if (m_frame->document() && !m_frame->document()->inPageCache()) {
// Don't remove event listeners from a transitional empty document (see bug 28716 for more information).
- bool keepEventListeners = m_isDisplayingInitialEmptyDocument && m_provisionalDocumentLoader
+ bool keepEventListeners = m_stateMachine.isDisplayingInitialEmptyDocument() && m_provisionalDocumentLoader
&& m_frame->document()->securityOrigin()->isSecureTransitionTo(m_provisionalDocumentLoader->url());
if (!keepEventListeners)
@@ -628,6 +521,7 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
#endif
}
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
// Stop the Geolocation object, if present. This call is made after the unload
// event has fired, so no new Geolocation activity is possible.
@@ -639,6 +533,9 @@ void FrameLoader::stopLoading(UnloadEventPolicy unloadEventPolicy, DatabasePolic
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
child->loader()->stopLoading(unloadEventPolicy);
+=======
+ // FIXME: This will cancel redirection timer, which really needs to be restarted when restoring the frame from b/f cache.
+>>>>>>> webkit.org at r61871
m_frame->redirectScheduler()->cancel();
}
@@ -710,9 +607,11 @@ bool FrameLoader::didOpenURL(const KURL& url)
// If we are still in the process of initializing an empty document then
// its frame is not in a consistent state for rendering, so avoid setJSStatusBarText
// since it may cause clients to attempt to render the frame.
- if (!m_creatingInitialEmptyDocument) {
- m_frame->setJSStatusBarText(String());
- m_frame->setJSDefaultStatusBarText(String());
+ if (!m_stateMachine.creatingInitialEmptyDocument()) {
+ if (DOMWindow* window = m_frame->existingDOMWindow()) {
+ window->setStatus(String());
+ window->setDefaultStatus(String());
+ }
}
m_URL = url;
if (m_URL.protocolInHTTPFamily() && !m_URL.host().isEmpty() && m_URL.path().isEmpty())
@@ -730,7 +629,8 @@ void FrameLoader::didExplicitOpen()
m_didCallImplicitClose = false;
// Calling document.open counts as committing the first real document load.
- m_committedFirstRealDocumentLoad = true;
+ if (!m_stateMachine.committedFirstRealDocumentLoad())
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit);
// Prevent window.open(url) -- eg window.open("about:blank") -- from blowing away results
// from a subsequent window.document.open / window.document.write call.
@@ -788,7 +688,7 @@ void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, boo
m_frame->setDocument(0);
writer()->clear();
- m_containsPlugIns = false;
+ m_subframeLoader.clear();
if (clearScriptObjects)
m_frame->script()->clearScriptObjects();
@@ -799,7 +699,8 @@ void FrameLoader::clear(bool clearWindowProperties, bool clearScriptObjects, boo
m_shouldCallCheckCompleted = false;
m_shouldCallCheckLoadComplete = false;
- m_isDisplayingInitialEmptyDocument = false;
+ if (m_stateMachine.isDisplayingInitialEmptyDocument() && m_stateMachine.committedFirstRealDocumentLoad())
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
}
void FrameLoader::receivedFirstData()
@@ -851,7 +752,6 @@ void FrameLoader::didBeginDocument(bool dispatch)
m_isComplete = false;
m_didCallImplicitClose = false;
m_isLoadingMainResource = true;
- m_isDisplayingInitialEmptyDocument = m_creatingInitialEmptyDocument;
if (m_pendingStateObject) {
m_frame->document()->statePopped(m_pendingStateObject.get());
@@ -965,7 +865,7 @@ void FrameLoader::commitIconURLToIconDatabase(const KURL& icon)
void FrameLoader::finishedParsing()
{
- if (m_creatingInitialEmptyDocument)
+ if (m_stateMachine.creatingInitialEmptyDocument())
return;
m_frame->injectUserScripts(InjectAtDocumentEnd);
@@ -1166,68 +1066,6 @@ void FrameLoader::loadArchive(PassRefPtr<Archive> prpArchive)
}
#endif
-bool FrameLoader::requestObject(RenderEmbeddedObject* renderer, const String& url, const AtomicString& frameName,
- const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
-{
- if (url.isEmpty() && mimeType.isEmpty())
- return false;
-
- if (!m_frame->script()->xssAuditor()->canLoadObject(url)) {
- // It is unsafe to honor the request for this object.
- return false;
- }
-
- KURL completedURL;
- if (!url.isEmpty())
- completedURL = completeURL(url);
-
- bool useFallback;
- if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) {
- Settings* settings = m_frame->settings();
- if ((!allowPlugins(AboutToInstantiatePlugin)
- // Application plugins are plugins implemented by the user agent, for example Qt plugins,
- // 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)))
- return false;
- if (isDocumentSandboxed(m_frame, SandboxPlugins))
- return false;
- return loadPlugin(renderer, completedURL, mimeType, paramNames, paramValues, useFallback);
- }
-
- ASSERT(renderer->node()->hasTagName(objectTag) || renderer->node()->hasTagName(embedTag));
- HTMLPlugInElement* element = static_cast<HTMLPlugInElement*>(renderer->node());
-
- // If the plug-in element already contains a subframe, requestFrame will re-use it. Otherwise,
- // it will create a new frame and set it as the RenderPart's widget, causing what was previously
- // in the widget to be torn down.
- return requestFrame(element, completedURL, frameName);
-}
-
-bool FrameLoader::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback)
-{
- if (m_client->shouldUsePluginDocument(mimeType)) {
- useFallback = false;
- return true;
- }
-
- // Allow other plug-ins to win over QuickTime because if the user has installed a plug-in that
- // can handle TIFF (which QuickTime can also handle) they probably intended to override QT.
- if (m_frame->page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
- const PluginData* pluginData = m_frame->page()->pluginData();
- String pluginName = pluginData ? pluginData->pluginNameForMimeType(mimeType) : String();
- if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", false))
- return true;
- }
-
- ObjectContentType objectType = m_client->objectContentType(url, mimeType);
- // If an object's content can't be handled and it has no fallback, let
- // it be handled as a plugin to show the broken plugin icon.
- useFallback = objectType == ObjectContentNone && hasFallback;
- return objectType == ObjectContentNone || objectType == ObjectContentNetscapePlugin || objectType == ObjectContentOtherPlugin;
-}
-
ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const String& mimeTypeIn)
{
String mimeType = mimeTypeIn;
@@ -1252,91 +1090,6 @@ ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const S
return WebCore::ObjectContentNone;
}
-static HTMLPlugInElement* toPlugInElement(Node* node)
-{
- if (!node)
- return 0;
-
- ASSERT(node->hasTagName(objectTag) || node->hasTagName(embedTag)
- || node->hasTagName(appletTag));
-
- return static_cast<HTMLPlugInElement*>(node);
-}
-
-bool FrameLoader::loadPlugin(RenderEmbeddedObject* renderer, const KURL& url, const String& mimeType,
- const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
-{
- RefPtr<Widget> widget;
-
- if (renderer && !useFallback) {
- HTMLPlugInElement* element = toPlugInElement(renderer->node());
-
- if (!SecurityOrigin::canLoad(url, String(), frame()->document())) {
- FrameLoader::reportLocalLoadFailed(m_frame, url.string());
- return false;
- }
-
- checkIfRunInsecureContent(m_frame->document()->securityOrigin(), url);
-
- widget = m_client->createPlugin(IntSize(renderer->contentWidth(), renderer->contentHeight()),
- element, url, paramNames, paramValues, mimeType,
- m_frame->document()->isPluginDocument() && !m_containsPlugIns);
- if (widget) {
- renderer->setWidget(widget);
- m_containsPlugIns = true;
-
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
- renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
-#endif
- } else
- renderer->setShowsMissingPluginIndicator();
- }
-
- return widget != 0;
-}
-
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url,
- const Vector<String>& paramNames, const Vector<String>& paramValues)
-{
- ASSERT(node->hasTagName(videoTag) || node->hasTagName(audioTag));
-
- if (!m_frame->script()->xssAuditor()->canLoadObject(url.string()))
- return 0;
-
- KURL completedURL;
- if (!url.isEmpty())
- completedURL = completeURL(url);
-
- if (!SecurityOrigin::canLoad(completedURL, String(), frame()->document())) {
- FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
- return 0;
- }
-
- HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node);
- RenderPart* renderer = toRenderPart(node->renderer());
- IntSize size;
-
- if (renderer)
- size = IntSize(renderer->contentWidth(), renderer->contentHeight());
- else if (mediaElement->isVideo())
- size = RenderVideo::defaultSize();
-
- checkIfRunInsecureContent(m_frame->document()->securityOrigin(), completedURL);
-
- RefPtr<Widget> widget = m_client->createMediaPlayerProxyPlugin(size, mediaElement, completedURL,
- paramNames, paramValues, "application/x-media-element-proxy-plugin");
-
- if (widget && renderer) {
- renderer->setWidget(widget);
- m_containsPlugIns = true;
- renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
- }
-
- return widget ? widget.release() : 0;
-}
-#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-
String FrameLoader::outgoingReferrer() const
{
return m_outgoingReferrer;
@@ -1410,12 +1163,18 @@ void FrameLoader::handleFallbackContent()
}
void FrameLoader::provisionalLoadStarted()
+<<<<<<< HEAD
{
#ifdef ANDROID_INSTRUMENT
if (!m_frame->tree()->parent())
android::TimeCounter::reset();
#endif
m_firstLayoutDone = false;
+=======
+{
+ if (m_stateMachine.firstLayoutDone())
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoad);
+>>>>>>> webkit.org at r61871
m_frame->redirectScheduler()->cancel(true);
m_client->provisionalLoadStarted();
}
@@ -1569,20 +1328,6 @@ void FrameLoader::started()
frame->loader()->m_isComplete = false;
}
-bool FrameLoader::allowPlugins(ReasonForCallingAllowPlugins reason)
-{
- Settings* settings = m_frame->settings();
- bool allowed = m_client->allowPlugins(settings && settings->arePluginsEnabled());
- if (!allowed && reason == AboutToInstantiatePlugin)
- m_frame->loader()->client()->didNotAllowPlugins();
- return allowed;
-}
-
-bool FrameLoader::containsPlugins() const
-{
- return m_containsPlugIns;
-}
-
void FrameLoader::prepareForLoadStart()
{
if (Page* page = m_frame->page())
@@ -2141,7 +1886,7 @@ bool FrameLoader::isLoading() const
bool FrameLoader::frameHasLoaded() const
{
- return m_committedFirstRealDocumentLoad || (m_provisionalDocumentLoader && !m_creatingInitialEmptyDocument);
+ return m_stateMachine.committedFirstRealDocumentLoad() || (m_provisionalDocumentLoader && !m_stateMachine.creatingInitialEmptyDocument());
}
void FrameLoader::setDocumentLoader(DocumentLoader* loader)
@@ -2230,15 +1975,13 @@ void FrameLoader::commitProvisionalLoad()
// Check to see if we need to cache the page we are navigating away from into the back/forward cache.
// We are doing this here because we know for sure that a new page is about to be loaded.
HistoryItem* item = history()->currentItem();
- if (!m_frame->tree()->parent() && PageCache::canCache(m_frame->page()) && !item->isInPageCache()) {
- pageHidden();
+ if (!m_frame->tree()->parent() && PageCache::canCache(m_frame->page()) && !item->isInPageCache())
pageCache()->add(item, m_frame->page());
- }
if (m_loadType != FrameLoadTypeReplace)
closeOldDataSources();
- if (!cachedPage && !m_creatingInitialEmptyDocument)
+ if (!cachedPage && !m_stateMachine.creatingInitialEmptyDocument())
m_client->makeRepresentation(pdl.get());
transitionToCommitted(cachedPage);
@@ -2342,18 +2085,24 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
case FrameLoadTypeIndexedBackForward:
if (Page* page = m_frame->page()) {
if (page->backForwardList()) {
+ // If the first load within a frame is a navigation within a back/forward list that was attached
+ // without any of the items being loaded then we need to update the history in a similar manner as
+ // for a standard load with the exception of updating the back/forward list (<rdar://problem/8091103>).
+ if (!m_stateMachine.committedFirstRealDocumentLoad())
+ history()->updateForStandardLoad(HistoryController::UpdateAllExceptBackForwardList);
+
history()->updateForBackForwardNavigation();
if (history()->currentItem())
m_pendingStateObject = history()->currentItem()->stateObject();
-
+
// Create a document view for this document, or used the cached view.
if (cachedPage) {
DocumentLoader* cachedDocumentLoader = cachedPage->documentLoader();
ASSERT(cachedDocumentLoader);
cachedDocumentLoader->setFrame(m_frame);
m_client->transitionToCommittedFromCachedFrame(cachedPage->cachedMainFrame());
-
+
} else
m_client->transitionToCommittedForNewPage();
}
@@ -2395,10 +2144,11 @@ void FrameLoader::transitionToCommitted(PassRefPtr<CachedPage> cachedPage)
// Tell the client we've committed this URL.
ASSERT(m_frame->view());
- if (m_creatingInitialEmptyDocument)
+ if (m_stateMachine.creatingInitialEmptyDocument())
return;
-
- m_committedFirstRealDocumentLoad = true;
+
+ if (!m_stateMachine.committedFirstRealDocumentLoad())
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::DisplayingInitialEmptyDocumentPostCommit);
if (!m_client->hasHTMLView())
receivedFirstData();
@@ -2483,8 +2233,10 @@ void FrameLoader::prepareForCachedPageRestore()
// Delete old status bar messages (if it _was_ activated on last URL).
if (m_frame->script()->canExecuteScripts(NotAboutToExecuteScript)) {
- m_frame->setJSStatusBarText(String());
- m_frame->setJSDefaultStatusBarText(String());
+ if (DOMWindow* window = m_frame->existingDOMWindow()) {
+ window->setStatus(String());
+ window->setDefaultStatus(String());
+ }
}
}
@@ -2592,8 +2344,13 @@ void FrameLoader::didReceiveServerRedirectForProvisionalLoadForFrame()
void FrameLoader::finishedLoadingDocument(DocumentLoader* loader)
{
// FIXME: Platforms shouldn't differ here!
+<<<<<<< HEAD
#if PLATFORM(WIN) || PLATFORM(CHROMIUM) || defined(ANDROID)
if (m_creatingInitialEmptyDocument)
+=======
+#if PLATFORM(WIN) || PLATFORM(CHROMIUM)
+ if (m_stateMachine.creatingInitialEmptyDocument())
+>>>>>>> webkit.org at r61871
return;
#endif
@@ -2789,7 +2546,7 @@ void FrameLoader::checkLoadCompleteForThisFrame()
if ((isBackForwardLoadType(m_loadType) || m_loadType == FrameLoadTypeReload || m_loadType == FrameLoadTypeReloadFromOrigin) && page->backForwardList())
history()->restoreScrollPositionAndViewState();
- if (m_creatingInitialEmptyDocument || !m_committedFirstRealDocumentLoad)
+ if (m_stateMachine.creatingInitialEmptyDocument() || !m_stateMachine.committedFirstRealDocumentLoad())
return;
const ResourceError& error = dl->mainDocumentError();
@@ -2856,7 +2613,8 @@ void FrameLoader::didFirstLayout()
if (isBackForwardLoadType(m_loadType) && page->backForwardList())
history()->restoreScrollPositionAndViewState();
- m_firstLayoutDone = true;
+ if (m_stateMachine.committedFirstRealDocumentLoad() && !m_stateMachine.isDisplayingInitialEmptyDocument() && !m_stateMachine.firstLayoutDone())
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::FirstLayoutDone);
m_client->dispatchDidFirstLayout();
}
@@ -2875,13 +2633,8 @@ void FrameLoader::frameLoadCompleted()
// After a canceled provisional load, firstLayoutDone is false.
// Reset it to true if we're displaying a page.
- if (m_documentLoader)
- m_firstLayoutDone = true;
-}
-
-bool FrameLoader::firstLayoutDone() const
-{
- return m_firstLayoutDone;
+ if (m_documentLoader && m_stateMachine.committedFirstRealDocumentLoad() && !m_stateMachine.isDisplayingInitialEmptyDocument() && !m_stateMachine.firstLayoutDone())
+ m_stateMachine.advanceTo(FrameLoaderStateMachine::FirstLayoutDone);
}
void FrameLoader::detachChildren()
@@ -3308,7 +3061,7 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest&, Pass
// is the user responding Cancel to the form repost nag sheet.
// 2) User responded Cancel to an alert popped up by the before unload event handler.
// The "before unload" event handler runs only for the main frame.
- bool canContinue = shouldContinue && (!isLoadingMainFrame() || m_frame->shouldClose());
+ bool canContinue = shouldContinue && (!isLoadingMainFrame() || shouldClose());
if (!canContinue) {
// If we were waiting for a quick redirect, but the policy delegate decided to ignore it, then we
@@ -3483,18 +3236,6 @@ void FrameLoader::loadProvisionalItemFromCachedPage()
commitProvisionalLoad();
}
-void FrameLoader::pageHidden()
-{
- m_pageDismissalEventBeingDispatched = true;
- if (m_frame->domWindow())
- m_frame->domWindow()->dispatchEvent(PageTransitionEvent::create(eventNames().pagehideEvent, true), m_frame->document());
- m_pageDismissalEventBeingDispatched = false;
-
- // Send pagehide event for subframes as well
- for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling())
- child->loader()->pageHidden();
-}
-
bool FrameLoader::shouldTreatURLAsSameAsCurrent(const KURL& url) const
{
if (!history()->currentItem())
@@ -3631,14 +3372,11 @@ void FrameLoader::navigateToDifferentDocument(HistoryItem* item, FrameLoadType l
void FrameLoader::loadItem(HistoryItem* item, FrameLoadType loadType)
{
// We do same-document navigation in the following cases:
- // - The HistoryItem has a history state object
- // - Navigating to an anchor within the page, with no form data stored on the target item or the current history entry,
- // and the URLs in the frame tree match the history item for fragment scrolling.
- // - The HistoryItem is not the same as the current item, because such cases are treated as a new load.
+ // - The HistoryItem corresponds to the same document.
+ // - The HistoryItem is not the same as the current item.
HistoryItem* currentItem = history()->currentItem();
- bool sameDocumentNavigation = ((!item->formData() && !(currentItem && currentItem->formData()) && history()->urlsMatchItem(item))
- || (currentItem && item->documentSequenceNumber() == currentItem->documentSequenceNumber()))
- && item != currentItem;
+ bool sameDocumentNavigation = currentItem && item != currentItem
+ && item->documentSequenceNumber() == currentItem->documentSequenceNumber();
#if ENABLE(WML)
// All WML decks should go through the real load mechanism, not the scroll-to-anchor code
@@ -3782,42 +3520,6 @@ void FrameLoader::updateSandboxFlags()
child->loader()->updateSandboxFlags();
}
-PassRefPtr<Widget> FrameLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const HashMap<String, String>& args)
-{
- String baseURLString;
- String codeBaseURLString;
- Vector<String> paramNames;
- Vector<String> paramValues;
- HashMap<String, String>::const_iterator end = args.end();
- for (HashMap<String, String>::const_iterator it = args.begin(); it != end; ++it) {
- if (equalIgnoringCase(it->first, "baseurl"))
- baseURLString = it->second;
- else if (equalIgnoringCase(it->first, "codebase"))
- codeBaseURLString = it->second;
- paramNames.append(it->first);
- paramValues.append(it->second);
- }
-
- if (!codeBaseURLString.isEmpty()) {
- KURL codeBaseURL = completeURL(codeBaseURLString);
- if (!SecurityOrigin::canLoad(codeBaseURL, String(), element->document())) {
- FrameLoader::reportLocalLoadFailed(m_frame, codeBaseURL.string());
- return 0;
- }
- }
-
- if (baseURLString.isEmpty())
- baseURLString = m_frame->document()->baseURL().string();
- KURL baseURL = completeURL(baseURLString);
-
- RefPtr<Widget> widget = m_client->createJavaAppletWidget(size, element, baseURL, paramNames, paramValues);
- if (!widget)
- return 0;
-
- m_containsPlugIns = true;
- return widget;
-}
-
void FrameLoader::didChangeTitle(DocumentLoader* loader)
{
m_client->didChangeTitle(loader);
@@ -3840,7 +3542,7 @@ void FrameLoader::didChangeIcons(DocumentLoader* loader)
void FrameLoader::dispatchDidCommitLoad()
{
- if (m_creatingInitialEmptyDocument)
+ if (m_stateMachine.creatingInitialEmptyDocument())
return;
#ifndef NDEBUG
diff --git a/WebCore/loader/FrameLoader.h b/WebCore/loader/FrameLoader.h
index a04937d..b361b51 100644
--- a/WebCore/loader/FrameLoader.h
+++ b/WebCore/loader/FrameLoader.h
@@ -33,6 +33,7 @@
#include "CachePolicy.h"
#include "DocumentWriter.h"
+#include "FrameLoaderStateMachine.h"
#include "FrameLoaderTypes.h"
#include "HistoryController.h"
#include "PolicyCallback.h"
@@ -40,6 +41,7 @@
#include "RedirectScheduler.h"
#include "ResourceLoadNotifier.h"
#include "ResourceRequest.h"
+#include "SubframeLoader.h"
#include "ThreadableLoader.h"
#include "Timer.h"
#include <wtf/Forward.h>
@@ -59,20 +61,14 @@ class DocumentLoader;
class Event;
class FormData;
class FormState;
+class FormSubmission;
class Frame;
class FrameLoaderClient;
class HistoryItem;
-class HTMLAppletElement;
class HTMLFormElement;
-class HTMLFrameOwnerElement;
class IconLoader;
-class IntSize;
class NavigationAction;
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
-class Node;
-#endif
class ProtectionSpace;
-class RenderEmbeddedObject;
class ResourceError;
class ResourceLoader;
class ResourceResponse;
@@ -84,7 +80,6 @@ class SerializedScriptValue;
class SharedBuffer;
class SubstituteData;
class TextResourceDecoder;
-class Widget;
struct FrameLoadRequest;
struct WindowFeatures;
@@ -104,6 +99,7 @@ public:
HistoryController* history() const { return &m_history; }
ResourceLoadNotifier* notifier() const { return &m_notifer; }
DocumentWriter* writer() const { return &m_writer; }
+ SubframeLoader* subframeLoader() const { return &m_subframeLoader; }
// FIXME: This is not cool, people. There are too many different functions that all start loads.
// We should aim to consolidate these into a smaller set of functions, and try to reuse more of
@@ -204,7 +200,6 @@ public:
CachePolicy subresourceCachePolicy() const;
void didFirstLayout();
- bool firstLayoutDone() const;
void didFirstVisuallyNonEmptyLayout();
@@ -226,11 +221,8 @@ public:
void changeLocation(const KURL&, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false, bool refresh = false);
void urlSelected(const KURL&, const String& target, PassRefPtr<Event>, bool lockHistory, bool lockBackForwardList, bool userGesture, ReferrerPolicy);
- bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName, bool lockHistory = true, bool lockBackForwardList = true);
- void submitForm(const char* action, const String& url,
- PassRefPtr<FormData>, const String& target, const String& contentType, const String& boundary,
- bool lockHistory, PassRefPtr<Event>, PassRefPtr<FormState>);
+ void submitForm(PassRefPtr<FormSubmission>);
void stop();
void stopLoading(UnloadEventPolicy, DatabasePolicy = DatabasePolicyStop);
@@ -251,8 +243,6 @@ public:
void handledOnloadEvents();
String userAgent(const KURL&) const;
- PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const HashMap<String, String>& args);
-
void dispatchDidClearWindowObjectInWorld(DOMWrapperWorld*);
void dispatchDidClearWindowObjectsInAllWorlds();
void dispatchDocumentElementAvailable();
@@ -288,9 +278,6 @@ public:
// setURL is a low-level setter and does not trigger loading.
void setURL(const KURL&);
- bool allowPlugins(ReasonForCallingAllowPlugins);
- bool containsPlugins() const;
-
void loadDone();
void finishedParsing();
void checkCompleted();
@@ -299,9 +286,6 @@ public:
bool isComplete() const;
- bool requestObject(RenderEmbeddedObject*, const String& url, const AtomicString& frameName,
- const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
-
KURL completeURL(const String& url);
void cancelAndClear();
@@ -312,9 +296,7 @@ public:
void commitProvisionalLoad();
bool isLoadingFromCachedPage() const { return m_loadingFromCachedPage; }
- bool committingFirstRealLoad() const { return !m_creatingInitialEmptyDocument && !m_committedFirstRealDocumentLoad; }
- bool committedFirstRealDocumentLoad() const { return m_committedFirstRealDocumentLoad; }
- bool creatingInitialEmptyDocument() const { return m_creatingInitialEmptyDocument; }
+ FrameLoaderStateMachine* stateMachine() const { return &m_stateMachine; }
void iconLoadDecisionAvailable();
@@ -329,10 +311,6 @@ public:
void open(CachedFrameBase&);
-#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
- PassRefPtr<Widget> loadMediaPlayerProxyPlugin(Node*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues);
-#endif
-
// FIXME: Should these really be public?
void completed();
bool allAncestorsAreComplete() const; // including this
@@ -350,13 +328,13 @@ public:
static ObjectContentType defaultObjectContentType(const KURL& url, const String& mimeType);
- bool isDisplayingInitialEmptyDocument() const { return m_isDisplayingInitialEmptyDocument; }
-
void clear(bool clearWindowProperties = true, bool clearScriptObjects = true, bool clearFrameView = true);
bool quickRedirectComing() const { return m_quickRedirectComing; }
bool shouldClose();
+
+ void started();
private:
bool canCachePageContainingThisFrame();
@@ -366,18 +344,11 @@ private:
#endif
void checkTimerFired(Timer<FrameLoader>*);
-
- void started();
-
- bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback);
- bool loadPlugin(RenderEmbeddedObject*, const KURL&, const String& mimeType,
- const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
void navigateWithinDocument(HistoryItem*);
void navigateToDifferentDocument(HistoryItem*, FrameLoadType);
void loadProvisionalItemFromCachedPage();
- void pageHidden();
void receivedFirstData();
@@ -454,8 +425,6 @@ private:
void detachChildren();
void closeAndRemoveChild(Frame*);
- Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer);
-
void loadInSameDocument(const KURL&, SerializedScriptValue* stateObject, bool isNewNavigation);
void provisionalLoadStarted();
@@ -481,6 +450,8 @@ private:
mutable HistoryController m_history;
mutable ResourceLoadNotifier m_notifer;
mutable DocumentWriter m_writer;
+ mutable SubframeLoader m_subframeLoader;
+ mutable FrameLoaderStateMachine m_stateMachine;
FrameState m_state;
FrameLoadType m_loadType;
@@ -495,7 +466,6 @@ private:
bool m_delegateIsHandlingProvisionalLoadError;
- bool m_firstLayoutDone;
bool m_quickRedirectComing;
bool m_sentRedirectNotification;
bool m_inStopAllLoaders;
@@ -518,12 +488,7 @@ private:
OwnPtr<IconLoader> m_iconLoader;
bool m_mayLoadIconLater;
- bool m_cancellingWithLoadInProgress;
-
bool m_needsClear;
- bool m_receivedData;
-
- bool m_containsPlugIns;
KURL m_submittedFormURL;
@@ -534,10 +499,6 @@ private:
Frame* m_opener;
HashSet<Frame*> m_openedFrames;
- bool m_creatingInitialEmptyDocument;
- bool m_isDisplayingInitialEmptyDocument;
- bool m_committedFirstRealDocumentLoad;
-
bool m_didPerformFirstNavigation;
bool m_loadingFromCachedPage;
bool m_suppressOpenerInNewFrame;
diff --git a/WebCore/loader/FrameLoaderStateMachine.cpp b/WebCore/loader/FrameLoaderStateMachine.cpp
new file mode 100644
index 0000000..790b144
--- /dev/null
+++ b/WebCore/loader/FrameLoaderStateMachine.cpp
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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. 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 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 "FrameLoaderStateMachine.h"
+
+#include <wtf/Assertions.h>
+
+namespace WebCore {
+
+
+FrameLoaderStateMachine::FrameLoaderStateMachine()
+ : m_state(Uninitialized)
+{
+}
+
+bool FrameLoaderStateMachine::committingFirstRealLoad() const
+{
+ return m_state == DisplayingInitialEmptyDocument;
+}
+
+bool FrameLoaderStateMachine::committedFirstRealDocumentLoad() const
+{
+ return m_state >= DisplayingInitialEmptyDocumentPostCommit;
+}
+
+bool FrameLoaderStateMachine::creatingInitialEmptyDocument() const
+{
+ return m_state == CreatingInitialEmptyDocument;
+}
+
+bool FrameLoaderStateMachine::isDisplayingInitialEmptyDocument() const
+{
+ return m_state == DisplayingInitialEmptyDocument || m_state == DisplayingInitialEmptyDocumentPostCommit;
+}
+
+bool FrameLoaderStateMachine::firstLayoutDone() const
+{
+ return m_state == FirstLayoutDone;
+}
+
+void FrameLoaderStateMachine::advanceTo(State state)
+{
+ ASSERT(State(m_state + 1) == state || (firstLayoutDone() && state == CommittedFirstRealLoad));
+ m_state = state;
+}
+
+} // namespace WebCore
diff --git a/WebCore/loader/FrameLoaderStateMachine.h b/WebCore/loader/FrameLoaderStateMachine.h
new file mode 100644
index 0000000..c3408c2
--- /dev/null
+++ b/WebCore/loader/FrameLoaderStateMachine.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 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. 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 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 FrameLoaderStateMachine_h
+#define FrameLoaderStateMachine_h
+
+#include <wtf/Noncopyable.h>
+
+namespace WebCore {
+
+// Encapsulates a state machine for FrameLoader. Note that this is different from FrameState,
+// which stores the state of the current load that FrameLoader is executing.
+class FrameLoaderStateMachine : public Noncopyable {
+public:
+ FrameLoaderStateMachine();
+
+ // Once a load has been committed, the state may
+ // alternate between CommittedFirstRealLoad and FirstLayoutDone.
+ // Otherwise, the states only go down the list.
+ enum State {
+ Uninitialized,
+ CreatingInitialEmptyDocument,
+ DisplayingInitialEmptyDocument,
+ DisplayingInitialEmptyDocumentPostCommit,
+ CommittedFirstRealLoad,
+ FirstLayoutDone
+ };
+
+ bool committingFirstRealLoad() const;
+ bool committedFirstRealDocumentLoad() const;
+ bool creatingInitialEmptyDocument() const;
+ bool isDisplayingInitialEmptyDocument() const;
+ bool firstLayoutDone() const;
+ void advanceTo(State);
+
+private:
+ State m_state;
+};
+
+} // namespace WebCore
+
+#endif // FrameLoaderStateMachine_h
diff --git a/WebCore/loader/HistoryController.cpp b/WebCore/loader/HistoryController.cpp
index c4e9e5a..5ccdf72 100644
--- a/WebCore/loader/HistoryController.cpp
+++ b/WebCore/loader/HistoryController.cpp
@@ -37,6 +37,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
+#include "FrameLoaderStateMachine.h"
#include "FrameTree.h"
#include "FrameView.h"
#include "HistoryItem.h"
@@ -81,7 +82,7 @@ void HistoryController::saveScrollPositionAndViewStateToItem(HistoryItem* item)
*/
void HistoryController::restoreScrollPositionAndViewState()
{
- if (!m_frame->loader()->committedFirstRealDocumentLoad())
+ if (!m_frame->loader()->stateMachine()->committedFirstRealDocumentLoad())
return;
ASSERT(m_currentItem);
@@ -106,21 +107,13 @@ void HistoryController::restoreScrollPositionAndViewState()
void HistoryController::updateBackForwardListForFragmentScroll()
{
updateBackForwardListClippedAtTarget(false);
-
- // Since the document isn't changed as a result of a fragment scroll, we should
- // preserve the DocumentSequenceNumber of the previous item.
- if (!m_previousItem)
- return;
-
- ASSERT(m_currentItem);
- m_currentItem->setDocumentSequenceNumber(m_previousItem->documentSequenceNumber());
}
void HistoryController::saveDocumentState()
{
// FIXME: Reading this bit of FrameLoader state here is unfortunate. I need to study
// this more to see if we can remove this dependency.
- if (m_frame->loader()->creatingInitialEmptyDocument())
+ if (m_frame->loader()->stateMachine()->creatingInitialEmptyDocument())
return;
// For a standard page load, we will have a previous item set, which will be used to
@@ -231,25 +224,6 @@ void HistoryController::goToItem(HistoryItem* targetItem, FrameLoadType type)
recursiveGoToItem(targetItem, currentItem, type);
}
-// Walk the frame tree and ensure that the URLs match the URLs in the item.
-bool HistoryController::urlsMatchItem(HistoryItem* item) const
-{
- const KURL& currentURL = m_frame->loader()->documentLoader()->url();
- if (!equalIgnoringFragmentIdentifier(currentURL, item->url()))
- return false;
-
- const HistoryItemVector& childItems = item->children();
-
- unsigned size = childItems.size();
- for (unsigned i = 0; i < size; ++i) {
- Frame* childFrame = m_frame->tree()->child(childItems[i]->target());
- if (childFrame && !childFrame->loader()->history()->urlsMatchItem(childItems[i].get()))
- return false;
- }
-
- return true;
-}
-
void HistoryController::updateForBackForwardNavigation()
{
#if !LOG_DISABLED
@@ -286,7 +260,7 @@ void HistoryController::updateForReload()
// 2) Global history: Handled by the client.
// 3) Visited links: Handled by the PageGroup.
-void HistoryController::updateForStandardLoad()
+void HistoryController::updateForStandardLoad(HistoryUpdateType updateType)
{
LOG(History, "WebCoreHistory: Updating History for Standard Load in frame %s", m_frame->loader()->documentLoader()->url().string().ascii().data());
@@ -298,7 +272,8 @@ void HistoryController::updateForStandardLoad()
if (!frameLoader->documentLoader()->isClientRedirect()) {
if (!historyURL.isEmpty()) {
- updateBackForwardListClippedAtTarget(true);
+ if (updateType != UpdateAllExceptBackForwardList)
+ updateBackForwardListClippedAtTarget(true);
if (!needPrivacy) {
frameLoader->client()->updateGlobalHistory();
frameLoader->documentLoader()->setDidCreateGlobalHistoryEntry(true);
@@ -521,9 +496,21 @@ PassRefPtr<HistoryItem> HistoryController::createItemTree(Frame* targetFrame, bo
RefPtr<HistoryItem> bfItem = createItem(m_frame->tree()->parent() ? true : false);
if (m_previousItem)
saveScrollPositionAndViewStateToItem(m_previousItem.get());
- if (!(clipAtTarget && m_frame == targetFrame)) {
+
+ if (!clipAtTarget || m_frame != targetFrame) {
// save frame state for items that aren't loading (khtml doesn't save those)
saveDocumentState();
+
+ // clipAtTarget is false for navigations within the same document, so
+ // we should copy the documentSequenceNumber over to the newly create
+ // item. Non-target items are just clones, and they should therefore
+ // preserve the same itemSequenceNumber.
+ if (m_previousItem) {
+ if (m_frame != targetFrame)
+ bfItem->setItemSequenceNumber(m_previousItem->itemSequenceNumber());
+ bfItem->setDocumentSequenceNumber(m_previousItem->documentSequenceNumber());
+ }
+
for (Frame* child = m_frame->tree()->firstChild(); child; child = child->tree()->nextSibling()) {
FrameLoader* childLoader = child->loader();
bool hasChildLoaded = childLoader->frameHasLoaded();
@@ -536,6 +523,7 @@ PassRefPtr<HistoryItem> HistoryController::createItemTree(Frame* targetFrame, bo
bfItem->addChildItem(childLoader->history()->createItemTree(targetFrame, clipAtTarget));
}
}
+ // FIXME: Eliminate the isTargetItem flag in favor of itemSequenceNumber.
if (m_frame == targetFrame)
bfItem->setIsTargetItem(true);
return bfItem;
@@ -550,21 +538,15 @@ void HistoryController::recursiveGoToItem(HistoryItem* item, HistoryItem* fromIt
ASSERT(item);
ASSERT(fromItem);
- KURL itemURL = item->url();
- KURL currentURL;
- if (m_frame->loader()->documentLoader())
- currentURL = m_frame->loader()->documentLoader()->url();
-
- // Always reload the target frame of the item we're going to. This ensures that we will
- // do -some- load for the transition, which means a proper notification will be posted
- // to the app.
- // The exact URL has to match, including fragment. We want to go through the _load
- // method, even if to do a within-page navigation.
- // The current frame tree and the frame tree snapshot in the item have to match.
- if (!item->isTargetItem() &&
- itemURL == currentURL &&
- ((m_frame->tree()->name().isEmpty() && item->target().isEmpty()) || m_frame->tree()->name() == item->target()) &&
- childFramesMatchItem(item))
+ // If the item we're going to is a clone of the item we're at, then do
+ // not load it again, and continue history traversal to its children.
+ // The current frame tree and the frame tree snapshot in the item have
+ // to match.
+ // Note: If item and fromItem are the same, then we need to create a new
+ // document.
+ if (item != fromItem && item->itemSequenceNumber() == fromItem->itemSequenceNumber()
+ && ((m_frame->tree()->name().isEmpty() && item->target().isEmpty()) || m_frame->tree()->name() == item->target())
+ && childFramesMatchItem(item))
{
// This content is good, so leave it alone and look for children that need reloading
// Save form state (works from currentItem, since prevItem is nil)
@@ -659,10 +641,6 @@ void HistoryController::pushState(PassRefPtr<SerializedScriptValue> stateObject,
item->setStateObject(stateObject);
item->setURLString(urlString);
- // Since the document isn't changed as a result of a pushState call, we
- // should preserve the DocumentSequenceNumber of the previous item.
- item->setDocumentSequenceNumber(m_previousItem->documentSequenceNumber());
-
page->backForwardList()->pushStateItem(item.release());
}
diff --git a/WebCore/loader/HistoryController.h b/WebCore/loader/HistoryController.h
index 64f7854..19902f8 100644
--- a/WebCore/loader/HistoryController.h
+++ b/WebCore/loader/HistoryController.h
@@ -43,6 +43,8 @@ class SerializedScriptValue;
class HistoryController : public Noncopyable {
public:
+ enum HistoryUpdateType { UpdateAll, UpdateAllExceptBackForwardList };
+
HistoryController(Frame*);
~HistoryController();
@@ -58,11 +60,10 @@ public:
void invalidateCurrentItemCachedPage();
void goToItem(HistoryItem*, FrameLoadType);
- bool urlsMatchItem(HistoryItem*) const;
void updateForBackForwardNavigation();
void updateForReload();
- void updateForStandardLoad();
+ void updateForStandardLoad(HistoryUpdateType updateType = UpdateAll);
void updateForRedirectWithLockedBackForwardList();
void updateForClientRedirect();
void updateForCommit();
diff --git a/WebCore/loader/ImageDocument.cpp b/WebCore/loader/ImageDocument.cpp
index 8ab412f..49f54e2 100644
--- a/WebCore/loader/ImageDocument.cpp
+++ b/WebCore/loader/ImageDocument.cpp
@@ -25,14 +25,11 @@
#include "config.h"
#include "ImageDocument.h"
-#include "CSSStyleDeclaration.h"
#include "CachedImage.h"
#include "DocumentLoader.h"
-#include "Element.h"
#include "EventListener.h"
#include "EventNames.h"
#include "Frame.h"
-#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameView.h"
#include "HTMLImageElement.h"
@@ -41,10 +38,8 @@
#include "MouseEvent.h"
#include "NotImplemented.h"
#include "Page.h"
-#include "SegmentedString.h"
+#include "RawDataDocumentParser.h"
#include "Settings.h"
-#include "Text.h"
-#include "XMLDocumentParser.h"
using std::min;
@@ -76,19 +71,21 @@ private:
ImageDocument* m_doc;
};
-class ImageTokenizer : public DocumentParser {
+class ImageDocumentParser : public RawDataDocumentParser {
public:
- ImageTokenizer(ImageDocument* doc) : m_doc(doc) {}
+ ImageDocumentParser(ImageDocument* document)
+ : RawDataDocumentParser(document)
+ {
+ }
- virtual void write(const SegmentedString&, bool appendData);
- virtual void finish();
- virtual bool isWaitingForScripts() const;
-
- virtual bool wantsRawData() const { return true; }
- virtual bool writeRawData(const char* data, int len);
+ ImageDocument* document() const
+ {
+ return static_cast<ImageDocument*>(m_document);
+ }
private:
- ImageDocument* m_doc;
+ virtual bool writeRawData(const char* data, int len);
+ virtual void finish();
};
class ImageDocumentElement : public HTMLImageElement {
@@ -110,7 +107,7 @@ private:
inline PassRefPtr<ImageDocumentElement> ImageDocumentElement::create(ImageDocument* document)
{
- return new ImageDocumentElement(document);
+ return adoptRef(new ImageDocumentElement(document));
}
// --------
@@ -121,69 +118,57 @@ static float pageZoomFactor(Document* document)
return view ? view->pageZoomFactor() : 1;
}
-void ImageTokenizer::write(const SegmentedString&, bool)
+bool ImageDocumentParser::writeRawData(const char*, int)
{
- // <https://bugs.webkit.org/show_bug.cgi?id=25397>: JS code can always call document.write, we need to handle it.
- notImplemented();
-}
-
-bool ImageTokenizer::writeRawData(const char*, int)
-{
- Frame* frame = m_doc->frame();
+ Frame* frame = document()->frame();
Settings* settings = frame->settings();
if (!frame->loader()->client()->allowImages(!settings || settings->areImagesEnabled()))
return false;
-
- CachedImage* cachedImage = m_doc->cachedImage();
+
+ CachedImage* cachedImage = document()->cachedImage();
cachedImage->data(frame->loader()->documentLoader()->mainResourceData(), false);
- m_doc->imageChanged();
+ document()->imageChanged();
return false;
}
-void ImageTokenizer::finish()
+void ImageDocumentParser::finish()
{
- if (!m_parserStopped && m_doc->imageElement()) {
- CachedImage* cachedImage = m_doc->cachedImage();
- RefPtr<SharedBuffer> data = m_doc->frame()->loader()->documentLoader()->mainResourceData();
+ if (!m_parserStopped && document()->imageElement()) {
+ CachedImage* cachedImage = document()->cachedImage();
+ RefPtr<SharedBuffer> data = document()->frame()->loader()->documentLoader()->mainResourceData();
// If this is a multipart image, make a copy of the current part, since the resource data
// will be overwritten by the next part.
- if (m_doc->frame()->loader()->documentLoader()->isLoadingMultipartContent())
+ if (document()->frame()->loader()->documentLoader()->isLoadingMultipartContent())
data = data->copy();
cachedImage->data(data.release(), true);
cachedImage->finish();
- cachedImage->setResponse(m_doc->frame()->loader()->documentLoader()->response());
+ cachedImage->setResponse(document()->frame()->loader()->documentLoader()->response());
- IntSize size = cachedImage->imageSize(pageZoomFactor(m_doc));
+ IntSize size = cachedImage->imageSize(pageZoomFactor(document()));
if (size.width()) {
// Compute the title, we use the decoded filename of the resource, falling
// back on the (decoded) hostname if there is no path.
- String fileName = decodeURLEscapeSequences(m_doc->url().lastPathComponent());
+ String fileName = decodeURLEscapeSequences(document()->url().lastPathComponent());
if (fileName.isEmpty())
- fileName = m_doc->url().host();
- m_doc->setTitle(imageTitle(fileName, size));
+ fileName = document()->url().host();
+ document()->setTitle(imageTitle(fileName, size));
}
- m_doc->imageChanged();
+ document()->imageChanged();
}
- m_doc->finishedParsing();
-}
-
-bool ImageTokenizer::isWaitingForScripts() const
-{
- // An image document is never waiting for scripts
- return false;
+ document()->finishedParsing();
}
// --------
-ImageDocument::ImageDocument(Frame* frame)
- : HTMLDocument(frame)
+ImageDocument::ImageDocument(Frame* frame, const KURL& url)
+ : HTMLDocument(frame, url)
, m_imageElement(0)
, m_imageSizeIsKnown(false)
, m_didShrinkImage(false)
@@ -194,7 +179,7 @@ ImageDocument::ImageDocument(Frame* frame)
DocumentParser* ImageDocument::createParser()
{
- return new ImageTokenizer(this);
+ return new ImageDocumentParser(this);
}
void ImageDocument::createDocumentStructure()
@@ -203,6 +188,9 @@ void ImageDocument::createDocumentStructure()
RefPtr<Element> rootElement = Document::createElement(htmlTag, false);
appendChild(rootElement, ec);
+
+ if (frame() && frame()->loader())
+ frame()->loader()->dispatchDocumentElementAvailable();
RefPtr<Element> body = Document::createElement(bodyTag, false);
body->setAttribute(styleAttr, "margin: 0px;");
diff --git a/WebCore/loader/ImageDocument.h b/WebCore/loader/ImageDocument.h
index bd627b4..e85b3ab 100644
--- a/WebCore/loader/ImageDocument.h
+++ b/WebCore/loader/ImageDocument.h
@@ -33,9 +33,9 @@ class ImageDocumentElement;
class ImageDocument : public HTMLDocument {
public:
- static PassRefPtr<ImageDocument> create(Frame* frame)
+ static PassRefPtr<ImageDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new ImageDocument(frame));
+ return adoptRef(new ImageDocument(frame, url));
}
CachedImage* cachedImage();
@@ -47,7 +47,7 @@ public:
void imageClicked(int x, int y);
private:
- ImageDocument(Frame*);
+ ImageDocument(Frame*, const KURL&);
virtual DocumentParser* createParser();
virtual bool isImageDocument() const { return true; }
diff --git a/WebCore/loader/MainResourceLoader.cpp b/WebCore/loader/MainResourceLoader.cpp
index 28587e2..0a5bf40 100644
--- a/WebCore/loader/MainResourceLoader.cpp
+++ b/WebCore/loader/MainResourceLoader.cpp
@@ -285,7 +285,7 @@ void MainResourceLoader::continueAfterContentPolicy(PolicyAction policy)
#if PLATFORM(QT)
void MainResourceLoader::substituteMIMETypeFromPluginDatabase(const ResourceResponse& r)
{
- if (!m_frame->loader()->allowPlugins(NotAboutToInstantiatePlugin))
+ if (!m_frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin))
return;
String filename = r.url().lastPathComponent();
diff --git a/WebCore/loader/MediaDocument.cpp b/WebCore/loader/MediaDocument.cpp
index e505c2f..97ca783 100644
--- a/WebCore/loader/MediaDocument.cpp
+++ b/WebCore/loader/MediaDocument.cpp
@@ -29,11 +29,8 @@
#include "MediaDocument.h"
#include "DocumentLoader.h"
-#include "Element.h"
-#include "Event.h"
#include "EventNames.h"
#include "Frame.h"
-#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "HTMLEmbedElement.h"
#include "HTMLNames.h"
@@ -41,51 +38,41 @@
#include "KeyboardEvent.h"
#include "MainResourceLoader.h"
#include "NodeList.h"
-#include "Page.h"
-#include "SegmentedString.h"
-#include "Settings.h"
-#include "Text.h"
-#include "XMLDocumentParser.h"
+#include "RawDataDocumentParser.h"
namespace WebCore {
using namespace HTMLNames;
-class MediaDocumentParser : public DocumentParser {
+// FIXME: Share more code with PluginDocumentParser.
+class MediaDocumentParser : public RawDataDocumentParser {
public:
- MediaDocumentParser(Document* doc) : m_doc(doc), m_mediaElement(0) {}
-
+ MediaDocumentParser(Document* document)
+ : RawDataDocumentParser(document)
+ , m_mediaElement(0)
+ {
+ }
+
private:
- virtual void write(const SegmentedString&, bool appendData);
- virtual void finish();
- virtual bool isWaitingForScripts() const;
-
- virtual bool wantsRawData() const { return true; }
virtual bool writeRawData(const char* data, int len);
-
+
void createDocumentStructure();
- Document* m_doc;
HTMLMediaElement* m_mediaElement;
};
-
-void MediaDocumentParser::write(const SegmentedString&, bool)
-{
- ASSERT_NOT_REACHED();
-}
void MediaDocumentParser::createDocumentStructure()
{
ExceptionCode ec;
- RefPtr<Element> rootElement = m_doc->createElement(htmlTag, false);
- m_doc->appendChild(rootElement, ec);
+ RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
+ document()->appendChild(rootElement, ec);
- RefPtr<Element> body = m_doc->createElement(bodyTag, false);
+ RefPtr<Element> body = document()->createElement(bodyTag, false);
body->setAttribute(styleAttr, "background-color: rgb(38,38,38);");
rootElement->appendChild(body, ec);
- RefPtr<Element> mediaElement = m_doc->createElement(videoTag, false);
+ RefPtr<Element> mediaElement = document()->createElement(videoTag, false);
m_mediaElement = static_cast<HTMLVideoElement*>(mediaElement.get());
m_mediaElement->setAttribute(controlsAttr, "");
@@ -93,11 +80,11 @@ void MediaDocumentParser::createDocumentStructure()
m_mediaElement->setAttribute(styleAttr, "margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0;");
m_mediaElement->setAttribute(nameAttr, "media");
- m_mediaElement->setSrc(m_doc->url());
+ m_mediaElement->setSrc(document()->url());
body->appendChild(mediaElement, ec);
- Frame* frame = m_doc->frame();
+ Frame* frame = document()->frame();
if (!frame)
return;
@@ -114,21 +101,9 @@ bool MediaDocumentParser::writeRawData(const char*, int)
finish();
return false;
}
-
-void MediaDocumentParser::finish()
-{
- if (!m_parserStopped)
- m_doc->finishedParsing();
-}
-
-bool MediaDocumentParser::isWaitingForScripts() const
-{
- // A media document is never waiting for scripts
- return false;
-}
-MediaDocument::MediaDocument(Frame* frame)
- : HTMLDocument(frame)
+MediaDocument::MediaDocument(Frame* frame, const KURL& url)
+ : HTMLDocument(frame, url)
, m_replaceMediaElementTimer(this, &MediaDocument::replaceMediaElementTimerFired)
{
setParseMode(Compat);
diff --git a/WebCore/loader/MediaDocument.h b/WebCore/loader/MediaDocument.h
index 98eb02f..5a8ec52 100644
--- a/WebCore/loader/MediaDocument.h
+++ b/WebCore/loader/MediaDocument.h
@@ -34,16 +34,16 @@ namespace WebCore {
class MediaDocument : public HTMLDocument {
public:
- static PassRefPtr<MediaDocument> create(Frame* frame)
+ static PassRefPtr<MediaDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new MediaDocument(frame));
+ return adoptRef(new MediaDocument(frame, url));
}
virtual ~MediaDocument();
void mediaElementSawUnsupportedTracks();
private:
- MediaDocument(Frame*);
+ MediaDocument(Frame*, const KURL&);
virtual bool isMediaDocument() const { return true; }
virtual DocumentParser* createParser();
diff --git a/WebCore/loader/PlaceholderDocument.h b/WebCore/loader/PlaceholderDocument.h
index 5b76a9c..3d40a6e 100644
--- a/WebCore/loader/PlaceholderDocument.h
+++ b/WebCore/loader/PlaceholderDocument.h
@@ -32,15 +32,15 @@ namespace WebCore {
class PlaceholderDocument : public Document {
public:
- static PassRefPtr<PlaceholderDocument> create(Frame* frame)
+ static PassRefPtr<PlaceholderDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new PlaceholderDocument(frame));
+ return adoptRef(new PlaceholderDocument(frame, url));
}
virtual void attach();
private:
- PlaceholderDocument(Frame* frame) : Document(frame, false, false) { }
+ PlaceholderDocument(Frame* frame, const KURL& url) : Document(frame, url, false, false) { }
};
} // namespace WebCore
diff --git a/WebCore/loader/PluginDocument.cpp b/WebCore/loader/PluginDocument.cpp
index 7833d41..12ab746 100644
--- a/WebCore/loader/PluginDocument.cpp
+++ b/WebCore/loader/PluginDocument.cpp
@@ -26,41 +26,36 @@
#include "PluginDocument.h"
#include "DocumentLoader.h"
-#include "Element.h"
#include "Frame.h"
-#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "HTMLEmbedElement.h"
#include "HTMLNames.h"
#include "MainResourceLoader.h"
#include "Page.h"
+#include "RawDataDocumentParser.h"
#include "RenderEmbeddedObject.h"
-#include "RenderWidget.h"
-#include "SegmentedString.h"
#include "Settings.h"
-#include "Text.h"
-#include "XMLDocumentParser.h"
namespace WebCore {
using namespace HTMLNames;
-
-class PluginDocumentParser : public DocumentParser {
+
+// FIXME: Share more code with MediaDocumentParser.
+class PluginDocumentParser : public RawDataDocumentParser {
public:
- PluginDocumentParser(Document* doc) : m_doc(doc), m_embedElement(0) {}
- static Widget* pluginWidgetFromDocument(Document* doc);
-
+ PluginDocumentParser(Document* document)
+ : RawDataDocumentParser(document)
+ , m_embedElement(0)
+ {
+ }
+
+ static Widget* pluginWidgetFromDocument(Document*);
+
private:
- virtual void write(const SegmentedString&, bool appendData);
- virtual void finish();
- virtual bool isWaitingForScripts() const;
-
- virtual bool wantsRawData() const { return true; }
virtual bool writeRawData(const char* data, int len);
-
+
void createDocumentStructure();
- Document* m_doc;
HTMLEmbedElement* m_embedElement;
};
@@ -78,33 +73,28 @@ Widget* PluginDocumentParser::pluginWidgetFromDocument(Document* doc)
return 0;
}
-void PluginDocumentParser::write(const SegmentedString&, bool)
-{
- ASSERT_NOT_REACHED();
-}
-
void PluginDocumentParser::createDocumentStructure()
{
ExceptionCode ec;
- RefPtr<Element> rootElement = m_doc->createElement(htmlTag, false);
- m_doc->appendChild(rootElement, ec);
+ RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
+ document()->appendChild(rootElement, ec);
- RefPtr<Element> body = m_doc->createElement(bodyTag, false);
+ RefPtr<Element> body = document()->createElement(bodyTag, false);
body->setAttribute(marginwidthAttr, "0");
body->setAttribute(marginheightAttr, "0");
body->setAttribute(bgcolorAttr, "rgb(38,38,38)");
rootElement->appendChild(body, ec);
- RefPtr<Element> embedElement = m_doc->createElement(embedTag, false);
+ RefPtr<Element> embedElement = document()->createElement(embedTag, false);
m_embedElement = static_cast<HTMLEmbedElement*>(embedElement.get());
m_embedElement->setAttribute(widthAttr, "100%");
m_embedElement->setAttribute(heightAttr, "100%");
m_embedElement->setAttribute(nameAttr, "plugin");
- m_embedElement->setAttribute(srcAttr, m_doc->url().string());
- m_embedElement->setAttribute(typeAttr, m_doc->frame()->loader()->writer()->mimeType());
+ m_embedElement->setAttribute(srcAttr, document()->url().string());
+ m_embedElement->setAttribute(typeAttr, document()->frame()->loader()->writer()->mimeType());
body->appendChild(embedElement, ec);
}
@@ -117,10 +107,10 @@ bool PluginDocumentParser::writeRawData(const char*, int)
createDocumentStructure();
- if (Frame* frame = m_doc->frame()) {
+ if (Frame* frame = document()->frame()) {
Settings* settings = frame->settings();
- if (settings && frame->loader()->allowPlugins(NotAboutToInstantiatePlugin)) {
- m_doc->updateLayout();
+ if (settings && frame->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin)) {
+ document()->updateLayout();
if (RenderWidget* renderer = toRenderWidget(m_embedElement->renderer())) {
frame->loader()->client()->redirectDataToPlugin(renderer->widget());
@@ -134,20 +124,8 @@ bool PluginDocumentParser::writeRawData(const char*, int)
return false;
}
-void PluginDocumentParser::finish()
-{
- if (!m_parserStopped)
- m_doc->finishedParsing();
-}
-
-bool PluginDocumentParser::isWaitingForScripts() const
-{
- // A plugin document is never waiting for scripts
- return false;
-}
-
-PluginDocument::PluginDocument(Frame* frame)
- : HTMLDocument(frame)
+PluginDocument::PluginDocument(Frame* frame, const KURL& url)
+ : HTMLDocument(frame, url)
{
setParseMode(Compat);
}
diff --git a/WebCore/loader/PluginDocument.h b/WebCore/loader/PluginDocument.h
index e3f98a7..53dde65 100644
--- a/WebCore/loader/PluginDocument.h
+++ b/WebCore/loader/PluginDocument.h
@@ -33,9 +33,9 @@ class Node;
class Widget;
class PluginDocument : public HTMLDocument {
public:
- static PassRefPtr<PluginDocument> create(Frame* frame)
+ static PassRefPtr<PluginDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new PluginDocument(frame));
+ return adoptRef(new PluginDocument(frame, url));
}
Widget* pluginWidget();
@@ -44,7 +44,7 @@ public:
virtual bool isPluginDocument() const { return true; }
private:
- PluginDocument(Frame*);
+ PluginDocument(Frame*, const KURL&);
virtual DocumentParser* createParser();
};
diff --git a/WebCore/loader/ProgressTracker.cpp b/WebCore/loader/ProgressTracker.cpp
index 2e12204..88231c8 100644
--- a/WebCore/loader/ProgressTracker.cpp
+++ b/WebCore/loader/ProgressTracker.cpp
@@ -29,6 +29,7 @@
#include "DocumentLoader.h"
#include "Frame.h"
#include "FrameLoader.h"
+#include "FrameLoaderStateMachine.h"
#include "FrameLoaderClient.h"
#include "Logging.h"
#include "ResourceResponse.h"
@@ -204,7 +205,7 @@ void ProgressTracker::incrementProgress(unsigned long identifier, const char*, i
// For documents that use WebCore's layout system, treat first layout as the half-way point.
// FIXME: The hasHTMLView function is a sort of roundabout way of asking "do you use WebCore's layout system".
bool useClampedMaxProgress = frame->loader()->client()->hasHTMLView()
- && !frame->loader()->firstLayoutDone();
+ && !frame->loader()->stateMachine()->firstLayoutDone();
double maxProgressValue = useClampedMaxProgress ? 0.5 : finalProgressValue;
increment = (maxProgressValue - m_progressValue) * percentOfRemainingBytes;
m_progressValue += increment;
diff --git a/WebCore/loader/RedirectScheduler.cpp b/WebCore/loader/RedirectScheduler.cpp
index b4c86d4..3cfe61a 100644
--- a/WebCore/loader/RedirectScheduler.cpp
+++ b/WebCore/loader/RedirectScheduler.cpp
@@ -36,9 +36,11 @@
#include "DocumentLoader.h"
#include "Event.h"
#include "FormState.h"
+#include "FormSubmission.h"
#include "Frame.h"
#include "FrameLoadRequest.h"
#include "FrameLoader.h"
+#include "FrameLoaderStateMachine.h"
#include "HistoryItem.h"
#include "HTMLFormElement.h"
#include "HTMLFrameOwnerElement.h"
@@ -170,15 +172,12 @@ private:
class ScheduledFormSubmission : public ScheduledNavigation {
public:
- ScheduledFormSubmission(const FrameLoadRequest& frameRequest, bool lockHistory, bool lockBackForwardList, PassRefPtr<Event> event, PassRefPtr<FormState> formState, bool duringLoad)
- : ScheduledNavigation(0, lockHistory, lockBackForwardList, duringLoad, true)
- , m_frameRequest(frameRequest)
- , m_event(event)
- , m_formState(formState)
+ ScheduledFormSubmission(PassRefPtr<FormSubmission> submission, bool lockBackForwardList, bool duringLoad)
+ : ScheduledNavigation(0, submission->lockHistory(), lockBackForwardList, duringLoad, true)
+ , m_submission(submission)
, m_wasProcessingUserGesture(UserGestureIndicator::processingUserGesture())
{
- ASSERT(!frameRequest.isEmpty());
- ASSERT(m_formState);
+ ASSERT(m_submission->state());
}
virtual void fire(Frame* frame)
@@ -189,9 +188,11 @@ public:
// Now that the timer has fired, we need to repeat the security check which normally is done when
// selecting a target, in case conditions have changed. Other code paths avoid this by targeting
// without leaving a time window. If we fail the check just silently drop the form submission.
- if (!m_formState->sourceFrame()->loader()->shouldAllowNavigation(frame))
+ if (!m_submission->state()->sourceFrame()->loader()->shouldAllowNavigation(frame))
return;
- frame->loader()->loadFrameRequest(m_frameRequest, lockHistory(), lockBackForwardList(), m_event, m_formState, SendReferrer);
+ FrameLoadRequest frameRequest;
+ m_submission->populateFrameLoadRequest(frameRequest);
+ frame->loader()->loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), SendReferrer);
}
// FIXME: Implement didStartTimer? It would make sense to report form
@@ -200,9 +201,7 @@ public:
// be a behavior change.
private:
- const FrameLoadRequest m_frameRequest;
- const RefPtr<Event> m_event;
- const RefPtr<FormState> m_formState;
+ RefPtr<FormSubmission> m_submission;
bool m_wasProcessingUserGesture;
};
@@ -281,31 +280,29 @@ void RedirectScheduler::scheduleLocationChange(const String& url, const String&
// Handle a location change of a page with no document as a special case.
// This may happen when a frame changes the location of another frame.
- bool duringLoad = !loader->committedFirstRealDocumentLoad();
+ bool duringLoad = !loader->stateMachine()->committedFirstRealDocumentLoad();
schedule(new ScheduledLocationChange(url, referrer, lockHistory, lockBackForwardList, wasUserGesture, duringLoad));
}
-void RedirectScheduler::scheduleFormSubmission(const FrameLoadRequest& frameRequest,
- bool lockHistory, PassRefPtr<Event> event, PassRefPtr<FormState> formState)
+void RedirectScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
{
ASSERT(m_frame->page());
- ASSERT(!frameRequest.isEmpty());
// FIXME: Do we need special handling for form submissions where the URL is the same
// as the current one except for the fragment part? See scheduleLocationChange above.
// Handle a location change of a page with no document as a special case.
// This may happen when a frame changes the location of another frame.
- bool duringLoad = !m_frame->loader()->committedFirstRealDocumentLoad();
+ bool duringLoad = !m_frame->loader()->stateMachine()->committedFirstRealDocumentLoad();
// If this is a child frame and the form submission was triggered by a script, lock the back/forward list
// to match IE and Opera.
// See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
- bool lockBackForwardList = mustLockBackForwardList(m_frame) || (formState->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
+ bool lockBackForwardList = mustLockBackForwardList(m_frame) || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript && m_frame->tree()->parent());
- schedule(new ScheduledFormSubmission(frameRequest, lockHistory, lockBackForwardList, event, formState, duringLoad));
+ schedule(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad));
}
void RedirectScheduler::scheduleRefresh(bool wasUserGesture)
diff --git a/WebCore/loader/RedirectScheduler.h b/WebCore/loader/RedirectScheduler.h
index ac3731c..e9d04dc 100644
--- a/WebCore/loader/RedirectScheduler.h
+++ b/WebCore/loader/RedirectScheduler.h
@@ -40,6 +40,7 @@
namespace WebCore {
class FormState;
+class FormSubmission;
class Frame;
class String;
@@ -56,7 +57,7 @@ public:
void scheduleRedirect(double delay, const String& url);
void scheduleLocationChange(const String& url, const String& referrer, bool lockHistory = true, bool lockBackForwardList = true, bool userGesture = false);
- void scheduleFormSubmission(const FrameLoadRequest&, bool lockHistory, PassRefPtr<Event>, PassRefPtr<FormState>);
+ void scheduleFormSubmission(PassRefPtr<FormSubmission>);
void scheduleRefresh(bool userGesture = false);
void scheduleHistoryNavigation(int steps);
diff --git a/WebCore/loader/ResourceLoader.cpp b/WebCore/loader/ResourceLoader.cpp
index 7a95383..b700fcf 100644
--- a/WebCore/loader/ResourceLoader.cpp
+++ b/WebCore/loader/ResourceLoader.cpp
@@ -510,8 +510,15 @@ void ResourceLoader::receivedCancellation(const AuthenticationChallenge&)
void ResourceLoader::willCacheResponse(ResourceHandle*, CacheStoragePolicy& policy)
{
+ // <rdar://problem/7249553> - There are reports of crashes with this method being called
+ // with a null m_frame->settings(), which can only happen if the frame doesn't have a page.
+ // Sadly we have no reproducible cases of this.
+ // We think that any frame without a page shouldn't have any loads happening in it, yet
+ // there is at least one code path where that is not true.
+ ASSERT(m_frame->settings());
+
// When in private browsing mode, prevent caching to disk
- if (policy == StorageAllowed && m_frame->settings()->privateBrowsingEnabled())
+ if (policy == StorageAllowed && m_frame->settings() && m_frame->settings()->privateBrowsingEnabled())
policy = StorageAllowedInMemoryOnly;
}
diff --git a/WebCore/loader/SinkDocument.cpp b/WebCore/loader/SinkDocument.cpp
index d40e567..e149981 100644
--- a/WebCore/loader/SinkDocument.cpp
+++ b/WebCore/loader/SinkDocument.cpp
@@ -26,40 +26,21 @@
#include "config.h"
#include "SinkDocument.h"
-#include "DocumentParser.h"
+#include "RawDataDocumentParser.h"
namespace WebCore {
-class SinkDocumentParser : public DocumentParser {
-public:
- SinkDocumentParser(Document* document) : m_document(document) { }
-
-private:
- virtual void write(const SegmentedString&, bool) { ASSERT_NOT_REACHED(); }
- virtual void finish();
- virtual bool isWaitingForScripts() const { return false; }
-
- virtual bool wantsRawData() const { return true; }
- virtual bool writeRawData(const char*, int) { return false; }
-
- Document* m_document;
-};
-
-void SinkDocumentParser::finish()
-{
- if (!m_parserStopped)
- m_document->finishedParsing();
-}
-
-SinkDocument::SinkDocument(Frame* frame)
- : HTMLDocument(frame)
+SinkDocument::SinkDocument(Frame* frame, const KURL& url)
+ : HTMLDocument(frame, url)
{
setParseMode(Compat);
}
-
+
DocumentParser* SinkDocument::createParser()
{
- return new SinkDocumentParser(this);
+ // The basic RawDataDocumentParser does nothing with the data
+ // which is sufficient for our purposes here.
+ return new RawDataDocumentParser(this);
}
} // namespace WebCore
diff --git a/WebCore/loader/SinkDocument.h b/WebCore/loader/SinkDocument.h
index 386660c..61930d4 100644
--- a/WebCore/loader/SinkDocument.h
+++ b/WebCore/loader/SinkDocument.h
@@ -32,13 +32,13 @@ namespace WebCore {
class SinkDocument : public HTMLDocument {
public:
- static PassRefPtr<SinkDocument> create(Frame* frame)
+ static PassRefPtr<SinkDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new SinkDocument(frame));
+ return adoptRef(new SinkDocument(frame, url));
}
private:
- SinkDocument(Frame*);
+ SinkDocument(Frame*, const KURL&);
virtual DocumentParser* createParser();
};
diff --git a/WebCore/loader/SubframeLoader.cpp b/WebCore/loader/SubframeLoader.cpp
new file mode 100644
index 0000000..f5a4c18
--- /dev/null
+++ b/WebCore/loader/SubframeLoader.cpp
@@ -0,0 +1,352 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2008 Alp Toker <alp@atoker.com>
+ * Copyright (C) Research In Motion Limited 2009. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SubframeLoader.h"
+
+#include "Frame.h"
+#include "FrameLoaderClient.h"
+#include "HTMLAppletElement.h"
+#include "HTMLFrameElementBase.h"
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "HTMLMediaElement.h"
+#endif
+#include "HTMLNames.h"
+#include "HTMLPlugInElement.h"
+#include "MIMETypeRegistry.h"
+#include "Node.h"
+#include "Page.h"
+#include "PluginData.h"
+#include "RenderEmbeddedObject.h"
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+#include "RenderVideo.h"
+#endif
+#include "RenderView.h"
+#include "Settings.h"
+#include "XSSAuditor.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+SubframeLoader::SubframeLoader(Frame* frame)
+ : m_containsPlugins(false)
+ , m_frame(frame)
+{
+}
+
+static HTMLPlugInElement* toPlugInElement(Node* node)
+{
+ if (!node)
+ return 0;
+
+ ASSERT(node->hasTagName(objectTag) || node->hasTagName(embedTag) || node->hasTagName(appletTag));
+
+ return static_cast<HTMLPlugInElement*>(node);
+}
+
+void SubframeLoader::clear()
+{
+ m_containsPlugins = false;
+}
+
+bool SubframeLoader::requestFrame(HTMLFrameOwnerElement* ownerElement, const String& urlString, const AtomicString& frameName, bool lockHistory, bool lockBackForwardList)
+{
+ // Support for <frame src="javascript:string">
+ KURL scriptURL;
+ KURL url;
+ if (protocolIsJavaScript(urlString)) {
+ scriptURL = completeURL(urlString); // completeURL() encodes the URL.
+ url = blankURL();
+ } else
+ url = completeURL(urlString);
+
+ Frame* frame = ownerElement->contentFrame();
+ if (frame)
+ frame->redirectScheduler()->scheduleLocationChange(url.string(), m_frame->loader()->outgoingReferrer(), lockHistory, lockBackForwardList, m_frame->loader()->isProcessingUserGesture());
+ else
+ frame = loadSubframe(ownerElement, url, frameName, m_frame->loader()->outgoingReferrer());
+
+ if (!frame)
+ return false;
+
+ if (!scriptURL.isEmpty())
+ frame->script()->executeIfJavaScriptURL(scriptURL);
+
+ return true;
+}
+
+bool SubframeLoader::requestObject(RenderEmbeddedObject* renderer, const String& url, const AtomicString& frameName,
+ const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ if (url.isEmpty() && mimeType.isEmpty())
+ return false;
+
+ if (!m_frame->script()->xssAuditor()->canLoadObject(url)) {
+ // It is unsafe to honor the request for this object.
+ return false;
+ }
+
+ KURL completedURL;
+ if (!url.isEmpty())
+ completedURL = completeURL(url);
+
+ bool useFallback;
+ if (shouldUsePlugin(completedURL, mimeType, renderer->hasFallbackContent(), useFallback)) {
+ Settings* settings = m_frame->settings();
+ if ((!allowPlugins(AboutToInstantiatePlugin)
+ // Application plugins are plugins implemented by the user agent, for example Qt plugins,
+ // 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)))
+ return false;
+ if (m_frame->document() && m_frame->document()->securityOrigin()->isSandboxed(SandboxPlugins))
+ return false;
+ return loadPlugin(renderer, completedURL, mimeType, paramNames, paramValues, useFallback);
+ }
+
+ ASSERT(renderer->node()->hasTagName(objectTag) || renderer->node()->hasTagName(embedTag));
+ HTMLPlugInElement* element = static_cast<HTMLPlugInElement*>(renderer->node());
+
+ // If the plug-in element already contains a subframe, requestFrame will re-use it. Otherwise,
+ // it will create a new frame and set it as the RenderPart's widget, causing what was previously
+ // in the widget to be torn down.
+ return requestFrame(element, completedURL, frameName);
+}
+
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+PassRefPtr<Widget> FrameLoader::loadMediaPlayerProxyPlugin(Node* node, const KURL& url,
+ const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ ASSERT(node->hasTagName(videoTag) || node->hasTagName(audioTag));
+
+ if (!m_frame->script()->xssAuditor()->canLoadObject(url.string()))
+ return 0;
+
+ KURL completedURL;
+ if (!url.isEmpty())
+ completedURL = completeURL(url);
+
+ if (!SecurityOrigin::canLoad(completedURL, String(), frame()->document())) {
+ FrameLoader::reportLocalLoadFailed(m_frame, completedURL.string());
+ return 0;
+ }
+
+ HTMLMediaElement* mediaElement = static_cast<HTMLMediaElement*>(node);
+ RenderPart* renderer = toRenderPart(node->renderer());
+ IntSize size;
+
+ if (renderer)
+ size = IntSize(renderer->contentWidth(), renderer->contentHeight());
+ else if (mediaElement->isVideo())
+ size = RenderVideo::defaultSize();
+
+ m_frame->loader()->checkIfRunInsecureContent(m_frame->document()->securityOrigin(), completedURL);
+
+ RefPtr<Widget> widget = m_frame->loader()->client()->createMediaPlayerProxyPlugin(size, mediaElement, completedURL,
+ paramNames, paramValues, "application/x-media-element-proxy-plugin");
+
+ if (widget && renderer) {
+ renderer->setWidget(widget);
+ m_containsPlugIns = true;
+ renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
+ }
+
+ return widget ? widget.release() : 0;
+}
+#endif // ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+
+PassRefPtr<Widget> SubframeLoader::createJavaAppletWidget(const IntSize& size, HTMLAppletElement* element, const HashMap<String, String>& args)
+{
+ String baseURLString;
+ String codeBaseURLString;
+ Vector<String> paramNames;
+ Vector<String> paramValues;
+ HashMap<String, String>::const_iterator end = args.end();
+ for (HashMap<String, String>::const_iterator it = args.begin(); it != end; ++it) {
+ if (equalIgnoringCase(it->first, "baseurl"))
+ baseURLString = it->second;
+ else if (equalIgnoringCase(it->first, "codebase"))
+ codeBaseURLString = it->second;
+ paramNames.append(it->first);
+ paramValues.append(it->second);
+ }
+
+ if (!codeBaseURLString.isEmpty()) {
+ KURL codeBaseURL = completeURL(codeBaseURLString);
+ if (!SecurityOrigin::canLoad(codeBaseURL, String(), element->document())) {
+ FrameLoader::reportLocalLoadFailed(m_frame, codeBaseURL.string());
+ return 0;
+ }
+ }
+
+ if (baseURLString.isEmpty())
+ baseURLString = m_frame->document()->baseURL().string();
+ KURL baseURL = completeURL(baseURLString);
+
+ RefPtr<Widget> widget = m_frame->loader()->client()->createJavaAppletWidget(size, element, baseURL, paramNames, paramValues);
+ if (!widget)
+ return 0;
+
+ m_containsPlugins = true;
+ return widget;
+}
+
+Frame* SubframeLoader::loadSubframe(HTMLFrameOwnerElement* ownerElement, const KURL& url, const String& name, const String& referrer)
+{
+ bool allowsScrolling = true;
+ int marginWidth = -1;
+ int marginHeight = -1;
+ if (ownerElement->hasTagName(frameTag) || ownerElement->hasTagName(iframeTag)) {
+ HTMLFrameElementBase* o = static_cast<HTMLFrameElementBase*>(ownerElement);
+ allowsScrolling = o->scrollingMode() != ScrollbarAlwaysOff;
+ marginWidth = o->getMarginWidth();
+ marginHeight = o->getMarginHeight();
+ }
+
+ if (!SecurityOrigin::canLoad(url, referrer, 0)) {
+ FrameLoader::reportLocalLoadFailed(m_frame, url.string());
+ return 0;
+ }
+
+ bool hideReferrer = SecurityOrigin::shouldHideReferrer(url, referrer);
+ RefPtr<Frame> frame = m_frame->loader()->client()->createFrame(url, name, ownerElement, hideReferrer ? String() : referrer, allowsScrolling, marginWidth, marginHeight);
+
+ if (!frame) {
+ m_frame->loader()->checkCallImplicitClose();
+ return 0;
+ }
+
+ // All new frames will have m_isComplete set to true at this point due to synchronously loading
+ // an empty document in FrameLoader::init(). But many frames will now be starting an
+ // asynchronous load of url, so we set m_isComplete to false and then check if the load is
+ // actually completed below. (Note that we set m_isComplete to false even for synchronous
+ // loads, so that checkCompleted() below won't bail early.)
+ // FIXME: Can we remove this entirely? m_isComplete normally gets set to false when a load is committed.
+ frame->loader()->started();
+
+ RenderObject* renderer = ownerElement->renderer();
+ FrameView* view = frame->view();
+ if (renderer && renderer->isWidget() && view)
+ toRenderWidget(renderer)->setWidget(view);
+
+ m_frame->loader()->checkCallImplicitClose();
+
+ // Some loads are performed synchronously (e.g., about:blank and loads
+ // cancelled by returning a null ResourceRequest from requestFromDelegate).
+ // In these cases, the synchronous load would have finished
+ // before we could connect the signals, so make sure to send the
+ // completed() signal for the child by hand and mark the load as being
+ // complete.
+ // FIXME: In this case the Frame will have finished loading before
+ // it's being added to the child list. It would be a good idea to
+ // create the child first, then invoke the loader separately.
+ if (frame->loader()->state() == FrameStateComplete)
+ frame->loader()->checkCompleted();
+
+ return frame.get();
+}
+
+bool SubframeLoader::allowPlugins(ReasonForCallingAllowPlugins reason)
+{
+ Settings* settings = m_frame->settings();
+ bool allowed = m_frame->loader()->client()->allowPlugins(settings && settings->arePluginsEnabled());
+ if (!allowed && reason == AboutToInstantiatePlugin)
+ m_frame->loader()->client()->didNotAllowPlugins();
+ return allowed;
+}
+
+
+bool SubframeLoader::shouldUsePlugin(const KURL& url, const String& mimeType, bool hasFallback, bool& useFallback)
+{
+ if (m_frame->loader()->client()->shouldUsePluginDocument(mimeType)) {
+ useFallback = false;
+ return true;
+ }
+
+ // Allow other plug-ins to win over QuickTime because if the user has installed a plug-in that
+ // can handle TIFF (which QuickTime can also handle) they probably intended to override QT.
+ if (m_frame->page() && (mimeType == "image/tiff" || mimeType == "image/tif" || mimeType == "image/x-tiff")) {
+ const PluginData* pluginData = m_frame->page()->pluginData();
+ String pluginName = pluginData ? pluginData->pluginNameForMimeType(mimeType) : String();
+ if (!pluginName.isEmpty() && !pluginName.contains("QuickTime", false))
+ return true;
+ }
+
+ ObjectContentType objectType = m_frame->loader()->client()->objectContentType(url, mimeType);
+ // If an object's content can't be handled and it has no fallback, let
+ // it be handled as a plugin to show the broken plugin icon.
+ useFallback = objectType == ObjectContentNone && hasFallback;
+ return objectType == ObjectContentNone || objectType == ObjectContentNetscapePlugin || objectType == ObjectContentOtherPlugin;
+}
+
+bool SubframeLoader::loadPlugin(RenderEmbeddedObject* renderer, const KURL& url, const String& mimeType,
+ const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback)
+{
+ RefPtr<Widget> widget;
+
+ if (renderer && !useFallback) {
+ HTMLPlugInElement* element = toPlugInElement(renderer->node());
+
+ if (!SecurityOrigin::canLoad(url, String(), m_frame->document())) {
+ FrameLoader::reportLocalLoadFailed(m_frame, url.string());
+ return false;
+ }
+
+ m_frame->loader()->checkIfRunInsecureContent(m_frame->document()->securityOrigin(), url);
+
+ widget = m_frame->loader()->client()->createPlugin(IntSize(renderer->contentWidth(), renderer->contentHeight()),
+ element, url, paramNames, paramValues, mimeType,
+ m_frame->document()->isPluginDocument() && !m_containsPlugins);
+ if (widget) {
+ renderer->setWidget(widget);
+ m_containsPlugins = true;
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+ renderer->node()->setNeedsStyleRecalc(SyntheticStyleChange);
+#endif
+ } else
+ renderer->setShowsMissingPluginIndicator();
+ }
+
+ return widget;
+}
+
+KURL SubframeLoader::completeURL(const String& url) const
+{
+ ASSERT(m_frame->document());
+ return m_frame->document()->completeURL(url);
+}
+
+} // namespace WebCore
diff --git a/WebCore/loader/SubframeLoader.h b/WebCore/loader/SubframeLoader.h
new file mode 100644
index 0000000..4bdb787
--- /dev/null
+++ b/WebCore/loader/SubframeLoader.h
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) Research In Motion Limited 2009. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SubframeLoader_h
+#define SubframeLoader_h
+
+#include "FrameLoaderTypes.h"
+#include "PlatformString.h"
+#include <wtf/Forward.h>
+#include <wtf/HashMap.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class AtomicString;
+class Frame;
+class FrameLoaderClient;
+class HTMLAppletElement;
+class HTMLFrameOwnerElement;
+class IntSize;
+class KURL;
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+class Node;
+#endif
+class RenderEmbeddedObject;
+class Widget;
+
+// This is a slight misnomer. It handles the higher level logic of loading both subframes and plugins.
+class SubframeLoader : public Noncopyable {
+public:
+ SubframeLoader(Frame*);
+
+ void clear();
+
+ bool requestFrame(HTMLFrameOwnerElement*, const String& url, const AtomicString& frameName, bool lockHistory = true, bool lockBackForwardList = true);
+ bool requestObject(RenderEmbeddedObject*, const String& url, const AtomicString& frameName,
+ const String& serviceType, const Vector<String>& paramNames, const Vector<String>& paramValues);
+
+#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
+ PassRefPtr<Widget> loadMediaPlayerProxyPlugin(Node*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+#endif
+
+ PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const HashMap<String, String>& args);
+
+ bool allowPlugins(ReasonForCallingAllowPlugins);
+
+ bool containsPlugins() const { return m_containsPlugins; }
+
+private:
+ Frame* loadSubframe(HTMLFrameOwnerElement*, const KURL&, const String& name, const String& referrer);
+ bool loadPlugin(RenderEmbeddedObject*, const KURL&, const String& mimeType,
+ const Vector<String>& paramNames, const Vector<String>& paramValues, bool useFallback);
+
+ bool shouldUsePlugin(const KURL&, const String& mimeType, bool hasFallback, bool& useFallback);
+
+ bool m_containsPlugins;
+ Frame* m_frame;
+
+ KURL completeURL(const String&) const;
+};
+
+} // namespace WebCore
+
+#endif // SubframeLoader_h
diff --git a/WebCore/loader/SubresourceLoader.cpp b/WebCore/loader/SubresourceLoader.cpp
index 4bd3c8d..d37bb1c 100644
--- a/WebCore/loader/SubresourceLoader.cpp
+++ b/WebCore/loader/SubresourceLoader.cpp
@@ -51,7 +51,6 @@ SubresourceLoader::SubresourceLoader(Frame* frame, SubresourceLoaderClient* clie
#ifndef NDEBUG
subresourceLoaderCounter.increment();
#endif
- m_documentLoader->addSubresourceLoader(this);
}
SubresourceLoader::~SubresourceLoader()
@@ -99,6 +98,7 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc
fl->addExtraFieldsToSubresourceRequest(newRequest);
RefPtr<SubresourceLoader> subloader(adoptRef(new SubresourceLoader(frame, client, sendResourceLoadCallbacks, shouldContentSniff)));
+ subloader->documentLoader()->addSubresourceLoader(subloader.get());
if (!subloader->load(newRequest))
return 0;
diff --git a/WebCore/loader/TextDocument.cpp b/WebCore/loader/TextDocument.cpp
index 68335a7..3360aca 100644
--- a/WebCore/loader/TextDocument.cpp
+++ b/WebCore/loader/TextDocument.cpp
@@ -44,8 +44,10 @@ public:
virtual ~TextDocumentParser();
TextDocumentParser(HTMLViewSourceDocument*);
+private:
virtual void write(const SegmentedString&, bool appendData);
virtual void finish();
+ virtual bool finishWasCalled();
virtual bool isWaitingForScripts() const;
inline void checkBuffer(int len = 10)
@@ -59,9 +61,7 @@ public:
m_size = newSize;
}
}
-
-private:
- Document* m_doc;
+
Element* m_preElement;
bool m_skipLF;
@@ -71,8 +71,8 @@ private:
UChar* m_dest;
};
-TextDocumentParser::TextDocumentParser(Document* doc)
- : m_doc(doc)
+TextDocumentParser::TextDocumentParser(Document* document)
+ : DocumentParser(document)
, m_preElement(0)
, m_skipLF(false)
{
@@ -82,9 +82,8 @@ TextDocumentParser::TextDocumentParser(Document* doc)
m_dest = m_buffer;
}
-TextDocumentParser::TextDocumentParser(HTMLViewSourceDocument* doc)
- : DocumentParser(true)
- , m_doc(doc)
+TextDocumentParser::TextDocumentParser(HTMLViewSourceDocument* document)
+ : DocumentParser(document, true)
, m_preElement(0)
, m_skipLF(false)
{
@@ -132,13 +131,13 @@ void TextDocumentParser::write(const SegmentedString& s, bool)
}
if (!m_preElement && !inViewSourceMode()) {
- RefPtr<Element> rootElement = m_doc->createElement(htmlTag, false);
- m_doc->appendChild(rootElement, ec);
+ RefPtr<Element> rootElement = document()->createElement(htmlTag, false);
+ document()->appendChild(rootElement, ec);
- RefPtr<Element> body = m_doc->createElement(bodyTag, false);
+ RefPtr<Element> body = document()->createElement(bodyTag, false);
rootElement->appendChild(body, ec);
- RefPtr<Element> preElement = m_doc->createElement(preTag, false);
+ RefPtr<Element> preElement = document()->createElement(preTag, false);
preElement->setAttribute("style", "word-wrap: break-word; white-space: pre-wrap;", ec);
body->appendChild(preElement, ec);
@@ -148,14 +147,14 @@ void TextDocumentParser::write(const SegmentedString& s, bool)
String string = String(m_buffer, m_dest - m_buffer);
if (inViewSourceMode()) {
- static_cast<HTMLViewSourceDocument*>(m_doc)->addViewSourceText(string);
+ static_cast<HTMLViewSourceDocument*>(document())->addViewSourceText(string);
return;
}
unsigned charsLeft = string.length();
while (charsLeft) {
// split large text to nodes of manageable size
- RefPtr<Text> text = Text::createWithLengthLimit(m_doc, string, charsLeft);
+ RefPtr<Text> text = Text::createWithLengthLimit(document(), string, charsLeft);
m_preElement->appendChild(text, ec);
}
}
@@ -169,7 +168,14 @@ void TextDocumentParser::finish()
m_buffer = 0;
m_dest = 0;
- m_doc->finishedParsing();
+ document()->finishedParsing();
+}
+
+bool TextDocumentParser::finishWasCalled()
+{
+ // finish() always calls document()->finishedParsing() so we'll be deleted
+ // after finish().
+ return false;
}
bool TextDocumentParser::isWaitingForScripts() const
@@ -178,8 +184,8 @@ bool TextDocumentParser::isWaitingForScripts() const
return false;
}
-TextDocument::TextDocument(Frame* frame)
- : HTMLDocument(frame)
+TextDocument::TextDocument(Frame* frame, const KURL& url)
+ : HTMLDocument(frame, url)
{
}
diff --git a/WebCore/loader/TextDocument.h b/WebCore/loader/TextDocument.h
index 02c7af5..8f58b69 100644
--- a/WebCore/loader/TextDocument.h
+++ b/WebCore/loader/TextDocument.h
@@ -33,13 +33,13 @@ class HTMLViewSourceDocument;
class TextDocument : public HTMLDocument {
public:
- static PassRefPtr<TextDocument> create(Frame* frame)
+ static PassRefPtr<TextDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new TextDocument(frame));
+ return adoptRef(new TextDocument(frame, url));
}
private:
- TextDocument(Frame*);
+ TextDocument(Frame*, const KURL&);
virtual DocumentParser* createParser();
};
diff --git a/WebCore/loader/appcache/ApplicationCache.cpp b/WebCore/loader/appcache/ApplicationCache.cpp
index c0cd3ea..2ad4a4b 100644
--- a/WebCore/loader/appcache/ApplicationCache.cpp
+++ b/WebCore/loader/appcache/ApplicationCache.cpp
@@ -130,7 +130,7 @@ ApplicationCacheResource* ApplicationCache::resourceForRequest(const ResourceReq
{
// We only care about HTTP/HTTPS GET requests.
if (!requestIsHTTPOrHTTPSGet(request))
- return false;
+ return 0;
KURL url(request.url());
if (url.hasFragmentIdentifier())
diff --git a/WebCore/loader/archive/cf/LegacyWebArchive.cpp b/WebCore/loader/archive/cf/LegacyWebArchive.cpp
index 931b159..3a144c2 100644
--- a/WebCore/loader/archive/cf/LegacyWebArchive.cpp
+++ b/WebCore/loader/archive/cf/LegacyWebArchive.cpp
@@ -198,7 +198,7 @@ PassRefPtr<ArchiveResource> LegacyWebArchive::createResource(CFDictionaryRef dic
}
CFStringRef mimeType = static_cast<CFStringRef>(CFDictionaryGetValue(dictionary, LegacyWebArchiveResourceMIMETypeKey));
- if (mimeType && CFGetTypeID(mimeType) != CFStringGetTypeID()) {
+ if (!mimeType || CFGetTypeID(mimeType) != CFStringGetTypeID()) {
LOG(Archives, "LegacyWebArchive - MIME type is not of type CFString, cannot create invalid resource");
return 0;
}
diff --git a/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm b/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm
index c474bba..6a35753 100644
--- a/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm
+++ b/WebCore/loader/archive/cf/LegacyWebArchiveMac.mm
@@ -31,7 +31,7 @@
namespace WebCore {
-static const NSString *LegacyWebArchiveResourceResponseKey = @"WebResourceResponse";
+static NSString * const LegacyWebArchiveResourceResponseKey = @"WebResourceResponse";
// FIXME: If is is possible to parse in a serialized NSURLResponse manually, without using
// NSKeyedUnarchiver, manipulating plists directly, we would prefer to do that instead.
diff --git a/WebCore/manual-tests/load-deferrer-script-element.html b/WebCore/manual-tests/load-deferrer-script-element.html
new file mode 100644
index 0000000..c0ad773
--- /dev/null
+++ b/WebCore/manual-tests/load-deferrer-script-element.html
@@ -0,0 +1,44 @@
+<html>
+<head>
+<script>
+function log(message)
+{
+ document.getElementById("result").innerHTML += message + "<br>";
+}
+
+function loadJSFile(){
+ var s = document.createElement('script')
+ s.setAttribute("type", "text/javascript")
+ s.setAttribute("src", "resources/load-deferrer-script-element.js")
+
+ document.getElementsByTagName("head")[0].appendChild(s);
+}
+
+jsLoaded = false;
+runningModal = false;
+
+// This line will load external script into memory.
+loadJSFile();
+
+function runModal()
+{
+ jsLoaded = true;
+ loadJSFile();
+
+ runningModal = true;
+ alert("Scripts should not be running in the background!");
+ runningModal = false;
+}
+</script>
+</head>
+
+<body>
+
+<p>This tests the bug https://bugs.webkit.org/show_bug.cgi?id=38910.
+Click the button, wait 5 seconds and close it.
+The test passes if no error messages show up in the page!</p>
+<input id="button" type="button" value="click me" onclick="runModal()"/>
+<p id="result"></p>
+
+</body>
+</html>
diff --git a/WebCore/manual-tests/localstorage-empty-database.html b/WebCore/manual-tests/localstorage-empty-database.html
index a164127..d0fcc41 100644
--- a/WebCore/manual-tests/localstorage-empty-database.html
+++ b/WebCore/manual-tests/localstorage-empty-database.html
@@ -8,6 +8,9 @@ Since no data has been stored, no database file should have been created.</p>
<p>If you click <a href="javascript:localStorage.setItem('bar', 'baz');">here</a>, data will be stored, and a database file should be created.</p>
-<p>(This is for <a href="https://bugs.webkit.org/show_bug.cgi?id=40301">https://bugs.webkit.org/show_bug.cgi?id=40301</a>.)</p>
+<p>If you click <a href="javascript:localStorage.clear();">here</a>, the local storage will be cleared, and the database file should be gone when the browser is closed.</p>
+
+<p>(This is for <a href="https://bugs.webkit.org/show_bug.cgi?id=40301">https://bugs.webkit.org/show_bug.cgi?id=40301</a>
+and <a href="https://bugs.webkit.org/show_bug.cgi?id=40767">https://bugs.webkit.org/show_bug.cgi?id=40767</a>.)</p>
</body>
</html>
diff --git a/WebCore/manual-tests/no-listbox-rendering.html b/WebCore/manual-tests/no-listbox-rendering.html
index f4467a6..24336e0 100644
--- a/WebCore/manual-tests/no-listbox-rendering.html
+++ b/WebCore/manual-tests/no-listbox-rendering.html
@@ -22,6 +22,40 @@ At the right cell you see a description of what should be the state of the eleme
<td>combobox in previos cell should have no selected option.</td>
</tr>
<tr>
+ <td>
+ <select multiple>
+ <optgroup label="1"></optgroup>
+ <option>11</option>
+ <option>12</option>
+ <option>13</option>
+ <option>14</option>
+ <optgroup label="2"></optgroup>
+ <option>21</option>
+ <option>22</option>
+ <option>23</option>
+ <option>24</option>
+ </select>
+ </td>
+ <td>combobox in previos cell should handle optgroup correctly.</td>
+ </tr>
+ <tr>
+ <td>
+ <select>
+ <optgroup label="1"></optgroup>
+ <option>11</option>
+ <option>12</option>
+ <option>13</option>
+ <option>14</option>
+ <optgroup label="2"></optgroup>
+ <option>21</option>
+ <option>22</option>
+ <option>23</option>
+ <option>24</option>
+ </select>
+ </td>
+ <td>combobox in previos cell should handle optgroup correctly.</td>
+ </tr>
+ <tr>
<td><input type="reset"</td>
<td>after pressing this button all the combo boxes should go back to the state discribed above.</td>
</tr>
diff --git a/WebCore/manual-tests/resources/load-deferrer-script-element.js b/WebCore/manual-tests/resources/load-deferrer-script-element.js
new file mode 100644
index 0000000..fdecdb4
--- /dev/null
+++ b/WebCore/manual-tests/resources/load-deferrer-script-element.js
@@ -0,0 +1,5 @@
+if (jsLoaded) {
+ log("Button was clicked.");
+ // Use a big timeout value to ensure that error messages do not show up.
+ setTimeout(function() { if (runningModal) log("Error: This line should not show up!"); }, 3000);
+}
diff --git a/WebCore/manual-tests/xhr-failure-behind-alert.html b/WebCore/manual-tests/xhr-failure-behind-alert.html
new file mode 100644
index 0000000..23b2a83
--- /dev/null
+++ b/WebCore/manual-tests/xhr-failure-behind-alert.html
@@ -0,0 +1,10 @@
+Connecting to a server that doesn't respond.
+Run this from a local file to avoid cross-origin code path.
+
+<script>
+var req = new XMLHttpRequest;
+req.open("GET", "http://127.0.0.1:7", true);
+req.send();
+req.onerror = function() { document.write("onerror<br>"); }
+alert("PASSED if no crash or assertion failure");
+</script>
diff --git a/WebCore/mathml/MathMLElement.cpp b/WebCore/mathml/MathMLElement.cpp
index b84616f..b93ff9f 100644
--- a/WebCore/mathml/MathMLElement.cpp
+++ b/WebCore/mathml/MathMLElement.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -37,20 +38,14 @@ namespace WebCore {
using namespace MathMLNames;
MathMLElement::MathMLElement(const QualifiedName& tagName, Document* document)
- : StyledElement(tagName, document, CreateStyledElementZeroRefCount)
+ : StyledElement(tagName, document, CreateStyledElement)
{
}
PassRefPtr<MathMLElement> MathMLElement::create(const QualifiedName& tagName, Document* document)
{
- return new MathMLElement(tagName, document);
+ return adoptRef(new MathMLElement(tagName, document));
}
-
-RenderObject* MathMLElement::createRenderer(RenderArena*, RenderStyle* style)
-{
- return RenderObject::createObject(this, style);
-}
-
}
diff --git a/WebCore/mathml/MathMLElement.h b/WebCore/mathml/MathMLElement.h
index 2fa322f..46cd7fd 100644
--- a/WebCore/mathml/MathMLElement.h
+++ b/WebCore/mathml/MathMLElement.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,18 +31,16 @@
#include "StyledElement.h"
namespace WebCore {
-
+
class MathMLElement : public StyledElement {
public:
static PassRefPtr<MathMLElement> create(const QualifiedName& tagName, Document*);
-
- virtual bool isMathMLElement() const { return true; }
-
- virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-
+
protected:
MathMLElement(const QualifiedName& tagName, Document*);
-
+
+private:
+ virtual bool isMathMLElement() const { return true; }
};
}
diff --git a/WebCore/mathml/MathMLInlineContainerElement.cpp b/WebCore/mathml/MathMLInlineContainerElement.cpp
index c5fcac9..efc9f8c 100644
--- a/WebCore/mathml/MathMLInlineContainerElement.cpp
+++ b/WebCore/mathml/MathMLInlineContainerElement.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,7 +33,6 @@
#include "MathMLNames.h"
#include "RenderMathMLBlock.h"
#include "RenderMathMLFraction.h"
-#include "RenderMathMLMath.h"
#include "RenderMathMLRoot.h"
#include "RenderMathMLRow.h"
#include "RenderMathMLSquareRoot.h"
@@ -50,16 +50,14 @@ MathMLInlineContainerElement::MathMLInlineContainerElement(const QualifiedName&
PassRefPtr<MathMLInlineContainerElement> MathMLInlineContainerElement::create(const QualifiedName& tagName, Document* document)
{
- return new MathMLInlineContainerElement(tagName, document);
+ return adoptRef(new MathMLInlineContainerElement(tagName, document));
}
-RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, RenderStyle* style)
+RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena* arena, RenderStyle* style)
{
- RenderObject* object = 0;
+ RenderObject* object;
if (hasLocalName(MathMLNames::mrowTag))
object = new (arena) RenderMathMLRow(this);
- else if (hasLocalName(MathMLNames::mathTag))
- object = new (arena) RenderMathMLMath(this);
else if (hasLocalName(MathMLNames::msubTag))
object = new (arena) RenderMathMLSubSup(this);
else if (hasLocalName(MathMLNames::msupTag))
@@ -83,9 +81,7 @@ RenderObject* MathMLInlineContainerElement::createRenderer(RenderArena *arena, R
object->setStyle(style);
return object;
}
-
-
+
}
#endif // ENABLE(MATHML)
-
diff --git a/WebCore/mathml/MathMLInlineContainerElement.h b/WebCore/mathml/MathMLInlineContainerElement.h
index dc78dc4..4e80e36 100644
--- a/WebCore/mathml/MathMLInlineContainerElement.h
+++ b/WebCore/mathml/MathMLInlineContainerElement.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,11 +36,11 @@ class MathMLInlineContainerElement : public MathMLElement {
public:
static PassRefPtr<MathMLInlineContainerElement> create(const QualifiedName& tagName, Document*);
- virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-
protected:
MathMLInlineContainerElement(const QualifiedName& tagName, Document*);
+private:
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
};
}
diff --git a/WebCore/mathml/MathMLMathElement.cpp b/WebCore/mathml/MathMLMathElement.cpp
index bd3b797..1b6b18d 100644
--- a/WebCore/mathml/MathMLMathElement.cpp
+++ b/WebCore/mathml/MathMLMathElement.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,21 +30,25 @@
#include "MathMLMathElement.h"
-#include "MathMLNames.h"
-#include "RenderObject.h"
+#include "RenderMathMLMath.h"
namespace WebCore {
-
-using namespace MathMLNames;
-MathMLMathElement::MathMLMathElement(const QualifiedName& tagName, Document* document)
+inline MathMLMathElement::MathMLMathElement(const QualifiedName& tagName, Document* document)
: MathMLInlineContainerElement(tagName, document)
{
}
PassRefPtr<MathMLMathElement> MathMLMathElement::create(const QualifiedName& tagName, Document* document)
{
- return new MathMLMathElement(tagName, document);
+ return adoptRef(new MathMLMathElement(tagName, document));
+}
+
+RenderObject* MathMLMathElement::createRenderer(RenderArena* arena, RenderStyle* style)
+{
+ RenderMathMLMath* renderer = new (arena) RenderMathMLMath(this);
+ renderer->setStyle(style);
+ return renderer;
}
}
diff --git a/WebCore/mathml/MathMLMathElement.h b/WebCore/mathml/MathMLMathElement.h
index e784524..d31d548 100644
--- a/WebCore/mathml/MathMLMathElement.h
+++ b/WebCore/mathml/MathMLMathElement.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,14 +31,15 @@
#include "MathMLInlineContainerElement.h"
namespace WebCore {
-
+
class MathMLMathElement : public MathMLInlineContainerElement {
public:
static PassRefPtr<MathMLMathElement> create(const QualifiedName& tagName, Document*);
-
-protected:
+
+private:
MathMLMathElement(const QualifiedName& tagName, Document*);
-
+
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
};
}
diff --git a/WebCore/mathml/MathMLTextElement.cpp b/WebCore/mathml/MathMLTextElement.cpp
index 6f6bcbc..4135d6c 100644
--- a/WebCore/mathml/MathMLTextElement.cpp
+++ b/WebCore/mathml/MathMLTextElement.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -36,14 +37,14 @@ namespace WebCore {
using namespace MathMLNames;
-MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document* document)
+inline MathMLTextElement::MathMLTextElement(const QualifiedName& tagName, Document* document)
: MathMLElement(tagName, document)
{
}
PassRefPtr<MathMLTextElement> MathMLTextElement::create(const QualifiedName& tagName, Document* document)
{
- return new MathMLTextElement(tagName, document);
+ return adoptRef(new MathMLTextElement(tagName, document));
}
RenderObject* MathMLTextElement::createRenderer(RenderArena* arena, RenderStyle* style)
@@ -54,11 +55,9 @@ RenderObject* MathMLTextElement::createRenderer(RenderArena* arena, RenderStyle*
return object;
}
- return RenderObject::createObject(this, style);
+ return MathMLElement::createRenderer(arena, style);
}
-
}
#endif // ENABLE(MATHML)
-
diff --git a/WebCore/mathml/MathMLTextElement.h b/WebCore/mathml/MathMLTextElement.h
index e647bfa..3af93d5 100644
--- a/WebCore/mathml/MathMLTextElement.h
+++ b/WebCore/mathml/MathMLTextElement.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Alex Milowski (alex@milowski.com). All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,11 +36,10 @@ class MathMLTextElement : public MathMLElement {
public:
static PassRefPtr<MathMLTextElement> create(const QualifiedName& tagName, Document*);
- virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
-
-protected:
+private:
MathMLTextElement(const QualifiedName& tagName, Document*);
-
+
+ virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
};
}
diff --git a/WebCore/mathml/RenderMathMLBlock.cpp b/WebCore/mathml/RenderMathMLBlock.cpp
index a897ff5..ef94893 100644
--- a/WebCore/mathml/RenderMathMLBlock.cpp
+++ b/WebCore/mathml/RenderMathMLBlock.cpp
@@ -96,6 +96,12 @@ void RenderMathMLBlock::paint(PaintInfo& info, int tx, int ty)
info.context->drawLine(IntPoint(tx, ty + offsetHeight()), IntPoint(tx + offsetWidth(), ty + offsetHeight()));
info.context->drawLine(IntPoint(tx, ty), IntPoint(tx, ty + offsetHeight()));
+ int topStart = paddingTop();
+
+ info.context->setStrokeColor(Color(0, 255, 0), sRGBColorSpace);
+
+ info.context->drawLine(IntPoint(tx, ty + topStart), IntPoint(tx + offsetWidth(), ty + topStart));
+
int baseline = baselinePosition(true);
info.context->setStrokeColor(Color(255, 0, 0), sRGBColorSpace);
diff --git a/WebCore/mathml/RenderMathMLFraction.cpp b/WebCore/mathml/RenderMathMLFraction.cpp
index 3399e55..811c230 100644
--- a/WebCore/mathml/RenderMathMLFraction.cpp
+++ b/WebCore/mathml/RenderMathMLFraction.cpp
@@ -127,14 +127,6 @@ void RenderMathMLFraction::layout()
if (lastChild() && lastChild()->isRenderBlock())
m_lineThickness = m_lineThickness * ceil(gFractionBarWidth * style()->fontSize());
- if (previousSibling() && previousSibling()->isRenderBlock()) {
- RenderBlock* sibling = toRenderBlock(previousSibling());
- verticalAlignCompute(sibling);
- } else if (nextSibling() && nextSibling()->isRenderBlock()) {
- RenderBlock* sibling = toRenderBlock(nextSibling());
- verticalAlignCompute(sibling);
- }
-
RenderBlock::layout();
// The row layout can affect the numerator/denominator width.
@@ -183,21 +175,15 @@ void RenderMathMLFraction::paint(PaintInfo& info, int tx, int ty)
info.context->restore();
}
-void RenderMathMLFraction::verticalAlignCompute(RenderBlock* sibling)
-{
- if (sibling->isRenderMathMLBlock()) {
- RenderMathMLBlock* op = toRenderMathMLBlock(sibling);
- style()->setVerticalAlign(LENGTH);
- int verticalShift = static_cast<int>(ceil(gFractionAlignment * op->offsetHeight() + 0.5 * lastChild()->style()->borderTopWidth()));
- style()->setVerticalAlignLength(Length(verticalShift, Fixed));
- }
-}
-
int RenderMathMLFraction::baselinePosition(bool firstLine, bool isRootLineBox) const
{
if (firstChild()->isRenderMathMLBlock()) {
RenderMathMLBlock* numerator = toRenderMathMLBlock(firstChild());
- return numerator->offsetHeight();
+ // FIXME: the baseline should adjust so the fraction line aligns
+ // relative certain operators (e.g. aligns with the horizontal
+ // stroke of the plus). 1/3 of the current font size is just
+ // a good guess.
+ return numerator->offsetHeight() + style()->fontSize() / 3;
}
return RenderBlock::baselinePosition(firstLine, isRootLineBox);
}
diff --git a/WebCore/mathml/RenderMathMLFraction.h b/WebCore/mathml/RenderMathMLFraction.h
index 30162ac..c8c1cb8 100644
--- a/WebCore/mathml/RenderMathMLFraction.h
+++ b/WebCore/mathml/RenderMathMLFraction.h
@@ -43,7 +43,6 @@ public:
protected:
virtual void layout();
private:
- void verticalAlignCompute(RenderBlock*);
int m_lineThickness;
};
diff --git a/WebCore/mathml/RenderMathMLOperator.cpp b/WebCore/mathml/RenderMathMLOperator.cpp
index 1ab3409..911c5d2 100644
--- a/WebCore/mathml/RenderMathMLOperator.cpp
+++ b/WebCore/mathml/RenderMathMLOperator.cpp
@@ -56,11 +56,14 @@ bool RenderMathMLOperator::isChildAllowed(RenderObject*, RenderStyle*) const
return false;
}
+static const float gOperatorSpacer = 0.1;
+static const float gOperatorExpansion = 1.2;
+
void RenderMathMLOperator::stretchToHeight(int height)
{
if (height == m_stretchHeight)
return;
- m_stretchHeight = height;
+ m_stretchHeight = static_cast<int>(height * gOperatorExpansion);
updateBoxModelInfoFromStyle();
setNeedsLayoutAndPrefWidthsRecalc();
@@ -110,6 +113,7 @@ static const int gMinimumStretchHeight = 24;
static const int gGlyphHeight = 10;
static const int gMiddleGlyphTopAdjust = -2;
static const int gBottomGlyphTopAdjust = -4;
+static const float gMinimumRatioForStretch = 0.10;
void RenderMathMLOperator::updateFromElement()
{
@@ -161,15 +165,16 @@ void RenderMathMLOperator::updateFromElement()
// We only stretch character if the stretch height is larger than a minimum size (e.g. 24px).
bool shouldStretch = isStretchy && m_stretchHeight>gMinimumStretchHeight;
+ m_isCentered = true;
// Either stretch is disabled or we don't have a stretchable character over the minimum height
if (stretchDisabled || !shouldStretch) {
m_isStacked = false;
- RenderBlock* container = new (renderArena()) RenderBlock(node());
+ RenderBlock* container = new (renderArena()) RenderMathMLBlock(node());
RefPtr<RenderStyle> newStyle = RenderStyle::create();
newStyle->inheritFrom(style());
- newStyle->setDisplay(BLOCK);
+ newStyle->setDisplay(INLINE_BLOCK);
// Check for a stretchable character that is under the minimum height and use the
// font size to adjust the glyph size.
@@ -181,9 +186,20 @@ void RenderMathMLOperator::updateFromElement()
desc->setComputedSize(m_stretchHeight);
newStyle->setFontDescription(*desc);
newStyle->font().update(newStyle->font().fontSelector());
+ newStyle->setVerticalAlign(BASELINE);
+ m_isCentered = false;
+ } else {
+ int topPad = (m_stretchHeight - currentFontSize) / 2;
+
+ if (topPad / static_cast<float>(m_stretchHeight) > gMinimumRatioForStretch) {
+ newStyle->setVerticalAlign(TOP);
+ newStyle->setPaddingTop(Length(topPad, Fixed));
+ } else {
+ m_isCentered = false;
+ newStyle->setVerticalAlign(BASELINE);
+ }
}
- newStyle->setVerticalAlign(BASELINE);
container->setStyle(newStyle.release());
addChild(container);
@@ -196,7 +212,9 @@ void RenderMathMLOperator::updateFromElement()
text = new (renderArena()) RenderText(node(), StringImpl::create(mo->textContent().characters(), mo->textContent().length()));
// If we can't figure out the text, leave it blank.
if (text) {
- text->setStyle(container->style());
+ RefPtr<RenderStyle> textStyle = RenderStyle::create();
+ textStyle->inheritFrom(container->style());
+ text->setStyle(textStyle.release());
container->addChild(text);
}
} else {
@@ -296,7 +314,7 @@ RefPtr<RenderStyle> RenderMathMLOperator::createStackableStyle(int size, int top
RenderBlock* RenderMathMLOperator::createGlyph(UChar glyph, int size, int charRelative, int topRelative)
{
- RenderBlock* container = new (renderArena()) RenderBlock(node());
+ RenderBlock* container = new (renderArena()) RenderMathMLBlock(node());
container->setStyle(createStackableStyle(size, topRelative).release());
addChild(container);
RenderBlock* parent = container;
@@ -320,7 +338,11 @@ RenderBlock* RenderMathMLOperator::createGlyph(UChar glyph, int size, int charRe
int RenderMathMLOperator::baselinePosition(bool firstLine, bool isRootLineBox) const
{
- return !m_isStacked && firstChild() ? firstChild()->baselinePosition(firstLine, isRootLineBox) : offsetHeight();
+ if (m_isStacked)
+ return m_stretchHeight * 2 / 3 - (m_stretchHeight - static_cast<int>(m_stretchHeight / gOperatorExpansion)) / 2;
+ if (m_isCentered && firstChild())
+ return firstChild()->baselinePosition(firstLine, isRootLineBox);
+ return RenderBlock::baselinePosition(firstLine, isRootLineBox);
}
}
diff --git a/WebCore/mathml/RenderMathMLOperator.h b/WebCore/mathml/RenderMathMLOperator.h
index 6566dd7..cc183c3 100644
--- a/WebCore/mathml/RenderMathMLOperator.h
+++ b/WebCore/mathml/RenderMathMLOperator.h
@@ -50,6 +50,7 @@ protected:
private:
int m_stretchHeight;
bool m_isStacked;
+ bool m_isCentered;
UChar m_operator;
};
diff --git a/WebCore/mathml/RenderMathMLRoot.cpp b/WebCore/mathml/RenderMathMLRoot.cpp
index 23e3519..c624539 100644
--- a/WebCore/mathml/RenderMathMLRoot.cpp
+++ b/WebCore/mathml/RenderMathMLRoot.cpp
@@ -97,6 +97,9 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty)
{
RenderMathMLBlock::paint(info , tx , ty);
+ if (info.context->paintingDisabled())
+ return;
+
tx += x();
ty += y();
@@ -145,7 +148,7 @@ void RenderMathMLRoot::paint(PaintInfo& info, int tx, int ty)
info.context->setStrokeThickness(gRadicalLineThickness * style()->fontSize());
info.context->setStrokeStyle(SolidStroke);
- info.context->setStrokeColor(style()->color(), sRGBColorSpace);
+ info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), sRGBColorSpace);
info.context->setLineJoin(MiterJoin);
info.context->setMiterLimit(style()->fontSize());
@@ -204,8 +207,7 @@ void RenderMathMLRoot::layout()
int maxHeight = toRenderBoxModelObject(lastChild())->offsetHeight();
RenderObject* current = lastChild()->firstChild();
-
- toRenderMathMLBlock(current)->style()->setVerticalAlign(BASELINE);
+ current->style()->setVerticalAlign(BASELINE);
if (!maxHeight)
maxHeight = style()->fontSize();
@@ -238,9 +240,11 @@ void RenderMathMLRoot::layout()
setNeedsLayoutAndPrefWidthsRecalc();
markContainingBlocksForLayout();
RenderBlock::layout();
-
+
indexBox->style()->setBottom(Length(radicalHeight + style()->paddingBottom().value(), Fixed));
-
+
+ // Now that we've potentially changed its position, we need layout the index again.
+ indexBox->setNeedsLayoutAndPrefWidthsRecalc();
indexBox->layout();
}
diff --git a/WebCore/mathml/RenderMathMLRow.cpp b/WebCore/mathml/RenderMathMLRow.cpp
index 1bb656f..acbfb9d 100644
--- a/WebCore/mathml/RenderMathMLRow.cpp
+++ b/WebCore/mathml/RenderMathMLRow.cpp
@@ -69,9 +69,6 @@ void RenderMathMLRow::layout()
// Calculate the maximum height of the row without the operators.
int maxHeight = nonOperatorHeight();
- // Set the maximum height of the row for intermediate layouts.
- style()->setHeight(Length(maxHeight, Fixed));
-
// Notify contained operators they may need to re-layout their stretched operators.
// We need to keep track of the number of children and operators because a row of
// operators needs some special handling.
@@ -141,16 +138,24 @@ void RenderMathMLRow::layout()
maxHeight = box->offsetHeight();
}
}
-
- // Set the maximum height of the row based on the calculations.
- style()->setHeight(Length(maxHeight, Fixed));
- // Do the final layout by calling our parent's layout again.
+ // Mark outself as needing layout and do the final layout of the row.
setNeedsLayoutAndPrefWidthsRecalc();
markContainingBlocksForLayout();
RenderBlock::layout();
-}
+}
+int RenderMathMLRow::baselinePosition(bool firstLine, bool isRootLineBox) const
+{
+ if (firstChild() && firstChild()->isRenderMathMLBlock()) {
+ RenderMathMLBlock* block = toRenderMathMLBlock(firstChild());
+ if (block->isRenderMathMLOperator())
+ return block->baselinePosition(firstLine, isRootLineBox);
+ }
+
+ return RenderBlock::baselinePosition(firstLine, isRootLineBox);
+}
+
}
#endif // ENABLE(MATHML)
diff --git a/WebCore/mathml/RenderMathMLRow.h b/WebCore/mathml/RenderMathMLRow.h
index a88b212..83c6832 100644
--- a/WebCore/mathml/RenderMathMLRow.h
+++ b/WebCore/mathml/RenderMathMLRow.h
@@ -37,6 +37,7 @@ public:
RenderMathMLRow(Node* container);
virtual bool isRenderMathMLRow() const { return true; }
virtual int nonOperatorHeight() const;
+ virtual int baselinePosition(bool , bool) const;
protected:
virtual void layout();
};
diff --git a/WebCore/mathml/RenderMathMLSquareRoot.cpp b/WebCore/mathml/RenderMathMLSquareRoot.cpp
index fc0a16d..6802176 100644
--- a/WebCore/mathml/RenderMathMLSquareRoot.cpp
+++ b/WebCore/mathml/RenderMathMLSquareRoot.cpp
@@ -69,6 +69,9 @@ void RenderMathMLSquareRoot::paint(PaintInfo& info, int tx, int ty)
{
RenderMathMLBlock::paint(info, tx, ty);
+ if (info.context->paintingDisabled())
+ return;
+
tx += x();
ty += y();
@@ -114,7 +117,7 @@ void RenderMathMLSquareRoot::paint(PaintInfo& info, int tx, int ty)
info.context->setStrokeThickness(gRadicalLineThickness * style()->fontSize());
info.context->setStrokeStyle(SolidStroke);
- info.context->setStrokeColor(style()->color(), sRGBColorSpace);
+ info.context->setStrokeColor(style()->visitedDependentColor(CSSPropertyColor), sRGBColorSpace);
info.context->setLineJoin(MiterJoin);
info.context->setMiterLimit(style()->fontSize());
diff --git a/WebCore/mathml/RenderMathMLSubSup.cpp b/WebCore/mathml/RenderMathMLSubSup.cpp
index 3124ac9..af25980 100644
--- a/WebCore/mathml/RenderMathMLSubSup.cpp
+++ b/WebCore/mathml/RenderMathMLSubSup.cpp
@@ -72,7 +72,7 @@ void RenderMathMLSubSup::addChild(RenderObject* child, RenderObject* beforeChild
RefPtr<RenderStyle> scriptsStyle = RenderStyle::create();
scriptsStyle->inheritFrom(style());
scriptsStyle->setDisplay(INLINE_BLOCK);
- scriptsStyle->setVerticalAlign(MIDDLE);
+ scriptsStyle->setVerticalAlign(TOP);
scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed));
scriptsStyle->setTextAlign(LEFT);
m_scripts->setStyle(scriptsStyle.release());
@@ -95,7 +95,7 @@ void RenderMathMLSubSup::addChild(RenderObject* child, RenderObject* beforeChild
RefPtr<RenderStyle> wrapperStyle = RenderStyle::create();
wrapperStyle->inheritFrom(style());
wrapperStyle->setDisplay(INLINE_BLOCK);
- wrapperStyle->setVerticalAlign(MIDDLE);
+ wrapperStyle->setVerticalAlign(TOP);
wrapper->setStyle(wrapperStyle.release());
RenderMathMLBlock::addChild(wrapper, beforeChild);
wrapper->addChild(child);
@@ -141,21 +141,32 @@ int RenderMathMLSubSup::nonOperatorHeight() const
void RenderMathMLSubSup::layout()
{
+ if (firstChild()) {
+ firstChild()->setNeedsLayoutAndPrefWidthsRecalc();
+ firstChild()->markContainingBlocksForLayout();
+ }
+ if (m_scripts) {
+ m_scripts->setNeedsLayoutAndPrefWidthsRecalc();
+ m_scripts->markContainingBlocksForLayout();
+ }
RenderBlock::layout();
if (m_kind == SubSup) {
- int width = 0;
- RenderObject* current = firstChild();
- while (current) {
- width += getBoxModelObjectWidth(current);
- current = current->nextSibling();
+ RenderObject* base = firstChild();
+ if (base) {
+ int maxHeight = 0;
+ RenderObject* current = base->firstChild();
+ while (current) {
+ int height = getBoxModelObjectHeight(current);
+ if (height > maxHeight)
+ maxHeight = height;
+ current = current->nextSibling();
+ }
+ int heightDiff = (m_scripts->offsetHeight() - maxHeight) / 2;
+ if (heightDiff < 0)
+ heightDiff = 0;
+ base->style()->setMarginTop(Length(heightDiff, Fixed));
}
- width++;
- // 1 + margin of scripts
- if (m_scripts)
- width += gSubsupScriptMargin;
- style()->setWidth(Length(width, Fixed));
-
setNeedsLayoutAndPrefWidthsRecalc();
markContainingBlocksForLayout();
RenderBlock::layout();
@@ -181,7 +192,10 @@ int RenderMathMLSubSup::baselinePosition(bool firstLine, bool isRootLineBox) con
RenderBoxModelObject* box = toRenderBoxModelObject(base);
topAdjust = (m_scripts->offsetHeight() - box->offsetHeight()) / 2;
}
- return topAdjust + (base ? base->baselinePosition(firstLine, isRootLineBox) : 0) + 4;
+ // FIXME: The last bit of this calculation should be more exact. Why is the 2-3px scaled for zoom necessary?
+ // The baseline is top spacing of the base + the baseline of the base + adjusted space for zoom
+ float zoomFactor = style()->effectiveZoom();
+ return topAdjust + base->baselinePosition(firstLine, isRootLineBox) + static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
}
break;
case Sup:
diff --git a/WebCore/mathml/RenderMathMLUnderOver.cpp b/WebCore/mathml/RenderMathMLUnderOver.cpp
index 514b872..ad32d59 100644
--- a/WebCore/mathml/RenderMathMLUnderOver.cpp
+++ b/WebCore/mathml/RenderMathMLUnderOver.cpp
@@ -234,7 +234,7 @@ void RenderMathMLUnderOver::layout()
RenderBlock::layout();
}
-int RenderMathMLUnderOver::baselinePosition(bool, bool) const
+int RenderMathMLUnderOver::baselinePosition(bool firstLine, bool isRootLineBox) const
{
int baseline = 0;
RenderObject* current = 0;
@@ -247,9 +247,12 @@ int RenderMathMLUnderOver::baselinePosition(bool, bool) const
if (current) {
// actual base
RenderObject* base = current->firstChild();
- baseline += base->baselinePosition(true);
+ baseline += base->baselinePosition(firstLine, isRootLineBox);
// added the negative top margin
baseline += current->style()->marginTop().value();
+ // FIXME: Where is the extra 2-3px adjusted for zoom coming from?
+ float zoomFactor = style()->effectiveZoom();
+ baseline += static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
}
break;
case Under:
@@ -257,6 +260,9 @@ int RenderMathMLUnderOver::baselinePosition(bool, bool) const
if (current) {
RenderObject* base = current->firstChild();
baseline += base->baselinePosition(true);
+ // FIXME: Where is the extra 2-3px adjusted for zoom coming from?
+ float zoomFactor = style()->effectiveZoom();
+ baseline += static_cast<int>((zoomFactor > 1.25 ? 2 : 3) * zoomFactor);
}
}
return baseline;
diff --git a/WebCore/notifications/Notification.cpp b/WebCore/notifications/Notification.cpp
index 5908634..3684245 100644
--- a/WebCore/notifications/Notification.cpp
+++ b/WebCore/notifications/Notification.cpp
@@ -90,8 +90,6 @@ Notification::~Notification()
ASSERT_NOT_REACHED();
cancel();
}
- if (m_presenter)
- m_presenter->notificationObjectDestroyed(this);
}
void Notification::show()
@@ -140,6 +138,12 @@ EventTargetData* Notification::ensureEventTargetData()
return &m_eventTargetData;
}
+void Notification::contextDestroyed()
+{
+ ActiveDOMObject::contextDestroyed();
+ if (m_presenter)
+ m_presenter->notificationObjectDestroyed(this);
+}
void Notification::startLoading()
{
diff --git a/WebCore/notifications/Notification.h b/WebCore/notifications/Notification.h
index 0e66b3d..20a319b 100644
--- a/WebCore/notifications/Notification.h
+++ b/WebCore/notifications/Notification.h
@@ -44,6 +44,7 @@
#include "NotificationContents.h"
#include "RegisteredEventListener.h"
#include "SharedBuffer.h"
+#include "TextDirection.h"
#include "ThreadableLoader.h"
#include "ThreadableLoaderClient.h"
#include <wtf/OwnPtr.h>
@@ -76,6 +77,8 @@ namespace WebCore {
String replaceId() const { return m_replaceId; }
void setReplaceId(const String& replaceId) { m_replaceId = replaceId; }
+ TextDirection direction() const { return dir() == "rtl" ? RTL : LTR; }
+
DEFINE_ATTRIBUTE_EVENT_LISTENER(display);
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
@@ -87,6 +90,9 @@ namespace WebCore {
virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
virtual Notification* toNotification() { return this; }
+ // ActiveDOMObject interface
+ virtual void contextDestroyed();
+
void stopLoading();
SharedBuffer* iconData() { return m_iconData.get(); }
diff --git a/WebCore/notifications/NotificationCenter.h b/WebCore/notifications/NotificationCenter.h
index b72e07d..ce20630 100644
--- a/WebCore/notifications/NotificationCenter.h
+++ b/WebCore/notifications/NotificationCenter.h
@@ -33,6 +33,7 @@
#include "Notification.h"
#include "NotificationContents.h"
+#include "ScriptExecutionContext.h"
#include "WorkerThread.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -43,8 +44,6 @@
namespace WebCore {
- class ScriptExecutionContext;
-
class NotificationCenter : public RefCounted<NotificationCenter>, public ActiveDOMObject {
public:
static PassRefPtr<NotificationCenter> create(ScriptExecutionContext* context, NotificationPresenter* presenter) { return adoptRef(new NotificationCenter(context, presenter)); }
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 413dba1..40b7494 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "DOMWindow.h"
+#include "AbstractDatabase.h"
#include "Base64.h"
#include "BarInfo.h"
#include "BeforeUnloadEvent.h"
@@ -229,7 +230,7 @@ bool DOMWindow::dispatchAllPendingBeforeUnloadEvents()
if (!frame)
continue;
- if (!frame->shouldClose())
+ if (!frame->loader()->shouldClose())
return false;
}
@@ -756,7 +757,18 @@ void DOMWindow::focus()
if (!m_frame)
return;
- m_frame->focusWindow();
+ Page* page = m_frame->page();
+ if (!page)
+ return;
+
+ // If we're a top level window, bring the window to the front.
+ if (m_frame == page->mainFrame())
+ page->chrome()->focus();
+
+ if (!m_frame)
+ return;
+
+ m_frame->eventHandler()->focusDocumentView();
}
void DOMWindow::blur()
@@ -764,7 +776,14 @@ void DOMWindow::blur()
if (!m_frame)
return;
- m_frame->unfocusWindow();
+ Page* page = m_frame->page();
+ if (!page)
+ return;
+
+ if (m_frame != page->mainFrame())
+ return;
+
+ page->chrome()->unfocus();
}
void DOMWindow::close()
@@ -782,8 +801,13 @@ void DOMWindow::close()
Settings* settings = m_frame->settings();
bool allowScriptsToCloseWindows = settings && settings->allowScriptsToCloseWindows();
- if (page->openedByDOM() || page->getHistoryLength() <= 1 || allowScriptsToCloseWindows)
- m_frame->scheduleClose();
+ if (!(page->openedByDOM() || page->getHistoryLength() <= 1 || allowScriptsToCloseWindows))
+ return;
+
+ if (!m_frame->loader()->shouldClose())
+ return;
+
+ page->chrome()->closeWindowSoon();
}
void DOMWindow::print()
@@ -1064,36 +1088,34 @@ void DOMWindow::setName(const String& string)
m_frame->tree()->setName(string);
}
-String DOMWindow::status() const
+void DOMWindow::setStatus(const String& string)
{
- if (!m_frame)
- return String();
+ m_status = string;
- return m_frame->jsStatusBarText();
-}
+ if (!m_frame)
+ return;
-void DOMWindow::setStatus(const String& string)
-{
- if (!m_frame)
- return;
+ Page* page = m_frame->page();
+ if (!page)
+ return;
- m_frame->setJSStatusBarText(string);
+ ASSERT(m_frame->document()); // Client calls shouldn't be made when the frame is in inconsistent state.
+ page->chrome()->setStatusbarText(m_frame, m_status);
}
-String DOMWindow::defaultStatus() const
+void DOMWindow::setDefaultStatus(const String& string)
{
- if (!m_frame)
- return String();
+ m_defaultStatus = string;
- return m_frame->jsDefaultStatusBarText();
-}
+ if (!m_frame)
+ return;
-void DOMWindow::setDefaultStatus(const String& string)
-{
- if (!m_frame)
- return;
+ Page* page = m_frame->page();
+ if (!page)
+ return;
- m_frame->setJSDefaultStatusBarText(string);
+ ASSERT(m_frame->document()); // Client calls shouldn't be made when the frame is in inconsistent state.
+ page->chrome()->setStatusbarText(m_frame, m_defaultStatus);
}
DOMWindow* DOMWindow::self() const
@@ -1219,7 +1241,7 @@ double DOMWindow::devicePixelRatio() const
PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
{
RefPtr<Database> database = 0;
- if (m_frame && Database::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase())
+ 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)
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index a1f40a8..4765b31 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -410,8 +410,21 @@ namespace WebCore {
#endif
EventTargetData m_eventTargetData;
+
+ String m_status;
+ String m_defaultStatus;
};
+ inline String DOMWindow::status() const
+ {
+ return m_status;
+ }
+
+ inline String DOMWindow::defaultStatus() const
+ {
+ return m_defaultStatus;
+ }
+
} // namespace WebCore
#endif // DOMWindow_h
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index bf1d55d..5b1000a 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -54,7 +54,7 @@ module window {
attribute [Replaceable] BarInfo toolbar;
attribute [Replaceable] Navigator navigator;
attribute [Replaceable] Navigator clientInformation;
- attribute [DoNotCheckDomainSecurity, JSCCustom, V8CustomSetter, V8DisallowShadowing] Location location;
+ attribute [DoNotCheckDomainSecurity, JSCCustom, V8CustomSetter, V8DisallowShadowing, CPPCustom] Location location;
attribute [Replaceable, CustomGetter, V8CustomSetter] Event event;
@@ -730,6 +730,10 @@ module window {
#endif
#endif
+#if defined(ENABLE_DATABASE)
+ attribute SQLExceptionConstructor SQLException;
+#endif
+
attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent;
attribute DOMFormDataConstructor FormData;
@@ -737,6 +741,8 @@ module window {
attribute [Conditional=FILE_READER|FILE_WRITER] FileErrorConstructor FileError;
attribute [Conditional=FILE_READER] FileReaderConstructor FileReader;
+ attribute BlobBuilderConstructor BlobBuilder;
+
#endif // defined(LANGUAGE_JAVASCRIPT)
#if defined(V8_BINDING) && V8_BINDING
diff --git a/WebCore/page/EditorClient.h b/WebCore/page/EditorClient.h
index cdf0bd8..69f48e7 100644
--- a/WebCore/page/EditorClient.h
+++ b/WebCore/page/EditorClient.h
@@ -34,11 +34,18 @@
#include <wtf/Vector.h>
#if PLATFORM(MAC)
+#ifdef __OBJC__
+@class NSArray;
+@class NSData;
+@class NSString;
+@class NSURL;
+#else
class NSArray;
class NSData;
class NSString;
class NSURL;
#endif
+#endif
namespace WebCore {
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index 5fde80e..c28b1a5 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -1014,6 +1014,9 @@ bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity g
bool EventHandler::scrollRecursively(ScrollDirection direction, ScrollGranularity granularity, Node* startingNode)
{
+ // The layout needs to be up to date to determine if we can scroll. We may be
+ // here because of an onLoad event, in which case the final layout hasn't been performed yet.
+ m_frame->document()->updateLayoutIgnorePendingStylesheets();
bool handled = scrollOverflow(direction, granularity, startingNode);
if (!handled) {
Frame* frame = m_frame;
diff --git a/WebCore/page/EventSource.idl b/WebCore/page/EventSource.idl
index be01098..9da7017 100644
--- a/WebCore/page/EventSource.idl
+++ b/WebCore/page/EventSource.idl
@@ -1,6 +1,6 @@
/*
- * Copyright (C) 2009 Ericsson AB
- * All rights reserved.
+ * Copyright (C) 2009 Ericsson AB. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -33,7 +33,10 @@ module window {
interface [
Conditional=EVENTSOURCE,
- CustomConstructor,
+ CanBeConstructed,
+ CustomConstructFunction,
+ ConstructorParameters=1,
+ V8CustomConstructor,
EventTarget,
NoStaticTables
] EventSource {
diff --git a/WebCore/page/FocusController.cpp b/WebCore/page/FocusController.cpp
index 804341d..e9f180b 100644
--- a/WebCore/page/FocusController.cpp
+++ b/WebCore/page/FocusController.cpp
@@ -319,7 +319,7 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa
// if |node| element is not in the viewport.
if (hasOffscreenRect(node)) {
Frame* frame = node->document()->view()->frame();
- scrollInDirection(frame, direction);
+ scrollInDirection(frame, direction, focusCandidate);
return true;
}
@@ -341,103 +341,152 @@ bool FocusController::advanceFocusDirectionally(FocusDirection direction, Keyboa
return true;
}
-// FIXME: Make this method more modular, and simpler to understand and maintain.
-static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate& candidate, FocusCandidate& closest)
+static void updateFocusCandidateInSameContainer(const FocusCandidate& candidate, FocusCandidate& closest)
{
- bool sameDocument = candidate.document() == closest.document();
- if (sameDocument) {
- if (closest.alignment > candidate.alignment
- || (closest.parentAlignment && candidate.alignment > closest.parentAlignment))
- return;
- } else if (closest.alignment > candidate.alignment
- && (closest.parentAlignment && candidate.alignment > closest.parentAlignment))
+ if (closest.isNull()) {
+ closest = candidate;
return;
+ }
- if (candidate.alignment != None
- || (closest.parentAlignment >= candidate.alignment
- && closest.document() == candidate.document())) {
+ if (candidate.alignment == closest.alignment) {
+ if (candidate.distance < closest.distance)
+ closest = candidate;
+ return;
+ }
+
+ if (candidate.alignment > closest.alignment)
+ closest = candidate;
+}
- // If we are now in an higher precedent case, lets reset the current closest's
- // distance so we force it to be bigger than any result we will get from
- // spatialDistance().
- if (closest.alignment < candidate.alignment
- && closest.parentAlignment < candidate.alignment)
- closest.distance = maxDistance();
+static void updateFocusCandidateIfCloser(Node* focusedNode, const FocusCandidate& candidate, FocusCandidate& closest)
+{
+ // First, check the common case: neither candidate nor closest are
+ // inside scrollable content, then no need to care about enclosingScrollableBox
+ // heuristics or parent{Distance,Alignment}, but only distance and alignment.
+ if (!candidate.inScrollableContainer() && !closest.inScrollableContainer()) {
+ updateFocusCandidateInSameContainer(candidate, closest);
+ return;
}
- // Bail out if candidate's distance is larger than that of the closest candidate.
- if (candidate.distance >= closest.distance)
+ bool sameContainer = candidate.document() == closest.document() && candidate.enclosingScrollableBox == closest.enclosingScrollableBox;
+
+ // Second, if candidate and closest are in the same "container" (i.e. {i}frame or any
+ // scrollable block element), we can handle them as common case.
+ if (sameContainer) {
+ updateFocusCandidateInSameContainer(candidate, closest);
return;
+ }
- if (closest.isNull()) {
+ // Last, we are considering moving to a candidate located in a different enclosing
+ // scrollable box than closest.
+ bool isInInnerDocument = !isInRootDocument(focusedNode);
+
+ bool sameContainerAsCandidate = isInInnerDocument ? focusedNode->document() == candidate.document() :
+ focusedNode->isDescendantOf(candidate.enclosingScrollableBox);
+
+ bool sameContainerAsClosest = isInInnerDocument ? focusedNode->document() == closest.document() :
+ focusedNode->isDescendantOf(closest.enclosingScrollableBox);
+
+ // sameContainerAsCandidate and sameContainerAsClosest are mutually exclusive.
+ ASSERT(!(sameContainerAsCandidate && sameContainerAsClosest));
+
+ if (sameContainerAsCandidate) {
closest = candidate;
return;
}
- // If the focused node and the candadate are in the same document and current
- // closest candidate is not in an {i}frame that is preferable to get focused ...
- if (focusedNode->document() == candidate.document()
- && candidate.distance < closest.parentDistance)
- closest = candidate;
- else if (focusedNode->document() != candidate.document()) {
- // If the focusedNode is in an inner document and candidate is in a
- // different document, we only consider to change focus if there is not
- // another already good focusable candidate in the same document as focusedNode.
- if (!((isInRootDocument(candidate.node) && !isInRootDocument(focusedNode))
- && focusedNode->document() == closest.document()))
+ if (sameContainerAsClosest) {
+ // Nothing to be done.
+ return;
+ }
+
+ // NOTE: !sameContainerAsCandidate && !sameContainerAsClosest
+ // If distance is shorter, and we are talking about scrollable container,
+ // lets compare parent distance and alignment before anything.
+ if (candidate.distance < closest.distance) {
+ if (candidate.alignment >= closest.parentAlignment
+ || candidate.parentAlignment == closest.parentAlignment) {
+ closest = candidate;
+ return;
+ }
+
+ } else if (candidate.parentDistance < closest.distance) {
+ if (candidate.parentAlignment >= closest.alignment) {
closest = candidate;
+ return;
+ }
}
}
void FocusController::findFocusableNodeInDirection(Node* outer, Node* focusedNode,
FocusDirection direction, KeyboardEvent* event,
- FocusCandidate& closestFocusCandidate,
- const FocusCandidate& candidateParent)
+ FocusCandidate& closest, const FocusCandidate& candidateParent)
{
ASSERT(outer);
ASSERT(candidateParent.isNull()
|| candidateParent.node->hasTagName(frameTag)
- || candidateParent.node->hasTagName(iframeTag));
+ || candidateParent.node->hasTagName(iframeTag)
+ || isScrollableContainerNode(candidateParent.node));
+
+ // Walk all the child nodes and update closest if we find a nearer node.
+ Node* node = outer;
+ while (node) {
- // Walk all the child nodes and update closestFocusCandidate if we find a nearer node.
- Node* candidate = outer;
- while (candidate) {
// Inner documents case.
+ if (node->isFrameOwnerElement()) {
+ deepFindFocusableNodeInDirection(node, focusedNode, direction, event, closest);
+
+ // Scrollable block elements (e.g. <div>, etc) case.
+ } else if (isScrollableContainerNode(node)) {
+ deepFindFocusableNodeInDirection(node, focusedNode, direction, event, closest);
+ node = node->traverseNextSibling();
+ continue;
+
+ } else if (node != focusedNode && node->isKeyboardFocusable(event)) {
+ FocusCandidate candidate(node);
+
+ // There are two ways to identify we are in a recursive call from deepFindFocusableNodeInDirection
+ // (i.e. processing an element in an iframe, frame or a scrollable block element):
+
+ // 1) If candidateParent is not null, and it holds the distance and alignment data of the
+ // parent container element itself;
+ // 2) Parent of outer is <frame> or <iframe>;
+ // 3) Parent is any other scrollable block element.
+ if (!candidateParent.isNull()) {
+ candidate.parentAlignment = candidateParent.alignment;
+ candidate.parentDistance = candidateParent.distance;
+ candidate.enclosingScrollableBox = candidateParent.node;
+
+ } else if (!isInRootDocument(outer)) {
+ if (Document* document = static_cast<Document*>(outer->parent()))
+ candidate.enclosingScrollableBox = static_cast<Node*>(document->ownerElement());
- if (candidate->isFrameOwnerElement())
- deepFindFocusableNodeInDirection(candidate, focusedNode, direction, event, closestFocusCandidate);
- else if (candidate != focusedNode && candidate->isKeyboardFocusable(event)) {
- FocusCandidate currentFocusCandidate(candidate);
+ } else if (isScrollableContainerNode(outer->parent()))
+ candidate.enclosingScrollableBox = outer->parent();
// Get distance and alignment from current candidate.
- distanceDataForNode(direction, focusedNode, currentFocusCandidate);
+ distanceDataForNode(direction, focusedNode, candidate);
// Bail out if distance is maximum.
- if (currentFocusCandidate.distance == maxDistance()) {
- candidate = candidate->traverseNextNode(outer->parent());
+ if (candidate.distance == maxDistance()) {
+ node = node->traverseNextNode(outer->parent());
continue;
}
- // If candidateParent is not null, it means that we are in a recursive call
- // from deepFineFocusableNodeInDirection (i.e. processing an element in an iframe),
- // and holds the distance and alignment data of the iframe element itself.
- if (!candidateParent.isNull()) {
- currentFocusCandidate.parentAlignment = candidateParent.alignment;
- currentFocusCandidate.parentDistance = candidateParent.distance;
- }
-
- updateFocusCandidateIfCloser(focusedNode, currentFocusCandidate, closestFocusCandidate);
+ updateFocusCandidateIfCloser(focusedNode, candidate, closest);
}
- candidate = candidate->traverseNextNode(outer->parent());
+ node = node->traverseNextNode(outer->parent());
}
}
void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* focusedNode,
FocusDirection direction, KeyboardEvent* event,
- FocusCandidate& closestFocusCandidate)
+ FocusCandidate& closest)
{
- ASSERT(container->hasTagName(frameTag) || container->hasTagName(iframeTag));
+ ASSERT(container->hasTagName(frameTag)
+ || container->hasTagName(iframeTag)
+ || isScrollableContainerNode(container));
// Track if focusedNode is a descendant of the current container node being processed.
bool descendantOfContainer = false;
@@ -457,10 +506,15 @@ void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* fo
descendantOfContainer = innerDocument == focusedNode->document();
firstChild = innerDocument->firstChild();
+ // Scrollable block elements (e.g. <div>, etc)
+ } else if (isScrollableContainerNode(container)) {
+
+ firstChild = container->firstChild();
+ descendantOfContainer = focusedNode->isDescendantOf(container);
}
if (descendantOfContainer) {
- findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closestFocusCandidate);
+ findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closest);
return;
}
@@ -474,8 +528,8 @@ void FocusController::deepFindFocusableNodeInDirection(Node* container, Node* fo
return;
// FIXME: Consider alignment?
- if (candidateParent.distance < closestFocusCandidate.distance)
- findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closestFocusCandidate, candidateParent);
+ if (candidateParent.distance < closest.distance)
+ findFocusableNodeInDirection(firstChild, focusedNode, direction, event, closest, candidateParent);
}
static bool relinquishesEditingFocus(Node *node)
@@ -540,20 +594,23 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra
// FIXME: Might want to disable this check for caretBrowsing
if (oldFocusedNode && oldFocusedNode->rootEditableElement() == oldFocusedNode && !relinquishesEditingFocus(oldFocusedNode))
return false;
-
+
+ // Set input method state before changing the focused node, so that the
+ // input method can still have a chance to finish the ongoing composition
+ // session.
+ m_page->editorClient()->setInputMethodState(node ? node->shouldUseInputMethod() : false);
+
clearSelectionIfNeeded(oldFocusedFrame.get(), newFocusedFrame.get(), node);
-
+
if (!node) {
if (oldDocument)
oldDocument->setFocusedNode(0);
- m_page->editorClient()->setInputMethodState(false);
return true;
}
RefPtr<Document> newDocument = node->document();
if (newDocument && newDocument->focusedNode() == node) {
- m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod());
return true;
}
@@ -565,8 +622,6 @@ bool FocusController::setFocusedNode(Node* node, PassRefPtr<Frame> newFocusedFra
if (newDocument)
newDocument->setFocusedNode(node);
- m_page->editorClient()->setInputMethodState(node->shouldUseInputMethod());
-
return true;
}
diff --git a/WebCore/page/Frame.cpp b/WebCore/page/Frame.cpp
index fb658d2..75a4598 100644
--- a/WebCore/page/Frame.cpp
+++ b/WebCore/page/Frame.cpp
@@ -135,7 +135,7 @@ static inline Frame* parentFromOwnerElement(HTMLFrameOwnerElement* ownerElement)
return ownerElement->document()->frame();
}
-Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient)
+inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* frameLoaderClient)
: m_page(page)
, m_treeNode(this, parentFromOwnerElement(ownerElement))
, m_loader(this, frameLoaderClient)
@@ -178,16 +178,17 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient*
XMLNames::init();
if (!ownerElement) {
- page->setMainFrame(this);
#if ENABLE(TILED_BACKING_STORE)
// Top level frame only for now.
setTiledBackingStoreEnabled(page->settings()->tiledBackingStoreEnabled());
#endif
} else {
page->incrementFrameCount();
+
// Make sure we will not end up with two frames referencing the same owner element.
- ASSERT((!(ownerElement->m_contentFrame)) || (ownerElement->m_contentFrame->ownerElement() != ownerElement));
- ownerElement->m_contentFrame = this;
+ Frame*& contentFrameSlot = ownerElement->m_contentFrame;
+ ASSERT(!contentFrameSlot || contentFrameSlot->ownerElement() != ownerElement);
+ contentFrameSlot = this;
}
#ifndef NDEBUG
@@ -195,6 +196,14 @@ Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient*
#endif
}
+PassRefPtr<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
+{
+ RefPtr<Frame> frame = adoptRef(new Frame(page, ownerElement, client));
+ if (!ownerElement)
+ page->setMainFrame(frame);
+ return frame.release();
+}
+
Frame::~Frame()
{
setView(0);
@@ -624,22 +633,6 @@ void Frame::setPrinting(bool printing, float minPageWidth, float maxPageWidth, b
child->setPrinting(printing, minPageWidth, maxPageWidth, adjustViewSize);
}
-void Frame::setJSStatusBarText(const String& text)
-{
- ASSERT(m_doc); // Client calls shouldn't be made when the frame is in inconsistent state.
- m_kjsStatusBarText = text;
- if (m_page)
- m_page->chrome()->setStatusbarText(this, m_kjsStatusBarText);
-}
-
-void Frame::setJSDefaultStatusBarText(const String& text)
-{
- ASSERT(m_doc); // Client calls shouldn't be made when the frame is in inconsistent state.
- m_kjsDefaultStatusBarText = text;
- if (m_page)
- m_page->chrome()->setStatusbarText(this, m_kjsDefaultStatusBarText);
-}
-
void Frame::setNeedsReapplyStyles()
{
// When the frame is not showing web content, it doesn't make sense to apply styles.
@@ -1436,6 +1429,7 @@ String Frame::documentTypeString() const
return String();
}
+<<<<<<< HEAD
void Frame::focusWindow()
{
if (!page())
@@ -1474,6 +1468,8 @@ void Frame::scheduleClose()
chrome->closeWindowSoon();
}
+=======
+>>>>>>> webkit.org at r61871
void Frame::respondToChangedSelection(const VisibleSelection& oldSelection, bool closeTyping)
{
bool isContinuousSpellCheckingEnabled = editor()->isContinuousSpellCheckingEnabled();
diff --git a/WebCore/page/Frame.h b/WebCore/page/Frame.h
index cb7e977..c2d364f 100644
--- a/WebCore/page/Frame.h
+++ b/WebCore/page/Frame.h
@@ -76,10 +76,7 @@ namespace WebCore {
#endif
{
public:
- static PassRefPtr<Frame> create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
- {
- return adoptRef(new Frame(page, ownerElement, client));
- }
+ static PassRefPtr<Frame> create(Page*, HTMLFrameOwnerElement*, FrameLoaderClient*);
void setView(PassRefPtr<FrameView>);
~Frame();
@@ -189,19 +186,6 @@ namespace WebCore {
private:
void lifeSupportTimerFired(Timer<Frame>*);
- // === to be moved into Chrome
-
- public:
- void focusWindow();
- void unfocusWindow();
- bool shouldClose();
- void scheduleClose();
-
- void setJSStatusBarText(const String&);
- void setJSDefaultStatusBarText(const String&);
- String jsStatusBarText() const;
- String jsDefaultStatusBarText() const;
-
// === to be moved into Editor
public:
@@ -336,9 +320,6 @@ namespace WebCore {
ScriptController m_script;
- String m_kjsStatusBarText;
- String m_kjsDefaultStatusBarText;
-
mutable VisibleSelection m_mark;
mutable Editor m_editor;
mutable SelectionController m_selectionController;
@@ -424,16 +405,6 @@ namespace WebCore {
m_mark = s;
}
- inline String Frame::jsStatusBarText() const
- {
- return m_kjsStatusBarText;
- }
-
- inline String Frame::jsDefaultStatusBarText() const
- {
- return m_kjsDefaultStatusBarText;
- }
-
inline bool Frame::needsReapplyStyles() const
{
return m_needsReapplyStyles;
@@ -509,13 +480,6 @@ namespace WebCore {
return &m_eventHandler;
}
- inline bool Frame::shouldClose()
- {
- // FIXME: Some WebKit clients call Frame::shouldClose() directly.
- // We should transition them to calling FrameLoader::shouldClose() then get rid of this method.
- return m_loader.shouldClose();
- }
-
} // namespace WebCore
#endif // Frame_h
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 6fe8d38..500a6dd 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -90,23 +90,25 @@ using namespace HTMLNames;
double FrameView::sCurrentPaintTimeStamp = 0.0;
+// REPAINT_THROTTLING now chooses default values for throttling parameters.
+// Should be removed when applications start using runtime configuration.
#if ENABLE(REPAINT_THROTTLING)
// Normal delay
-static const double deferredRepaintDelay = 0.025;
+double FrameView::s_deferredRepaintDelay = 0.025;
// Negative value would mean that first few repaints happen without a delay
-static const double initialDeferredRepaintDelayDuringLoading = 0;
+double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0;
// The delay grows on each repaint to this maximum value
-static const double maxDeferredRepaintDelayDuringLoading = 2.5;
+double FrameView::s_maxDeferredRepaintDelayDuringLoading = 2.5;
// On each repaint the delay increses by this amount
-static const double deferredRepaintDelayIncrementDuringLoading = 0.5;
+double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0.5;
#else
// FIXME: Repaint throttling could be good to have on all platform.
// The balance between CPU use and repaint frequency will need some tuning for desktop.
// More hooks may be needed to reset the delay on things like GIF and CSS animations.
-static const double deferredRepaintDelay = 0;
-static const double initialDeferredRepaintDelayDuringLoading = 0;
-static const double maxDeferredRepaintDelayDuringLoading = 0;
-static const double deferredRepaintDelayIncrementDuringLoading = 0;
+double FrameView::s_deferredRepaintDelay = 0;
+double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0;
+double FrameView::s_maxDeferredRepaintDelayDuringLoading = 0;
+double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0;
#endif
// The maximum number of updateWidgets iterations that should be done before returning.
@@ -222,7 +224,7 @@ void FrameView::reset()
m_deferringRepaints = 0;
m_repaintCount = 0;
m_repaintRects.clear();
- m_deferredRepaintDelay = initialDeferredRepaintDelayDuringLoading;
+ m_deferredRepaintDelay = s_initialDeferredRepaintDelayDuringLoading;
m_deferredRepaintTimer.stop();
m_lastPaintTime = 0;
m_paintBehavior = PaintBehaviorNormal;
@@ -930,6 +932,8 @@ void FrameView::removeSlowRepaintObject()
void FrameView::addFixedObject()
{
+ if (!m_fixedObjectCount && platformWidget())
+ setCanBlitOnScroll(false);
++m_fixedObjectCount;
}
@@ -937,6 +941,64 @@ void FrameView::removeFixedObject()
{
ASSERT(m_fixedObjectCount > 0);
--m_fixedObjectCount;
+ if (!m_fixedObjectCount)
+ setCanBlitOnScroll(!useSlowRepaints());
+}
+
+bool FrameView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+{
+ const size_t fixedObjectThreshold = 5;
+
+ RenderBlock::PositionedObjectsListHashSet* positionedObjects = 0;
+ if (RenderView* root = m_frame->contentRenderer())
+ positionedObjects = root->positionedObjects();
+
+ if (!positionedObjects || positionedObjects->isEmpty()) {
+ hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+ return true;
+ }
+
+ // Get the rects of the fixed objects visible in the rectToScroll
+ Vector<IntRect, fixedObjectThreshold> subRectToUpdate;
+ bool updateInvalidatedSubRect = true;
+ RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
+ for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
+ RenderBox* renderBox = *it;
+ if (renderBox->style()->position() != FixedPosition)
+ continue;
+ IntRect updateRect = renderBox->layer()->repaintRectIncludingDescendants();
+ updateRect = contentsToWindow(updateRect);
+
+ updateRect.intersect(rectToScroll);
+ if (!updateRect.isEmpty()) {
+ if (subRectToUpdate.size() >= fixedObjectThreshold) {
+ updateInvalidatedSubRect = false;
+ break;
+ }
+ subRectToUpdate.append(updateRect);
+ }
+ }
+
+ // Scroll the view
+ if (updateInvalidatedSubRect) {
+ // 1) scroll
+ hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+
+ // 2) update the area of fixed objects that has been invalidated
+ size_t fixObjectsCount = subRectToUpdate.size();
+ for (size_t i = 0; i < fixObjectsCount; ++i) {
+ IntRect updateRect = subRectToUpdate[i];
+ IntRect scrolledRect = updateRect;
+ scrolledRect.move(scrollDelta);
+ updateRect.unite(scrolledRect);
+ updateRect.intersect(rectToScroll);
+ hostWindow()->invalidateContentsAndWindow(updateRect, false);
+ }
+ return true;
+ }
+
+ // the number of fixed objects exceed the threshold, we cannot use the fast path
+ return false;
}
void FrameView::setIsOverlapped(bool isOverlapped)
@@ -1240,13 +1302,13 @@ void FrameView::updateDeferredRepaintDelay()
{
Document* document = m_frame->document();
if (!document || (!document->parsing() && !document->docLoader()->requestCount())) {
- m_deferredRepaintDelay = deferredRepaintDelay;
+ m_deferredRepaintDelay = s_deferredRepaintDelay;
return;
}
- if (m_deferredRepaintDelay < maxDeferredRepaintDelayDuringLoading) {
- m_deferredRepaintDelay += deferredRepaintDelayIncrementDuringLoading;
- if (m_deferredRepaintDelay > maxDeferredRepaintDelayDuringLoading)
- m_deferredRepaintDelay = maxDeferredRepaintDelayDuringLoading;
+ if (m_deferredRepaintDelay < s_maxDeferredRepaintDelayDuringLoading) {
+ m_deferredRepaintDelay += s_deferredRepaintDelayIncrementDuringLoading;
+ if (m_deferredRepaintDelay > s_maxDeferredRepaintDelayDuringLoading)
+ m_deferredRepaintDelay = s_maxDeferredRepaintDelayDuringLoading;
}
}
@@ -2251,4 +2313,29 @@ void FrameView::setZoomFactor(float percent, ZoomMode mode)
layout();
}
+
+// Normal delay
+void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p)
+{
+ s_deferredRepaintDelay = p;
+}
+
+// Negative value would mean that first few repaints happen without a delay
+void FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(double p)
+{
+ s_initialDeferredRepaintDelayDuringLoading = p;
+}
+
+// The delay grows on each repaint to this maximum value
+void FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double p)
+{
+ s_maxDeferredRepaintDelayDuringLoading = p;
+}
+
+// On each repaint the delay increases by this amount
+void FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p)
+{
+ s_deferredRepaintDelayIncrementDuringLoading = p;
+}
+
} // namespace WebCore
diff --git a/WebCore/page/FrameView.h b/WebCore/page/FrameView.h
index 69cc67a..b047db0 100644
--- a/WebCore/page/FrameView.h
+++ b/WebCore/page/FrameView.h
@@ -46,7 +46,7 @@ class RenderLayer;
class RenderObject;
class RenderEmbeddedObject;
class RenderScrollbarPart;
-class ScheduledEvent;
+struct ScheduledEvent;
class String;
template <typename T> class Timer;
@@ -222,6 +222,18 @@ public:
float pageZoomFactor() const { return shouldApplyPageZoom() ? m_zoomFactor : 1.0f; }
float textZoomFactor() const { return shouldApplyTextZoom() ? m_zoomFactor : 1.0f; }
+ // Normal delay
+ static void setRepaintThrottlingDeferredRepaintDelay(double p);
+ // Negative value would mean that first few repaints happen without a delay
+ static void setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(double p);
+ // The delay grows on each repaint to this maximum value
+ static void setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double p);
+ // On each repaint the delay increses by this amount
+ static void setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p);
+
+protected:
+ virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
private:
FrameView(Frame*);
@@ -354,6 +366,11 @@ private:
RenderScrollbarPart* m_scrollCorner;
float m_zoomFactor;
+
+ static double s_deferredRepaintDelay;
+ static double s_initialDeferredRepaintDelayDuringLoading;
+ static double s_maxDeferredRepaintDelayDuringLoading;
+ static double s_deferredRepaintDelayIncrementDuringLoading;
};
#if ENABLE(INSPECTOR)
diff --git a/WebCore/page/OriginAccessEntry.h b/WebCore/page/OriginAccessEntry.h
index 7c8d556..67e39fe 100644
--- a/WebCore/page/OriginAccessEntry.h
+++ b/WebCore/page/OriginAccessEntry.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef CrossOriginAccess_h
-#define CrossOriginAccess_h
+#ifndef OriginAccessEntry_h
+#define OriginAccessEntry_h
#include "PlatformString.h"
@@ -71,4 +71,4 @@ inline bool operator!=(const OriginAccessEntry& a, const OriginAccessEntry& b)
} // namespace WebCore
-#endif // CrossOriginAccess_h
+#endif // OriginAccessEntry_h
diff --git a/WebCore/page/Page.cpp b/WebCore/page/Page.cpp
index 446f9f0..d5074aa 100644
--- a/WebCore/page/Page.cpp
+++ b/WebCore/page/Page.cpp
@@ -404,7 +404,7 @@ void Page::refreshPlugins(bool reload)
continue;
for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
- if (frame->loader()->containsPlugins())
+ if (frame->loader()->subframeLoader()->containsPlugins())
framesNeedingReload.append(frame);
}
}
@@ -415,7 +415,7 @@ void Page::refreshPlugins(bool reload)
PluginData* Page::pluginData() const
{
- if (!mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin))
+ if (!mainFrame()->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin))
return 0;
if (!m_pluginData)
m_pluginData = PluginData::create(this);
diff --git a/WebCore/page/PageGroupLoadDeferrer.cpp b/WebCore/page/PageGroupLoadDeferrer.cpp
index 122658b..ced8f36 100644
--- a/WebCore/page/PageGroupLoadDeferrer.cpp
+++ b/WebCore/page/PageGroupLoadDeferrer.cpp
@@ -43,8 +43,10 @@ PageGroupLoadDeferrer::PageGroupLoadDeferrer(Page* page, bool deferSelf)
// This code is not logically part of load deferring, but we do not want JS code executed beneath modal
// windows or sheets, which is exactly when PageGroupLoadDeferrer is used.
- for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext())
+ for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
frame->document()->suspendActiveDOMObjects();
+ frame->document()->suspendExecuteScriptSoonTimer();
+ }
}
}
@@ -60,8 +62,10 @@ PageGroupLoadDeferrer::~PageGroupLoadDeferrer()
if (Page* page = m_deferredFrames[i]->page()) {
page->setDefersLoading(false);
- for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext())
+ for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
frame->document()->resumeActiveDOMObjects();
+ frame->document()->resumeExecuteScriptSoonTimer();
+ }
}
}
}
diff --git a/WebCore/page/PrintContext.cpp b/WebCore/page/PrintContext.cpp
index bc4b31a..4ab7367 100644
--- a/WebCore/page/PrintContext.cpp
+++ b/WebCore/page/PrintContext.cpp
@@ -199,6 +199,42 @@ int PrintContext::pageNumberForElement(Element* element, const FloatSize& pageSi
return -1;
}
+String PrintContext::pageProperty(Frame* frame, const char* propertyName, int pageNumber)
+{
+ Document* document = frame->document();
+ document->updateLayout();
+ RefPtr<RenderStyle> style = document->styleForPage(pageNumber);
+
+ // Implement formatters for properties we care about.
+ if (!strcmp(propertyName, "margin-left"))
+ return String::format("%d", style->marginLeft().rawValue());
+ if (!strcmp(propertyName, "line-height"))
+ return String::format("%d", style->lineHeight().rawValue());
+ if (!strcmp(propertyName, "font-size"))
+ return String::format("%d", style->fontDescription().computedPixelSize());
+ if (!strcmp(propertyName, "font-family"))
+ return String::format("%s", style->fontDescription().family().family().string().utf8().data());
+
+ return String::format("pageProperty() unimplemented for: %s", propertyName);
+}
+
+bool PrintContext::isPageBoxVisible(Frame* frame, int pageNumber)
+{
+ return frame->document()->isPageBoxVisible(pageNumber);
+}
+
+String PrintContext::pageAreaRectInPixels(Frame* frame, int pageNumber)
+{
+ IntRect pageArea = frame->document()->pageAreaRectInPixels(pageNumber);
+ return String::format("(%d,%d,%d,%d)", pageArea.x(), pageArea.y(), pageArea.width(), pageArea.height());
+}
+
+String PrintContext::preferredPageSizeInPixels(Frame* frame, int pageNumber)
+{
+ IntSize pageSize = frame->document()->preferredPageSizeInPixels(pageNumber);
+ return String::format("(%d,%d)", pageSize.width(), pageSize.height());
+}
+
int PrintContext::numberOfPages(Frame* frame, const FloatSize& pageSizeInPixels)
{
frame->document()->updateLayout();
diff --git a/WebCore/page/PrintContext.h b/WebCore/page/PrintContext.h
index 1891144..81a9b76 100644
--- a/WebCore/page/PrintContext.h
+++ b/WebCore/page/PrintContext.h
@@ -31,6 +31,7 @@ class FloatRect;
class FloatSize;
class GraphicsContext;
class IntRect;
+class String;
class PrintContext {
public:
@@ -54,6 +55,10 @@ public:
// Used by layout tests.
static int pageNumberForElement(Element*, const FloatSize& pageSizeInPixels);
+ static String pageProperty(Frame* frame, const char* propertyName, int pageNumber);
+ static bool isPageBoxVisible(Frame* frame, int pageNumber);
+ static String pageAreaRectInPixels(Frame* frame, int pageNumber);
+ static String preferredPageSizeInPixels(Frame* frame, int pageNumber);
static int numberOfPages(Frame*, const FloatSize& pageSizeInPixels);
protected:
diff --git a/WebCore/page/Settings.cpp b/WebCore/page/Settings.cpp
index b20f2e5..503b938 100644
--- a/WebCore/page/Settings.cpp
+++ b/WebCore/page/Settings.cpp
@@ -144,7 +144,7 @@ Settings::Settings(Page* page)
, m_webGLEnabled(false)
, m_loadDeferringEnabled(true)
, m_tiledBackingStoreEnabled(false)
- , m_html5ParserEnabled(false)
+ , m_html5ParserEnabled(true)
, m_paginateDuringLayoutEnabled(false)
#ifdef ANDROID_PLUGINS
, m_pluginsOnDemand(false)
diff --git a/WebCore/page/SpatialNavigation.cpp b/WebCore/page/SpatialNavigation.cpp
index 0239c39..58b70e4 100644
--- a/WebCore/page/SpatialNavigation.cpp
+++ b/WebCore/page/SpatialNavigation.cpp
@@ -125,8 +125,11 @@ static IntRect renderRectRelativeToRootDocument(RenderObject* render)
// Handle nested frames.
for (Frame* frame = render->document()->frame(); frame; frame = frame->tree()->parent()) {
- if (HTMLFrameOwnerElement* ownerElement = frame->ownerElement())
- rect.move(ownerElement->offsetLeft(), ownerElement->offsetTop());
+ if (Element* element = static_cast<Element*>(frame->ownerElement())) {
+ do {
+ rect.move(element->offsetLeft(), element->offsetTop());
+ } while ((element = element->offsetParent()));
+ }
}
return rect;
@@ -445,7 +448,7 @@ bool hasOffscreenRect(Node* node)
// In a bottom-up way, this method tries to scroll |frame| in a given direction
// |direction|, going up in the frame tree hierarchy in case it does not succeed.
-bool scrollInDirection(Frame* frame, FocusDirection direction)
+bool scrollInDirection(Frame* frame, FocusDirection direction, const FocusCandidate& candidate)
{
if (!frame)
return false;
@@ -469,6 +472,9 @@ bool scrollInDirection(Frame* frame, FocusDirection direction)
return false;
}
+ if (!candidate.isNull() && isScrollableContainerNode(candidate.enclosingScrollableBox))
+ return frame->eventHandler()->scrollRecursively(scrollDirection, ScrollByLine, candidate.enclosingScrollableBox);
+
return frame->eventHandler()->scrollRecursively(scrollDirection, ScrollByLine);
}
@@ -527,4 +533,17 @@ static bool checkNegativeCoordsForNode(Node* node, const IntRect& curRect)
return canBeScrolled;
}
+bool isScrollableContainerNode(Node* node)
+{
+ if (!node)
+ return false;
+
+ if (RenderObject* renderer = node->renderer()) {
+ return (renderer->isBox() && toRenderBox(renderer)->canBeScrolledAndHasScrollableArea()
+ && node->hasChildNodes() && !node->isDocumentNode());
+ }
+
+ return false;
+}
+
} // namespace WebCore
diff --git a/WebCore/page/SpatialNavigation.h b/WebCore/page/SpatialNavigation.h
index d38fb09..78419a7 100644
--- a/WebCore/page/SpatialNavigation.h
+++ b/WebCore/page/SpatialNavigation.h
@@ -97,6 +97,7 @@ enum RectsAlignment {
struct FocusCandidate {
FocusCandidate()
: node(0)
+ , enclosingScrollableBox(0)
, distance(maxDistance())
, parentDistance(maxDistance())
, alignment(None)
@@ -106,6 +107,7 @@ struct FocusCandidate {
FocusCandidate(Node* n)
: node(n)
+ , enclosingScrollableBox(0)
, distance(maxDistance())
, parentDistance(maxDistance())
, alignment(None)
@@ -114,9 +116,11 @@ struct FocusCandidate {
}
bool isNull() const { return !node; }
+ bool inScrollableContainer() const { return node && enclosingScrollableBox; }
Document* document() const { return node ? node->document() : 0; }
Node* node;
+ Node* enclosingScrollableBox;
long long distance;
long long parentDistance;
RectsAlignment alignment;
@@ -124,10 +128,11 @@ struct FocusCandidate {
};
void distanceDataForNode(FocusDirection direction, Node* start, FocusCandidate& candidate);
-bool scrollInDirection(Frame*, FocusDirection);
+bool scrollInDirection(Frame*, FocusDirection, const FocusCandidate& candidate = FocusCandidate());
void scrollIntoView(Element*);
bool hasOffscreenRect(Node*);
bool isInRootDocument(Node*);
+bool isScrollableContainerNode(Node*);
} // namspace WebCore
diff --git a/WebCore/page/WebKitPoint.idl b/WebCore/page/WebKitPoint.idl
index fd617b2..4e6021f 100644
--- a/WebCore/page/WebKitPoint.idl
+++ b/WebCore/page/WebKitPoint.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,7 +25,12 @@
module window {
- interface [CustomConstructor] WebKitPoint {
+ interface [
+ CanBeConstructed,
+ CustomConstructFunction,
+ ConstructorParameters=2,
+ V8CustomConstructor
+ ] WebKitPoint {
attribute float x;
attribute float y;
};
diff --git a/WebCore/page/XSSAuditor.cpp b/WebCore/page/XSSAuditor.cpp
index b5aba79..33a0951 100644
--- a/WebCore/page/XSSAuditor.cpp
+++ b/WebCore/page/XSSAuditor.cpp
@@ -35,7 +35,7 @@
#include "DOMWindow.h"
#include "Frame.h"
#include "KURL.h"
-#include "PreloadScanner.h"
+#include "LegacyPreloadScanner.h"
#include "ResourceResponseBase.h"
#include "ScriptSourceCode.h"
#include "Settings.h"
@@ -277,7 +277,7 @@ String XSSAuditor::decodeHTMLEntities(const String& string, bool leaveUndecodabl
if (leaveUndecodableEntitiesUntouched)
sourceShadow = source;
bool notEnoughCharacters = false;
- unsigned entity = PreloadScanner::consumeEntity(source, notEnoughCharacters);
+ unsigned entity = LegacyPreloadScanner::consumeEntity(source, notEnoughCharacters);
// We ignore notEnoughCharacters because we might as well use this loop
// to copy the remaining characters into |result|.
diff --git a/WebCore/page/XSSAuditor.h b/WebCore/page/XSSAuditor.h
index 7afbf07..20e0a53 100644
--- a/WebCore/page/XSSAuditor.h
+++ b/WebCore/page/XSSAuditor.h
@@ -66,8 +66,8 @@ namespace WebCore {
// * ScriptController::executeIfJavaScriptURL - used to evaluate JavaScript URLs.
// * ScriptEventListener::createAttributeEventListener - used to create JavaScript event handlers.
// * HTMLBaseElement::process - used to set the document base URL.
- // * HTMLDocumentParser::parseTag - used to load external JavaScript scripts.
- // * FrameLoader::requestObject - used to load <object>/<embed> elements.
+ // * LegacyHTMLDocumentParser::parseTag - used to load external JavaScript scripts.
+ // * SubframeLoader::requestObject - used to load <object>/<embed> elements.
//
class XSSAuditor : public Noncopyable {
public:
@@ -95,7 +95,7 @@ namespace WebCore {
// Determines whether object should be loaded based on the content of
// any user-submitted data.
//
- // This method is called by FrameLoader::requestObject.
+ // This method is called by SubframeLoader::requestObject.
bool canLoadObject(const String& url) const;
// Determines whether the base URL should be changed based on the content
diff --git a/WebCore/page/animation/AnimationBase.cpp b/WebCore/page/animation/AnimationBase.cpp
index aa6a4c1..7195d1f 100644
--- a/WebCore/page/animation/AnimationBase.cpp
+++ b/WebCore/page/animation/AnimationBase.cpp
@@ -191,6 +191,22 @@ static inline EVisibility blendFunc(const AnimationBase* anim, EVisibility from,
return result > 0. ? VISIBLE : (to != VISIBLE ? to : from);
}
+static inline LengthBox blendFunc(const AnimationBase* anim, const LengthBox& from, const LengthBox& to, double progress)
+{
+ // Length types have to match to animate
+ if (from.top().type() != to.top().type()
+ || from.right().type() != to.right().type()
+ || from.bottom().type() != to.bottom().type()
+ || from.left().type() != to.left().type())
+ return to;
+
+ LengthBox result(blendFunc(anim, from.top(), to.top(), progress),
+ blendFunc(anim, from.right(), to.right(), progress),
+ blendFunc(anim, from.bottom(), to.bottom(), progress),
+ blendFunc(anim, from.left(), to.left(), progress));
+ return result;
+}
+
class PropertyWrapperBase;
static void addShorthandProperties();
@@ -634,6 +650,8 @@ void AnimationBase::ensurePropertyMap()
gPropertyWrappers->append(new PropertyWrapper<const IntSize&>(CSSPropertyBorderBottomRightRadius, &RenderStyle::borderBottomRightRadius, &RenderStyle::setBorderBottomRightRadius));
gPropertyWrappers->append(new PropertyWrapper<EVisibility>(CSSPropertyVisibility, &RenderStyle::visibility, &RenderStyle::setVisibility));
gPropertyWrappers->append(new PropertyWrapper<float>(CSSPropertyZoom, &RenderStyle::zoom, &RenderStyle::setZoom));
+
+ gPropertyWrappers->append(new PropertyWrapper<LengthBox>(CSSPropertyClip, &RenderStyle::clip, &RenderStyle::setClip));
#if USE(ACCELERATED_COMPOSITING)
gPropertyWrappers->append(new PropertyWrapperAcceleratedOpacity());
@@ -652,7 +670,6 @@ void AnimationBase::ensurePropertyMap()
gPropertyWrappers->append(new PropertyWrapperMaybeInvalidColor(CSSPropertyBorderBottomColor, &RenderStyle::borderBottomColor, &RenderStyle::setBorderBottomColor));
gPropertyWrappers->append(new PropertyWrapperMaybeInvalidColor(CSSPropertyOutlineColor, &RenderStyle::outlineColor, &RenderStyle::setOutlineColor));
- // These are for shadows
gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyWebkitBoxShadow, &RenderStyle::boxShadow, &RenderStyle::setBoxShadow));
gPropertyWrappers->append(new PropertyWrapperShadow(CSSPropertyTextShadow, &RenderStyle::textShadow, &RenderStyle::setTextShadow));
diff --git a/WebCore/page/animation/AnimationBase.h b/WebCore/page/animation/AnimationBase.h
index ac55a2b..91ef8cf 100644
--- a/WebCore/page/animation/AnimationBase.h
+++ b/WebCore/page/animation/AnimationBase.h
@@ -42,7 +42,7 @@ class Element;
class Node;
class RenderObject;
class RenderStyle;
-class TimingFunction;
+struct TimingFunction;
class AnimationBase : public RefCounted<AnimationBase> {
friend class CompositeAnimation;
diff --git a/WebCore/bindings/js/JSSharedWorkerConstructor.h b/WebCore/page/brew/ChromeClientBrew.h
index 87baa38..d1fac2d 100644
--- a/WebCore/bindings/js/JSSharedWorkerConstructor.h
+++ b/WebCore/page/brew/ChromeClientBrew.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (c) 2010, Company 100, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -28,29 +28,24 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSSharedWorkerConstructor_h
-#define JSSharedWorkerConstructor_h
+#ifndef ChromeClientBrew_h
+#define ChromeClientBrew_h
-#if ENABLE(SHARED_WORKERS)
-
-#include "JSDOMBinding.h"
+#include "ChromeClient.h"
+#include <wtf/Forward.h>
namespace WebCore {
+class IntRect;
+class PopupMenuClient;
- class JSSharedWorkerConstructor : public DOMConstructorObject {
- public:
- JSSharedWorkerConstructor(JSC::ExecState*, JSDOMGlobalObject*);
-
- static const JSC::ClassInfo s_info;
-
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
-
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
- };
+// Contains Brew-specific extensions to the ChromeClient. Only put
+// things here that don't make sense for other ports.
+class ChromeClientBrew : public ChromeClient {
+public:
+ virtual void createSelectPopup(PopupMenuClient*, int selected, const IntRect& rect) = 0;
+ virtual bool destroySelectPopup() = 0;
+};
} // namespace WebCore
-#endif // ENABLE(SHARED_WORKERS)
-
-#endif // JSSharedWorkerConstructor_h
+#endif
diff --git a/WebCore/page/mac/WebCoreViewFactory.h b/WebCore/page/mac/WebCoreViewFactory.h
index db70b6d..2ca0d17 100644
--- a/WebCore/page/mac/WebCoreViewFactory.h
+++ b/WebCore/page/mac/WebCoreViewFactory.h
@@ -28,9 +28,6 @@
@protocol WebCoreViewFactory
-- (NSArray *)pluginsInfo; // array of id <WebCorePluginInfo>
-- (void)refreshPlugins;
-
- (NSString *)inputElementAltText;
- (NSString *)resetButtonDefaultLabel;
- (NSString *)searchableIndexIntroduction;
@@ -171,13 +168,3 @@
@interface WebCoreViewFactory (SubclassResponsibility) <WebCoreViewFactory>
@end
-
-@protocol WebCorePluginInfo <NSObject>
-- (NSString *)name;
-- (NSString *)filename;
-- (NSString *)pluginDescription;
-- (NSEnumerator *)MIMETypeEnumerator;
-- (NSString *)descriptionForMIMEType:(NSString *)MIMEType;
-- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType;
-@end
-
diff --git a/WebCore/page/win/FrameWin.h b/WebCore/page/win/FrameWin.h
index 4c274b7..cbfe33d 100644
--- a/WebCore/page/win/FrameWin.h
+++ b/WebCore/page/win/FrameWin.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FrameWin_H
-#define FrameWin_H
+#ifndef FrameWin_h
+#define FrameWin_h
#include <wtf/Vector.h>
diff --git a/WebCore/platform/BlobItem.cpp b/WebCore/platform/BlobItem.cpp
index 949e7f8..f98e466 100644
--- a/WebCore/platform/BlobItem.cpp
+++ b/WebCore/platform/BlobItem.cpp
@@ -90,9 +90,12 @@ unsigned long long FileBlobItem::size() const
PassRefPtr<BlobItem> FileBlobItem::slice(long long start, long long length)
{
ASSERT(start >= 0 && length >= 0);
- ASSERT(static_cast<unsigned long long>(start) < size());
- if (!start && size() <= static_cast<unsigned long long>(length))
+ long long fileSize = size();
+ ASSERT(start < fileSize);
+ if (!start && fileSize <= length)
return this;
+ if (start + length > fileSize)
+ length = fileSize - start;
const FileRangeBlobItem* fileRangeItem = toFileRangeBlobItem();
double modificationTime = fileRangeItem ? fileRangeItem->snapshotModificationTime() : getFileSnapshotModificationTime(path());
return FileRangeBlobItem::create(path(), start, length, modificationTime);
@@ -129,6 +132,14 @@ CString StringBlobItem::convertToCString(const String& text, LineEnding ending,
if (ending == EndingTransparent)
return result;
+ if (ending == EndingNative) {
+#if OS(WINDOWS)
+ ending = EndingCRLF;
+#else
+ ending = EndingLF;
+#endif
+ }
+
const char* endingChars = (ending == EndingCRLF) ? "\r\n" : ((ending == EndingCR) ? "\r" : "\n");
int endingLength = (ending == EndingCRLF) ? 2 : 1;
@@ -141,6 +152,7 @@ CString StringBlobItem::convertToCString(const String& text, LineEnding ending,
if (c == '\r') {
// Safe to look ahead because of trailing '\0'.
if (*p == '\n' && ending != EndingCRLF) {
+ p++;
calculatedLength += (endingLength - 2);
++needFix;
} else if (ending != EndingCR) {
@@ -163,6 +175,7 @@ CString StringBlobItem::convertToCString(const String& text, LineEnding ending,
while (char c = *p++) {
if (c == '\r') {
if (*p == '\n' && ending != EndingCRLF) {
+ p++;
memcpy(q, endingChars, endingLength);
q += endingLength;
} else if (*p != '\n' && ending != EndingCR) {
@@ -204,7 +217,7 @@ PassRefPtr<BlobItem> DataRangeBlobItem::create(PassRefPtr<DataBlobItem> item, lo
DataRangeBlobItem::DataRangeBlobItem(PassRefPtr<DataBlobItem> item, long long start, long long length)
: m_length(length)
{
- const DataRangeBlobItem* rangeItem = m_item->toDataRangeBlobItem();
+ const DataRangeBlobItem* rangeItem = item->toDataRangeBlobItem();
if (rangeItem) {
m_item = rangeItem->m_item;
m_start = start + rangeItem->m_start;
diff --git a/WebCore/platform/BlobItem.h b/WebCore/platform/BlobItem.h
index f2ee56b..1d34c59 100644
--- a/WebCore/platform/BlobItem.h
+++ b/WebCore/platform/BlobItem.h
@@ -44,6 +44,7 @@ namespace WebCore {
// String ending types.
enum LineEnding {
EndingTransparent = 0,
+ EndingNative,
EndingLF,
EndingCR,
EndingCRLF,
diff --git a/WebCore/platform/FileSystem.h b/WebCore/platform/FileSystem.h
index f270c31..42aaaef 100644
--- a/WebCore/platform/FileSystem.h
+++ b/WebCore/platform/FileSystem.h
@@ -59,6 +59,10 @@ typedef struct HINSTANCE__* HINSTANCE;
typedef HINSTANCE HMODULE;
#endif
+#if PLATFORM(BREWMP)
+typedef struct _IFile IFile;
+#endif
+
namespace WTF {
class CString;
}
@@ -117,6 +121,11 @@ typedef HANDLE PlatformFileHandle;
// FIXME: -1 is INVALID_HANDLE_VALUE, defined in <winbase.h>. Chromium tries to
// avoid using Windows headers in headers. We'd rather move this into the .cpp.
const PlatformFileHandle invalidPlatformFileHandle = reinterpret_cast<HANDLE>(-1);
+#elif PLATFORM(BREWMP)
+typedef IFile* PlatformFileHandle;
+const PlatformFileHandle invalidPlatformFileHandle = 0;
+typedef void* PlatformModule;
+typedef unsigned PlatformModuleVersion;
#else
typedef int PlatformFileHandle;
const PlatformFileHandle invalidPlatformFileHandle = -1;
diff --git a/WebCore/platform/LengthBox.h b/WebCore/platform/LengthBox.h
index 7d7698d..cf56389 100644
--- a/WebCore/platform/LengthBox.h
+++ b/WebCore/platform/LengthBox.h
@@ -45,6 +45,14 @@ struct LengthBox {
, m_bottom(Length(v, Fixed))
{
}
+
+ LengthBox(Length t, Length r, Length b, Length l)
+ : m_left(l)
+ , m_right(r)
+ , m_top(t)
+ , m_bottom(b)
+ {
+ }
LengthBox(int t, int r, int b, int l)
: m_left(Length(l, Fixed))
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 2f3bf92..d6ff588 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -54,8 +54,9 @@ static HashSet<String>* supportedImageMIMETypesForEncoding;
static HashSet<String>* supportedJavaScriptMIMETypes;
static HashSet<String>* supportedNonImageMIMETypes;
static HashSet<String>* supportedMediaMIMETypes;
-static HashMap<String, String, CaseFoldingHash>* mediaMIMETypeForExtensionMap;
+typedef HashMap<String, Vector<String>*, CaseFoldingHash> MediaMIMETypeMap;
+
static void initializeSupportedImageMIMETypes()
{
#if PLATFORM(CG)
@@ -249,7 +250,7 @@ static void initializeSupportedNonImageMimeTypes()
#endif
}
-static void initializeMediaTypeMaps()
+static MediaMIMETypeMap& mediaMIMETypeMap()
{
struct TypeExtensionPair {
const char* type;
@@ -257,11 +258,7 @@ static void initializeMediaTypeMaps()
};
// A table of common media MIME types and file extenstions used when a platform's
- // specific MIME type lookup doens't have a match for a media file extension. While some
- // file extensions are claimed by multiple MIME types, this table only includes one
- // for each because it is currently only used by getMediaMIMETypeForExtension. If we
- // ever add a MIME type -> file extension mapping, the alternate MIME types will need
- // to be added.
+ // specific MIME type lookup doesn't have a match for a media file extension.
static const TypeExtensionPair pairs[] = {
// Ogg
@@ -292,8 +289,13 @@ static void initializeMediaTypeMaps()
{ "video/mpeg", "mpv" },
// MPEG playlist
- { "audio/x-mpegurl", "m3url" },
+ { "application/vnd.apple.mpegurl", "m3u8" },
+ { "application/mpegurl", "m3u8" },
{ "application/x-mpegurl", "m3u8" },
+ { "audio/mpegurl", "m3url" },
+ { "audio/x-mpegurl", "m3url" },
+ { "audio/mpegurl", "m3u" },
+ { "audio/x-mpegurl", "m3u" },
// MPEG-4
{ "video/x-m4v", "m4v" },
@@ -303,6 +305,8 @@ static void initializeMediaTypeMaps()
// MP3
{ "audio/mp3", "mp3" },
+ { "audio/x-mp3", "mp3" },
+ { "audio/x-mpeg", "mp3" },
// MPEG-2
{ "video/x-mpeg2", "mp2" },
@@ -327,23 +331,46 @@ static void initializeMediaTypeMaps()
{ "audio/x-gsm", "gsm" }
};
- mediaMIMETypeForExtensionMap = new HashMap<String, String, CaseFoldingHash>;
+ DEFINE_STATIC_LOCAL(MediaMIMETypeMap, mediaMIMETypeForExtensionMap, ());
+
+ if (!mediaMIMETypeForExtensionMap.isEmpty())
+ return mediaMIMETypeForExtensionMap;
+
const unsigned numPairs = sizeof(pairs) / sizeof(pairs[0]);
- for (unsigned ndx = 0; ndx < numPairs; ++ndx)
- mediaMIMETypeForExtensionMap->set(pairs[ndx].extension, pairs[ndx].type);
+ for (unsigned ndx = 0; ndx < numPairs; ++ndx) {
+
+ if (mediaMIMETypeForExtensionMap.contains(pairs[ndx].extension))
+ mediaMIMETypeForExtensionMap.get(pairs[ndx].extension)->append(pairs[ndx].type);
+ else {
+ Vector<String>* synonyms = new Vector<String>;
+
+ // If there is a system specific type for this extension, add it as the first type so
+ // getMediaMIMETypeForExtension will always return it.
+ String systemType = MIMETypeRegistry::getMIMETypeForExtension(pairs[ndx].type);
+ if (!systemType.isEmpty() && pairs[ndx].type != systemType)
+ synonyms->append(systemType);
+ synonyms->append(pairs[ndx].type);
+ mediaMIMETypeForExtensionMap.add(pairs[ndx].extension, synonyms);
+ }
+ }
+
+ return mediaMIMETypeForExtensionMap;
}
String MIMETypeRegistry::getMediaMIMETypeForExtension(const String& ext)
{
- // Check with system specific implementation first.
- String mimeType = getMIMETypeForExtension(ext);
- if (!mimeType.isEmpty())
- return mimeType;
-
- // No match, look in the static mapping.
- if (!mediaMIMETypeForExtensionMap)
- initializeMediaTypeMaps();
- return mediaMIMETypeForExtensionMap->get(ext);
+ if (mediaMIMETypeMap().contains(ext))
+ return (*mediaMIMETypeMap().get(ext))[0];
+
+ return String();
+}
+
+Vector<String> MIMETypeRegistry::getMediaMIMETypesForExtension(const String& ext)
+{
+ if (mediaMIMETypeMap().contains(ext))
+ return *mediaMIMETypeMap().get(ext);
+
+ return Vector<String>();
}
static void initializeSupportedMediaMIMETypes()
diff --git a/WebCore/platform/MIMETypeRegistry.h b/WebCore/platform/MIMETypeRegistry.h
index 27c2c3a..f71b478 100644
--- a/WebCore/platform/MIMETypeRegistry.h
+++ b/WebCore/platform/MIMETypeRegistry.h
@@ -35,10 +35,11 @@ namespace WebCore {
class MIMETypeRegistry {
public:
- static String getMIMETypeForExtension(const String& ext);
+ static String getMIMETypeForExtension(const String& extension);
static Vector<String> getExtensionsForMIMEType(const String& type);
static String getPreferredExtensionForMIMEType(const String& type);
- static String getMediaMIMETypeForExtension(const String& ext);
+ static String getMediaMIMETypeForExtension(const String& extension);
+ static Vector<String> getMediaMIMETypesForExtension(const String& extension);
static String getMIMETypeForPath(const String& path);
diff --git a/WebCore/platform/Pasteboard.h b/WebCore/platform/Pasteboard.h
index c3476a9..7ee8e81 100644
--- a/WebCore/platform/Pasteboard.h
+++ b/WebCore/platform/Pasteboard.h
@@ -43,10 +43,16 @@
// knowledge of the frame and editor or moved into the editing directory.
#if PLATFORM(MAC)
+#ifdef __OBJC__
+@class NSFileWrapper;
+@class NSPasteboard;
+@class NSArray;
+#else
class NSFileWrapper;
class NSPasteboard;
class NSArray;
#endif
+#endif
#if PLATFORM(WIN)
#include <windows.h>
diff --git a/WebCore/platform/PlatformKeyboardEvent.h b/WebCore/platform/PlatformKeyboardEvent.h
index ddb1680..824587e 100644
--- a/WebCore/platform/PlatformKeyboardEvent.h
+++ b/WebCore/platform/PlatformKeyboardEvent.h
@@ -63,7 +63,8 @@ class BMessage;
#endif
#if PLATFORM(EFL)
-#include <Evas.h>
+typedef struct _Evas_Event_Key_Down Evas_Event_Key_Down;
+typedef struct _Evas_Event_Key_Up Evas_Event_Key_Up;
#endif
#if PLATFORM(BREWMP)
diff --git a/WebCore/platform/PlatformMouseEvent.h b/WebCore/platform/PlatformMouseEvent.h
index be25973..725945a 100644
--- a/WebCore/platform/PlatformMouseEvent.h
+++ b/WebCore/platform/PlatformMouseEvent.h
@@ -34,7 +34,9 @@ typedef struct _GdkEventMotion GdkEventMotion;
#endif
#if PLATFORM(EFL)
-#include <Evas.h>
+typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down;
+typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up;
+typedef struct _Evas_Event_Mouse_Move Evas_Event_Mouse_Move;
#endif
#if PLATFORM(QT)
@@ -126,7 +128,7 @@ namespace WebCore {
#endif
#if PLATFORM(EFL)
- void setClickCount(Evas_Button_Flags);
+ void setClickCount(unsigned int);
PlatformMouseEvent(const Evas_Event_Mouse_Down*, IntPoint);
PlatformMouseEvent(const Evas_Event_Mouse_Up*, IntPoint);
PlatformMouseEvent(const Evas_Event_Mouse_Move*, IntPoint);
diff --git a/WebCore/platform/PlatformStrategies.cpp b/WebCore/platform/PlatformStrategies.cpp
new file mode 100644
index 0000000..e0baa70
--- /dev/null
+++ b/WebCore/platform/PlatformStrategies.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(PLATFORM_STRATEGIES)
+
+#include "PlatformStrategies.h"
+
+namespace WebCore {
+
+static PlatformStrategies* s_platformStrategies;
+
+PlatformStrategies* platformStrategies()
+{
+ ASSERT(s_platformStrategies);
+
+ return s_platformStrategies;
+}
+
+void setPlatformStrategies(PlatformStrategies* platformStrategies)
+{
+ if (!s_platformStrategies) {
+ s_platformStrategies = platformStrategies;
+ return;
+ }
+
+ // FIXME: This happens when mixing different platform strategies, and we should probably
+ // throw an exception here in release builds.
+ ASSERT(platformStrategies != s_platformStrategies);
+}
+
+} // namespace WebCore
+
+#endif // USE(PLATFORM_STRATEGIES)
diff --git a/WebCore/platform/PlatformStrategies.h b/WebCore/platform/PlatformStrategies.h
new file mode 100644
index 0000000..22da3ac
--- /dev/null
+++ b/WebCore/platform/PlatformStrategies.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformStrategies_h
+#define PlatformStrategies_h
+
+#if USE(PLATFORM_STRATEGIES)
+
+namespace WebCore {
+
+class PluginStrategy;
+
+class PlatformStrategies {
+public:
+ PluginStrategy* pluginStrategy()
+ {
+ if (!m_pluginStrategy)
+ m_pluginStrategy = createPluginStrategy();
+
+ return m_pluginStrategy;
+ }
+
+protected:
+ PlatformStrategies()
+ : m_pluginStrategy(0)
+ {
+ }
+ virtual ~PlatformStrategies() { }
+
+private:
+ virtual PluginStrategy* createPluginStrategy() = 0;
+
+ PluginStrategy* m_pluginStrategy;
+};
+
+PlatformStrategies* platformStrategies();
+void setPlatformStrategies(PlatformStrategies*);
+
+} // namespace WebCore
+
+#endif // USE(PLATFORM_STRATEGIES)
+
+#endif // PlatformStrategies_h
diff --git a/WebCore/platform/PlatformWheelEvent.h b/WebCore/platform/PlatformWheelEvent.h
index 6651334..6747392 100644
--- a/WebCore/platform/PlatformWheelEvent.h
+++ b/WebCore/platform/PlatformWheelEvent.h
@@ -33,7 +33,7 @@ typedef struct _GdkEventScroll GdkEventScroll;
#endif
#if PLATFORM(EFL)
-#include <Evas.h>
+typedef struct _Evas_Event_Mouse_Wheel Evas_Event_Mouse_Wheel;
#endif
#if PLATFORM(QT)
diff --git a/WebCore/platform/PopupMenu.h b/WebCore/platform/PopupMenu.h
index f25a63b..d9d2740 100644
--- a/WebCore/platform/PopupMenu.h
+++ b/WebCore/platform/PopupMenu.h
@@ -182,7 +182,7 @@ private:
static void menuUnmapped(GtkWidget*, PopupMenu*);
static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, PopupMenu*);
static void menuRemoveItem(GtkWidget*, PopupMenu*);
-#elif PLATFORM(EFL)
+#elif PLATFORM(EFL) || PLATFORM(BREWMP)
FrameView* m_view;
#elif PLATFORM(WX)
wxMenu* m_menu;
diff --git a/WebCore/platform/ScrollView.cpp b/WebCore/platform/ScrollView.cpp
index 87d58c7..615ae5d 100644
--- a/WebCore/platform/ScrollView.cpp
+++ b/WebCore/platform/ScrollView.cpp
@@ -543,7 +543,8 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
if (canBlitOnScroll()) { // The main frame can just blit the WebView window
// FIXME: Find a way to scroll subframes with this faster path
- hostWindow()->scroll(-scrollDelta, scrollViewRect, clipRect);
+ if (!scrollContentsFastPath(-scrollDelta, scrollViewRect, clipRect))
+ hostWindow()->invalidateContentsForSlowScroll(updateRect, false);
} else {
// We need to go ahead and repaint the entire backing store. Do it now before moving the
// windowed plugins.
@@ -557,6 +558,12 @@ void ScrollView::scrollContents(const IntSize& scrollDelta)
hostWindow()->invalidateWindow(IntRect(), true);
}
+bool ScrollView::scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
+{
+ hostWindow()->scroll(scrollDelta, rectToScroll, clipRect);
+ return true;
+}
+
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
{
IntPoint viewPoint = convertFromContainingWindow(windowPoint);
diff --git a/WebCore/platform/ScrollView.h b/WebCore/platform/ScrollView.h
index 8bda7af..6853969 100644
--- a/WebCore/platform/ScrollView.h
+++ b/WebCore/platform/ScrollView.h
@@ -265,6 +265,9 @@ protected:
virtual void updateScrollCorner();
virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
+ // Scroll the content by blitting the pixels
+ virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
+
private:
RefPtr<Scrollbar> m_horizontalScrollbar;
RefPtr<Scrollbar> m_verticalScrollbar;
diff --git a/WebCore/platform/ThemeTypes.h b/WebCore/platform/ThemeTypes.h
index 7314fba..271bd83 100644
--- a/WebCore/platform/ThemeTypes.h
+++ b/WebCore/platform/ThemeTypes.h
@@ -47,7 +47,7 @@ typedef unsigned ControlStates;
// Must follow CSSValueKeywords.in order
enum ControlPart {
NoControlPart, CheckboxPart, RadioPart, PushButtonPart, SquareButtonPart, ButtonPart,
- ButtonBevelPart, DefaultButtonPart, InnerSpinButtonPart, ListButtonPart, ListboxPart, ListItemPart,
+ ButtonBevelPart, DefaultButtonPart, InnerSpinButtonPart, InputSpeechButtonPart, ListButtonPart, ListboxPart, ListItemPart,
MediaFullscreenButtonPart, MediaMuteButtonPart, MediaPlayButtonPart, MediaSeekBackButtonPart,
MediaSeekForwardButtonPart, MediaRewindButtonPart, MediaReturnToRealtimeButtonPart, MediaToggleClosedCaptionsButtonPart,
MediaSliderPart, MediaSliderThumbPart, MediaVolumeSliderContainerPart, MediaVolumeSliderPart, MediaVolumeSliderThumbPart,
diff --git a/WebCore/platform/ThreadTimers.h b/WebCore/platform/ThreadTimers.h
index 01b4c71..ab42598 100644
--- a/WebCore/platform/ThreadTimers.h
+++ b/WebCore/platform/ThreadTimers.h
@@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ThreadTimer_h
-#define ThreadTimer_h
+#ifndef ThreadTimers_h
+#define ThreadTimers_h
#include <wtf/Noncopyable.h>
#include <wtf/HashSet.h>
diff --git a/WebCore/platform/Widget.h b/WebCore/platform/Widget.h
index 795dac3..d6ff597 100644
--- a/WebCore/platform/Widget.h
+++ b/WebCore/platform/Widget.h
@@ -78,8 +78,9 @@ typedef BView* PlatformWidget;
#endif
#if PLATFORM(EFL)
-#include <Ecore_Evas.h>
-#include <Evas.h>
+typedef struct _Evas_Object Evas_Object;
+typedef struct _Evas Evas;
+typedef struct _Ecore_Evas Ecore_Evas;
typedef Evas_Object* PlatformWidget;
#endif
diff --git a/WebCore/platform/brew/DragDataBrew.cpp b/WebCore/platform/brew/DragDataBrew.cpp
index 20f93b8..eec8bc4 100644
--- a/WebCore/platform/brew/DragDataBrew.cpp
+++ b/WebCore/platform/brew/DragDataBrew.cpp
@@ -68,17 +68,16 @@ bool DragData::containsCompatibleContent() const
return false;
}
-bool DragData::containsURL() const
+bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
{
return false;
}
-String DragData::asURL(String*) const
+String DragData::asURL(FilenameConversionPolicy filenamePolicy, String*) const
{
return String();
}
-
PassRefPtr<DocumentFragment> DragData::asFragment(Document*) const
{
return 0;
diff --git a/WebCore/platform/brew/FileSystemBrew.cpp b/WebCore/platform/brew/FileSystemBrew.cpp
new file mode 100644
index 0000000..88aa05b
--- /dev/null
+++ b/WebCore/platform/brew/FileSystemBrew.cpp
@@ -0,0 +1,259 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "FileSystem.h"
+
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "StringBuilder.h"
+
+#include <AEEAppGen.h>
+#include <AEEFile.h>
+#include <AEEStdLib.h>
+
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RandomNumber.h>
+#include <wtf/brew/ShellBrew.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+bool getFileSize(const String& path, long long& result)
+{
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+ FileInfo info;
+
+ if (IFILEMGR_GetInfo(fileMgr.get(), path.utf8().data(), &info) == SUCCESS) {
+ result = info.dwSize;
+ return true;
+ }
+
+ return false;
+}
+
+bool getFileModificationTime(const String& path, time_t& result)
+{
+ // There is no way to get file modification time in BREW. IFILEMGR_GetInfoEx() returns
+ // only file creation time.
+ return false;
+}
+
+bool fileExists(const String& path)
+{
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+
+ return (IFILEMGR_Test(fileMgr.get(), path.utf8().data()) == SUCCESS);
+}
+
+bool deleteFile(const String& path)
+{
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+
+ return (IFILEMGR_Remove(fileMgr.get(), path.utf8().data()) == SUCCESS);
+}
+
+bool deleteEmptyDirectory(const String& path)
+{
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+
+ return (IFILEMGR_RmDir(fileMgr.get(), path.utf8().data()) == SUCCESS);
+}
+
+String pathByAppendingComponent(const String& path, const String& component)
+{
+ if (component.isEmpty())
+ return path;
+
+ Vector<UChar, 1024> buffer;
+
+ buffer.append(path.characters(), path.length());
+
+ if (buffer.last() != L'/' && component[0] != L'/')
+ buffer.append(L'/');
+
+ buffer.append(component.characters(), component.length());
+
+ return String(buffer.data(), buffer.size());
+}
+
+CString fileSystemRepresentation(const String& path)
+{
+ return path.utf8();
+}
+
+static String canonicalPath(const String& path)
+{
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+
+ // Get the buffer size required to resolve the path.
+ int canonPathLen;
+ IFILEMGR_ResolvePath(fileMgr.get(), path.utf8().data(), 0, &canonPathLen);
+
+ // Resolve the path to the canonical path.
+ Vector<char> canonPathBuffer(canonPathLen);
+ IFILEMGR_ResolvePath(fileMgr.get(), path.utf8().data(), canonPathBuffer.data(), &canonPathLen);
+
+ String canonPath(canonPathBuffer.data());
+
+ // Remove the trailing '/'.
+ int lastDivPos = canonPath.reverseFind('/');
+ int endPos = canonPath.length();
+ if (lastDivPos == endPos - 1)
+ canonPath = canonPath.substring(0, canonPath.length() - 1);
+
+ return canonPath;
+}
+
+static bool makeAllDirectories(PassOwnPtr<IFileMgr> fileMgr, const String& path)
+{
+ if (path == canonicalPath(AEEFS_HOME_DIR))
+ return true;
+
+ int lastDivPos = path.reverseFind('/');
+ int endPos = path.length();
+ if (lastDivPos == path.length() - 1) {
+ endPos -= 1;
+ lastDivPos = path.reverseFind('/', lastDivPos);
+ }
+
+ if (lastDivPos > 0) {
+ if (!makeAllDirectories(fileMgr.release(), path.substring(0, lastDivPos)))
+ return false;
+ }
+
+ String folder(path.substring(0, endPos));
+
+ // IFILEMGR_MkDir return SUCCESS when the file is successfully created or if file already exists.
+ // So we need to check fileinfo.attrib.
+ IFILEMGR_MkDir(fileMgr.get(), folder.utf8().data());
+
+ FileInfo fileInfo;
+ if (IFILEMGR_GetInfo(fileMgr.get(), folder.utf8().data(), &fileInfo) != SUCCESS)
+ return false;
+
+ return fileInfo.attrib & _FA_DIR;
+}
+
+bool makeAllDirectories(const String& path)
+{
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+
+ return makeAllDirectories(fileMgr.release(), canonicalPath(path));
+}
+
+String homeDirectoryPath()
+{
+ return String(AEEFS_HOME_DIR);
+}
+
+String pathGetFileName(const String& path)
+{
+ return path.substring(path.reverseFind('/') + 1);
+}
+
+String directoryName(const String& path)
+{
+ String fileName = pathGetFileName(path);
+ String dirName = String(path);
+ dirName.truncate(dirName.length() - pathGetFileName(path).length());
+ return dirName;
+}
+
+CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
+{
+ // BREW does not have a system-wide temporary directory,
+ // use "fs:/~/tmp" as our temporary directory.
+ String tempPath("fs:/~/tmp");
+
+ OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR);
+
+ // Create the temporary directory if it does not exist.
+ IFILEMGR_MkDir(fileMgr.get(), tempPath.utf8().data());
+
+ // Loop until we find a temporary filename that does not exist.
+ int number = static_cast<int>(randomNumber() * 10000);
+ CString filename;
+ do {
+ StringBuilder builder;
+ builder.append(tempPath);
+ builder.append('/');
+ builder.append(prefix);
+ builder.append(String::number(number));
+ filename = builder.toString().utf8();
+ number++;
+ } while (IFILEMGR_Test(fileMgr.get(), filename.data()) == SUCCESS);
+
+ IFile* tempFile = IFILEMGR_OpenFile(fileMgr.get(), filename.data(), _OFM_CREATE);
+ if (tempFile) {
+ handle = tempFile;
+ return filename;
+ }
+
+ return CString();
+}
+
+void closeFile(PlatformFileHandle& handle)
+{
+ if (isHandleValid(handle)) {
+ IFILE_Release(handle);
+ handle = invalidPlatformFileHandle;
+ }
+}
+
+int writeToFile(PlatformFileHandle handle, const char* data, int length)
+{
+ if (!isHandleValid(handle))
+ return -1;
+
+ int bytesWritten = IFILE_Write(handle, data, length);
+ if (!bytesWritten)
+ return -1;
+ return bytesWritten;
+}
+
+bool unloadModule(PlatformModule module)
+{
+ notImplemented();
+
+ return false;
+}
+
+Vector<String> listDirectory(const String& path, const String& filter)
+{
+ Vector<String> entries;
+
+ // OK to not implement listDirectory, because it's only used for plug-ins and
+ // Brew MP does not support the plug-in at the moment.
+ notImplemented();
+
+ return entries;
+}
+
+}
diff --git a/WebCore/platform/brew/PopupMenuBrew.cpp b/WebCore/platform/brew/PopupMenuBrew.cpp
new file mode 100644
index 0000000..89f3fa1
--- /dev/null
+++ b/WebCore/platform/brew/PopupMenuBrew.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
+ * Copyright (C) 2009-2010 ProFUSION embedded systems
+ * Copyright (C) 2009-2010 Samsung Electronics
+ * Copyright (C) 2010 Company 100, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "config.h"
+#include "PopupMenu.h"
+
+#include "Chrome.h"
+#include "ChromeClientBrew.h"
+#include "FrameView.h"
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+PopupMenu::PopupMenu(PopupMenuClient* menuList)
+ : m_popupClient(menuList)
+ , m_view(0)
+{
+}
+
+PopupMenu::~PopupMenu()
+{
+}
+
+void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
+{
+ ASSERT(m_popupClient);
+ ChromeClientBrew* chromeClient = static_cast<ChromeClientBrew*>(view->frame()->page()->chrome()->client());
+ ASSERT(chromeClient);
+
+ m_view = view;
+ chromeClient->createSelectPopup(m_popupClient, index, rect);
+}
+
+void PopupMenu::hide()
+{
+ ASSERT(m_view);
+ ChromeClientBrew* chromeClient = static_cast<ChromeClientBrew*>(m_view->frame()->page()->chrome()->client());
+ ASSERT(chromeClient);
+
+ chromeClient->destroySelectPopup();
+}
+
+void PopupMenu::updateFromElement()
+{
+ client()->setTextFromItem(client()->selectedIndex());
+}
+
+bool PopupMenu::itemWritingDirectionIsNatural()
+{
+ return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/chromium/ChromiumBridge.h b/WebCore/platform/chromium/ChromiumBridge.h
index f1dc95b..3e9406d 100644
--- a/WebCore/platform/chromium/ChromiumBridge.h
+++ b/WebCore/platform/chromium/ChromiumBridge.h
@@ -44,6 +44,16 @@ typedef struct NPObject NPObject;
typedef struct _NPP NPP_t;
typedef NPP_t* NPP;
+#if OS(DARWIN)
+typedef struct CGFont* CGFontRef;
+typedef uintptr_t ATSFontContainerRef;
+#ifdef __OBJC__
+@class NSFont;
+#else
+class NSFont;
+#endif
+#endif // OS(DARWIN)
+
#if OS(WINDOWS)
typedef struct HFONT__* HFONT;
#endif
@@ -127,6 +137,9 @@ namespace WebCore {
static void getRenderStyleForStrike(const char* family, int sizeAndStyle, FontRenderStyle* result);
static String getFontFamilyForCharacters(const UChar*, size_t numCharacters);
#endif
+#if OS(DARWIN)
+ static bool loadFont(NSFont* srcFont, ATSFontContainerRef* out);
+#endif
// Forms --------------------------------------------------------------
static void notifyFormStateChanged(const Document*);
diff --git a/WebCore/platform/chromium/ChromiumDataObject.cpp b/WebCore/platform/chromium/ChromiumDataObject.cpp
index 5c67c65..8352669 100644
--- a/WebCore/platform/chromium/ChromiumDataObject.cpp
+++ b/WebCore/platform/chromium/ChromiumDataObject.cpp
@@ -67,7 +67,8 @@ bool ChromiumDataObject::hasData() const
}
ChromiumDataObject::ChromiumDataObject(const ChromiumDataObject& other)
- : urlTitle(other.urlTitle)
+ : RefCounted<ChromiumDataObject>()
+ , urlTitle(other.urlTitle)
, downloadMetadata(other.downloadMetadata)
, fileExtension(other.fileExtension)
, filenames(other.filenames)
diff --git a/WebCore/platform/chromium/ClipboardChromium.cpp b/WebCore/platform/chromium/ClipboardChromium.cpp
index 750ff30..29f9620 100644
--- a/WebCore/platform/chromium/ClipboardChromium.cpp
+++ b/WebCore/platform/chromium/ClipboardChromium.cpp
@@ -512,8 +512,7 @@ void ClipboardChromium::writeRange(Range* selectedRange, Frame* frame)
if (!m_dataObject)
return;
- m_dataObject->textHtml = createMarkup(selectedRange, 0,
- AnnotateForInterchange);
+ m_dataObject->textHtml = createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs);
m_dataObject->htmlBaseUrl = frame->document()->url();
String str = frame->selectedText();
diff --git a/WebCore/platform/chromium/KeyboardCodes.h b/WebCore/platform/chromium/KeyboardCodes.h
index ee4024a..a58ba35 100644
--- a/WebCore/platform/chromium/KeyboardCodes.h
+++ b/WebCore/platform/chromium/KeyboardCodes.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KeyboardCodesWin_h
-#define KeyboardCodesWin_h
+#ifndef KeyboardCodes_h
+#define KeyboardCodes_h
#if OS(WINDOWS)
#include <windows.h>
diff --git a/WebCore/platform/chromium/PasteboardChromium.cpp b/WebCore/platform/chromium/PasteboardChromium.cpp
index 0455482..58373b1 100644
--- a/WebCore/platform/chromium/PasteboardChromium.cpp
+++ b/WebCore/platform/chromium/PasteboardChromium.cpp
@@ -81,7 +81,7 @@ void Pasteboard::setSelectionMode(bool selectionMode)
void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
{
- String html = createMarkup(selectedRange, 0, AnnotateForInterchange);
+ String html = createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs);
ExceptionCode ec = 0;
KURL url = selectedRange->startContainer(ec)->document()->url();
String plainText = frame->selectedText();
diff --git a/WebCore/platform/chromium/ThemeChromiumMac.mm b/WebCore/platform/chromium/ThemeChromiumMac.mm
index 15a8382..5769e38 100644
--- a/WebCore/platform/chromium/ThemeChromiumMac.mm
+++ b/WebCore/platform/chromium/ThemeChromiumMac.mm
@@ -271,7 +271,8 @@ static void updateStates(NSCell* cell, ControlStates states)
// Window Inactive state
NSControlTint oldTint = [cell controlTint];
bool windowInactive = (states & WindowInactiveState);
- NSControlTint tint = windowInactive ? NSClearControlTint : [NSColor currentControlTint];
+ NSControlTint tint = windowInactive ? static_cast<NSControlTint>(NSClearControlTint)
+ : [NSColor currentControlTint];
if (tint != oldTint)
[cell setControlTint:tint];
}
diff --git a/WebCore/platform/efl/FileChooserEfl.cpp b/WebCore/platform/efl/FileChooserEfl.cpp
index 866caae..c77fa9e 100644
--- a/WebCore/platform/efl/FileChooserEfl.cpp
+++ b/WebCore/platform/efl/FileChooserEfl.cpp
@@ -31,6 +31,7 @@
#include "FileChooser.h"
#include "LocalizedStrings.h"
+#include "StringTruncator.h"
namespace WebCore {
@@ -39,8 +40,15 @@ String FileChooser::basenameForWidth(const Font& font, int width) const
if (width <= 0)
return String();
+ String string;
if (m_filenames.isEmpty())
- return fileButtonNoFileSelectedLabel();
+ string = fileButtonNoFileSelectedLabel();
+ else if (m_filenames.size() == 1)
+ string = m_filenames[0];
+ else
+ return StringTruncator::rightTruncate(multipleFileUploadText(m_filenames.size()), width, font, false);
+
+ return StringTruncator::centerTruncate(string, static_cast<float>(width), font, false);
}
}
diff --git a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
index f2f03a4..70e317e 100644
--- a/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
+++ b/WebCore/platform/efl/PlatformKeyboardEventEfl.cpp
@@ -37,6 +37,7 @@
#include "TextEncoding.h"
#include "WindowsKeyboardCodes.h"
+#include <Evas.h>
#include <stdio.h>
#include <wtf/HashMap.h>
#include <wtf/text/CString.h>
diff --git a/WebCore/platform/efl/PlatformMouseEventEfl.cpp b/WebCore/platform/efl/PlatformMouseEventEfl.cpp
index a03614c..53de522 100644
--- a/WebCore/platform/efl/PlatformMouseEventEfl.cpp
+++ b/WebCore/platform/efl/PlatformMouseEventEfl.cpp
@@ -37,7 +37,7 @@
namespace WebCore {
-void PlatformMouseEvent::setClickCount(Evas_Button_Flags flags)
+void PlatformMouseEvent::setClickCount(unsigned int flags)
{
if (flags & EVAS_BUTTON_TRIPLE_CLICK)
m_clickCount = 3;
diff --git a/WebCore/platform/efl/PlatformWheelEventEfl.cpp b/WebCore/platform/efl/PlatformWheelEventEfl.cpp
index 08bda5e..704db38 100644
--- a/WebCore/platform/efl/PlatformWheelEventEfl.cpp
+++ b/WebCore/platform/efl/PlatformWheelEventEfl.cpp
@@ -33,6 +33,8 @@
#include "Scrollbar.h"
+#include <Evas.h>
+
namespace WebCore {
enum {
diff --git a/WebCore/platform/efl/RenderThemeEfl.cpp b/WebCore/platform/efl/RenderThemeEfl.cpp
index 2773b0d..6ed7599 100644
--- a/WebCore/platform/efl/RenderThemeEfl.cpp
+++ b/WebCore/platform/efl/RenderThemeEfl.cpp
@@ -36,6 +36,7 @@
#include "RenderObject.h"
#include <wtf/text/CString.h>
+#include <Ecore_Evas.h>
#include <Edje.h>
namespace WebCore {
diff --git a/WebCore/platform/efl/RenderThemeEfl.h b/WebCore/platform/efl/RenderThemeEfl.h
index 3ebd29d..22e0608 100644
--- a/WebCore/platform/efl/RenderThemeEfl.h
+++ b/WebCore/platform/efl/RenderThemeEfl.h
@@ -32,10 +32,11 @@
#include "RenderTheme.h"
-#include <Ecore_Evas.h>
-#include <Evas.h>
#include <cairo.h>
+typedef struct _Ecore_Evas Ecore_Evas;
+typedef struct _Evas_Object Evas_Object;
+
namespace WebCore {
enum FormType { // KEEP IN SYNC WITH edjeGroupFromFormType()
diff --git a/WebCore/platform/efl/ScrollbarEfl.cpp b/WebCore/platform/efl/ScrollbarEfl.cpp
index 5b8002d..1030ebd 100644
--- a/WebCore/platform/efl/ScrollbarEfl.cpp
+++ b/WebCore/platform/efl/ScrollbarEfl.cpp
@@ -35,6 +35,7 @@
#include <Ecore.h>
#include <Edje.h>
+#include <Evas.h>
#include <string>
#include <wtf/text/CString.h>
diff --git a/WebCore/platform/efl/ScrollbarEfl.h b/WebCore/platform/efl/ScrollbarEfl.h
index cd85888..35375a6 100644
--- a/WebCore/platform/efl/ScrollbarEfl.h
+++ b/WebCore/platform/efl/ScrollbarEfl.h
@@ -30,7 +30,6 @@
#define ScrollbarEfl_h
#include "Scrollbar.h"
-#include <Evas.h>
#include <wtf/PassRefPtr.h>
namespace WebCore {
diff --git a/WebCore/platform/efl/WidgetEfl.cpp b/WebCore/platform/efl/WidgetEfl.cpp
index 9e335f7..725e56f 100644
--- a/WebCore/platform/efl/WidgetEfl.cpp
+++ b/WebCore/platform/efl/WidgetEfl.cpp
@@ -41,6 +41,7 @@
#include "Page.h"
#include <Ecore.h>
+#include <Ecore_Evas.h>
#include <Edje.h>
#include <Evas.h>
diff --git a/WebCore/platform/graphics/BitmapImage.h b/WebCore/platform/graphics/BitmapImage.h
index e5591ec..2cf30d3 100644
--- a/WebCore/platform/graphics/BitmapImage.h
+++ b/WebCore/platform/graphics/BitmapImage.h
@@ -57,7 +57,7 @@ namespace WebCore {
// invoking our constructor or destructor. This allows us to have a vector even for a struct
// that's not copyable.
namespace WTF {
- template<> class VectorTraits<WebCore::FrameData> : public SimpleClassVectorTraits {};
+ template<> struct VectorTraits<WebCore::FrameData> : public SimpleClassVectorTraits {};
}
namespace WebCore {
diff --git a/WebCore/platform/graphics/FloatRect.h b/WebCore/platform/graphics/FloatRect.h
index 4c3a382..b265121 100644
--- a/WebCore/platform/graphics/FloatRect.h
+++ b/WebCore/platform/graphics/FloatRect.h
@@ -29,10 +29,6 @@
#include "FloatPoint.h"
-#if PLATFORM(EFL)
-#include <Evas.h>
-#endif
-
#if PLATFORM(CG)
typedef struct CGRect CGRect;
#endif
@@ -149,11 +145,6 @@ public:
operator QRectF() const;
#endif
-#if PLATFORM(EFL)
- explicit FloatRect(const Eina_Rectangle&);
- operator Eina_Rectangle() const;
-#endif
-
#if PLATFORM(WX) && USE(WXGC)
FloatRect(const wxRect2DDouble&);
operator wxRect2DDouble() const;
diff --git a/WebCore/platform/graphics/Font.cpp b/WebCore/platform/graphics/Font.cpp
index 6414147..0351f7b 100644
--- a/WebCore/platform/graphics/Font.cpp
+++ b/WebCore/platform/graphics/Font.cpp
@@ -191,7 +191,7 @@ float Font::floatWidth(const TextRun& run, int extraCharsAvailable, int& charsCo
return floatWidthForComplexText(run);
}
-FloatRect Font::selectionRectForText(const TextRun& run, const IntPoint& point, int h, int from, int to) const
+FloatRect Font::selectionRectForText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
{
#if ENABLE(SVG_FONTS)
if (primaryFont()->isSVGFont())
@@ -206,7 +206,7 @@ FloatRect Font::selectionRectForText(const TextRun& run, const IntPoint& point,
return selectionRectForComplexText(run, point, h, from, to);
}
-int Font::offsetForPosition(const TextRun& run, int x, bool includePartialGlyphs) const
+int Font::offsetForPosition(const TextRun& run, float x, bool includePartialGlyphs) const
{
#if ENABLE(SVG_FONTS)
if (primaryFont()->isSVGFont())
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index 2b36cca..ecfde98 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -50,7 +50,6 @@ class FontSelector;
class GlyphBuffer;
class GlyphPageTreeNode;
class GraphicsContext;
-class IntPoint;
class SVGFontElement;
struct GlyphData;
@@ -99,8 +98,8 @@ public:
float floatWidth(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* glyphOverflow = 0) const;
float floatWidth(const TextRun& run, int extraCharsAvailable, int& charsConsumed, String& glyphName) const;
- int offsetForPosition(const TextRun&, int position, bool includePartialGlyphs) const;
- FloatRect selectionRectForText(const TextRun&, const IntPoint&, int h, int from = 0, int to = -1) const;
+ int offsetForPosition(const TextRun&, float position, bool includePartialGlyphs) const;
+ FloatRect selectionRectForText(const TextRun&, const FloatPoint&, int h, int from = 0, int to = -1) const;
bool isSmallCaps() const { return m_fontDescription.smallCaps(); }
@@ -158,24 +157,24 @@ private:
void drawTextUsingSVGFont(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const;
float floatWidthUsingSVGFont(const TextRun&) const;
float floatWidthUsingSVGFont(const TextRun&, int extraCharsAvailable, int& charsConsumed, String& glyphName) const;
- FloatRect selectionRectForTextUsingSVGFont(const TextRun&, const IntPoint&, int h, int from, int to) const;
- int offsetForPositionForTextUsingSVGFont(const TextRun&, int position, bool includePartialGlyphs) const;
+ FloatRect selectionRectForTextUsingSVGFont(const TextRun&, const FloatPoint&, int h, int from, int to) const;
+ int offsetForPositionForTextUsingSVGFont(const TextRun&, float position, bool includePartialGlyphs) const;
#endif
void drawSimpleText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const;
void drawGlyphs(GraphicsContext*, const SimpleFontData*, const GlyphBuffer&, int from, int to, const FloatPoint&) const;
void drawGlyphBuffer(GraphicsContext*, const GlyphBuffer&, const TextRun&, const FloatPoint&) const;
float floatWidthForSimpleText(const TextRun&, GlyphBuffer*, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
- int offsetForPositionForSimpleText(const TextRun&, int position, bool includePartialGlyphs) const;
- FloatRect selectionRectForSimpleText(const TextRun&, const IntPoint&, int h, int from, int to) const;
+ int offsetForPositionForSimpleText(const TextRun&, float position, bool includePartialGlyphs) const;
+ FloatRect selectionRectForSimpleText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
static bool canReturnFallbackFontsForComplexText();
CodePath codePath(const TextRun&) const;
void drawComplexText(GraphicsContext*, const TextRun&, const FloatPoint&, int from, int to) const;
float floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontData*>* fallbackFonts = 0, GlyphOverflow* = 0) const;
- int offsetForPositionForComplexText(const TextRun&, int position, bool includePartialGlyphs) const;
- FloatRect selectionRectForComplexText(const TextRun&, const IntPoint&, int h, int from, int to) const;
+ int offsetForPositionForComplexText(const TextRun&, float position, bool includePartialGlyphs) const;
+ FloatRect selectionRectForComplexText(const TextRun&, const FloatPoint&, int h, int from, int to) const;
friend struct WidthIterator;
diff --git a/WebCore/platform/graphics/FontCache.h b/WebCore/platform/graphics/FontCache.h
index dd5928d..1a3ba69 100644
--- a/WebCore/platform/graphics/FontCache.h
+++ b/WebCore/platform/graphics/FontCache.h
@@ -72,6 +72,7 @@ public:
#endif
static void comInitialize();
static void comUninitialize();
+ static IMultiLanguage* getMultiLanguageInterface();
#elif PLATFORM(WIN)
IMLangFontLink2* getFontLinkInterface();
#endif
diff --git a/WebCore/platform/graphics/FontFastPath.cpp b/WebCore/platform/graphics/FontFastPath.cpp
index b863e83..82f970f 100644
--- a/WebCore/platform/graphics/FontFastPath.cpp
+++ b/WebCore/platform/graphics/FontFastPath.cpp
@@ -29,7 +29,6 @@
#include "FontFallbackList.h"
#include "GlyphBuffer.h"
#include "GlyphPageTreeNode.h"
-#include "IntPoint.h"
#include "SimpleFontData.h"
#include "WidthIterator.h"
@@ -257,7 +256,7 @@ float Font::floatWidthForSimpleText(const TextRun& run, GlyphBuffer* glyphBuffer
return it.m_runWidthSoFar;
}
-FloatRect Font::selectionRectForSimpleText(const TextRun& run, const IntPoint& point, int h, int from, int to) const
+FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
{
WidthIterator it(this, run);
it.advance(from);
@@ -265,19 +264,19 @@ FloatRect Font::selectionRectForSimpleText(const TextRun& run, const IntPoint& p
it.advance(to);
float afterWidth = it.m_runWidthSoFar;
- // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning
+ // Using roundf() rather than ceilf() for the right edge as a compromise to ensure correct caret positioning.
if (run.rtl()) {
it.advance(run.length());
float totalWidth = it.m_runWidthSoFar;
return FloatRect(point.x() + floorf(totalWidth - afterWidth), point.y(), roundf(totalWidth - beforeWidth) - floorf(totalWidth - afterWidth), h);
- } else {
- return FloatRect(point.x() + floorf(beforeWidth), point.y(), roundf(afterWidth) - floorf(beforeWidth), h);
}
+
+ return FloatRect(point.x() + floorf(beforeWidth), point.y(), roundf(afterWidth) - floorf(beforeWidth), h);
}
-int Font::offsetForPositionForSimpleText(const TextRun& run, int x, bool includePartialGlyphs) const
+int Font::offsetForPositionForSimpleText(const TextRun& run, float x, bool includePartialGlyphs) const
{
- float delta = (float)x;
+ float delta = x;
WidthIterator it(this, run);
GlyphBuffer localGlyphBuffer;
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index 629d100..bee3ef6 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -129,7 +129,7 @@ void GraphicsContext::setStrokeColor(const Color& color, ColorSpace colorSpace)
setPlatformStrokeColor(color, colorSpace);
}
-void GraphicsContext::setShadow(const IntSize& size, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setShadow(const FloatSize& size, float blur, const Color& color, ColorSpace colorSpace)
{
m_common->state.shadowSize = size;
m_common->state.shadowBlur = blur;
@@ -145,7 +145,7 @@ void GraphicsContext::clearShadow()
clearPlatformShadow();
}
-bool GraphicsContext::getShadow(IntSize& size, float& blur, Color& color) const
+bool GraphicsContext::getShadow(FloatSize& size, float& blur, Color& color) const
{
size = m_common->state.shadowSize;
blur = m_common->state.shadowBlur;
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index b857546..8bcfc06 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -47,9 +47,7 @@ class SurfaceOpenVG;
}
typedef class WebCore::SurfaceOpenVG PlatformGraphicsContext;
#elif PLATFORM(QT)
-QT_BEGIN_NAMESPACE
-class QPainter;
-QT_END_NAMESPACE
+#include <QPainter>
typedef QPainter PlatformGraphicsContext;
#elif PLATFORM(WX)
class wxGCDC;
@@ -298,8 +296,8 @@ namespace WebCore {
void beginTransparencyLayer(float opacity);
void endTransparencyLayer();
- void setShadow(const IntSize&, float blur, const Color&, ColorSpace);
- bool getShadow(IntSize&, float&, Color&) const;
+ void setShadow(const FloatSize&, float blur, const Color&, ColorSpace);
+ bool getShadow(FloatSize&, float&, Color&) const;
void clearShadow();
void drawFocusRing(const Vector<IntRect>&, int width, int offset, const Color&);
@@ -314,7 +312,7 @@ namespace WebCore {
#if PLATFORM(CAIRO)
float getAlpha();
void createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const Color& shadowColor, const FloatRect& shadowRect, float kernelSize);
- static void calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const IntSize& shadowSize, float shadowBlur);
+ static void calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur);
#endif
void setCompositeOperation(CompositeOperator);
@@ -413,6 +411,7 @@ namespace WebCore {
bool inTransparencyLayer() const;
PlatformPath* currentPath();
QPen pen();
+ static QPainter::CompositionMode toQtCompositionMode(CompositeOperator op);
#endif
#if PLATFORM(GTK)
@@ -444,7 +443,7 @@ namespace WebCore {
void setPlatformShouldAntialias(bool b);
- void setPlatformShadow(const IntSize&, float blur, const Color&, ColorSpace);
+ void setPlatformShadow(const FloatSize&, float blur, const Color&, ColorSpace);
void clearPlatformShadow();
static void adjustLineToPixelBoundaries(FloatPoint& p1, FloatPoint& p2, float strokeWidth, const StrokeStyle&);
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index a5ca8c7..dc70734 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -35,31 +35,75 @@
namespace WebCore {
+bool GraphicsContext3D::computeFormatAndTypeParameters(unsigned int format,
+ unsigned int type,
+ unsigned long* componentsPerPixel,
+ unsigned long* bytesPerComponent)
+{
+ switch (format) {
+ case GraphicsContext3D::ALPHA:
+ *componentsPerPixel = 1;
+ break;
+ case GraphicsContext3D::LUMINANCE:
+ *componentsPerPixel = 1;
+ break;
+ case GraphicsContext3D::LUMINANCE_ALPHA:
+ *componentsPerPixel = 2;
+ break;
+ case GraphicsContext3D::RGB:
+ *componentsPerPixel = 3;
+ break;
+ case GraphicsContext3D::RGBA:
+ *componentsPerPixel = 4;
+ break;
+ default:
+ return false;
+ }
+ switch (type) {
+ case GraphicsContext3D::UNSIGNED_BYTE:
+ *bytesPerComponent = sizeof(unsigned char);
+ break;
+ case GraphicsContext3D::UNSIGNED_SHORT_5_6_5:
+ case GraphicsContext3D::UNSIGNED_SHORT_4_4_4_4:
+ case GraphicsContext3D::UNSIGNED_SHORT_5_5_5_1:
+ *componentsPerPixel = 1;
+ *bytesPerComponent = sizeof(unsigned short);
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
bool GraphicsContext3D::extractImageData(Image* image,
+ unsigned int format,
+ unsigned int type,
bool flipY,
bool premultiplyAlpha,
- Vector<uint8_t>& imageData,
- unsigned int* format,
- unsigned int* internalFormat)
+ Vector<uint8_t>& data)
{
if (!image)
return false;
- AlphaOp alphaOp = kAlphaDoNothing;
- bool hasAlphaChannel = true;
- if (!getImageData(image, imageData, premultiplyAlpha,
- &hasAlphaChannel, &alphaOp, format))
+ if (!getImageData(image, format, type, premultiplyAlpha, data))
return false;
- processImageData(imageData.data(),
- image->width(),
- image->height(),
- flipY,
- alphaOp);
- // For GLES2 tex functions, internalformat has to match format.
- *internalFormat = *format;
+ if (flipY) {
+ unsigned long componentsPerPixel, bytesPerComponent;
+ if (!computeFormatAndTypeParameters(format, type,
+ &componentsPerPixel,
+ &bytesPerComponent))
+ return false;
+ // The image data is tightly packed, and we upload it as such.
+ unsigned int unpackAlignment = 1;
+ flipVertically(data.data(), image->width(), image->height(),
+ componentsPerPixel * bytesPerComponent,
+ unpackAlignment);
+ }
return true;
}
bool GraphicsContext3D::extractImageData(ImageData* imageData,
+ unsigned int format,
+ unsigned int type,
bool flipY,
bool premultiplyAlpha,
Vector<uint8_t>& data)
@@ -70,83 +114,480 @@ bool GraphicsContext3D::extractImageData(ImageData* imageData,
int height = imageData->height();
int dataBytes = width * height * 4;
data.resize(dataBytes);
- uint8_t* dst = data.data();
- uint8_t* src = imageData->data()->data()->data();
- memcpy(dst, src, dataBytes);
- processImageData(dst,
- width,
- height,
- flipY,
- premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing);
+ if (!packPixels(imageData->data()->data()->data(),
+ kSourceFormatRGBA8,
+ width,
+ height,
+ format,
+ type,
+ premultiplyAlpha ? kAlphaDoPremultiply : kAlphaDoNothing,
+ data.data()))
+ return false;
+ if (flipY) {
+ unsigned long componentsPerPixel, bytesPerComponent;
+ if (!computeFormatAndTypeParameters(format, type,
+ &componentsPerPixel,
+ &bytesPerComponent))
+ return false;
+ // The image data is tightly packed, and we upload it as such.
+ unsigned int unpackAlignment = 1;
+ flipVertically(data.data(), width, height,
+ componentsPerPixel * bytesPerComponent,
+ unpackAlignment);
+ }
return true;
}
-void GraphicsContext3D::processImageData(uint8_t* imageData,
- unsigned width,
- unsigned height,
- bool flipVertically,
- AlphaOp alphaOp)
+void GraphicsContext3D::flipVertically(void* imageData,
+ unsigned int width,
+ unsigned int height,
+ unsigned int bytesPerPixel,
+ unsigned int unpackAlignment)
{
- switch (alphaOp) {
- case kAlphaDoPremultiply:
- premultiplyAlpha(imageData, width * height);
- break;
- case kAlphaDoUnmultiply:
- unmultiplyAlpha(imageData, width * height);
- break;
- default:
- break;
+ if (!width || !height)
+ return;
+ unsigned int validRowBytes = width * bytesPerPixel;
+ unsigned int totalRowBytes = validRowBytes;
+ unsigned int remainder = validRowBytes % unpackAlignment;
+ if (remainder)
+ totalRowBytes += remainder;
+ uint8_t* tempRow = new uint8_t[validRowBytes];
+ uint8_t* data = static_cast<uint8_t*>(imageData);
+ for (unsigned i = 0; i < height / 2; i++) {
+ uint8_t* lowRow = data + (totalRowBytes * i);
+ uint8_t* highRow = data + (totalRowBytes * (height - i - 1));
+ memcpy(tempRow, lowRow, validRowBytes);
+ memcpy(lowRow, highRow, validRowBytes);
+ memcpy(highRow, tempRow, validRowBytes);
}
+ delete[] tempRow;
+}
- if (flipVertically && width && height) {
- int rowBytes = width * 4;
- uint8_t* tempRow = new uint8_t[rowBytes];
- for (unsigned i = 0; i < height / 2; i++) {
- uint8_t* lowRow = imageData + (rowBytes * i);
- uint8_t* highRow = imageData + (rowBytes * (height - i - 1));
- memcpy(tempRow, lowRow, rowBytes);
- memcpy(lowRow, highRow, rowBytes);
- memcpy(highRow, tempRow, rowBytes);
- }
- delete[] tempRow;
+// These functions can not be static, or gcc will not allow them to be
+// used as template parameters. Use an anonymous namespace to prevent
+// the need to declare prototypes for them.
+namespace {
+
+//----------------------------------------------------------------------
+// Pixel unpacking routines.
+
+void unpackRGB8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[0];
+ destination[1] = source[1];
+ destination[2] = source[2];
+ destination[3] = 0xFF;
+}
+
+void unpackBGRA8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[2];
+ destination[1] = source[1];
+ destination[2] = source[0];
+ destination[3] = source[3];
+}
+
+//----------------------------------------------------------------------
+// Pixel packing routines.
+//
+
+void packRGBA8ToA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[3];
+}
+
+void packRGBA8ToR8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[0];
+}
+
+void packRGBA8ToR8Premultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ destination[0] = sourceR;
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToR8Unmultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ destination[0] = sourceR;
+}
+
+void packRGBA8ToRA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[0];
+ destination[1] = source[3];
+}
+
+void packRGBA8ToRA8Premultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ destination[0] = sourceR;
+ destination[1] = source[3];
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToRA8Unmultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ destination[0] = sourceR;
+ destination[1] = source[3];
+}
+
+void packRGBA8ToRGB8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[0];
+ destination[1] = source[1];
+ destination[2] = source[2];
+}
+
+void packRGBA8ToRGB8Premultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ destination[0] = sourceR;
+ destination[1] = sourceG;
+ destination[2] = sourceB;
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToRGB8Unmultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ destination[0] = sourceR;
+ destination[1] = sourceG;
+ destination[2] = sourceB;
+}
+
+// This is only used when the source format is different than kSourceFormatRGBA8.
+void packRGBA8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+ destination[0] = source[0];
+ destination[1] = source[1];
+ destination[2] = source[2];
+ destination[3] = source[3];
+}
+
+void packRGBA8ToRGBA8Premultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ destination[0] = sourceR;
+ destination[1] = sourceG;
+ destination[2] = sourceB;
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToRGBA8Unmultiply(const uint8_t* source, uint8_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ destination[0] = sourceR;
+ destination[1] = sourceG;
+ destination[2] = sourceB;
+ destination[3] = source[3];
+}
+
+void packRGBA8ToUnsignedShort4444(const uint8_t* source, uint16_t* destination)
+{
+ *destination = (((source[0] & 0xF0) << 8)
+ | ((source[1] & 0xF0) << 4)
+ | (source[2] & 0xF0)
+ | (source[3] >> 4));
+}
+
+void packRGBA8ToUnsignedShort4444Premultiply(const uint8_t* source, uint16_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ *destination = (((sourceR & 0xF0) << 8)
+ | ((sourceG & 0xF0) << 4)
+ | (sourceB & 0xF0)
+ | (source[3] >> 4));
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToUnsignedShort4444Unmultiply(const uint8_t* source, uint16_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ *destination = (((sourceR & 0xF0) << 8)
+ | ((sourceG & 0xF0) << 4)
+ | (sourceB & 0xF0)
+ | (source[3] >> 4));
+}
+
+void packRGBA8ToUnsignedShort5551(const uint8_t* source, uint16_t* destination)
+{
+ *destination = (((source[0] & 0xF8) << 8)
+ | ((source[1] & 0xF8) << 3)
+ | ((source[2] & 0xF8) >> 2)
+ | (source[3] >> 7));
+}
+
+void packRGBA8ToUnsignedShort5551Premultiply(const uint8_t* source, uint16_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ *destination = (((sourceR & 0xF8) << 8)
+ | ((sourceG & 0xF8) << 3)
+ | ((sourceB & 0xF8) >> 2)
+ | (source[3] >> 7));
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToUnsignedShort5551Unmultiply(const uint8_t* source, uint16_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ *destination = (((sourceR & 0xF8) << 8)
+ | ((sourceG & 0xF8) << 3)
+ | ((sourceB & 0xF8) >> 2)
+ | (source[3] >> 7));
+}
+
+void packRGBA8ToUnsignedShort565(const uint8_t* source, uint16_t* destination)
+{
+ *destination = (((source[0] & 0xF8) << 8)
+ | ((source[1] & 0xFC) << 3)
+ | ((source[2] & 0xF8) >> 3));
+}
+
+void packRGBA8ToUnsignedShort565Premultiply(const uint8_t* source, uint16_t* destination)
+{
+ float scaleFactor = source[3] / 255.0f;
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ *destination = (((sourceR & 0xF8) << 8)
+ | ((sourceG & 0xFC) << 3)
+ | ((sourceB & 0xF8) >> 3));
+}
+
+// FIXME: this routine is lossy and must be removed.
+void packRGBA8ToUnsignedShort565Unmultiply(const uint8_t* source, uint16_t* destination)
+{
+ float scaleFactor = 1.0f / (source[3] ? source[3] / 255.0f : 1.0f);
+ uint8_t sourceR = static_cast<uint8_t>(static_cast<float>(source[0]) * scaleFactor);
+ uint8_t sourceG = static_cast<uint8_t>(static_cast<float>(source[1]) * scaleFactor);
+ uint8_t sourceB = static_cast<uint8_t>(static_cast<float>(source[2]) * scaleFactor);
+ *destination = (((sourceR & 0xF8) << 8)
+ | ((sourceG & 0xFC) << 3)
+ | ((sourceB & 0xF8) >> 3));
+}
+
+} // anonymous namespace
+
+// This is used whenever unpacking is necessary; i.e., the source data
+// is not in RGBA8 format.
+template<typename SourceType, typename DestType,
+ void unpackingFunc(const SourceType*, uint8_t*),
+ void packingFunc(const uint8_t*, DestType*)>
+static void doUnpackingAndPacking(const SourceType* sourceData,
+ unsigned int numElements,
+ unsigned int sourceElementsPerPixel,
+ DestType* destinationData,
+ unsigned int destinationElementsPerPixel)
+{
+ const SourceType* endPointer = sourceData + numElements;
+ uint8_t temporaryRGBAData[4];
+ while (sourceData < endPointer) {
+ unpackingFunc(sourceData, temporaryRGBAData);
+ packingFunc(temporaryRGBAData, destinationData);
+ sourceData += sourceElementsPerPixel;
+ destinationData += destinationElementsPerPixel;
}
}
-// Premultiply alpha into color channels.
-void GraphicsContext3D::premultiplyAlpha(unsigned char* rgbaData, int numPixels)
+// This handles all conversions with a faster path for RGBA8 source data.
+template<typename SourceType, typename DestType, void packingFunc(const SourceType*, DestType*)>
+static void doPacking(const SourceType* sourceData,
+ GraphicsContext3D::SourceDataFormat sourceDataFormat,
+ unsigned int numElements,
+ unsigned int sourceElementsPerPixel,
+ DestType* destinationData,
+ unsigned int destinationElementsPerPixel)
{
- for (int j = 0; j < numPixels; j++) {
- float r = rgbaData[4*j+0] / 255.0f;
- float g = rgbaData[4*j+1] / 255.0f;
- float b = rgbaData[4*j+2] / 255.0f;
- float a = rgbaData[4*j+3] / 255.0f;
- rgbaData[4*j+0] = (unsigned char) (r * a * 255.0f);
- rgbaData[4*j+1] = (unsigned char) (g * a * 255.0f);
- rgbaData[4*j+2] = (unsigned char) (b * a * 255.0f);
+ switch (sourceDataFormat) {
+ case GraphicsContext3D::kSourceFormatRGBA8: {
+ const SourceType* endPointer = sourceData + numElements;
+ while (sourceData < endPointer) {
+ packingFunc(sourceData, destinationData);
+ sourceData += sourceElementsPerPixel;
+ destinationData += destinationElementsPerPixel;
+ }
+ break;
+ }
+ case GraphicsContext3D::kSourceFormatRGB8: {
+ doUnpackingAndPacking<SourceType, DestType, unpackRGB8ToRGBA8, packingFunc>(sourceData, numElements, sourceElementsPerPixel, destinationData, destinationElementsPerPixel);
+ break;
+ }
+ case GraphicsContext3D::kSourceFormatBGRA8: {
+ doUnpackingAndPacking<SourceType, DestType, unpackBGRA8ToRGBA8, packingFunc>(sourceData, numElements, sourceElementsPerPixel, destinationData, destinationElementsPerPixel);
+ break;
+ }
}
}
-// Remove premultiplied alpha from color channels.
-// FIXME: this is lossy. Must retrieve original values from HTMLImageElement.
-void GraphicsContext3D::unmultiplyAlpha(unsigned char* rgbaData, int numPixels)
-{
- for (int j = 0; j < numPixels; j++) {
- float r = rgbaData[4*j+0] / 255.0f;
- float g = rgbaData[4*j+1] / 255.0f;
- float b = rgbaData[4*j+2] / 255.0f;
- float a = rgbaData[4*j+3] / 255.0f;
- if (a > 0.0f) {
- r /= a;
- g /= a;
- b /= a;
- r = (r > 1.0f) ? 1.0f : r;
- g = (g > 1.0f) ? 1.0f : g;
- b = (b > 1.0f) ? 1.0f : b;
- rgbaData[4*j+0] = (unsigned char) (r * 255.0f);
- rgbaData[4*j+1] = (unsigned char) (g * 255.0f);
- rgbaData[4*j+2] = (unsigned char) (b * 255.0f);
+bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
+ GraphicsContext3D::SourceDataFormat sourceDataFormat,
+ unsigned int width,
+ unsigned int height,
+ unsigned int destinationFormat,
+ unsigned int destinationType,
+ AlphaOp alphaOp,
+ void* destinationData)
+{
+ unsigned int sourceElementsPerPixel = 4;
+ unsigned int numElements = width * height * sourceElementsPerPixel;
+ switch (destinationType) {
+ case UNSIGNED_BYTE: {
+ uint8_t* destination = static_cast<uint8_t*>(destinationData);
+ if (sourceDataFormat == kSourceFormatRGBA8 && destinationFormat == RGBA && alphaOp == kAlphaDoNothing) {
+ // No conversion necessary.
+ memcpy(destinationData, sourceData, numElements);
+ break;
+ }
+ switch (destinationFormat) {
+ case RGB:
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRGB8>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 3);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRGB8Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 3);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRGB8Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 3);
+ break;
+ }
+ break;
+ case RGBA:
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ ASSERT(sourceDataFormat != kSourceFormatRGBA8); // Handled above with fast case.
+ doPacking<uint8_t, uint8_t, packRGBA8ToRGBA8>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 4);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRGBA8Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 4);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRGBA8Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 4);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ break;
+ case ALPHA:
+ // From the desktop OpenGL conversion rules (OpenGL 2.1
+ // specification, Table 3.15), the alpha channel is chosen
+ // from the RGBA data.
+ doPacking<uint8_t, uint8_t, packRGBA8ToA8>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case LUMINANCE:
+ // From the desktop OpenGL conversion rules (OpenGL 2.1
+ // specification, Table 3.15), the red channel is chosen
+ // from the RGBA data.
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ doPacking<uint8_t, uint8_t, packRGBA8ToR8>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToR8Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToR8Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ }
+ break;
+ case LUMINANCE_ALPHA:
+ // From the desktop OpenGL conversion rules (OpenGL 2.1
+ // specification, Table 3.15), the red and alpha channels
+ // are chosen from the RGBA data.
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRA8>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 2);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRA8Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 2);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint8_t, packRGBA8ToRA8Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 2);
+ break;
+ }
+ break;
+ }
+ break;
+ }
+ case UNSIGNED_SHORT_4_4_4_4: {
+ uint16_t* destination = static_cast<uint16_t*>(destinationData);
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort4444>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort4444Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort4444Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
}
+ break;
}
+ case UNSIGNED_SHORT_5_5_5_1: {
+ uint16_t* destination = static_cast<uint16_t*>(destinationData);
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort5551>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort5551Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort5551Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ }
+ break;
+ }
+ case UNSIGNED_SHORT_5_6_5: {
+ uint16_t* destination = static_cast<uint16_t*>(destinationData);
+ switch (alphaOp) {
+ case kAlphaDoNothing:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort565>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoPremultiply:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort565Premultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ case kAlphaDoUnmultiply:
+ doPacking<uint8_t, uint16_t, packRGBA8ToUnsignedShort565Unmultiply>(sourceData, sourceDataFormat, numElements, sourceElementsPerPixel, destination, 1);
+ break;
+ }
+ break;
+ }
+ }
+ return true;
}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index 8d5c286..981459f 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -26,6 +26,7 @@
#ifndef GraphicsContext3D_h
#define GraphicsContext3D_h
+#include "GraphicsLayer.h"
#include "PlatformString.h"
#include <wtf/ListHashSet.h>
@@ -39,11 +40,20 @@
#if PLATFORM(MAC)
#include <OpenGL/OpenGL.h>
+#include <wtf/RetainPtr.h>
-typedef void* PlatformGraphicsContext3D;
+typedef CGLContextObj PlatformGraphicsContext3D;
const PlatformGraphicsContext3D NullPlatformGraphicsContext3D = 0;
typedef GLuint Platform3DObject;
const Platform3DObject NullPlatform3DObject = 0;
+
+#ifdef __OBJC__
+@class CALayer;
+@class WebGLLayer;
+#else
+typedef void* CALayer;
+typedef void* WebGLLayer;
+#endif
#elif PLATFORM(QT)
class QPainter;
class QRect;
@@ -421,15 +431,27 @@ namespace WebCore {
#if PLATFORM(MAC)
PlatformGraphicsContext3D platformGraphicsContext3D() const { return m_contextObj; }
Platform3DObject platformTexture() const { return m_texture; }
+ CALayer* platformLayer() const { return static_cast<CALayer*>(m_webGLLayer.get()); }
#elif PLATFORM(CHROMIUM)
PlatformGraphicsContext3D platformGraphicsContext3D() const;
Platform3DObject platformTexture() const;
+#if USE(ACCELERATED_COMPOSITING)
+ // FIXME: Stubbed out for now. Must be implemented to get WebGL working with
+ // accelerated compositing.
+ PlatformLayer* platformLayer() const { return 0; }
+#endif
#elif PLATFORM(QT)
PlatformGraphicsContext3D platformGraphicsContext3D();
Platform3DObject platformTexture() const;
+#if USE(ACCELERATED_COMPOSITING)
+ PlatformLayer* platformLayer() const { return 0; }
+#endif
#else
PlatformGraphicsContext3D platformGraphicsContext3D() const { return NullPlatformGraphicsContext3D; }
Platform3DObject platformTexture() const { return NullPlatform3DObject; }
+#if USE(ACCELERATED_COMPOSITING)
+ PlatformLayer* platformLayer() const { return 0; }
+#endif
#endif
void makeContextCurrent();
@@ -442,49 +464,59 @@ namespace WebCore {
// like GL_FLOAT, GL_INT, etc.
int sizeInBytes(int type);
+ bool isGLES2Compliant() const;
+
//----------------------------------------------------------------------
- // Helpers for texture uploading.
+ // Helpers for texture uploading and pixel readback.
//
- // Extracts the contents of the given Image into the passed
- // Vector, obeying the flipY and premultiplyAlpha flags.
- // Returns the applicable OpenGL format and internalFormat for
- // the subsequent glTexImage2D or glTexSubImage2D call.
- // Returns true upon success.
+ // Computes the components per pixel and bytes per component
+ // for the given format and type combination. Returns false if
+ // either was an invalid enum.
+ bool computeFormatAndTypeParameters(unsigned int format,
+ unsigned int type,
+ unsigned long* componentsPerPixel,
+ unsigned long* bytesPerComponent);
+
+ // Extracts the contents of the given Image into the passed Vector,
+ // packing the pixel data according to the given format and type,
+ // and obeying the flipY and premultiplyAlpha flags. Returns true
+ // upon success.
bool extractImageData(Image* image,
+ unsigned int format,
+ unsigned int type,
bool flipY,
bool premultiplyAlpha,
- Vector<uint8_t>& imageData,
- unsigned int* format,
- unsigned int* internalFormat);
+ Vector<uint8_t>& data);
- // Extracts the contents of the given ImageData into the passed
- // Vector, obeying the flipY and premultiplyAlpha flags.
- // Returns true upon success.
+ // Extracts the contents of the given ImageData into the passed Vector,
+ // packing the pixel data according to the given format and type,
+ // and obeying the flipY and premultiplyAlpha flags. Returns true
+ // upon success.
bool extractImageData(ImageData*,
+ unsigned int format,
+ unsigned int type,
bool flipY,
bool premultiplyAlpha,
Vector<uint8_t>& data);
- // Processes the given image data in preparation for uploading
- // via texImage2D or texSubImage2D. The input data must be in
- // 4-component format with the alpha channel last (i.e., RGBA
- // or BGRA), tightly packed, with no space between rows.
-
- enum AlphaOp {
- kAlphaDoNothing = 0,
- kAlphaDoPremultiply = 1,
- kAlphaDoUnmultiply = 2
+ // Flips the given image data vertically, in-place.
+ void flipVertically(void* imageData,
+ unsigned int width,
+ unsigned int height,
+ unsigned int bytesPerPixel,
+ unsigned int unpackAlignment);
+
+ // Attempt to enumerate all possible native image formats to
+ // reduce the amount of temporary allocations during texture
+ // uploading. This enum must be public because it is accessed
+ // by non-member functions.
+ enum SourceDataFormat {
+ kSourceFormatRGBA8,
+ kSourceFormatRGB8,
+ kSourceFormatBGRA8
};
- void processImageData(uint8_t* imageData,
- unsigned width,
- unsigned height,
- bool flipVertically,
- AlphaOp alphaOp);
-
- bool isGLES2Compliant() const;
-
//----------------------------------------------------------------------
// Entry points for WebGL.
//
@@ -693,33 +725,49 @@ namespace WebCore {
private:
GraphicsContext3D(Attributes attrs, HostWindow* hostWindow);
- // Helpers for texture uploading.
- void premultiplyAlpha(unsigned char* rgbaData, int numPixels);
- void unmultiplyAlpha(uint8_t* imageData, int numPixels);
-
// Each platform must provide an implementation of this method.
//
- // Gets the data for the given Image into outputVector,
- // without doing any processing of the data (vertical flip or
- // otherwise).
- //
- // premultiplyAlpha indicates whether the user will eventually
- // want the alpha channel multiplied into the color channels.
- //
- // The out parameter hasAlphaChannel indicates whether the
- // image actually had an alpha channel.
+ // Gets the data for the given Image into outputVector in the
+ // format specified by the (OpenGL-style) format and type
+ // arguments. Despite the fact that the outputVector contains
+ // uint8_t, if the format and type specify packed pixels, then
+ // it will essentially contain uint16_t after the extraction
+ // process.
//
- // The out parameter neededAlphaOp should be passed to a
- // subsequent call of processImageData.
+ // If premultiplyAlpha is true, the alpha channel, if any,
+ // will be multiplied into the color channels during the
+ // extraction process. This premultiplication occurs before
+ // any packing of pixel data.
//
- // The out parameter format should be passed to subsequent
- // invocations of texImage2D and texSubImage2D.
+ // No vertical flip of the image data is performed by this
+ // method.
bool getImageData(Image* image,
- Vector<uint8_t>& outputVector,
+ unsigned int format,
+ unsigned int type,
bool premultiplyAlpha,
- bool* hasAlphaChannel,
- AlphaOp* neededAlphaOp,
- unsigned int* format);
+ Vector<uint8_t>& outputVector);
+
+ // Possible alpha operations that may need to occur during
+ // pixel packing. FIXME: kAlphaDoUnmultiply is lossy and must
+ // be removed.
+ enum AlphaOp {
+ kAlphaDoNothing = 0,
+ kAlphaDoPremultiply = 1,
+ kAlphaDoUnmultiply = 2
+ };
+
+ // Helper for getImageData which implements packing of pixel
+ // data into the specified OpenGL destination format and type.
+ // Source data must be in RGBA format with no gaps between
+ // rows. Destination data will have no gaps between rows.
+ bool packPixels(const uint8_t* sourceData,
+ SourceDataFormat sourceDataFormat,
+ unsigned int width,
+ unsigned int height,
+ unsigned int destinationFormat,
+ unsigned int destinationType,
+ AlphaOp alphaOp,
+ void* destinationData);
#if PLATFORM(MAC)
// Take into account the user's requested context creation attributes,
@@ -736,6 +784,7 @@ namespace WebCore {
Vector<Vector<float> > m_vertexArray;
CGLContextObj m_contextObj;
+ RetainPtr<WebGLLayer> m_webGLLayer;
GLuint m_texture;
GLuint m_fbo;
GLuint m_depthStencilBuffer;
diff --git a/WebCore/platform/graphics/GraphicsContextPrivate.h b/WebCore/platform/graphics/GraphicsContextPrivate.h
index baa3392..6bf465b 100644
--- a/WebCore/platform/graphics/GraphicsContextPrivate.h
+++ b/WebCore/platform/graphics/GraphicsContextPrivate.h
@@ -72,7 +72,7 @@ namespace WebCore {
bool paintingDisabled;
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
diff --git a/WebCore/platform/graphics/GraphicsLayer.h b/WebCore/platform/graphics/GraphicsLayer.h
index 340b911..4338d89 100644
--- a/WebCore/platform/graphics/GraphicsLayer.h
+++ b/WebCore/platform/graphics/GraphicsLayer.h
@@ -33,9 +33,6 @@
#include "FloatPoint.h"
#include "FloatPoint3D.h"
#include "FloatSize.h"
-#if ENABLE(3D_CANVAS)
-#include "GraphicsContext3D.h"
-#endif
#include "GraphicsLayerClient.h"
#include "IntRect.h"
#include "TransformationMatrix.h"
@@ -281,6 +278,8 @@ public:
virtual void setNeedsDisplay() = 0;
// mark the given rect (in layer coords) as needing dispay. Never goes deep.
virtual void setNeedsDisplayInRect(const FloatRect&) = 0;
+
+ virtual void setContentsNeedsDisplay() { };
// Set that the position/size of the contents (image or video).
IntRect contentsRect() const { return m_contentsRect; }
@@ -302,8 +301,7 @@ public:
virtual void setContentsBackgroundColor(const Color&) { }
#if ENABLE(3D_CANVAS)
- virtual void setContentsToGraphicsContext3D(const GraphicsContext3D*) { }
- virtual void setGraphicsContext3DNeedsDisplay() { }
+ virtual void setContentsToWebGL(PlatformLayer*) { }
#endif
// Callback from the underlying graphics system to draw layer contents.
void paintGraphicsLayerContents(GraphicsContext&, const IntRect& clip);
diff --git a/WebCore/platform/graphics/Icon.h b/WebCore/platform/graphics/Icon.h
index 59c732f..3390679 100644
--- a/WebCore/platform/graphics/Icon.h
+++ b/WebCore/platform/graphics/Icon.h
@@ -40,7 +40,7 @@ typedef struct HICON__* HICON;
#elif PLATFORM(GTK)
typedef struct _GdkPixbuf GdkPixbuf;
#elif PLATFORM(EFL)
-#include <Evas.h>
+typedef struct _Evas_Object Evas_Object;
#elif PLATFORM(CHROMIUM)
#include "PlatformIcon.h"
#endif
diff --git a/WebCore/platform/graphics/IntRect.h b/WebCore/platform/graphics/IntRect.h
index 5c5eae1..ad90dd9 100644
--- a/WebCore/platform/graphics/IntRect.h
+++ b/WebCore/platform/graphics/IntRect.h
@@ -51,8 +51,6 @@ QT_END_NAMESPACE
typedef struct _GdkRectangle GdkRectangle;
#elif PLATFORM(HAIKU)
class BRect;
-#elif PLATFORM(EFL)
-#include <Evas.h>
#endif
#if PLATFORM(WX)
@@ -155,9 +153,6 @@ public:
#elif PLATFORM(HAIKU)
explicit IntRect(const BRect&);
operator BRect() const;
-#elif PLATFORM(EFL)
- explicit IntRect(const Eina_Rectangle&);
- operator Eina_Rectangle() const;
#endif
#if PLATFORM(CG)
diff --git a/WebCore/platform/graphics/TextRun.h b/WebCore/platform/graphics/TextRun.h
index 03d7b9f..b5cd42a 100644
--- a/WebCore/platform/graphics/TextRun.h
+++ b/WebCore/platform/graphics/TextRun.h
@@ -39,6 +39,7 @@ public:
, m_len(len)
, m_xpos(xpos)
, m_padding(padding)
+ , m_glyphScale(1.0f)
, m_allowTabs(allowTabs)
, m_rtl(rtl)
, m_directionalOverride(directionalOverride)
@@ -58,6 +59,7 @@ public:
, m_len(s.length())
, m_xpos(xpos)
, m_padding(padding)
+ , m_glyphScale(1.0f)
, m_allowTabs(allowTabs)
, m_rtl(rtl)
, m_directionalOverride(directionalOverride)
@@ -79,6 +81,9 @@ public:
void setText(const UChar* c, int len) { m_characters = c; m_len = len; }
+ float glyphScale() const { return m_glyphScale; }
+ void setGlyphScale(float scale) { m_glyphScale = scale; }
+
bool allowTabs() const { return m_allowTabs; }
int xPos() const { return m_xpos; }
int padding() const { return m_padding; }
@@ -88,6 +93,7 @@ public:
bool applyRunRounding() const { return m_applyRunRounding; }
bool applyWordRounding() const { return m_applyWordRounding; }
bool spacingDisabled() const { return m_disableSpacing; }
+ bool applyGlyphScaling() const { return m_glyphScale != 1.0f; }
void disableSpacing() { m_disableSpacing = true; }
void disableRoundingHacks() { m_applyRunRounding = m_applyWordRounding = false; }
@@ -108,6 +114,7 @@ private:
int m_xpos;
int m_padding;
+ float m_glyphScale;
bool m_allowTabs;
bool m_rtl;
bool m_directionalOverride;
diff --git a/WebCore/platform/graphics/WidthIterator.cpp b/WebCore/platform/graphics/WidthIterator.cpp
index 996ce40..0814d48 100644
--- a/WebCore/platform/graphics/WidthIterator.cpp
+++ b/WebCore/platform/graphics/WidthIterator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2003, 2006, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2008 Holger Hans Peter Freyther
*
* This library is free software; you can redistribute it and/or
@@ -60,15 +60,16 @@ WidthIterator::WidthIterator(const Font* font, const TextRun& run, HashSet<const
if (!m_padding)
m_padPerSpace = 0;
else {
- float numSpaces = 0;
- for (int i = 0; i < run.length(); i++)
+ int numSpaces = 0;
+ for (int i = 0; i < run.length(); i++) {
if (Font::treatAsSpace(m_run[i]))
numSpaces++;
+ }
- if (numSpaces == 0)
+ if (!numSpaces)
m_padPerSpace = 0;
else
- m_padPerSpace = ceilf(m_run.padding() / numSpaces);
+ m_padPerSpace = m_padding / numSpaces;
}
}
@@ -133,6 +134,11 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
width = tabWidth - fmodf(m_run.xPos() + runWidthSoFar, tabWidth);
} else {
width = fontData->widthForGlyph(glyph);
+
+ // SVG uses glyphScale(), when textLength is used to stretch/squeeze text.
+ if (m_run.applyGlyphScaling())
+ width *= m_run.glyphScale();
+
// We special case spaces in two ways when applying word rounding.
// First, we round spaces to an adjusted width in all fonts.
// Second, in fixed-pitch fonts we ensure that all characters that
@@ -170,8 +176,9 @@ void WidthIterator::advance(int offset, GlyphBuffer* glyphBuffer)
width += m_padding;
m_padding = 0;
} else {
- width += m_padPerSpace;
+ float previousPadding = m_padding;
m_padding -= m_padPerSpace;
+ width += roundf(previousPadding) - roundf(m_padding);
}
}
diff --git a/WebCore/platform/graphics/cairo/FontCacheCairo.cpp b/WebCore/platform/graphics/cairo/FontCacheCairo.cpp
index fceeea1..cb54549 100644
--- a/WebCore/platform/graphics/cairo/FontCacheCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCacheCairo.cpp
@@ -88,7 +88,8 @@ static bool isWellKnownFontName(const AtomicString family)
// Fonts that are used by layout tests included. The fact that
// they are used in Layout Tests indicate web compatibility issues
// if we do not handle them correctly.
- if (equalIgnoringCase(family, "sans-serif") || equalIgnoringCase(family, "serif")
+ if (equalIgnoringCase(family, "sans-serif") || equalIgnoringCase(family, "sans")
+ || equalIgnoringCase(family, "serif") || equalIgnoringCase(family, "mono")
|| equalIgnoringCase(family, "monospace") || equalIgnoringCase(family, "cursive")
|| equalIgnoringCase(family, "fantasy") || equalIgnoringCase(family, "Times")
|| equalIgnoringCase(family, "Courier") || equalIgnoringCase(family, "Helvetica")
@@ -118,9 +119,6 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD
if (!FcPatternAddString(pattern.get(), FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
return 0;
- FcConfigSubstitute(0, pattern.get(), FcMatchPattern);
- FcDefaultSubstitute(pattern.get());
-
GOwnPtr<FcObjectSet> objectSet(FcObjectSetCreate());
if (!FcObjectSetAdd(objectSet.get(), FC_FAMILY))
return 0;
diff --git a/WebCore/platform/graphics/cairo/FontCairo.cpp b/WebCore/platform/graphics/cairo/FontCairo.cpp
index 2a2d4a7..93051cb 100644
--- a/WebCore/platform/graphics/cairo/FontCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCairo.cpp
@@ -70,7 +70,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
}
// Text shadow, inspired by FontMac
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur = 0;
Color shadowColor;
bool hasShadow = context->textDrawingMode() == cTextFill &&
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 083497f..50564c5 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -143,7 +143,7 @@ static inline void copyContextProperties(cairo_t* srcCr, cairo_t* dstCr)
cairo_set_fill_rule(dstCr, cairo_get_fill_rule(srcCr));
}
-void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const IntSize& shadowSize, float shadowBlur)
+void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& kernelSize, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur)
{
#if ENABLE(FILTERS)
// calculate the kernel size according to the HTML5 canvas shadow specification
@@ -161,7 +161,7 @@ void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize,
static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPrivate* gcp, bool fillShadow, bool strokeShadow)
{
#if ENABLE(FILTERS)
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (!context->getShadow(shadowSize, shadowBlur, shadowColor))
@@ -559,7 +559,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
static void drawBorderlessRectShadow(GraphicsContext* context, const FloatRect& rect, const Color& rectColor)
{
#if ENABLE(FILTERS)
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
@@ -841,7 +841,7 @@ void GraphicsContext::clipToImageBuffer(const FloatRect& rect, const ImageBuffer
notImplemented();
}
-void GraphicsContext::setPlatformShadow(IntSize const& size, float, Color const&, ColorSpace)
+void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace)
{
// Cairo doesn't support shadows natively, they are drawn manually in the draw*
// functions
@@ -849,7 +849,7 @@ void GraphicsContext::setPlatformShadow(IntSize const& size, float, Color const&
if (m_common->state.shadowsIgnoreTransforms) {
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
- m_common->state.shadowSize = IntSize(size.width(), -size.height());
+ m_common->state.shadowSize = FloatSize(size.width(), -size.height());
}
}
diff --git a/WebCore/platform/graphics/cairo/ImageCairo.cpp b/WebCore/platform/graphics/cairo/ImageCairo.cpp
index 92394b3..64fbedf 100644
--- a/WebCore/platform/graphics/cairo/ImageCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageCairo.cpp
@@ -134,7 +134,7 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo
// Draw the shadow
#if ENABLE(FILTERS)
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index c6a8f83..5c03a86 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -39,11 +39,10 @@
namespace WebCore {
bool GraphicsContext3D::getImageData(Image* image,
- Vector<uint8_t>& outputVector,
+ unsigned int format,
+ unsigned int type,
bool premultiplyAlpha,
- bool* hasAlphaChannel,
- AlphaOp* neededAlphaOp,
- unsigned int* format)
+ Vector<uint8_t>& outputVector)
{
if (!image)
return false;
@@ -52,16 +51,10 @@ bool GraphicsContext3D::getImageData(Image* image,
return false;
int width = CGImageGetWidth(cgImage);
int height = CGImageGetHeight(cgImage);
- int rowBytes = width * 4;
- CGImageAlphaInfo info = CGImageGetAlphaInfo(cgImage);
- *hasAlphaChannel = (info != kCGImageAlphaNone
- && info != kCGImageAlphaNoneSkipLast
- && info != kCGImageAlphaNoneSkipFirst);
- if (!premultiplyAlpha && *hasAlphaChannel)
- // FIXME: must fetch the image data before the premultiplication step
- *neededAlphaOp = kAlphaDoUnmultiply;
- *format = RGBA;
- outputVector.resize(height * rowBytes);
+ // FIXME: we should get rid of this temporary copy where possible.
+ int tempRowBytes = width * 4;
+ Vector<uint8_t> tempVector;
+ tempVector.resize(height * tempRowBytes);
// Try to reuse the color space from the image to preserve its colors.
// Some images use a color space (such as indexed) unsupported by the bitmap context.
CGColorSpaceRef colorSpace = CGImageGetColorSpace(cgImage);
@@ -79,20 +72,36 @@ bool GraphicsContext3D::getImageData(Image* image,
releaseColorSpace = true;
break;
}
- CGContextRef tmpContext = CGBitmapContextCreate(outputVector.data(),
- width, height, 8, rowBytes,
- colorSpace,
- kCGImageAlphaPremultipliedLast);
+ CGContextRef tempContext = CGBitmapContextCreate(tempVector.data(),
+ width, height, 8, tempRowBytes,
+ colorSpace,
+ // FIXME: change this!
+ kCGImageAlphaPremultipliedLast);
if (releaseColorSpace)
CGColorSpaceRelease(colorSpace);
- if (!tmpContext)
+ if (!tempContext)
return false;
- CGContextSetBlendMode(tmpContext, kCGBlendModeCopy);
- CGContextDrawImage(tmpContext,
+ CGContextSetBlendMode(tempContext, kCGBlendModeCopy);
+ CGContextDrawImage(tempContext,
CGRectMake(0, 0, static_cast<CGFloat>(width), static_cast<CGFloat>(height)),
cgImage);
- CGContextRelease(tmpContext);
- return true;
+ CGContextRelease(tempContext);
+ // Pack the pixel data into the output vector.
+ unsigned long componentsPerPixel, bytesPerComponent;
+ if (!computeFormatAndTypeParameters(format, type, &componentsPerPixel, &bytesPerComponent))
+ return false;
+ int rowBytes = width * componentsPerPixel * bytesPerComponent;
+ outputVector.resize(height * rowBytes);
+ CGImageAlphaInfo info = CGImageGetAlphaInfo(cgImage);
+ bool hasAlphaChannel = (info != kCGImageAlphaNone
+ && info != kCGImageAlphaNoneSkipLast
+ && info != kCGImageAlphaNoneSkipFirst);
+ AlphaOp neededAlphaOp = kAlphaDoNothing;
+ if (!premultiplyAlpha && hasAlphaChannel)
+ // FIXME: must fetch the image data before the premultiplication step.
+ neededAlphaOp = kAlphaDoUnmultiply;
+ return packPixels(tempVector.data(), kSourceFormatRGBA8, width, height,
+ format, type, neededAlphaOp, outputVector.data());
}
diff --git a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
index c69f222..5a903dc 100644
--- a/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
@@ -764,7 +764,7 @@ void GraphicsContext::endTransparencyLayer()
m_data->m_userToDeviceTransformKnownToBeIdentity = false;
}
-void GraphicsContext::setPlatformShadow(const IntSize& offset, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setPlatformShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace)
{
if (paintingDisabled())
return;
diff --git a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
index 48cf9d2..5b8bad3 100644
--- a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
@@ -273,7 +273,7 @@ bool TransparencyAwareGlyphPainter::drawGlyphs(int numGlyphs,
// If there is a non-blur shadow and both the fill color and shadow color
// are opaque, handle without skia.
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (m_graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -434,7 +434,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext,
}
FloatRect Font::selectionRectForComplexText(const TextRun& run,
- const IntPoint& point,
+ const FloatPoint& point,
int h,
int from,
int to) const
@@ -445,10 +445,10 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
// If the text is RTL, left will actually be after right.
if (left < right)
- return FloatRect(left, static_cast<float>(point.y()),
+ return FloatRect(left, point.y(),
right - left, static_cast<float>(h));
- return FloatRect(right, static_cast<float>(point.y()),
+ return FloatRect(right, point.y(),
left - right, static_cast<float>(h));
}
@@ -483,7 +483,7 @@ void Font::drawComplexText(GraphicsContext* graphicsContext,
// If there is a non-blur shadow and both the fill color and shadow color
// are opaque, handle without skia.
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor) && windowsCanHandleDrawTextShadow(graphicsContext)) {
@@ -509,9 +509,13 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return static_cast<float>(state.width());
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int x,
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
bool includePartialGlyphs) const
{
+ // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
+ // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
+ int x = static_cast<int>(xFloat);
+
// Mac code ignores includePartialGlyphs, and they don't know what it's
// supposed to do, so we just ignore it as well.
UniscribeHelperTextRun state(run, *this);
diff --git a/WebCore/platform/graphics/chromium/FontLinux.cpp b/WebCore/platform/graphics/chromium/FontLinux.cpp
index 700b3ed..a2098a4 100644
--- a/WebCore/platform/graphics/chromium/FontLinux.cpp
+++ b/WebCore/platform/graphics/chromium/FontLinux.cpp
@@ -171,10 +171,9 @@ public:
memset(&m_item, 0, sizeof(m_item));
// We cannot know, ahead of time, how many glyphs a given script run
// will produce. We take a guess that script runs will not produce more
- // than twice as many glyphs as there are code points and fallback if
- // we find that we are wrong.
- m_maxGlyphs = m_run.length() * 2;
- createGlyphArrays();
+ // than twice as many glyphs as there are code points plus a bit of
+ // padding and fallback if we find that we are wrong.
+ createGlyphArrays((m_run.length() + 2) * 2);
m_item.log_clusters = new unsigned short[m_run.length()];
@@ -258,10 +257,9 @@ public:
}
setupFontForScriptRun();
-
- if (!shapeGlyphs())
- return false;
+ shapeGlyphs();
setGlyphXPositions(rtl());
+
return true;
}
@@ -409,46 +407,34 @@ private:
delete[] m_xPositions;
}
- bool createGlyphArrays()
- {
- m_item.glyphs = new HB_Glyph[m_maxGlyphs];
- m_item.attributes = new HB_GlyphAttributes[m_maxGlyphs];
- m_item.advances = new HB_Fixed[m_maxGlyphs];
- m_item.offsets = new HB_FixedPoint[m_maxGlyphs];
- // HB_FixedPoint is a struct, so we must use memset to clear it.
- memset(m_item.offsets, 0, m_maxGlyphs * sizeof(HB_FixedPoint));
- m_glyphs16 = new uint16_t[m_maxGlyphs];
- m_xPositions = new SkScalar[m_maxGlyphs];
-
- return m_item.glyphs
- && m_item.attributes
- && m_item.advances
- && m_item.offsets
- && m_glyphs16
- && m_xPositions;
- }
-
- bool expandGlyphArrays()
+ void createGlyphArrays(int size)
{
- deleteGlyphArrays();
- m_maxGlyphs <<= 1;
- return createGlyphArrays();
+ m_item.glyphs = new HB_Glyph[size];
+ memset(m_item.glyphs, 0, size * sizeof(HB_Glyph));
+ m_item.attributes = new HB_GlyphAttributes[size];
+ memset(m_item.attributes, 0, size * sizeof(HB_GlyphAttributes));
+ m_item.advances = new HB_Fixed[size];
+ memset(m_item.advances, 0, size * sizeof(HB_Fixed));
+ m_item.offsets = new HB_FixedPoint[size];
+ memset(m_item.offsets, 0, size * sizeof(HB_FixedPoint));
+
+ m_glyphs16 = new uint16_t[size];
+ m_xPositions = new SkScalar[size];
+
+ m_item.num_glyphs = size;
}
- bool shapeGlyphs()
+ void shapeGlyphs()
{
for (;;) {
- m_item.num_glyphs = m_maxGlyphs;
- HB_ShapeItem(&m_item);
- if (m_item.num_glyphs < m_maxGlyphs)
+ if (HB_ShapeItem(&m_item))
break;
// We overflowed our arrays. Resize and retry.
- if (!expandGlyphArrays())
- return false;
+ // HB_ShapeItem fills in m_item.num_glyphs with the needed size.
+ deleteGlyphArrays();
+ createGlyphArrays(m_item.num_glyphs);
}
-
- return true;
}
void setGlyphXPositions(bool isRTL)
@@ -478,7 +464,6 @@ private:
unsigned m_offsetX; // Offset in pixels to the start of the next script run.
unsigned m_pixelWidth; // Width (in px) of the current script run.
unsigned m_numCodePoints; // Code points in current script run.
- unsigned m_maxGlyphs; // Current size of all the Harfbuzz arrays.
OwnPtr<TextRun> m_normalizedRun;
OwnArrayPtr<UChar> m_normalizedBuffer; // A buffer for normalized run.
@@ -564,9 +549,13 @@ static int glyphIndexForXPositionInScriptRun(const TextRunWalker& walker, int x)
}
// Return the code point index for the given |x| offset into the text run.
-int Font::offsetForPositionForComplexText(const TextRun& run, int x,
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat,
bool includePartialGlyphs) const
{
+ // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
+ // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
+ int x = static_cast<int>(xFloat);
+
// (Mac code ignores includePartialGlyphs, and they don't know what it's
// supposed to do, so we just ignore it as well.)
TextRunWalker walker(run, 0, this);
@@ -641,7 +630,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int x,
// Return the rectangle for selecting the given range of code-points in the TextRun.
FloatRect Font::selectionRectForComplexText(const TextRun& run,
- const IntPoint& point, int height,
+ const FloatPoint& point, int height,
int from, int to) const
{
int fromX = -1, toX = -1, fromAdvance = -1, toAdvance = -1;
diff --git a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
index 25c9cf8..40e7bcf 100644
--- a/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
+++ b/WebCore/platform/graphics/chromium/FontPlatformDataChromiumWin.h
@@ -29,8 +29,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FontPlatformDataWin_h
-#define FontPlatformDataWin_h
+#ifndef FontPlatformDataChromiumWin_h
+#define FontPlatformDataChromiumWin_h
#include "config.h"
@@ -131,4 +131,4 @@ private:
} // WebCore
-#endif // FontPlatformDataWin_h
+#endif // FontPlatformDataChromiumWin_h
diff --git a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.h b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.h
index 6a964c4..b637ede 100644
--- a/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.h
+++ b/WebCore/platform/graphics/chromium/FontUtilsChromiumWin.h
@@ -33,8 +33,8 @@
// FIXME: Move all methods to the files that have their callsites and remove this file.
// *Utils files are not very WebKit-ty.
-#ifndef FontUtilsWin_h
-#define FontUtilsWin_h
+#ifndef FontUtilsChromiumWin_h
+#define FontUtilsChromiumWin_h
#include <usp10.h>
#include <wchar.h>
@@ -93,4 +93,4 @@ int getStyleFromLogfont(const LOGFONT*);
} // namespace WebCore
-#endif // FontUtilsWin_h
+#endif // FontUtilsChromiumWin_h
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
index 23aeefa..b26565c 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
@@ -48,9 +48,11 @@
#include "FloatConversion.h"
#include "FloatRect.h"
#include "Image.h"
+#include "ImageLayerChromium.h"
#include "LayerChromium.h"
#include "PlatformString.h"
#include "SystemTime.h"
+#include "TransformLayerChromium.h"
#include <wtf/CurrentTime.h>
#include <wtf/StringExtras.h>
#include <wtf/text/CString.h>
@@ -94,7 +96,7 @@ GraphicsLayerChromium::GraphicsLayerChromium(GraphicsLayerClient* client)
, m_contentsLayerPurpose(NoContentsLayer)
, m_contentsLayerHasBackgroundColor(false)
{
- m_layer = LayerChromium::create(LayerChromium::Layer, this);
+ m_layer = LayerChromium::create(this);
updateDebugIndicators();
}
@@ -307,18 +309,25 @@ void GraphicsLayerChromium::setContentsToImage(Image* image)
{
bool childrenChanged = false;
if (image) {
- m_pendingContentsImage = image->nativeImageForCurrentFrame();
- m_contentsLayerPurpose = ContentsLayerForImage;
- if (!m_contentsLayer)
+ NativeImagePtr nativeImage = image->nativeImageForCurrentFrame();
+ if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForImage) {
+ RefPtr<ImageLayerChromium> imageLayer = ImageLayerChromium::create(this);
+ setupContentsLayer(imageLayer.get());
+ m_contentsLayer = imageLayer;
+ m_contentsLayerPurpose = ContentsLayerForImage;
childrenChanged = true;
+ }
+ ImageLayerChromium* imageLayer = static_cast<ImageLayerChromium*>(m_contentsLayer.get());
+ imageLayer->setContents(nativeImage);
+ updateContentsRect();
} else {
- m_pendingContentsImage = 0;
- m_contentsLayerPurpose = NoContentsLayer;
- if (m_contentsLayer)
+ if (m_contentsLayer) {
childrenChanged = true;
- }
- updateContentsImage();
+ // The old contents layer will be removed via updateSublayerList.
+ m_contentsLayer = 0;
+ }
+ }
if (childrenChanged)
updateSublayerList();
@@ -476,7 +485,7 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
{
if (m_preserves3D && !m_transformLayer) {
// Create the transform layer.
- m_transformLayer = LayerChromium::create(LayerChromium::TransformLayer, this);
+ m_transformLayer = TransformLayerChromium::create(this);
// Copy the position from this layer.
updateLayerPosition();
@@ -540,26 +549,6 @@ void GraphicsLayerChromium::updateLayerBackgroundColor()
clearLayerBackgroundColor(*m_contentsLayer);
}
-void GraphicsLayerChromium::updateContentsImage()
-{
- if (m_pendingContentsImage) {
- if (!m_contentsLayer.get()) {
- RefPtr<LayerChromium> imageLayer = LayerChromium::create(LayerChromium::Layer, this);
-
- setupContentsLayer(imageLayer.get());
- m_contentsLayer = imageLayer;
- // m_contentsLayer will be parented by updateSublayerList.
- }
- m_contentsLayer->setContents(m_pendingContentsImage);
- m_pendingContentsImage = 0;
-
- updateContentsRect();
- } else {
- // No image. m_contentsLayer will be removed via updateSublayerList.
- m_contentsLayer = 0;
- }
-}
-
void GraphicsLayerChromium::updateContentsVideo()
{
// FIXME: Implement
diff --git a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
index bc86799..0c84c80 100644
--- a/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
@@ -135,13 +135,12 @@ private:
enum ContentsLayerPurpose {
NoContentsLayer = 0,
ContentsLayerForImage,
- ContentsLayerForVideo
+ ContentsLayerForVideo,
+ ContentsLayerForWebGL
};
ContentsLayerPurpose m_contentsLayerPurpose;
bool m_contentsLayerHasBackgroundColor : 1;
-
- NativeImagePtr m_pendingContentsImage;
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
new file mode 100644
index 0000000..7905601
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "ImageLayerChromium.h"
+
+#if PLATFORM(SKIA)
+#include "NativeImageSkia.h"
+#include "PlatformContextSkia.h"
+#endif
+
+namespace WebCore {
+
+PassRefPtr<ImageLayerChromium> ImageLayerChromium::create(GraphicsLayerChromium* owner)
+{
+ return adoptRef(new ImageLayerChromium(owner));
+}
+
+ImageLayerChromium::ImageLayerChromium(GraphicsLayerChromium* owner)
+ : LayerChromium(owner)
+ , m_contents(0)
+{
+}
+
+void ImageLayerChromium::setContents(NativeImagePtr contents)
+{
+ // Check if the image has changed.
+ if (m_contents == contents)
+ return;
+ m_contents = contents;
+ setNeedsDisplay();
+}
+
+void ImageLayerChromium::updateTextureContents(unsigned textureId)
+{
+ void* pixels = 0;
+ IntRect dirtyRect(m_dirtyRect);
+ IntSize requiredTextureSize;
+ IntSize bitmapSize;
+
+#if PLATFORM(SKIA)
+ // The layer contains an Image.
+ NativeImageSkia* skiaImage = static_cast<NativeImageSkia*>(m_contents);
+ const SkBitmap* skiaBitmap = skiaImage;
+ requiredTextureSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
+ ASSERT(skiaBitmap);
+
+ SkAutoLockPixels lock(*skiaBitmap);
+ SkBitmap::Config skiaConfig = skiaBitmap->config();
+ // FIXME: do we need to support more image configurations?
+ if (skiaConfig == SkBitmap::kARGB_8888_Config) {
+ pixels = skiaBitmap->getPixels();
+ bitmapSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
+ }
+#else
+#error "Need to implement for your platform."
+#endif
+ if (pixels)
+ updateTextureRect(pixels, bitmapSize, requiredTextureSize, dirtyRect, textureId);
+}
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/ImageLayerChromium.h b/WebCore/platform/graphics/chromium/ImageLayerChromium.h
new file mode 100644
index 0000000..9355b2d
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/ImageLayerChromium.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * 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 ImageLayerChromium_h
+#define ImageLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+namespace WebCore {
+
+// A Layer that contains only an Image element.
+class ImageLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<ImageLayerChromium> create(GraphicsLayerChromium* owner = 0);
+ virtual bool drawsContent() { return m_contents; }
+ virtual void updateTextureContents(unsigned textureId);
+ void setContents(NativeImagePtr);
+
+private:
+ ImageLayerChromium(GraphicsLayerChromium* owner);
+ NativeImagePtr m_contents;
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.cpp b/WebCore/platform/graphics/chromium/LayerChromium.cpp
index 5e71e49..e3209a7 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerChromium.cpp
@@ -44,20 +44,20 @@
#include <GLES2/gl2.h>
-
namespace WebCore {
using namespace std;
-PassRefPtr<LayerChromium> LayerChromium::create(LayerType type, GraphicsLayerChromium* owner)
+unsigned LayerChromium::m_shaderProgramId = 0;
+
+PassRefPtr<LayerChromium> LayerChromium::create(GraphicsLayerChromium* owner)
{
- return adoptRef(new LayerChromium(type, owner));
+ return adoptRef(new LayerChromium(owner));
}
-LayerChromium::LayerChromium(LayerType type, GraphicsLayerChromium* owner)
+LayerChromium::LayerChromium(GraphicsLayerChromium* owner)
: m_needsDisplayOnBoundsChange(false)
, m_owner(owner)
- , m_layerType(type)
, m_superlayer(0)
, m_layerRenderer(0)
, m_borderWidth(0)
@@ -71,13 +71,11 @@ LayerChromium::LayerChromium(LayerType type, GraphicsLayerChromium* owner)
, m_edgeAntialiasingMask(0)
, m_hidden(false)
, m_masksToBounds(false)
- , m_contentsGravity(Bottom)
, m_opacity(1.0)
, m_opaque(true)
, m_zPosition(0.0)
, m_geometryFlipped(false)
, m_contentsDirty(false)
- , m_contents(0)
{
}
@@ -103,90 +101,94 @@ void LayerChromium::setLayerRenderer(LayerRendererChromium* renderer)
m_layerRenderer = renderer;
}
-void LayerChromium::updateTextureContents(unsigned int textureId)
+void LayerChromium::updateTextureContents(unsigned textureId)
{
RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_owner->client());
+ if (!backing || backing->paintingGoesToWindow())
+ return;
+
+ ASSERT(drawsContent());
+
+ void* pixels = 0;
+ IntRect dirtyRect(m_dirtyRect);
+ IntSize requiredTextureSize;
+ IntSize bitmapSize;
- if (backing && !backing->paintingGoesToWindow()) {
- void* pixels = 0;
- IntRect dirtyRect(m_dirtyRect);
- IntSize requiredTextureSize;
- IntSize bitmapSize;
#if PLATFORM(SKIA)
- const SkBitmap* skiaBitmap = 0;
- OwnPtr<skia::PlatformCanvas> canvas;
- OwnPtr<PlatformContextSkia> skiaContext;
- OwnPtr<GraphicsContext> graphicsContext;
- if (drawsContent()) { // Layer contents must be drawn into a canvas.
- // Clip the dirtyRect to the size of the layer to avoid drawing outside
- // the bounds of the backing texture.
- dirtyRect.intersect(IntRect(IntPoint(0, 0), m_bounds));
-
- canvas.set(new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), false));
- skiaContext.set(new PlatformContextSkia(canvas.get()));
-
- // This is needed to get text to show up correctly. Without it,
- // GDI renders with zero alpha and the text becomes invisible.
- // Unfortunately, setting this to true disables cleartype.
- // FIXME: Does this take us down a very slow text rendering path?
- skiaContext->setDrawingToImageBuffer(true);
-
- graphicsContext.set(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(skiaContext.get())));
-
- // Bring the canvas into the coordinate system of the paint rect.
- canvas->translate(static_cast<SkScalar>(-dirtyRect.x()), static_cast<SkScalar>(-dirtyRect.y()));
-
- m_owner->paintGraphicsLayerContents(*graphicsContext, dirtyRect);
- const SkBitmap& bitmap = canvas->getDevice()->accessBitmap(false);
- skiaBitmap = &bitmap;
- requiredTextureSize = m_bounds;
- } else { // Layer is a container.
- // The layer contains an Image.
- NativeImageSkia* skiaImage = static_cast<NativeImageSkia*>(contents());
- skiaBitmap = skiaImage;
- requiredTextureSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
- }
-
- ASSERT(skiaBitmap);
- SkAutoLockPixels lock(*skiaBitmap);
- SkBitmap::Config skiaConfig = skiaBitmap->config();
- // FIXME: do we need to support more image configurations?
- if (skiaConfig == SkBitmap::kARGB_8888_Config) {
- pixels = skiaBitmap->getPixels();
- bitmapSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
- }
+ const SkBitmap* skiaBitmap = 0;
+ OwnPtr<skia::PlatformCanvas> canvas;
+ OwnPtr<PlatformContextSkia> skiaContext;
+ OwnPtr<GraphicsContext> graphicsContext;
+
+ requiredTextureSize = m_bounds;
+ IntRect boundsRect(IntPoint(0, 0), m_bounds);
+
+ // If the texture needs to be reallocated then we must redraw the entire
+ // contents of the layer.
+ if (requiredTextureSize != m_allocatedTextureSize)
+ dirtyRect = boundsRect;
+ else {
+ // Clip the dirtyRect to the size of the layer to avoid drawing outside
+ // the bounds of the backing texture.
+ dirtyRect.intersect(boundsRect);
+ }
+
+ canvas.set(new skia::PlatformCanvas(dirtyRect.width(), dirtyRect.height(), false));
+ skiaContext.set(new PlatformContextSkia(canvas.get()));
+
+ // This is needed to get text to show up correctly. Without it,
+ // GDI renders with zero alpha and the text becomes invisible.
+ // Unfortunately, setting this to true disables cleartype.
+ // FIXME: Does this take us down a very slow text rendering path?
+ skiaContext->setDrawingToImageBuffer(true);
+
+ graphicsContext.set(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(skiaContext.get())));
+
+ // Bring the canvas into the coordinate system of the paint rect.
+ canvas->translate(static_cast<SkScalar>(-dirtyRect.x()), static_cast<SkScalar>(-dirtyRect.y()));
+
+ m_owner->paintGraphicsLayerContents(*graphicsContext, dirtyRect);
+ const SkBitmap& bitmap = canvas->getDevice()->accessBitmap(false);
+ skiaBitmap = &bitmap;
+ ASSERT(skiaBitmap);
+
+ SkAutoLockPixels lock(*skiaBitmap);
+ SkBitmap::Config skiaConfig = skiaBitmap->config();
+ // FIXME: do we need to support more image configurations?
+ if (skiaConfig == SkBitmap::kARGB_8888_Config) {
+ pixels = skiaBitmap->getPixels();
+ bitmapSize = IntSize(skiaBitmap->width(), skiaBitmap->height());
+ }
#else
#error "Need to implement for your platform."
#endif
- if (pixels) {
- glBindTexture(GL_TEXTURE_2D, textureId);
- // If the texture id or size changed since last time then we need to tell GL
- // to re-allocate a texture.
- if (m_allocatedTextureId != textureId || requiredTextureSize != m_allocatedTextureSize) {
- ASSERT(bitmapSize == requiredTextureSize);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
-
- m_allocatedTextureId = textureId;
- m_allocatedTextureSize = requiredTextureSize;
- } else {
- ASSERT(dirtyRect.width() <= m_allocatedTextureSize.width() && dirtyRect.height() <= m_allocatedTextureSize.height());
- ASSERT(dirtyRect.width() == bitmapSize.width() && dirtyRect.height() == bitmapSize.height());
- glTexSubImage2D(GL_TEXTURE_2D, 0, dirtyRect.x(), dirtyRect.y(), dirtyRect.width(), dirtyRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, pixels);
- }
- }
- }
- m_contentsDirty = false;
- m_dirtyRect.setSize(FloatSize());
+ if (pixels)
+ updateTextureRect(pixels, bitmapSize, requiredTextureSize, dirtyRect, textureId);
}
-void LayerChromium::setContents(NativeImagePtr contents)
+void LayerChromium::updateTextureRect(void* pixels, const IntSize& bitmapSize, const IntSize& requiredTextureSize, const IntRect& updateRect, unsigned textureId)
{
- // Check if the image has changed.
- if (m_contents == contents)
+ if (!pixels)
return;
- m_contents = contents;
- setNeedsDisplay();
+
+ glBindTexture(GL_TEXTURE_2D, textureId);
+ // If the texture id or size changed since last time then we need to tell GL
+ // to re-allocate a texture.
+ if (m_allocatedTextureId != textureId || requiredTextureSize != m_allocatedTextureSize) {
+ ASSERT(bitmapSize == requiredTextureSize);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+
+ m_allocatedTextureId = textureId;
+ m_allocatedTextureSize = requiredTextureSize;
+ } else {
+ ASSERT(updateRect.width() <= m_allocatedTextureSize.width() && updateRect.height() <= m_allocatedTextureSize.height());
+ ASSERT(updateRect.width() == bitmapSize.width() && updateRect.height() == bitmapSize.height());
+ glTexSubImage2D(GL_TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, pixels);
+ }
+
+ m_dirtyRect.setSize(FloatSize());
+ m_contentsDirty = false;
}
void LayerChromium::setNeedsCommit()
@@ -331,5 +333,4 @@ void LayerChromium::setNeedsDisplay()
}
}
-
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/LayerChromium.h b/WebCore/platform/graphics/chromium/LayerChromium.h
index 7af7e9b..f19baea 100644
--- a/WebCore/platform/graphics/chromium/LayerChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerChromium.h
@@ -52,21 +52,18 @@ class PlatformCanvas;
namespace WebCore {
+class GraphicsContext3D;
class LayerRendererChromium;
+// Base class for composited layers. The implementation covers layers that require
+// a GraphicsContext to render their contents. Special layer types are derived from
+// this class.
class LayerChromium : public RefCounted<LayerChromium> {
public:
- enum LayerType { Layer, TransformLayer };
- enum FilterType { Linear, Nearest, Trilinear, Lanczos };
- enum ContentsGravityType { Center, Top, Bottom, Left, Right, TopLeft, TopRight,
- BottomLeft, BottomRight, Resize, ResizeAspect, ResizeAspectFill };
-
- static PassRefPtr<LayerChromium> create(LayerType, GraphicsLayerChromium* owner = 0);
+ static PassRefPtr<LayerChromium> create(GraphicsLayerChromium* owner = 0);
~LayerChromium();
- void display(PlatformGraphicsContext*);
-
void addSublayer(PassRefPtr<LayerChromium>);
void insertSublayer(PassRefPtr<LayerChromium>, size_t index);
void replaceSublayer(LayerChromium* reference, PassRefPtr<LayerChromium> newLayer);
@@ -93,9 +90,6 @@ public:
void setClearsContext(bool clears) { m_clearsContext = clears; setNeedsCommit(); }
bool clearsContext() const { return m_clearsContext; }
- void setContentsGravity(ContentsGravityType gravityType) { m_contentsGravity = gravityType; setNeedsCommit(); }
- ContentsGravityType contentsGravity() const { return m_contentsGravity; }
-
void setDoubleSided(bool doubleSided) { m_doubleSided = doubleSided; setNeedsCommit(); }
bool doubleSided() const { return m_doubleSided; }
@@ -152,27 +146,42 @@ public:
void setGeometryFlipped(bool flipped) { m_geometryFlipped = flipped; setNeedsCommit(); }
bool geometryFlipped() const { return m_geometryFlipped; }
- void updateTextureContents(unsigned int textureId);
+ virtual void updateTextureContents(unsigned textureId);
bool contentsDirty() { return m_contentsDirty; }
- void setContents(NativeImagePtr contents);
- NativeImagePtr contents() const { return m_contents; }
-
void setDrawTransform(const TransformationMatrix& transform) { m_drawTransform = transform; }
const TransformationMatrix& drawTransform() const { return m_drawTransform; }
void setDrawOpacity(float opacity) { m_drawOpacity = opacity; }
float drawOpacity() const { return m_drawOpacity; }
- bool drawsContent() { return m_owner && m_owner->drawsContent(); }
+ virtual bool drawsContent() { return m_owner && m_owner->drawsContent(); }
+
+ // Return true if the layer has its own GL texture and false if the texture
+ // needs to be allocated by the compositor.
+ virtual bool ownsTexture() { return false; }
+
+ // Returns the id of the GL texture that stores the contents of this layer.
+ // Derived layer classes that own their own textures should overwrite this method.
+ virtual unsigned textureId() { return m_allocatedTextureId; }
bool preserves3D() { return m_owner && m_owner->preserves3D(); }
void setLayerRenderer(LayerRendererChromium*);
-private:
- LayerChromium(LayerType, GraphicsLayerChromium* owner);
+ static void setShaderProgramId(unsigned shaderProgramId) { m_shaderProgramId = shaderProgramId; }
+ virtual unsigned shaderProgramId() { return m_shaderProgramId; }
+
+protected:
+ GraphicsLayerChromium* m_owner;
+ LayerChromium(GraphicsLayerChromium* owner);
+ void updateTextureRect(void* pixels, const IntSize& bitmapSize, const IntSize& requiredTextureSize, const IntRect& dirtyRect, unsigned textureId);
+ IntSize m_bounds;
+ FloatRect m_dirtyRect;
+ bool m_contentsDirty;
+
+private:
void setNeedsCommit();
void setSuperlayer(LayerChromium* superlayer) { m_superlayer = superlayer; }
@@ -193,17 +202,11 @@ private:
Vector<RefPtr<LayerChromium> > m_sublayers;
LayerChromium* m_superlayer;
- GraphicsLayerChromium* m_owner;
-
- LayerType m_layerType;
-
- IntSize m_bounds;
IntSize m_backingStoreSize;
FloatPoint m_position;
FloatPoint m_anchorPoint;
Color m_backgroundColor;
Color m_borderColor;
- FloatRect m_dirtyRect;
LayerRendererChromium* m_layerRenderer;
@@ -221,9 +224,13 @@ private:
float m_drawOpacity;
- unsigned int m_allocatedTextureId;
+ unsigned m_allocatedTextureId;
IntSize m_allocatedTextureSize;
+ // The shader program used by all layers of this type is the same.
+ // This static can be shadowed by derived classes to use a special shader.
+ static unsigned m_shaderProgramId;
+
bool m_clearsContext;
bool m_doubleSided;
bool m_hidden;
@@ -232,15 +239,10 @@ private:
bool m_geometryFlipped;
bool m_needsDisplayOnBoundsChange;
- bool m_contentsDirty;
-
- ContentsGravityType m_contentsGravity;
- NativeImagePtr m_contents;
String m_name;
};
}
-
#endif // USE(ACCELERATED_COMPOSITING)
#endif
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index 73311be..dc587dd 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -38,6 +38,8 @@
#include "LayerChromium.h"
#include "NotImplemented.h"
#include "Page.h"
+#include "TransformLayerChromium.h"
+#include "WebGLLayerChromium.h"
#if PLATFORM(SKIA)
#include "NativeImageSkia.h"
#include "PlatformContextSkia.h"
@@ -104,6 +106,22 @@ static GLuint loadShaderProgram(const char* vertexShaderSource, const char* frag
return programObject;
}
+bool LayerRendererChromium::createLayerShader(ShaderProgramType type, const char* vertexShaderSource, const char* fragmentShaderSource)
+{
+ unsigned programId = loadShaderProgram(vertexShaderSource, fragmentShaderSource);
+ ASSERT(programId);
+
+ ShaderProgram* program = &m_shaderPrograms[type];
+
+ program->m_shaderProgramId = programId;
+ program->m_samplerLocation = glGetUniformLocation(programId, "s_texture");
+ program->m_matrixLocation = glGetUniformLocation(programId, "matrix");
+ program->m_alphaLocation = glGetUniformLocation(programId, "alpha");
+
+ return programId;
+}
+
+
static void toGLMatrix(float* flattened, const TransformationMatrix& m)
{
flattened[0] = m.m11();
@@ -164,6 +182,14 @@ static inline bool compareLayerZ(const LayerChromium* a, const LayerChromium* b)
return transformA.m43() < transformB.m43();
}
+ShaderProgram::ShaderProgram()
+ : m_shaderProgramId(0)
+ , m_samplerLocation(-1)
+ , m_matrixLocation(-1)
+ , m_alphaLocation(-1)
+{
+}
+
PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(Page* page)
{
return new LayerRendererChromium(page);
@@ -172,15 +198,13 @@ PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(Page* page)
LayerRendererChromium::LayerRendererChromium(Page* page)
: m_rootLayer(0)
, m_needsDisplay(false)
- , m_layerProgramObject(0)
- , m_borderProgramObject(0)
- , m_scrollProgramObject(0)
, m_positionLocation(0)
, m_texCoordLocation(1)
, m_page(page)
, m_rootLayerTextureWidth(0)
, m_rootLayerTextureHeight(0)
, m_scrollPosition(IntPoint(-1, -1))
+ , m_currentShaderProgramType(NumShaderProgramTypes)
{
m_quadVboIds[Vertices] = m_quadVboIds[LayerElements] = 0;
m_hardwareCompositing = (initGL() && initializeSharedGLObjects());
@@ -191,9 +215,11 @@ LayerRendererChromium::~LayerRendererChromium()
if (m_hardwareCompositing) {
makeContextCurrent();
glDeleteBuffers(3, m_quadVboIds);
- glDeleteProgram(m_layerProgramObject);
- glDeleteProgram(m_scrollProgramObject);
- glDeleteProgram(m_borderProgramObject);
+
+ for (int i = 0; i < NumShaderProgramTypes; i++) {
+ if (m_shaderPrograms[i].m_shaderProgramId)
+ glDeleteProgram(m_shaderPrograms[i].m_shaderProgramId);
+ }
}
// Free up all GL textures.
@@ -224,7 +250,21 @@ void LayerRendererChromium::setRootLayerCanvasSize(const IntSize& size)
m_rootLayerCanvasSize = size;
}
-void LayerRendererChromium::drawTexturedQuad(const TransformationMatrix& matrix, float width, float height, float opacity, bool scrolling)
+void LayerRendererChromium::useShaderProgram(ShaderProgramType programType)
+{
+ if (programType != m_currentShaderProgramType) {
+ ShaderProgram* program = &m_shaderPrograms[programType];
+ glUseProgram(program->m_shaderProgramId);
+ m_currentShaderProgramType = programType;
+
+ // Set the uniform locations matching the program.
+ m_samplerLocation = program->m_samplerLocation;
+ m_matrixLocation = program->m_matrixLocation;
+ m_alphaLocation = program->m_alphaLocation;
+ }
+}
+
+void LayerRendererChromium::drawTexturedQuad(const TransformationMatrix& matrix, float width, float height, float opacity)
{
static GLfloat glMatrix[16];
@@ -238,10 +278,9 @@ void LayerRendererChromium::drawTexturedQuad(const TransformationMatrix& matrix,
toGLMatrix(&glMatrix[0], renderMatrix);
- int matrixLocation = (scrolling ? m_scrollMatrixLocation : m_matrixLocation);
- glUniformMatrix4fv(matrixLocation, 1, false, &glMatrix[0]);
+ glUniformMatrix4fv(m_matrixLocation, 1, false, &glMatrix[0]);
- if (!scrolling)
+ if (m_alphaLocation != -1)
glUniform1f(m_alphaLocation, opacity);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
@@ -265,8 +304,8 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
glBindTexture(GL_TEXTURE_2D, m_rootLayerTextureId);
- unsigned int visibleRectWidth = visibleRect.width();
- unsigned int visibleRectHeight = visibleRect.height();
+ unsigned visibleRectWidth = visibleRect.width();
+ unsigned visibleRectHeight = visibleRect.height();
if (visibleRectWidth != m_rootLayerTextureWidth || visibleRectHeight != m_rootLayerTextureHeight) {
m_rootLayerTextureWidth = visibleRect.width();
m_rootLayerTextureHeight = visibleRect.height();
@@ -310,10 +349,10 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
scrolledLayerMatrix.scale3d(1, -1, 1);
// Switch shaders to avoid RGB swizzling.
- glUseProgram(m_scrollProgramObject);
- glUniform1i(m_scrollSamplerLocation, 0);
+ useShaderProgram(ScrollLayerProgram);
+ glUniform1i(m_shaderPrograms[ScrollLayerProgram].m_samplerLocation, 0);
- drawTexturedQuad(scrolledLayerMatrix, visibleRect.width(), visibleRect.height(), 1, true);
+ drawTexturedQuad(scrolledLayerMatrix, visibleRect.width(), visibleRect.height(), 1);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, contentRect.width(), contentRect.height());
@@ -349,11 +388,11 @@ void LayerRendererChromium::drawLayers(const IntRect& updateRect, const IntRect&
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Render the root layer using a quad that takes up the entire visible area of the window.
- glUseProgram(m_layerProgramObject);
+ useShaderProgram(ContentLayerProgram);
glUniform1i(m_samplerLocation, 0);
TransformationMatrix layerMatrix;
layerMatrix.translate3d(visibleRect.width() / 2, visibleRect.height() / 2, 0);
- drawTexturedQuad(layerMatrix, visibleRect.width(), visibleRect.height(), 1, false);
+ drawTexturedQuad(layerMatrix, visibleRect.width(), visibleRect.height(), 1);
// If culling is enabled then we will cull the backface.
glCullFace(GL_BACK);
@@ -442,13 +481,14 @@ void LayerRendererChromium::drawDebugBorder(LayerChromium* layer, const Transfor
if (!borderColor.alpha())
return;
- glUseProgram(m_borderProgramObject);
+ useShaderProgram(DebugBorderProgram);
TransformationMatrix renderMatrix = matrix;
IntSize bounds = layer->bounds();
renderMatrix.scale3d(bounds.width(), bounds.height(), 1);
renderMatrix.multiply(m_projectionMatrix);
toGLMatrix(&glMatrix[0], renderMatrix);
- glUniformMatrix4fv(m_borderMatrixLocation, 1, false, &glMatrix[0]);
+ unsigned borderMatrixLocation = m_shaderPrograms[DebugBorderProgram].m_matrixLocation;
+ glUniformMatrix4fv(borderMatrixLocation, 1, false, &glMatrix[0]);
glUniform4f(m_borderColorLocation, borderColor.red() / 255.0,
borderColor.green() / 255.0,
@@ -460,9 +500,6 @@ void LayerRendererChromium::drawDebugBorder(LayerChromium* layer, const Transfor
// The indices for the line are stored in the same array as the triangle indices.
glDrawElements(GL_LINE_LOOP, 4, GL_UNSIGNED_SHORT, (void*)(6 * sizeof(unsigned short)));
checkGLError();
-
- // Switch back to the shader program used for layer contents.
- glUseProgram(m_layerProgramObject);
}
// Returns true if any part of the layer falls within the visibleRect
@@ -524,11 +561,9 @@ void LayerRendererChromium::updateLayersRecursive(LayerChromium* layer, const Tr
// Check if the layer falls within the visible bounds of the page.
bool layerVisible = isLayerVisible(layer, localMatrix, visibleRect);
- bool layerHasContent = layer->drawsContent() || layer->contents();
-
bool skipLayer = false;
if (bounds.width() > 2048 || bounds.height() > 2048) {
- if (layerHasContent)
+ if (layer->drawsContent())
LOG(LayerRenderer, "Skipping layer with size %d %d", bounds.width(), bounds.height());
skipLayer = true;
}
@@ -571,15 +606,16 @@ void LayerRendererChromium::drawLayer(LayerChromium* layer)
const TransformationMatrix& localMatrix = layer->drawTransform();
IntSize bounds = layer->bounds();
- // Note that there are two types of layers:
- // 1. Layers that draw their own content via the GraphicsContext (layer->drawsContent() == true).
- // 2. Layers that are pure containers of images/video/etc whose content is simply
- // copied into the backing texture (layer->contents() == true).
- if (layer->drawsContent() || layer->contents()) {
- int textureId = getTextureId(layer);
- // If no texture has been created for the layer yet then create one now.
- if (textureId == -1)
- textureId = assignTextureForLayer(layer);
+ if (layer->drawsContent()) {
+ int textureId;
+ if (layer->ownsTexture())
+ textureId = layer->textureId();
+ else {
+ textureId = getTextureId(layer);
+ // If no texture has been created for the layer yet then create one now.
+ if (textureId == -1)
+ textureId = assignTextureForLayer(layer);
+ }
// Redraw the contents of the layer if necessary.
if (layer->contentsDirty()) {
@@ -587,14 +623,19 @@ void LayerRendererChromium::drawLayer(LayerChromium* layer)
layer->updateTextureContents(textureId);
}
+ // FIXME: This is temporary until WebGL layers stop changing the current
+ // context.
+ if (layer->ownsTexture())
+ makeContextCurrent();
+
if (layer->doubleSided())
glDisable(GL_CULL_FACE);
else
glEnable(GL_CULL_FACE);
glBindTexture(GL_TEXTURE_2D, textureId);
-
- drawTexturedQuad(localMatrix, bounds.width(), bounds.height(), layer->drawOpacity(), false);
+ useShaderProgram(static_cast<ShaderProgramType>(layer->shaderProgramId()));
+ drawTexturedQuad(localMatrix, bounds.width(), bounds.height(), layer->drawOpacity());
}
// Draw the debug border if there is one.
@@ -616,14 +657,15 @@ bool LayerRendererChromium::initGL()
return true;
}
-// Binds the given attribute name to a common location across all three programs
-// used by the compositor. This allows the code to bind the attributes only once
-// even when switching between programs.
-void LayerRendererChromium::bindCommonAttribLocation(int location, char* attribName)
+void LayerRendererChromium::bindCommonAttribLocations(ShaderProgramType program)
{
- glBindAttribLocation(m_layerProgramObject, location, attribName);
- glBindAttribLocation(m_borderProgramObject, location, attribName);
- glBindAttribLocation(m_scrollProgramObject, location, attribName);
+ unsigned programId = m_shaderPrograms[program].m_shaderProgramId;
+ glBindAttribLocation(programId, m_positionLocation, "a_position");
+ glBindAttribLocation(programId, m_texCoordLocation, "a_texCoord");
+
+ // Re-link the program for the new attribute locations to take effect.
+ glLinkProgram(programId);
+ checkGLError();
}
bool LayerRendererChromium::initializeSharedGLObjects()
@@ -663,6 +705,19 @@ bool LayerRendererChromium::initializeSharedGLObjects()
" gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w); \n"
"} \n";
+ // WebGL layers need to be flipped vertically and their colors shouldn't be
+ // swizzled.
+ char webGLFragmentShaderString[] =
+ "precision mediump float; \n"
+ "varying vec2 v_texCoord; \n"
+ "uniform sampler2D s_texture; \n"
+ "uniform float alpha; \n"
+ "void main() \n"
+ "{ \n"
+ " vec4 texColor = texture2D(s_texture, vec2(v_texCoord.x, 1.0 - v_texCoord.y)); \n"
+ " gl_FragColor = vec4(texColor.x, texColor.y, texColor.z, texColor.w) * alpha; \n"
+ "} \n";
+
// Shaders for drawing the debug borders around the layers.
char borderVertexShaderString[] =
"attribute vec4 a_position; \n"
@@ -692,49 +747,38 @@ bool LayerRendererChromium::initializeSharedGLObjects()
0, 1, 2, 3}; // A line path for drawing the layer border.
makeContextCurrent();
- m_layerProgramObject = loadShaderProgram(vertexShaderString, fragmentShaderString);
- if (!m_layerProgramObject) {
- LOG_ERROR("Failed to create shader program for layers");
+
+ if (!createLayerShader(ContentLayerProgram, vertexShaderString, fragmentShaderString)) {
+ LOG_ERROR("Failed to create shader program for content layers");
return false;
}
+ LayerChromium::setShaderProgramId(ContentLayerProgram);
- m_scrollProgramObject = loadShaderProgram(vertexShaderString, scrollFragmentShaderString);
- if (!m_scrollProgramObject) {
+ if (!createLayerShader(WebGLLayerProgram, vertexShaderString, webGLFragmentShaderString)) {
+ LOG_ERROR("Failed to create shader program for WebGL layers");
+ return false;
+ }
+ WebGLLayerChromium::setShaderProgramId(WebGLLayerProgram);
+
+ if (!createLayerShader(ScrollLayerProgram, vertexShaderString, scrollFragmentShaderString)) {
LOG_ERROR("Failed to create shader program for scrolling layer");
return false;
}
- m_borderProgramObject = loadShaderProgram(borderVertexShaderString, borderFragmentShaderString);
- if (!m_borderProgramObject) {
+ if (!createLayerShader(DebugBorderProgram, borderVertexShaderString, borderFragmentShaderString)) {
LOG_ERROR("Failed to create shader program for debug borders");
return false;
}
- // Specify the attrib location for the position and make it the same for all three programs to
+ // Specify the attrib location for the position and texCoord and make it the same for all programs to
// avoid binding re-binding the vertex attributes.
- bindCommonAttribLocation(m_positionLocation, "a_position");
- bindCommonAttribLocation(m_texCoordLocation, "a_texCoord");
-
- checkGLError();
-
- // Re-link the shaders to get the new attrib location to take effect.
- glLinkProgram(m_layerProgramObject);
- glLinkProgram(m_borderProgramObject);
- glLinkProgram(m_scrollProgramObject);
-
- checkGLError();
-
- // Get locations of uniforms for the layer content shader program.
- m_samplerLocation = glGetUniformLocation(m_layerProgramObject, "s_texture");
- m_matrixLocation = glGetUniformLocation(m_layerProgramObject, "matrix");
- m_alphaLocation = glGetUniformLocation(m_layerProgramObject, "alpha");
-
- m_scrollMatrixLocation = glGetUniformLocation(m_scrollProgramObject, "matrix");
- m_scrollSamplerLocation = glGetUniformLocation(m_scrollProgramObject, "s_texture");
+ bindCommonAttribLocations(ContentLayerProgram);
+ bindCommonAttribLocations(WebGLLayerProgram);
+ bindCommonAttribLocations(DebugBorderProgram);
+ bindCommonAttribLocations(ScrollLayerProgram);
- // Get locations of uniforms for the debug border shader program.
- m_borderMatrixLocation = glGetUniformLocation(m_borderProgramObject, "matrix");
- m_borderColorLocation = glGetUniformLocation(m_borderProgramObject, "color");
+ // Get the location of the color uniform for the debug border shader program.
+ m_borderColorLocation = glGetUniformLocation(m_shaderPrograms[DebugBorderProgram].m_shaderProgramId, "color");
glGenBuffers(3, m_quadVboIds);
glBindBuffer(GL_ARRAY_BUFFER, m_quadVboIds[Vertices]);
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.h b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
index a2e3427..dc7ea70 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.h
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.h
@@ -47,6 +47,16 @@ namespace WebCore {
class GLES2Context;
class Page;
+class ShaderProgram {
+public:
+ ShaderProgram();
+
+ unsigned m_shaderProgramId;
+ int m_samplerLocation;
+ int m_matrixLocation;
+ int m_alphaLocation;
+};
+
// Class that handles drawing of composited render layers using GL.
class LayerRendererChromium : public Noncopyable {
public:
@@ -74,17 +84,23 @@ public:
GraphicsContext* rootLayerGraphicsContext() const { return m_rootLayerGraphicsContext.get(); }
private:
+ enum ShaderProgramType { DebugBorderProgram, ScrollLayerProgram, ContentLayerProgram, WebGLLayerProgram, NumShaderProgramTypes };
+
void updateLayersRecursive(LayerChromium* layer, const TransformationMatrix& parentMatrix, float opacity, const IntRect& visibleRect);
void drawLayer(LayerChromium*);
void drawDebugBorder(LayerChromium*, const TransformationMatrix&);
- void drawTexturedQuad(const TransformationMatrix& matrix, float width, float height, float opacity, bool scrolling);
+ void drawTexturedQuad(const TransformationMatrix& matrix, float width, float height, float opacity);
bool isLayerVisible(LayerChromium*, const TransformationMatrix&, const IntRect& visibleRect);
- void bindCommonAttribLocation(int location, char* attribName);
+ bool createLayerShader(ShaderProgramType, const char* vertexShaderSource, const char* fragmentShaderSource);
+
+ void useShaderProgram(ShaderProgramType);
+
+ void bindCommonAttribLocations(ShaderProgramType);
enum VboIds { Vertices, LayerElements };
@@ -96,12 +112,9 @@ private:
int getTextureId(LayerChromium*);
int assignTextureForLayer(LayerChromium*);
- // GL shader program object IDs.
- unsigned int m_layerProgramObject;
- unsigned int m_borderProgramObject;
- unsigned int m_scrollProgramObject;
+ ShaderProgram m_shaderPrograms[NumShaderProgramTypes];
- unsigned int m_rootLayerTextureId;
+ unsigned m_rootLayerTextureId;
int m_rootLayerTextureWidth;
int m_rootLayerTextureHeight;
@@ -111,13 +124,9 @@ private:
int m_samplerLocation;
int m_matrixLocation;
int m_alphaLocation;
- int m_scrollMatrixLocation;
- int m_scrollSamplerLocation;
-
- int m_borderMatrixLocation;
int m_borderColorLocation;
- unsigned int m_quadVboIds[3];
+ unsigned m_quadVboIds[3];
TransformationMatrix m_projectionMatrix;
RefPtr<LayerChromium> m_rootLayer;
@@ -128,8 +137,10 @@ private:
IntPoint m_scrollPosition;
bool m_hardwareCompositing;
+ ShaderProgramType m_currentShaderProgramType;
+
// Map associating layers with textures ids used by the GL compositor.
- typedef HashMap<LayerChromium*, unsigned int> TextureIdMap;
+ typedef HashMap<LayerChromium*, unsigned> TextureIdMap;
TextureIdMap m_textureIdMap;
#if PLATFORM(SKIA)
diff --git a/WebCore/platform/graphics/chromium/TransformLayerChromium.cpp b/WebCore/platform/graphics/chromium/TransformLayerChromium.cpp
new file mode 100644
index 0000000..6427eeb
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/TransformLayerChromium.cpp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "TransformLayerChromium.h"
+
+namespace WebCore {
+
+PassRefPtr<TransformLayerChromium> TransformLayerChromium::create(GraphicsLayerChromium* owner)
+{
+ return adoptRef(new TransformLayerChromium(owner));
+}
+
+TransformLayerChromium::TransformLayerChromium(GraphicsLayerChromium* owner)
+ : LayerChromium(owner)
+{
+}
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/TransformLayerChromium.h b/WebCore/platform/graphics/chromium/TransformLayerChromium.h
new file mode 100644
index 0000000..3d5ce94
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/TransformLayerChromium.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef TransformLayerChromium_h
+#define TransformLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+namespace WebCore {
+
+// A Layer that doesn't draw any content but simply exists to group and
+// transform its descendants.
+class TransformLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<TransformLayerChromium> create(GraphicsLayerChromium* owner = 0);
+ virtual bool drawsContent() { return false; }
+
+private:
+ TransformLayerChromium(GraphicsLayerChromium* owner);
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp b/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
new file mode 100644
index 0000000..6b49b9a
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "WebGLLayerChromium.h"
+
+namespace WebCore {
+
+unsigned WebGLLayerChromium::m_shaderProgramId = 0;
+
+WebGLLayerChromium::WebGLLayerChromium(GraphicsLayerChromium* owner)
+ : LayerChromium(owner)
+ , m_context(0)
+ , m_textureId(0)
+ , m_textureChanged(false)
+{
+}
+
+unsigned WebGLLayerChromium::textureId()
+{
+ return m_textureId;
+}
+
+void WebGLLayerChromium::updateTextureContents(unsigned textureId)
+{
+ // FIXME: Implement
+}
+
+void WebGLLayerChromium::setContext(const GraphicsContext3D* context)
+{
+ // FIXME: Implement
+}
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/chromium/WebGLLayerChromium.h b/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
new file mode 100644
index 0000000..abd0c93
--- /dev/null
+++ b/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 WebGLLayerChromium_h
+#define WebGLLayerChromium_h
+
+#if USE(ACCELERATED_COMPOSITING)
+
+#include "LayerChromium.h"
+
+namespace WebCore {
+
+class GraphicsContext3D;
+
+// A Layer that contains a WebGL element.
+class WebGLLayerChromium : public LayerChromium {
+public:
+ static PassRefPtr<WebGLLayerChromium> create(GraphicsLayerChromium* owner = 0);
+ virtual bool drawsContent() { return m_context; }
+ virtual bool ownsTexture() { return true; }
+ virtual void updateTextureContents(unsigned);
+ virtual unsigned textureId();
+ virtual unsigned shaderProgramId() { return m_shaderProgramId; }
+
+ void setContext(const GraphicsContext3D* context);
+
+ static void setShaderProgramId(unsigned shaderProgramId) { m_shaderProgramId = shaderProgramId; }
+
+private:
+ WebGLLayerChromium(GraphicsLayerChromium* owner);
+ GraphicsContext3D* m_context;
+ unsigned m_textureId;
+ bool m_textureChanged;
+
+ static unsigned m_shaderProgramId;
+};
+
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+#endif
diff --git a/WebCore/platform/graphics/efl/FontEfl.cpp b/WebCore/platform/graphics/efl/FontEfl.cpp
index 2aeb397..96d6a7b 100644
--- a/WebCore/platform/graphics/efl/FontEfl.cpp
+++ b/WebCore/platform/graphics/efl/FontEfl.cpp
@@ -51,13 +51,13 @@ float Font::floatWidthForComplexText(const TextRun&, HashSet<const SimpleFontDat
return 0.0f;
}
-int Font::offsetForPositionForComplexText(const TextRun&, int, bool) const
+int Font::offsetForPositionForComplexText(const TextRun&, float, bool) const
{
notImplemented();
return 0;
}
-FloatRect Font::selectionRectForComplexText(const TextRun&, const IntPoint&, int, int, int) const
+FloatRect Font::selectionRectForComplexText(const TextRun&, const FloatPoint&, int, int, int) const
{
notImplemented();
return FloatRect();
diff --git a/WebCore/platform/graphics/filters/FEBlend.h b/WebCore/platform/graphics/filters/FEBlend.h
index a387814..52de647 100644
--- a/WebCore/platform/graphics/filters/FEBlend.h
+++ b/WebCore/platform/graphics/filters/FEBlend.h
@@ -19,8 +19,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEBlend_h
-#define SVGFEBlend_h
+#ifndef FEBlend_h
+#define FEBlend_h
#if ENABLE(FILTERS)
#include "FilterEffect.h"
@@ -65,4 +65,4 @@ namespace WebCore {
#endif // ENABLE(FILTERS)
-#endif // SVGFEBlend_h
+#endif // FEBlend_h
diff --git a/WebCore/platform/graphics/filters/FEColorMatrix.h b/WebCore/platform/graphics/filters/FEColorMatrix.h
index 104a2e8..906d0f1 100644
--- a/WebCore/platform/graphics/filters/FEColorMatrix.h
+++ b/WebCore/platform/graphics/filters/FEColorMatrix.h
@@ -19,8 +19,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEColorMatrix_h
-#define SVGFEColorMatrix_h
+#ifndef FEColorMatrix_h
+#define FEColorMatrix_h
#if ENABLE(FILTERS)
#include "FilterEffect.h"
@@ -65,4 +65,4 @@ namespace WebCore {
#endif // ENABLE(FILTERS)
-#endif // SVGFEColorMatrix_h
+#endif // FEColorMatrix_h
diff --git a/WebCore/platform/graphics/filters/FEComponentTransfer.h b/WebCore/platform/graphics/filters/FEComponentTransfer.h
index a79e5df..834d9ee 100644
--- a/WebCore/platform/graphics/filters/FEComponentTransfer.h
+++ b/WebCore/platform/graphics/filters/FEComponentTransfer.h
@@ -19,8 +19,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEComponentTransfer_h
-#define SVGFEComponentTransfer_h
+#ifndef FEComponentTransfer_h
+#define FEComponentTransfer_h
#if ENABLE(FILTERS)
#include "FilterEffect.h"
@@ -98,4 +98,4 @@ namespace WebCore {
#endif // ENABLE(FILTERS)
-#endif // SVGFEComponentTransfer_h
+#endif // FEComponentTransfer_h
diff --git a/WebCore/platform/graphics/filters/FEComposite.h b/WebCore/platform/graphics/filters/FEComposite.h
index b05cc66..11268c7 100644
--- a/WebCore/platform/graphics/filters/FEComposite.h
+++ b/WebCore/platform/graphics/filters/FEComposite.h
@@ -19,8 +19,8 @@
Boston, MA 02110-1301, USA.
*/
-#ifndef SVGFEComposite_h
-#define SVGFEComposite_h
+#ifndef FEComposite_h
+#define FEComposite_h
#if ENABLE(FILTERS)
#include "FilterEffect.h"
@@ -82,4 +82,4 @@ private:
#endif // ENABLE(FILTERS)
-#endif // SVGFEComposite_h
+#endif // FEComposite_h
diff --git a/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
index 3e88f63..38f69b1 100644
--- a/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/DataSourceGStreamer.h
@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef DATA_SOURCE_GSTREAMER_H
-#define DATA_SOURCE_GSTREAMER_H
+#ifndef DataSourceGStreamer_h
+#define DataSourceGStreamer_h
#include <glib-object.h>
#include <gst/base/gstbasesrc.h>
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
index 7e6b71a..29ac356 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
@@ -276,7 +276,7 @@ bool MediaPlayerPrivateGStreamer::isAvailable()
MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer(MediaPlayer* player)
: m_player(player)
, m_playBin(0)
- , m_videoSink(0)
+ , m_webkitVideoSink(0)
, m_fpsSink(0)
, m_source(0)
, m_seekTime(0)
@@ -327,20 +327,16 @@ MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer()
m_source = 0;
}
+ if (m_videoSinkBin) {
+ gst_object_unref(m_videoSinkBin);
+ m_videoSinkBin = 0;
+ }
+
if (m_playBin) {
gst_element_set_state(m_playBin, GST_STATE_NULL);
gst_object_unref(GST_OBJECT(m_playBin));
}
- if (m_videoSink) {
- g_object_unref(m_videoSink);
- m_videoSink = 0;
- }
-
- if (m_fpsSink) {
- g_object_unref(m_fpsSink);
- m_fpsSink = 0;
- }
}
void MediaPlayerPrivateGStreamer::load(const String& url)
@@ -515,7 +511,7 @@ IntSize MediaPlayerPrivateGStreamer::naturalSize() const
if (!hasVideo())
return IntSize();
- GstPad* pad = gst_element_get_static_pad(m_videoSink, "sink");
+ GstPad* pad = gst_element_get_static_pad(m_webkitVideoSink, "sink");
if (!pad)
return IntSize();
@@ -1349,7 +1345,6 @@ bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
return true;
}
-
PlatformMedia MediaPlayerPrivateGStreamer::platformMedia() const
{
PlatformMedia p;
@@ -1393,26 +1388,56 @@ void MediaPlayerPrivateGStreamer::createGSTPlayBin()
g_signal_connect(m_playBin, "notify::source", G_CALLBACK(mediaPlayerPrivateSourceChangedCallback), this);
g_signal_connect(m_playBin, "notify::mute", G_CALLBACK(mediaPlayerPrivateMuteChangedCallback), this);
- m_videoSink = webkit_video_sink_new();
+ m_webkitVideoSink = webkit_video_sink_new();
+
+ g_signal_connect(m_webkitVideoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
+
+ m_videoSinkBin = gst_bin_new("sink");
+ GstElement* videoTee = gst_element_factory_make("tee", "videoTee");
+ GstElement* queue = gst_element_factory_make("queue", 0);
- g_object_ref_sink(m_videoSink);
+ // Take ownership.
+ g_object_ref_sink(m_videoSinkBin);
+
+ // Build a new video sink consisting of a bin containing a tee
+ // (meant to distribute data to multiple video sinks) and our
+ // internal video sink. For fullscreen we create an autovideosink
+ // and initially block the data flow towards it and configure it
+
+ gst_bin_add_many(GST_BIN(m_videoSinkBin), videoTee, queue, NULL);
+
+ // Link a new src pad from tee to queue1.
+ GstPad* srcPad = gst_element_get_request_pad(videoTee, "src%d");
+ GstPad* sinkPad = gst_element_get_static_pad(queue, "sink");
+ gst_pad_link(srcPad, sinkPad);
+ gst_object_unref(GST_OBJECT(srcPad));
+ gst_object_unref(GST_OBJECT(sinkPad));
WTFLogChannel* channel = getChannelFromName("Media");
if (channel->state == WTFLogChannelOn) {
m_fpsSink = gst_element_factory_make("fpsdisplaysink", "sink");
if (g_object_class_find_property(G_OBJECT_GET_CLASS(m_fpsSink), "video-sink")) {
- g_object_set(m_fpsSink, "video-sink", m_videoSink, NULL);
- g_object_ref_sink(m_fpsSink);
- g_object_set(m_playBin, "video-sink", m_fpsSink, NULL);
+ g_object_set(m_fpsSink, "video-sink", m_webkitVideoSink, NULL);
+ gst_bin_add(GST_BIN(m_videoSinkBin), m_fpsSink);
+ gst_element_link(queue, m_fpsSink);
} else {
m_fpsSink = 0;
- g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
+ gst_bin_add(GST_BIN(m_videoSinkBin), m_webkitVideoSink);
+ gst_element_link(queue, m_webkitVideoSink);
LOG_VERBOSE(Media, "Can't display FPS statistics, you need gst-plugins-bad >= 0.10.18");
}
- } else
- g_object_set(m_playBin, "video-sink", m_videoSink, NULL);
+ } else {
+ gst_bin_add(GST_BIN(m_videoSinkBin), m_webkitVideoSink);
+ gst_element_link(queue, m_webkitVideoSink);
+ }
+
+ // Add a ghostpad to the bin so it can proxy to tee.
+ GstPad* pad = gst_element_get_static_pad(videoTee, "sink");
+ gst_element_add_pad(m_videoSinkBin, gst_ghost_pad_new("sink", pad));
+ gst_object_unref(GST_OBJECT(pad));
- g_signal_connect(m_videoSink, "repaint-requested", G_CALLBACK(mediaPlayerPrivateRepaintCallback), this);
+ // Set the bin as video sink of playbin.
+ g_object_set(m_playBin, "video-sink", m_videoSinkBin, NULL);
}
}
diff --git a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
index 81f90b8..d65bdbc 100644
--- a/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
@@ -146,7 +146,8 @@ class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateInterface {
private:
MediaPlayer* m_player;
GstElement* m_playBin;
- GstElement* m_videoSink;
+ GstElement* m_webkitVideoSink;
+ GstElement* m_videoSinkBin;
GstElement* m_fpsSink;
GstElement* m_source;
GstClockTime m_seekTime;
diff --git a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
index f5379b6..4fb0b73 100644
--- a/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
+++ b/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.h
@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _HAVE_WEBKIT_VIDEO_SINK_H
-#define _HAVE_WEBKIT_VIDEO_SINK_H
+#ifndef VideoSinkGStreamer_h
+#define VideoSinkGStreamer_h
#include <glib-object.h>
#include <gst/video/gstvideosink.h>
diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp
index 2164db5..fae84cb 100644
--- a/WebCore/platform/graphics/gtk/FontGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontGtk.cpp
@@ -210,7 +210,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
float red, green, blue, alpha;
// Text shadow, inspired by FontMac
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur = 0;
Color shadowColor;
bool hasShadow = context->textDrawingMode() == cTextFill &&
@@ -308,8 +308,12 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return width;
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int x, bool includePartialGlyphs) const
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
{
+ // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
+ // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
+ int x = static_cast<int>(xFloat);
+
PangoLayout* layout = getDefaultPangoLayout(run);
setPangoAttributes(this, run, layout);
@@ -328,7 +332,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int x, bool includ
return offset;
}
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& point, int h, int from, int to) const
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
{
PangoLayout* layout = getDefaultPangoLayout(run);
setPangoAttributes(this, run, layout);
diff --git a/WebCore/platform/graphics/haiku/FontHaiku.cpp b/WebCore/platform/graphics/haiku/FontHaiku.cpp
index d4622cb..a991bfc 100644
--- a/WebCore/platform/graphics/haiku/FontHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/FontHaiku.cpp
@@ -100,13 +100,13 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return 0;
}
-FloatRect Font::selectionRectForComplexText(const TextRun&, const IntPoint&, int, int, int) const
+FloatRect Font::selectionRectForComplexText(const TextRun&, const FloatPoint&, int, int, int) const
{
notImplemented();
return FloatRect();
}
-int Font::offsetForPositionForComplexText(const TextRun&, int, bool) const
+int Font::offsetForPositionForComplexText(const TextRun&, float, bool) const
{
notImplemented();
return 0;
diff --git a/WebCore/platform/graphics/haiku/FontPlatformData.h b/WebCore/platform/graphics/haiku/FontPlatformData.h
index 9feab8e..4e86e16 100644
--- a/WebCore/platform/graphics/haiku/FontPlatformData.h
+++ b/WebCore/platform/graphics/haiku/FontPlatformData.h
@@ -25,8 +25,8 @@
*
*/
-#ifndef FontPlatformData_H
-#define FontPlatformData_H
+#ifndef FontPlatformData_h
+#define FontPlatformData_h
#include "FontDescription.h"
#include "GlyphBuffer.h"
diff --git a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
index 7350eeb..2f02f31 100644
--- a/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
+++ b/WebCore/platform/graphics/haiku/GraphicsContextHaiku.cpp
@@ -536,7 +536,7 @@ void GraphicsContext::clearPlatformShadow()
notImplemented();
}
-void GraphicsContext::setPlatformShadow(IntSize const&, float, Color const&, ColorSpace)
+void GraphicsContext::setPlatformShadow(FloatSize const&, float, Color const&, ColorSpace)
{
notImplemented();
}
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.cpp b/WebCore/platform/graphics/mac/ComplexTextController.cpp
index 61d5518..61c9a59 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.cpp
+++ b/WebCore/platform/graphics/mac/ComplexTextController.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -69,6 +69,7 @@ ComplexTextController::ComplexTextController(const Font* font, const TextRun& ru
, m_glyphInCurrentRun(0)
, m_characterInCurrentGlyph(0)
, m_finalRoundingWidth(0)
+ , m_padding(run.padding())
, m_fallbackFonts(fallbackFonts)
, m_minGlyphBoundingBoxX(numeric_limits<float>::max())
, m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
@@ -76,26 +77,26 @@ ComplexTextController::ComplexTextController(const Font* font, const TextRun& ru
, m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
, m_lastRoundingGlyph(0)
{
- m_padding = m_run.padding();
if (!m_padding)
m_padPerSpace = 0;
else {
- float numSpaces = 0;
- for (int s = 0; s < m_run.length(); s++)
+ int numSpaces = 0;
+ for (int s = 0; s < m_run.length(); s++) {
if (Font::treatAsSpace(m_run[s]))
numSpaces++;
+ }
- if (numSpaces == 0)
+ if (!numSpaces)
m_padPerSpace = 0;
else
- m_padPerSpace = ceilf(m_run.padding() / numSpaces);
+ m_padPerSpace = m_padding / numSpaces;
}
collectComplexTextRuns();
adjustGlyphsAndAdvances();
}
-int ComplexTextController::offsetForPosition(int h, bool includePartialGlyphs)
+int ComplexTextController::offsetForPosition(float h, bool includePartialGlyphs)
{
if (h >= m_totalWidth)
return m_run.ltr() ? m_end : 0;
@@ -115,9 +116,9 @@ int ComplexTextController::offsetForPosition(int h, bool includePartialGlyphs)
CFIndex hitGlyphStart = complexTextRun.indexAt(j);
CFIndex hitGlyphEnd;
if (m_run.ltr())
- hitGlyphEnd = max<CFIndex>(hitGlyphStart, j + 1 < complexTextRun.glyphCount() ? complexTextRun.indexAt(j + 1) : complexTextRun.stringLength());
+ hitGlyphEnd = max<CFIndex>(hitGlyphStart, j + 1 < complexTextRun.glyphCount() ? complexTextRun.indexAt(j + 1) : static_cast<CFIndex>(complexTextRun.stringLength()));
else
- hitGlyphEnd = max<CFIndex>(hitGlyphStart, j > 0 ? complexTextRun.indexAt(j - 1) : complexTextRun.stringLength());
+ hitGlyphEnd = max<CFIndex>(hitGlyphStart, j > 0 ? complexTextRun.indexAt(j - 1) : static_cast<CFIndex>(complexTextRun.stringLength()));
// FIXME: Instead of dividing the glyph's advance equally between the characters, this
// could use the glyph's "ligature carets". However, there is no Core Text API to get the
@@ -259,7 +260,7 @@ void ComplexTextController::collectComplexTextRuns()
}
if (nextGlyphData.fontData != glyphData.fontData || nextIsSmallCaps != isSmallCaps || !nextGlyphData.glyph != !glyphData.glyph) {
- int itemStart = m_run.rtl() ? index + 1 : indexOfFontTransition;
+ int itemStart = m_run.rtl() ? index + 1 : static_cast<int>(indexOfFontTransition);
int itemLength = m_run.rtl() ? indexOfFontTransition - index : index - indexOfFontTransition;
collectComplexTextRunsForCharacters((isSmallCaps ? m_smallCapsBuffer.data() : cp) + itemStart, itemLength, itemStart, glyphData.glyph ? glyphData.fontData : 0);
indexOfFontTransition = index;
@@ -508,8 +509,9 @@ void ComplexTextController::adjustGlyphsAndAdvances()
advance.width += m_padding;
m_padding = 0;
} else {
- advance.width += m_padPerSpace;
+ float previousPadding = m_padding;
m_padding -= m_padPerSpace;
+ advance.width += roundf(previousPadding) - roundf(m_padding);
}
}
diff --git a/WebCore/platform/graphics/mac/ComplexTextController.h b/WebCore/platform/graphics/mac/ComplexTextController.h
index 55cde29..b520d33 100644
--- a/WebCore/platform/graphics/mac/ComplexTextController.h
+++ b/WebCore/platform/graphics/mac/ComplexTextController.h
@@ -53,7 +53,7 @@ public:
void advance(unsigned to, GlyphBuffer* = 0);
// Compute the character offset for a given x coordinate.
- int offsetForPosition(int x, bool includePartialGlyphs);
+ int offsetForPosition(float x, bool includePartialGlyphs);
// Returns the width of everything we've consumed so far.
float runWidthSoFar() const { return m_runWidthSoFar; }
diff --git a/WebCore/platform/graphics/mac/FontComplexTextMac.cpp b/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
index b7ed0e9..05eae03 100644
--- a/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
+++ b/WebCore/platform/graphics/mac/FontComplexTextMac.cpp
@@ -37,7 +37,7 @@ using namespace std;
namespace WebCore {
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& point, int h,
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h,
int from, int to) const
{
ComplexTextController controller(this, run);
@@ -97,7 +97,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return controller.totalWidth();
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int x, bool includePartialGlyphs) const
+int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
{
ComplexTextController controller(this, run);
return controller.offsetForPosition(x, includePartialGlyphs);
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index 100200a..aeb0ab2 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -135,7 +135,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
CGContextSetFontSize(cgContext, platformData.m_size);
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
ColorSpace fillColorSpace = context->fillColorSpace();
diff --git a/WebCore/platform/graphics/mac/FontPlatformData.h b/WebCore/platform/graphics/mac/FontPlatformData.h
index 23016e7..f4c92be 100644
--- a/WebCore/platform/graphics/mac/FontPlatformData.h
+++ b/WebCore/platform/graphics/mac/FontPlatformData.h
@@ -51,7 +51,8 @@ class String;
inline CTFontRef toCTFontRef(NSFont *nsFont) { return reinterpret_cast<CTFontRef>(nsFont); }
#endif
-struct FontPlatformData {
+class FontPlatformData {
+ public:
FontPlatformData(float size, bool syntheticBold, bool syntheticOblique)
: m_syntheticBold(syntheticBold)
, m_syntheticOblique(syntheticOblique)
diff --git a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm b/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
index 53b0282..e2ab405 100644
--- a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
+++ b/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
@@ -53,7 +53,8 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt
FontPlatformData::FontPlatformData(const FontPlatformData& f)
{
- m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? static_cast<const NSFont *>(CFRetain(f.m_font)) : f.m_font;
+ m_font = f.m_font && f.m_font != reinterpret_cast<NSFont *>(-1) ? const_cast<NSFont *>(static_cast<const NSFont *>(CFRetain(f.m_font))) : f.m_font;
+
m_syntheticBold = f.m_syntheticBold;
m_syntheticOblique = f.m_syntheticOblique;
m_size = f.m_size;
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index 90678b2..6457e4f 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.cpp
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -29,6 +29,7 @@
#include "GraphicsContext3D.h"
+#import "BlockExceptions.h"
#include "CanvasObject.h"
#include "ImageBuffer.h"
#include "NotImplemented.h"
@@ -38,6 +39,7 @@
#include "Float32Array.h"
#include "WebGLFramebuffer.h"
#include "Int32Array.h"
+#include "WebGLLayer.h"
#include "WebGLProgram.h"
#include "WebGLRenderbuffer.h"
#include "WebGLShader.h"
@@ -146,6 +148,14 @@ GraphicsContext3D::GraphicsContext3D(GraphicsContext3D::Attributes attrs, HostWi
validateAttributes();
+ // Create the WebGLLayer
+ BEGIN_BLOCK_OBJC_EXCEPTIONS
+ m_webGLLayer.adoptNS([[WebGLLayer alloc] initWithGraphicsContext3D:this]);
+#ifndef NDEBUG
+ [m_webGLLayer.get() setName:@"WebGL Layer"];
+#endif
+ END_BLOCK_OBJC_EXCEPTIONS
+
// create a texture to render into
::glGenTextures(1, &m_texture);
::glBindTexture(GL_TEXTURE_2D, m_texture);
@@ -383,8 +393,8 @@ static inline void ensureContext(CGLContextObj context)
void GraphicsContext3D::prepareTexture()
{
+ ensureContext(m_contextObj);
if (m_attrs.antialias) {
- ensureContext(m_contextObj);
::glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_multisampleFBO);
::glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, m_fbo);
::glBlitFramebufferEXT(0, 0, m_currentWidth, m_currentHeight, 0, 0, m_currentWidth, m_currentHeight, GL_COLOR_BUFFER_BIT, GL_LINEAR);
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.h b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
index 26a5de6..c17204f 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.h
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.h
@@ -89,10 +89,7 @@ public:
virtual void setNeedsDisplay();
virtual void setNeedsDisplayInRect(const FloatRect&);
-
-#if ENABLE(3D_CANVAS)
- virtual void setGraphicsContext3DNeedsDisplay();
-#endif
+ virtual void setContentsNeedsDisplay();
virtual void setContentsRect(const IntRect&);
@@ -107,7 +104,7 @@ public:
virtual void setContentsToImage(Image*);
virtual void setContentsToMedia(PlatformLayer*);
#if ENABLE(3D_CANVAS)
- virtual void setContentsToGraphicsContext3D(const GraphicsContext3D*);
+ virtual void setContentsToWebGL(PlatformLayer*);
#endif
virtual PlatformLayer* platformLayer() const;
@@ -260,7 +257,7 @@ private:
void updateContentsImage();
void updateContentsMediaLayer();
#if ENABLE(3D_CANVAS)
- void updateContentsGraphicsContext3D();
+ void updateContentsWebGLLayer();
#endif
void updateContentsRect();
void updateGeometryOrientation();
@@ -268,6 +265,7 @@ private:
void updateReplicatedLayers();
void updateLayerAnimations();
+ void updateContentsNeedsDisplay();
enum StructuralLayerPurpose {
NoStructuralLayer = 0,
@@ -306,12 +304,13 @@ private:
ContentsImageChanged = 1 << 17,
ContentsMediaLayerChanged = 1 << 18,
#if ENABLE(3D_CANVAS)
- ContentsGraphicsContext3DChanged = 1 << 19,
+ ContentsWebGLLayerChanged = 1 << 19,
#endif
ContentsRectChanged = 1 << 20,
GeometryOrientationChanged = 1 << 21,
MaskLayerChanged = 1 << 22,
- ReplicatedLayerChanged = 1 << 23
+ ReplicatedLayerChanged = 1 << 23,
+ ContentsNeedsDisplay = 1 << 24
};
typedef unsigned LayerChangeFlags;
void noteLayerPropertyChanged(LayerChangeFlags flags);
@@ -333,7 +332,7 @@ private:
ContentsLayerForImage,
ContentsLayerForMedia
#if ENABLE(3D_CANVAS)
- ,ContentsLayerForGraphicsLayer3D
+ , ContentsLayerForWebGL
#endif
};
@@ -389,11 +388,6 @@ private:
Vector<FloatRect> m_dirtyRects;
LayerChangeFlags m_uncommittedChanges;
-
-#if ENABLE(3D_CANVAS)
- PlatformGraphicsContext3D m_platformGraphicsContext3D;
- Platform3DObject m_platformTexture;
-#endif
};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index bd01353..355c023 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -31,9 +31,6 @@
#import "Animation.h"
#import "BlockExceptions.h"
-#if ENABLE(3D_CANVAS)
-#import "Canvas3DLayer.h"
-#endif
#import "FloatConversion.h"
#import "FloatRect.h"
#import "Image.h"
@@ -369,10 +366,6 @@ GraphicsLayerCA::GraphicsLayerCA(GraphicsLayerClient* client)
, m_contentsLayerPurpose(NoContentsLayer)
, m_contentsLayerHasBackgroundColor(false)
, m_uncommittedChanges(NoChange)
-#if ENABLE(3D_CANVAS)
- , m_platformGraphicsContext3D(NullPlatformGraphicsContext3D)
- , m_platformTexture(NullPlatform3DObject)
-#endif
{
BEGIN_BLOCK_OBJC_EXCEPTIONS
m_layer.adoptNS([[WebLayer alloc] init]);
@@ -697,6 +690,11 @@ void GraphicsLayerCA::setNeedsDisplayInRect(const FloatRect& rect)
noteLayerPropertyChanged(DirtyRectsChanged);
}
+void GraphicsLayerCA::setContentsNeedsDisplay()
+{
+ noteLayerPropertyChanged(ContentsNeedsDisplay);
+}
+
void GraphicsLayerCA::setContentsRect(const IntRect& rect)
{
if (rect == m_contentsRect)
@@ -914,8 +912,8 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers()
updateContentsMediaLayer();
#if ENABLE(3D_CANVAS)
- if (m_uncommittedChanges & ContentsGraphicsContext3DChanged) // Needs to happen before ChildrenChanged
- updateContentsGraphicsContext3D();
+ if (m_uncommittedChanges & ContentsWebGLLayerChanged) // Needs to happen before ChildrenChanged
+ updateContentsWebGLLayer();
#endif
if (m_uncommittedChanges & BackgroundColorChanged) // Needs to happen before ChildrenChanged, and after updating image or video
@@ -969,6 +967,9 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers()
if (m_uncommittedChanges & MaskLayerChanged)
updateMaskLayer();
+ if (m_uncommittedChanges & ContentsNeedsDisplay)
+ updateContentsNeedsDisplay();
+
END_BLOCK_OBJC_EXCEPTIONS
}
@@ -1390,9 +1391,9 @@ void GraphicsLayerCA::updateContentsMediaLayer()
}
#if ENABLE(3D_CANVAS)
-void GraphicsLayerCA::updateContentsGraphicsContext3D()
+void GraphicsLayerCA::updateContentsWebGLLayer()
{
- // Canvas3D layer was set as m_contentsLayer, and will get parented in updateSublayerList().
+ // WebGLLayer was set as m_contentsLayer, and will get parented in updateSublayerList().
if (m_contentsLayer) {
setupContentsLayer(m_contentsLayer.get());
[m_contentsLayer.get() setNeedsDisplay];
@@ -1716,38 +1717,19 @@ void GraphicsLayerCA::pauseAnimationOnLayer(AnimatedPropertyID property, const S
}
#if ENABLE(3D_CANVAS)
-void GraphicsLayerCA::setContentsToGraphicsContext3D(const GraphicsContext3D* graphicsContext3D)
+void GraphicsLayerCA::setContentsToWebGL(PlatformLayer* webglLayer)
{
- PlatformGraphicsContext3D context = graphicsContext3D->platformGraphicsContext3D();
- Platform3DObject texture = graphicsContext3D->platformTexture();
-
- if (context == m_platformGraphicsContext3D && texture == m_platformTexture)
+ if (webglLayer == m_contentsLayer)
return;
- m_platformGraphicsContext3D = context;
- m_platformTexture = texture;
-
- noteSublayersChanged();
+ m_contentsLayer = webglLayer;
+ if (m_contentsLayer && [m_contentsLayer.get() respondsToSelector:@selector(setLayerOwner:)])
+ [(id)m_contentsLayer.get() setLayerOwner:this];
- BEGIN_BLOCK_OBJC_EXCEPTIONS
+ m_contentsLayerPurpose = webglLayer ? ContentsLayerForWebGL : NoContentsLayer;
- if (m_platformGraphicsContext3D != NullPlatformGraphicsContext3D && m_platformTexture != NullPlatform3DObject) {
- // create the inner 3d layer
- m_contentsLayer.adoptNS([[Canvas3DLayer alloc] initWithContext:const_cast<GraphicsContext3D*>(graphicsContext3D)]);
-#ifndef NDEBUG
- [m_contentsLayer.get() setName:@"3D Layer"];
-#endif
- [m_contentsLayer.get() setLayerOwner:this];
- } else {
- // remove the inner layer
- [m_contentsLayer.get() setLayerOwner:0];
- m_contentsLayer = 0;
- }
-
- END_BLOCK_OBJC_EXCEPTIONS
-
- noteLayerPropertyChanged(ContentsGraphicsContext3DChanged);
- m_contentsLayerPurpose = m_contentsLayer ? ContentsLayerForGraphicsLayer3D : NoContentsLayer;
+ noteSublayersChanged();
+ noteLayerPropertyChanged(ContentsWebGLLayerChanged);
}
#endif
@@ -1762,6 +1744,12 @@ void GraphicsLayerCA::repaintLayerDirtyRects()
m_dirtyRects.clear();
}
+void GraphicsLayerCA::updateContentsNeedsDisplay()
+{
+ if (m_contentsLayer)
+ [m_contentsLayer.get() setNeedsDisplay];
+}
+
bool GraphicsLayerCA::createAnimationFromKeyframes(const KeyframeValueList& valueList, const Animation* animation, const String& keyframesName, double timeOffset)
{
ASSERT(valueList.property() != AnimatedPropertyWebkitTransform);
@@ -2566,14 +2554,6 @@ void GraphicsLayerCA::noteLayerPropertyChanged(LayerChangeFlags flags)
m_uncommittedChanges |= flags;
}
-#if ENABLE(3D_CANVAS)
-void GraphicsLayerCA::setGraphicsContext3DNeedsDisplay()
-{
- if (m_contentsLayerPurpose == ContentsLayerForGraphicsLayer3D)
- [m_contentsLayer.get() setNeedsDisplay];
-}
-#endif
-
} // namespace WebCore
#endif // USE(ACCELERATED_COMPOSITING)
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index b49c52f..c73eeea 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -1252,22 +1252,22 @@ static void addFileTypesToCache(NSArray * fileTypes, HashSet<String> &cache)
if (!uti)
continue;
RetainPtr<CFStringRef> mime(AdoptCF, UTTypeCopyPreferredTagWithClass(uti.get(), kUTTagClassMIMEType));
-
- // UTI types are missing many media related MIME types supported by QTKit, see rdar://6434168,
- // and not all third party movie importers register their types, so if we didn't find a type for
- // this extension look it up in the hard coded table in the MIME type regsitry.
- if (!mime) {
- // -movieFileTypes: returns both file extensions and OSTypes. The later are surrounded by single
- // quotes, eg. 'MooV', so don't bother looking at those.
- if (CFStringGetCharacterAtIndex(ext, 0) != '\'') {
- String mediaType = MIMETypeRegistry::getMediaMIMETypeForExtension(String(ext));
- if (!mediaType.isEmpty())
- mime.adoptCF(mediaType.createCFString());
+ if (mime)
+ cache.add(mime.get());
+
+ // -movieFileTypes: returns both file extensions and OSTypes. The later are surrounded by single
+ // quotes, eg. 'MooV', so don't bother looking at those.
+ if (CFStringGetCharacterAtIndex(ext, 0) != '\'') {
+ // UTI is missing many media related MIME types supported by QTKit (see rdar://6434168), and not all
+ // web servers use the MIME type UTI returns for an extension (see rdar://7875393), so even if UTI
+ // has a type for this extension add any types in hard coded table in the MIME type regsitry.
+ Vector<String> typesForExtension = MIMETypeRegistry::getMediaMIMETypesForExtension(ext);
+ unsigned count = typesForExtension.size();
+ for (unsigned ndx = 0; ndx < count; ++ndx) {
+ if (!cache.contains(typesForExtension[ndx]))
+ cache.add(typesForExtension[ndx]);
}
}
- if (!mime)
- continue;
- cache.add(mime.get());
}
}
diff --git a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
index 04badbe..bddb2ad 100644
--- a/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
+++ b/WebCore/platform/graphics/mac/SimpleFontDataMac.mm
@@ -270,7 +270,7 @@ void SimpleFontData::platformInit()
// and web pages that foolishly use this metric for width will be laid out
// poorly if we return an accurate height. Classic case is Times 13 point,
// which has an "x" that is 7x6 pixels.
- m_xHeight = static_cast<float>(max(CGRectGetMaxX(xBox), CGRectGetMaxY(xBox)));
+ m_xHeight = static_cast<float>(max(CGRectGetMaxX(xBox), -CGRectGetMinY(xBox)));
} else {
#ifndef BUILDING_ON_TIGER
m_xHeight = static_cast<float>(CGFontGetXHeight(m_platformData.cgFont())) / m_unitsPerEm;
@@ -427,6 +427,7 @@ FloatRect SimpleFontData::platformBoundsForGlyph(Glyph glyph) const
if (!m_platformData.font())
return boundingBox;
boundingBox = [m_platformData.font() boundingRectForGlyph:glyph];
+ boundingBox.setY(-boundingBox.bottom());
#endif
if (m_syntheticBoldOffset)
boundingBox.setWidth(boundingBox.width() + m_syntheticBoldOffset);
diff --git a/WebCore/platform/graphics/mac/Canvas3DLayer.h b/WebCore/platform/graphics/mac/WebGLLayer.h
index 4609010..6440b71 100644
--- a/WebCore/platform/graphics/mac/Canvas3DLayer.h
+++ b/WebCore/platform/graphics/mac/WebGLLayer.h
@@ -23,27 +23,25 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef Canvas3DLayer_h
-#define Canvas3DLayer_h
+#ifndef WebGLLayer_h
+#define WebGLLayer_h
#if USE(ACCELERATED_COMPOSITING)
-#import "WebLayer.h"
+#import <QuartzCore/QuartzCore.h>
namespace WebCore {
class GraphicsLayer;
class GraphicsContext3D;
}
-@interface Canvas3DLayer : CAOpenGLLayer
+@interface WebGLLayer : CAOpenGLLayer
{
WebCore::GraphicsLayer* m_layerOwner;
WebCore::GraphicsContext3D* m_context;
- CGLContextObj m_contextObj;
- GLuint m_texture;
}
-- (id)initWithContext:(WebCore::GraphicsContext3D*)context;
+- (id)initWithGraphicsContext3D:(WebCore::GraphicsContext3D*)context;
- (CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace;
@@ -51,4 +49,4 @@ namespace WebCore {
#endif // USE(ACCELERATED_COMPOSITING)
-#endif // Canvas3DLayer_h
+#endif // WebGLLayer_h
diff --git a/WebCore/platform/graphics/mac/Canvas3DLayer.mm b/WebCore/platform/graphics/mac/WebGLLayer.mm
index 22a0a10..12c6f0d 100644
--- a/WebCore/platform/graphics/mac/Canvas3DLayer.mm
+++ b/WebCore/platform/graphics/mac/WebGLLayer.mm
@@ -28,10 +28,10 @@
#if USE(ACCELERATED_COMPOSITING)
#if ENABLE(3D_CANVAS)
-#import "Canvas3DLayer.h"
+#import "WebGLLayer.h"
+#import "GraphicsContext3D.h"
#import "GraphicsLayer.h"
-#import <QuartzCore/QuartzCore.h>
#import <OpenGL/OpenGL.h>
#import <wtf/FastMalloc.h>
#import <wtf/RetainPtr.h>
@@ -39,13 +39,11 @@
using namespace WebCore;
-@implementation Canvas3DLayer
+@implementation WebGLLayer
--(id)initWithContext:(GraphicsContext3D*)context
+-(id)initWithGraphicsContext3D:(GraphicsContext3D*)context
{
m_context = context;
- m_contextObj = static_cast<CGLContextObj>(context->platformGraphicsContext3D());
- m_texture = static_cast<GLuint>(context->platformTexture());
self = [super init];
return self;
}
@@ -59,13 +57,13 @@ using namespace WebCore;
// If needed we will have to set the display mask in the Canvas CGLContext and
// make sure it matches.
UNUSED_PARAM(mask);
- return CGLRetainPixelFormat(CGLGetPixelFormat(m_contextObj));
+ return CGLRetainPixelFormat(CGLGetPixelFormat(m_context->platformGraphicsContext3D()));
}
-(CGLContextObj)copyCGLContextForPixelFormat:(CGLPixelFormatObj)pixelFormat
{
CGLContextObj contextObj;
- CGLCreateContext(pixelFormat, m_contextObj, &contextObj);
+ CGLCreateContext(pixelFormat, m_context->platformGraphicsContext3D(), &contextObj);
return contextObj;
}
@@ -86,7 +84,7 @@ using namespace WebCore;
glLoadIdentity();
glEnable(GL_TEXTURE_2D);
- glBindTexture(GL_TEXTURE_2D, m_texture);
+ glBindTexture(GL_TEXTURE_2D, m_context->platformTexture());
glBegin(GL_TRIANGLE_FAN);
glTexCoord2f(0, 0);
@@ -113,7 +111,7 @@ static void freeData(void *, const void *data, size_t /* size */)
-(CGImageRef)copyImageSnapshotWithColorSpace:(CGColorSpaceRef)colorSpace
{
- CGLSetCurrentContext(m_contextObj);
+ CGLSetCurrentContext(m_context->platformGraphicsContext3D());
RetainPtr<CGColorSpaceRef> imageColorSpace = colorSpace;
if (!imageColorSpace)
@@ -151,7 +149,7 @@ static void freeData(void *, const void *data, size_t /* size */)
@end
-@implementation Canvas3DLayer(WebLayerAdditions)
+@implementation WebGLLayer(WebGLLayerAdditions)
-(void)setLayerOwner:(GraphicsLayer*)aLayer
{
diff --git a/WebCore/platform/graphics/mac/WebLayer.mm b/WebCore/platform/graphics/mac/WebLayer.mm
index 641d421..0c9925e 100644
--- a/WebCore/platform/graphics/mac/WebLayer.mm
+++ b/WebCore/platform/graphics/mac/WebLayer.mm
@@ -193,7 +193,6 @@ using namespace WebCore;
{
CGRect aBounds = [self bounds];
CGPoint aPos = [self position];
- CATransform3D t = [self transform];
NSString* selfString = [NSString stringWithFormat:@"%@<%@ 0x%08x> \"%@\" bounds(%.1f, %.1f, %.1f, %.1f) pos(%.1f, %.1f), sublayers=%d masking=%d",
inPrefix,
diff --git a/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp b/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
index 7fe160a..0faf3ce 100644
--- a/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
+++ b/WebCore/platform/graphics/openvg/GraphicsContextOpenVG.cpp
@@ -292,7 +292,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect)
return FloatRect(enclosingIntRect(m_data->transformation().mapRect(rect)));
}
-void GraphicsContext::setPlatformShadow(const IntSize& size, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const Color& color, ColorSpace colorSpace)
{
if (paintingDisabled())
return;
diff --git a/WebCore/platform/graphics/qt/FontCustomPlatformData.h b/WebCore/platform/graphics/qt/FontCustomPlatformData.h
index 4305b87..0f2a6ce 100644
--- a/WebCore/platform/graphics/qt/FontCustomPlatformData.h
+++ b/WebCore/platform/graphics/qt/FontCustomPlatformData.h
@@ -19,8 +19,8 @@
This class provides all functionality needed for loading images, style sheets and html
pages from the web. It has a memory cache for these objects.
*/
-#ifndef FontCustomPlatformData_h_
-#define FontCustomPlatformData_h_
+#ifndef FontCustomPlatformData_h
+#define FontCustomPlatformData_h
#include "FontRenderingMode.h"
#include <wtf/Noncopyable.h>
@@ -43,4 +43,4 @@ FontCustomPlatformData* createFontCustomPlatformData(SharedBuffer* buffer);
} // namespace WebCore
-#endif // FontCustomPlatformData_h_
+#endif // FontCustomPlatformData_h
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp
index d357a22..0c1d271 100644
--- a/WebCore/platform/graphics/qt/FontQt.cpp
+++ b/WebCore/platform/graphics/qt/FontQt.cpp
@@ -109,7 +109,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float
QPointF pt(point.x(), point.y());
// text shadow
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
bool hasShadow = ctx->textDrawingMode() == cTextFill && ctx->getShadow(shadowSize, shadowBlur, shadowColor);
@@ -234,7 +234,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return 0;
if (run.length() == 1 && treatAsSpace(run[0]))
- return QFontMetrics(font()).width(run[0]) - m_wordSpacing + run.padding();
+ return QFontMetrics(font()).width(run[0]) + run.padding();
String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
QString string = fromRawDataWithoutRef(sanitized);
@@ -247,14 +247,14 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return w + run.padding();
}
-int Font::offsetForPositionForSimpleText(const TextRun& run, int position, bool includePartialGlyphs) const
+int Font::offsetForPositionForSimpleText(const TextRun& run, float position, bool includePartialGlyphs) const
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
QString string = fromRawDataWithoutRef(sanitized);
QFontMetrics fm(font());
- float delta = (float)position;
+ float delta = position;
int curPos = 0;
do {
float charWidth = fm.width(string[curPos]);
@@ -275,7 +275,7 @@ int Font::offsetForPositionForSimpleText(const TextRun& run, int position, bool
#endif
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool) const
+int Font::offsetForPositionForComplexText(const TextRun& run, float position, bool) const
{
String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
QString string = fromRawDataWithoutRef(sanitized);
@@ -285,7 +285,7 @@ int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool
return line.xToCursor(position);
}
-FloatRect Font::selectionRectForSimpleText(const TextRun& run, const IntPoint& pt, int h, int from, int to) const
+FloatRect Font::selectionRectForSimpleText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
@@ -302,7 +302,7 @@ FloatRect Font::selectionRectForSimpleText(const TextRun& run, const IntPoint& p
#endif
}
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& pt, int h, int from, int to) const
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& pt, int h, int from, int to) const
{
String sanitized = Font::normalizeSpaces(String(run.characters(), run.length()));
QString string = fromRawDataWithoutRef(sanitized);
diff --git a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
index e0a785e..1a51910 100644
--- a/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
@@ -56,8 +56,13 @@ typedef char GLchar;
#define APIENTRY
#endif
+#ifdef QT_OPENGL_ES_2
+typedef GLsizeiptr GLsizeiptrType;
+typedef GLintptr GLintptrType;
+#else
typedef ptrdiff_t GLsizeiptrType;
typedef ptrdiff_t GLintptrType;
+#endif
typedef void (APIENTRY* glActiveTextureType) (GLenum);
typedef void (APIENTRY* glAttachShaderType) (GLuint, GLuint);
@@ -517,18 +522,10 @@ void GraphicsContext3D::makeContextCurrent()
void GraphicsContext3D::beginPaint(WebGLRenderingContext* context)
{
m_internal->m_glWidget->makeCurrent();
-
HTMLCanvasElement* canvas = context->canvas();
ImageBuffer* imageBuffer = canvas->buffer();
-
- m_internal->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_internal->m_mainFbo);
-
- glReadPixels(/* x */ 0, /* y */ 0, m_currentWidth, m_currentHeight, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, m_internal->m_pixels.bits());
-
- QPainter* p = imageBuffer->context()->platformContext();
- p->drawImage(/* x */ 0, /* y */ 0, m_internal->m_pixels.rgbSwapped().transformed(QMatrix().rotate(180)));
-
- m_internal->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, m_internal->m_currentFbo);
+ QPainter* painter = imageBuffer->context()->platformContext();
+ paint(painter, QRect(QPoint(0, 0), QSize(m_currentWidth, m_currentHeight)));
}
void GraphicsContext3D::endPaint()
@@ -541,7 +538,7 @@ void GraphicsContext3D::paint(QPainter* painter, const QRect& rect) const
QWebPageClient* webPageClient = m_internal->m_hostWindow->platformPageClient();
QGLWidget* ownerGLWidget = m_internal->getOwnerGLWidget(webPageClient);
if (ownerGLWidget) {
- ownerGLWidget->drawTexture(QPointF(0, 0), m_internal->m_texture);
+ ownerGLWidget->drawTexture(rect, m_internal->m_texture);
return;
}
#endif
@@ -1082,12 +1079,20 @@ void GraphicsContext3D::scissor(long x, long y, unsigned long width, unsigned lo
void GraphicsContext3D::shaderSource(WebGLShader* shader, const String& source)
{
ASSERT(shader);
-
+
m_internal->m_glWidget->makeCurrent();
- CString sourceCS = source.utf8();
+ String prefixedSource;
+
+#if defined (QT_OPENGL_ES_2)
+ prefixedSource.append("precision mediump float;\n");
+#endif
+
+ prefixedSource.append(source);
+
+ CString sourceCS = prefixedSource.utf8();
const char* data = sourceCS.data();
- int length = source.length();
+ int length = prefixedSource.length();
m_internal->shaderSource((GLuint) shader->object(), /* count */ 1, &data, &length);
}
@@ -1615,11 +1620,10 @@ void GraphicsContext3D::synthesizeGLError(unsigned long error)
}
bool GraphicsContext3D::getImageData(Image* image,
- Vector<uint8_t>& outputVector,
+ unsigned int format,
+ unsigned int type,
bool premultiplyAlpha,
- bool* hasAlphaChannel,
- AlphaOp* neededAlphaOp,
- unsigned int* format)
+ Vector<uint8_t>& outputVector)
{
if (!image)
return false;
@@ -1627,17 +1631,14 @@ bool GraphicsContext3D::getImageData(Image* image,
if (!nativePixmap)
return false;
- *hasAlphaChannel = true;
- *format = GraphicsContext3D::RGBA;
-
- *neededAlphaOp = kAlphaDoNothing;
+ AlphaOp neededAlphaOp = kAlphaDoNothing;
if (!premultiplyAlpha && *hasAlphaChannel)
- *neededAlphaOp = kAlphaDoUnmultiply;
-
+ // FIXME: must fetch the image data before the premultiplication step
+ neededAlphaOp = kAlphaDoUnmultiply;
QImage nativeImage = nativePixmap->toImage().convertToFormat(QImage::Format_ARGB32);
- outputVector.append(nativeImage.rgbSwapped().bits(), nativeImage.byteCount());
-
- return true;
+ outputVector.resize(nativeImage.byteCount());
+ return packPixels(nativeImage.rgbSwapped().bits(), kSourceFormatRGBA8, image->width(), image->height(),
+ format, type, neededAlphaOp, outputVector.data());
}
}
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 2a7db4e..13608b2 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -69,7 +69,7 @@
namespace WebCore {
-static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op)
+QPainter::CompositionMode GraphicsContext::toQtCompositionMode(CompositeOperator op)
{
switch (op) {
case CompositeClear:
@@ -333,7 +333,7 @@ void GraphicsContext::drawRect(const IntRect& rect)
p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
if (m_common->state.shadowColor.isValid()) {
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -371,7 +371,7 @@ void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
p->setRenderHint(QPainter::Antialiasing, m_data->antiAliasingForRectsAndLines);
adjustLineToPixelBoundaries(p1, p2, width, style);
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (textDrawingMode() == cTextFill && getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -473,7 +473,7 @@ void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSp
const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
p->setRenderHint(QPainter::Antialiasing, true);
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
startAngle *= 16;
@@ -508,7 +508,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
QPainter* p = m_data->p();
p->save();
p->setRenderHint(QPainter::Antialiasing, shouldAntialias);
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -539,7 +539,7 @@ QPen GraphicsContext::pen()
static void inline drawFilledShadowPath(GraphicsContext* context, QPainter* p, const QPainterPath& path)
{
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -586,7 +586,7 @@ void GraphicsContext::strokePath()
path.setFillRule(toQtFillRule(fillRule()));
if (m_common->state.strokePattern || m_common->state.strokeGradient || strokeColor().alpha()) {
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -618,7 +618,7 @@ void GraphicsContext::strokePath()
static inline void drawBorderlessRectShadow(GraphicsContext* context, QPainter* p, const FloatRect& rect)
{
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -628,6 +628,73 @@ static inline void drawBorderlessRectShadow(GraphicsContext* context, QPainter*
}
}
+static inline void drawRepeatPattern(QPainter* p, QPixmap* image, const FloatRect& rect, const bool repeatX, const bool repeatY)
+{
+ // Patterns must be painted so that the top left of the first image is anchored at
+ // the origin of the coordinate space
+ if (image) {
+ int w = image->width();
+ int h = image->height();
+ int startX, startY;
+ QRect r(static_cast<int>(rect.x()), static_cast<int>(rect.y()), static_cast<int>(rect.width()), static_cast<int>(rect.height()));
+
+ // startX, startY is the coordinate of the first image we need to put on the left-top of the rect
+ if (repeatX && repeatY) {
+ // repeat
+ // startX, startY is at the left top side of the left-top of the rect
+ startX = r.x() >=0 ? r.x() - (r.x() % w) : r.x() - (w - qAbs(r.x()) % w);
+ startY = r.y() >=0 ? r.y() - (r.y() % h) : r.y() - (h - qAbs(r.y()) % h);
+ } else {
+ if (!repeatX && !repeatY) {
+ // no-repeat
+ // only draw the image once at orgin once, check if need to draw
+ QRect imageRect(0, 0, w, h);
+ if (imageRect.intersects(r)) {
+ startX = 0;
+ startY = 0;
+ } else
+ return;
+ } else if (repeatX && !repeatY) {
+ // repeat-x
+ // startY is fixed, but startX change based on the left-top of the rect
+ QRect imageRect(r.x(), 0, r.width(), h);
+ if (imageRect.intersects(r)) {
+ startX = r.x() >=0 ? r.x() - (r.x() % w) : r.x() - (w - qAbs(r.x()) % w);
+ startY = 0;
+ } else
+ return;
+ } else {
+ // repeat-y
+ // startX is fixed, but startY change based on the left-top of the rect
+ QRect imageRect(0, r.y(), w, r.height());
+ if (imageRect.intersects(r)) {
+ startX = 0;
+ startY = r.y() >=0 ? r.y() - (r.y() % h) : r.y() - (h - qAbs(r.y()) % h);
+ } else
+ return;
+ }
+ }
+
+ int x = startX;
+ int y = startY;
+ do {
+ // repeat Y
+ do {
+ // repeat X
+ QRect imageRect(x, y, w, h);
+ QRect intersectRect = imageRect.intersected(r);
+ QPoint destStart(intersectRect.x(), intersectRect.y());
+ QRect sourceRect(intersectRect.x() - imageRect.x(), intersectRect.y() - imageRect.y(), intersectRect.width(), intersectRect.height());
+
+ p->drawPixmap(destStart, *image, sourceRect);
+ x += w;
+ } while (repeatX && x < r.x() + r.width());
+ x = startX;
+ y += h;
+ } while (repeatY && y < r.y() + r.height());
+ }
+}
+
void GraphicsContext::fillRect(const FloatRect& rect)
{
if (paintingDisabled())
@@ -644,12 +711,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
QBrush brush(m_common->state.fillPattern->createPlatformPattern(affine));
QPixmap* image = m_common->state.fillPattern->tileImage()->nativeImageForCurrentFrame();
- if (!m_common->state.fillPattern->repeatX() && image)
- rectM.setWidth(image->width());
- if (!m_common->state.fillPattern->repeatY() && image)
- rectM.setHeight(image->height());
- p->fillRect(rectM, brush);
-
+ drawRepeatPattern(p, image, rect, m_common->state.fillPattern->repeatX(), m_common->state.fillPattern->repeatY());
} else if (m_common->state.fillGradient) {
QBrush brush(*m_common->state.fillGradient->platformGradient());
brush.setTransform(m_common->state.fillGradient->gradientSpaceTransform());
@@ -820,7 +882,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect)
return FloatRect(roundedOrigin, roundedLowerRight - roundedOrigin);
}
-void GraphicsContext::setPlatformShadow(const IntSize& size, float, const Color&, ColorSpace)
+void GraphicsContext::setPlatformShadow(const FloatSize& size, float, const Color&, ColorSpace)
{
// Qt doesn't support shadows natively, they are drawn manually in the draw*
// functions
@@ -828,7 +890,7 @@ void GraphicsContext::setPlatformShadow(const IntSize& size, float, const Color&
if (m_common->state.shadowsIgnoreTransforms) {
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
- m_common->state.shadowSize = IntSize(size.width(), -size.height());
+ m_common->state.shadowSize = FloatSize(size.width(), -size.height());
}
}
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index cc707da..fb3d621 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -78,9 +78,6 @@ void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
m_buffer->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
m_reader.set(new QImageReader(m_buffer.get(), m_format));
- // This will force the JPEG decoder to use JDCT_IFAST
- m_reader->setQuality(49);
-
// QImageReader only allows retrieving the format before reading the image
m_format = m_reader->format();
}
@@ -188,9 +185,21 @@ void ImageDecoderQt::internalReadImage(size_t frameIndex)
bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
{
- // Now get the QImage from Qt and place it in the RGBA32Buffer
- QImage img;
- if (!m_reader->read(&img)) {
+ QPixmap pixmap;
+ bool pixmapLoaded;
+ const int imageCount = m_reader->imageCount();
+ if (imageCount == 0 || imageCount == 1)
+ pixmapLoaded = pixmap.loadFromData((const uchar*)(m_data->data()), m_data->size(), m_format);
+ else {
+ QImage img;
+ const bool imageLoaded = m_reader->read(&img);
+ if (imageLoaded) {
+ pixmap = QPixmap::fromImage(img);
+ pixmapLoaded = true;
+ }
+ }
+
+ if (!pixmapLoaded) {
frameCount();
repetitionCount();
clearPointers();
@@ -198,12 +207,11 @@ bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
}
// now into the RGBA32Buffer - even if the image is not
- QSize imageSize = img.size();
RGBA32Buffer* const buffer = &m_frameBufferCache[frameIndex];
buffer->setRect(m_reader->currentImageRect());
buffer->setStatus(RGBA32Buffer::FrameComplete);
buffer->setDuration(m_reader->nextImageDelay());
- buffer->setDecodedImage(img);
+ buffer->setPixmap(pixmap);
return true;
}
diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp
index 0d23738..af94f55 100644
--- a/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -177,17 +177,17 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
IntSize selfSize = size();
- ctxt->save();
-
- // Set the compositing operation.
- ctxt->setCompositeOperation(op);
-
QPainter* painter(ctxt->platformContext());
+ QPainter::CompositionMode compositionMode = GraphicsContext::toQtCompositionMode(op);
+
if (!image->hasAlpha() && painter->compositionMode() == QPainter::CompositionMode_SourceOver)
- painter->setCompositionMode(QPainter::CompositionMode_Source);
+ compositionMode = QPainter::CompositionMode_Source;
+
+ QPainter::CompositionMode lastCompositionMode = painter->compositionMode();
+ painter->setCompositionMode(compositionMode);
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) {
@@ -208,7 +208,7 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
// http://www.meyerweb.com/eric/css/edge/complexspiral/demo.html
painter->drawPixmap(dst, *image, src);
- ctxt->restore();
+ painter->setCompositionMode(lastCompositionMode);
if (imageObserver())
imageObserver()->didDraw(this);
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
index e76ed7b..62e2f17 100644
--- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
@@ -38,11 +38,10 @@
namespace WebCore {
bool GraphicsContext3D::getImageData(Image* image,
- Vector<uint8_t>& outputVector,
+ unsigned int format,
+ unsigned int type,
bool premultiplyAlpha,
- bool* hasAlphaChannel,
- AlphaOp* neededAlphaOp,
- unsigned int* format)
+ Vector<uint8_t>& outputVector)
{
if (!image)
return false;
@@ -60,18 +59,12 @@ bool GraphicsContext3D::getImageData(Image* image,
ASSERT(rowBytes == skiaImage->width() * 4);
uint8_t* pixels = reinterpret_cast<uint8_t*>(skiaImage->getPixels());
outputVector.resize(rowBytes * height);
- int size = rowBytes * height;
- memcpy(outputVector.data(), pixels, size);
- *hasAlphaChannel = true;
+ AlphaOp neededAlphaOp = kAlphaDoNothing;
if (!premultiplyAlpha)
// FIXME: must fetch the image data before the premultiplication step
- *neededAlphaOp = kAlphaDoUnmultiply;
- // Convert from BGRA to RGBA. FIXME: add GL_BGRA extension support
- // to all underlying OpenGL implementations.
- for (int i = 0; i < size; i += 4)
- std::swap(outputVector[i], outputVector[i + 2]);
- *format = RGBA;
- return true;
+ neededAlphaOp = kAlphaDoUnmultiply;
+ return packPixels(pixels, kSourceFormatBGRA8, skiaImage->width(), height,
+ format, type, neededAlphaOp, outputVector.data());
}
} // namespace WebCore
diff --git a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 6ef38f0..74d0c6e 100644
--- a/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -977,7 +977,7 @@ void GraphicsContext::setPlatformFillPattern(Pattern* pattern)
platformContext()->setFillShader(pattern->platformPattern(getCTM()));
}
-void GraphicsContext::setPlatformShadow(const IntSize& size,
+void GraphicsContext::setPlatformShadow(const FloatSize& size,
float blurFloat,
const Color& color,
ColorSpace colorSpace)
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index e0d2840..6595f6b 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -222,7 +222,7 @@ void SkiaWinOutlineCache::removePathsForFont(HFONT hfont)
bool windowsCanHandleDrawTextShadow(WebCore::GraphicsContext *context)
{
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.h b/WebCore/platform/graphics/skia/SkiaFontWin.h
index 0bad30f..4c2bb32 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.h
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.h
@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SkiaWinOutlineCache_h
-#define SkiaWinOutlineCache_h
+#ifndef SkiaFontWin_h
+#define SkiaFontWin_h
#include <windows.h>
#include <usp10.h>
@@ -90,4 +90,4 @@ bool paintSkiaText(GraphicsContext* graphicsContext,
} // namespace WebCore
-#endif // SkiaWinOutlineCache_h
+#endif // SkiaFontWin_h
diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp
index 83178f3..34f9b07 100644
--- a/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -140,7 +140,7 @@ static void drawGDIGlyphs(GraphicsContext* graphicsContext, const SimpleFontData
drawIntoBitmap = fillColor.alpha() != 255 || graphicsContext->inTransparencyLayer();
if (!drawIntoBitmap) {
- IntSize size;
+ FloatSize size;
float blur;
Color color;
graphicsContext->getShadow(size, blur, color);
@@ -349,7 +349,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
CGContextSetFontSize(cgContext, platformData.size());
wkSetCGContextFontRenderingStyle(cgContext, font->isSystemFont(), false, font->platformData().useGDI());
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur;
Color shadowColor;
graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor);
diff --git a/WebCore/platform/graphics/win/FontWin.cpp b/WebCore/platform/graphics/win/FontWin.cpp
index 717171f..97971dc 100644
--- a/WebCore/platform/graphics/win/FontWin.cpp
+++ b/WebCore/platform/graphics/win/FontWin.cpp
@@ -43,7 +43,7 @@ bool Font::canReturnFallbackFontsForComplexText()
return true;
}
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& point, int h,
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h,
int from, int to) const
{
UniscribeController it(this, run);
@@ -104,8 +104,12 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return controller.runWidthSoFar();
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int x, bool includePartialGlyphs) const
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
{
+ // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
+ // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
+ int x = static_cast<int>(xFloat);
+
UniscribeController controller(this, run);
return controller.offsetForPosition(x, includePartialGlyphs);
}
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.h b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
index 171cdbf..0b74266 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.h
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GraphicsLayerCACF_h_
-#define GraphicsLayerCACF_h_
+#ifndef GraphicsLayerCACF_h
+#define GraphicsLayerCACF_h
#if USE(ACCELERATED_COMPOSITING)
@@ -142,4 +142,4 @@ private:
#endif // USE(ACCELERATED_COMPOSITING)
-#endif // GraphicsLayerCACF_h_
+#endif // GraphicsLayerCACF_h
diff --git a/WebCore/platform/graphics/win/QTMovieWinTimer.h b/WebCore/platform/graphics/win/QTMovieWinTimer.h
index 3e3c2bc..976b310 100644
--- a/WebCore/platform/graphics/win/QTMovieWinTimer.h
+++ b/WebCore/platform/graphics/win/QTMovieWinTimer.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef QTMovieViewTimer_h
-#define QTMovieViewTimer_h
+#ifndef QTMovieWinTimer_h
+#define QTMovieWinTimer_h
// This header should not be included from WebCore.
// It is used by the QuickTime access DLL. It copies some WebCore code
diff --git a/WebCore/platform/graphics/win/RefCountedGDIHandle.h b/WebCore/platform/graphics/win/RefCountedGDIHandle.h
index 65f66f1..65f66f1 100755..100644
--- a/WebCore/platform/graphics/win/RefCountedGDIHandle.h
+++ b/WebCore/platform/graphics/win/RefCountedGDIHandle.h
diff --git a/WebCore/platform/graphics/win/UniscribeController.cpp b/WebCore/platform/graphics/win/UniscribeController.cpp
index bcf7578..afea10a 100644
--- a/WebCore/platform/graphics/win/UniscribeController.cpp
+++ b/WebCore/platform/graphics/win/UniscribeController.cpp
@@ -1,29 +1,26 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 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"
@@ -51,24 +48,25 @@ UniscribeController::UniscribeController(const Font* font, const TextRun& run, H
, m_end(run.length())
, m_currentCharacter(0)
, m_runWidthSoFar(0)
+ , m_padding(run.padding())
, m_computingOffsetPosition(false)
, m_includePartialGlyphs(false)
, m_offsetX(0)
, m_offsetPosition(0)
{
- m_padding = m_run.padding();
if (!m_padding)
m_padPerSpace = 0;
else {
float numSpaces = 0;
- for (int s = 0; s < m_run.length(); s++)
+ for (int s = 0; s < m_run.length(); s++) {
if (Font::treatAsSpace(m_run[s]))
numSpaces++;
+ }
if (numSpaces == 0)
m_padPerSpace = 0;
else
- m_padPerSpace = ceilf(m_run.padding() / numSpaces);
+ m_padPerSpace = m_padding / numSpaces;
}
// Null out our uniscribe structs
@@ -339,8 +337,9 @@ bool UniscribeController::shapeAndPlaceItem(const UChar* cp, unsigned i, const S
advance += m_padding;
m_padding = 0;
} else {
- advance += m_padPerSpace;
+ float previousPadding = m_padding;
m_padding -= m_padPerSpace;
+ advance += roundf(previousPadding) - roundf(m_padding);
}
}
diff --git a/WebCore/platform/graphics/win/UniscribeController.h b/WebCore/platform/graphics/win/UniscribeController.h
index 09203b5..162ddbe 100644
--- a/WebCore/platform/graphics/win/UniscribeController.h
+++ b/WebCore/platform/graphics/win/UniscribeController.h
@@ -1,29 +1,26 @@
/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 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 UniscribeController_h
diff --git a/WebCore/platform/graphics/win/WebLayer.h b/WebCore/platform/graphics/win/WebLayer.h
index 8dab5cc..8dab5cc 100755..100644
--- a/WebCore/platform/graphics/win/WebLayer.h
+++ b/WebCore/platform/graphics/win/WebLayer.h
diff --git a/WebCore/platform/graphics/win/WebTiledLayer.h b/WebCore/platform/graphics/win/WebTiledLayer.h
index fdf0205..fdf0205 100755..100644
--- a/WebCore/platform/graphics/win/WebTiledLayer.h
+++ b/WebCore/platform/graphics/win/WebTiledLayer.h
diff --git a/WebCore/platform/graphics/wince/FontCacheWince.cpp b/WebCore/platform/graphics/wince/FontCacheWince.cpp
index 3262fc0..6b5dfa5 100644
--- a/WebCore/platform/graphics/wince/FontCacheWince.cpp
+++ b/WebCore/platform/graphics/wince/FontCacheWince.cpp
@@ -51,7 +51,7 @@ static IMLangFontLink2* langFontLink = 0;
static IMLangFontLink* langFontLink = 0;
#endif
-IMultiLanguage* getMultiLanguageInterface()
+IMultiLanguage* FontCache::getMultiLanguageInterface()
{
if (!multiLanguage)
CoCreateInstance(CLSID_CMultiLanguage, 0, CLSCTX_INPROC_SERVER, IID_IMultiLanguage, (void**)&multiLanguage);
diff --git a/WebCore/platform/graphics/wince/FontPlatformData.h b/WebCore/platform/graphics/wince/FontPlatformData.h
index 77803d3..bb49f75 100644
--- a/WebCore/platform/graphics/wince/FontPlatformData.h
+++ b/WebCore/platform/graphics/wince/FontPlatformData.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef FontPlatformDataWince_H
-#define FontPlatformDataWince_H
+#ifndef FontPlatformData_h
+#define FontPlatformData_h
#include "FontDescription.h"
#include "StringImpl.h"
diff --git a/WebCore/platform/graphics/wince/FontWince.cpp b/WebCore/platform/graphics/wince/FontWince.cpp
index f8b1886..c0948c0 100644
--- a/WebCore/platform/graphics/wince/FontWince.cpp
+++ b/WebCore/platform/graphics/wince/FontWince.cpp
@@ -242,8 +242,12 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
return w;
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool includePartialGlyphs) const
+int Font::offsetForPositionForComplexText(const TextRun& run, float xFloat, bool includePartialGlyphs) const
{
+ // FIXME: This truncation is not a problem for HTML, but only affects SVG, which passes floating-point numbers
+ // to Font::offsetForPosition(). Bug http://webkit.org/b/40673 tracks fixing this problem.
+ int position = static_cast<int>(xFloat);
+
TextRunComponents components;
int w = generateComponents(&components, *this, run);
@@ -308,7 +312,7 @@ static float cursorToX(const Font* font, const TextRunComponents& components, in
return width;
}
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& pt,
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& pt,
int h, int from, int to) const
{
TextRunComponents components;
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index 5896f90..c2c29c7 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -1249,7 +1249,7 @@ void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& to
if (!m_data->m_dc)
return;
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur = 0;
Color shadowColor;
@@ -1550,7 +1550,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
fillRect(rect, fillColor(), DeviceColorSpace);
}
-void GraphicsContext::setPlatformShadow(const IntSize&, float, const Color&, ColorSpace)
+void GraphicsContext::setPlatformShadow(const FloatSize&, float, const Color&, ColorSpace)
{
notImplemented();
}
@@ -1672,7 +1672,7 @@ void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer
return;
}
- IntSize shadowSize;
+ FloatSize shadowSize;
float shadowBlur = 0;
Color shadowColor;
bool hasShadow = textDrawingMode() == cTextFill
diff --git a/WebCore/platform/graphics/wince/MediaPlayerProxy.cpp b/WebCore/platform/graphics/wince/MediaPlayerProxy.cpp
index ceb5a7c..6fb262d 100644
--- a/WebCore/platform/graphics/wince/MediaPlayerProxy.cpp
+++ b/WebCore/platform/graphics/wince/MediaPlayerProxy.cpp
@@ -109,7 +109,7 @@ void WebMediaPlayerProxy::initEngine()
}
}
serviceType = "application/x-mplayer2";
- frame->loader()->requestObject(static_cast<RenderPartObject*>(element->renderer()), url, nullAtom, serviceType, paramNames, paramValues);
+ frame->loader()->subframeLoader()->requestObject(static_cast<RenderPartObject*>(element->renderer()), url, nullAtom, serviceType, paramNames, paramValues);
m_init = true;
}
diff --git a/WebCore/platform/graphics/wx/FontPlatformData.h b/WebCore/platform/graphics/wx/FontPlatformData.h
index 9d506d6..952368e 100644
--- a/WebCore/platform/graphics/wx/FontPlatformData.h
+++ b/WebCore/platform/graphics/wx/FontPlatformData.h
@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FontPlatformData_H
-#define FontPlatformData_H
+#ifndef FontPlatformData_h
+#define FontPlatformData_h
#include "FontDescription.h"
#include "AtomicString.h"
diff --git a/WebCore/platform/graphics/wx/FontWx.cpp b/WebCore/platform/graphics/wx/FontWx.cpp
index 3dcabf1..cc45ab0 100644
--- a/WebCore/platform/graphics/wx/FontWx.cpp
+++ b/WebCore/platform/graphics/wx/FontWx.cpp
@@ -70,7 +70,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
drawTextWithSpacing(graphicsContext, font, color, glyphBuffer, from, numGlyphs, point);
}
-FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& point, int h, int from, int to) const
+FloatRect Font::selectionRectForComplexText(const TextRun& run, const FloatPoint& point, int h, int from, int to) const
{
#if OS(WINDOWS) || OS(DARWIN)
ComplexTextController it(this, run);
@@ -153,7 +153,7 @@ float Font::floatWidthForComplexText(const TextRun& run, HashSet<const SimpleFon
#endif
}
-int Font::offsetForPositionForComplexText(const TextRun& run, int x, bool includePartialGlyphs) const
+int Font::offsetForPositionForComplexText(const TextRun& run, float x, bool includePartialGlyphs) const
{
#if OS(WINDOWS) || OS(DARWIN)
ComplexTextController controller(this, run);
diff --git a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
index 127bf07..0b6c81b 100644
--- a/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
+++ b/WebCore/platform/graphics/wx/GraphicsContextWx.cpp
@@ -554,7 +554,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
return;
}
-void GraphicsContext::setPlatformShadow(IntSize const&, float, Color const&, ColorSpace)
+void GraphicsContext::setPlatformShadow(FloatSize const&, float, Color const&, ColorSpace)
{
notImplemented();
}
diff --git a/WebCore/platform/gtk/ClipboardGtk.cpp b/WebCore/platform/gtk/ClipboardGtk.cpp
index ad1c665..924fabc 100644
--- a/WebCore/platform/gtk/ClipboardGtk.cpp
+++ b/WebCore/platform/gtk/ClipboardGtk.cpp
@@ -331,23 +331,7 @@ void ClipboardGtk::declareAndWriteDragImage(Element* element, const KURL& url, c
void ClipboardGtk::writeURL(const KURL& url, const String& label, Frame*)
{
- String actualLabel(label);
- if (actualLabel.isEmpty())
- actualLabel = url;
- m_dataObject->setText(actualLabel);
-
- Vector<UChar> markup;
- append(markup, "<a href=\"");
- append(markup, url.string());
- append(markup, "\">");
- append(markup, label);
- append(markup, "</a>");
- m_dataObject->setMarkup(String::adopt(markup));
-
- Vector<KURL> uriList;
- uriList.append(url);
- m_dataObject->setURIList(uriList);
-
+ m_dataObject->setURL(url, label);
if (m_clipboard)
m_helper->writeClipboardContents(m_clipboard);
}
@@ -357,7 +341,7 @@ void ClipboardGtk::writeRange(Range* range, Frame* frame)
ASSERT(range);
m_dataObject->setText(frame->selectedText());
- m_dataObject->setMarkup(createMarkup(range, 0, AnnotateForInterchange));
+ m_dataObject->setMarkup(createMarkup(range, 0, AnnotateForInterchange, false, AbsoluteURLs));
if (m_clipboard)
m_helper->writeClipboardContents(m_clipboard);
diff --git a/WebCore/platform/gtk/DataObjectGtk.cpp b/WebCore/platform/gtk/DataObjectGtk.cpp
index 57d920c..db13345 100644
--- a/WebCore/platform/gtk/DataObjectGtk.cpp
+++ b/WebCore/platform/gtk/DataObjectGtk.cpp
@@ -21,6 +21,7 @@
#include "markup.h"
#include <gtk/gtk.h>
+#include <wtf/gobject/GOwnPtr.h>
namespace WebCore {
@@ -41,7 +42,7 @@ String DataObjectGtk::text()
String DataObjectGtk::markup()
{
if (m_range)
- return createMarkup(m_range.get(), 0, AnnotateForInterchange);
+ return createMarkup(m_range.get(), 0, AnnotateForInterchange, false, AbsoluteURLs);
return m_markup;
}
@@ -58,6 +59,28 @@ void DataObjectGtk::setMarkup(const String& newMarkup)
m_markup = newMarkup;
}
+void DataObjectGtk::setURL(const KURL& url, const String& label)
+{
+ setText(url.string());
+
+ String actualLabel(label);
+ if (actualLabel.isEmpty())
+ actualLabel = url;
+
+ Vector<UChar> markup;
+ append(markup, "<a href=\"");
+ append(markup, url.string());
+ append(markup, "\">");
+ GOwnPtr<gchar> escaped(g_markup_escape_text(actualLabel.utf8().data(), -1));
+ append(markup, String::fromUTF8(escaped.get()));
+ append(markup, "</a>");
+ setMarkup(String::adopt(markup));
+
+ Vector<KURL> uriList;
+ uriList.append(url);
+ setURIList(uriList);
+}
+
void DataObjectGtk::clearText()
{
m_range = 0;
diff --git a/WebCore/platform/gtk/DataObjectGtk.h b/WebCore/platform/gtk/DataObjectGtk.h
index 41f8f49..8fba938 100644
--- a/WebCore/platform/gtk/DataObjectGtk.h
+++ b/WebCore/platform/gtk/DataObjectGtk.h
@@ -46,6 +46,7 @@ public:
void setURIList(const Vector<KURL>& newURIList) { m_uriList = newURIList; }
void setImage(GdkPixbuf* newImage) { m_image = newImage; }
void setDragContext(GdkDragContext* newDragContext) { m_dragContext = newDragContext; }
+ void setURL(const KURL&, const String&);
bool hasText() { return m_range || !m_text.isEmpty(); }
bool hasMarkup() { return m_range || !m_markup.isEmpty(); }
bool hasURIList() { return !m_uriList.isEmpty(); }
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
index cdd679c..3ee6763 100644
--- a/WebCore/platform/gtk/GtkVersioning.h
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -23,6 +23,16 @@
#include <gtk/gtk.h>
// Macros to avoid deprecation checking churn
+#if !GTK_CHECK_VERSION(2, 21, 2)
+#define gdk_visual_get_depth(visual) (visual)->depth
+#define gdk_visual_get_bits_per_rgb(visual) (visual)->bits_per_rgb
+#define gdk_drag_context_get_selected_action(context) (context)->action
+#endif // GTK_CHECK_VERSION(2, 21, 2)
+
+#if !GTK_CHECK_VERSION(2, 20, 0)
+#define gtk_widget_set_realized(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_REALIZED)
+#endif // GTK_CHECK_VERSION(2, 20, 0)
+
#if !GTK_CHECK_VERSION(2, 19, 0)
#define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL(widget)
#define gtk_widget_get_realized(widget) GTK_WIDGET_REALIZED(widget)
@@ -31,8 +41,18 @@
#define gtk_widget_is_sensitive(widget) GTK_WIDGET_IS_SENSITIVE(widget)
#endif // GTK_CHECK_VERSION(2, 19, 0)
+#if !GTK_CHECK_VERSION(2, 18, 0)
+#define gtk_widget_set_visible(widget, FALSE) GTK_WIDGET_UNSET_FLAGS((widget), GTK_VISIBLE)
+#define gtk_widget_set_window(widget, new_window) (widget)->window = (new_window)
+#define gtk_widget_set_can_focus(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_CAN_FOCUS)
+#endif // GTK_CHECK_VERSION(2, 18, 0)
+
#if !GTK_CHECK_VERSION(2, 14, 0)
#define gtk_widget_get_window(widget) (widget)->window
-#endif
+#define gtk_adjustment_get_value(adj) (adj)->value
+#define gtk_dialog_get_content_area(dialog) (dialog)->vbox
+#define gtk_selection_data_get_length(data) (data)->length
+#define gtk_selection_data_get_data(data) (data)->data
+#endif // GTK_CHECK_VERSION(2, 14, 0)
#endif // GtkVersioning_h
diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp
index 599f7da..a0069cf 100644
--- a/WebCore/platform/gtk/PasteboardGtk.cpp
+++ b/WebCore/platform/gtk/PasteboardGtk.cpp
@@ -68,7 +68,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
GtkClipboard* clipboard = m_helper->getClipboard(frame);
DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
dataObject->setText(frame->selectedText());
- dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange));
+ dataObject->setMarkup(createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs));
m_helper->writeClipboardContents(clipboard);
}
@@ -80,17 +80,14 @@ void Pasteboard::writePlainText(const String& text)
m_helper->writeClipboardContents(clipboard);
}
-void Pasteboard::writeURL(const KURL& url, const String&, Frame* frame)
+void Pasteboard::writeURL(const KURL& url, const String& label, Frame* frame)
{
if (url.isEmpty())
return;
GtkClipboard* clipboard = m_helper->getClipboard(frame);
DataObjectGtk* dataObject = DataObjectGtk::forClipboard(clipboard);
-
- Vector<KURL> uriList;
- uriList.append(url);
- dataObject->setURIList(uriList);
+ dataObject->setURL(url, label);
m_helper->writeClipboardContents(clipboard);
}
diff --git a/WebCore/platform/gtk/PasteboardHelper.cpp b/WebCore/platform/gtk/PasteboardHelper.cpp
index 3dc4cc0..141488f 100644
--- a/WebCore/platform/gtk/PasteboardHelper.cpp
+++ b/WebCore/platform/gtk/PasteboardHelper.cpp
@@ -25,6 +25,7 @@
#include "Chrome.h"
#include "DataObjectGtk.h"
#include "Frame.h"
+#include "GtkVersioning.h"
#include "Page.h"
#include "Pasteboard.h"
#include "TextResourceDecoder.h"
@@ -115,7 +116,7 @@ void PasteboardHelper::getClipboardContents(GtkClipboard* clipboard)
if (gtk_clipboard_wait_is_target_available(clipboard, gdkMarkupAtom)) {
if (GtkSelectionData* data = gtk_clipboard_wait_for_contents(clipboard, gdkMarkupAtom)) {
RefPtr<TextResourceDecoder> decoder(TextResourceDecoder::create("text/plain", "UTF-8", true));
- String markup(decoder->decode(reinterpret_cast<char*>(data->data), data->length));
+ String markup(decoder->decode(reinterpret_cast<const char*>(gtk_selection_data_get_data(data)), gtk_selection_data_get_length(data)));
markup += decoder->flush();
dataObject->setMarkup(markup);
gtk_selection_data_free(data);
@@ -141,7 +142,7 @@ void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint
else if (info == getIdForTargetType(TargetTypeMarkup)) {
GOwnPtr<gchar> markup(g_strdup(dataObject->markup().utf8().data()));
- gtk_selection_data_set(selectionData, selectionData->target, 8,
+ gtk_selection_data_set(selectionData, gdkMarkupAtom, 8,
reinterpret_cast<const guchar*>(markup.get()), strlen(markup.get()));
} else if (info == getIdForTargetType(TargetTypeURIList)) {
@@ -164,7 +165,7 @@ void PasteboardHelper::fillSelectionData(GtkSelectionData* selectionData, guint
result.append(url);
GOwnPtr<gchar> resultData(g_strdup(result.utf8().data()));
- gtk_selection_data_set(selectionData, selectionData->target, 8,
+ gtk_selection_data_set(selectionData, netscapeURLAtom, 8,
reinterpret_cast<const guchar*>(resultData.get()), strlen(resultData.get()));
} else if (info == getIdForTargetType(TargetTypeImage))
diff --git a/WebCore/platform/gtk/PlatformScreenGtk.cpp b/WebCore/platform/gtk/PlatformScreenGtk.cpp
index 0ab00a1..6ace728 100644
--- a/WebCore/platform/gtk/PlatformScreenGtk.cpp
+++ b/WebCore/platform/gtk/PlatformScreenGtk.cpp
@@ -72,7 +72,7 @@ int screenDepth(Widget* widget)
GdkVisual* visual = getVisual(widget);
if (!visual)
return 24;
- return visual->depth;
+ return gdk_visual_get_depth(visual);
}
int screenDepthPerComponent(Widget* widget)
@@ -81,7 +81,7 @@ int screenDepthPerComponent(Widget* widget)
if (!visual)
return 8;
- return visual->bits_per_rgb;
+ return gdk_visual_get_bits_per_rgb(visual);
}
bool screenIsMonochrome(Widget* widget)
diff --git a/WebCore/platform/gtk/PopupMenuGtk.cpp b/WebCore/platform/gtk/PopupMenuGtk.cpp
index f29d51b..bf8cfb4 100644
--- a/WebCore/platform/gtk/PopupMenuGtk.cpp
+++ b/WebCore/platform/gtk/PopupMenuGtk.cpp
@@ -89,22 +89,24 @@ void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
gtk_widget_size_request(GTK_WIDGET(m_popup.get()), &requisition);
gtk_widget_set_size_request(GTK_WIDGET(m_popup.get()), std::max(rect.width(), requisition.width), -1);
- GList* children = GTK_MENU_SHELL(m_popup.get())->children;
+ GList* children = gtk_container_get_children(GTK_CONTAINER(m_popup.get()));
+ GList* p = children;
if (size)
for (int i = 0; i < size; i++) {
if (i > index)
break;
- GtkWidget* item = reinterpret_cast<GtkWidget*>(children->data);
+ GtkWidget* item = reinterpret_cast<GtkWidget*>(p->data);
GtkRequisition itemRequisition;
gtk_widget_get_child_requisition(item, &itemRequisition);
m_menuPosition.setY(m_menuPosition.y() - itemRequisition.height);
- children = g_list_next(children);
+ p = g_list_next(p);
} else
// Center vertically the empty popup in the combo box area
m_menuPosition.setY(m_menuPosition.y() - rect.height() / 2);
+ g_list_free(children);
gtk_menu_popup(m_popup.get(), 0, 0, reinterpret_cast<GtkMenuPositionFunc>(menuPositionFunction), this, 0, gtk_get_current_event_time());
}
diff --git a/WebCore/platform/gtk/RenderThemeGtk.cpp b/WebCore/platform/gtk/RenderThemeGtk.cpp
index 6205dbd..75fb946 100644
--- a/WebCore/platform/gtk/RenderThemeGtk.cpp
+++ b/WebCore/platform/gtk/RenderThemeGtk.cpp
@@ -299,77 +299,63 @@ static void setMozillaState(const RenderTheme* theme, GtkThemeWidgetType type, R
static bool paintMozillaGtkWidget(const RenderThemeGtk* theme, GtkThemeWidgetType type, RenderObject* o, const RenderObject::PaintInfo& i, const IntRect& rect)
{
- GRefPtr<GdkDrawable> pixmap;
-
// Painting is disabled so just claim to have succeeded
if (i.context->paintingDisabled())
return false;
- // No GdkWindow to render to, so return true to fall back
- if (!i.context->gdkDrawable())
- // This is slow, used only during printing process
- pixmap = adoptGRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_system()->depth));
-
- GtkWidgetState mozState;
- setMozillaState(theme, type, o, &mozState);
-
- int flags;
+ GtkWidgetState widgetState;
+ setMozillaState(theme, type, o, &widgetState);
// We might want to make setting flags the caller's job at some point rather than doing it here.
- switch (type) {
- case MOZ_GTK_BUTTON:
+ int flags = 0;
+ if (type == MOZ_GTK_BUTTON)
flags = GTK_RELIEF_NORMAL;
- break;
- case MOZ_GTK_CHECKBUTTON:
- case MOZ_GTK_RADIOBUTTON:
+ else if (type == MOZ_GTK_CHECKBUTTON || type == MOZ_GTK_RADIOBUTTON)
flags = theme->isChecked(o);
- break;
- default:
- flags = 0;
- break;
- }
-
- GtkTextDirection direction = gtkTextDirection(o->style()->direction());
- if (pixmap) {
- GdkRectangle gdkRect = IntRect(0, 0, rect.width(), rect.height());
+ GRefPtr<GdkDrawable> drawable(i.context->gdkDrawable());
+ GdkRectangle paintRect, clipRect;
+ if (drawable) {
+ AffineTransform ctm = i.context->getCTM();
+ IntPoint pos = ctm.mapPoint(rect.location());
+ paintRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height());
+
+ // Intersect the cairo rectangle with the target widget region. This will
+ // prevent the theme drawing code from drawing into regions that cairo will
+ // clip anyway.
+ cairo_t* cr = i.context->platformContext();
+ double clipX1, clipX2, clipY1, clipY2;
+ cairo_clip_extents(cr, &clipX1, &clipY1, &clipX2, &clipY2);
+ IntPoint clipPos = ctm.mapPoint(IntPoint(clipX1, clipY1));
+
+ clipRect.width = clipX2 - clipX1;
+ clipRect.height = clipY2 - clipY1;
+ clipRect.x = clipPos.x();
+ clipRect.y = clipPos.y();
+ gdk_rectangle_intersect(&paintRect, &clipRect, &clipRect);
- moz_gtk_use_theme_parts(theme->partsForDrawable(pixmap.get()));
-
- bool result = moz_gtk_widget_paint(type, pixmap.get(), &gdkRect, &gdkRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
-
- if (!result) {
- cairo_t* cr = i.context->platformContext();
- gdk_cairo_set_source_pixmap(cr, pixmap.get(), rect.x(), rect.y());
- cairo_paint(cr);
- }
-
- return result;
+ } else {
+ // In some situations, like during print previews, this GraphicsContext is not
+ // backed by a GdkDrawable. In those situations, we render onto a pixmap and then
+ // copy the rendered data back to the GraphicsContext via Cairo.
+ drawable = adoptGRef(gdk_pixmap_new(0, rect.width(), rect.height(), gdk_visual_get_system()->depth));
+ paintRect = clipRect = IntRect(0, 0, rect.width(), rect.height());
}
- AffineTransform ctm = i.context->getCTM();
-
- IntPoint pos = ctm.mapPoint(rect.location());
- GdkRectangle gdkRect = IntRect(pos.x(), pos.y(), rect.width(), rect.height());
-
- // Find the clip rectangle
- cairo_t* cr = i.context->platformContext();
- double clipX1, clipX2, clipY1, clipY2;
- cairo_clip_extents(cr, &clipX1, &clipY1, &clipX2, &clipY2);
-
- GdkRectangle gdkClipRect;
- gdkClipRect.width = clipX2 - clipX1;
- gdkClipRect.height = clipY2 - clipY1;
- IntPoint clipPos = ctm.mapPoint(IntPoint(clipX1, clipY1));
- gdkClipRect.x = clipPos.x();
- gdkClipRect.y = clipPos.y();
-
- gdk_rectangle_intersect(&gdkRect, &gdkClipRect, &gdkClipRect);
+ moz_gtk_use_theme_parts(theme->partsForDrawable(drawable.get()));
+ bool success = moz_gtk_widget_paint(type, drawable.get(), &paintRect, &clipRect, &widgetState, flags, gtkTextDirection(o->style()->direction())) == MOZ_GTK_SUCCESS;
+
+ // If the drawing was successful and we rendered onto a pixmap, copy the
+ // results back to the original GraphicsContext.
+ if (success && !i.context->gdkDrawable()) {
+ cairo_t* cairoContext = i.context->platformContext();
+ cairo_save(cairoContext);
+ gdk_cairo_set_source_pixmap(cairoContext, drawable.get(), rect.x(), rect.y());
+ cairo_paint(cairoContext);
+ cairo_restore(cairoContext);
+ }
- // Since the theme renderer is going to be drawing onto this GdkDrawable,
- // select the appropriate widgets for the drawable depth.
- moz_gtk_use_theme_parts(theme->partsForDrawable(i.context->gdkDrawable()));
- return moz_gtk_widget_paint(type, i.context->gdkDrawable(), &gdkRect, &gdkClipRect, &mozState, flags, direction) != MOZ_GTK_SUCCESS;
+ return !success;
}
static void setButtonPadding(RenderStyle* style)
diff --git a/WebCore/platform/gtk/ScrollbarGtk.cpp b/WebCore/platform/gtk/ScrollbarGtk.cpp
index 3d4cc47..5dc4dd6 100644
--- a/WebCore/platform/gtk/ScrollbarGtk.cpp
+++ b/WebCore/platform/gtk/ScrollbarGtk.cpp
@@ -120,11 +120,15 @@ void ScrollbarGtk::detachAdjustment()
// For the case where we only operate on the GtkAdjustment it is best to
// reset the values so that the surrounding scrollbar gets updated, or
// e.g. for a GtkScrolledWindow the scrollbar gets hidden.
+#if GTK_CHECK_VERSION(2, 14, 0)
+ gtk_adjustment_configure(m_adjustment, 0, 0, 0, 0, 0, 0);
+#else
m_adjustment->lower = 0;
m_adjustment->upper = 0;
m_adjustment->value = 0;
gtk_adjustment_changed(m_adjustment);
gtk_adjustment_value_changed(m_adjustment);
+#endif
g_object_unref(m_adjustment);
m_adjustment = 0;
}
@@ -158,19 +162,33 @@ void ScrollbarGtk::frameRectsChanged()
void ScrollbarGtk::updateThumbPosition()
{
- if (m_adjustment->value != m_currentPos) {
+ if (gtk_adjustment_get_value(m_adjustment) != m_currentPos) {
+#if GTK_CHECK_VERSION(2, 14, 0)
+ gtk_adjustment_set_value(m_adjustment, m_currentPos);
+#else
m_adjustment->value = m_currentPos;
gtk_adjustment_value_changed(m_adjustment);
+#endif
}
}
void ScrollbarGtk::updateThumbProportion()
{
+#if GTK_CHECK_VERSION(2, 14, 0)
+ gtk_adjustment_configure(m_adjustment,
+ gtk_adjustment_get_value(m_adjustment),
+ gtk_adjustment_get_lower(m_adjustment),
+ m_totalSize,
+ m_lineStep,
+ m_pageStep,
+ m_visibleSize);
+#else
m_adjustment->step_increment = m_lineStep;
m_adjustment->page_increment = m_pageStep;
m_adjustment->page_size = m_visibleSize;
m_adjustment->upper = m_totalSize;
gtk_adjustment_changed(m_adjustment);
+#endif
}
void ScrollbarGtk::setFrameRect(const IntRect& rect)
diff --git a/WebCore/platform/haiku/PasteboardHaiku.cpp b/WebCore/platform/haiku/PasteboardHaiku.cpp
index defec3f..d7a7e08 100644
--- a/WebCore/platform/haiku/PasteboardHaiku.cpp
+++ b/WebCore/platform/haiku/PasteboardHaiku.cpp
@@ -102,7 +102,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
data->AddData("text/plain", B_MIME_TYPE, string.String(), string.Length());
- BString markupString(createMarkup(selectedRange, 0, AnnotateForInterchange));
+ BString markupString(createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs));
data->AddData("text/html", B_MIME_TYPE, markupString.String(), markupString.Length());
be_clipboard->Commit();
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index b063db2..f32536c 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -41,6 +41,7 @@
#include "NativeImageSkia.h"
#include "SkColorPriv.h"
#elif PLATFORM(QT)
+#include <QPixmap>
#include <QImage>
#endif
@@ -136,8 +137,7 @@ namespace WebCore {
}
#if PLATFORM(QT)
- void setDecodedImage(const QImage& image);
- QImage decodedImage() const { return m_image; }
+ void setPixmap(const QPixmap& pixmap);
#endif
private:
@@ -149,6 +149,8 @@ namespace WebCore {
#if PLATFORM(SKIA)
return m_bitmap.getAddr32(x, y);
#elif PLATFORM(QT)
+ m_image = m_pixmap.toImage();
+ m_pixmap = QPixmap();
return reinterpret_cast<QRgb*>(m_image.scanLine(y)) + x;
#else
return m_bytes.data() + (y * width()) + x;
@@ -178,6 +180,7 @@ namespace WebCore {
#if PLATFORM(SKIA)
NativeImageSkia m_bitmap;
#elif PLATFORM(QT)
+ mutable QPixmap m_pixmap;
mutable QImage m_image;
bool m_hasAlpha;
IntSize m_size;
@@ -236,7 +239,7 @@ namespace WebCore {
virtual void setData(SharedBuffer* data, bool allDataReceived)
{
- if (failed())
+ if (m_failed)
return;
m_data = data;
m_isAllDataReceived = allDataReceived;
@@ -305,7 +308,8 @@ namespace WebCore {
// Sets the "decode failure" flag. For caller convenience (since so
// many callers want to return false after calling this), returns false
- // to enable easy tailcalling.
+ // to enable easy tailcalling. Subclasses may override this to also
+ // clean up any local data.
virtual bool setFailed()
{
m_failed = true;
diff --git a/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp b/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
index a6d36ef..901f60d 100644
--- a/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp
@@ -77,6 +77,12 @@ RGBA32Buffer* BMPImageDecoder::frameBufferAtIndex(size_t index)
return buffer;
}
+bool BMPImageDecoder::setFailed()
+{
+ m_reader.clear();
+ return ImageDecoder::setFailed();
+}
+
void BMPImageDecoder::decode(bool onlySize)
{
if (failed())
@@ -86,6 +92,10 @@ void BMPImageDecoder::decode(bool onlySize)
// has failed.
if (!decodeHelper(onlySize) && isAllDataReceived())
setFailed();
+ // If we're done decoding the image, we don't need the BMPImageReader
+ // anymore. (If we failed, |m_reader| has already been cleared.)
+ else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache.first().status() == RGBA32Buffer::FrameComplete))
+ m_reader.clear();
}
bool BMPImageDecoder::decodeHelper(bool onlySize)
diff --git a/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h b/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
index 15be0a2..b08b32b 100644
--- a/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
+++ b/WebCore/platform/image-decoders/bmp/BMPImageDecoder.h
@@ -46,6 +46,10 @@ namespace WebCore {
virtual void setData(SharedBuffer*, bool allDataReceived);
virtual bool isSizeAvailable();
virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
+ // accessing deleted memory, especially when calling this from inside
+ // BMPImageReader!
+ virtual bool setFailed();
private:
inline uint32_t readUint32(int offset) const
diff --git a/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp b/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
index 2f3bffa..93bedf3 100644
--- a/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
+++ b/WebCore/platform/image-decoders/bmp/BMPImageReader.cpp
@@ -79,7 +79,7 @@ bool BMPImageReader::decodeBMP(bool onlySize)
ASSERT(m_buffer); // Parent should set this before asking us to decode!
if (m_buffer->status() == RGBA32Buffer::FrameEmpty) {
if (!m_buffer->setSize(m_parent->size().width(), m_parent->size().height()))
- return setFailed(); // Unable to allocate.
+ return m_parent->setFailed(); // Unable to allocate.
m_buffer->setStatus(RGBA32Buffer::FramePartial);
// setSize() calls eraseARGB(), which resets the alpha flag, so we force
// it back to false here. We'll set it true below in all cases where
@@ -95,10 +95,11 @@ bool BMPImageReader::decodeBMP(bool onlySize)
// Decode the data.
if ((m_andMaskState != Decoding) && !pastEndOfImage(0)) {
- if ((m_infoHeader.biCompression == RLE4) || (m_infoHeader.biCompression == RLE8) || (m_infoHeader.biCompression == RLE24)) {
- if (!processRLEData())
- return false;
- } else if (!processNonRLEData(false, 0))
+ if ((m_infoHeader.biCompression != RLE4) && (m_infoHeader.biCompression != RLE8) && (m_infoHeader.biCompression != RLE24)) {
+ const ProcessingResult result = processNonRLEData(false, 0);
+ if (result != Success)
+ return (result == Failure) ? m_parent->setFailed() : false;
+ } else if (!processRLEData())
return false;
}
@@ -114,8 +115,11 @@ bool BMPImageReader::decodeBMP(bool onlySize)
m_andMaskState = Decoding;
}
- if ((m_andMaskState == Decoding) && !processNonRLEData(false, 0))
- return false;
+ if (m_andMaskState == Decoding) {
+ const ProcessingResult result = processNonRLEData(false, 0);
+ if (result != Success)
+ return (result == Failure) ? m_parent->setFailed() : false;
+ }
// Done!
m_buffer->setStatus(RGBA32Buffer::FrameComplete);
@@ -136,7 +140,7 @@ bool BMPImageReader::readInfoHeaderSize()
// problematic or at least confusing in other places), or to overrun the
// image data.
if (((m_headerOffset + m_infoHeader.biSize) < m_headerOffset) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize))))
- return setFailed();
+ return m_parent->setFailed();
// See if this is a header size we understand:
// OS/2 1.x: 12
@@ -149,7 +153,7 @@ bool BMPImageReader::readInfoHeaderSize()
else if ((m_infoHeader.biSize >= 16) && (m_infoHeader.biSize <= 64) && (!(m_infoHeader.biSize & 3) || (m_infoHeader.biSize == 42) || (m_infoHeader.biSize == 46)))
m_isOS22x = true;
else
- return setFailed();
+ return m_parent->setFailed();
return true;
}
@@ -164,11 +168,11 @@ bool BMPImageReader::processInfoHeader()
// Sanity-check header values.
if (!isInfoHeaderValid())
- return setFailed();
+ return m_parent->setFailed();
// Set our size.
if (!m_parent->setSize(m_infoHeader.biWidth, m_infoHeader.biHeight))
- return setFailed();
+ return false;
// For paletted images, bitmaps can set biClrUsed to 0 to mean "all
// colors", so set it to the maximum number of colors for this bit depth.
@@ -228,7 +232,7 @@ bool BMPImageReader::readInfoHeader()
m_infoHeader.biCompression = RLE24;
m_isOS22x = true;
} else if (biCompression > 5)
- return setFailed(); // Some type we don't understand.
+ return m_parent->setFailed(); // Some type we don't understand.
else
m_infoHeader.biCompression = static_cast<CompressionType>(biCompression);
}
@@ -395,7 +399,7 @@ bool BMPImageReader::processBitmasks()
// Fail if we don't have enough file space for the bitmasks.
static const size_t SIZEOF_BITMASKS = 12;
if (((m_headerOffset + m_infoHeader.biSize + SIZEOF_BITMASKS) < (m_headerOffset + m_infoHeader.biSize)) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize + SIZEOF_BITMASKS))))
- return setFailed();
+ return m_parent->setFailed();
// Read bitmasks.
if ((m_data->size() - m_decodedOffset) < SIZEOF_BITMASKS)
@@ -435,7 +439,7 @@ bool BMPImageReader::processBitmasks()
// Make sure bitmask does not overlap any other bitmasks.
for (int j = 0; j < i; ++j) {
if (tempMask & m_bitMasks[j])
- return setFailed();
+ return m_parent->setFailed();
}
// Count offset into pixel data.
@@ -448,7 +452,7 @@ bool BMPImageReader::processBitmasks()
// Make sure bitmask is contiguous.
if (tempMask)
- return setFailed();
+ return m_parent->setFailed();
// Since RGBABuffer tops out at 8 bits per channel, adjust the shift
// amounts to use the most significant 8 bits of the channel.
@@ -467,7 +471,7 @@ bool BMPImageReader::processColorTable()
// Fail if we don't have enough file space for the color table.
if (((m_headerOffset + m_infoHeader.biSize + m_tableSizeInBytes) < (m_headerOffset + m_infoHeader.biSize)) || (m_imgDataOffset && (m_imgDataOffset < (m_headerOffset + m_infoHeader.biSize + m_tableSizeInBytes))))
- return setFailed();
+ return m_parent->setFailed();
// Read color table.
if ((m_decodedOffset > m_data->size()) || ((m_data->size() - m_decodedOffset) < m_tableSizeInBytes))
@@ -529,10 +533,10 @@ bool BMPImageReader::processRLEData()
const uint8_t count = m_data->data()[m_decodedOffset];
const uint8_t code = m_data->data()[m_decodedOffset + 1];
if ((count || (code != 1)) && pastEndOfImage(0))
- return setFailed();
+ return m_parent->setFailed();
// Decode.
- if (count == 0) {
+ if (!count) {
switch (code) {
case 0: // Magic token: EOL
// Skip any remaining pixels in this row.
@@ -562,7 +566,7 @@ bool BMPImageReader::processRLEData()
if (dx || dy)
m_buffer->setHasAlpha(true);
if (((m_coord.x() + dx) > m_parent->size().width()) || pastEndOfImage(dy))
- return setFailed();
+ return m_parent->setFailed();
// Skip intervening pixels.
m_coord.move(dx, m_isTopDown ? dy : -dy);
@@ -571,19 +575,23 @@ bool BMPImageReader::processRLEData()
break;
}
- default: // Absolute mode
+ default: { // Absolute mode
// |code| pixels specified as in BI_RGB, zero-padded at the end
// to a multiple of 16 bits.
// Because processNonRLEData() expects m_decodedOffset to
// point to the beginning of the pixel data, bump it past
// the escape bytes and then reset if decoding failed.
m_decodedOffset += 2;
- if (!processNonRLEData(true, code)) {
+ const ProcessingResult result = processNonRLEData(true, code);
+ if (result == Failure)
+ return m_parent->setFailed();
+ if (result == InsufficientData) {
m_decodedOffset -= 2;
return false;
}
break;
}
+ }
} else { // Encoded mode
// The following color data is repeated for |count| total pixels.
// Strangely, some BMPs seem to specify excessively large counts
@@ -608,7 +616,7 @@ bool BMPImageReader::processRLEData()
colorIndexes[1] &= 0xf;
}
if ((colorIndexes[0] >= m_infoHeader.biClrUsed) || (colorIndexes[1] >= m_infoHeader.biClrUsed))
- return setFailed();
+ return m_parent->setFailed();
for (int which = 0; m_coord.x() < endX; ) {
setI(colorIndexes[which]);
which = !which;
@@ -620,10 +628,10 @@ bool BMPImageReader::processRLEData()
}
}
-bool BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
+BMPImageReader::ProcessingResult BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
{
if (m_decodedOffset > m_data->size())
- return false;
+ return InsufficientData;
if (!inRLE)
numPixels = m_parent->size().width();
@@ -631,7 +639,7 @@ bool BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
// Fail if we're being asked to decode more pixels than remain in the row.
const int endX = m_coord.x() + numPixels;
if (endX > m_parent->size().width())
- return setFailed();
+ return Failure;
// Determine how many bytes of data the requested number of pixels
// requires.
@@ -648,7 +656,7 @@ bool BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
while (!pastEndOfImage(0)) {
// Bail if we don't have enough data for the desired number of pixels.
if ((m_data->size() - m_decodedOffset) < paddedNumBytes)
- return false;
+ return InsufficientData;
if (m_infoHeader.biBitCount < 16) {
// Paletted data. Pixels are stored little-endian within bytes.
@@ -672,7 +680,7 @@ bool BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
m_coord.move(1, 0);
} else {
if (colorIndex >= m_infoHeader.biClrUsed)
- return setFailed();
+ return Failure;
setI(colorIndex);
}
pixelData <<= m_infoHeader.biBitCount;
@@ -713,12 +721,12 @@ bool BMPImageReader::processNonRLEData(bool inRLE, int numPixels)
// Success, keep going.
m_decodedOffset += paddedNumBytes;
if (inRLE)
- return true;
+ return Success;
moveBufferToNextRow();
}
// Finished decoding whole image.
- return true;
+ return Success;
}
void BMPImageReader::moveBufferToNextRow()
@@ -726,11 +734,4 @@ void BMPImageReader::moveBufferToNextRow()
m_coord.move(-m_coord.x(), m_isTopDown ? 1 : -1);
}
-bool BMPImageReader::setFailed()
-{
- m_parent->setFailed();
- m_colorTable.clear();
- return false;
-}
-
} // namespace WebCore
diff --git a/WebCore/platform/image-decoders/bmp/BMPImageReader.h b/WebCore/platform/image-decoders/bmp/BMPImageReader.h
index a30a721..0a6dc84 100644
--- a/WebCore/platform/image-decoders/bmp/BMPImageReader.h
+++ b/WebCore/platform/image-decoders/bmp/BMPImageReader.h
@@ -97,6 +97,11 @@ namespace WebCore {
NotYetDecoded,
Decoding,
};
+ enum ProcessingResult {
+ Success,
+ Failure,
+ InsufficientData,
+ };
// These are based on the Windows BITMAPINFOHEADER and RGBTRIPLE
// structs, but with unnecessary entries removed.
@@ -161,14 +166,18 @@ namespace WebCore {
// Processes a set of non-RLE-compressed pixels. Two cases:
// * inRLE = true: the data is inside an RLE-encoded bitmap. Tries to
- // process |numPixels| pixels on the current row; returns true on
- // success.
+ // process |numPixels| pixels on the current row.
// * inRLE = false: the data is inside a non-RLE-encoded bitmap.
// |numPixels| is ignored. Expects |m_coord| to point at the
// beginning of the next row to be decoded. Tries to process as
- // many complete rows as possible. Returns true if the whole image
- // was decoded.
- bool processNonRLEData(bool inRLE, int numPixels);
+ // many complete rows as possible. Returns InsufficientData if
+ // there wasn't enough data to decode the whole image.
+ //
+ // This function returns a ProcessingResult instead of a bool so that it
+ // can avoid calling m_parent->setFailed(), which could lead to memory
+ // corruption since that will delete |this| but some callers still want
+ // to access member variables after this returns.
+ ProcessingResult processNonRLEData(bool inRLE, int numPixels);
// Returns true if the current y-coordinate plus |numRows| would be past
// the end of the image. Here "plus" means "toward the end of the
@@ -261,11 +270,6 @@ namespace WebCore {
// depending on the value of |m_isTopDown|.
void moveBufferToNextRow();
- // Sets the "decode failure" flag and clears any local storage. For
- // caller convenience (since so many callers want to return false after
- // calling this), returns false to enable easy tailcalling.
- bool setFailed();
-
// The decoder that owns us.
ImageDecoder* m_parent;
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
index 3cf516e..a590a6c 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp
@@ -119,6 +119,12 @@ RGBA32Buffer* GIFImageDecoder::frameBufferAtIndex(size_t index)
return &frame;
}
+bool GIFImageDecoder::setFailed()
+{
+ m_reader.clear();
+ return ImageDecoder::setFailed();
+}
+
void GIFImageDecoder::clearFrameBufferCache(size_t clearBeforeFrame)
{
// In some cases, like if the decoder was destroyed while animating, we
@@ -300,9 +306,6 @@ void GIFImageDecoder::decode(unsigned haltAtFrame, GIFQuery query)
// has failed.
if (!m_reader->read((const unsigned char*)m_data->data() + m_readOffset, m_data->size() - m_readOffset, query, haltAtFrame) && isAllDataReceived())
setFailed();
-
- if (failed())
- m_reader.clear();
}
bool GIFImageDecoder::initFrameBuffer(unsigned frameIndex)
diff --git a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
index 1c3378c..e0f8173 100644
--- a/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
+++ b/WebCore/platform/image-decoders/gif/GIFImageDecoder.h
@@ -49,6 +49,10 @@ namespace WebCore {
virtual size_t frameCount();
virtual int repetitionCount() const;
virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
+ // accessing deleted memory, especially when calling this from inside
+ // GIFImageReader!
+ virtual bool setFailed();
virtual void clearFrameBufferCache(size_t clearBeforeFrame);
// Callbacks from the GIF reader.
diff --git a/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp b/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
index 325c506..d667795 100644
--- a/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp
@@ -116,6 +116,13 @@ RGBA32Buffer* ICOImageDecoder::frameBufferAtIndex(size_t index)
return buffer;
}
+bool ICOImageDecoder::setFailed()
+{
+ m_bmpReaders.clear();
+ m_pngDecoders.clear();
+ return ImageDecoder::setFailed();
+}
+
// static
bool ICOImageDecoder::compareEntries(const IconDirectoryEntry& a, const IconDirectoryEntry& b)
{
@@ -147,6 +154,13 @@ void ICOImageDecoder::decode(size_t index, bool onlySize)
// has failed.
if ((!decodeDirectory() || (!onlySize && !decodeAtIndex(index))) && isAllDataReceived())
setFailed();
+ // If we're done decoding this frame, we don't need the BMPImageReader or
+ // PNGImageDecoder anymore. (If we failed, these have already been
+ // cleared.)
+ else if ((m_frameBufferCache.size() > index) && (m_frameBufferCache[index].status() == RGBA32Buffer::FrameComplete)) {
+ m_bmpReaders[index].clear();
+ m_pngDecoders[index].clear();
+ }
}
bool ICOImageDecoder::decodeDirectory()
@@ -241,8 +255,9 @@ bool ICOImageDecoder::processDirectoryEntries()
// The image size is the size of the largest entry.
const IconDirectoryEntry& dirEntry = m_dirEntries.first();
- setSize(dirEntry.m_size.width(), dirEntry.m_size.height());
- return true;
+ // Technically, this next call shouldn't be able to fail, since the width
+ // and height here are each <= 256, and |m_frameSize| is empty.
+ return setSize(dirEntry.m_size.width(), dirEntry.m_size.height());
}
ICOImageDecoder::IconDirectoryEntry ICOImageDecoder::readDirectoryEntry()
diff --git a/WebCore/platform/image-decoders/ico/ICOImageDecoder.h b/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
index c1f29c9..48024a2 100644
--- a/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
+++ b/WebCore/platform/image-decoders/ico/ICOImageDecoder.h
@@ -52,6 +52,10 @@ namespace WebCore {
virtual bool setSize(unsigned width, unsigned height);
virtual size_t frameCount();
virtual RGBA32Buffer* frameBufferAtIndex(size_t);
+ // CAUTION: setFailed() deletes all readers and decoders. Be careful to
+ // avoid accessing deleted memory, especially when calling this from
+ // inside BMPImageReader!
+ virtual bool setFailed();
private:
enum ImageType {
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index 8375693..cce4f64 100644
--- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -167,10 +167,8 @@ public:
m_bufferLength = data.size();
// We need to do the setjmp here. Otherwise bad things will happen
- if (setjmp(m_err.setjmp_buffer)) {
- close();
+ if (setjmp(m_err.setjmp_buffer))
return m_decoder->setFailed();
- }
switch (m_state) {
case JPEG_HEADER:
@@ -304,7 +302,7 @@ public:
case JPEG_DONE:
// Finish decompression.
return jpeg_finish_decompress(&m_info);
-
+
case JPEG_ERROR:
// We can get here if the constructor failed.
return m_decoder->setFailed();
@@ -402,6 +400,12 @@ RGBA32Buffer* JPEGImageDecoder::frameBufferAtIndex(size_t index)
return &frame;
}
+bool JPEGImageDecoder::setFailed()
+{
+ m_reader.clear();
+ return ImageDecoder::setFailed();
+}
+
bool JPEGImageDecoder::outputScanlines()
{
if (m_frameBufferCache.isEmpty())
@@ -482,8 +486,9 @@ void JPEGImageDecoder::decode(bool onlySize)
// has failed.
if (!m_reader->decode(m_data->buffer(), onlySize) && isAllDataReceived())
setFailed();
-
- if (failed() || (!m_frameBufferCache.isEmpty() && m_frameBufferCache[0].status() == RGBA32Buffer::FrameComplete))
+ // If we're done decoding the image, we don't need the JPEGImageReader
+ // anymore. (If we failed, |m_reader| has already been cleared.)
+ else if (!m_frameBufferCache.isEmpty() && (m_frameBufferCache[0].status() == RGBA32Buffer::FrameComplete))
m_reader.clear();
}
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
index 79bad47..43b35fd 100644
--- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
+++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.h
@@ -46,6 +46,10 @@ namespace WebCore {
virtual bool setSize(unsigned width, unsigned height);
virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
virtual bool supportsAlpha() const { return false; }
+ // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
+ // accessing deleted memory, especially when calling this from inside
+ // JPEGImageReader!
+ virtual bool setFailed();
bool outputScanlines();
void jpegComplete();
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index 1dcf6c7..56cf05f 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -125,10 +125,8 @@ public:
PNGImageDecoder* decoder = static_cast<PNGImageDecoder*>(png_get_progressive_ptr(m_png));
// We need to do the setjmp here. Otherwise bad things will happen.
- if (setjmp(m_png->jmpbuf)) {
- close();
+ if (setjmp(m_png->jmpbuf))
return decoder->setFailed();
- }
const char* segment;
while (unsigned segmentLength = data.getSomeData(segment, m_readOffset)) {
@@ -166,6 +164,7 @@ private:
};
PNGImageDecoder::PNGImageDecoder()
+ : m_doNothingOnFailure(false)
{
}
@@ -204,6 +203,14 @@ RGBA32Buffer* PNGImageDecoder::frameBufferAtIndex(size_t index)
return &frame;
}
+bool PNGImageDecoder::setFailed()
+{
+ if (m_doNothingOnFailure)
+ return false;
+ m_reader.clear();
+ return ImageDecoder::setFailed();
+}
+
void PNGImageDecoder::headerAvailable()
{
png_structp png = m_reader->pngPtr();
@@ -217,8 +224,15 @@ void PNGImageDecoder::headerAvailable()
return;
}
- // We can fill in the size now that the header is available.
- if (!setSize(width, height)) {
+ // We can fill in the size now that the header is available. Avoid memory
+ // corruption issues by neutering setFailed() during this call; if we don't
+ // do this, failures will cause |m_reader| to be deleted, and our jmpbuf
+ // will cease to exist. Note that we'll still properly set the failure flag
+ // in this case as soon as we longjmp().
+ m_doNothingOnFailure = true;
+ bool result = setSize(width, height);
+ m_doNothingOnFailure = false;
+ if (!result) {
longjmp(png->jmpbuf, 1);
return;
}
@@ -341,7 +355,9 @@ void PNGImageDecoder::rowAvailable(unsigned char* rowBuffer, unsigned rowIndex,
// Copy the data into our buffer.
int width = scaledSize().width();
int destY = scaledY(rowIndex);
- if (destY < 0)
+
+ // Check that the row is within the image bounds. LibPNG may supply an extra row.
+ if (destY < 0 || destY >= scaledSize().height())
return;
bool sawAlpha = buffer.hasAlpha();
for (int x = 0; x < width; ++x) {
@@ -373,8 +389,9 @@ void PNGImageDecoder::decode(bool onlySize)
// has failed.
if (!m_reader->decode(*m_data, onlySize) && isAllDataReceived())
setFailed();
-
- if (failed() || isComplete())
+ // If we're done decoding the image, we don't need the PNGImageReader
+ // anymore. (If we failed, |m_reader| has already been cleared.)
+ else if (isComplete())
m_reader.clear();
}
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.h b/WebCore/platform/image-decoders/png/PNGImageDecoder.h
index 287a794..145fc4d 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.h
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.h
@@ -44,6 +44,10 @@ namespace WebCore {
virtual bool isSizeAvailable();
virtual bool setSize(unsigned width, unsigned height);
virtual RGBA32Buffer* frameBufferAtIndex(size_t index);
+ // CAUTION: setFailed() deletes |m_reader|. Be careful to avoid
+ // accessing deleted memory, especially when calling this from inside
+ // PNGImageReader!
+ virtual bool setFailed();
// Callbacks from libpng
void headerAvailable();
@@ -62,6 +66,7 @@ namespace WebCore {
void decode(bool onlySize);
OwnPtr<PNGImageReader> m_reader;
+ bool m_doNothingOnFailure;
};
} // namespace WebCore
diff --git a/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp b/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
index b2e5e17..044515a 100644
--- a/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
+++ b/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
@@ -57,6 +57,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
void RGBA32Buffer::clear()
{
+ m_pixmap = QPixmap();
m_image = QImage();
m_status = FrameEmpty;
// NOTE: Do not reset other members here; clearFrameBufferCache()
@@ -67,7 +68,11 @@ void RGBA32Buffer::clear()
void RGBA32Buffer::zeroFill()
{
- m_image.fill(0);
+ if (m_pixmap.isNull() && !m_image.isNull()) {
+ m_pixmap = QPixmap(m_image.width(), m_image.height());
+ m_image = QImage();
+ }
+ m_pixmap.fill(QColor(0, 0, 0, 0));
}
void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
@@ -76,6 +81,7 @@ void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
return;
m_image = other.m_image;
+ m_pixmap = other.m_pixmap;
m_size = other.m_size;
m_hasAlpha = other.m_hasAlpha;
}
@@ -87,8 +93,9 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
ASSERT(width() == 0 && height() == 0);
m_size = IntSize(newWidth, newHeight);
- m_image = QImage(newWidth, newHeight, QImage::Format_ARGB32_Premultiplied);
- if (m_image.isNull())
+ m_image = QImage();
+ m_pixmap = QPixmap(newWidth, newHeight);
+ if (m_pixmap.isNull())
return false;
// Zero the image.
@@ -99,10 +106,11 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
QPixmap* RGBA32Buffer::asNewNativeImage() const
{
- QPixmap pix = QPixmap::fromImage(m_image);
- m_image = QImage();
-
- return new QPixmap(pix);
+ if (m_pixmap.isNull() && !m_image.isNull()) {
+ m_pixmap = QPixmap::fromImage(m_image);
+ m_image = QImage();
+ }
+ return new QPixmap(m_pixmap);
}
bool RGBA32Buffer::hasAlpha() const
@@ -121,11 +129,12 @@ void RGBA32Buffer::setStatus(FrameStatus status)
}
// The image must not have format 8888 pre multiplied...
-void RGBA32Buffer::setDecodedImage(const QImage& image)
+void RGBA32Buffer::setPixmap(const QPixmap& pixmap)
{
- m_image = image;
- m_size = image.size();
- m_hasAlpha = image.hasAlphaChannel();
+ m_pixmap = pixmap;
+ m_image = QImage();
+ m_size = pixmap.size();
+ m_hasAlpha = pixmap.hasAlphaChannel();
}
int RGBA32Buffer::width() const
diff --git a/WebCore/platform/mac/EventLoopMac.mm b/WebCore/platform/mac/EventLoopMac.mm
index 05ef33a..4c3c8a4 100644
--- a/WebCore/platform/mac/EventLoopMac.mm
+++ b/WebCore/platform/mac/EventLoopMac.mm
@@ -32,7 +32,10 @@ void EventLoop::cycle()
{
// FIXME: Should this use NSRunLoopCommonModes? Switching to NSRunLoopCommonModes causes Safari to hang in a tight loop.
[NSApp setWindowsNeedUpdate:YES];
- NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantFuture] inMode:NSDefaultRunLoopMode dequeue:YES];
+ NSTimeInterval interval = [[NSDate date] timeIntervalSinceReferenceDate];
+ interval += 0.05;
+ NSDate *untilDate = [NSDate dateWithTimeIntervalSinceReferenceDate:interval];
+ NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:untilDate inMode:NSDefaultRunLoopMode dequeue:YES];
[NSApp sendEvent:event];
}
diff --git a/WebCore/platform/mac/KeyEventMac.mm b/WebCore/platform/mac/KeyEventMac.mm
index 7b8b2ce..30f1689 100644
--- a/WebCore/platform/mac/KeyEventMac.mm
+++ b/WebCore/platform/mac/KeyEventMac.mm
@@ -30,6 +30,7 @@
#import "KeyEventCocoa.h"
#import "Logging.h"
+#import "WindowsKeyboardCodes.h"
#import <Carbon/Carbon.h>
using namespace WTF;
@@ -203,20 +204,19 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(NSEvent *event)
, m_macEvent(event)
{
// Always use 13 for Enter/Return -- we don't want to use AppKit's different character for Enter.
- if (m_windowsVirtualKeyCode == '\r') {
+ if (m_windowsVirtualKeyCode == VK_RETURN) {
m_text = "\r";
m_unmodifiedText = "\r";
}
- // The adjustments below are only needed in backward compatibility mode, but we cannot tell what mode we are in from here.
-
- // Turn 0x7F into 8, because backspace needs to always be 8.
- if (m_text == "\x7F")
+ // AppKit sets text to "\x7F" for backspace, but the correct KeyboardEvent character code is 8.
+ if (m_windowsVirtualKeyCode == VK_BACK) {
m_text = "\x8";
- if (m_unmodifiedText == "\x7F")
m_unmodifiedText = "\x8";
- // Always use 9 for tab -- we don't want to use AppKit's different character for shift-tab.
- if (m_windowsVirtualKeyCode == 9) {
+ }
+
+ // Always use 9 for Tab -- we don't want to use AppKit's different character for shift-tab.
+ if (m_windowsVirtualKeyCode == VK_TAB) {
m_text = "\x9";
m_unmodifiedText = "\x9";
}
diff --git a/WebCore/platform/mac/PasteboardHelper.h b/WebCore/platform/mac/PasteboardHelper.h
index 4ae964d..0e241bb 100644
--- a/WebCore/platform/mac/PasteboardHelper.h
+++ b/WebCore/platform/mac/PasteboardHelper.h
@@ -48,9 +48,9 @@ namespace WebCore {
class PasteboardHelper {
public:
virtual ~PasteboardHelper() {}
- virtual String urlFromPasteboard(const NSPasteboard*, String* title) const = 0;
- virtual String plainTextFromPasteboard(const NSPasteboard*) const = 0;
- virtual DOMDocumentFragment* fragmentFromPasteboard(const NSPasteboard*) const = 0;
+ virtual String urlFromPasteboard(NSPasteboard*, String* title) const = 0;
+ virtual String plainTextFromPasteboard(NSPasteboard*) const = 0;
+ virtual DOMDocumentFragment* fragmentFromPasteboard(NSPasteboard*) const = 0;
virtual NSArray* insertablePasteboardTypes() const = 0;
};
diff --git a/WebCore/platform/mac/PasteboardMac.mm b/WebCore/platform/mac/PasteboardMac.mm
index 03ede03..bba7cac 100644
--- a/WebCore/platform/mac/PasteboardMac.mm
+++ b/WebCore/platform/mac/PasteboardMac.mm
@@ -378,6 +378,10 @@ PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefP
}
}
if ([HTMLString length] != 0) {
+ // FIXME: FragmentScriptingNotAllowed is a HACK and should
+ // be removed or replaced with an enum with a better name.
+ // FragmentScriptingNotAllowed causes the Parser to remove children
+ // of <script> tags (so javascript doesn't show up in pastes).
RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(frame->document(), HTMLString, "", FragmentScriptingNotAllowed);
if (fragment)
return fragment.release();
diff --git a/WebCore/platform/mac/ThemeMac.mm b/WebCore/platform/mac/ThemeMac.mm
index 7cc913f..20b662f 100644
--- a/WebCore/platform/mac/ThemeMac.mm
+++ b/WebCore/platform/mac/ThemeMac.mm
@@ -31,6 +31,7 @@
#import "LocalCurrentGraphicsContext.h"
#import "ScrollView.h"
#import "WebCoreSystemInterface.h"
+#import <Carbon/Carbon.h>
#include <wtf/StdLibExtras.h>
using namespace std;
@@ -100,19 +101,22 @@ static LengthSize sizeFromFont(const Font& font, const LengthSize& zoomedSize, f
return sizeFromNSControlSize(controlSizeForFont(font), zoomedSize, zoomFactor, sizes);
}
-static void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
+static ControlSize controlSizeFromPixelSize(const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
{
- NSControlSize size;
if (minZoomedSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomFactor) &&
minZoomedSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomFactor))
- size = NSRegularControlSize;
- else if (minZoomedSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomFactor) &&
- minZoomedSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomFactor))
- size = NSSmallControlSize;
- else
- size = NSMiniControlSize;
+ return NSRegularControlSize;
+ if (minZoomedSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomFactor) &&
+ minZoomedSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomFactor))
+ return NSSmallControlSize;
+ return NSMiniControlSize;
+}
+
+static void setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minZoomedSize, float zoomFactor)
+{
+ ControlSize size = controlSizeFromPixelSize(sizes, minZoomedSize, zoomFactor);
if (size != [cell controlSize]) // Only update if we have to, since AppKit does work even if the size is the same.
- [cell setControlSize:size];
+ [cell setControlSize:(NSControlSize)size];
}
static void updateStates(NSCell* cell, ControlStates states)
@@ -149,6 +153,22 @@ static void updateStates(NSCell* cell, ControlStates states)
// a view in a window whose key state can be detected.
}
+static ThemeDrawState convertControlStatesToThemeDrawState(ThemeButtonKind kind, ControlStates states)
+{
+ if (states & ReadOnlyState)
+ return kThemeStateUnavailableInactive;
+ if (!(states & EnabledState))
+ return kThemeStateUnavailableInactive;
+
+ // Do not process PressedState if !EnabledState or ReadOnlyState.
+ if (states & PressedState) {
+ if (kind == kThemeIncDecButton || kind == kThemeIncDecButtonSmall || kind == kThemeIncDecButtonMini)
+ return states & SpinUpState ? kThemeStatePressedUp : kThemeStatePressedDown;
+ return kThemeStatePressed;
+ }
+ return kThemeStateActive;
+}
+
static IntRect inflateRect(const IntRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)
{
// Only do the inflation if the available width/height are too small. Otherwise try to
@@ -469,29 +489,25 @@ static NSControlSize stepperControlSizeForFont(const Font& font)
return NSMiniControlSize;
}
-static NSStepperCell* stepper(ControlStates states, const IntRect& zoomedRect, float zoomFactor)
+static void paintStepper(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView*)
{
- static NSStepperCell* cell = [[NSStepperCell alloc] init];
- setControlSize(cell, stepperSizes(), zoomedRect.size(), zoomFactor);
+ // We don't use NSStepperCell because there are no ways to draw an
+ // NSStepperCell with the up button highlighted.
- updateStates(cell, states);
- if (states & PressedState && states & SpinUpState) {
- // FIXME: There is no way to draw a NSSteperCell with the up button hilighted.
- // Disables the hilight of the down button if the up button is pressed.
- [cell setHighlighted:NO];
- }
- return cell;
-}
-
-static void paintStepper(ControlStates states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
-{
- NSStepperCell* cell = stepper(states, zoomedRect, zoomFactor);
+ HIThemeButtonDrawInfo drawInfo;
+ drawInfo.version = 0;
+ drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
+ drawInfo.adornment = kThemeAdornmentDefault;
+ ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
+ if (controlSize == NSSmallControlSize)
+ drawInfo.kind = kThemeIncDecButtonSmall;
+ else if (controlSize == NSMiniControlSize)
+ drawInfo.kind = kThemeIncDecButtonMini;
+ else
+ drawInfo.kind = kThemeIncDecButton;
- context->save();
- NSControlSize controlSize = [cell controlSize];
- IntSize zoomedSize = stepperSizes()[controlSize];
IntRect rect(zoomedRect);
-
+ context->save();
if (zoomFactor != 1.0f) {
rect.setWidth(rect.width() / zoomFactor);
rect.setHeight(rect.height() / zoomFactor);
@@ -499,12 +515,15 @@ static void paintStepper(ControlStates states, GraphicsContext* context, const I
context->scale(FloatSize(zoomFactor, zoomFactor));
context->translate(-rect.x(), -rect.y());
}
-
- BEGIN_BLOCK_OBJC_EXCEPTIONS
- [cell drawWithFrame:NSRect(rect) inView:ThemeMac::ensuredView(scrollView)];
- [cell setControlView:nil];
- END_BLOCK_OBJC_EXCEPTIONS
-
+ CGRect bounds(rect);
+ // Adjust 'bounds' so that HIThemeDrawButton(bounds,...) draws exactly on 'rect'.
+ CGRect backgroundBounds;
+ HIThemeGetButtonBackgroundBounds(&bounds, &drawInfo, &backgroundBounds);
+ if (bounds.origin.x != backgroundBounds.origin.x)
+ bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
+ if (bounds.origin.y != backgroundBounds.origin.y)
+ bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
+ HIThemeDrawButton(&bounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
context->restore();
}
@@ -669,8 +688,7 @@ void ThemeMac::inflateControlPaintRect(ControlPart part, ControlStates states, I
}
case OuterSpinButtonPart: {
static const int stepperMargin[4] = { 0, 0, 0, 0};
- NSCell *cell = stepper(states, zoomedRect, zoomFactor);
- NSControlSize controlSize = [cell controlSize];
+ ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
IntSize zoomedSize = stepperSizes()[controlSize];
zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
zoomedSize.setWidth(zoomedSize.width() * zoomFactor);
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.h b/WebCore/platform/mac/WebCoreSystemInterface.h
index 88472da..1f14311 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.h
+++ b/WebCore/platform/mac/WebCoreSystemInterface.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2006, 2007, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -59,30 +59,27 @@ typedef struct _NSRect NSRect;
@class QTMovie;
@class QTMovieView;
#else
-typedef struct NSArray NSArray;
-typedef struct NSButtonCell NSButtonCell;
-typedef struct NSData NSData;
-typedef struct NSDate NSDate;
-typedef struct NSEvent NSEvent;
-typedef struct NSFont NSFont;
-typedef struct NSImage NSImage;
-typedef struct NSMenu NSMenu;
-typedef struct NSMutableArray NSMutableArray;
-typedef struct NSMutableURLRequest NSMutableURLRequest;
-typedef struct NSURLRequest NSURLRequest;
-typedef struct NSString NSString;
-typedef struct NSTextFieldCell NSTextFieldCell;
-typedef struct NSURLConnection NSURLConnection;
-typedef struct NSURLResponse NSURLResponse;
-typedef struct NSView NSView;
-typedef struct objc_object *id;
-typedef struct QTMovie QTMovie;
-typedef struct QTMovieView QTMovieView;
+class NSArray;
+class NSButtonCell;
+class NSData;
+class NSDate;
+class NSEvent;
+class NSFont;
+class NSImage;
+class NSMenu;
+class NSMutableArray;
+class NSMutableURLRequest;
+class NSURLRequest;
+class NSString;
+class NSTextFieldCell;
+class NSURLConnection;
+class NSURLResponse;
+class NSView;
+class QTMovie;
+class QTMovieView;
#endif
-#ifdef __cplusplus
extern "C" {
-#endif
// In alphabetical order.
@@ -173,12 +170,12 @@ extern BOOL (*wkUseSharedMediaUI)();
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
extern NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
+extern void* wkGetHyphenationLocationBeforeIndex;
#else
extern void* wkNoteOpenPanelFiles;
+extern CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
-#ifdef __cplusplus
}
-#endif
#endif
diff --git a/WebCore/platform/mac/WebCoreSystemInterface.mm b/WebCore/platform/mac/WebCoreSystemInterface.mm
index bb54ad0..2a06f15 100644
--- a/WebCore/platform/mac/WebCoreSystemInterface.mm
+++ b/WebCore/platform/mac/WebCoreSystemInterface.mm
@@ -1,5 +1,5 @@
/*
- * Copyright 2006, 2007, 2008, 2010 Apple Computer, Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008, 2009, 2010 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -112,6 +112,8 @@ BOOL (*wkSupportsMultipartXMixedReplace)(NSMutableURLRequest *);
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
NSMutableArray *(*wkNoteOpenPanelFiles)(NSArray *);
+void* wkGetHyphenationLocationBeforeIndex;
#else
void* wkNoteOpenPanelFiles;
+CFIndex (*wkGetHyphenationLocationBeforeIndex)(CFStringRef string, CFIndex index);
#endif
diff --git a/WebCore/platform/network/CredentialStorage.cpp b/WebCore/platform/network/CredentialStorage.cpp
index 1adda69..a48af77 100644
--- a/WebCore/platform/network/CredentialStorage.cpp
+++ b/WebCore/platform/network/CredentialStorage.cpp
@@ -77,7 +77,7 @@ static String protectionSpaceMapKeyFromURL(const KURL& url)
if (directoryURL.length() > directoryURLPathStart + 1) {
int index = directoryURL.reverseFind('/');
ASSERT(index > 0);
- directoryURL = directoryURL.substring(0, (static_cast<unsigned>(index) != directoryURLPathStart) ? index : directoryURLPathStart + 1);
+ directoryURL = directoryURL.substring(0, (static_cast<unsigned>(index) != directoryURLPathStart) ? static_cast<unsigned>(index) : directoryURLPathStart + 1);
}
ASSERT(directoryURL.length() == directoryURLPathStart + 1 || directoryURL[directoryURL.length() - 1] != '/');
diff --git a/WebCore/platform/network/CredentialStorage.h b/WebCore/platform/network/CredentialStorage.h
index 21fcbad..ff7b5ee 100644
--- a/WebCore/platform/network/CredentialStorage.h
+++ b/WebCore/platform/network/CredentialStorage.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SessionCredentialStorage_h
-#define SessionCredentialStorage_h
+#ifndef CredentialStorage_h
+#define CredentialStorage_h
namespace WebCore {
@@ -49,4 +49,4 @@ public:
} // namespace WebCore
-#endif // SessionCredentialStorage_h
+#endif // CredentialStorage_h
diff --git a/WebCore/platform/network/FormData.cpp b/WebCore/platform/network/FormData.cpp
index 431dbe4..9e4a227 100644
--- a/WebCore/platform/network/FormData.cpp
+++ b/WebCore/platform/network/FormData.cpp
@@ -204,9 +204,8 @@ void FormData::appendFileRange(const String& filename, long long start, long lon
void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEncoding& encoding, bool isMultiPartForm, Document* document)
{
- FormDataBuilder formDataBuilder;
if (isMultiPartForm)
- m_boundary = formDataBuilder.generateUniqueBoundaryString();
+ m_boundary = FormDataBuilder::generateUniqueBoundaryString();
Vector<char> encodedData;
@@ -218,7 +217,7 @@ void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEnco
ASSERT(key);
if (isMultiPartForm) {
Vector<char> header;
- formDataBuilder.beginMultiPartHeader(header, m_boundary.data(), key->cstr());
+ FormDataBuilder::beginMultiPartHeader(header, m_boundary.data(), key->cstr());
bool shouldGenerateFile = false;
// If the current type is FILE, then we also need to include the filename
@@ -238,7 +237,7 @@ void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEnco
}
// We have to include the filename=".." part in the header, even if the filename is empty
- formDataBuilder.addFilenameToMultiPartHeader(header, encoding, fileName);
+ FormDataBuilder::addFilenameToMultiPartHeader(header, encoding, fileName);
// If the item is sliced from a file, do not add the content type.
#if ENABLE(BLOB_SLICE)
@@ -252,11 +251,11 @@ void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEnco
// MIME type of the generated file.
String mimeType = MIMETypeRegistry::getMIMETypeForPath(fileName);
if (!mimeType.isEmpty())
- formDataBuilder.addContentTypeToMultiPartHeader(header, mimeType.latin1());
+ FormDataBuilder::addContentTypeToMultiPartHeader(header, mimeType.latin1());
}
}
- formDataBuilder.finishMultiPartHeader(header);
+ FormDataBuilder::finishMultiPartHeader(header);
// Append body
appendData(header.data(), header.size());
@@ -271,12 +270,12 @@ void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEnco
if (encodedData.isEmpty() && key->cstr() == "isindex")
FormDataBuilder::encodeStringAsFormData(encodedData, stringValue->cstr());
else
- formDataBuilder.addKeyValuePairAsFormData(encodedData, key->cstr(), stringValue->cstr());
+ FormDataBuilder::addKeyValuePairAsFormData(encodedData, key->cstr(), stringValue->cstr());
}
}
if (isMultiPartForm)
- formDataBuilder.addBoundaryToMultiPartHeader(encodedData, m_boundary.data(), true);
+ FormDataBuilder::addBoundaryToMultiPartHeader(encodedData, m_boundary.data(), true);
appendData(encodedData.data(), encodedData.size());
}
diff --git a/WebCore/platform/network/FormDataBuilder.cpp b/WebCore/platform/network/FormDataBuilder.cpp
index 13a457b..fb78b08 100644
--- a/WebCore/platform/network/FormDataBuilder.cpp
+++ b/WebCore/platform/network/FormDataBuilder.cpp
@@ -25,6 +25,7 @@
#include "config.h"
#include "FormDataBuilder.h"
+#include "CSSHelper.h"
#include "Document.h"
#include "Frame.h"
#include "FrameLoader.h"
@@ -48,6 +49,12 @@ FormDataBuilder::~FormDataBuilder()
{
}
+void FormDataBuilder::parseAction(const String& action)
+{
+ // FIXME: Can we parse into a KURL?
+ m_action = deprecatedParseURL(action);
+}
+
void FormDataBuilder::parseEncodingType(const String& type)
{
if (type.contains("multipart", false) || type.contains("form-data", false)) {
diff --git a/WebCore/platform/network/FormDataBuilder.h b/WebCore/platform/network/FormDataBuilder.h
index 390a87b..559906e 100644
--- a/WebCore/platform/network/FormDataBuilder.h
+++ b/WebCore/platform/network/FormDataBuilder.h
@@ -45,12 +45,18 @@ public:
bool isMultiPartForm() const { return m_isMultiPartForm; }
void setIsMultiPartForm(bool value) { m_isMultiPartForm = value; }
+ const String& action() const { return m_action; }
+
+ const String& target() const { return m_target; }
+ void setTarget(const String& target) { m_target = target; }
+
String encodingType() const { return m_encodingType; }
void setEncodingType(const String& value) { m_encodingType = value; }
String acceptCharset() const { return m_acceptCharset; }
void setAcceptCharset(const String& value) { m_acceptCharset = value; }
+ void parseAction(const String&);
void parseEncodingType(const String&);
void parseMethodType(const String&);
@@ -72,6 +78,8 @@ private:
bool m_isPostMethod;
bool m_isMultiPartForm;
+ String m_action;
+ String m_target;
String m_encodingType;
String m_acceptCharset;
};
diff --git a/WebCore/platform/network/ResourceHandle.cpp b/WebCore/platform/network/ResourceHandle.cpp
index de416fe..d3ee3f2 100644
--- a/WebCore/platform/network/ResourceHandle.cpp
+++ b/WebCore/platform/network/ResourceHandle.cpp
@@ -69,7 +69,7 @@ PassRefPtr<ResourceHandle> ResourceHandle::create(const ResourceRequest& request
void ResourceHandle::scheduleFailure(FailureType type)
{
- d->m_failureType = type;
+ d->m_scheduledFailureType = type;
d->m_failureTimer.startOneShot(0);
}
@@ -78,11 +78,16 @@ void ResourceHandle::fireFailure(Timer<ResourceHandle>*)
if (!client())
return;
- switch (d->m_failureType) {
+ switch (d->m_scheduledFailureType) {
+ case NoFailure:
+ ASSERT_NOT_REACHED();
+ return;
case BlockedFailure:
+ d->m_scheduledFailureType = NoFailure;
client()->wasBlocked(this);
return;
case InvalidURLFailure:
+ d->m_scheduledFailureType = NoFailure;
client()->cannotShowURL(this);
return;
}
@@ -138,6 +143,25 @@ void ResourceHandle::forceContentSniffing()
shouldForceContentSniffing = true;
}
+void ResourceHandle::setDefersLoading(bool defers)
+{
+ LOG(Network, "Handle %p setDefersLoading(%s)", this, defers ? "true" : "false");
+
+ ASSERT(d->m_defersLoading != defers); // Deferring is not counted, so calling setDefersLoading() repeatedly is likely to be in error.
+ d->m_defersLoading = defers;
+
+ if (defers) {
+ ASSERT(d->m_failureTimer.isActive() == (d->m_scheduledFailureType != NoFailure));
+ if (d->m_failureTimer.isActive())
+ d->m_failureTimer.stop();
+ } else if (d->m_scheduledFailureType != NoFailure) {
+ ASSERT(!d->m_failureTimer.isActive());
+ d->m_failureTimer.startOneShot(0);
+ }
+
+ platformSetDefersLoading(defers);
+}
+
#if !USE(SOUP)
void ResourceHandle::prepareForURL(const KURL& url)
{
diff --git a/WebCore/platform/network/ResourceHandle.h b/WebCore/platform/network/ResourceHandle.h
index 4b60a33..e1c889a 100644
--- a/WebCore/platform/network/ResourceHandle.h
+++ b/WebCore/platform/network/ResourceHandle.h
@@ -102,6 +102,7 @@ private:
ResourceHandle(const ResourceRequest&, ResourceHandleClient*, bool defersLoading, bool shouldContentSniff);
enum FailureType {
+ NoFailure,
BlockedFailure,
InvalidURLFailure
};
@@ -209,6 +210,8 @@ public:
using RefCounted<ResourceHandle>::deref;
private:
+ void platformSetDefersLoading(bool);
+
void scheduleFailure(FailureType);
bool start(Frame*);
diff --git a/WebCore/platform/network/ResourceHandleInternal.h b/WebCore/platform/network/ResourceHandleInternal.h
index f20f055..92b24cb 100644
--- a/WebCore/platform/network/ResourceHandleInternal.h
+++ b/WebCore/platform/network/ResourceHandleInternal.h
@@ -133,6 +133,7 @@ namespace WebCore {
, m_needsSiteSpecificQuirks(false)
, m_currentMacChallenge(nil)
#endif
+ , m_scheduledFailureType(ResourceHandle::NoFailure)
, m_failureTimer(loader, &ResourceHandle::fireFailure)
{
const KURL& url = m_request.url();
@@ -220,7 +221,7 @@ namespace WebCore {
#endif
AuthenticationChallenge m_currentWebChallenge;
- ResourceHandle::FailureType m_failureType;
+ ResourceHandle::FailureType m_scheduledFailureType;
Timer<ResourceHandle> m_failureTimer;
};
diff --git a/WebCore/platform/network/android/ResourceHandleAndroid.cpp b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
index 1530a26..ba01e6a 100644
--- a/WebCore/platform/network/android/ResourceHandleAndroid.cpp
+++ b/WebCore/platform/network/android/ResourceHandleAndroid.cpp
@@ -84,6 +84,7 @@ bool ResourceHandle::supportsBufferedData()
return false;
}
+<<<<<<< HEAD
#if PLATFORM(ANDROID)
// TODO: this needs upstreaming.
void ResourceHandle::pauseLoad(bool pause)
@@ -94,6 +95,9 @@ void ResourceHandle::pauseLoad(bool pause)
#endif
void ResourceHandle::setDefersLoading(bool defers)
+=======
+void ResourceHandle::platformSetDefersLoading(bool)
+>>>>>>> webkit.org at r61871
{
notImplemented();
}
diff --git a/WebCore/bindings/js/JSWebSocketConstructor.h b/WebCore/platform/network/brew/SocketStreamError.h
index 633e612..80dfa39 100644
--- a/WebCore/bindings/js/JSWebSocketConstructor.h
+++ b/WebCore/platform/network/brew/SocketStreamError.h
@@ -28,27 +28,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSWebSocketConstructor_h
-#define JSWebSocketConstructor_h
+#ifndef SocketStreamError_h
+#define SocketStreamError_h
-#if ENABLE(WEB_SOCKETS)
-
-#include "JSDOMBinding.h"
+#include "SocketStreamErrorBase.h"
namespace WebCore {
-class JSWebSocketConstructor : public DOMConstructorObject {
- public:
- JSWebSocketConstructor(JSC::ExecState*, JSDOMGlobalObject*);
- static const JSC::ClassInfo s_info;
+class SocketStreamError : public SocketStreamErrorBase {
+public:
+ SocketStreamError() { }
+ explicit SocketStreamError(int errorCode)
+ : SocketStreamErrorBase(errorCode)
+ {
+ }
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
};
} // namespace WebCore
-#endif // ENABLE(WEB_SOCKETS)
-
-#endif // JSWebSocketConstructor_h
+#endif // SocketStreamError_h
diff --git a/WebCore/platform/network/brew/SocketStreamHandle.h b/WebCore/platform/network/brew/SocketStreamHandle.h
new file mode 100644
index 0000000..d2d3e34
--- /dev/null
+++ b/WebCore/platform/network/brew/SocketStreamHandle.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SocketStreamHandle_h
+#define SocketStreamHandle_h
+
+#include "SocketStreamHandleBase.h"
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class AuthenticationChallenge;
+class Credential;
+class SocketStreamHandleClient;
+class SocketStreamHandlePrivate;
+
+class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
+public:
+ static PassRefPtr<SocketStreamHandle> create(const KURL& url, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(url, client)); }
+
+ virtual ~SocketStreamHandle();
+
+protected:
+ virtual int platformSend(const char* data, int length);
+ virtual void platformClose();
+
+private:
+ SocketStreamHandle(const KURL&, SocketStreamHandleClient*);
+
+ // No authentication for streams per se, but proxy may ask for credentials.
+ void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
+ void receivedCredential(const AuthenticationChallenge&, const Credential&);
+ void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
+ void receivedCancellation(const AuthenticationChallenge&);
+
+ SocketStreamHandlePrivate* m_p;
+ friend class SocketStreamHandlePrivate;
+};
+
+} // namespace WebCore
+
+#endif // SocketStreamHandle_h
diff --git a/WebCore/platform/network/brew/SocketStreamHandleBrew.cpp b/WebCore/platform/network/brew/SocketStreamHandleBrew.cpp
new file mode 100644
index 0000000..5dc925e
--- /dev/null
+++ b/WebCore/platform/network/brew/SocketStreamHandleBrew.cpp
@@ -0,0 +1,230 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "SocketStreamHandle.h"
+
+#include "KURL.h"
+#include "Logging.h"
+#include "NotImplemented.h"
+#include "SocketStreamHandleClient.h"
+#include "SocketStreamHandlePrivate.h"
+#include <wtf/Vector.h>
+#include <wtf/brew/ShellBrew.h>
+#include <wtf/text/CString.h>
+
+namespace WebCore {
+
+static void socketStreamConnectCallback(void* user, int nError)
+{
+ SocketStreamHandlePrivate* p = reinterpret_cast<SocketStreamHandlePrivate*>(user);
+
+ if (nError != AEE_NET_SUCCESS) {
+ p->socketError(nError);
+ return;
+ }
+
+ p->socketConnected();
+}
+
+static void getHostByNameCallback(void* user)
+{
+ SocketStreamHandlePrivate* p = reinterpret_cast<SocketStreamHandlePrivate*>(user);
+
+ if (p->m_dns.nResult < 1 || p->m_dns.nResult > AEEDNSMAXADDRS) {
+ p->socketError(p->m_dns.nResult);
+ return;
+ }
+
+ p->connect();
+}
+
+static void socketReadableCallback(void* user)
+{
+ SocketStreamHandlePrivate* p = reinterpret_cast<SocketStreamHandlePrivate*>(user);
+ p->socketReadyRead();
+}
+
+static INetMgr* networkManager()
+{
+ static INetMgr* s_netMgr;
+
+ if (!s_netMgr) {
+ IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell;
+ ISHELL_CreateInstance(shell, AEECLSID_NET, reinterpret_cast<void**>(&s_netMgr));
+ ASSERT(s_netMgr);
+ }
+
+ return s_netMgr;
+}
+
+SocketStreamHandlePrivate::SocketStreamHandlePrivate(SocketStreamHandle* streamHandle, const KURL& url)
+{
+ m_streamHandle = streamHandle;
+ m_isSecure = url.protocolIs("wss");
+
+ m_socket.set(INETMGR_OpenSocket(networkManager(), AEE_SOCK_STREAM));
+ if (!m_socket)
+ return;
+
+ if (m_isSecure)
+ m_ssl = createInstance<ISSL>(AEECLSID_SSL);
+
+ m_port = url.hasPort() ? url.port() : (m_isSecure ? 443 : 80);
+
+ CALLBACK_Init(&m_dnsCallback, getHostByNameCallback, this);
+ m_dnsCallback.pfnCancel = 0;
+
+ INETMGR_GetHostByName(networkManager(), &m_dns, url.host().latin1().data(), &m_dnsCallback);
+}
+
+SocketStreamHandlePrivate::~SocketStreamHandlePrivate()
+{
+}
+
+void SocketStreamHandlePrivate::socketConnected()
+{
+ if (m_streamHandle && m_streamHandle->client()) {
+ m_streamHandle->m_state = SocketStreamHandleBase::Open;
+ m_streamHandle->client()->didOpen(m_streamHandle);
+ }
+
+ ISOCKET_Readable(m_socket.get(), socketReadableCallback, this);
+}
+
+void SocketStreamHandlePrivate::socketReadyRead()
+{
+ if (m_streamHandle && m_streamHandle->client()) {
+ Vector<char> buffer(1024);
+
+ int readSize = ISOCKET_Read(m_socket.get(), buffer.data(), buffer.size());
+ if (readSize == AEE_NET_ERROR) {
+ socketError(ISOCKET_GetLastError(m_socket.get()));
+ return;
+ }
+
+ m_streamHandle->client()->didReceiveData(m_streamHandle, buffer.data(), readSize);
+ }
+
+ ISOCKET_Readable(m_socket.get(), socketReadableCallback, this);
+}
+
+void SocketStreamHandlePrivate::connect()
+{
+ ISOCKET_Connect(m_socket.get(), m_dns.addrs[0], HTONS(m_port), socketStreamConnectCallback, this);
+}
+
+int SocketStreamHandlePrivate::send(const char* data, int len)
+{
+ if (!m_socket)
+ return 0;
+
+ int sentSize = ISOCKET_Write(m_socket.get(), reinterpret_cast<byte*>(const_cast<char*>(data)), len);
+ if (sentSize == AEE_NET_ERROR) {
+ socketError(ISOCKET_GetLastError(m_socket.get()));
+ return 0;
+ }
+
+ return sentSize;
+}
+
+void SocketStreamHandlePrivate::close()
+{
+ m_socket.clear();
+}
+
+void SocketStreamHandlePrivate::socketClosed()
+{
+ if (m_streamHandle && m_streamHandle->client()) {
+ SocketStreamHandle* streamHandle = m_streamHandle;
+ m_streamHandle = 0;
+ // This following call deletes _this_. Nothing should be after it.
+ streamHandle->client()->didClose(streamHandle);
+ }
+}
+
+void SocketStreamHandlePrivate::socketError(int error)
+{
+ // FIXME - in the future, we might not want to treat all errors as fatal.
+ if (m_streamHandle && m_streamHandle->client()) {
+ SocketStreamHandle* streamHandle = m_streamHandle;
+ m_streamHandle = 0;
+ // This following call deletes _this_. Nothing should be after it.
+ streamHandle->client()->didClose(streamHandle);
+ }
+}
+
+SocketStreamHandle::SocketStreamHandle(const KURL& url, SocketStreamHandleClient* client)
+ : SocketStreamHandleBase(url, client)
+{
+ LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
+ m_p = new SocketStreamHandlePrivate(this, url);
+}
+
+SocketStreamHandle::~SocketStreamHandle()
+{
+ LOG(Network, "SocketStreamHandle %p delete", this);
+ setClient(0);
+ delete m_p;
+}
+
+int SocketStreamHandle::platformSend(const char* data, int len)
+{
+ LOG(Network, "SocketStreamHandle %p platformSend", this);
+ return m_p->send(data, len);
+}
+
+void SocketStreamHandle::platformClose()
+{
+ LOG(Network, "SocketStreamHandle %p platformClose", this);
+ m_p->close();
+}
+
+void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/network/brew/SocketStreamHandlePrivate.h b/WebCore/platform/network/brew/SocketStreamHandlePrivate.h
new file mode 100644
index 0000000..3c6fd18
--- /dev/null
+++ b/WebCore/platform/network/brew/SocketStreamHandlePrivate.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2010 Company 100, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SocketStreamHandlePrivate_h
+#define SocketStreamHandlePrivate_h
+
+#include "SocketStreamHandleBase.h"
+
+#include <AEENet.h>
+#include <AEESSL.h>
+#include <wtf/OwnPtr.h>
+
+namespace WebCore {
+
+class SocketStreamHandleClient;
+
+class SocketStreamHandlePrivate {
+public:
+ SocketStreamHandlePrivate(SocketStreamHandle*, const KURL&);
+ ~SocketStreamHandlePrivate();
+
+ void socketConnected();
+ void socketReadyRead();
+ void socketClosed();
+ void socketError(int);
+
+ void connect();
+ int send(const char* data, int len);
+ void close();
+
+ AEEDNSResult m_dns;
+ AEECallback m_dnsCallback;
+ unsigned int m_port;
+ bool m_isSecure;
+
+ OwnPtr<ISocket> m_socket;
+ OwnPtr<ISSL> m_ssl;
+ SocketStreamHandle* m_streamHandle;
+};
+
+}
+
+#endif // SocketStreamHandlePrivate_h
diff --git a/WebCore/platform/network/cf/AuthenticationCF.h b/WebCore/platform/network/cf/AuthenticationCF.h
index 55f3e5f..b945ca1 100644
--- a/WebCore/platform/network/cf/AuthenticationCF.h
+++ b/WebCore/platform/network/cf/AuthenticationCF.h
@@ -26,8 +26,9 @@
#ifndef AuthenticationCF_h
#define AuthenticationCF_h
+#include <CFNetwork/CFURLCredentialPriv.h>
+
typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
-typedef struct _CFURLCredential* CFURLCredentialRef;
typedef struct _CFURLProtectionSpace* CFURLProtectionSpaceRef;
namespace WebCore {
diff --git a/WebCore/platform/network/cf/DNSCFNet.cpp b/WebCore/platform/network/cf/DNSCFNet.cpp
index c17b59f..bda9e41 100644
--- a/WebCore/platform/network/cf/DNSCFNet.cpp
+++ b/WebCore/platform/network/cf/DNSCFNet.cpp
@@ -49,12 +49,18 @@ namespace WebCore {
const int namesToResolveImmediately = 4;
// Coalesce prefetch requests for this long before sending them out.
-const double coalesceDelay = 1.0;
+const double coalesceDelayInSeconds = 1.0;
+
+// Sending many DNS requests at once can overwhelm some gateways. CFHost doesn't currently throttle for us, see <rdar://8105550>.
+const int maxSimultaneousRequests = 8;
// For a page has links to many outside sites, it is likely that the system DNS resolver won't be able to cache them all anyway, and we don't want
-// to negatively affect other appications' performance, by pushing their cached entries out, too.
+// to negatively affect other applications' performance by pushing their cached entries out.
// If we end up with lots of names to prefetch, some will be dropped.
-const int maxRequestsToSend = 64;
+const int maxRequestsToQueue = 64;
+
+// If there were queued names that couldn't be sent simultaneously, check the state of resolvers after this delay.
+const double retryResolvingInSeconds = 0.1;
class DNSResolveQueue : public TimerBase {
public:
@@ -92,9 +98,14 @@ void DNSResolveQueue::add(const String& name)
}
atomicDecrement(&m_requestsInFlight);
}
- m_names.add(name);
- if (!isActive())
- startOneShot(coalesceDelay);
+
+ // It's better to not prefetch some names than to clog the queue.
+ // Dropping the newest names, because on a single page, these are likely to be below oldest ones.
+ if (m_names.size() < maxRequestsToQueue) {
+ m_names.add(name);
+ if (!isActive())
+ startOneShot(coalesceDelayInSeconds);
+ }
}
void DNSResolveQueue::decrementRequestCount()
@@ -104,15 +115,17 @@ void DNSResolveQueue::decrementRequestCount()
void DNSResolveQueue::fired()
{
- int requestsAllowed = maxRequestsToSend - m_requestsInFlight;
+ int requestsAllowed = maxSimultaneousRequests - m_requestsInFlight;
- for (HashSet<String>::iterator iter = m_names.begin(); iter != m_names.end() && requestsAllowed > 0; ++iter, --requestsAllowed) {
+ for (; !m_names.isEmpty() && requestsAllowed > 0; --requestsAllowed) {
atomicIncrement(&m_requestsInFlight);
- resolve(*iter);
+ HashSet<String>::iterator currentName = m_names.begin();
+ resolve(*currentName);
+ m_names.remove(currentName);
}
- // It's better to skip some names than to clog the queue.
- m_names.clear();
+ if (!m_names.isEmpty())
+ startOneShot(retryResolvingInSeconds);
}
static void clientCallback(CFHostRef theHost, CFHostInfoType, const CFStreamError*, void*)
diff --git a/WebCore/platform/network/cf/FormDataStreamCFNet.h b/WebCore/platform/network/cf/FormDataStreamCFNet.h
index 254a2cd..e57a0d1 100644
--- a/WebCore/platform/network/cf/FormDataStreamCFNet.h
+++ b/WebCore/platform/network/cf/FormDataStreamCFNet.h
@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FormDataStreamCFNet_h_
-#define FormDataStreamCFNet_h_
+#ifndef FormDataStreamCFNet_h
+#define FormDataStreamCFNet_h
#include <CoreFoundation/CoreFoundation.h>
#include <wtf/Forward.h>
@@ -41,4 +41,4 @@ namespace WebCore {
PassRefPtr<FormData> httpBodyFromRequest(CFURLRequestRef);
}
-#endif FormDataStreamCFNet_h_
+#endif FormDataStreamCFNet_h
diff --git a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
index e54f6d6..f126d27 100644
--- a/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
+++ b/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
@@ -626,7 +626,7 @@ void ResourceHandle::setClientCertificate(const String& host, CFDataRef cert)
clientCerts().set(host.lower(), cert);
}
-void ResourceHandle::setDefersLoading(bool defers)
+void ResourceHandle::platformSetDefersLoading(bool defers)
{
if (!d->m_connection)
return;
diff --git a/WebCore/platform/network/chromium/ResourceResponse.h b/WebCore/platform/network/chromium/ResourceResponse.h
index f80bf42..852b9f5 100644
--- a/WebCore/platform/network/chromium/ResourceResponse.h
+++ b/WebCore/platform/network/chromium/ResourceResponse.h
@@ -21,7 +21,7 @@
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef ResourceResponse_h
@@ -41,6 +41,7 @@ namespace WebCore {
, m_isMultipartPayload(false)
, m_wasFetchedViaSPDY(false)
, m_wasNpnNegotiated(false)
+ , m_wasAlternateProtocolAvailable(false)
, m_wasFetchedViaProxy(false)
, m_responseTime(0)
{
@@ -53,6 +54,7 @@ namespace WebCore {
, m_isMultipartPayload(false)
, m_wasFetchedViaSPDY(false)
, m_wasNpnNegotiated(false)
+ , m_wasAlternateProtocolAvailable(false)
, m_wasFetchedViaProxy(false)
, m_responseTime(0)
{
@@ -76,6 +78,15 @@ namespace WebCore {
bool wasNpnNegotiated() const { return m_wasNpnNegotiated; }
void setWasNpnNegotiated(bool value) { m_wasNpnNegotiated = value; }
+ bool wasAlternateProtocolAvailable() const
+ {
+ return m_wasAlternateProtocolAvailable;
+ }
+ void setWasAlternateProtocolAvailable(bool value)
+ {
+ m_wasAlternateProtocolAvailable = value;
+ }
+
bool wasFetchedViaProxy() const { return m_wasFetchedViaProxy; }
void setWasFetchedViaProxy(bool value) { m_wasFetchedViaProxy = value; }
@@ -119,6 +130,10 @@ namespace WebCore {
// Was the resource fetched over a channel which used TLS/Next-Protocol-Negotiation (also SPDY related).
bool m_wasNpnNegotiated;
+ // Was the resource fetched over a channel which specified "Alternate-Protocol"
+ // (e.g.: Alternate-Protocol: 443:npn-spdy/1).
+ bool m_wasAlternateProtocolAvailable;
+
// Was the resource fetched over an explicit proxy (HTTP, SOCKS, etc).
bool m_wasFetchedViaProxy;
diff --git a/WebCore/platform/network/curl/FormDataStreamCurl.h b/WebCore/platform/network/curl/FormDataStreamCurl.h
index 85ca8b0..bba1547 100644
--- a/WebCore/platform/network/curl/FormDataStreamCurl.h
+++ b/WebCore/platform/network/curl/FormDataStreamCurl.h
@@ -22,8 +22,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef FormatDataStreamCurl_h
-#define FormatDataStreamCurl_h
+#ifndef FormDataStreamCurl_h
+#define FormDataStreamCurl_h
#include "config.h"
diff --git a/WebCore/platform/network/curl/ResourceHandleCurl.cpp b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
index 05134a5..1fbafbd 100644
--- a/WebCore/platform/network/curl/ResourceHandleCurl.cpp
+++ b/WebCore/platform/network/curl/ResourceHandleCurl.cpp
@@ -153,34 +153,24 @@ void ResourceHandle::setClientCertificate(const String& host, CFDataRef cert)
}
#endif
-void ResourceHandle::setDefersLoading(bool defers)
+void ResourceHandle::platformSetDefersLoading(bool defers)
{
- if (d->m_defersLoading == defers)
- return;
-
#if LIBCURL_VERSION_NUM > 0x071200
if (!d->m_handle)
- d->m_defersLoading = defers;
- else if (defers) {
+ return;
+
+ if (defers) {
CURLcode error = curl_easy_pause(d->m_handle, CURLPAUSE_ALL);
// If we could not defer the handle, so don't do it.
if (error != CURLE_OK)
return;
-
- d->m_defersLoading = defers;
} else {
- // We need to set defersLoading before restarting a connection
- // or libcURL will call the callbacks in curl_easy_pause and
- // we would ASSERT.
- d->m_defersLoading = defers;
-
CURLcode error = curl_easy_pause(d->m_handle, CURLPAUSE_CONT);
if (error != CURLE_OK)
// Restarting the handle has failed so just cancel it.
cancel();
}
#else
- d->m_defersLoading = defers;
LOG_ERROR("Deferred loading is implemented if libcURL version is above 7.18.0");
#endif
}
diff --git a/WebCore/platform/network/mac/ResourceHandleMac.mm b/WebCore/platform/network/mac/ResourceHandleMac.mm
index 0454dd6..f14c108 100644
--- a/WebCore/platform/network/mac/ResourceHandleMac.mm
+++ b/WebCore/platform/network/mac/ResourceHandleMac.mm
@@ -325,11 +325,8 @@ void ResourceHandle::cancel()
[d->m_connection.get() cancel];
}
-void ResourceHandle::setDefersLoading(bool defers)
+void ResourceHandle::platformSetDefersLoading(bool defers)
{
- LOG(Network, "Handle %p setDefersLoading(%s)", this, defers ? "true" : "false");
-
- d->m_defersLoading = defers;
if (d->m_connection)
wkSetNSURLConnectionDefersCallbacks(d->m_connection.get(), defers);
}
diff --git a/WebCore/platform/network/qt/DnsPrefetchHelper.h b/WebCore/platform/network/qt/DnsPrefetchHelper.h
index e355025..892a3fb 100644
--- a/WebCore/platform/network/qt/DnsPrefetchHelper.h
+++ b/WebCore/platform/network/qt/DnsPrefetchHelper.h
@@ -16,8 +16,8 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#ifndef DNSPREFETCHHELPER_H
-#define DNSPREFETCHHELPER_H
+#ifndef DnsPrefetchHelper_h
+#define DnsPrefetchHelper_h
#include <QObject>
#include <QCache>
@@ -83,4 +83,4 @@ namespace WebCore {
}
-#endif // DNSPREFETCHHELPER_H
+#endif // DnsPrefetchHelper_h
diff --git a/WebCore/platform/network/qt/QNetworkReplyHandler.h b/WebCore/platform/network/qt/QNetworkReplyHandler.h
index 1abad4e..9f8217d 100644
--- a/WebCore/platform/network/qt/QNetworkReplyHandler.h
+++ b/WebCore/platform/network/qt/QNetworkReplyHandler.h
@@ -16,8 +16,8 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#ifndef QNETWORKREPLYHANDLER_H
-#define QNETWORKREPLYHANDLER_H
+#ifndef QNetworkReplyHandler_h
+#define QNetworkReplyHandler_h
#include <QObject>
@@ -113,4 +113,4 @@ private:
}
-#endif // QNETWORKREPLYHANDLER_H
+#endif // QNetworkReplyHandler_h
diff --git a/WebCore/platform/network/qt/ResourceHandleQt.cpp b/WebCore/platform/network/qt/ResourceHandleQt.cpp
index aaa306a..b35df6b 100644
--- a/WebCore/platform/network/qt/ResourceHandleQt.cpp
+++ b/WebCore/platform/network/qt/ResourceHandleQt.cpp
@@ -210,10 +210,8 @@ void ResourceHandle::loadResourceSynchronously(const ResourceRequest& request, S
}
-void ResourceHandle::setDefersLoading(bool defers)
+void ResourceHandle::platformSetDefersLoading(bool defers)
{
- d->m_defersLoading = defers;
-
if (d->m_job)
d->m_job->setLoadMode(QNetworkReplyHandler::LoadMode(defers));
}
diff --git a/WebCore/platform/network/soup/ResourceHandleSoup.cpp b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
index e2c67bc..15d914f 100644
--- a/WebCore/platform/network/soup/ResourceHandleSoup.cpp
+++ b/WebCore/platform/network/soup/ResourceHandleSoup.cpp
@@ -637,9 +637,8 @@ bool ResourceHandle::supportsBufferedData()
return false;
}
-void ResourceHandle::setDefersLoading(bool defers)
+void ResourceHandle::platformSetDefersLoading(bool)
{
- d->m_defersLoading = defers;
notImplemented();
}
diff --git a/WebCore/platform/network/win/NetworkStateNotifierWin.cpp b/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
index 5cc381d..1620669 100644
--- a/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
+++ b/WebCore/platform/network/win/NetworkStateNotifierWin.cpp
@@ -88,6 +88,10 @@ void NetworkStateNotifier::callAddressChanged(void* context)
void CALLBACK NetworkStateNotifier::addrChangeCallback(void* context, BOOLEAN timedOut)
{
+ // NotifyAddrChange only notifies us of a single address change. Now that we've been notified,
+ // we need to call it again so we'll get notified the *next* time.
+ static_cast<NetworkStateNotifier*>(context)->registerForAddressChange();
+
callOnMainThread(callAddressChanged, context);
}
diff --git a/WebCore/platform/network/win/ResourceHandleWin.cpp b/WebCore/platform/network/win/ResourceHandleWin.cpp
index aff316e..63c84a9 100644
--- a/WebCore/platform/network/win/ResourceHandleWin.cpp
+++ b/WebCore/platform/network/win/ResourceHandleWin.cpp
@@ -25,9 +25,6 @@
#include "config.h"
#include "ResourceHandle.h"
-#include "ResourceHandleClient.h"
-#include "ResourceHandleInternal.h"
-#include "ResourceHandleWin.h"
#include "DocLoader.h"
#include "Document.h"
@@ -35,7 +32,11 @@
#include "FrameLoader.h"
#include "Page.h"
#include "ResourceError.h"
+#include "ResourceHandleClient.h"
+#include "ResourceHandleInternal.h"
+#include "ResourceHandleWin.h"
#include "Timer.h"
+#include "WebCoreInstanceHandle.h"
#include <wtf/text/CString.h>
#include <windows.h>
#include <wininet.h>
@@ -113,12 +114,12 @@ static void initializeOffScreenResourceHandleWindow()
memset(&wcex, 0, sizeof(WNDCLASSEX));
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.lpfnWndProc = ResourceHandleWndProc;
- wcex.hInstance = Page::instanceHandle();
+ wcex.hInstance = WebCore::instanceHandle();
wcex.lpszClassName = kResourceHandleWindowClassName;
RegisterClassEx(&wcex);
transferJobWindowHandle = CreateWindow(kResourceHandleWindowClassName, 0, 0, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,
- HWND_MESSAGE, 0, Page::instanceHandle(), 0);
+ HWND_MESSAGE, 0, WebCore::instanceHandle(), 0);
}
ResourceHandleInternal::~ResourceHandleInternal()
@@ -144,9 +145,9 @@ void ResourceHandle::onHandleCreated(LPARAM lParam)
return;
}
- if (method() == "POST") {
+ if (request().httpMethod() == "POST") {
// FIXME: Too late to set referrer properly.
- String urlStr = url().path();
+ String urlStr = request().url().path();
int fragmentIndex = urlStr.find('#');
if (fragmentIndex != -1)
urlStr = urlStr.left(fragmentIndex);
@@ -166,7 +167,7 @@ void ResourceHandle::onHandleCreated(LPARAM lParam)
}
}
} else if (!d->m_secondaryHandle) {
- assert(method() == "POST");
+ assert(request().httpMethod() == "POST");
d->m_secondaryHandle = HINTERNET(lParam);
// Need to actually send the request now.
@@ -175,18 +176,18 @@ void ResourceHandle::onHandleCreated(LPARAM lParam)
headers += d->m_postReferrer;
headers += "\n";
const CString& headersLatin1 = headers.latin1();
- String formData = postData()->flattenToString();
+ String formData = request().httpBody()->flattenToString();
INTERNET_BUFFERSA buffers;
memset(&buffers, 0, sizeof(buffers));
buffers.dwStructSize = sizeof(INTERNET_BUFFERSA);
- buffers.lpcszHeader = headersLatin1;
+ buffers.lpcszHeader = headersLatin1.data();
buffers.dwHeadersLength = headers.length();
buffers.dwBufferTotal = formData.length();
d->m_bytesRemainingToWrite = formData.length();
d->m_formDataString = (char*)malloc(formData.length());
d->m_formDataLength = formData.length();
- strncpy(d->m_formDataString, formData.latin1(), formData.length());
+ strncpy(d->m_formDataString, formData.latin1().data(), formData.length());
d->m_writing = true;
HttpSendRequestExA(d->m_secondaryHandle, &buffers, 0, 0, (DWORD_PTR)d->m_jobId);
// FIXME: add proper error handling
@@ -223,7 +224,7 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
return;
}
- HINTERNET handle = (method() == "POST") ? d->m_secondaryHandle : d->m_resourceHandle;
+ HINTERNET handle = (request().httpMethod() == "POST") ? d->m_secondaryHandle : d->m_resourceHandle;
BOOL ok = FALSE;
static const int bufferSize = 32768;
@@ -260,7 +261,11 @@ void ResourceHandle::onRequestComplete(LPARAM lParam)
InternetGetLastResponseInfo(&platformData.error, platformData.errorString, &errorStringChars);
}
}
- _RPTF1(_CRT_WARN, "Load error: %i\n", error);
+#ifdef RESOURCE_LOADER_DEBUG
+ char buf[64];
+ _snprintf(buf, sizeof(buf), "Load error: %i\n", error);
+ OutputDebugStringA(buf);
+#endif
}
if (d->m_secondaryHandle)
@@ -309,8 +314,8 @@ static void __stdcall transferJobStatusCallback(HINTERNET internetHandle,
// need to block the redirect at this point so the application can
// decide whether or not to follow the redirect)
msg = requestRedirectedMessage;
- lParam = (LPARAM) new StringImpl((const UChar*) statusInformation,
- statusInformationLength);
+ lParam = (LPARAM) StringImpl::create((const UChar*) statusInformation,
+ statusInformationLength).releaseRef();
break;
case INTERNET_STATUS_USER_INPUT_REQUIRED:
// FIXME: prompt the user if necessary
@@ -327,8 +332,8 @@ static void __stdcall transferJobStatusCallback(HINTERNET internetHandle,
bool ResourceHandle::start(Frame* frame)
{
ref();
- if (url().isLocalFile()) {
- String path = url().path();
+ if (request().url().isLocalFile()) {
+ String path = request().url().path();
// windows does not enjoy a leading slash on paths
if (path[0] == '/')
path = path.substring(1);
@@ -347,7 +352,7 @@ bool ResourceHandle::start(Frame* frame)
} else {
static HINTERNET internetHandle = 0;
if (!internetHandle) {
- String userAgentStr = frame->loader()->userAgent() + String("", 1);
+ String userAgentStr = frame->loader()->userAgent(request().url()) + String("", 1);
LPCWSTR userAgent = reinterpret_cast<const WCHAR*>(userAgentStr.characters());
// leak the Internet for now
internetHandle = InternetOpen(userAgent, INTERNET_OPEN_TYPE_PRECONFIG, 0, 0, INTERNET_FLAG_ASYNC);
@@ -371,17 +376,17 @@ bool ResourceHandle::start(Frame* frame)
// InternetConnect followed by HttpSendRequest.
HINTERNET urlHandle;
String referrer = frame->loader()->referrer();
- if (method() == "POST") {
+ if (request().httpMethod() == "POST") {
d->m_postReferrer = referrer;
- String host = url().host();
+ String host = request().url().host();
urlHandle = InternetConnectA(internetHandle, host.latin1().data(),
- url().port(),
+ request().url().port(),
NULL, // no username
NULL, // no password
INTERNET_SERVICE_HTTP,
flags, (DWORD_PTR)d->m_jobId);
} else {
- String urlStr = url().string();
+ String urlStr = request().url().string();
int fragmentIndex = urlStr.find('#');
if (fragmentIndex != -1)
urlStr = urlStr.left(fragmentIndex);
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp
index c98c79a..485d0d1 100644
--- a/WebCore/platform/qt/ClipboardQt.cpp
+++ b/WebCore/platform/qt/ClipboardQt.cpp
@@ -283,7 +283,7 @@ void ClipboardQt::writeRange(Range* range, Frame* frame)
QString text = frame->selectedText();
text.replace(QChar(0xa0), QLatin1Char(' '));
m_writableData->setText(text);
- m_writableData->setHtml(createMarkup(range, 0, AnnotateForInterchange));
+ m_writableData->setHtml(createMarkup(range, 0, AnnotateForInterchange, false, AbsoluteURLs));
#ifndef QT_NO_CLIPBOARD
if (!isForDragging())
QApplication::clipboard()->setMimeData(m_writableData);
diff --git a/WebCore/platform/qt/PasteboardQt.cpp b/WebCore/platform/qt/PasteboardQt.cpp
index 86d2cfe..e1e6d84 100644
--- a/WebCore/platform/qt/PasteboardQt.cpp
+++ b/WebCore/platform/qt/PasteboardQt.cpp
@@ -66,7 +66,7 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
md->setText(text);
QString html = QLatin1String("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /></head><body>");
- html += createMarkup(selectedRange, 0, AnnotateForInterchange);
+ html += createMarkup(selectedRange, 0, AnnotateForInterchange, false, AbsoluteURLs);
html += QLatin1String("</body></html>");
md->setHtml(html);
diff --git a/WebCore/platform/qt/QWebPageClient.h b/WebCore/platform/qt/QWebPageClient.h
index 9e32d31..1f508bb 100644
--- a/WebCore/platform/qt/QWebPageClient.h
+++ b/WebCore/platform/qt/QWebPageClient.h
@@ -87,11 +87,13 @@ public:
virtual QObject* pluginParent() const = 0;
virtual QStyle* style() const = 0;
-
+
virtual QRectF graphicsItemVisibleRect() const { return QRectF(); }
-
+
virtual bool viewResizesToContentsEnabled() const = 0;
+ virtual QRectF windowRect() const = 0;
+
protected:
#ifndef QT_NO_CURSOR
virtual QCursor cursor() const = 0;
diff --git a/WebCore/platform/sql/SQLiteStatement.cpp b/WebCore/platform/sql/SQLiteStatement.cpp
index cd2a467..78bbfeb 100644
--- a/WebCore/platform/sql/SQLiteStatement.cpp
+++ b/WebCore/platform/sql/SQLiteStatement.cpp
@@ -61,7 +61,7 @@ SQLiteStatement::~SQLiteStatement()
int SQLiteStatement::prepare()
{
ASSERT(!m_isPrepared);
- const void* tail;
+ const void* tail = 0;
LOG(SQLDatabase, "SQL - prepare - %s", m_query.ascii().data());
String strippedQuery = m_query.stripWhiteSpace();
int error = sqlite3_prepare16_v2(m_database.sqlite3Handle(), strippedQuery.charactersWithNullTermination(), -1, &m_statement, &tail);
@@ -77,7 +77,7 @@ int SQLiteStatement::prepare()
if (error != SQLITE_OK)
LOG(SQLDatabase, "sqlite3_prepare16 failed (%i)\n%s\n%s", error, m_query.ascii().data(), sqlite3_errmsg(m_database.sqlite3Handle()));
const UChar* ch = static_cast<const UChar*>(tail);
- if (*ch)
+ if (ch && *ch)
error = SQLITE_ERROR;
#ifndef NDEBUG
m_isPrepared = error == SQLITE_OK;
diff --git a/WebCore/platform/text/BidiContext.cpp b/WebCore/platform/text/BidiContext.cpp
index 59db7bd..fb6b8cf 100644
--- a/WebCore/platform/text/BidiContext.cpp
+++ b/WebCore/platform/text/BidiContext.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2009 Apple Inc. All right reserved.
+ * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. All right reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -22,35 +22,40 @@
#include "config.h"
#include "BidiContext.h"
-#include <wtf/StdLibExtras.h>
-
namespace WebCore {
using namespace WTF::Unicode;
+inline PassRefPtr<BidiContext> BidiContext::createUncached(unsigned char level, Direction direction, bool override, BidiContext* parent)
+{
+ return adoptRef(new BidiContext(level, direction, override, parent));
+}
+
PassRefPtr<BidiContext> BidiContext::create(unsigned char level, Direction direction, bool override, BidiContext* parent)
{
ASSERT(direction == (level % 2 ? RightToLeft : LeftToRight));
if (parent)
- return adoptRef(new BidiContext(level, direction, override, parent));
+ return createUncached(level, direction, override, parent);
ASSERT(level <= 1);
if (!level) {
- DEFINE_STATIC_LOCAL(BidiContext, ltrContext, (0, LeftToRight, false, 0));
- if (!override)
- return &ltrContext;
+ if (!override) {
+ static BidiContext* ltrContext = createUncached(0, LeftToRight, false, 0).releaseRef();
+ return ltrContext;
+ }
- DEFINE_STATIC_LOCAL(BidiContext, ltrOverrideContext, (0, LeftToRight, true, 0));
- return &ltrOverrideContext;
+ static BidiContext* ltrOverrideContext = createUncached(0, LeftToRight, true, 0).releaseRef();
+ return ltrOverrideContext;
}
- DEFINE_STATIC_LOCAL(BidiContext, rtlContext, (1, RightToLeft, false, 0));
- if (!override)
- return &rtlContext;
+ if (!override) {
+ static BidiContext* rtlContext = createUncached(1, RightToLeft, false, 0).releaseRef();
+ return rtlContext;
+ }
- DEFINE_STATIC_LOCAL(BidiContext, rtlOverrideContext, (1, RightToLeft, true, 0));
- return &rtlOverrideContext;
+ static BidiContext* rtlOverrideContext = createUncached(1, RightToLeft, true, 0).releaseRef();
+ return rtlOverrideContext;
}
bool operator==(const BidiContext& c1, const BidiContext& c2)
diff --git a/WebCore/platform/text/BidiContext.h b/WebCore/platform/text/BidiContext.h
index 8791605..b52815f 100644
--- a/WebCore/platform/text/BidiContext.h
+++ b/WebCore/platform/text/BidiContext.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
- * Copyright (C) 2003, 2004, 2006, 2007, 2009 Apple Inc. All right reserved.
+ * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. All right reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -49,6 +49,8 @@ private:
{
}
+ static PassRefPtr<BidiContext> createUncached(unsigned char level, WTF::Unicode::Direction, bool override, BidiContext* parent);
+
unsigned char m_level;
unsigned m_direction : 5; // Direction
bool m_override : 1;
diff --git a/WebCore/platform/text/CharacterNames.h b/WebCore/platform/text/CharacterNames.h
index 687bfb4..f06246c 100644
--- a/WebCore/platform/text/CharacterNames.h
+++ b/WebCore/platform/text/CharacterNames.h
@@ -42,6 +42,7 @@ const UChar ethiopicPrefaceColon = 0x1366;
const UChar hebrewPunctuationGeresh = 0x05F3;
const UChar hebrewPunctuationGershayim = 0x05F4;
const UChar horizontalEllipsis = 0x2026;
+const UChar hyphen = 0x2010;
const UChar hyphenMinus = 0x002D;
const UChar ideographicComma = 0x3001;
const UChar ideographicFullStop = 0x3002;
diff --git a/WebCore/platform/text/Hyphenation.cpp b/WebCore/platform/text/Hyphenation.cpp
new file mode 100644
index 0000000..8ef5a25
--- /dev/null
+++ b/WebCore/platform/text/Hyphenation.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Hyphenation.h"
+
+#include "NotImplemented.h"
+
+namespace WebCore {
+
+size_t lastHyphenLocation(const UChar* /* characters */, size_t /* length */, size_t /* beforeIndex */)
+{
+ notImplemented();
+ return 0;
+}
+
+} // namespace WebCore
diff --git a/WebCore/platform/text/Hyphenation.h b/WebCore/platform/text/Hyphenation.h
new file mode 100644
index 0000000..dbcbe69
--- /dev/null
+++ b/WebCore/platform/text/Hyphenation.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef Hyphenation_h
+#define Hyphenation_h
+
+#include <wtf/unicode/Unicode.h>
+
+namespace WebCore {
+
+size_t lastHyphenLocation(const UChar*, size_t length, size_t beforeIndex);
+
+} // namespace WebCore
+
+#endif // Hyphenation_h
diff --git a/WebCore/platform/text/cf/HyphenationCF.cpp b/WebCore/platform/text/cf/HyphenationCF.cpp
new file mode 100644
index 0000000..50ba4c8
--- /dev/null
+++ b/WebCore/platform/text/cf/HyphenationCF.cpp
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Hyphenation.h"
+
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+
+#include "TextBreakIteratorInternalICU.h"
+#include <wtf/RetainPtr.h>
+
+namespace WebCore {
+
+static CFLocaleRef createCurrentSearchLocale()
+{
+ RetainPtr<CFStringRef> localeIdentifier(AdoptCF, CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, (const UInt8*)currentSearchLocaleID(), strlen(currentSearchLocaleID()), kCFStringEncodingASCII, false, kCFAllocatorNull));
+ return CFLocaleCreate(kCFAllocatorDefault, localeIdentifier.get());
+}
+
+size_t lastHyphenLocation(const UChar* characters, size_t length, size_t beforeIndex)
+{
+ RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, characters, length, kCFAllocatorNull));
+
+ static CFLocaleRef locale = createCurrentSearchLocale();
+
+ CFIndex result = CFStringGetHyphenationLocationBeforeIndex(string.get(), beforeIndex, CFRangeMake(0, length), 0, locale, 0);
+ return result == kCFNotFound ? 0 : result;
+}
+
+} // namespace WebCore
+
+#endif // !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
diff --git a/WebCore/platform/text/mac/HyphenationMac.mm b/WebCore/platform/text/mac/HyphenationMac.mm
new file mode 100644
index 0000000..e64477f
--- /dev/null
+++ b/WebCore/platform/text/mac/HyphenationMac.mm
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "Hyphenation.h"
+
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+
+#import "TextBreakIteratorInternalICU.h"
+#import "WebCoreSystemInterface.h"
+#import <wtf/RetainPtr.h>
+
+namespace WebCore {
+
+size_t lastHyphenLocation(const UChar* characters, size_t length, size_t beforeIndex)
+{
+ static bool localeIsEnglish = !strcmp("en", currentSearchLocaleID());
+ if (!localeIsEnglish)
+ return 0;
+
+ RetainPtr<CFStringRef> string(AdoptCF, CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, characters, length, kCFAllocatorNull));
+ return wkGetHyphenationLocationBeforeIndex(string.get(), beforeIndex);
+}
+
+} // namespace WebCore
+
+#endif // defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
diff --git a/WebCore/platform/text/wince/TextCodecWinCE.cpp b/WebCore/platform/text/wince/TextCodecWinCE.cpp
new file mode 100644
index 0000000..644b12f
--- /dev/null
+++ b/WebCore/platform/text/wince/TextCodecWinCE.cpp
@@ -0,0 +1,483 @@
+/*
+ * Copyright (C) 2007-2009 Torch Mobile, Inc. 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 library is distributed in the hope that i 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 "TextCodecWinCE.h"
+
+#include "ce_textcodecs.h"
+#include "FontCache.h"
+#include "PlatformString.h"
+#include "StringHash.h"
+#include <mlang.h>
+#include <winbase.h>
+#include <winnls.h>
+#include <wtf/HashMap.h>
+#include <wtf/HashSet.h>
+#include <wtf/text/CString.h>
+#include <wtf/unicode/UTF8.h>
+
+namespace WebCore {
+
+struct CharsetInfo {
+ CString m_name;
+ String m_friendlyName;
+ UINT m_codePage;
+ Vector<CString> m_aliases;
+ bool m_usesNativeCodec;
+};
+
+class LanguageManager {
+private:
+ LanguageManager();
+
+ friend LanguageManager& languageManager();
+};
+
+// Usage: a lookup table used to get CharsetInfo with code page ID.
+// Key: code page ID. Value: charset information.
+static HashMap<UINT, CString>& codePageCharsets()
+{
+ static HashMap<UINT, CString> cc;
+ return cc;
+}
+
+static HashMap<String, CharsetInfo>& knownCharsets()
+{
+ static HashMap<String, CharsetInfo> kc;
+ return kc;
+}
+
+// Usage: a map that stores charsets that are supported by system. Sorted by name.
+// Key: charset. Value: code page ID.
+typedef HashSet<String> CharsetSet;
+static CharsetSet& supportedCharsets()
+{
+ static CharsetSet sl;
+ return sl;
+}
+
+static LanguageManager& languageManager()
+{
+ static LanguageManager lm;
+ return lm;
+}
+
+static void addCharset(UINT codePage, const char* charsetName, const wchar_t* friendlyName, const char* charsetAliases, bool nativeSupport = false)
+{
+ CharsetInfo info;
+ info.m_codePage = codePage;
+ info.m_name = charsetName;
+ info.m_friendlyName = friendlyName;
+ info.m_usesNativeCodec = nativeSupport;
+ const char* begin = charsetAliases;
+ for (;;) {
+ const char* end = strchr(begin, '|');
+ CString alias = end ? CString(begin, end - begin) : begin;
+ if (alias.length())
+ info.m_aliases.append(alias);
+ if (!end)
+ break;
+ begin = end + 1;
+ }
+ knownCharsets().set(info.m_name.data(), info);
+ if (codePage != CP_ACP)
+ codePageCharsets().set(codePage, info.m_name);
+}
+
+LanguageManager::LanguageManager()
+{
+ // 437, 708, 709, 710, 720, 737, 775, 850, 852
+ addCharset(932, "SHIFT_JIS", L"Japanese (SHIFT_JIS)", "shift_jis");
+ addCharset(936, "GBK", L"Chinese Simplified (GBK)", "gbk|gb2312");
+ addCharset(949, "KSC5601", L"Korean (KSC5601)", "ks_c_5601-1987|ksc5601|euc-kr|euckr|x-euc-kr");
+ addCharset(950, "BIG5", L"Chinese Traditional (BIG5)", "big5");
+ addCharset(1361, "JOHAB", L"Korean (Johab)", "johab|korean.johab");
+ addCharset(51932, "EUC-JP", L"Japanese (EUC)", "euc-jp|eucjp|x-euc-jp", true);
+ addCharset(874, "CP874", L"Thai (Windows)", "cp874|windows-874", true);
+ addCharset(CP_ACP, "TIS620", L"Thai (TIS 620)", "tis620|ISO-8859-11|ISO-IR-166|TIS-620|TIS620-0TIS620.2529-1|TIS620.2533-0|TIS620.2533-1|thai8", true);
+ addCharset(CP_ACP, "MACTHAI", L"Thai (Mac OS)", "macthai|x-mac-thai|mac-thai", true);
+ supportedCharsets().add("EUC-JP");
+ supportedCharsets().add("CP874");
+ supportedCharsets().add("TIS620");
+ supportedCharsets().add("MACTHAI");
+
+ IEnumCodePage* enumInterface;
+ IMultiLanguage* mli = FontCache::getMultiLanguageInterface();
+ if (mli && S_OK == mli->EnumCodePages(MIMECONTF_BROWSER, &enumInterface)) {
+ MIMECPINFO cpInfo;
+ ULONG ccpInfo;
+ while (S_OK == enumInterface->Next(1, &cpInfo, &ccpInfo) && ccpInfo) {
+ if (!IsValidCodePage(cpInfo.uiCodePage))
+ continue;
+
+ HashMap<UINT, CString>::iterator i = codePageCharsets().find(cpInfo.uiCodePage);
+
+ CString name(String(cpInfo.wszWebCharset).latin1());
+ if (i == codePageCharsets().end()) {
+ CharsetInfo info;
+ info.m_codePage = cpInfo.uiCodePage;
+ knownCharsets().set(name.data(), info);
+ i = codePageCharsets().set(cpInfo.uiCodePage, name).first;
+ }
+ if (i != codePageCharsets().end()) {
+ HashMap<String, CharsetInfo>::iterator j = knownCharsets().find(String(i->second.data(), i->second.length()));
+ ASSERT(j != knownCharsets().end());
+ CharsetInfo& info = j->second;
+ info.m_name = i->second.data();
+ info.m_friendlyName = cpInfo.wszDescription;
+ info.m_aliases.append(name);
+ info.m_aliases.append(String(cpInfo.wszHeaderCharset).latin1());
+ info.m_aliases.append(String(cpInfo.wszBodyCharset).latin1());
+ info.m_usesNativeCodec = false;
+ String cpName = String::format("cp%d", cpInfo.uiCodePage);
+ info.m_aliases.append(cpName.latin1());
+ supportedCharsets().add(i->second.data());
+ }
+ }
+ enumInterface->Release();
+ }
+}
+
+static UINT getCodePage(const char* name)
+{
+ if (!strcmp(name, "UTF-8"))
+ return CP_UTF8;
+
+ // Explicitly use a "const" reference to fix the silly VS build error
+ // saying "==" is not found for const_iterator and iterator
+ const HashMap<String, CharsetInfo>& charsets = knownCharsets();
+ HashMap<String, CharsetInfo>::const_iterator i = charsets.find(name);
+ return i == charsets.end() ? CP_ACP : i->second.m_codePage;
+}
+
+static PassOwnPtr<TextCodec> newTextCodecWinCE(const TextEncoding& encoding, const void*)
+{
+ return new TextCodecWinCE(encoding);
+}
+
+TextCodecWinCE::TextCodecWinCE(const TextEncoding& encoding)
+ : m_encoding(encoding)
+{
+}
+
+TextCodecWinCE::~TextCodecWinCE()
+{
+}
+
+void TextCodecWinCE::registerBaseEncodingNames(EncodingNameRegistrar registrar)
+{
+ registrar("UTF-8", "UTF-8");
+}
+
+void TextCodecWinCE::registerBaseCodecs(TextCodecRegistrar registrar)
+{
+ registrar("UTF-8", newTextCodecWinCE, 0);
+}
+
+void TextCodecWinCE::registerExtendedEncodingNames(EncodingNameRegistrar registrar)
+{
+ languageManager();
+ for (CharsetSet::iterator i = supportedCharsets().begin(); i != supportedCharsets().end(); ++i) {
+ HashMap<String, CharsetInfo>::iterator j = knownCharsets().find(*i);
+ if (j != knownCharsets().end()) {
+ registrar(j->second.m_name.data(), j->second.m_name.data());
+ for (Vector<CString>::const_iterator alias = j->second.m_aliases.begin(); alias != j->second.m_aliases.end(); ++alias)
+ registrar(alias->data(), j->second.m_name.data());
+ }
+ }
+}
+
+void TextCodecWinCE::registerExtendedCodecs(TextCodecRegistrar registrar)
+{
+ languageManager();
+ for (CharsetSet::iterator i = supportedCharsets().begin(); i != supportedCharsets().end(); ++i) {
+ HashMap<String, CharsetInfo>::iterator j = knownCharsets().find(*i);
+ if (j != knownCharsets().end())
+ registrar(j->second.m_name.data(), newTextCodecWinCE, 0);
+ }
+}
+
+static DWORD getCodePageFlags(UINT codePage)
+{
+ if (codePage == CP_UTF8)
+ return MB_ERR_INVALID_CHARS;
+
+ if (codePage == 42) // Symbol
+ return 0;
+
+ // Microsoft says the flag must be 0 for the following code pages
+ if (codePage > 50000) {
+ if ((codePage >= 50220 && codePage <= 50222)
+ || codePage == 50225
+ || codePage == 50227
+ || codePage == 50229
+ || codePage == 52936
+ || codePage == 54936
+ || (codePage >= 57002 && codePage <= 57001)
+ || codePage == 65000 // UTF-7
+ )
+ return 0;
+ }
+
+ return MB_PRECOMPOSED | MB_ERR_INVALID_CHARS;
+}
+
+static inline const char* findFirstNonAsciiCharacter(const char* bytes, size_t length)
+{
+ for (const char* bytesEnd = bytes + length; bytes < bytesEnd; ++bytes) {
+ if (*bytes & 0x80)
+ break;
+ }
+ return bytes;
+}
+
+static void decode(Vector<UChar, 8192>& result, const char* encodingName, const char* bytes, size_t length, size_t* left, bool canBeFirstTime, bool& sawInvalidChar)
+{
+ *left = length;
+ if (!bytes || !length)
+ return;
+
+ UINT codePage;
+
+ HashMap<String, CharsetInfo>::iterator i = knownCharsets().find(encodingName);
+ if (i == knownCharsets().end()) {
+ if (!strcmp(encodingName, "UTF-8"))
+ codePage = CP_UTF8;
+ else
+ codePage = CP_ACP;
+ } else {
+ codePage = i->second.m_codePage;
+ if (i->second.m_usesNativeCodec) {
+ typedef int (*FuncEucMbToWc)(wchar_t *pwc, const unsigned char *s, int n);
+ FuncEucMbToWc encMbToWc = 0;
+ if (!strcmp(encodingName, "EUC-JP"))
+ encMbToWc = TextCodecsCE::euc_jp_mbtowc;
+ else if (!strcmp(encodingName, "CP874"))
+ encMbToWc = TextCodecsCE::cp874_mbtowc;
+ else if (!strcmp(encodingName, "TIS620"))
+ encMbToWc = TextCodecsCE::tis620_mbtowc;
+ else if (!strcmp(encodingName, "MACTHAI"))
+ encMbToWc = TextCodecsCE::mac_thai_mbtowc;
+
+ if (encMbToWc) {
+ const char* const srcStart = bytes;
+ const char* const srcEnd = bytes + length;
+ int lastSize = result.size();
+ result.resize(lastSize + length);
+ for (;;) {
+ UChar* dst = result.data() + lastSize;
+ const UChar* const dstEnd = result.data() + result.size();
+ for (; dst < dstEnd && bytes < srcEnd; ++dst) {
+ int numberEncoded = encMbToWc(dst, (const unsigned char*)bytes, srcEnd - bytes);
+ if (numberEncoded >= 0)
+ bytes += numberEncoded;
+ else {
+ if (numberEncoded == RET_ILSEQ)
+ sawInvalidChar = true;
+ break;
+ }
+ }
+ if (bytes == srcEnd || dst != dstEnd) {
+ *left = srcEnd - bytes;
+ result.resize(dst - result.data());
+ return;
+ }
+ lastSize = result.size();
+ result.resize(result.size() + 256);
+ }
+ } else {
+ *left = 0;
+ result.append(bytes, length);
+ return;
+ }
+ }
+ }
+
+ DWORD flags = getCodePageFlags(codePage);
+
+ if (codePage == CP_UTF8) {
+ if (canBeFirstTime) {
+ // Handle BOM.
+ if (length > 3) {
+ if (bytes[0] == (char)0xEF && bytes[1] == (char)0xBB && bytes[2] == (char)0xBF) {
+ // BOM found!
+ length -= 3;
+ bytes += 3;
+ *left = length;
+ }
+ } else if (bytes[0] == 0xEF && (length < 2 || bytes[1] == (char)0xBB) && (length < 3 || bytes[2] == (char)0xBF)) {
+ if (length == 3)
+ *left = 0;
+ return;
+ }
+ }
+
+ // Process ASCII characters at beginning.
+ const char* firstNonAsciiChar = findFirstNonAsciiCharacter(bytes, length);
+ int numAsciiCharacters = firstNonAsciiChar - bytes;
+ if (numAsciiCharacters) {
+ result.append(bytes, numAsciiCharacters);
+ length -= numAsciiCharacters;
+ if (!length) {
+ *left = 0;
+ return;
+ }
+ bytes = firstNonAsciiChar;
+ }
+
+ int oldSize = result.size();
+ result.resize(oldSize + length);
+ UChar* resultStart = result.data() + oldSize;
+ const char* sourceStart = bytes;
+ const char* const sourceEnd = bytes + length;
+ for (;;) {
+ using namespace WTF::Unicode;
+ ConversionResult convRes = convertUTF8ToUTF16(&sourceStart
+ , sourceEnd
+ , &resultStart
+ , result.data() + result.size()
+ , true);
+
+ // FIXME: is it possible?
+ if (convRes == targetExhausted && sourceStart < sourceEnd) {
+ oldSize = result.size();
+ result.resize(oldSize + 256);
+ resultStart = result.data() + oldSize;
+ continue;
+ }
+
+ if (convRes != conversionOK)
+ sawInvalidChar = true;
+
+ break;
+ }
+
+ *left = sourceEnd - sourceStart;
+ result.resize(resultStart - result.data());
+ } else {
+ int testLength = length;
+ int untestedLength = length;
+ for (;;) {
+ int resultLength = MultiByteToWideChar(codePage, flags, bytes, testLength, 0, 0);
+
+ if (resultLength > 0) {
+ int oldSize = result.size();
+ result.resize(oldSize + resultLength);
+
+ MultiByteToWideChar(codePage, flags, bytes, testLength, result.data() + oldSize, resultLength);
+
+ if (testLength == untestedLength) {
+ *left = length - testLength;
+ break;
+ }
+ untestedLength -= testLength;
+ length -= testLength;
+ bytes += testLength;
+ } else {
+ untestedLength = testLength - 1;
+ if (!untestedLength) {
+ *left = length;
+ break;
+ }
+ }
+ testLength = (untestedLength + 1) / 2;
+ }
+ }
+}
+
+String TextCodecWinCE::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
+{
+ if (!m_decodeBuffer.isEmpty()) {
+ m_decodeBuffer.append(bytes, length);
+ bytes = m_decodeBuffer.data();
+ length = m_decodeBuffer.size();
+ }
+
+ size_t left;
+ Vector<UChar, 8192> result;
+ for (;;) {
+ bool sawInvalidChar = false;
+ WebCore::decode(result, m_encoding.name(), bytes, length, &left, m_decodeBuffer.isEmpty(), sawInvalidChar);
+ if (!left)
+ break;
+
+ if (!sawInvalidChar && !flush && left < 16)
+ break;
+
+ result.append(L'?');
+ sawError = true;
+ if (stopOnError)
+ return String(result.data(), result.size());
+
+
+ if (left == 1)
+ break;
+
+ bytes += length - left + 1;
+ length = left - 1;
+ }
+ if (left && !flush) {
+ if (m_decodeBuffer.isEmpty())
+ m_decodeBuffer.append(bytes + length - left, left);
+ else {
+ memmove(m_decodeBuffer.data(), bytes + length - left, left);
+ m_decodeBuffer.resize(left);
+ }
+ } else
+ m_decodeBuffer.clear();
+ return String(result.data(), result.size());
+}
+
+CString TextCodecWinCE::encode(const UChar* characters, size_t length, UnencodableHandling)
+{
+ if (!characters || !length)
+ return CString();
+
+ UINT codePage = getCodePage(m_encoding.name());
+ DWORD flags = codePage == CP_UTF8 ? 0 : WC_COMPOSITECHECK;
+
+ int resultLength = WideCharToMultiByte(codePage, flags, characters, length, 0, 0, 0, 0);
+
+ // FIXME: We need to implement UnencodableHandling: QuestionMarksForUnencodables, EntitiesForUnencodables, and URLEncodedEntitiesForUnencodables.
+
+ if (resultLength <= 0)
+ return "?";
+
+ Vector<char> result(resultLength);
+
+ WideCharToMultiByte(codePage, flags, characters, length, result.data(), resultLength, 0, 0);
+
+ return CString(result.data(), result.size());
+}
+
+void TextCodecWinCE::enumerateSupportedEncodings(EncodingReceiver& receiver)
+{
+ languageManager();
+ for (CharsetSet::iterator i = supportedCharsets().begin(); i != supportedCharsets().end(); ++i) {
+ HashMap<String, CharsetInfo>::iterator j = knownCharsets().find(*i);
+ if (j != knownCharsets().end() && !receiver.receive(j->second.m_name.data(), j->second.m_friendlyName.charactersWithNullTermination(), j->second.m_codePage))
+ break;
+ }
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/js/JSWorkerConstructor.h b/WebCore/platform/text/wince/TextCodecWinCE.h
index c845fa6..a870d3e 100644
--- a/WebCore/bindings/js/JSWorkerConstructor.h
+++ b/WebCore/platform/text/wince/TextCodecWinCE.h
@@ -1,5 +1,7 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006 Alexey Proskuryakov <ap@nypop.com>
+ * Copyright (C) 2007-2009 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,29 +25,47 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef JSWorkerConstructor_h
-#define JSWorkerConstructor_h
+#ifndef TextCodecWinCE_h
+#define TextCodecWinCE_h
-#if ENABLE(WORKERS)
-
-#include "JSDOMBinding.h"
+#include "PlatformString.h"
+#include "TextCodec.h"
+#include "TextEncoding.h"
+#include <wtf/Vector.h>
namespace WebCore {
- class JSWorkerConstructor : public DOMConstructorObject {
- public:
- JSWorkerConstructor(JSC::ExecState*, JSDOMGlobalObject*);
+class TextCodecWinCE : public TextCodec {
+public:
+ static void registerBaseEncodingNames(EncodingNameRegistrar);
+ static void registerBaseCodecs(TextCodecRegistrar);
+
+ static void registerExtendedEncodingNames(EncodingNameRegistrar);
+ static void registerExtendedCodecs(TextCodecRegistrar);
- static const JSC::ClassInfo s_info;
+ TextCodecWinCE(const TextEncoding&);
+ virtual ~TextCodecWinCE();
- private:
- virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
+ virtual String decode(const char*, size_t length, bool flush, bool stopOnError, bool& sawError);
+ virtual CString encode(const UChar*, size_t length, UnencodableHandling);
- virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
+ struct EncodingInfo {
+ String m_encoding;
+ String m_friendlyName;
};
-} // namespace WebCore
+ struct EncodingReceiver {
+ // Return false to stop enumerating.
+ virtual bool receive(const char* encoding, const wchar_t* friendlyName, unsigned int codePage) = 0;
+ };
-#endif // ENABLE(WORKERS)
+ static void enumerateSupportedEncodings(EncodingReceiver& receiver);
+
+private:
+ TextEncoding m_encoding;
+ Vector<char> m_decodeBuffer;
+};
+
+} // namespace WebCore
-#endif // JSWorkerConstructor_h
+#endif // TextCodecWinCE_h
diff --git a/WebCore/platform/win/PlatformScrollBar.h b/WebCore/platform/win/PlatformScrollBar.h
index c84616a..89c6e4a 100644
--- a/WebCore/platform/win/PlatformScrollBar.h
+++ b/WebCore/platform/win/PlatformScrollBar.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PlatformScrollbar_h
-#define PlatformScrollbar_h
+#ifndef PlatformScrollBar_h
+#define PlatformScrollBar_h
#include "Scrollbar.h"
#include "Timer.h"
@@ -46,5 +46,5 @@ public:
}
-#endif // PlatformScrollbar_h
+#endif // PlatformScrollBar_h
diff --git a/WebCore/plugins/MimeType.cpp b/WebCore/plugins/MimeType.cpp
index 247e7a4..5faeb5f 100644
--- a/WebCore/plugins/MimeType.cpp
+++ b/WebCore/plugins/MimeType.cpp
@@ -25,6 +25,7 @@
#include "Plugin.h"
#include "PluginData.h"
#include "Settings.h"
+#include "StringBuilder.h"
namespace WebCore {
@@ -43,9 +44,17 @@ const String &MimeType::type() const
return mimeClassInfo().type;
}
-const String &MimeType::suffixes() const
+String MimeType::suffixes() const
{
- return mimeClassInfo().suffixes;
+ const Vector<String>& extensions = mimeClassInfo().extensions;
+
+ StringBuilder builder;
+ for (size_t i = 0; i < extensions.size(); ++i) {
+ if (i)
+ builder.append(',');
+ builder.append(extensions[i]);
+ }
+ return builder.toString();
}
const String &MimeType::description() const
@@ -56,10 +65,10 @@ const String &MimeType::description() const
PassRefPtr<Plugin> MimeType::enabledPlugin() const
{
const Page* p = m_pluginData->page();
- if (!p || !p->mainFrame()->loader()->allowPlugins(NotAboutToInstantiatePlugin))
+ if (!p || !p->mainFrame()->loader()->subframeLoader()->allowPlugins(NotAboutToInstantiatePlugin))
return 0;
- return Plugin::create(m_pluginData.get(), mimeClassInfo().pluginIndex);
+ return Plugin::create(m_pluginData.get(), m_pluginData->mimePluginIndices()[m_index]);
}
} // namespace WebCore
diff --git a/WebCore/plugins/MimeType.h b/WebCore/plugins/MimeType.h
index 33a7fa0..c91e0a3 100644
--- a/WebCore/plugins/MimeType.h
+++ b/WebCore/plugins/MimeType.h
@@ -37,7 +37,7 @@ namespace WebCore {
~MimeType();
const String &type() const;
- const String &suffixes() const;
+ String suffixes() const;
const String &description() const;
PassRefPtr<Plugin> enabledPlugin() const;
diff --git a/WebCore/plugins/Plugin.cpp b/WebCore/plugins/Plugin.cpp
index 765478d..dcbf3f1 100644
--- a/WebCore/plugins/Plugin.cpp
+++ b/WebCore/plugins/Plugin.cpp
@@ -64,7 +64,7 @@ PassRefPtr<MimeType> Plugin::item(unsigned index)
const Vector<MimeClassInfo>& mimes = m_pluginData->mimes();
for (unsigned i = 0; i < mimes.size(); ++i) {
- if (mimes[i] == mime)
+ if (mimes[i] == mime && m_pluginData->mimePluginIndices()[i] == m_index)
return MimeType::create(m_pluginData.get(), i).get();
}
return 0;
diff --git a/WebCore/plugins/PluginData.cpp b/WebCore/plugins/PluginData.cpp
index 7780cff..ff90747 100644
--- a/WebCore/plugins/PluginData.cpp
+++ b/WebCore/plugins/PluginData.cpp
@@ -24,6 +24,11 @@
#include "config.h"
#include "PluginData.h"
+#if USE(PLATFORM_STRATEGIES)
+#include "PlatformStrategies.h"
+#include "PluginStrategy.h"
+#endif
+
namespace WebCore {
PluginData::PluginData(const Page* page)
@@ -33,8 +38,10 @@ PluginData::PluginData(const Page* page)
for (unsigned i = 0; i < m_plugins.size(); ++i) {
const PluginInfo& plugin = m_plugins[i];
- for (unsigned j = 0; j < plugin.mimes.size(); ++j)
+ for (unsigned j = 0; j < plugin.mimes.size(); ++j) {
m_mimes.append(plugin.mimes[j]);
+ m_mimePluginIndices.append(i);
+ }
}
}
@@ -52,10 +59,24 @@ String PluginData::pluginNameForMimeType(const String& mimeType) const
const MimeClassInfo& info = m_mimes[i];
if (info.type == mimeType)
- return m_plugins[info.pluginIndex].name;
+ return m_plugins[m_mimePluginIndices[i]].name;
}
return String();
}
+#if USE(PLATFORM_STRATEGIES)
+void PluginData::refresh()
+{
+ platformStrategies()->pluginStrategy()->refreshPlugins();
+}
+
+void PluginData::initPlugins()
+{
+ ASSERT(m_plugins.isEmpty());
+
+ platformStrategies()->pluginStrategy()->getPluginInfo(m_plugins);
+}
+#endif
+
}
diff --git a/WebCore/plugins/PluginData.h b/WebCore/plugins/PluginData.h
index 1055afb..f4cc62f 100644
--- a/WebCore/plugins/PluginData.h
+++ b/WebCore/plugins/PluginData.h
@@ -32,13 +32,12 @@ struct PluginInfo;
struct MimeClassInfo {
String type;
String desc;
- String suffixes;
- unsigned pluginIndex;
+ Vector<String> extensions;
};
inline bool operator==(const MimeClassInfo& a, const MimeClassInfo& b)
{
- return a.type == b.type && a.desc == b.desc && a.suffixes == b.suffixes && a.pluginIndex == b.pluginIndex;
+ return a.type == b.type && a.desc == b.desc && a.extensions == b.extensions;
}
struct PluginInfo {
@@ -58,7 +57,8 @@ public:
const Vector<PluginInfo>& plugins() const { return m_plugins; }
const Vector<MimeClassInfo>& mimes() const { return m_mimes; }
-
+ const Vector<size_t>& mimePluginIndices() const { return m_mimePluginIndices; }
+
bool supportsMimeType(const String& mimeType) const;
String pluginNameForMimeType(const String& mimeType) const;
@@ -70,6 +70,8 @@ private:
Vector<PluginInfo> m_plugins;
Vector<MimeClassInfo> m_mimes;
+ Vector<size_t> m_mimePluginIndices;
+
const Page* m_page;
};
diff --git a/WebCore/plugins/PluginDatabase.h b/WebCore/plugins/PluginDatabase.h
index ed714aa..ea3559d 100644
--- a/WebCore/plugins/PluginDatabase.h
+++ b/WebCore/plugins/PluginDatabase.h
@@ -25,8 +25,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PluginDatabase_H
-#define PluginDatabase_H
+#ifndef PluginDatabase_h
+#define PluginDatabase_h
#include "PlatformString.h"
#include "PluginPackage.h"
diff --git a/WebCore/plugins/PluginPackage.h b/WebCore/plugins/PluginPackage.h
index 4fc9341..659f5ff 100644
--- a/WebCore/plugins/PluginPackage.h
+++ b/WebCore/plugins/PluginPackage.h
@@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PluginPackage_H
-#define PluginPackage_H
+#ifndef PluginPackage_h
+#define PluginPackage_h
#include "FileSystem.h"
#include "PlatformString.h"
diff --git a/WebCore/plugins/PluginStrategy.h b/WebCore/plugins/PluginStrategy.h
new file mode 100644
index 0000000..7e92196
--- /dev/null
+++ b/WebCore/plugins/PluginStrategy.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginStrategy_h
+#define PluginStrategy_h
+
+#if USE(PLATFORM_STRATEGIES)
+
+#include "PluginData.h"
+
+namespace WebCore {
+
+class PluginStrategy {
+public:
+ virtual void refreshPlugins() = 0;
+ virtual void getPluginInfo(Vector<PluginInfo>&) = 0;
+
+protected:
+ virtual ~PluginStrategy() { }
+};
+
+} // namespace WebCore
+
+#endif // USE(PLATFORM_STRATEGIES)
+
+#endif // PluginStrategy_h
diff --git a/WebCore/plugins/PluginStream.h b/WebCore/plugins/PluginStream.h
index b937ff0..f9f927e 100644
--- a/WebCore/plugins/PluginStream.h
+++ b/WebCore/plugins/PluginStream.h
@@ -24,8 +24,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef PluginStream_H
-#define PluginStream_H
+#ifndef PluginStream_h
+#define PluginStream_h
#include "FileSystem.h"
#include "KURL.h"
diff --git a/WebCore/plugins/PluginViewNone.cpp b/WebCore/plugins/PluginViewNone.cpp
index d7b03ca..a4cc358 100644
--- a/WebCore/plugins/PluginViewNone.cpp
+++ b/WebCore/plugins/PluginViewNone.cpp
@@ -120,28 +120,33 @@ void PluginView::restart()
{
}
-#if ENABLE(NETSCAPE_PLUGIN_API)
-void PluginView::keepAlive(NPP)
+#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
+void PluginView::handleFocusInEvent()
{
}
-#endif
-#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(EFL)
-void PluginView::privateBrowsingStateChanged(bool)
+void PluginView::handleFocusOutEvent()
{
}
+#endif
-void PluginView::setJavaScriptPaused(bool)
+// The functions below are for platforms that do not use PluginView for plugins
+// due to architectural differences. The plan is to eventually have all
+// ports using PluginView, but until then, if new functions like this are
+// added, please make sure they have the proper platform #ifs so that changes
+// do not break ports who compile both this file and PluginView.cpp.
+#if PLATFORM(MAC) || PLATFORM(CHROMIUM) || PLATFORM(EFL)
+#if ENABLE(NETSCAPE_PLUGIN_API)
+void PluginView::keepAlive(NPP)
{
}
#endif
-#if defined(XP_UNIX) && ENABLE(NETSCAPE_PLUGIN_API)
-void PluginView::handleFocusInEvent()
+void PluginView::privateBrowsingStateChanged(bool)
{
}
-void PluginView::handleFocusOutEvent()
+void PluginView::setJavaScriptPaused(bool)
{
}
#endif
diff --git a/WebCore/plugins/chromium/PluginDataChromium.cpp b/WebCore/plugins/chromium/PluginDataChromium.cpp
index a106bc0..378fccb 100644
--- a/WebCore/plugins/chromium/PluginDataChromium.cpp
+++ b/WebCore/plugins/chromium/PluginDataChromium.cpp
@@ -84,8 +84,7 @@ String getPluginMimeTypeFromExtension(const String& extension)
for (size_t i = 0; i < plugins.size(); ++i) {
for (size_t j = 0; j < plugins[i].mimes.size(); ++j) {
const MimeClassInfo& mime = plugins[i].mimes[j];
- Vector<String> extensions;
- mime.suffixes.split(",", extensions);
+ const Vector<String>& extensions = mime.extensions;
for (size_t k = 0; k < extensions.size(); ++k) {
if (extension == extensions[k])
return mime.type;
diff --git a/WebCore/plugins/gtk/PluginDataGtk.cpp b/WebCore/plugins/gtk/PluginDataGtk.cpp
index ca6584b..ae4d98b 100644
--- a/WebCore/plugins/gtk/PluginDataGtk.cpp
+++ b/WebCore/plugins/gtk/PluginDataGtk.cpp
@@ -47,17 +47,8 @@ void PluginData::initPlugins()
mime.type = it->first;
mime.desc = it->second;
- mime.pluginIndex = m_plugins.size();
+ mime.extensions = package->mimeToExtensions().get(mime.type);
- Vector<String> extensions = package->mimeToExtensions().get(mime.type);
-
- for (unsigned i = 0; i < extensions.size(); i++) {
- if (i > 0)
- mime.suffixes += ",";
-
- mime.suffixes += extensions[i];
- }
-
info.mimes.append(mime);
}
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index 400ba6f..dca7dad 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -39,6 +39,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "GraphicsContext.h"
+#include "GtkVersioning.h"
#include "HTMLNames.h"
#include "HTMLPlugInElement.h"
#include "HostWindow.h"
@@ -214,7 +215,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
GdkDrawable* gdkBackingStore = 0;
gint xoff = 0, yoff = 0;
- gdk_window_get_internal_paint_info(widget->window, &gdkBackingStore, &xoff, &yoff);
+ gdk_window_get_internal_paint_info(gtk_widget_get_window(widget), &gdkBackingStore, &xoff, &yoff);
GC gc = XDefaultGC(GDK_DISPLAY(), gdk_screen_get_number(gdk_screen_get_default()));
if (gdkBackingStore) {
@@ -348,7 +349,7 @@ void PluginView::initXEvent(XEvent* xEvent)
// but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify
// events; thus, this is right:
GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient();
- xEvent->xany.window = widget ? GDK_WINDOW_XWINDOW(widget->window) : 0;
+ xEvent->xany.window = widget ? GDK_WINDOW_XWINDOW(gtk_widget_get_window(widget)) : 0;
}
static void setXButtonEventSpecificFields(XEvent* xEvent, MouseEvent* event, const IntPoint& postZoomPos, Frame* parentFrame)
@@ -656,11 +657,13 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
case NPNVnetscapeWindow: {
#if defined(XP_UNIX)
void* w = reinterpret_cast<void*>(value);
- *((XID *)w) = GDK_WINDOW_XWINDOW(m_parentFrame->view()->hostWindow()->platformPageClient()->window);
+ GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient();
+ *((XID *)w) = GDK_WINDOW_XWINDOW(gtk_widget_get_window(widget));
#endif
#ifdef GDK_WINDOWING_WIN32
HGDIOBJ* w = reinterpret_cast<HGDIOBJ*>(value);
- *w = GDK_WINDOW_HWND(m_parentFrame->view()->hostWindow()->platformPageClient()->window);
+ GtkWidget* widget = m_parentFrame->view()->hostWindow()->platformPageClient();
+ *w = GDK_WINDOW_HWND(gtk_widget_get_window(widget));
#endif
*result = NPERR_NO_ERROR;
return true;
@@ -810,7 +813,7 @@ bool PluginView::platformStart()
g_signal_connect(platformPluginWidget(), "plug-added", G_CALLBACK(plugAddedCallback), this);
g_signal_connect(platformPluginWidget(), "plug-removed", G_CALLBACK(plugRemovedCallback), NULL);
} else
- setPlatformWidget(gtk_xtbin_new(pageClient->window, 0));
+ setPlatformWidget(gtk_xtbin_new(gtk_widget_get_window(pageClient), 0));
#else
setPlatformWidget(gtk_socket_new());
gtk_container_add(GTK_CONTAINER(pageClient), platformPluginWidget());
@@ -831,12 +834,14 @@ bool PluginView::platformStart()
m_npWindow.type = NPWindowTypeWindow;
#if defined(XP_UNIX)
if (m_needsXEmbed) {
- gtk_widget_realize(platformPluginWidget());
+ GtkWidget* widget = platformPluginWidget();
+ gtk_widget_realize(widget);
m_npWindow.window = (void*)gtk_socket_get_id(GTK_SOCKET(platformPluginWidget()));
- ws->display = GDK_WINDOW_XDISPLAY(platformPluginWidget()->window);
- ws->visual = GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(GDK_DRAWABLE(platformPluginWidget()->window)));
- ws->depth = gdk_drawable_get_visual(GDK_DRAWABLE(platformPluginWidget()->window))->depth;
- ws->colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(GDK_DRAWABLE(platformPluginWidget()->window)));
+ GdkWindow* window = gtk_widget_get_window(widget);
+ ws->display = GDK_WINDOW_XDISPLAY(window);
+ ws->visual = GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(GDK_DRAWABLE(window)));
+ ws->depth = gdk_visual_get_depth(gdk_drawable_get_visual(GDK_DRAWABLE(window)));
+ ws->colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(GDK_DRAWABLE(window)));
} else {
m_npWindow.window = (void*)GTK_XTBIN(platformPluginWidget())->xtwindow;
ws->display = GTK_XTBIN(platformPluginWidget())->xtdisplay;
@@ -846,7 +851,7 @@ bool PluginView::platformStart()
}
XFlush (ws->display);
#elif defined(GDK_WINDOWING_WIN32)
- m_npWindow.window = (void*)GDK_WINDOW_HWND(platformPluginWidget()->window);
+ m_npWindow.window = (void*)GDK_WINDOW_HWND(gtk_widget_get_window(platformPluginWidget()));
#endif
} else {
m_npWindow.type = NPWindowTypeDrawable;
@@ -856,14 +861,14 @@ bool PluginView::platformStart()
GdkScreen* gscreen = gdk_screen_get_default();
GdkVisual* gvisual = gdk_screen_get_system_visual(gscreen);
- if (gvisual->depth == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth)) {
+ if (gdk_visual_get_depth(gvisual) == 32 || !m_plugin->quirks().contains(PluginQuirkRequiresDefaultScreenDepth)) {
getVisualAndColormap(32, &m_visual, &m_colormap);
ws->depth = 32;
}
if (!m_visual) {
- getVisualAndColormap(gvisual->depth, &m_visual, &m_colormap);
- ws->depth = gvisual->depth;
+ getVisualAndColormap(gdk_visual_get_depth(gvisual), &m_visual, &m_colormap);
+ ws->depth = gdk_visual_get_depth(gvisual);
}
ws->display = GDK_DISPLAY();
diff --git a/WebCore/plugins/gtk/gtk2xtbin.c b/WebCore/plugins/gtk/gtk2xtbin.c
index 28388cf..b7fd3f0 100644
--- a/WebCore/plugins/gtk/gtk2xtbin.c
+++ b/WebCore/plugins/gtk/gtk2xtbin.c
@@ -271,6 +271,9 @@ gtk_xtbin_realize (GtkWidget *widget)
{
GtkXtBin *xtbin;
GtkAllocation allocation = { 0, 0, 200, 200 };
+#if GTK_CHECK_VERSION(2, 18, 0)
+ GtkAllocation widget_allocation;
+#endif
gint x, y, w, h, d; /* geometry of window */
#ifdef DEBUG_XTBIN
@@ -291,8 +294,14 @@ gtk_xtbin_realize (GtkWidget *widget)
printf("initial allocation %d %d %d %d\n", x, y, w, h);
#endif
+#if GTK_CHECK_VERSION(2, 18, 0)
+ gtk_widget_get_allocation(widget, &widget_allocation);
+ xtbin->width = widget_allocation.width;
+ xtbin->height = widget_allocation.height;
+#else
xtbin->width = widget->allocation.width;
xtbin->height = widget->allocation.height;
+#endif
/* use GtkSocket's realize */
(*GTK_WIDGET_CLASS(parent_class)->realize)(widget);
@@ -333,7 +342,7 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
xt_client_init(&(xtbin->xtclient),
GDK_VISUAL_XVISUAL(gdk_rgb_get_visual()),
GDK_COLORMAP_XCOLORMAP(gdk_rgb_get_colormap()),
- gdk_rgb_get_visual()->depth);
+ gdk_visual_get_depth(gdk_rgb_get_visual()));
if (!xtbin->xtclient.xtdisplay) {
/* If XtOpenDisplay failed, we can't go any further.
@@ -404,7 +413,7 @@ gtk_xtbin_set_position (GtkXtBin *xtbin,
xtbin->y = y;
if (gtk_widget_get_realized (GTK_WIDGET(xtbin)))
- gdk_window_move (GTK_WIDGET (xtbin)->window, x, y);
+ gdk_window_move (gtk_widget_get_window(GTK_WIDGET (xtbin)), x, y);
}
void
@@ -457,7 +466,7 @@ gtk_xtbin_unrealize (GtkWidget *object)
xtbin = GTK_XTBIN(object);
widget = GTK_WIDGET(object);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE);
+ gtk_widget_set_visible(widget, FALSE);
if (gtk_widget_get_realized (widget)) {
xt_client_unrealize(&(xtbin->xtclient));
}
diff --git a/WebCore/plugins/mac/PluginDataMac.mm b/WebCore/plugins/mac/PluginDataMac.mm
deleted file mode 100644
index dcdf22d..0000000
--- a/WebCore/plugins/mac/PluginDataMac.mm
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2004 Apple Computer, Inc. All rights reserved.
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "PluginData.h"
-
-#import "BlockExceptions.h"
-#import "Logging.h"
-#import "WebCoreViewFactory.h"
-
-namespace WebCore {
-
-void PluginData::initPlugins()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
-
- NSArray* plugins = [[WebCoreViewFactory sharedFactory] pluginsInfo];
- for (unsigned int i = 0; i < [plugins count]; ++i) {
- PluginInfo pluginInfo;
-
- id <WebCorePluginInfo> plugin = [plugins objectAtIndex:i];
-
- pluginInfo.name = [plugin name];
- pluginInfo.file = [plugin filename];
- pluginInfo.desc = [plugin pluginDescription];
-
- NSEnumerator* MIMETypeEnumerator = [plugin MIMETypeEnumerator];
- while (NSString* MIME = [MIMETypeEnumerator nextObject]) {
- MimeClassInfo mime;
-
- mime.type = String(MIME).lower();
- mime.suffixes = [[plugin extensionsForMIMEType:MIME] componentsJoinedByString:@","];
- mime.desc = [plugin descriptionForMIMEType:MIME];
- mime.pluginIndex = m_plugins.size();
-
- pluginInfo.mimes.append(mime);
- }
-
- m_plugins.append(pluginInfo);
- }
-
- END_BLOCK_OBJC_EXCEPTIONS;
-
- return;
-}
-
-void PluginData::refresh()
-{
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- [[WebCoreViewFactory sharedFactory] refreshPlugins];
- END_BLOCK_OBJC_EXCEPTIONS;
-}
-
-}
-
diff --git a/WebCore/plugins/qt/PluginContainerQt.h b/WebCore/plugins/qt/PluginContainerQt.h
index 624654c..3a2896d 100644
--- a/WebCore/plugins/qt/PluginContainerQt.h
+++ b/WebCore/plugins/qt/PluginContainerQt.h
@@ -16,8 +16,8 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#ifndef PluginContainerQt_H
-#define PluginContainerQt_H
+#ifndef PluginContainerQt_h
+#define PluginContainerQt_h
#include <QX11EmbedContainer>
@@ -60,4 +60,4 @@ namespace WebCore {
};
}
-#endif // PluginContainerQt_H
+#endif // PluginContainerQt_h
diff --git a/WebCore/plugins/qt/PluginDataQt.cpp b/WebCore/plugins/qt/PluginDataQt.cpp
index 8d4968b..3dc86d0 100644
--- a/WebCore/plugins/qt/PluginDataQt.cpp
+++ b/WebCore/plugins/qt/PluginDataQt.cpp
@@ -52,8 +52,8 @@ void PluginData::initPlugins()
MimeClassInfo mimeInfo;
mimeInfo.type = mimeType.name;
mimeInfo.desc = mimeType.description;
- mimeInfo.suffixes = mimeType.fileExtensions.join(QLatin1String("; "));
- mimeInfo.pluginIndex = m_plugins.size();
+ for (int k = 0; k < mimeType.fileExtensions.count(); ++k)
+ mimeInfo.extensions.append(mimeType.fileExtensions.at(k));
info.mimes.append(mimeInfo);
}
@@ -80,16 +80,7 @@ void PluginData::initPlugins()
mime.type = it->first;
mime.desc = it->second;
- mime.pluginIndex = m_plugins.size();
-
- Vector<String> extensions = package->mimeToExtensions().get(mime.type);
-
- for (unsigned i = 0; i < extensions.size(); i++) {
- if (i > 0)
- mime.suffixes += ",";
-
- mime.suffixes += extensions[i];
- }
+ mime.extensions = package->mimeToExtensions().get(mime.type);
info.mimes.append(mime);
}
diff --git a/WebCore/plugins/qt/PluginPackageQt.cpp b/WebCore/plugins/qt/PluginPackageQt.cpp
index 5694148..07149f3 100644
--- a/WebCore/plugins/qt/PluginPackageQt.cpp
+++ b/WebCore/plugins/qt/PluginPackageQt.cpp
@@ -35,6 +35,8 @@
namespace WebCore {
+typedef void gtkInitFunc(int *argc, char ***argv);
+
bool PluginPackage::fetchInfo()
{
if (!load())
@@ -109,6 +111,7 @@ bool PluginPackage::load()
NP_InitializeFuncPtr NP_Initialize;
NPError npErr;
+ gtkInitFunc* gtkInit;
NP_Initialize = (NP_InitializeFuncPtr)m_module->resolve("NP_Initialize");
m_NPP_Shutdown = (NPP_ShutdownProcPtr)m_module->resolve("NP_Shutdown");
@@ -127,6 +130,26 @@ bool PluginPackage::load()
m_browserFuncs.getvalue = staticPluginQuirkRequiresGtkToolKit_NPN_GetValue;
}
+ // WORKAROUND: Prevent gtk based plugin crashes such as BR# 40567 by
+ // explicitly forcing the initializing of Gtk, i.e. calling gtk_init,
+ // whenver the symbol is present in the plugin library loaded above.
+ // Note that this workaround is based on code from the NSPluginClass ctor
+ // in KDE's kdebase/apps/nsplugins/viewer/nsplugin.cpp file.
+ gtkInit = (gtkInitFunc*)m_module->resolve("gtk_init");
+ if (gtkInit) {
+ // Prevent gtk_init() from replacing the X error handlers, since the Gtk
+ // handlers abort when they receive an X error, thus killing the viewer.
+#ifdef Q_WS_X11
+ int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0);
+ int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0);
+#endif
+ gtkInit(0, 0);
+#ifdef Q_WS_X11
+ XSetErrorHandler(old_error_handler);
+ XSetIOErrorHandler(old_io_error_handler);
+#endif
+ }
+
#if defined(XP_UNIX)
npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs);
#else
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index ff52070..6a0fa39 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -60,6 +60,7 @@
#include "ScriptController.h"
#include "Settings.h"
#include "npruntime_impl.h"
+#include "qwebpage_p.h"
#include "runtime_root.h"
#include <QApplication>
@@ -121,12 +122,15 @@ void PluginView::updatePluginWidget()
// do not call setNPWindowIfNeeded immediately, will be called on paint()
m_hasPendingGeometryChange = true;
- // in order to move/resize the plugin window at the same time as the
+ // (i) in order to move/resize the plugin window at the same time as the
// rest of frame during e.g. scrolling, we set the window geometry
// in the paint() function, but as paint() isn't called when the
// plugin window is outside the frame which can be caused by a
// scroll, we need to move/resize immediately.
- if (!m_windowRect.intersects(frameView->frameRect()))
+ // (ii) if we are running layout tests from DRT, paint() won't ever get called
+ // so we need to call setNPWindowIfNeeded() if window geometry has changed
+ if (!m_windowRect.intersects(frameView->frameRect())
+ || (QWebPagePrivate::drtRun && platformPluginWidget() && (m_windowRect != oldWindowRect || m_clipRect != oldClipRect)))
setNPWindowIfNeeded();
// Make sure we get repainted afterwards. This is necessary for downward
diff --git a/WebCore/plugins/symbian/npinterface.h b/WebCore/plugins/symbian/npinterface.h
index 0f0b6ca..e296127 100644
--- a/WebCore/plugins/symbian/npinterface.h
+++ b/WebCore/plugins/symbian/npinterface.h
@@ -16,8 +16,8 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#ifndef npinterface_H
-#define npinterface_H
+#ifndef npinterface_h
+#define npinterface_h
#include "npfunctions.h"
#include <QtPlugin>
@@ -34,4 +34,4 @@ QT_BEGIN_NAMESPACE
Q_DECLARE_INTERFACE(NPInterface, "com.nokia.qts60.webplugin/1.0");
QT_END_NAMESPACE
-#endif // npinterface_H
+#endif // npinterface_h
diff --git a/WebCore/plugins/win/PluginDataWin.cpp b/WebCore/plugins/win/PluginDataWin.cpp
index 59bd40b..41fe073 100644
--- a/WebCore/plugins/win/PluginDataWin.cpp
+++ b/WebCore/plugins/win/PluginDataWin.cpp
@@ -46,16 +46,7 @@ void PluginData::initPlugins()
mime.type = it->first;
mime.desc = it->second;
- mime.pluginIndex = m_plugins.size();
-
- Vector<String> extensions = package->mimeToExtensions().get(mime.type);
-
- for (unsigned i = 0; i < extensions.size(); i++) {
- if (i > 0)
- mime.suffixes += ",";
-
- mime.suffixes += extensions[i];
- }
+ mime.extensions = package->mimeToExtensions().get(mime.type);
info.mimes.append(mime);
}
diff --git a/WebCore/plugins/wx/PluginDataWx.cpp b/WebCore/plugins/wx/PluginDataWx.cpp
index 747c11a..a595c82 100644
--- a/WebCore/plugins/wx/PluginDataWx.cpp
+++ b/WebCore/plugins/wx/PluginDataWx.cpp
@@ -53,17 +53,8 @@ void PluginData::initPlugins()
mime.type = it->first;
mime.desc = it->second;
- mime.pluginIndex = m_plugins.size();
+ mime.extensions = package->mimeToExtensions().get(mime.type);
- Vector<String> extensions = package->mimeToExtensions().get(mime.type);
-
- for (unsigned i = 0; i < extensions.size(); i++) {
- if (i > 0)
- mime.suffixes += ",";
-
- mime.suffixes += extensions[i];
- }
-
info.mimes.append(mime);
}
diff --git a/WebCore/rendering/BidiRun.h b/WebCore/rendering/BidiRun.h
index 542081a..5dbb07b 100644
--- a/WebCore/rendering/BidiRun.h
+++ b/WebCore/rendering/BidiRun.h
@@ -38,6 +38,7 @@ struct BidiRun : BidiCharacterRun {
: BidiCharacterRun(start, stop, context, dir)
, m_object(object)
, m_box(0)
+ , m_hasHyphen(false)
{
}
@@ -58,6 +59,7 @@ private:
public:
RenderObject* m_object;
InlineBox* m_box;
+ bool m_hasHyphen;
};
}
diff --git a/WebCore/rendering/InlineBox.h b/WebCore/rendering/InlineBox.h
index e165f0c..eec9c1b 100644
--- a/WebCore/rendering/InlineBox.h
+++ b/WebCore/rendering/InlineBox.h
@@ -53,7 +53,7 @@ public:
#endif
, m_endsWithBreak(false)
, m_hasSelectedChildren(false)
- , m_hasEllipsisBox(false)
+ , m_hasEllipsisBoxOrHyphen(false)
, m_dirOverride(false)
, m_isText(false)
, m_determinedIfNextOnLineExists(false)
@@ -86,7 +86,7 @@ public:
#endif
, m_endsWithBreak(false)
, m_hasSelectedChildren(false)
- , m_hasEllipsisBox(false)
+ , m_hasEllipsisBoxOrHyphen(false)
, m_dirOverride(false)
, m_isText(false)
, m_determinedIfNextOnLineExists(false)
@@ -133,18 +133,28 @@ public:
bool isText() const { return m_isText; }
void setIsText(bool b) { m_isText = b; }
- virtual bool isInlineBox() { return false; }
virtual bool isInlineFlowBox() const { return false; }
- virtual bool isInlineTextBox() { return false; }
+ virtual bool isInlineTextBox() const { return false; }
virtual bool isRootInlineBox() const { return false; }
-#if ENABLE(SVG)
- virtual bool isSVGRootInlineBox() { return false; }
+#if ENABLE(SVG)
+ virtual bool isSVGInlineTextBox() const { return false; }
+ virtual bool isSVGRootInlineBox() const { return false; }
bool hasVirtualHeight() const { return m_hasVirtualHeight; }
void setHasVirtualHeight() { m_hasVirtualHeight = true; }
- virtual int virtualHeight() const { ASSERT_NOT_REACHED(); return 0; }
+ virtual int virtualHeight() const
+ {
+ ASSERT_NOT_REACHED();
+ return 0;
+ }
#endif
-
+
+ virtual IntRect calculateBoundaries() const
+ {
+ ASSERT_NOT_REACHED();
+ return IntRect();
+ }
+
bool isConstructed() { return m_constructed; }
virtual void setConstructed()
{
@@ -274,7 +284,7 @@ protected:
// for RootInlineBox
bool m_endsWithBreak : 1; // Whether the line ends with a <br>.
bool m_hasSelectedChildren : 1; // Whether we have any children selected (this bit will also be set if the <br> that terminates our line is selected).
- bool m_hasEllipsisBox : 1;
+ bool m_hasEllipsisBoxOrHyphen : 1;
// for InlineTextBox
public:
diff --git a/WebCore/rendering/InlineFlowBox.h b/WebCore/rendering/InlineFlowBox.h
index e939fb4..b933c09 100644
--- a/WebCore/rendering/InlineFlowBox.h
+++ b/WebCore/rendering/InlineFlowBox.h
@@ -127,7 +127,7 @@ public:
void determineSpacingForFlowBoxes(bool lastLine, RenderObject* endObject);
int getFlowSpacingWidth();
bool onEndChain(RenderObject* endObject);
- virtual int placeBoxesHorizontally(int x, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
+ int placeBoxesHorizontally(int x, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
void computeLogicalBoxHeights(int& maxPositionTop, int& maxPositionBottom,
int& maxAscent, int& maxDescent, bool strictMode, GlyphOverflowAndFallbackFontsMap&);
void adjustMaxAscentAndDescent(int& maxAscent, int& maxDescent,
diff --git a/WebCore/rendering/InlineTextBox.cpp b/WebCore/rendering/InlineTextBox.cpp
index 2fc5823..09825b6 100644
--- a/WebCore/rendering/InlineTextBox.cpp
+++ b/WebCore/rendering/InlineTextBox.cpp
@@ -1,7 +1,7 @@
/*
* (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -103,6 +103,18 @@ RenderObject::SelectionState InlineTextBox::selectionState()
return state;
}
+typedef Vector<UChar, 256> BufferForAppendingHyphen;
+
+static void adjustCharactersAndLengthForHyphen(BufferForAppendingHyphen& charactersWithHyphen, RenderStyle* style, const UChar*& characters, int& length)
+{
+ const AtomicString& hyphenString = style->hyphenString();
+ charactersWithHyphen.reserveCapacity(length + hyphenString.length());
+ charactersWithHyphen.append(characters, length);
+ charactersWithHyphen.append(hyphenString.characters(), hyphenString.length());
+ characters = charactersWithHyphen.data();
+ length += hyphenString.length();
+}
+
IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
{
int sPos = max(startPos - m_start, 0);
@@ -114,9 +126,18 @@ IntRect InlineTextBox::selectionRect(int tx, int ty, int startPos, int endPos)
RenderText* textObj = textRenderer();
int selTop = selectionTop();
int selHeight = selectionHeight();
- const Font& f = textObj->style(m_firstLine)->font();
+ RenderStyle* styleToUse = textObj->style(m_firstLine);
+ const Font& f = styleToUse->font();
+
+ const UChar* characters = textObj->text()->characters() + m_start;
+ int len = m_len;
+ BufferForAppendingHyphen charactersWithHyphen;
+ if (ePos == len && hasHyphen()) {
+ adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, len);
+ ePos = len;
+ }
- IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(textObj->text()->characters() + m_start, m_len, textObj->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride),
+ IntRect r = enclosingIntRect(f.selectionRectForText(TextRun(characters, len, textObj->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride),
IntPoint(tx + m_x, ty + selTop), selHeight, sPos, ePos));
if (r.x() > tx + m_x + m_width)
r.setWidth(0);
@@ -476,16 +497,21 @@ void InlineTextBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
}
}
+ const UChar* characters = textRenderer()->text()->characters() + m_start;
+ int length = m_len;
+ BufferForAppendingHyphen charactersWithHyphen;
+ if (hasHyphen())
+ adjustCharactersAndLengthForHyphen(charactersWithHyphen, styleToUse, characters, length);
+
int baseline = renderer()->style(m_firstLine)->font().ascent();
IntPoint textOrigin(m_x + tx, m_y + ty + baseline);
- TextRun textRun(textRenderer()->text()->characters() + m_start, m_len, textRenderer()->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride || styleToUse->visuallyOrdered());
+ TextRun textRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd, direction() == RTL, m_dirOverride || styleToUse->visuallyOrdered());
int sPos = 0;
int ePos = 0;
if (paintSelectedTextOnly || paintSelectedTextSeparately)
selectionStartEnd(sPos, ePos);
- int length = m_len;
if (m_truncation != cNoTruncation) {
sPos = min<int>(sPos, m_truncation);
ePos = min<int>(ePos, m_truncation);
@@ -600,8 +626,16 @@ void InlineTextBox::paintSelection(GraphicsContext* context, int tx, int ty, Ren
// If the text is truncated, let the thing being painted in the truncation
// draw its own highlight.
int length = m_truncation != cNoTruncation ? m_truncation : m_len;
+ const UChar* characters = textRenderer()->text()->characters() + m_start;
+
+ BufferForAppendingHyphen charactersWithHyphen;
+ if (ePos == length && hasHyphen()) {
+ adjustCharactersAndLengthForHyphen(charactersWithHyphen, style, characters, length);
+ ePos = length;
+ }
+
context->clip(IntRect(m_x + tx, y + ty, m_width, h));
- context->drawHighlightForText(font, TextRun(textRenderer()->text()->characters() + m_start, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
+ context->drawHighlightForText(font, TextRun(characters, length, textRenderer()->allowTabs(), textPos(), m_toAdd,
direction() == RTL, m_dirOverride || style->visuallyOrdered()),
IntPoint(m_x + tx, y + ty), h, c, style->colorSpace(), sPos, ePos);
context->restore();
diff --git a/WebCore/rendering/InlineTextBox.h b/WebCore/rendering/InlineTextBox.h
index d03de85..2ef5ec9 100644
--- a/WebCore/rendering/InlineTextBox.h
+++ b/WebCore/rendering/InlineTextBox.h
@@ -65,16 +65,21 @@ public:
unsigned short truncation() { return m_truncation; }
+ bool hasHyphen() const { return m_hasEllipsisBoxOrHyphen; }
+ void setHasHyphen(bool hasHyphen) { m_hasEllipsisBoxOrHyphen = hasHyphen; }
+
private:
virtual int selectionTop();
virtual int selectionHeight();
public:
+ virtual IntRect calculateBoundaries() const { return IntRect(x(), y(), width(), height()); }
+
virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos);
bool isSelected(int startPos, int endPos) const;
- void selectionStartEnd(int& sPos, int& ePos);
+ virtual void selectionStartEnd(int& sPos, int& ePos);
-private:
+protected:
virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
@@ -99,7 +104,7 @@ public:
void setSpaceAdd(int add) { m_width -= m_toAdd; m_toAdd = add; m_width += m_toAdd; }
private:
- virtual bool isInlineTextBox() { return true; }
+ virtual bool isInlineTextBox() const { return true; }
public:
virtual int caretMinOffset() const;
diff --git a/WebCore/rendering/MediaControlElements.cpp b/WebCore/rendering/MediaControlElements.cpp
index 3413b02..383a8cf 100644
--- a/WebCore/rendering/MediaControlElements.cpp
+++ b/WebCore/rendering/MediaControlElements.cpp
@@ -70,7 +70,7 @@ inline MediaControlShadowRootElement::MediaControlShadowRootElement(HTMLMediaEle
PassRefPtr<MediaControlShadowRootElement> MediaControlShadowRootElement::create(HTMLMediaElement* mediaElement)
{
- RefPtr<MediaControlShadowRootElement> element = new MediaControlShadowRootElement(mediaElement);
+ RefPtr<MediaControlShadowRootElement> element = adoptRef(new MediaControlShadowRootElement(mediaElement));
RefPtr<RenderStyle> rootStyle = RenderStyle::create();
rootStyle->inheritFrom(mediaElement->renderer()->style());
@@ -130,7 +130,7 @@ MediaControlElement::MediaControlElement(HTMLMediaElement* mediaElement, PseudoI
PassRefPtr<MediaControlElement> MediaControlElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
{
- return new MediaControlElement(mediaElement, pseudoStyleId);
+ return adoptRef(new MediaControlElement(mediaElement, pseudoStyleId));
}
void MediaControlElement::attachToParent(Element* parent)
@@ -222,7 +222,7 @@ inline MediaControlTimelineContainerElement::MediaControlTimelineContainerElemen
PassRefPtr<MediaControlTimelineContainerElement> MediaControlTimelineContainerElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlTimelineContainerElement(mediaElement);
+ return adoptRef(new MediaControlTimelineContainerElement(mediaElement));
}
bool MediaControlTimelineContainerElement::rendererIsNeeded(RenderStyle* style)
@@ -252,7 +252,7 @@ inline MediaControlVolumeSliderContainerElement::MediaControlVolumeSliderContain
PassRefPtr<MediaControlVolumeSliderContainerElement> MediaControlVolumeSliderContainerElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlVolumeSliderContainerElement(mediaElement);
+ return adoptRef(new MediaControlVolumeSliderContainerElement(mediaElement));
}
PassRefPtr<RenderStyle> MediaControlVolumeSliderContainerElement::styleForElement()
@@ -298,7 +298,7 @@ inline MediaControlStatusDisplayElement::MediaControlStatusDisplayElement(HTMLMe
PassRefPtr<MediaControlStatusDisplayElement> MediaControlStatusDisplayElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlStatusDisplayElement(mediaElement);
+ return adoptRef(new MediaControlStatusDisplayElement(mediaElement));
}
void MediaControlStatusDisplayElement::update()
@@ -482,7 +482,7 @@ inline MediaControlMuteButtonElement::MediaControlMuteButtonElement(HTMLMediaEle
PassRefPtr<MediaControlMuteButtonElement> MediaControlMuteButtonElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlMuteButtonElement(mediaElement);
+ return adoptRef(new MediaControlMuteButtonElement(mediaElement));
}
void MediaControlMuteButtonElement::defaultEventHandler(Event* event)
@@ -508,7 +508,7 @@ inline MediaControlPlayButtonElement::MediaControlPlayButtonElement(HTMLMediaEle
PassRefPtr<MediaControlPlayButtonElement> MediaControlPlayButtonElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlPlayButtonElement(mediaElement);
+ return adoptRef(new MediaControlPlayButtonElement(mediaElement));
}
void MediaControlPlayButtonElement::defaultEventHandler(Event* event)
@@ -537,7 +537,7 @@ inline MediaControlSeekButtonElement::MediaControlSeekButtonElement(HTMLMediaEle
PassRefPtr<MediaControlSeekButtonElement> MediaControlSeekButtonElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
{
- return new MediaControlSeekButtonElement(mediaElement, pseudoStyleId);
+ return adoptRef(new MediaControlSeekButtonElement(mediaElement, pseudoStyleId));
}
inline bool MediaControlSeekButtonElement::isForwardButton() const
@@ -601,7 +601,7 @@ inline MediaControlRewindButtonElement::MediaControlRewindButtonElement(HTMLMedi
PassRefPtr<MediaControlRewindButtonElement> MediaControlRewindButtonElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlRewindButtonElement(mediaElement);
+ return adoptRef(new MediaControlRewindButtonElement(mediaElement));
}
void MediaControlRewindButtonElement::defaultEventHandler(Event* event)
@@ -623,7 +623,7 @@ inline MediaControlReturnToRealtimeButtonElement::MediaControlReturnToRealtimeBu
PassRefPtr<MediaControlReturnToRealtimeButtonElement> MediaControlReturnToRealtimeButtonElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlReturnToRealtimeButtonElement(mediaElement);
+ return adoptRef(new MediaControlReturnToRealtimeButtonElement(mediaElement));
}
void MediaControlReturnToRealtimeButtonElement::defaultEventHandler(Event* event)
@@ -645,7 +645,7 @@ inline MediaControlToggleClosedCaptionsButtonElement::MediaControlToggleClosedCa
PassRefPtr<MediaControlToggleClosedCaptionsButtonElement> MediaControlToggleClosedCaptionsButtonElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlToggleClosedCaptionsButtonElement(mediaElement);
+ return adoptRef(new MediaControlToggleClosedCaptionsButtonElement(mediaElement));
}
void MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler(Event* event)
@@ -672,7 +672,7 @@ MediaControlTimelineElement::MediaControlTimelineElement(HTMLMediaElement* media
PassRefPtr<MediaControlTimelineElement> MediaControlTimelineElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlTimelineElement(mediaElement);
+ return adoptRef(new MediaControlTimelineElement(mediaElement));
}
void MediaControlTimelineElement::defaultEventHandler(Event* event)
@@ -725,7 +725,7 @@ inline MediaControlVolumeSliderElement::MediaControlVolumeSliderElement(HTMLMedi
PassRefPtr<MediaControlVolumeSliderElement> MediaControlVolumeSliderElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlVolumeSliderElement(mediaElement);
+ return adoptRef(new MediaControlVolumeSliderElement(mediaElement));
}
void MediaControlVolumeSliderElement::defaultEventHandler(Event* event)
@@ -767,7 +767,7 @@ inline MediaControlFullscreenButtonElement::MediaControlFullscreenButtonElement(
PassRefPtr<MediaControlFullscreenButtonElement> MediaControlFullscreenButtonElement::create(HTMLMediaElement* mediaElement)
{
- return new MediaControlFullscreenButtonElement(mediaElement);
+ return adoptRef(new MediaControlFullscreenButtonElement(mediaElement));
}
void MediaControlFullscreenButtonElement::defaultEventHandler(Event* event)
@@ -790,7 +790,7 @@ inline MediaControlTimeDisplayElement::MediaControlTimeDisplayElement(HTMLMediaE
PassRefPtr<MediaControlTimeDisplayElement> MediaControlTimeDisplayElement::create(HTMLMediaElement* mediaElement, PseudoId pseudoStyleId)
{
- return new MediaControlTimeDisplayElement(mediaElement, pseudoStyleId);
+ return adoptRef(new MediaControlTimeDisplayElement(mediaElement, pseudoStyleId));
}
PassRefPtr<RenderStyle> MediaControlTimeDisplayElement::styleForElement()
diff --git a/WebCore/rendering/RenderApplet.cpp b/WebCore/rendering/RenderApplet.cpp
index a1689a5..12eb4fb 100644
--- a/WebCore/rendering/RenderApplet.cpp
+++ b/WebCore/rendering/RenderApplet.cpp
@@ -72,7 +72,7 @@ void RenderApplet::createWidgetIfNecessary()
Frame* frame = this->frame();
ASSERT(frame);
- setWidget(frame->loader()->createJavaAppletWidget(IntSize(contentWidth, contentHeight), element, m_args));
+ setWidget(frame->loader()->subframeLoader()->createJavaAppletWidget(IntSize(contentWidth, contentHeight), element, m_args));
}
void RenderApplet::layout()
diff --git a/WebCore/rendering/RenderBlock.h b/WebCore/rendering/RenderBlock.h
index 8c61e2c..e3a11c8 100644
--- a/WebCore/rendering/RenderBlock.h
+++ b/WebCore/rendering/RenderBlock.h
@@ -38,7 +38,7 @@ class RenderInline;
struct BidiRun;
template <class Iterator, class Run> class BidiResolver;
-template <class Iterator> class MidpointState;
+template <class Iterator> struct MidpointState;
typedef BidiResolver<InlineIterator, BidiRun> InlineBidiResolver;
typedef MidpointState<InlineIterator> LineMidpointState;
@@ -227,7 +227,19 @@ protected:
virtual bool hasLineIfEmpty() const;
bool layoutOnlyPositionedObjects();
-
+
+#if ENABLE(SVG)
+protected:
+
+ // Only used by RenderSVGText, which explicitely overrides RenderBlock::layoutBlock(), do NOT use for anything else.
+ void forceLayoutInlineChildren()
+ {
+ int repaintTop = 0;
+ int repaintBottom = 0;
+ layoutInlineChildren(true, repaintTop, repaintBottom);
+ }
+#endif
+
private:
virtual RenderObjectChildList* virtualChildren() { return children(); }
virtual const RenderObjectChildList* virtualChildren() const { return children(); }
@@ -295,7 +307,7 @@ private:
void skipTrailingWhitespace(InlineIterator&, bool isLineEmpty, bool previousLineBrokeCleanly);
int skipLeadingWhitespace(InlineBidiResolver&, bool firstLine, bool isLineEmpty, bool previousLineBrokeCleanly);
void fitBelowFloats(int widthToFit, bool firstLine, int& availableWidth);
- InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, EClear* clear = 0);
+ InlineIterator findNextLineBreak(InlineBidiResolver&, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly, bool& hyphenated, EClear* = 0);
RootInlineBox* constructLine(unsigned runCount, BidiRun* firstRun, BidiRun* lastRun, bool firstLine, bool lastLine, RenderObject* endObject);
InlineFlowBox* createLineBoxes(RenderObject*, bool firstLine);
void computeHorizontalPositionsForLine(RootInlineBox*, bool firstLine, BidiRun* firstRun, BidiRun* trailingSpaceRun, bool reachedEnd, GlyphOverflowAndFallbackFontsMap&);
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp
index be7c76b..097b661 100644
--- a/WebCore/rendering/RenderBlockLineLayout.cpp
+++ b/WebCore/rendering/RenderBlockLineLayout.cpp
@@ -24,6 +24,7 @@
#include "BidiResolver.h"
#include "CharacterNames.h"
+#include "Hyphenation.h"
#include "InlineIterator.h"
#include "InlineTextBox.h"
#include "Logging.h"
@@ -46,6 +47,10 @@
#include "HTMLNames.h"
#endif // ANDROID_LAYOUT
+#if ENABLE(SVG)
+#include "SVGRootInlineBox.h"
+#endif
+
using namespace std;
using namespace WTF;
using namespace Unicode;
@@ -298,6 +303,8 @@ RootInlineBox* RenderBlock::constructLine(unsigned runCount, BidiRun* firstRun,
text->setStart(r->m_start);
text->setLen(r->m_stop - r->m_start);
text->m_dirOverride = r->dirOverride(visuallyOrdered);
+ if (r->m_hasHyphen)
+ text->setHasHyphen(true);
}
}
@@ -351,22 +358,19 @@ void RenderBlock::computeHorizontalPositionsForLine(RootInlineBox* lineBox, bool
}
HashSet<const SimpleFontData*> fallbackFonts;
GlyphOverflow glyphOverflow;
- r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow));
- if (!fallbackFonts.isEmpty()
-#if ENABLE(SVG)
- && !isSVGText()
-#endif
- ) {
+ int hyphenWidth = 0;
+ if (static_cast<InlineTextBox*>(r->m_box)->hasHyphen()) {
+ const AtomicString& hyphenString = rt->style()->hyphenString();
+ hyphenWidth = rt->style(firstLine)->font().width(TextRun(hyphenString.characters(), hyphenString.length()));
+ }
+ r->m_box->setWidth(rt->width(r->m_start, r->m_stop - r->m_start, totWidth, firstLine, &fallbackFonts, &glyphOverflow) + hyphenWidth);
+ if (!fallbackFonts.isEmpty()) {
ASSERT(r->m_box->isText());
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(static_cast<InlineTextBox*>(r->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())).first;
ASSERT(it->second.first.isEmpty());
copyToVector(fallbackFonts, it->second.first);
}
- if ((glyphOverflow.top || glyphOverflow.bottom || glyphOverflow.left || glyphOverflow.right)
-#if ENABLE(SVG)
- && !isSVGText()
-#endif
- ) {
+ if ((glyphOverflow.top || glyphOverflow.bottom || glyphOverflow.left || glyphOverflow.right)) {
ASSERT(r->m_box->isText());
GlyphOverflowAndFallbackFontsMap::iterator it = textBoxDataMap.add(static_cast<InlineTextBox*>(r->m_box), make_pair(Vector<const SimpleFontData*>(), GlyphOverflow())).first;
it->second.second = glyphOverflow;
@@ -795,7 +799,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
isLineEmpty = true;
EClear clear = CNONE;
- end = findNextLineBreak(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, &clear);
+ bool hyphenated;
+ end = findNextLineBreak(resolver, firstLine, isLineEmpty, previousLineBrokeCleanly, hyphenated, &clear);
if (resolver.position().atEnd()) {
resolver.deleteRuns();
checkForFloatsFromLastLine = true;
@@ -861,20 +866,37 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintTop, i
RootInlineBox* lineBox = 0;
if (resolver.runCount()) {
+ if (hyphenated)
+ resolver.logicallyLastRun()->m_hasHyphen = true;
lineBox = constructLine(resolver.runCount(), resolver.firstRun(), resolver.lastRun(), firstLine, !end.obj, end.obj && !end.pos ? end.obj : 0);
if (lineBox) {
lineBox->setEndsWithBreak(previousLineBrokeCleanly);
- // Now we position all of our text runs horizontally.
+#if ENABLE(SVG)
+ bool isSVGRootInlineBox = lineBox->isSVGRootInlineBox();
+#else
+ bool isSVGRootInlineBox = false;
+#endif
+
GlyphOverflowAndFallbackFontsMap textBoxDataMap;
- computeHorizontalPositionsForLine(lineBox, firstLine, resolver.firstRun(), trailingSpaceRun, end.atEnd(), textBoxDataMap);
+
+ // Now we position all of our text runs horizontally.
+ if (!isSVGRootInlineBox)
+ computeHorizontalPositionsForLine(lineBox, firstLine, resolver.firstRun(), trailingSpaceRun, end.atEnd(), textBoxDataMap);
// Now position our text runs vertically.
computeVerticalPositionsForLine(lineBox, resolver.firstRun(), textBoxDataMap);
#if ENABLE(SVG)
- // Special SVG text layout code
- lineBox->computePerCharacterLayoutInformation();
+ // SVG text layout code computes vertical & horizontal positions on its own.
+ // Note that we still need to execute computeVerticalPositionsForLine() as
+ // it calls InlineTextBox::positionLineBox(), which tracks whether the box
+ // contains reversed text or not. If we wouldn't do that editing and thus
+ // text selection in RTL boxes would not work as expected.
+ if (isSVGRootInlineBox) {
+ ASSERT(isSVGText());
+ static_cast<SVGRootInlineBox*>(lineBox)->computePerCharacterLayoutInformation();
+ }
#endif
#if PLATFORM(MAC)
@@ -1262,7 +1284,7 @@ static inline bool shouldCollapseWhiteSpace(const RenderStyle* style, bool isLin
static inline bool shouldPreserveNewline(RenderObject* object)
{
#if ENABLE(SVG)
- if (object->isSVGText())
+ if (object->isSVGInlineText())
return false;
#endif
@@ -1429,8 +1451,34 @@ static inline unsigned textWidth(RenderText* text, unsigned from, unsigned len,
return font.width(TextRun(text->characters() + from, len, !collapseWhiteSpace, xPos));
}
+static void tryHyphenating(RenderText* text, const Font& font, int lastSpace, int pos, int xPos, int availableWidth, bool isFixedPitch, bool collapseWhiteSpace, int lastSpaceWordSpacing, InlineIterator& lineBreak, int nextBreakable, bool& hyphenated)
+{
+ const AtomicString& hyphenString = text->style()->hyphenString();
+ int hyphenWidth = font.width(TextRun(hyphenString.characters(), hyphenString.length()));
+
+ unsigned prefixLength = font.offsetForPosition(TextRun(text->characters() + lastSpace, pos - lastSpace, !collapseWhiteSpace, xPos + lastSpaceWordSpacing), availableWidth - xPos - hyphenWidth - lastSpaceWordSpacing, false);
+ if (!prefixLength)
+ return;
+
+ prefixLength = 1 + lastHyphenLocation(text->characters() + lastSpace + 1, pos - lastSpace - 1, prefixLength - 1);
+ if (prefixLength <= 1)
+ return;
+
+#if !ASSERT_DISABLED
+ int prefixWidth = hyphenWidth + textWidth(text, lastSpace, prefixLength, font, xPos, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;
+ ASSERT(xPos + prefixWidth <= availableWidth);
+#else
+ UNUSED_PARAM(isFixedPitch);
+#endif
+
+ lineBreak.obj = text;
+ lineBreak.pos = lastSpace + prefixLength;
+ lineBreak.nextBreakablePosition = nextBreakable;
+ hyphenated = true;
+}
+
InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool firstLine, bool& isLineEmpty, bool& previousLineBrokeCleanly,
- EClear* clear)
+ bool& hyphenated, EClear* clear)
{
ASSERT(resolver.position().block == this);
@@ -1468,6 +1516,8 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
bool prevLineBrokeCleanly = previousLineBrokeCleanly;
previousLineBrokeCleanly = false;
+ hyphenated = false;
+
bool autoWrapWasEverTrueOnLine = false;
bool floatsFitOnLine = true;
@@ -1486,7 +1536,7 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
autoWrapWasEverTrueOnLine = autoWrapWasEverTrueOnLine || autoWrap;
#if ENABLE(SVG)
- bool preserveNewline = o->isSVGText() ? false : RenderStyle::preserveNewline(currWS);
+ bool preserveNewline = o->isSVGInlineText() ? false : RenderStyle::preserveNewline(currWS);
#else
bool preserveNewline = RenderStyle::preserveNewline(currWS);
#endif
@@ -1641,8 +1691,10 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
int len = strlen - pos;
const UChar* str = t->characters();
- const Font& f = t->style(firstLine)->font();
+ RenderStyle* style = t->style(firstLine);
+ const Font& f = style->font();
bool isFixedPitch = f.isFixedPitch();
+ bool canHyphenate = style->hyphens() == HyphensAuto;
int lastSpace = pos;
int wordSpacing = o->style()->wordSpacing();
@@ -1712,6 +1764,11 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
len--;
lastSpaceWordSpacing = 0;
lastSpace = pos; // Cheesy hack to prevent adding in widths of the run twice.
+ if (style->hyphens() == HyphensNone) {
+ // Prevent a line break at the soft hyphen by ensuring that betweenWords is false
+ // in the next iteration.
+ atStart = true;
+ }
continue;
}
@@ -1782,6 +1839,11 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
}
}
if (lineWasTooWide || w + tmpW > width) {
+ if (canHyphenate && w + tmpW > width) {
+ tryHyphenating(t, f, lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated);
+ if (hyphenated)
+ goto end;
+ }
if (lBreak.obj && shouldPreserveNewline(lBreak.obj) && lBreak.obj->isText() && toRenderText(lBreak.obj)->textLength() && !toRenderText(lBreak.obj)->isWordBreak() && toRenderText(lBreak.obj)->characters()[lBreak.pos] == '\n') {
if (!stoppedIgnoringSpaces && pos > 0) {
// We need to stop right before the newline and then start up again.
@@ -1887,9 +1949,15 @@ InlineIterator RenderBlock::findNextLineBreak(InlineBidiResolver& resolver, bool
}
// IMPORTANT: pos is > length here!
- if (!ignoringSpaces)
- tmpW += textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;
+ int additionalTmpW = ignoringSpaces ? 0 : textWidth(t, lastSpace, pos - lastSpace, f, w + tmpW, isFixedPitch, collapseWhiteSpace) + lastSpaceWordSpacing;
+ tmpW += additionalTmpW;
tmpW += inlineWidth(o, !appliedStartWidth, true);
+
+ if (canHyphenate && w + tmpW > width) {
+ tryHyphenating(t, f, lastSpace, pos, w + tmpW - additionalTmpW, width, isFixedPitch, collapseWhiteSpace, lastSpaceWordSpacing, lBreak, nextBreakable, hyphenated);
+ if (hyphenated)
+ goto end;
+ }
} else
ASSERT_NOT_REACHED();
diff --git a/WebCore/rendering/RenderBoxModelObject.cpp b/WebCore/rendering/RenderBoxModelObject.cpp
index 196e8c5..3f1b5ae 100644
--- a/WebCore/rendering/RenderBoxModelObject.cpp
+++ b/WebCore/rendering/RenderBoxModelObject.cpp
@@ -4,6 +4,7 @@
* (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
* (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
* Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -48,77 +49,57 @@ bool RenderBoxModelObject::s_layerWasSelfPainting = false;
static const double cInterpolationCutoff = 800. * 800.;
static const double cLowQualityTimeThreshold = 0.500; // 500 ms
-class RenderBoxModelScaleData : public Noncopyable {
-public:
- RenderBoxModelScaleData(RenderBoxModelObject* object, const IntSize& size, const AffineTransform& transform, double time, bool lowQualityScale)
- : m_size(size)
- , m_transform(transform)
- , m_lastPaintTime(time)
- , m_lowQualityScale(lowQualityScale)
- , m_highQualityRepaintTimer(object, &RenderBoxModelObject::highQualityRepaintTimerFired)
- {
- }
+typedef HashMap<RenderBoxModelObject*, IntSize> LastPaintSizeMap;
- ~RenderBoxModelScaleData()
- {
- m_highQualityRepaintTimer.stop();
- }
-
- Timer<RenderBoxModelObject>& hiqhQualityRepaintTimer() { return m_highQualityRepaintTimer; }
-
- const IntSize& size() const { return m_size; }
- void setSize(const IntSize& s) { m_size = s; }
- double lastPaintTime() const { return m_lastPaintTime; }
- void setLastPaintTime(double t) { m_lastPaintTime = t; }
- bool useLowQualityScale() const { return m_lowQualityScale; }
- const AffineTransform& transform() const { return m_transform; }
- void setTransform(const AffineTransform& transform) { m_transform = transform; }
- void setUseLowQualityScale(bool b)
- {
- m_highQualityRepaintTimer.stop();
- m_lowQualityScale = b;
- if (b)
- m_highQualityRepaintTimer.startOneShot(cLowQualityTimeThreshold);
- }
+class ImageQualityController : public Noncopyable {
+public:
+ ImageQualityController();
+ bool shouldPaintAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const IntSize&);
+ void objectDestroyed(RenderBoxModelObject*);
private:
- IntSize m_size;
- AffineTransform m_transform;
- double m_lastPaintTime;
- bool m_lowQualityScale;
- Timer<RenderBoxModelObject> m_highQualityRepaintTimer;
+ void highQualityRepaintTimerFired(Timer<ImageQualityController>*);
+ void restartTimer();
+
+ LastPaintSizeMap m_lastPaintSizeMap;
+ Timer<ImageQualityController> m_timer;
+ bool m_animatedResizeIsActive;
};
-class RenderBoxModelScaleObserver {
-public:
- static bool shouldPaintBackgroundAtLowQuality(GraphicsContext*, RenderBoxModelObject*, Image*, const IntSize&);
-
- static void boxModelObjectDestroyed(RenderBoxModelObject* object)
- {
- if (gBoxModelObjects) {
- RenderBoxModelScaleData* data = gBoxModelObjects->take(object);
- delete data;
- if (!gBoxModelObjects->size()) {
- delete gBoxModelObjects;
- gBoxModelObjects = 0;
- }
- }
- }
+ImageQualityController::ImageQualityController()
+ : m_timer(this, &ImageQualityController::highQualityRepaintTimerFired)
+ , m_animatedResizeIsActive(false)
+{
+}
- static void highQualityRepaintTimerFired(RenderBoxModelObject* object)
- {
- RenderBoxModelScaleObserver::boxModelObjectDestroyed(object);
- object->repaint();
+void ImageQualityController::objectDestroyed(RenderBoxModelObject* object)
+{
+ m_lastPaintSizeMap.remove(object);
+ if (m_lastPaintSizeMap.isEmpty()) {
+ m_animatedResizeIsActive = false;
+ m_timer.stop();
+ }
+}
+
+void ImageQualityController::highQualityRepaintTimerFired(Timer<ImageQualityController>*)
+{
+ if (m_animatedResizeIsActive) {
+ m_animatedResizeIsActive = false;
+ for (LastPaintSizeMap::iterator it = m_lastPaintSizeMap.begin(); it != m_lastPaintSizeMap.end(); ++it)
+ it->first->repaint();
}
+}
- static HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>* gBoxModelObjects;
-};
+void ImageQualityController::restartTimer()
+{
+ m_timer.startOneShot(cLowQualityTimeThreshold);
+}
-bool RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(GraphicsContext* context, RenderBoxModelObject* object, Image* image, const IntSize& size)
+bool ImageQualityController::shouldPaintAtLowQuality(GraphicsContext* context, RenderBoxModelObject* object, Image* image, const IntSize& size)
{
// If the image is not a bitmap image, then none of this is relevant and we just paint at high
// quality.
- if (!image || !image->isBitmapImage())
+ if (!image || !image->isBitmapImage() || context->paintingDisabled())
return false;
// Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image
@@ -126,59 +107,57 @@ bool RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(GraphicsCont
IntSize imageSize(image->width(), image->height());
// Look ourselves up in the hashtable.
- RenderBoxModelScaleData* data = 0;
- if (gBoxModelObjects)
- data = gBoxModelObjects->get(object);
+ LastPaintSizeMap::iterator i = m_lastPaintSizeMap.find(object);
const AffineTransform& currentTransform = context->getCTM();
bool contextIsScaled = !currentTransform.isIdentityOrTranslationOrFlipped();
if (!contextIsScaled && imageSize == size) {
- // There is no scale in effect. If we had a scale in effect before, we can just delete this data.
- if (data) {
- gBoxModelObjects->remove(object);
- delete data;
- }
+ // There is no scale in effect. If we had a scale in effect before, we can just remove this object from the list.
+ if (i != m_lastPaintSizeMap.end())
+ m_lastPaintSizeMap.remove(object);
+
return false;
}
- // There is no need to hash scaled images that always use low quality mode when the page demands it. This is the iChat case.
+ // There is no need to hash scaled images that always use low quality mode when the page demands it. This is the iChat case.
if (object->document()->page()->inLowQualityImageInterpolationMode()) {
double totalPixels = static_cast<double>(image->width()) * static_cast<double>(image->height());
if (totalPixels > cInterpolationCutoff)
return true;
}
-
- // If there is no data yet, we will paint the first scale at high quality and record the paint time in case a second scale happens
- // very soon.
- if (!data) {
- data = new RenderBoxModelScaleData(object, size, currentTransform, currentTime(), false);
- if (!gBoxModelObjects)
- gBoxModelObjects = new HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>;
- gBoxModelObjects->set(object, data);
+ // If an animated resize is active, paint in low quality and kick the timer ahead.
+ if (m_animatedResizeIsActive) {
+ m_lastPaintSizeMap.set(object, size);
+ restartTimer();
+ return true;
+ }
+ // If this is the first time resizing this image, or its size is the
+ // same as the last resize, draw at high res, but record the paint
+ // size and set the timer.
+ if (i == m_lastPaintSizeMap.end() || size == i->second) {
+ restartTimer();
+ m_lastPaintSizeMap.set(object, size);
return false;
}
-
- const AffineTransform& tr = data->transform();
- bool scaleUnchanged = tr.a() == currentTransform.a() && tr.b() == currentTransform.b() && tr.c() == currentTransform.c() && tr.d() == currentTransform.d();
- // We are scaled, but we painted already at this size, so just keep using whatever mode we last painted with.
- if ((!contextIsScaled || scaleUnchanged) && data->size() == size)
- return data->useLowQualityScale();
-
- // We have data and our size just changed. If this change happened quickly, go into low quality mode and then set a repaint
- // timer to paint in high quality mode. Otherwise it is ok to just paint in high quality mode.
- double newTime = currentTime();
- data->setUseLowQualityScale(newTime - data->lastPaintTime() < cLowQualityTimeThreshold);
- data->setLastPaintTime(newTime);
- data->setTransform(currentTransform);
- data->setSize(size);
- return data->useLowQualityScale();
+ // If the timer is no longer active, draw at high quality and don't
+ // set the timer.
+ if (!m_timer.isActive()) {
+ objectDestroyed(object);
+ return false;
+ }
+ // This object has been resized to two different sizes while the timer
+ // is active, so draw at low quality, set the flag for animated resizes and
+ // the object to the list for high quality redraw.
+ m_lastPaintSizeMap.set(object, size);
+ m_animatedResizeIsActive = true;
+ restartTimer();
+ return true;
}
-HashMap<RenderBoxModelObject*, RenderBoxModelScaleData*>* RenderBoxModelScaleObserver::gBoxModelObjects = 0;
-
-void RenderBoxModelObject::highQualityRepaintTimerFired(Timer<RenderBoxModelObject>*)
+static ImageQualityController* imageQualityController()
{
- RenderBoxModelScaleObserver::highQualityRepaintTimerFired(this);
+ static ImageQualityController* controller = new ImageQualityController;
+ return controller;
}
void RenderBoxModelObject::setSelectionState(SelectionState s)
@@ -203,6 +182,10 @@ void RenderBoxModelObject::setSelectionState(SelectionState s)
cb->setSelectionState(s);
}
+bool RenderBoxModelObject::shouldPaintAtLowQuality(GraphicsContext* context, Image* image, const IntSize& size)
+{
+ return imageQualityController()->shouldPaintAtLowQuality(context, this, image, size);
+}
RenderBoxModelObject::RenderBoxModelObject(Node* node)
: RenderObject(node)
@@ -215,7 +198,7 @@ RenderBoxModelObject::~RenderBoxModelObject()
// Our layer should have been destroyed and cleared by now
ASSERT(!hasLayer());
ASSERT(!m_layer);
- RenderBoxModelScaleObserver::boxModelObjectDestroyed(this);
+ imageQualityController()->objectDestroyed(this);
}
void RenderBoxModelObject::destroyLayer()
@@ -464,7 +447,6 @@ int RenderBoxModelObject::paddingRight(bool) const
return padding.calcMinValue(w);
}
-
void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& c, const FillLayer* bgLayer, int tx, int ty, int w, int h, InlineFlowBox* box, CompositeOperator op, RenderObject* backgroundObject)
{
GraphicsContext* context = paintInfo.context;
@@ -631,7 +613,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
CompositeOperator compositeOp = op == CompositeSourceOver ? bgLayer->composite() : op;
RenderObject* clientForBackgroundImage = backgroundObject ? backgroundObject : this;
Image* image = bg->image(clientForBackgroundImage, tileSize);
- bool useLowQualityScaling = RenderBoxModelScaleObserver::shouldPaintBackgroundAtLowQuality(context, this, image, tileSize);
+ bool useLowQualityScaling = shouldPaintAtLowQuality(context, image, tileSize);
context->drawTiledImage(image, style()->colorSpace(), destRect, phase, tileSize, compositeOp, useLowQualityScaling);
}
}
diff --git a/WebCore/rendering/RenderBoxModelObject.h b/WebCore/rendering/RenderBoxModelObject.h
index dc2cf18..f022495 100644
--- a/WebCore/rendering/RenderBoxModelObject.h
+++ b/WebCore/rendering/RenderBoxModelObject.h
@@ -2,6 +2,7 @@
* Copyright (C) 1999 Lars Knoll (knoll@kde.org)
* (C) 1999 Antti Koivisto (koivisto@kde.org)
* Copyright (C) 2003, 2006, 2007, 2009 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -107,6 +108,8 @@ public:
protected:
void calculateBackgroundImageGeometry(const FillLayer*, int tx, int ty, int w, int h, IntRect& destRect, IntPoint& phase, IntSize& tileSize);
+ bool shouldPaintAtLowQuality(GraphicsContext*, Image*, const IntSize&);
+
private:
virtual bool isBoxModelObject() const { return true; }
diff --git a/WebCore/rendering/RenderEmbeddedObject.cpp b/WebCore/rendering/RenderEmbeddedObject.cpp
index 3d3278a..7ab12a1 100644
--- a/WebCore/rendering/RenderEmbeddedObject.cpp
+++ b/WebCore/rendering/RenderEmbeddedObject.cpp
@@ -165,7 +165,7 @@ void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
Vector<String> paramValues;
Frame* frame = frameView()->frame();
- // The calls to FrameLoader::requestObject within this function can result in a plug-in being initialized.
+ // The calls to SubframeLoader::requestObject within this function can result in a plug-in being initialized.
// This can run cause arbitrary JavaScript to run and may result in this RenderObject being detached from
// the render tree and destroyed, causing a crash like <rdar://problem/6954546>. By extending our lifetime
// artifically to ensure that we remain alive for the duration of plug-in initialization.
@@ -284,7 +284,16 @@ void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
return;
}
- bool success = objectElement->dispatchBeforeLoadEvent(url) && frame->loader()->requestObject(this, url, objectElement->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ bool beforeLoadAllowedLoad = objectElement->dispatchBeforeLoadEvent(url);
+
+ // beforeload events can modify the DOM, potentially causing
+ // RenderWidget::destroy() to be called. Ensure we haven't been
+ // destroyed before continuing.
+ if (!node())
+ return;
+
+ bool success = beforeLoadAllowedLoad && frame->loader()->subframeLoader()->requestObject(this, url, objectElement->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+
if (!success && m_hasFallbackContent)
objectElement->renderFallbackContent();
@@ -319,7 +328,7 @@ void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
}
if (embedElement->dispatchBeforeLoadEvent(url))
- frame->loader()->requestObject(this, url, embedElement->getAttribute(nameAttr), serviceType, paramNames, paramValues);
+ frame->loader()->subframeLoader()->requestObject(this, url, embedElement->getAttribute(nameAttr), serviceType, paramNames, paramValues);
}
#if ENABLE(PLUGIN_PROXY_FOR_VIDEO)
else if (node()->hasTagName(videoTag) || node()->hasTagName(audioTag)) {
@@ -328,7 +337,7 @@ void RenderEmbeddedObject::updateWidget(bool onlyCreateNonNetscapePlugins)
mediaElement->getPluginProxyParams(kurl, paramNames, paramValues);
mediaElement->setNeedWidgetUpdate(false);
- frame->loader()->loadMediaPlayerProxyPlugin(node(), kurl, paramNames, paramValues);
+ frame->loader()->subframeLoader()->loadMediaPlayerProxyPlugin(node(), kurl, paramNames, paramValues);
}
#endif
}
diff --git a/WebCore/rendering/RenderFileUploadControl.cpp b/WebCore/rendering/RenderFileUploadControl.cpp
index f42a657..c652276 100644
--- a/WebCore/rendering/RenderFileUploadControl.cpp
+++ b/WebCore/rendering/RenderFileUploadControl.cpp
@@ -53,7 +53,6 @@ const int buttonShadowHeight = 2;
RenderFileUploadControl::RenderFileUploadControl(HTMLInputElement* input)
: RenderBlock(input)
- , m_button(0)
{
FileList* list = input->files();
Vector<String> filenames;
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp
index 98b0f47..643fac9 100644
--- a/WebCore/rendering/RenderImage.cpp
+++ b/WebCore/rendering/RenderImage.cpp
@@ -5,6 +5,7 @@
* (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com)
* (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -56,133 +57,6 @@ using namespace std;
namespace WebCore {
-static const double cInterpolationCutoff = 800. * 800.;
-static const double cLowQualityTimeThreshold = 0.050; // 50 ms
-
-class RenderImageScaleData : public Noncopyable {
-public:
- RenderImageScaleData(RenderImage* image, const IntSize& size, double time, bool lowQualityScale)
- : m_size(size)
- , m_time(time)
- , m_lowQualityScale(lowQualityScale)
- , m_highQualityRepaintTimer(image, &RenderImage::highQualityRepaintTimerFired)
- {
- }
-
- ~RenderImageScaleData()
- {
- m_highQualityRepaintTimer.stop();
- }
-
- const IntSize& size() const { return m_size; }
- double time() const { return m_time; }
- bool useLowQualityScale() const { return m_lowQualityScale; }
- Timer<RenderImage>& hiqhQualityRepaintTimer() { return m_highQualityRepaintTimer; }
-
- void setSize(const IntSize& s) { m_size = s; }
- void setTime(double t) { m_time = t; }
- void setUseLowQualityScale(bool b)
- {
- m_highQualityRepaintTimer.stop();
- m_lowQualityScale = b;
- if (b)
- m_highQualityRepaintTimer.startOneShot(cLowQualityTimeThreshold);
- }
-
-private:
- IntSize m_size;
- double m_time;
- bool m_lowQualityScale;
- Timer<RenderImage> m_highQualityRepaintTimer;
-};
-
-class RenderImageScaleObserver {
-public:
- static bool shouldImagePaintAtLowQuality(RenderImage*, const IntSize&);
-
- static void imageDestroyed(RenderImage* image)
- {
- if (gImages) {
- RenderImageScaleData* data = gImages->take(image);
- delete data;
- if (gImages->size() == 0) {
- delete gImages;
- gImages = 0;
- }
- }
- }
-
- static void highQualityRepaintTimerFired(RenderImage* image)
- {
- RenderImageScaleObserver::imageDestroyed(image);
- image->repaint();
- }
-
- static HashMap<RenderImage*, RenderImageScaleData*>* gImages;
-};
-
-bool RenderImageScaleObserver::shouldImagePaintAtLowQuality(RenderImage* image, const IntSize& size)
-{
- // If the image is not a bitmap image, then none of this is relevant and we just paint at high
- // quality.
- if (!image->image() || !image->image()->isBitmapImage())
- return false;
-
- // Make sure to use the unzoomed image size, since if a full page zoom is in effect, the image
- // is actually being scaled.
- IntSize imageSize(image->image()->width(), image->image()->height());
-
- // Look ourselves up in the hashtable.
- RenderImageScaleData* data = 0;
- if (gImages)
- data = gImages->get(image);
-
- if (imageSize == size) {
- // There is no scale in effect. If we had a scale in effect before, we can just delete this data.
- if (data) {
- gImages->remove(image);
- delete data;
- }
- return false;
- }
-
- // There is no need to hash scaled images that always use low quality mode when the page demands it. This is the iChat case.
- if (image->document()->page()->inLowQualityImageInterpolationMode()) {
- double totalPixels = static_cast<double>(image->image()->width()) * static_cast<double>(image->image()->height());
- if (totalPixels > cInterpolationCutoff)
- return true;
- }
-
- // If there is no data yet, we will paint the first scale at high quality and record the paint time in case a second scale happens
- // very soon.
- if (!data) {
- data = new RenderImageScaleData(image, size, currentTime(), false);
- if (!gImages)
- gImages = new HashMap<RenderImage*, RenderImageScaleData*>;
- gImages->set(image, data);
- return false;
- }
-
- // We are scaled, but we painted already at this size, so just keep using whatever mode we last painted with.
- if (data->size() == size)
- return data->useLowQualityScale();
-
- // We have data and our size just changed. If this change happened quickly, go into low quality mode and then set a repaint
- // timer to paint in high quality mode. Otherwise it is ok to just paint in high quality mode.
- double newTime = currentTime();
- data->setUseLowQualityScale(newTime - data->time() < cLowQualityTimeThreshold);
- data->setTime(newTime);
- data->setSize(size);
- return data->useLowQualityScale();
-}
-
-HashMap<RenderImage*, RenderImageScaleData*>* RenderImageScaleObserver::gImages = 0;
-
-void RenderImage::highQualityRepaintTimerFired(Timer<RenderImage>*)
-{
- RenderImageScaleObserver::highQualityRepaintTimerFired(this);
-}
-
using namespace HTMLNames;
RenderImage::RenderImage(Node* node)
@@ -198,7 +72,6 @@ RenderImage::~RenderImage()
{
if (m_cachedImage)
m_cachedImage->removeClient(this);
- RenderImageScaleObserver::imageDestroyed(this);
}
void RenderImage::setCachedImage(CachedImage* newImage)
@@ -497,7 +370,7 @@ void RenderImage::paintIntoRect(GraphicsContext* context, const IntRect& rect)
HTMLImageElement* imageElt = (node() && node()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(node()) : 0;
CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
- bool useLowQualityScaling = RenderImageScaleObserver::shouldImagePaintAtLowQuality(this, rect.size());
+ bool useLowQualityScaling = shouldPaintAtLowQuality(context, this->image(), rect.size());
context->drawImage(image(rect.width(), rect.height()), style()->colorSpace(), rect, compositeOperator, useLowQualityScaling);
}
diff --git a/WebCore/rendering/RenderIndicator.cpp b/WebCore/rendering/RenderIndicator.cpp
new file mode 100644
index 0000000..afff9c2
--- /dev/null
+++ b/WebCore/rendering/RenderIndicator.cpp
@@ -0,0 +1,81 @@
+/*
+ * 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"
+
+#if ENABLE(PROGRESS_TAG) || ENABLE(METER_TAG)
+
+#include "RenderIndicator.h"
+
+#include "RenderTheme.h"
+
+using namespace std;
+
+namespace WebCore {
+
+RenderIndicator::RenderIndicator(Node* node)
+ : RenderBlock(node)
+{
+}
+
+RenderIndicator::~RenderIndicator()
+{
+}
+
+void RenderIndicator::layout()
+{
+ ASSERT(needsLayout());
+
+ LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+ calcWidth();
+ calcHeight();
+ layoutParts();
+ repainter.repaintAfterLayout();
+ setNeedsLayout(false);
+}
+
+void RenderIndicator::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
+{
+ RenderBlock::styleDidChange(diff, oldStyle);
+ requestLayoutForParts();
+}
+
+void RenderIndicator::updateFromElement()
+{
+ requestLayoutForParts();
+ repaint();
+}
+
+bool RenderIndicator::hasParts() const
+{
+ if (RenderObject* last = lastChild())
+ return last->isRenderBlock();
+ return false;
+}
+
+void RenderIndicator::requestLayoutForParts()
+{
+ if (shouldHaveParts() || hasParts())
+ setNeedsLayout(true);
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/WebCore/rendering/RenderIndicator.h b/WebCore/rendering/RenderIndicator.h
new file mode 100644
index 0000000..2d82a09
--- /dev/null
+++ b/WebCore/rendering/RenderIndicator.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef RenderIndicator_h
+#define RenderIndicator_h
+
+#if ENABLE(PROGRESS_TAG) || ENABLE(METER_TAG)
+#include "RenderBlock.h"
+
+namespace WebCore {
+
+class RenderIndicator : public RenderBlock {
+public:
+ RenderIndicator(Node*);
+ virtual ~RenderIndicator();
+
+protected:
+ virtual void layout();
+ virtual void updateFromElement();
+ virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
+ virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
+ virtual void layoutParts() = 0;
+ virtual bool shouldHaveParts() const = 0;
+
+private:
+ void requestLayoutForParts();
+ bool hasParts() const;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // RenderIndicator_h
+
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 5d206dd..fcb9c07 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -376,6 +376,14 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags, IntPoint
*cachedOffset = oldCachedOffset;
}
+IntRect RenderLayer::repaintRectIncludingDescendants() const
+{
+ IntRect repaintRect = m_repaintRect;
+ for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
+ repaintRect.unite(child->repaintRectIncludingDescendants());
+ return repaintRect;
+}
+
void RenderLayer::computeRepaintRects()
{
RenderBoxModelObject* repaintContainer = renderer()->containerForRepaint();
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index f300d76..45b64e0 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -403,6 +403,7 @@ public:
// Return a cached repaint rect, computed relative to the layer renderer's containerForRepaint.
IntRect repaintRect() const { return m_repaintRect; }
+ IntRect repaintRectIncludingDescendants() const;
void computeRepaintRects();
void updateRepaintRectsAfterScroll(bool fixed = false);
void setNeedsFullRepaint(bool f = true) { m_needsFullRepaint = f; }
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index b55a474..794b55a 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -216,8 +216,8 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
else if (is3DCanvas(renderer())) {
HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(renderer()->node());
WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(canvas->renderingContext());
- if (context->graphicsContext3D()->platformGraphicsContext3D())
- m_graphicsLayer->setContentsToGraphicsContext3D(context->graphicsContext3D());
+ if (context->graphicsContext3D()->platformLayer())
+ m_graphicsLayer->setContentsToWebGL(context->graphicsContext3D()->platformLayer());
}
#endif
@@ -227,6 +227,18 @@ bool RenderLayerBacking::updateGraphicsLayerConfiguration()
return layerConfigChanged;
}
+static IntRect clipBox(RenderBox* renderer)
+{
+ IntRect result = ClipRects::infiniteRect();
+ if (renderer->hasOverflowClip())
+ result = renderer->overflowClipRect(0, 0);
+
+ if (renderer->hasClip())
+ result.intersect(renderer->clipRect(0, 0));
+
+ return result;
+}
+
void RenderLayerBacking::updateGraphicsLayerGeometry()
{
// If we haven't built z-order lists yet, wait until later.
@@ -266,7 +278,8 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
if (compAncestor && compAncestor->backing()->hasClippingLayer()) {
// If the compositing ancestor has a layer to clip children, we parent in that, and therefore
// position relative to it.
- graphicsLayerParentLocation = toRenderBox(compAncestor->renderer())->overflowClipRect(0, 0).location();
+ IntRect clippingBox = clipBox(toRenderBox(compAncestor->renderer()));
+ graphicsLayerParentLocation = clippingBox.location();
} else
graphicsLayerParentLocation = ancestorCompositingBounds.location();
@@ -302,7 +315,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
// If we have a layer that clips children, position it.
IntRect clippingBox;
if (m_clippingLayer) {
- clippingBox = toRenderBox(renderer())->overflowClipRect(0, 0);
+ clippingBox = clipBox(toRenderBox(renderer()));
m_clippingLayer->setPosition(FloatPoint() + (clippingBox.location() - localCompositingBounds.location()));
m_clippingLayer->setSize(clippingBox.size());
m_clippingLayer->setOffsetFromRenderer(clippingBox.location() - IntPoint());
@@ -714,7 +727,7 @@ bool RenderLayerBacking::containsPaintedContent() const
bool RenderLayerBacking::isDirectlyCompositedImage() const
{
RenderObject* renderObject = renderer();
- return renderObject->isImage() && !hasBoxDecorationsOrBackground(renderObject);
+ return renderObject->isImage() && !hasBoxDecorationsOrBackground(renderObject) && !renderObject->hasClip();
}
void RenderLayerBacking::rendererContentChanged()
@@ -726,7 +739,7 @@ void RenderLayerBacking::rendererContentChanged()
#if ENABLE(3D_CANVAS)
if (is3DCanvas(renderer())) {
- m_graphicsLayer->setGraphicsContext3DNeedsDisplay();
+ m_graphicsLayer->setContentsNeedsDisplay();
return;
}
#endif
diff --git a/WebCore/rendering/RenderLayerCompositor.cpp b/WebCore/rendering/RenderLayerCompositor.cpp
index f68623b..f2c0dc4 100644
--- a/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/WebCore/rendering/RenderLayerCompositor.cpp
@@ -469,7 +469,7 @@ RenderLayer* RenderLayerCompositor::enclosingNonStackingClippingLayer(const Rend
if (curr->isStackingContext())
return 0;
- if (curr->renderer()->hasOverflowClip())
+ if (curr->renderer()->hasOverflowClip() || curr->renderer()->hasClip())
return curr;
}
return 0;
@@ -1229,9 +1229,8 @@ bool RenderLayerCompositor::clippedByAncestor(RenderLayer* layer) const
// into the hierarchy between this layer and its children in the z-order hierarchy.
bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer) const
{
- // FIXME: need to look at hasClip() too eventually
return layer->hasCompositingDescendant() &&
- layer->renderer()->hasOverflowClip();
+ (layer->renderer()->hasOverflowClip() || layer->renderer()->hasClip());
}
bool RenderLayerCompositor::requiresCompositingForTransform(RenderObject* renderer) const
diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp
index 871c10f..77fe3c2 100644
--- a/WebCore/rendering/RenderMenuList.cpp
+++ b/WebCore/rendering/RenderMenuList.cpp
@@ -314,7 +314,7 @@ void RenderMenuList::valueChanged(unsigned listIndex, bool fireOnChange)
void RenderMenuList::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow)
{
SelectElement* select = toSelectElement(static_cast<Element*>(node()));
- select->listBoxSelectItem(select->listToOptionIndex(listIndex), allowMultiplySelections, shift, fireOnChangeNow);
+ select->listBoxSelectItem(listIndex, allowMultiplySelections, shift, fireOnChangeNow);
}
bool RenderMenuList::multiple()
diff --git a/WebCore/rendering/RenderMeter.cpp b/WebCore/rendering/RenderMeter.cpp
index d443ceb..cfa7cba 100644
--- a/WebCore/rendering/RenderMeter.cpp
+++ b/WebCore/rendering/RenderMeter.cpp
@@ -27,6 +27,7 @@
#include "HTMLMeterElement.h"
#include "HTMLNames.h"
#include "RenderTheme.h"
+#include "ShadowElement.h"
using namespace std;
@@ -35,10 +36,18 @@ namespace WebCore {
using namespace HTMLNames;
RenderMeter::RenderMeter(HTMLMeterElement* element)
- : RenderBlock(element)
+ : RenderIndicator(element)
{
}
+RenderMeter::~RenderMeter()
+{
+ if (m_valuePart)
+ m_valuePart->detach();
+ if (m_barPart)
+ m_barPart->detach();
+}
+
void RenderMeter::calcWidth()
{
RenderBox::calcWidth();
@@ -51,25 +60,125 @@ void RenderMeter::calcHeight()
setHeight(theme()->meterSizeForBounds(this, frameRect()).height());
}
-void RenderMeter::layout()
+void RenderMeter::layoutParts()
{
- ASSERT(needsLayout());
+ // We refresh shadow node here because the state can depend
+ // on the frame size of this render object.
+ updatePartsState();
+ if (m_valuePart)
+ m_valuePart->layoutAsPart(valuePartRect());
+ if (m_barPart)
+ m_barPart->layoutAsPart(barPartRect());
+}
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
+bool RenderMeter::shouldHaveParts() const
+{
+ bool hasTheme = theme()->supportsMeter(style()->appearance(), isHorizontal());
+ if (!hasTheme)
+ return true;
+ bool shadowsHaveStyle = ShadowBlockElement::partShouldHaveStyle(this, barPseudoId()) || ShadowBlockElement::partShouldHaveStyle(this, valuePseudoId());
+ if (shadowsHaveStyle)
+ return true;
+ return false;
+}
- calcWidth();
- calcHeight();
+double RenderMeter::valueRatio() const
+{
+ HTMLMeterElement* element = static_cast<HTMLMeterElement*>(node());
+ double min = element->min();
+ double max = element->max();
+ double value = element->value();
+
+ if (max <= min)
+ return 0;
+ return (value - min) / (max - min);
+}
- m_overflow.clear();
+IntRect RenderMeter::barPartRect() const
+{
+ return IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), lround(width() - borderLeft() - paddingLeft() - borderRight() - paddingRight()), height() - borderTop() - paddingTop() - borderBottom() - paddingBottom());
+}
- repainter.repaintAfterLayout();
+IntRect RenderMeter::valuePartRect() const
+{
+ IntRect rect = barPartRect();
+
+ if (rect.height() <= rect.width()) {
+ int width = static_cast<int>(rect.width()*valueRatio());
+ if (style()->direction() == RTL) {
+ rect.setX(rect.x() + (rect.width() - width));
+ rect.setWidth(width);
+ } else
+ rect.setWidth(width);
+ } else {
+ int height = static_cast<int>(rect.height()*valueRatio());
+ rect.setY(rect.y() + (rect.height() - height));
+ rect.setHeight(height);
+ }
+
+ return rect;
+}
+
+bool RenderMeter::isHorizontal() const
+{
+ IntRect rect = barPartRect();
+ return rect.height() <= rect.width();
+}
- setNeedsLayout(false);
+PseudoId RenderMeter::valuePseudoId() const
+{
+ HTMLMeterElement* element = static_cast<HTMLMeterElement*>(node());
+
+ if (isHorizontal()) {
+ switch (element->gaugeRegion()) {
+ case HTMLMeterElement::GaugeRegionOptimum:
+ return METER_HORIZONTAL_OPTIMUM;
+ case HTMLMeterElement::GaugeRegionSuboptimal:
+ return METER_HORIZONTAL_SUBOPTIMAL;
+ case HTMLMeterElement::GaugeRegionEvenLessGood:
+ return METER_HORIZONTAL_EVEN_LESS_GOOD;
+ }
+ } else {
+ switch (element->gaugeRegion()) {
+ case HTMLMeterElement::GaugeRegionOptimum:
+ return METER_VERTICAL_OPTIMUM;
+ case HTMLMeterElement::GaugeRegionSuboptimal:
+ return METER_VERTICAL_SUBOPTIMAL;
+ case HTMLMeterElement::GaugeRegionEvenLessGood:
+ return METER_VERTICAL_EVEN_LESS_GOOD;
+ }
+ }
+
+ ASSERT_NOT_REACHED();
+ return NOPSEUDO;
+}
+
+PseudoId RenderMeter::barPseudoId() const
+{
+ return isHorizontal() ? METER_HORIZONTAL_BAR : METER_VERTICAL_BAR;
}
-void RenderMeter::updateFromElement()
+void RenderMeter::updatePartsState()
{
- repaint();
+ if (shouldHaveParts() && !m_barPart) {
+ ASSERT(!m_valuePart);
+ m_barPart = ShadowBlockElement::createForPart(this->node(), barPseudoId());
+ addChild(m_barPart->renderer());
+ m_valuePart = ShadowBlockElement::createForPart(this->node(), valuePseudoId());
+ addChild(m_valuePart->renderer());
+ } else if (!shouldHaveParts() && m_barPart) {
+ ASSERT(m_valuePart);
+ m_barPart->detach();
+ m_barPart = 0;
+ m_valuePart->detach();
+ m_valuePart = 0;
+ }
+
+ if (m_barPart) {
+ ASSERT(m_valuePart);
+ m_barPart->updateStyleForPart(barPseudoId());
+ m_valuePart->updateStyleForPart(valuePseudoId());
+ }
}
} // namespace WebCore
diff --git a/WebCore/rendering/RenderMeter.h b/WebCore/rendering/RenderMeter.h
index fd95adb..0e73e40 100644
--- a/WebCore/rendering/RenderMeter.h
+++ b/WebCore/rendering/RenderMeter.h
@@ -23,23 +23,39 @@
#if ENABLE(METER_TAG)
#include "RenderBlock.h"
+#include "RenderProgress.h"
#include "RenderWidget.h"
+
namespace WebCore {
class HTMLMeterElement;
+class ShadowBlockElement;
-class RenderMeter : public RenderBlock {
+class RenderMeter : public RenderIndicator {
public:
RenderMeter(HTMLMeterElement*);
+ virtual ~RenderMeter();
private:
virtual const char* renderName() const { return "RenderMeter"; }
virtual bool isMeter() const { return true; }
- virtual void layout();
- virtual void updateFromElement();
virtual void calcWidth();
virtual void calcHeight();
+
+ virtual void layoutParts();
+ virtual bool shouldHaveParts() const;
+
+ bool isHorizontal() const;
+ void updatePartsState();
+ IntRect valuePartRect() const;
+ PseudoId valuePseudoId() const;
+ IntRect barPartRect() const;
+ PseudoId barPseudoId() const;
+ double valueRatio() const;
+
+ RefPtr<ShadowBlockElement> m_barPart;
+ RefPtr<ShadowBlockElement> m_valuePart;
};
inline RenderMeter* toRenderMeter(RenderObject* object)
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index e9e9ffc..143e2c0 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1633,9 +1633,6 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
s_affectsParentBlock = false;
if (view()->frameView()) {
- // FIXME: A better solution would be to only invalidate the fixed regions when scrolling. It's overkill to
- // prevent the entire view from blitting on a scroll.
-
bool shouldBlitOnFixedBackgroundImage = false;
#if ENABLE(FAST_MOBILE_SCROLLING)
// On low-powered/mobile devices, preventing blitting on a scroll can cause noticeable delays
@@ -1645,11 +1642,8 @@ void RenderObject::styleWillChange(StyleDifference diff, const RenderStyle* newS
shouldBlitOnFixedBackgroundImage = true;
#endif
- bool newStyleSlowScroll = newStyle && (newStyle->position() == FixedPosition
- || (!shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage()));
- bool oldStyleSlowScroll = m_style && (m_style->position() == FixedPosition
- || (!shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage()));
-
+ bool newStyleSlowScroll = newStyle && !shouldBlitOnFixedBackgroundImage && newStyle->hasFixedBackgroundImage();
+ bool oldStyleSlowScroll = m_style && !shouldBlitOnFixedBackgroundImage && m_style->hasFixedBackgroundImage();
if (oldStyleSlowScroll != newStyleSlowScroll) {
if (oldStyleSlowScroll)
view()->frameView()->removeSlowRepaintObject();
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index 9f1e8dd..3446a00 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -341,6 +341,7 @@ public:
virtual bool isSVGHiddenContainer() const { return false; }
virtual bool isRenderPath() const { return false; }
virtual bool isSVGText() const { return false; }
+ virtual bool isSVGInlineText() const { return false; }
virtual bool isSVGImage() const { return false; }
virtual bool isSVGForeignObject() const { return false; }
virtual bool isSVGResourceContainer() const { return false; }
diff --git a/WebCore/rendering/RenderProgress.cpp b/WebCore/rendering/RenderProgress.cpp
index e4e045d..2587e4b 100644
--- a/WebCore/rendering/RenderProgress.cpp
+++ b/WebCore/rendering/RenderProgress.cpp
@@ -23,11 +23,11 @@
#if ENABLE(PROGRESS_TAG)
#include "RenderProgress.h"
-#include "ShadowElement.h"
+
#include "HTMLNames.h"
#include "HTMLProgressElement.h"
#include "RenderTheme.h"
-#include "RenderView.h"
+#include "ShadowElement.h"
#include <wtf/CurrentTime.h>
#include <wtf/RefPtr.h>
@@ -36,14 +36,13 @@ using namespace std;
namespace WebCore {
RenderProgress::RenderProgress(HTMLProgressElement* element)
- : RenderBlock(element)
+ : RenderIndicator(element)
, m_position(-1)
, m_animationStartTime(0)
, m_animationRepeatInterval(0)
, m_animationDuration(0)
, m_animating(false)
, m_animationTimer(this, &RenderProgress::animationTimerFired)
- , m_valuePart(0)
{
}
@@ -53,53 +52,6 @@ RenderProgress::~RenderProgress()
m_valuePart->detach();
}
-void RenderProgress::layout()
-{
- ASSERT(needsLayout());
-
- LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
-
- IntSize oldSize = size();
-
- calcWidth();
- calcHeight();
- if (m_valuePart) {
- IntRect valuePartRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), lround((width() - borderLeft() - paddingLeft() - borderRight() - paddingRight()) * position()), height() - borderTop() - paddingTop() - borderBottom() - paddingBottom());
- if (style()->direction() == RTL)
- valuePartRect.setX(width() - borderRight() - paddingRight() - valuePartRect.width());
- toRenderBox(m_valuePart->renderer())->setFrameRect(valuePartRect);
-
- if (oldSize != size())
- m_valuePart->renderer()->setChildNeedsLayout(true, false);
-
- LayoutStateMaintainer statePusher(view(), this, size());
-
- IntRect oldRect = toRenderBox(m_valuePart->renderer())->frameRect();
-
- m_valuePart->renderer()->layoutIfNeeded();
-
- toRenderBox(m_valuePart->renderer())->setFrameRect(valuePartRect);
- if (m_valuePart->renderer()->checkForRepaintDuringLayout())
- m_valuePart->renderer()->repaintDuringLayoutIfMoved(oldRect);
-
- statePusher.pop();
- addOverflowFromChild(toRenderBox(m_valuePart->renderer()));
- }
-
- updateAnimationState();
-
- repainter.repaintAfterLayout();
-
- setNeedsLayout(false);
-}
-
-void RenderProgress::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
-{
- RenderBlock::styleDidChange(diff, oldStyle);
-
- updateValuePartState();
-}
-
void RenderProgress::updateFromElement()
{
HTMLProgressElement* element = progressElement();
@@ -108,45 +60,7 @@ void RenderProgress::updateFromElement()
m_position = element->position();
updateAnimationState();
-
- updateValuePartState();
-
- repaint();
-}
-
-void RenderProgress::updateValuePartState()
-{
- bool needLayout = !style()->hasAppearance() || m_valuePart;
- if (!style()->hasAppearance() && !m_valuePart) {
- m_valuePart = ShadowBlockElement::create(node());
- RefPtr<RenderStyle> styleForValuePart = createStyleForValuePart(style());
- m_valuePart->setRenderer(m_valuePart->createRenderer(renderArena(), styleForValuePart.get()));
- m_valuePart->renderer()->setStyle(styleForValuePart.release());
- m_valuePart->setAttached();
- m_valuePart->setInDocument();
- addChild(m_valuePart->renderer());
- } else if (style()->hasAppearance() && m_valuePart) {
- m_valuePart->detach();
- m_valuePart = 0;
- }
- if (needLayout)
- setNeedsLayout(true);
-}
-
-PassRefPtr<RenderStyle> RenderProgress::createStyleForValuePart(RenderStyle* parentStyle)
-{
- RefPtr<RenderStyle> styleForValuePart;
- RenderStyle* pseudoStyle = getCachedPseudoStyle(PROGRESS_BAR_VALUE);
- if (pseudoStyle)
- styleForValuePart = RenderStyle::clone(pseudoStyle);
- else
- styleForValuePart = RenderStyle::create();
-
- if (parentStyle)
- styleForValuePart->inheritFrom(parentStyle);
- styleForValuePart->setDisplay(BLOCK);
- styleForValuePart->setAppearance(ProgressBarValuePart);
- return styleForValuePart.release();
+ RenderIndicator::updateFromElement();
}
double RenderProgress::animationProgress() const
@@ -171,7 +85,31 @@ void RenderProgress::paint(PaintInfo& paintInfo, int tx, int ty)
m_animationTimer.startOneShot(m_animationRepeatInterval);
}
- RenderBlock::paint(paintInfo, tx, ty);
+ RenderIndicator::paint(paintInfo, tx, ty);
+}
+
+void RenderProgress::layoutParts()
+{
+ updatePartsState();
+ if (m_valuePart)
+ m_valuePart->layoutAsPart(valuePartRect());
+ updateAnimationState();
+}
+
+bool RenderProgress::shouldHaveParts() const
+{
+ return !style()->hasAppearance();
+}
+
+void RenderProgress::updatePartsState()
+{
+ if (shouldHaveParts() && !m_valuePart) {
+ m_valuePart = ShadowBlockElement::createForPart(this->node(), PROGRESS_BAR_VALUE);
+ addChild(m_valuePart->renderer());
+ } else if (!shouldHaveParts() && m_valuePart) {
+ m_valuePart->detach();
+ m_valuePart = 0;
+ }
}
void RenderProgress::updateAnimationState()
@@ -191,6 +129,14 @@ void RenderProgress::updateAnimationState()
m_animationTimer.stop();
}
+IntRect RenderProgress::valuePartRect() const
+{
+ IntRect rect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), lround((width() - borderLeft() - paddingLeft() - borderRight() - paddingRight()) * position()), height() - borderTop() - paddingTop() - borderBottom() - paddingBottom());
+ if (style()->direction() == RTL)
+ rect.setX(width() - borderRight() - paddingRight() - rect.width());
+ return rect;
+}
+
HTMLProgressElement* RenderProgress::progressElement() const
{
return static_cast<HTMLProgressElement*>(node());
diff --git a/WebCore/rendering/RenderProgress.h b/WebCore/rendering/RenderProgress.h
index 4d1a88f..bd979e8 100644
--- a/WebCore/rendering/RenderProgress.h
+++ b/WebCore/rendering/RenderProgress.h
@@ -23,13 +23,14 @@
#if ENABLE(PROGRESS_TAG)
#include "RenderBlock.h"
+#include "RenderIndicator.h"
namespace WebCore {
class HTMLProgressElement;
class ShadowBlockElement;
-class RenderProgress : public RenderBlock {
+class RenderProgress : public RenderIndicator {
public:
RenderProgress(HTMLProgressElement*);
virtual ~RenderProgress();
@@ -45,17 +46,17 @@ public:
private:
virtual const char* renderName() const { return "RenderProgress"; }
virtual bool isProgress() const { return true; }
- virtual void layout();
virtual void updateFromElement();
virtual void paint(PaintInfo&, int tx, int ty);
- virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
- virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+ virtual void layoutParts();
+ virtual bool shouldHaveParts() const;
+
+ IntRect valuePartRect() const;
void animationTimerFired(Timer<RenderProgress>*);
void updateAnimationState();
- void updateValuePartState();
- PassRefPtr<RenderStyle> createStyleForValuePart(RenderStyle*);
+ void updatePartsState();
double m_position;
double m_animationStartTime;
diff --git a/WebCore/rendering/RenderSVGBlock.cpp b/WebCore/rendering/RenderSVGBlock.cpp
index 99725d6..2bae158 100644
--- a/WebCore/rendering/RenderSVGBlock.cpp
+++ b/WebCore/rendering/RenderSVGBlock.cpp
@@ -68,6 +68,11 @@ void RenderSVGBlock::updateBoxModelInfoFromStyle()
setHasOverflowClip(false);
}
+void RenderSVGBlock::absoluteRects(Vector<IntRect>&, int, int)
+{
+ // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used.
+ ASSERT_NOT_REACHED();
+}
}
#endif
diff --git a/WebCore/rendering/RenderSVGBlock.h b/WebCore/rendering/RenderSVGBlock.h
index a250c00..af819fd 100644
--- a/WebCore/rendering/RenderSVGBlock.h
+++ b/WebCore/rendering/RenderSVGBlock.h
@@ -29,13 +29,16 @@ namespace WebCore {
class SVGElement;
-class RenderSVGBlock : public RenderBlock, protected SVGRenderBase {
+class RenderSVGBlock : public RenderBlock
+ , protected SVGRenderBase {
public:
RenderSVGBlock(SVGElement*);
private:
virtual void setStyle(PassRefPtr<RenderStyle>);
virtual void updateBoxModelInfoFromStyle();
+
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
};
}
diff --git a/WebCore/rendering/RenderSVGHiddenContainer.cpp b/WebCore/rendering/RenderSVGHiddenContainer.cpp
index bb0a15d..5d6bd25 100644
--- a/WebCore/rendering/RenderSVGHiddenContainer.cpp
+++ b/WebCore/rendering/RenderSVGHiddenContainer.cpp
@@ -52,11 +52,6 @@ IntRect RenderSVGHiddenContainer::clippedOverflowRectForRepaint(RenderBoxModelOb
return IntRect();
}
-void RenderSVGHiddenContainer::absoluteRects(Vector<IntRect>&, int, int)
-{
- // This subtree does not take up space or paint
-}
-
void RenderSVGHiddenContainer::absoluteQuads(Vector<FloatQuad>&)
{
// This subtree does not take up space or paint
diff --git a/WebCore/rendering/RenderSVGHiddenContainer.h b/WebCore/rendering/RenderSVGHiddenContainer.h
index fdbd2bc..c446f11 100644
--- a/WebCore/rendering/RenderSVGHiddenContainer.h
+++ b/WebCore/rendering/RenderSVGHiddenContainer.h
@@ -48,7 +48,6 @@ namespace WebCore {
virtual void paint(PaintInfo&, int parentX, int parentY);
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
- virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
virtual FloatRect objectBoundingBox() const;
diff --git a/WebCore/rendering/RenderSVGImage.cpp b/WebCore/rendering/RenderSVGImage.cpp
index d1a3037..45898c7 100644
--- a/WebCore/rendering/RenderSVGImage.cpp
+++ b/WebCore/rendering/RenderSVGImage.cpp
@@ -143,11 +143,6 @@ bool RenderSVGImage::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int
return false;
}
-FloatRect RenderSVGImage::objectBoundingBox() const
-{
- return m_localBounds;
-}
-
FloatRect RenderSVGImage::repaintRectInLocalCoordinates() const
{
// If we already have a cached repaint rect, return that
@@ -195,14 +190,15 @@ void RenderSVGImage::addFocusRingRects(Vector<IntRect>& rects, int, int)
rects.append(contentRect);
}
-void RenderSVGImage::absoluteRects(Vector<IntRect>& rects, int, int)
+void RenderSVGImage::absoluteRects(Vector<IntRect>&, int, int)
{
- rects.append(absoluteClippedOverflowRect());
+ // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used.
+ ASSERT_NOT_REACHED();
}
void RenderSVGImage::absoluteQuads(Vector<FloatQuad>& quads)
{
- quads.append(FloatRect(absoluteClippedOverflowRect()));
+ quads.append(localToAbsoluteQuad(strokeBoundingBox()));
}
}
diff --git a/WebCore/rendering/RenderSVGImage.h b/WebCore/rendering/RenderSVGImage.h
index 512892c..37d2aee 100644
--- a/WebCore/rendering/RenderSVGImage.h
+++ b/WebCore/rendering/RenderSVGImage.h
@@ -34,7 +34,8 @@ namespace WebCore {
class SVGImageElement;
-class RenderSVGImage : public RenderImage, protected SVGRenderBase {
+class RenderSVGImage : public RenderImage
+ , protected SVGRenderBase {
public:
RenderSVGImage(SVGImageElement*);
@@ -46,7 +47,7 @@ private:
virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
- virtual FloatRect objectBoundingBox() const;
+ virtual FloatRect objectBoundingBox() const { return m_localBounds; }
virtual FloatRect strokeBoundingBox() const { return m_localBounds; }
virtual FloatRect repaintRectInLocalCoordinates() const;
@@ -83,5 +84,3 @@ private:
#endif // ENABLE(SVG)
#endif // RenderSVGImage_h
-
-// vim:ts=4:noet
diff --git a/WebCore/rendering/RenderSVGInline.cpp b/WebCore/rendering/RenderSVGInline.cpp
index 85d148e..ca0fdb5 100644
--- a/WebCore/rendering/RenderSVGInline.cpp
+++ b/WebCore/rendering/RenderSVGInline.cpp
@@ -26,11 +26,7 @@
#if ENABLE(SVG)
#include "RenderSVGInline.h"
-#include "FloatQuad.h"
-#include "RenderBlock.h"
#include "SVGInlineFlowBox.h"
-#include "SVGInlineTextBox.h"
-#include "SVGRootInlineBox.h"
namespace WebCore {
@@ -46,25 +42,6 @@ InlineFlowBox* RenderSVGInline::createInlineFlowBox()
return box;
}
-void RenderSVGInline::absoluteRects(Vector<IntRect>& rects, int, int)
-{
- InlineFlowBox* firstBox = firstLineBox();
-
- RootInlineBox* rootBox = firstBox ? firstBox->root() : 0;
- RenderBox* object = rootBox ? rootBox->block() : 0;
-
- if (!object)
- return;
-
- int xRef = object->x();
- int yRef = object->y();
-
- for (InlineFlowBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
- FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
- rects.append(enclosingIntRect(localToAbsoluteQuad(rect).boundingBox()));
- }
-}
-
FloatRect RenderSVGInline::objectBoundingBox() const
{
if (const RenderObject* object = findTextRootObject(this))
@@ -89,25 +66,33 @@ FloatRect RenderSVGInline::repaintRectInLocalCoordinates() const
return FloatRect();
}
-void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
+IntRect RenderSVGInline::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer)
{
- InlineFlowBox* firstBox = firstLineBox();
+ return SVGRenderBase::clippedOverflowRectForRepaint(this, repaintContainer);
+}
- RootInlineBox* rootBox = firstBox ? firstBox->root() : 0;
- RenderBox* object = rootBox ? rootBox->block() : 0;
+void RenderSVGInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& repaintRect, bool fixed)
+{
+ SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed);
+}
+
+void RenderSVGInline::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState& transformState) const
+{
+ SVGRenderBase::mapLocalToContainer(this, repaintContainer, useTransforms, fixed, transformState);
+}
+void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
+{
+ const RenderObject* object = findTextRootObject(this);
if (!object)
return;
- int xRef = object->x();
- int yRef = object->y();
-
- for (InlineFlowBox* curr = firstBox; curr; curr = curr->nextLineBox()) {
- FloatRect rect(xRef + curr->x(), yRef + curr->y(), curr->width(), curr->height());
- quads.append(localToAbsoluteQuad(rect));
- }
+ FloatRect textBoundingBox = object->strokeBoundingBox();
+ for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
+ quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->width(), box->height())));
}
+
}
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderSVGInline.h b/WebCore/rendering/RenderSVGInline.h
index 1afbb97..2efb1aa 100644
--- a/WebCore/rendering/RenderSVGInline.h
+++ b/WebCore/rendering/RenderSVGInline.h
@@ -31,26 +31,28 @@
namespace WebCore {
-class RenderSVGInline : public RenderInline, protected SVGRenderBase {
+class RenderSVGInline : public RenderInline
+ , protected SVGRenderBase {
public:
RenderSVGInline(Node*);
virtual const char* renderName() const { return "RenderSVGInline"; }
virtual bool requiresLayer() const { return false; }
- // These are shared between RenderSVGTSpan and RenderSVGTextPath
- virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
- virtual void absoluteQuads(Vector<FloatQuad>&);
-
// Chapter 10.4 of the SVG Specification say that we should use the
// object bounding box of the parent text element.
- // We search for the root text element and take it's bounding box.
+ // We search for the root text element and take its bounding box.
// It is also necessary to take the stroke and repaint rect of
// this element, since we need it for filters.
virtual FloatRect objectBoundingBox() const;
virtual FloatRect strokeBoundingBox() const;
virtual FloatRect repaintRectInLocalCoordinates() const;
-
+
+ virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
+ virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
+ virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
+ virtual void absoluteQuads(Vector<FloatQuad>&);
+
private:
virtual InlineFlowBox* createInlineFlowBox();
};
diff --git a/WebCore/rendering/RenderSVGInlineText.cpp b/WebCore/rendering/RenderSVGInlineText.cpp
index 48d01ae..ba99243 100644
--- a/WebCore/rendering/RenderSVGInlineText.cpp
+++ b/WebCore/rendering/RenderSVGInlineText.cpp
@@ -38,99 +38,21 @@
namespace WebCore {
-static inline bool isChildOfHiddenContainer(RenderObject* start)
-{
- while (start) {
- if (start->isSVGHiddenContainer())
- return true;
-
- start = start->parent();
- }
-
- return false;
-}
-
RenderSVGInlineText::RenderSVGInlineText(Node* n, PassRefPtr<StringImpl> str)
: RenderText(n, str)
{
}
-
void RenderSVGInlineText::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
{
- // Skip RenderText's possible layout scheduling on style change
- RenderObject::styleDidChange(diff, oldStyle);
+ RenderText::styleDidChange(diff, oldStyle);
- // FIXME: SVG text is apparently always transformed?
+ // FIXME: Should optimize this.
+ // SVG text is always transformed.
if (RefPtr<StringImpl> textToTransform = originalText())
setText(textToTransform.release(), true);
}
-void RenderSVGInlineText::absoluteRects(Vector<IntRect>& rects, int, int)
-{
- rects.append(computeRepaintRectForRange(0, 0, textLength()));
-}
-
-void RenderSVGInlineText::absoluteQuads(Vector<FloatQuad>& quads)
-{
- quads.append(computeRepaintQuadForRange(0, 0, textLength()));
-}
-
-IntRect RenderSVGInlineText::selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool /*clipToVisibleContent*/)
-{
- ASSERT(!needsLayout());
-
- if (selectionState() == SelectionNone)
- return IntRect();
-
- // Early exit if we're ie. a <text> within a <defs> section.
- if (isChildOfHiddenContainer(this))
- return IntRect();
-
- // Now calculate startPos and endPos for painting selection.
- // We include a selection while endPos > 0
- int startPos, endPos;
- if (selectionState() == SelectionInside) {
- // We are fully selected.
- startPos = 0;
- endPos = textLength();
- } else {
- selectionStartEnd(startPos, endPos);
- if (selectionState() == SelectionStart)
- endPos = textLength();
- else if (selectionState() == SelectionEnd)
- startPos = 0;
- }
-
- if (startPos == endPos)
- return IntRect();
-
- return computeRepaintRectForRange(repaintContainer, startPos, endPos);
-}
-
-IntRect RenderSVGInlineText::computeRepaintRectForRange(RenderBoxModelObject* repaintContainer, int startPos, int endPos)
-{
- FloatQuad repaintQuad = computeRepaintQuadForRange(repaintContainer, startPos, endPos);
- return enclosingIntRect(repaintQuad.boundingBox());
-}
-
-FloatQuad RenderSVGInlineText::computeRepaintQuadForRange(RenderBoxModelObject* repaintContainer, int startPos, int endPos)
-{
- RenderBlock* cb = containingBlock();
- if (!cb || !cb->container())
- return FloatQuad();
-
- RenderSVGRoot* root = findSVGRootObject(parent());
- if (!root)
- return FloatQuad();
-
- IntRect rect;
- for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- rect.unite(box->selectionRect(0, 0, startPos, endPos));
-
- return localToContainerQuad(FloatQuad(rect), repaintContainer);
-}
-
InlineTextBox* RenderSVGInlineText::createTextBox()
{
InlineTextBox* box = new (renderArena()) SVGInlineTextBox(this);
@@ -140,57 +62,9 @@ InlineTextBox* RenderSVGInlineText::createTextBox()
IntRect RenderSVGInlineText::localCaretRect(InlineBox*, int, int*)
{
- // SVG doesn't have any editable content where a caret rect would be needed.
- // FIXME: That's not sufficient. The localCaretRect function is also used for selection.
return IntRect();
}
-VisiblePosition RenderSVGInlineText::positionForPoint(const IntPoint& point)
-{
- SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(firstTextBox());
-
- if (!textBox || textLength() == 0)
- return createVisiblePosition(0, DOWNSTREAM);
-
- SVGRootInlineBox* rootBox = textBox->svgRootInlineBox();
- RenderBlock* object = rootBox ? rootBox->block() : 0;
-
- if (!object)
- return createVisiblePosition(0, DOWNSTREAM);
-
- int closestOffsetInBox = 0;
-
- // FIXME: This approach is wrong. The correct code would first find the
- // closest SVGInlineTextBox to the point, and *then* ask only that inline box
- // what the closest text offset to that point is. This code instead walks
- // through all boxes in order, so when you click "near" a box, you'll actually
- // end up returning the nearest offset in the last box, even if the
- // nearest offset to your click is contained in another box.
- for (SVGInlineTextBox* box = textBox; box; box = static_cast<SVGInlineTextBox*>(box->nextTextBox())) {
- if (box->svgCharacterHitsPosition(point.x() + object->x(), point.y() + object->y(), closestOffsetInBox)) {
- // If we're not at the end/start of the box, stop looking for other selected boxes.
- if (box->direction() == LTR) {
- if (closestOffsetInBox <= (int) box->end() + 1)
- break;
- } else {
- if (closestOffsetInBox > (int) box->start())
- break;
- }
- }
- }
-
- return createVisiblePosition(closestOffsetInBox, DOWNSTREAM);
-}
-
-void RenderSVGInlineText::destroy()
-{
- if (!documentBeingDestroyed()) {
- setNeedsLayoutAndPrefWidthsRecalc();
- repaint();
- }
- RenderText::destroy();
-}
-
}
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/RenderSVGInlineText.h b/WebCore/rendering/RenderSVGInlineText.h
index b475067..08b4a47 100644
--- a/WebCore/rendering/RenderSVGInlineText.h
+++ b/WebCore/rendering/RenderSVGInlineText.h
@@ -36,28 +36,19 @@ public:
private:
virtual const char* renderName() const { return "RenderSVGInlineText"; }
-
+
virtual void styleDidChange(StyleDifference, const RenderStyle*);
// FIXME: We need objectBoundingBox for DRT results and filters at the moment.
// This should be fixed to give back the objectBoundingBox of the text root.
virtual FloatRect objectBoundingBox() const { return FloatRect(); }
- virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
- virtual void absoluteQuads(Vector<FloatQuad>&);
-
virtual bool requiresLayer() const { return false; }
- virtual IntRect selectionRectForRepaint(RenderBoxModelObject* repaintContainer, bool clipToVisibleContent = true);
- virtual bool isSVGText() const { return true; }
+ virtual bool isSVGInlineText() const { return true; }
virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);
- virtual VisiblePosition positionForPoint(const IntPoint&);
-
- virtual void destroy();
virtual InlineTextBox* createTextBox();
- IntRect computeRepaintRectForRange(RenderBoxModelObject* repaintContainer, int startPos, int endPos);
- FloatQuad computeRepaintQuadForRange(RenderBoxModelObject* repaintContainer, int startPos, int endPos);
};
}
diff --git a/WebCore/rendering/RenderSVGModelObject.cpp b/WebCore/rendering/RenderSVGModelObject.cpp
index 837b36a..a80a963 100644
--- a/WebCore/rendering/RenderSVGModelObject.cpp
+++ b/WebCore/rendering/RenderSVGModelObject.cpp
@@ -72,14 +72,15 @@ IntRect RenderSVGModelObject::outlineBoundsForRepaint(RenderBoxModelObject* repa
return containerRelativeQuad.enclosingBoundingBox();
}
-void RenderSVGModelObject::absoluteRects(Vector<IntRect>& rects, int, int)
+void RenderSVGModelObject::absoluteRects(Vector<IntRect>&, int, int)
{
- rects.append(absoluteClippedOverflowRect());
+ // This code path should never be taken for SVG, as we're assuming useTransforms=true everywhere, absoluteQuads should be used.
+ ASSERT_NOT_REACHED();
}
void RenderSVGModelObject::absoluteQuads(Vector<FloatQuad>& quads)
{
- quads.append(absoluteClippedOverflowRect());
+ quads.append(localToAbsoluteQuad(strokeBoundingBox()));
}
void RenderSVGModelObject::destroy()
diff --git a/WebCore/rendering/RenderSVGModelObject.h b/WebCore/rendering/RenderSVGModelObject.h
index affa18d..42ca27f 100644
--- a/WebCore/rendering/RenderSVGModelObject.h
+++ b/WebCore/rendering/RenderSVGModelObject.h
@@ -55,7 +55,7 @@ public:
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint*) const;
- virtual void absoluteRects(Vector<IntRect>& rects, int tx, int ty);
+ virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
virtual void destroy();
diff --git a/WebCore/rendering/RenderSVGResourceFilter.cpp b/WebCore/rendering/RenderSVGResourceFilter.cpp
index b0220a9..0062015 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.cpp
+++ b/WebCore/rendering/RenderSVGResourceFilter.cpp
@@ -91,13 +91,13 @@ void RenderSVGResourceFilter::invalidateClient(RenderObject* object)
markForLayoutAndResourceInvalidation(object);
}
-PassOwnPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
+PassRefPtr<SVGFilterBuilder> RenderSVGResourceFilter::buildPrimitives()
{
SVGFilterElement* filterElement = static_cast<SVGFilterElement*>(node());
bool primitiveBoundingBoxMode = filterElement->primitiveUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX;
// Add effects to the builder
- OwnPtr<SVGFilterBuilder> builder(new SVGFilterBuilder);
+ RefPtr<SVGFilterBuilder> builder = SVGFilterBuilder::create();
builder->clearEffects();
for (Node* node = filterElement->firstChild(); node; node = node->nextSibling()) {
if (!node->isSVGElement())
diff --git a/WebCore/rendering/RenderSVGResourceFilter.h b/WebCore/rendering/RenderSVGResourceFilter.h
index 105b256..7b5ab09 100644
--- a/WebCore/rendering/RenderSVGResourceFilter.h
+++ b/WebCore/rendering/RenderSVGResourceFilter.h
@@ -47,7 +47,7 @@ struct FilterData {
}
RefPtr<SVGFilter> filter;
- OwnPtr<SVGFilterBuilder> builder;
+ RefPtr<SVGFilterBuilder> builder;
OwnPtr<ImageBuffer> sourceGraphicBuffer;
GraphicsContext* savedContext;
FloatRect boundaries;
@@ -72,7 +72,7 @@ public:
virtual FloatRect resourceBoundingBox(RenderObject*);
- PassOwnPtr<SVGFilterBuilder> buildPrimitives();
+ PassRefPtr<SVGFilterBuilder> buildPrimitives();
SVGUnitTypes::SVGUnitType filterUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->filterUnits()); }
SVGUnitTypes::SVGUnitType primitiveUnits() const { return toUnitType(static_cast<SVGFilterElement*>(node())->primitiveUnits()); }
diff --git a/WebCore/rendering/RenderSVGRoot.cpp b/WebCore/rendering/RenderSVGRoot.cpp
index 6017513..70ff938 100644
--- a/WebCore/rendering/RenderSVGRoot.cpp
+++ b/WebCore/rendering/RenderSVGRoot.cpp
@@ -144,12 +144,16 @@ void RenderSVGRoot::paint(PaintInfo& paintInfo, int parentX, int parentY)
if (paintInfo.context->paintingDisabled())
return;
+ bool isVisible = style()->visibility() == VISIBLE;
IntPoint parentOriginInContainer(parentX, parentY);
IntPoint borderBoxOriginInContainer = parentOriginInContainer + parentOriginToBorderBox();
- if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
+ if (hasBoxDecorations() && (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == PaintPhaseChildBlockBackground) && isVisible)
paintBoxDecorations(paintInfo, borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y());
+ if (paintInfo.phase == PaintPhaseBlockBackground)
+ return;
+
// An empty viewport disables rendering. FIXME: Should we still render filters?
if (m_viewportSize.isEmpty())
return;
@@ -184,7 +188,7 @@ void RenderSVGRoot::paint(PaintInfo& paintInfo, int parentX, int parentY)
childPaintInfo.context->restore();
- if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && style()->visibility() == VISIBLE)
+ if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth() && isVisible)
paintOutline(paintInfo.context, borderBoxOriginInContainer.x(), borderBoxOriginInContainer.y(), width(), height());
}
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp
index 072b6d1..84f5329 100644
--- a/WebCore/rendering/RenderSVGText.cpp
+++ b/WebCore/rendering/RenderSVGText.cpp
@@ -44,6 +44,7 @@
#include "SVGTransformList.h"
#include "SVGURIReference.h"
#include "SimpleFontData.h"
+#include "TransformState.h"
namespace WebCore {
@@ -63,7 +64,7 @@ void RenderSVGText::computeRectForRepaint(RenderBoxModelObject* repaintContainer
SVGRenderBase::computeRectForRepaint(this, repaintContainer, repaintRect, fixed);
}
-void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed , bool useTransforms, TransformState& transformState) const
+void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState) const
{
SVGRenderBase::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState);
}
@@ -73,18 +74,28 @@ void RenderSVGText::layout()
ASSERT(needsLayout());
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- // Best guess for a relative starting point
- SVGTextElement* text = static_cast<SVGTextElement*>(node());
- int xOffset = (int)(text->x()->getFirst().value(text));
- int yOffset = (int)(text->y()->getFirst().value(text));
- setLocation(xOffset, yOffset);
-
if (m_needsTransformUpdate) {
+ SVGTextElement* text = static_cast<SVGTextElement*>(node());
m_localTransform = text->animatedLocalTransform();
m_needsTransformUpdate = false;
}
- RenderBlock::layout();
+ // Reduced version of RenderBlock::layoutBlock(), which only takes care of SVG text.
+ // All if branches that could cause early exit in RenderBlocks layoutBlock() method are turned into assertions.
+ ASSERT(!isInline());
+ ASSERT(!layoutOnlyPositionedObjects());
+ ASSERT(!scrollsOverflow());
+ ASSERT(!hasControlClip());
+ ASSERT(!hasColumns());
+ ASSERT(!positionedObjects());
+ ASSERT(!m_overflow);
+ ASSERT(!isAnonymousBlock());
+
+ if (!firstChild())
+ setChildrenInline(true);
+
+ ASSERT(childrenInline());
+ forceLayoutInlineChildren();
repainter.repaintAfterLayout();
setNeedsLayout(false);
@@ -128,40 +139,9 @@ bool RenderSVGText::nodeAtPoint(const HitTestRequest&, HitTestResult&, int, int,
return false;
}
-void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int, int)
-{
- RenderSVGRoot* root = findSVGRootObject(parent());
- if (!root)
- return;
-
- // Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
- // to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
- for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
- for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) {
- FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
- // FIXME: crawling up the parent chain to map each rect is very inefficient
- // we should compute the absoluteTransform outside this loop first.
- rects.append(enclosingIntRect(localToAbsoluteQuad(boxRect).boundingBox()));
- }
- }
-}
-
void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads)
{
- RenderSVGRoot* root = findSVGRootObject(parent());
- if (!root)
- return;
-
- // Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard
- // to spot errors, if there are any using WebInspector. Individually feed them into 'rects'.
- for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
- for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) {
- FloatRect boxRect(box->x(), box->y(), box->width(), box->height());
- // FIXME: crawling up the parent chain to map each quad is very inefficient
- // we should compute the absoluteTransform outside this loop first.
- quads.append(localToAbsoluteQuad(boxRect));
- }
- }
+ quads.append(localToAbsoluteQuad(strokeBoundingBox()));
}
void RenderSVGText::paint(PaintInfo& paintInfo, int, int)
@@ -169,48 +149,26 @@ void RenderSVGText::paint(PaintInfo& paintInfo, int, int)
if (paintInfo.context->paintingDisabled())
return;
- PaintInfo pi(paintInfo);
- pi.context->save();
- applyTransformToPaintInfo(pi, localToParentTransform());
- RenderBlock::paint(pi, 0, 0);
- pi.context->restore();
-}
-
-FloatRect RenderSVGText::objectBoundingBox() const
-{
- FloatRect boundingBox;
+ if (paintInfo.phase != PaintPhaseForeground
+ && paintInfo.phase != PaintPhaseSelfOutline
+ && paintInfo.phase != PaintPhaseSelection)
+ return;
- for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) {
- for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine())
- boundingBox.unite(FloatRect(box->x(), box->y(), box->width(), box->height()));
- }
-
- boundingBox.move(x(), y());
- return boundingBox;
+ PaintInfo blockInfo(paintInfo);
+ blockInfo.context->save();
+ applyTransformToPaintInfo(blockInfo, localToParentTransform());
+ RenderBlock::paint(blockInfo, 0, 0);
+ blockInfo.context->restore();
}
FloatRect RenderSVGText::strokeBoundingBox() const
{
- FloatRect strokeRect = objectBoundingBox();
-
- // SVG needs to include the strokeWidth(), not the textStrokeWidth().
- if (style()->svgStyle()->hasStroke()) {
- float strokeWidth = SVGRenderStyle::cssPrimitiveToLength(this, style()->svgStyle()->strokeWidth(), 1.0f);
+ FloatRect strokeBoundaries = objectBoundingBox();
+ if (!style()->svgStyle()->hasStroke())
+ return strokeBoundaries;
-#if ENABLE(SVG_FONTS)
- const Font& font = style()->font();
- if (font.primaryFont()->isSVGFont()) {
- float scale = font.unitsPerEm() > 0 ? font.size() / font.unitsPerEm() : 0.0f;
-
- if (scale != 0.0f)
- strokeWidth /= scale;
- }
-#endif
-
- strokeRect.inflate(strokeWidth);
- }
-
- return strokeRect;
+ strokeBoundaries.inflate(SVGRenderStyle::cssPrimitiveToLength(this, style()->svgStyle()->strokeWidth(), 1.0f));
+ return strokeBoundaries;
}
FloatRect RenderSVGText::repaintRectInLocalCoordinates() const
@@ -237,5 +195,3 @@ void RenderSVGText::updateFirstLetter()
}
#endif // ENABLE(SVG)
-
-// vim:ts=4:noet
diff --git a/WebCore/rendering/RenderSVGText.h b/WebCore/rendering/RenderSVGText.h
index 162c958..6e7d03a 100644
--- a/WebCore/rendering/RenderSVGText.h
+++ b/WebCore/rendering/RenderSVGText.h
@@ -38,14 +38,12 @@ public:
RenderSVGText(SVGTextElement* node);
virtual void setNeedsTransformUpdate() { m_needsTransformUpdate = true; }
+ virtual FloatRect repaintRectInLocalCoordinates() const;
private:
virtual const char* renderName() const { return "RenderSVGText"; }
-
virtual bool isSVGText() const { return true; }
- virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
-
virtual void paint(PaintInfo&, int tx, int ty);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
@@ -55,7 +53,6 @@ private:
virtual void destroy();
- virtual void absoluteRects(Vector<IntRect>&, int tx, int ty);
virtual void absoluteQuads(Vector<FloatQuad>&);
virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer);
@@ -63,12 +60,11 @@ private:
virtual void mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool useTransforms, bool fixed, TransformState&) const;
- virtual FloatRect objectBoundingBox() const;
+ virtual FloatRect objectBoundingBox() const { return frameRect(); }
virtual FloatRect strokeBoundingBox() const;
- virtual FloatRect repaintRectInLocalCoordinates() const;
+ virtual const AffineTransform& localToParentTransform() const { return m_localTransform; }
virtual AffineTransform localTransform() const { return m_localTransform; }
-
virtual RootInlineBox* createRootInlineBox();
virtual RenderBlock* firstLineBlock() const;
@@ -82,5 +78,3 @@ private:
#endif // ENABLE(SVG)
#endif
-
-// vim:ts=4:noet
diff --git a/WebCore/rendering/RenderSelectionInfo.h b/WebCore/rendering/RenderSelectionInfo.h
index c06a9ae..a09fc1a 100644
--- a/WebCore/rendering/RenderSelectionInfo.h
+++ b/WebCore/rendering/RenderSelectionInfo.h
@@ -22,8 +22,8 @@
*
*/
-#ifndef SelectionInfo_h
-#define SelectionInfo_h
+#ifndef RenderSelectionInfo_h
+#define RenderSelectionInfo_h
#include "IntRect.h"
#include "RenderBox.h"
@@ -101,4 +101,4 @@ private:
} // namespace WebCore
-#endif // SelectionInfo_h
+#endif // RenderSelectionInfo_h
diff --git a/WebCore/rendering/RenderSlider.cpp b/WebCore/rendering/RenderSlider.cpp
index 60b2369..591b1ac 100644
--- a/WebCore/rendering/RenderSlider.cpp
+++ b/WebCore/rendering/RenderSlider.cpp
@@ -29,7 +29,7 @@
#include "Frame.h"
#include "HTMLInputElement.h"
#include "HTMLNames.h"
-#include "LegacyHTMLTreeConstructor.h"
+#include "LegacyHTMLTreeBuilder.h"
#include "MediaControlElements.h"
#include "MouseEvent.h"
#include "RenderLayer.h"
@@ -56,7 +56,6 @@ static double sliderPosition(HTMLInputElement* element)
return range.proportionFromValue(range.valueFromElement(element));
}
-// FIXME: Could share code with the SliderDivElement class in RenderProgress.
class SliderThumbElement : public ShadowBlockElement {
public:
static PassRefPtr<SliderThumbElement> create(Node* shadowParent);
@@ -68,7 +67,7 @@ public:
private:
SliderThumbElement(Node* shadowParent);
-
+
FloatPoint m_offsetToThumb;
bool m_inDragMode;
};
@@ -81,7 +80,7 @@ inline SliderThumbElement::SliderThumbElement(Node* shadowParent)
inline PassRefPtr<SliderThumbElement> SliderThumbElement::create(Node* shadowParent)
{
- return new SliderThumbElement(shadowParent);
+ return adoptRef(new SliderThumbElement(shadowParent));
}
void SliderThumbElement::defaultEventHandler(Event* event)
@@ -111,7 +110,7 @@ void SliderThumbElement::defaultEventHandler(Event* event)
}
m_inDragMode = true;
- document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowParentNode());
+ document()->frame()->eventHandler()->setCapturingMouseEventsNode(shadowParent());
event->setDefaultHandled();
return;
}
diff --git a/WebCore/rendering/RenderTable.h b/WebCore/rendering/RenderTable.h
index 3d0714f..dace8ba 100644
--- a/WebCore/rendering/RenderTable.h
+++ b/WebCore/rendering/RenderTable.h
@@ -75,7 +75,7 @@ public:
{
}
- unsigned short span;
+ unsigned span;
unsigned width; // the calculated position of the column
};
diff --git a/WebCore/rendering/RenderTableSection.cpp b/WebCore/rendering/RenderTableSection.cpp
index 5f6c1eb..fcb6c59 100644
--- a/WebCore/rendering/RenderTableSection.cpp
+++ b/WebCore/rendering/RenderTableSection.cpp
@@ -238,7 +238,7 @@ void RenderTableSection::addCell(RenderTableCell* cell, RenderTableRow* row)
table()->appendColumn(cSpan);
currentSpan = cSpan;
} else {
- if (cSpan < columns[m_cCol].span)
+ if (cSpan < static_cast<int>(columns[m_cCol].span))
table()->splitColumn(m_cCol, cSpan);
currentSpan = columns[m_cCol].span;
}
diff --git a/WebCore/rendering/RenderText.cpp b/WebCore/rendering/RenderText.cpp
index cfd6026..c70ac58 100644
--- a/WebCore/rendering/RenderText.cpp
+++ b/WebCore/rendering/RenderText.cpp
@@ -314,7 +314,7 @@ void RenderText::absoluteRectsForRange(Vector<IntRect>& rects, unsigned start, u
void RenderText::absoluteQuads(Vector<FloatQuad>& quads)
{
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox())
- quads.append(localToAbsoluteQuad(FloatRect(box->x(), box->y(), box->width(), box->height())));
+ quads.append(localToAbsoluteQuad(FloatRect(box->calculateBoundaries())));
}
void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start, unsigned end, bool useSelectionHeight)
@@ -332,7 +332,7 @@ void RenderText::absoluteQuadsForRange(Vector<FloatQuad>& quads, unsigned start,
for (InlineTextBox* box = firstTextBox(); box; box = box->nextTextBox()) {
// Note: box->end() returns the index of the last character, not the index past it
if (start <= box->start() && box->end() < end) {
- IntRect r = IntRect(box->x(), box->y(), box->width(), box->height());
+ IntRect r(box->calculateBoundaries());
if (useSelectionHeight) {
IntRect selectionRect = box->selectionRect(0, 0, start, end);
r.setHeight(selectionRect.height());
@@ -1051,7 +1051,7 @@ void RenderText::setTextInternal(PassRefPtr<StringImpl> text)
ASSERT(m_text);
#if ENABLE(SVG)
- if (isSVGText()) {
+ if (isSVGInlineText()) {
if (style() && style()->whiteSpace() == PRE) {
// Spec: When xml:space="preserve", the SVG user agent will do the following using a
// copy of the original character data content. It will convert all newline and tab
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index d3892e9..ab56036 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -1,6 +1,7 @@
/**
* Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
* (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -299,9 +300,13 @@ bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
// If we found a spin button, we're done.
if (m_outerSpinButton && result.innerNode() == m_outerSpinButton)
return true;
- // If we're not a search field, or we already found the results or cancel buttons, we're done.
+ // If we're not a search field, or we already found the speech, results or cancel buttons, we're done.
if (!m_innerBlock || result.innerNode() == m_resultsButton || result.innerNode() == m_cancelButton)
return true;
+#if ENABLE(INPUT_SPEECH)
+ if (m_innerBlock && m_speechButton && result.innerNode() == m_speechButton)
+ return true;
+#endif
Node* innerNode = 0;
RenderBox* innerBlockRenderer = m_innerBlock->renderBox();
@@ -314,6 +319,19 @@ bool RenderTextControlSingleLine::nodeAtPoint(const HitTestRequest& request, Hit
if (m_resultsButton && m_resultsButton->renderer() && xPos < textLeft)
innerNode = m_resultsButton.get();
+#if ENABLE(INPUT_SPEECH)
+ if (!innerNode && m_speechButton && m_speechButton->renderer()) {
+ int buttonLeft = textLeft + innerTextRenderer->width();
+ if (m_cancelButton) {
+ RenderBox* cancelRenderer = m_cancelButton->renderBox();
+ cancelRenderer->calcWidth();
+ buttonLeft += cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight();
+ }
+ if (xPos > buttonLeft)
+ innerNode = m_speechButton.get();
+ }
+#endif
+
if (!innerNode) {
int textRight = textLeft + innerTextRenderer->width();
if (m_cancelButton && m_cancelButton->renderer() && xPos > textRight)
@@ -350,8 +368,20 @@ void RenderTextControlSingleLine::forwardEvent(Event* event)
FloatPoint localPoint = innerTextRenderer->absoluteToLocal(static_cast<MouseEvent*>(event)->absoluteLocation(), false, true);
int textRight = innerTextRenderer->borderBoxRect().right();
+#if ENABLE(INPUT_SPEECH)
+ int cancelRight = textRight;
+ if (m_cancelButton && m_cancelButton->renderBox()) {
+ RenderBox* cancelRenderer = m_cancelButton->renderBox();
+ cancelRight += cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight();
+ }
+#endif
+
if (m_resultsButton && localPoint.x() < innerTextRenderer->borderBoxRect().x())
m_resultsButton->defaultEventHandler(event);
+#if ENABLE(INPUT_SPEECH)
+ else if (m_speechButton && localPoint.x() > cancelRight)
+ m_speechButton->defaultEventHandler(event);
+#endif
else if (m_cancelButton && localPoint.x() > textRight)
m_cancelButton->defaultEventHandler(event);
else if (m_outerSpinButton && localPoint.x() > textRight)
@@ -381,6 +411,11 @@ void RenderTextControlSingleLine::styleDidChange(StyleDifference diff, const Ren
if (RenderObject* spinRenderer = m_outerSpinButton ? m_outerSpinButton->renderer() : 0)
spinRenderer->setStyle(createOuterSpinButtonStyle());
+#if ENABLE(INPUT_SPEECH)
+ if (RenderObject* speechRenderer = m_speechButton ? m_speechButton->renderer() : 0)
+ speechRenderer->setStyle(createSpeechButtonStyle(style()));
+#endif
+
setHasOverflowClip(false);
}
@@ -408,9 +443,19 @@ void RenderTextControlSingleLine::capsLockStateMayHaveChanged()
}
}
+bool RenderTextControlSingleLine::hasControlClip() const
+{
+ bool clip = m_cancelButton;
+#if ENABLE(INPUT_SPEECH)
+ if (m_speechButton)
+ clip = true;
+#endif
+ return clip;
+}
+
IntRect RenderTextControlSingleLine::controlClipRect(int tx, int ty) const
{
- // This should only get called for search inputs.
+ // This should only get called for search & speech inputs.
ASSERT(hasControlClip());
IntRect clipRect = IntRect(m_innerBlock->renderBox()->frameRect());
@@ -432,6 +477,13 @@ int RenderTextControlSingleLine::textBlockWidth() const
width -= cancelRenderer->width() + cancelRenderer->marginLeft() + cancelRenderer->marginRight();
}
+#if ENABLE(INPUT_SPEECH)
+ if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
+ speechRenderer->calcWidth();
+ width -= speechRenderer->width() + speechRenderer->marginLeft() + speechRenderer->marginRight();
+ }
+#endif
+
return width - decorationWidthRight();
}
@@ -490,6 +542,12 @@ int RenderTextControlSingleLine::preferredContentWidth(float charWidth) const
result += cancelRenderer->borderLeft() + cancelRenderer->borderRight() +
cancelRenderer->paddingLeft() + cancelRenderer->paddingRight();
+#if ENABLE(INPUT_SPEECH)
+ if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
+ result += speechRenderer->borderLeft() + speechRenderer->borderRight() +
+ speechRenderer->paddingLeft() + speechRenderer->paddingRight();
+ }
+#endif
return result;
}
@@ -525,12 +583,28 @@ void RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight(int lineH
lineHeight = max(lineHeight, cancelRenderer->height());
}
+#if ENABLE(INPUT_SPEECH)
+ if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0) {
+ toRenderBlock(speechRenderer)->calcHeight();
+ setHeight(max(height(),
+ speechRenderer->borderTop() + speechRenderer->borderBottom() +
+ speechRenderer->paddingTop() + speechRenderer->paddingBottom() +
+ speechRenderer->marginTop() + speechRenderer->marginBottom()));
+ lineHeight = max(lineHeight, speechRenderer->height());
+ }
+#endif
+
setHeight(height() + lineHeight);
}
void RenderTextControlSingleLine::createSubtreeIfNeeded()
{
- if (!inputElement()->isSearchField()) {
+ bool createSubtree = inputElement()->isSearchField();
+#if ENABLE(INPUT_SPEECH)
+ if (inputElement()->isSpeechEnabled())
+ createSubtree = true;
+#endif
+ if (!createSubtree) {
RenderTextControl::createSubtreeIfNeeded(m_innerBlock.get());
if (inputElement()->hasSpinButton() && !m_outerSpinButton) {
m_outerSpinButton = SpinButtonElement::create(node());
@@ -545,20 +619,31 @@ void RenderTextControlSingleLine::createSubtreeIfNeeded()
m_innerBlock->attachInnerElement(node(), createInnerBlockStyle(style()), renderArena());
}
- if (!m_resultsButton) {
- // Create the search results button element
- m_resultsButton = SearchFieldResultsButtonElement::create(document());
- m_resultsButton->attachInnerElement(m_innerBlock.get(), createResultsButtonStyle(m_innerBlock->renderer()->style()), renderArena());
+ if (inputElement()->isSearchField()) {
+ if (!m_resultsButton) {
+ // Create the search results button element.
+ m_resultsButton = SearchFieldResultsButtonElement::create(document());
+ m_resultsButton->attachInnerElement(m_innerBlock.get(), createResultsButtonStyle(m_innerBlock->renderer()->style()), renderArena());
+ }
}
- // Create innerText element before adding the cancel button
+ // Create innerText element before adding the other buttons.
RenderTextControl::createSubtreeIfNeeded(m_innerBlock.get());
- if (!m_cancelButton) {
- // Create the cancel button element
- m_cancelButton = SearchFieldCancelButtonElement::create(document());
- m_cancelButton->attachInnerElement(m_innerBlock.get(), createCancelButtonStyle(m_innerBlock->renderer()->style()), renderArena());
+ if (inputElement()->isSearchField()) {
+ if (!m_cancelButton) {
+ // Create the cancel button element.
+ m_cancelButton = SearchFieldCancelButtonElement::create(document());
+ m_cancelButton->attachInnerElement(m_innerBlock.get(), createCancelButtonStyle(m_innerBlock->renderer()->style()), renderArena());
+ }
}
+#if ENABLE(INPUT_SPEECH)
+ if (inputElement()->isSpeechEnabled() && !m_speechButton) {
+ // Create the speech button element.
+ m_speechButton = InputFieldSpeechButtonElement::create(document());
+ m_speechButton->attachInnerElement(m_innerBlock.get(), createSpeechButtonStyle(m_innerBlock->renderer()->style()), renderArena());
+ }
+#endif
}
void RenderTextControlSingleLine::updateFromElement()
@@ -696,6 +781,19 @@ PassRefPtr<RenderStyle> RenderTextControlSingleLine::createOuterSpinButtonStyle(
return buttonStyle.release();
}
+#if ENABLE(INPUT_SPEECH)
+PassRefPtr<RenderStyle> RenderTextControlSingleLine::createSpeechButtonStyle(const RenderStyle* startStyle) const
+{
+ ASSERT(node()->isHTMLElement());
+ RefPtr<RenderStyle> buttonStyle = getCachedPseudoStyle(INPUT_SPEECH_BUTTON);
+ if (!buttonStyle)
+ buttonStyle = RenderStyle::create();
+ if (startStyle)
+ buttonStyle->inheritFrom(startStyle);
+ return buttonStyle.release();
+}
+#endif
+
void RenderTextControlSingleLine::updateCancelButtonVisibility() const
{
if (!m_cancelButton->renderer())
@@ -834,6 +932,10 @@ int RenderTextControlSingleLine::clientPaddingRight() const
if (RenderBox* cancelRenderer = m_cancelButton ? m_cancelButton->renderBox() : 0)
padding += cancelRenderer->width();
+#if ENABLE(INPUT_SPEECH)
+ if (RenderBox* speechRenderer = m_speechButton ? m_speechButton->renderBox() : 0)
+ padding += speechRenderer->width();
+#endif
return padding;
}
diff --git a/WebCore/rendering/RenderTextControlSingleLine.h b/WebCore/rendering/RenderTextControlSingleLine.h
index dff9e5f..ab9f711 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.h
+++ b/WebCore/rendering/RenderTextControlSingleLine.h
@@ -29,6 +29,7 @@
namespace WebCore {
class InputElement;
+class InputFieldSpeechButtonElement;
class SearchFieldCancelButtonElement;
class SearchFieldResultsButtonElement;
class SearchPopupMenu;
@@ -59,7 +60,7 @@ public:
private:
int preferredDecorationWidthRight() const;
- virtual bool hasControlClip() const { return m_cancelButton; }
+ virtual bool hasControlClip() const;
virtual IntRect controlClipRect(int tx, int ty) const;
virtual bool isTextField() const { return true; }
@@ -98,6 +99,9 @@ private:
PassRefPtr<RenderStyle> createResultsButtonStyle(const RenderStyle* startStyle) const;
PassRefPtr<RenderStyle> createCancelButtonStyle(const RenderStyle* startStyle) const;
PassRefPtr<RenderStyle> createOuterSpinButtonStyle() const;
+#if ENABLE(INPUT_SPEECH)
+ PassRefPtr<RenderStyle> createSpeechButtonStyle(const RenderStyle* startStyle) const;
+#endif
void updateCancelButtonVisibility() const;
EVisibility visibilityForCancelButton() const;
@@ -142,6 +146,9 @@ private:
RefPtr<SearchFieldResultsButtonElement> m_resultsButton;
RefPtr<SearchFieldCancelButtonElement> m_cancelButton;
RefPtr<TextControlInnerElement> m_outerSpinButton;
+#if ENABLE(INPUT_SPEECH)
+ RefPtr<InputFieldSpeechButtonElement> m_speechButton;
+#endif
Timer<RenderTextControlSingleLine> m_searchEventTimer;
RefPtr<SearchPopupMenu> m_searchPopup;
diff --git a/WebCore/rendering/RenderTheme.cpp b/WebCore/rendering/RenderTheme.cpp
index 2b5efc9..407f273 100644
--- a/WebCore/rendering/RenderTheme.cpp
+++ b/WebCore/rendering/RenderTheme.cpp
@@ -232,6 +232,10 @@ void RenderTheme::adjustStyle(CSSStyleSelector* selector, RenderStyle* style, El
case RatingLevelIndicatorPart:
return adjustMeterStyle(selector, style, e);
#endif
+#if ENABLE(INPUT_SPEECH)
+ case InputSpeechButtonPart:
+ // FIXME: Adjust the speech button's style and sizes.
+#endif
default:
break;
}
@@ -362,6 +366,10 @@ bool RenderTheme::paint(RenderObject* o, const RenderObject::PaintInfo& paintInf
return paintSearchFieldResultsDecoration(o, paintInfo, r);
case SearchFieldResultsButtonPart:
return paintSearchFieldResultsButton(o, paintInfo, r);
+#if ENABLE(INPUT_SPEECH)
+ case InputSpeechButtonPart:
+ // FIXME: Add painting code to draw the speech button.
+#endif
default:
break;
}
@@ -410,6 +418,9 @@ bool RenderTheme::paintBorderOnly(RenderObject* o, const RenderObject::PaintInfo
case SearchFieldDecorationPart:
case SearchFieldResultsDecorationPart:
case SearchFieldResultsButtonPart:
+#if ENABLE(INPUT_SPEECH)
+ case InputSpeechButtonPart:
+#endif
default:
break;
}
@@ -456,6 +467,9 @@ bool RenderTheme::paintDecorations(RenderObject* o, const RenderObject::PaintInf
case SearchFieldDecorationPart:
case SearchFieldResultsDecorationPart:
case SearchFieldResultsButtonPart:
+#if ENABLE(INPUT_SPEECH)
+ case InputSpeechButtonPart:
+#endif
default:
break;
}
@@ -655,6 +669,11 @@ bool RenderTheme::isControlStyled(const RenderStyle* style, const BorderData& bo
case ListboxPart:
case MenulistPart:
case ProgressBarPart:
+ case MeterPart:
+ case RelevancyLevelIndicatorPart:
+ case ContinuousCapacityLevelIndicatorPart:
+ case DiscreteCapacityLevelIndicatorPart:
+ case RatingLevelIndicatorPart:
// FIXME: Uncomment this when making search fields style-able.
// case SearchFieldPart:
case TextFieldPart:
@@ -918,56 +937,16 @@ IntSize RenderTheme::meterSizeForBounds(const RenderMeter*, const IntRect& bound
return bounds.size();
}
-bool RenderTheme::paintMeter(RenderObject* renderObject, const RenderObject::PaintInfo& paintInfo, const IntRect& rect)
+bool RenderTheme::supportsMeter(ControlPart, bool) const
{
- if (!renderObject->isMeter())
- return true;
-
- // Some platforms do not have a native gauge widget, so we draw here a default implementation.
- RenderMeter* renderMeter = toRenderMeter(renderObject);
- RenderStyle* style = renderObject->style();
- int left = style->borderLeft().width() + style->paddingLeft().value();
- int top = style->borderTop().width() + style->paddingTop().value();
- int right = style->borderRight().width() + style->paddingRight().value();
- int bottom = style->borderBottom().width() + style->paddingBottom().value();
- FloatRect innerRect(rect.x() + left, rect.y() + top, rect.width() - left - right, rect.height() - top - bottom);
-
- HTMLMeterElement* element = static_cast<HTMLMeterElement*>(renderMeter->node());
- double min = element->min();
- double max = element->max();
- double value = element->value();
-
- if (min >= max) {
- paintInfo.context->fillRect(innerRect, Color::black, style->colorSpace());
- return false;
- }
-
- // Paint the background first
- paintInfo.context->fillRect(innerRect, Color::lightGray, style->colorSpace());
-
- FloatRect valueRect;
-
- if (rect.width() < rect.height()) {
- // Vertical gauge
- double scale = innerRect.height() / (max - min);
- valueRect.setLocation(FloatPoint(innerRect.x(), innerRect.y() + narrowPrecisionToFloat((max - value) * scale)));
- valueRect.setSize(FloatSize(innerRect.width(), narrowPrecisionToFloat((value - min) * scale)));
- } else if (renderMeter->style()->direction() == RTL) {
- // right to left horizontal gauge
- double scale = innerRect.width() / (max - min);
- valueRect.setLocation(FloatPoint(innerRect.x() + narrowPrecisionToFloat((max - value) * scale), innerRect.y()));
- valueRect.setSize(FloatSize(narrowPrecisionToFloat((value - min) * scale), innerRect.height()));
- } else {
- // left to right horizontal gauge
- double scale = innerRect.width() / (max - min);
- valueRect.setLocation(innerRect.location());
- valueRect.setSize(FloatSize(narrowPrecisionToFloat((value - min) * scale), innerRect.height()));
- }
- if (!valueRect.isEmpty())
- paintInfo.context->fillRect(valueRect, Color::black, style->colorSpace());
-
return false;
}
+
+bool RenderTheme::paintMeter(RenderObject*, const RenderObject::PaintInfo&, const IntRect&)
+{
+ return true;
+}
+
#endif
#if ENABLE(PROGRESS_TAG)
diff --git a/WebCore/rendering/RenderTheme.h b/WebCore/rendering/RenderTheme.h
index 2d196c7..72a33dc 100644
--- a/WebCore/rendering/RenderTheme.h
+++ b/WebCore/rendering/RenderTheme.h
@@ -195,6 +195,7 @@ public:
#if ENABLE(METER_TAG)
virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
+ virtual bool supportsMeter(ControlPart, bool isHorizontal) const;
#endif
protected:
diff --git a/WebCore/rendering/RenderThemeChromiumMac.mm b/WebCore/rendering/RenderThemeChromiumMac.mm
index 47a872d..e572b69 100644
--- a/WebCore/rendering/RenderThemeChromiumMac.mm
+++ b/WebCore/rendering/RenderThemeChromiumMac.mm
@@ -91,7 +91,7 @@ void RenderThemeChromiumMac::updateActiveState(NSCell* cell, const RenderObject*
{
NSControlTint oldTint = [cell controlTint];
NSControlTint tint = isActive(o) ? [NSColor currentControlTint] :
- NSClearControlTint;
+ static_cast<NSControlTint>(NSClearControlTint);
if (tint != oldTint)
[cell setControlTint:tint];
diff --git a/WebCore/rendering/RenderThemeMac.h b/WebCore/rendering/RenderThemeMac.h
index 7cb4e3b..34dbed3 100644
--- a/WebCore/rendering/RenderThemeMac.h
+++ b/WebCore/rendering/RenderThemeMac.h
@@ -83,6 +83,7 @@ public:
#if ENABLE(METER_TAG)
virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
virtual bool paintMeter(RenderObject*, const RenderObject::PaintInfo&, const IntRect&);
+ virtual bool supportsMeter(ControlPart, bool isHorizontal) const;
#endif
#if ENABLE(PROGRESS_TAG)
diff --git a/WebCore/rendering/RenderThemeMac.mm b/WebCore/rendering/RenderThemeMac.mm
index d0289de..9c79386 100644
--- a/WebCore/rendering/RenderThemeMac.mm
+++ b/WebCore/rendering/RenderThemeMac.mm
@@ -839,6 +839,20 @@ bool RenderThemeMac::paintMeter(RenderObject* renderObject, const RenderObject::
return false;
}
+bool RenderThemeMac::supportsMeter(ControlPart part, bool isHorizontal) const
+{
+ switch (part) {
+ case RelevancyLevelIndicatorPart:
+ case DiscreteCapacityLevelIndicatorPart:
+ case RatingLevelIndicatorPart:
+ case MeterPart:
+ case ContinuousCapacityLevelIndicatorPart:
+ return isHorizontal;
+ default:
+ return false;
+ }
+}
+
NSLevelIndicatorStyle RenderThemeMac::levelIndicatorStyleFor(ControlPart part) const
{
switch (part) {
diff --git a/WebCore/rendering/RenderTreeAsText.cpp b/WebCore/rendering/RenderTreeAsText.cpp
index b05d97a..26f40ab 100644
--- a/WebCore/rendering/RenderTreeAsText.cpp
+++ b/WebCore/rendering/RenderTreeAsText.cpp
@@ -416,10 +416,11 @@ void write(TextStream& ts, const RenderObject& o, int indent, RenderAsTextBehavi
return;
}
if (o.isSVGText()) {
- if (!o.isText())
- writeSVGText(ts, *toRenderBlock(&o), indent);
- else
- writeSVGInlineText(ts, *toRenderText(&o), indent);
+ writeSVGText(ts, *toRenderBlock(&o), indent);
+ return;
+ }
+ if (o.isSVGInlineText()) {
+ writeSVGInlineText(ts, *toRenderText(&o), indent);
return;
}
if (o.isSVGImage()) {
diff --git a/WebCore/rendering/RenderView.cpp b/WebCore/rendering/RenderView.cpp
index 8079760..e77f6c7 100644
--- a/WebCore/rendering/RenderView.cpp
+++ b/WebCore/rendering/RenderView.cpp
@@ -193,9 +193,17 @@ void RenderView::paint(PaintInfo& paintInfo, int tx, int ty)
paintObject(paintInfo, tx, ty);
}
+static inline bool isComposited(RenderObject* object)
+{
+ return object->hasLayer() && toRenderBoxModelObject(object)->layer()->isComposited();
+}
+
static inline bool rendererObscuresBackground(RenderObject* object)
{
- return object && object->style()->visibility() == VISIBLE && object->style()->opacity() == 1 && !object->style()->hasTransform();
+ return object && object->style()->visibility() == VISIBLE
+ && object->style()->opacity() == 1
+ && !object->style()->hasTransform()
+ && !isComposited(object);
}
void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int, int)
@@ -223,8 +231,19 @@ void RenderView::paintBoxDecorations(PaintInfo& paintInfo, int, int)
#endif
}
+ if (document()->ownerElement() || !view())
+ return;
+
+ bool rootFillsViewport = false;
+ Node* documentElement = document()->documentElement();
+ if (RenderObject* rootRenderer = documentElement ? documentElement->renderer() : 0) {
+ // The document element's renderer is currently forced to be a block, but may not always be.
+ RenderBox* rootBox = rootRenderer->isBox() ? toRenderBox(rootRenderer) : 0;
+ rootFillsViewport = rootBox && !rootBox->x() && !rootBox->y() && rootBox->width() >= width() && rootBox->height() >= height();
+ }
+
// If painting will entirely fill the view, no need to fill the background.
- if (elt || rendererObscuresBackground(firstChild()) || !view())
+ if (rootFillsViewport && rendererObscuresBackground(firstChild()))
return;
// This code typically only executes if the root element's visibility has been set to hidden,
diff --git a/WebCore/rendering/RootInlineBox.cpp b/WebCore/rendering/RootInlineBox.cpp
index 24e49c6..3a8a4f5 100644
--- a/WebCore/rendering/RootInlineBox.cpp
+++ b/WebCore/rendering/RootInlineBox.cpp
@@ -47,11 +47,11 @@ void RootInlineBox::destroy(RenderArena* arena)
void RootInlineBox::detachEllipsisBox(RenderArena* arena)
{
- if (m_hasEllipsisBox) {
+ if (hasEllipsisBox()) {
EllipsisBox* box = gEllipsisBoxMap->take(this);
box->setParent(0);
box->destroy(arena);
- m_hasEllipsisBox = false;
+ setHasEllipsisBox(false);
}
}
@@ -62,7 +62,7 @@ RenderLineBoxList* RootInlineBox::rendererLineBoxes() const
void RootInlineBox::clearTruncation()
{
- if (m_hasEllipsisBox) {
+ if (hasEllipsisBox()) {
detachEllipsisBox(renderer()->renderArena());
InlineFlowBox::clearTruncation();
}
@@ -92,7 +92,7 @@ void RootInlineBox::placeEllipsis(const AtomicString& ellipsisStr, bool ltr, in
if (!gEllipsisBoxMap)
gEllipsisBoxMap = new EllipsisBoxMap();
gEllipsisBoxMap->add(this, ellipsisBox);
- m_hasEllipsisBox = true;
+ setHasEllipsisBox(true);
// FIXME: Do we need an RTL version of this?
if (ltr && (x() + width() + ellipsisWidth) <= blockRightEdge) {
@@ -117,8 +117,8 @@ int RootInlineBox::placeEllipsisBox(bool ltr, int blockLeftEdge, int blockRightE
void RootInlineBox::paintEllipsisBox(RenderObject::PaintInfo& paintInfo, int tx, int ty) const
{
- if (m_hasEllipsisBox && renderer()->shouldPaintWithinRoot(paintInfo) && renderer()->style()->visibility() == VISIBLE &&
- paintInfo.phase == PaintPhaseForeground)
+ if (hasEllipsisBox() && renderer()->shouldPaintWithinRoot(paintInfo) && renderer()->style()->visibility() == VISIBLE
+ && paintInfo.phase == PaintPhaseForeground)
ellipsisBox()->paint(paintInfo, tx, ty);
}
@@ -174,7 +174,7 @@ void RootInlineBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
bool RootInlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result, int x, int y, int tx, int ty)
{
- if (m_hasEllipsisBox && visibleToHitTesting()) {
+ if (hasEllipsisBox() && visibleToHitTesting()) {
if (ellipsisBox()->nodeAtPoint(request, result, x, y, tx, ty)) {
renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
return true;
@@ -204,6 +204,12 @@ void RootInlineBox::childRemoved(InlineBox* box)
int RootInlineBox::verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallbackFontsMap& textBoxDataMap)
{
+#if ENABLE(SVG)
+ // SVG will handle vertical alignment on its own.
+ if (isSVGRootInlineBox())
+ return 0;
+#endif
+
int maxPositionTop = 0;
int maxPositionBottom = 0;
int maxAscent = 0;
@@ -410,8 +416,8 @@ void RootInlineBox::setLineBreakInfo(RenderObject* obj, unsigned breakPos, const
EllipsisBox* RootInlineBox::ellipsisBox() const
{
- if (!m_hasEllipsisBox)
- return false;
+ if (!hasEllipsisBox())
+ return 0;
return gEllipsisBoxMap->get(this);
}
diff --git a/WebCore/rendering/RootInlineBox.h b/WebCore/rendering/RootInlineBox.h
index cfa550b..fa2510a 100644
--- a/WebCore/rendering/RootInlineBox.h
+++ b/WebCore/rendering/RootInlineBox.h
@@ -61,15 +61,11 @@ public:
int selectionBottom() const { return lineBottom(); }
int selectionHeight() const { return max(0, selectionBottom() - selectionTop()); }
- virtual int verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallbackFontsMap&);
+ int verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallbackFontsMap&);
void setLineTopBottomPositions(int top, int bottom);
virtual RenderLineBoxList* rendererLineBoxes() const;
-#if ENABLE(SVG)
- virtual void computePerCharacterLayoutInformation() { }
-#endif
-
RenderObject* lineBreakObj() const { return m_lineBreakObj; }
BidiStatus lineBreakBidiStatus() const;
void setLineBreakInfo(RenderObject*, unsigned breakPos, const BidiStatus&);
@@ -132,7 +128,10 @@ public:
virtual void attachLineBoxToRenderObject();
virtual void removeLineBoxFromRenderObject();
-protected:
+private:
+ bool hasEllipsisBox() const { return m_hasEllipsisBoxOrHyphen; }
+ void setHasEllipsisBox(bool hasEllipsisBox) { m_hasEllipsisBoxOrHyphen = hasEllipsisBox; }
+
// Where this line ended. The exact object and the position within that object are stored so that
// we can create an InlineIterator beginning just after the end of this line.
RenderObject* m_lineBreakObj;
diff --git a/WebCore/rendering/SVGCharacterData.h b/WebCore/rendering/SVGCharacterData.h
index 68682c9..5143042 100644
--- a/WebCore/rendering/SVGCharacterData.h
+++ b/WebCore/rendering/SVGCharacterData.h
@@ -90,12 +90,6 @@ struct SVGChar {
AffineTransform characterTransform() const;
};
-struct SVGTextDecorationInfo {
- // ETextDecoration is meant to be used here
- HashMap<int, RenderObject*> fillServerMap;
- HashMap<int, RenderObject*> strokeServerMap;
-};
-
} // namespace WebCore
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGCharacterLayoutInfo.cpp b/WebCore/rendering/SVGCharacterLayoutInfo.cpp
index 04f0067..18315df 100644
--- a/WebCore/rendering/SVGCharacterLayoutInfo.cpp
+++ b/WebCore/rendering/SVGCharacterLayoutInfo.cpp
@@ -67,7 +67,7 @@ static float calculateBaselineShift(RenderObject* item)
return baselineShift;
}
-SVGCharacterLayoutInfo::SVGCharacterLayoutInfo(Vector<SVGChar>& chars)
+SVGCharacterLayoutInfo::SVGCharacterLayoutInfo()
: curx(0.0f)
, cury(0.0f)
, angle(0.0f)
@@ -78,7 +78,6 @@ SVGCharacterLayoutInfo::SVGCharacterLayoutInfo(Vector<SVGChar>& chars)
, pathExtraAdvance(0.0f)
, pathTextLength(0.0f)
, pathChunkLength(0.0f)
- , svgChars(chars)
, nextDrawnSeperated(false)
, xStackChanged(false)
, yStackChanged(false)
diff --git a/WebCore/rendering/SVGCharacterLayoutInfo.h b/WebCore/rendering/SVGCharacterLayoutInfo.h
index 16fd740..7549283 100644
--- a/WebCore/rendering/SVGCharacterLayoutInfo.h
+++ b/WebCore/rendering/SVGCharacterLayoutInfo.h
@@ -67,7 +67,7 @@ class PositionedFloatVector : public PositionedVector<float> { };
struct SVGChar;
struct SVGCharacterLayoutInfo {
- SVGCharacterLayoutInfo(Vector<SVGChar>&);
+ SVGCharacterLayoutInfo();
enum StackType { XStack, YStack, DxStack, DyStack, AngleStack, BaselineShiftStack };
@@ -120,7 +120,7 @@ struct SVGCharacterLayoutInfo {
float pathChunkLength;
// Result vector
- Vector<SVGChar>& svgChars;
+ Vector<SVGChar> svgChars;
bool nextDrawnSeperated : 1;
private:
diff --git a/WebCore/rendering/SVGInlineFlowBox.cpp b/WebCore/rendering/SVGInlineFlowBox.cpp
index bbd61b3..1cd938a 100644
--- a/WebCore/rendering/SVGInlineFlowBox.cpp
+++ b/WebCore/rendering/SVGInlineFlowBox.cpp
@@ -1,9 +1,8 @@
/*
- * This file is part of the WebKit project.
- *
* Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
* (C) 2006 Apple Computer Inc.
* (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -23,24 +22,43 @@
*/
#include "config.h"
+#include "SVGInlineFlowBox.h"
#if ENABLE(SVG)
-#include "SVGInlineFlowBox.h"
-#include "SVGNames.h"
+#include "GraphicsContext.h"
+#include "SVGRenderSupport.h"
namespace WebCore {
-using namespace SVGNames;
-
-void SVGInlineFlowBox::paint(RenderObject::PaintInfo&, int, int)
+void SVGInlineFlowBox::paint(RenderObject::PaintInfo& paintInfo, int, int)
{
- ASSERT_NOT_REACHED();
+ ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
+ ASSERT(!paintInfo.context->paintingDisabled());
+
+ RenderObject* boxRenderer = renderer();
+ ASSERT(boxRenderer);
+
+ RenderObject::PaintInfo childPaintInfo(paintInfo);
+ childPaintInfo.context->save();
+
+ RenderSVGResourceFilter* filter = 0;
+ FloatRect repaintRect = boxRenderer->repaintRectInLocalCoordinates();
+
+ if (SVGRenderBase::prepareToRenderSVGContent(boxRenderer, childPaintInfo, repaintRect, filter)) {
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
+ child->paint(childPaintInfo, 0, 0);
+ }
+
+ SVGRenderBase::finishRenderSVGContent(boxRenderer, childPaintInfo, filter, paintInfo.context);
+ childPaintInfo.context->restore();
}
-int SVGInlineFlowBox::placeBoxesHorizontally(int, int&, int&, bool&, GlyphOverflowAndFallbackFontsMap&)
+IntRect SVGInlineFlowBox::calculateBoundaries() const
{
- // no-op
- return 0;
+ IntRect childRect;
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
+ childRect.unite(child->calculateBoundaries());
+ return childRect;
}
} // namespace WebCore
diff --git a/WebCore/rendering/SVGInlineFlowBox.h b/WebCore/rendering/SVGInlineFlowBox.h
index 17ad528..ba4c5b2 100644
--- a/WebCore/rendering/SVGInlineFlowBox.h
+++ b/WebCore/rendering/SVGInlineFlowBox.h
@@ -41,8 +41,10 @@ public:
void setHeight(int h) { m_height = h; }
virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
- virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
-
+
+ virtual IntRect calculateBoundaries() const;
+ void layoutFlowBox();
+
private:
int m_height;
};
diff --git a/WebCore/rendering/SVGInlineTextBox.cpp b/WebCore/rendering/SVGInlineTextBox.cpp
index 8bd7fef..68b4fd0 100644
--- a/WebCore/rendering/SVGInlineTextBox.cpp
+++ b/WebCore/rendering/SVGInlineTextBox.cpp
@@ -21,25 +21,28 @@
*/
#include "config.h"
-
-#if ENABLE(SVG)
#include "SVGInlineTextBox.h"
-#include "Frame.h"
+#if ENABLE(SVG)
+#include "FloatConversion.h"
#include "GraphicsContext.h"
#include "InlineFlowBox.h"
+#include "RenderBlock.h"
#include "RenderSVGResource.h"
#include "SVGRootInlineBox.h"
#include "SVGTextLayoutUtilities.h"
-#include "Text.h"
#include <float.h>
+using namespace std;
+
namespace WebCore {
-SVGInlineTextBox::SVGInlineTextBox(RenderObject* obj)
- : InlineTextBox(obj)
+SVGInlineTextBox::SVGInlineTextBox(RenderObject* object)
+ : InlineTextBox(object)
, m_height(0)
+ , m_paintingResource(0)
+ , m_paintingResourceMode(ApplyToDefaultMode)
{
}
@@ -60,522 +63,550 @@ SVGRootInlineBox* SVGInlineTextBox::svgRootInlineBox() const
return static_cast<SVGRootInlineBox*>(parentBox);
}
-float SVGInlineTextBox::calculateGlyphWidth(RenderStyle* style, int offset, int extraCharsAvailable, int& charsConsumed, String& glyphName) const
+void SVGInlineTextBox::measureCharacter(RenderStyle* style, int position, int& charsConsumed, String& glyphName, String& unicodeString, float& glyphWidth, float& glyphHeight) const
{
ASSERT(style);
- return style->font().floatWidth(svgTextRunForInlineTextBox(textRenderer()->characters() + offset, 1, style, this, 0), extraCharsAvailable, charsConsumed, glyphName);
-}
-float SVGInlineTextBox::calculateGlyphHeight(RenderStyle* style, int, int) const
-{
- // This is just a guess, and the only purpose of this function is to centralize this hack.
- // In real-life top-top-bottom scripts this won't be enough, I fear.
- return style->font().ascent() + style->font().descent();
+ int offset = direction() == RTL ? end() - position : start() + position;
+ int extraCharsAvailable = len() - position - 1;
+ const UChar* characters = textRenderer()->characters();
+
+ const Font& font = style->font();
+ glyphWidth = font.floatWidth(svgTextRunForInlineTextBox(characters + offset, 1, style, this), extraCharsAvailable, charsConsumed, glyphName);
+ glyphHeight = font.height();
+
+ // The unicodeString / glyphName pair is needed for kerning calculations.
+ unicodeString = String(characters + offset, charsConsumed);
}
-FloatRect SVGInlineTextBox::calculateGlyphBoundaries(RenderStyle* style, int offset, const SVGChar& svgChar) const
+int SVGInlineTextBox::offsetForPosition(int xCoordinate, bool includePartialGlyphs) const
{
- const Font& font = style->font();
+ ASSERT(!m_currentChunkPart.isValid());
+ float x = xCoordinate;
- // Take RTL text into account and pick right glyph width/height.
- float glyphWidth = 0.0f;
+ RenderText* textRenderer = this->textRenderer();
+ ASSERT(textRenderer);
- // FIXME: account for multi-character glyphs
- int charsConsumed;
- String glyphName;
- if (direction() == LTR)
- glyphWidth = calculateGlyphWidth(style, offset, 0, charsConsumed, glyphName);
- else
- glyphWidth = calculateGlyphWidth(style, start() + end() - offset, 0, charsConsumed, glyphName);
+ RenderStyle* style = textRenderer->style();
+ ASSERT(style);
- float x1 = svgChar.x;
- float x2 = svgChar.x + glyphWidth;
+ RenderBlock* containingBlock = textRenderer->containingBlock();
+ ASSERT(containingBlock);
- float y1 = svgChar.y - font.ascent();
- float y2 = svgChar.y + font.descent();
+ // Move incoming relative x position to absolute position, as the character origins stored in the chunk parts use absolute coordinates
+ x += containingBlock->x();
- FloatRect glyphRect(x1, y1, x2 - x1, y2 - y1);
+ // Figure out which text chunk part is hit
+ SVGTextChunkPart hitPart;
- // Take per-character transformations into account
- glyphRect = svgChar.characterTransform().mapRect(glyphRect);
+ const Vector<SVGTextChunkPart>::const_iterator end = m_svgTextChunkParts.end();
+ for (Vector<SVGTextChunkPart>::const_iterator it = m_svgTextChunkParts.begin(); it != end; ++it) {
+ const SVGTextChunkPart& part = *it;
- return glyphRect;
-}
+ // Check whether we're past the hit part.
+ if (x < part.firstCharacter->x)
+ break;
-// Helper class for closestCharacterToPosition()
-struct SVGInlineTextBoxClosestCharacterToPositionWalker {
- SVGInlineTextBoxClosestCharacterToPositionWalker(int x, int y)
- : m_character(0)
- , m_distance(FLT_MAX)
- , m_x(x)
- , m_y(y)
- , m_offsetOfHitCharacter(0)
- {
+ hitPart = part;
}
- void chunkPortionCallback(SVGInlineTextBox* textBox, int startOffset, const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end)
- {
- RenderStyle* style = textBox->textRenderer()->style();
+ // If we did not hit anything, just exit.
+ if (!hitPart.isValid())
+ return 0;
- Vector<SVGChar>::iterator closestCharacter = 0;
- unsigned int closestOffset = UINT_MAX;
+ // Before calling Font::offsetForPosition(), subtract the start position of the first character
+ // in the hit text chunk part, to pass in coordinates, which are relative to the text chunk part, as
+ // constructTextRun() only builds a TextRun for the current chunk part, not the whole inline text box.
+ x -= hitPart.firstCharacter->x;
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (it->isHidden())
- continue;
+ m_currentChunkPart = hitPart;
+ TextRun textRun(constructTextRun(style));
+ m_currentChunkPart = SVGTextChunkPart();
- unsigned int newOffset = textBox->start() + (it - start) + startOffset;
- FloatRect glyphRect = chunkCtm.mapRect(textBox->calculateGlyphBoundaries(style, newOffset, *it));
+ // Eventually handle lengthAdjust="spacingAndGlyphs".
+ if (!m_chunkTransformation.isIdentity())
+ textRun.setGlyphScale(narrowPrecisionToFloat(isVerticalWritingMode(style->svgStyle()) ? m_chunkTransformation.d() : m_chunkTransformation.a()));
- // Take RTL text into account and pick right glyph width/height.
- // NOTE: This offset has to be corrected _after_ calling calculateGlyphBoundaries
- if (textBox->direction() == RTL)
- newOffset = textBox->start() + textBox->end() - newOffset;
+ return hitPart.offset + style->font().offsetForPosition(textRun, x, includePartialGlyphs);
+}
- // Calculate distances relative to the glyph mid-point. I hope this is accurate enough.
- float xDistance = glyphRect.x() + glyphRect.width() / 2.0f - m_x;
- float yDistance = glyphRect.y() - glyphRect.height() / 2.0f - m_y;
+int SVGInlineTextBox::positionForOffset(int) const
+{
+ // SVG doesn't use the offset <-> position selection system.
+ ASSERT_NOT_REACHED();
+ return 0;
+}
- float newDistance = sqrtf(xDistance * xDistance + yDistance * yDistance);
- if (newDistance <= m_distance) {
- m_distance = newDistance;
- closestOffset = newOffset;
- closestCharacter = it;
- }
- }
+FloatRect SVGInlineTextBox::selectionRectForTextChunkPart(const SVGTextChunkPart& part, int partStartPos, int partEndPos, RenderStyle* style)
+{
+ // Map startPos/endPos positions into chunk part
+ mapStartEndPositionsIntoChunkPartCoordinates(partStartPos, partEndPos, part);
- if (closestOffset != UINT_MAX) {
- // Record current chunk, if it contains the current closest character next to the mouse.
- m_character = closestCharacter;
- m_offsetOfHitCharacter = closestOffset;
- }
- }
+ if (partStartPos >= partEndPos)
+ return FloatRect();
- SVGChar* character() const
- {
- return m_character;
- }
+ // Set current chunk part, so constructTextRun() works properly.
+ m_currentChunkPart = part;
- int offsetOfHitCharacter() const
- {
- if (!m_character)
- return 0;
+ const Font& font = style->font();
+ Vector<SVGChar>::const_iterator character = part.firstCharacter;
+ FloatPoint textOrigin(character->x, character->y - font.ascent());
- return m_offsetOfHitCharacter;
- }
+ FloatRect partRect(font.selectionRectForText(constructTextRun(style), textOrigin, part.height, partStartPos, partEndPos));
+ m_currentChunkPart = SVGTextChunkPart();
-private:
- Vector<SVGChar>::iterator m_character;
- float m_distance;
+ return character->characterTransform().mapRect(partRect);
+}
- int m_x;
- int m_y;
- int m_offsetOfHitCharacter;
-};
+IntRect SVGInlineTextBox::selectionRect(int, int, int startPos, int endPos)
+{
+ ASSERT(!m_currentChunkPart.isValid());
-// Helper class for selectionRect()
-struct SVGInlineTextBoxSelectionRectWalker {
- SVGInlineTextBoxSelectionRectWalker()
- {
- }
+ int boxStart = start();
+ startPos = max(startPos - boxStart, 0);
+ endPos = min(endPos - boxStart, static_cast<int>(len()));
- void chunkPortionCallback(SVGInlineTextBox* textBox, int startOffset, const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end)
- {
- RenderStyle* style = textBox->textRenderer()->style();
+ if (startPos >= endPos)
+ return IntRect();
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (it->isHidden())
- continue;
+ RenderText* text = textRenderer();
+ ASSERT(text);
- unsigned int newOffset = textBox->start() + (it - start) + startOffset;
- m_selectionRect.unite(textBox->calculateGlyphBoundaries(style, newOffset, *it));
- }
+ RenderStyle* style = text->style();
+ ASSERT(style);
- m_selectionRect = chunkCtm.mapRect(m_selectionRect);
- }
+ FloatRect selectionRect;
- FloatRect selectionRect() const
- {
- return m_selectionRect;
- }
+ // Figure out which text chunk part is hit
+ const Vector<SVGTextChunkPart>::const_iterator end = m_svgTextChunkParts.end();
+ for (Vector<SVGTextChunkPart>::const_iterator it = m_svgTextChunkParts.begin(); it != end; ++it)
+ selectionRect.unite(selectionRectForTextChunkPart(*it, startPos, endPos, style));
+
+ // Resepect possible chunk transformation
+ if (m_chunkTransformation.isIdentity())
+ return enclosingIntRect(selectionRect);
-private:
- FloatRect m_selectionRect;
-};
+ return enclosingIntRect(m_chunkTransformation.mapRect(selectionRect));
+}
-SVGChar* SVGInlineTextBox::closestCharacterToPosition(int x, int y, int& offsetOfHitCharacter) const
+void SVGInlineTextBox::paint(RenderObject::PaintInfo& paintInfo, int, int)
{
- SVGRootInlineBox* rootBox = svgRootInlineBox();
- if (!rootBox)
- return 0;
+ ASSERT(renderer()->shouldPaintWithinRoot(paintInfo));
+ ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
+ ASSERT(truncation() == cNoTruncation);
- SVGInlineTextBoxClosestCharacterToPositionWalker walkerCallback(x, y);
- SVGTextChunkWalker<SVGInlineTextBoxClosestCharacterToPositionWalker> walker(&walkerCallback, &SVGInlineTextBoxClosestCharacterToPositionWalker::chunkPortionCallback);
+ if (renderer()->style()->visibility() != VISIBLE)
+ return;
- rootBox->walkTextChunks(&walker, this);
+ // Note: We're explicitely not supporting composition & custom underlines and custom highlighters - unlike InlineTextBox.
+ // If we ever need that for SVG, it's very easy to refactor and reuse the code.
- offsetOfHitCharacter = walkerCallback.offsetOfHitCharacter();
- return walkerCallback.character();
-}
+ RenderObject* parentRenderer = parent()->renderer();
+ ASSERT(parentRenderer);
-bool SVGInlineTextBox::svgCharacterHitsPosition(int x, int y, int& closestOffsetInBox) const
-{
- int offsetOfHitCharacter = 0;
- SVGChar* charAtPosPtr = closestCharacterToPosition(x, y, offsetOfHitCharacter);
- if (!charAtPosPtr)
- return false;
+ RenderStyle* style = parentRenderer->style();
+ ASSERT(style);
- SVGChar& charAtPos = *charAtPosPtr;
- RenderStyle* style = textRenderer()->style(m_firstLine);
- FloatRect glyphRect = calculateGlyphBoundaries(style, offsetOfHitCharacter, charAtPos);
+ const SVGRenderStyle* svgStyle = style->svgStyle();
+ ASSERT(svgStyle);
- // FIXME: Why?
- if (direction() == RTL)
- offsetOfHitCharacter++;
+ bool hasFill = svgStyle->hasFill();
+ bool hasStroke = svgStyle->hasStroke();
+ bool paintSelectedTextOnly = paintInfo.phase == PaintPhaseSelection;
- // The caller actually the closest offset before/after the hit char
- // closestCharacterToPosition returns us offsetOfHitCharacter.
- closestOffsetInBox = offsetOfHitCharacter;
+ // Determine whether or not we're selected.
+ bool isPrinting = parentRenderer->document()->printing();
+ bool hasSelection = !isPrinting && selectionState() != RenderObject::SelectionNone;
+ if (!hasSelection && paintSelectedTextOnly)
+ return;
- // FIXME: (bug 13910) This code does not handle bottom-to-top/top-to-bottom vertical text.
+ RenderStyle* selectionStyle = style;
+ if (hasSelection) {
+ selectionStyle = parentRenderer->getCachedPseudoStyle(SELECTION);
+ if (selectionStyle) {
+ const SVGRenderStyle* svgSelectionStyle = selectionStyle->svgStyle();
+ ASSERT(svgSelectionStyle);
+
+ if (!hasFill)
+ hasFill = svgSelectionStyle->hasFill();
+ if (!hasStroke)
+ hasStroke = svgSelectionStyle->hasStroke();
+ } else
+ selectionStyle = style;
+ }
- // Check whether y position hits the current character
- if (y < charAtPos.y - glyphRect.height() || y > charAtPos.y)
- return false;
+ // Compute text match marker rects. It needs to traverse all text chunk parts to figure
+ // out the union selection rect of all text chunk parts that contribute to the selection.
+ computeTextMatchMarkerRect(style);
+ ASSERT(!m_currentChunkPart.isValid());
+
+ const Vector<SVGTextChunkPart>::const_iterator end = m_svgTextChunkParts.end();
+ for (Vector<SVGTextChunkPart>::const_iterator it = m_svgTextChunkParts.begin(); it != end; ++it) {
+ ASSERT(!m_paintingResource);
+
+ // constructTextRun() uses the current chunk part to figure out what text to render.
+ m_currentChunkPart = *it;
+ paintInfo.context->save();
+
+ // Prepare context and draw text
+ if (!m_chunkTransformation.isIdentity())
+ paintInfo.context->concatCTM(m_chunkTransformation);
+
+ Vector<SVGChar>::const_iterator firstCharacter = m_currentChunkPart.firstCharacter;
+ AffineTransform characterTransform = firstCharacter->characterTransform();
+ if (!characterTransform.isIdentity())
+ paintInfo.context->concatCTM(characterTransform);
+
+ FloatPoint textOrigin(firstCharacter->x, firstCharacter->y);
+
+ // Draw background once (not in both fill/stroke phases)
+ if (!isPrinting && !paintSelectedTextOnly && hasSelection)
+ paintSelection(paintInfo.context, textOrigin, style);
+
+ // Spec: All text decorations except line-through should be drawn before the text is filled and stroked; thus, the text is rendered on top of these decorations.
+ int decorations = style->textDecorationsInEffect();
+ if (decorations & UNDERLINE)
+ paintDecoration(paintInfo.context, textOrigin, UNDERLINE, hasSelection);
+ if (decorations & OVERLINE)
+ paintDecoration(paintInfo.context, textOrigin, OVERLINE, hasSelection);
+
+ // Fill text
+ if (hasFill) {
+ m_paintingResourceMode = ApplyToFillMode | ApplyToTextMode;
+ paintText(paintInfo.context, textOrigin, style, selectionStyle, hasSelection, paintSelectedTextOnly);
+ }
- // Check whether x position hits the current character
- if (x < charAtPos.x) {
- if (closestOffsetInBox > 0 && direction() == LTR)
- return true;
- if (closestOffsetInBox < static_cast<int>(end()) && direction() == RTL)
- return true;
+ // Stroke text
+ if (hasStroke) {
+ m_paintingResourceMode = ApplyToStrokeMode | ApplyToTextMode;
+ paintText(paintInfo.context, textOrigin, style, selectionStyle, hasSelection, paintSelectedTextOnly);
+ }
- return false;
+ // Spec: Line-through should be drawn after the text is filled and stroked; thus, the line-through is rendered on top of the text.
+ if (decorations & LINE_THROUGH)
+ paintDecoration(paintInfo.context, textOrigin, LINE_THROUGH, hasSelection);
+
+ m_paintingResourceMode = ApplyToDefaultMode;
+ paintInfo.context->restore();
}
- // Adjust the closest offset to after the char if x was after the char midpoint
- if (x >= charAtPos.x + glyphRect.width() / 2.0)
- closestOffsetInBox += direction() == RTL ? -1 : 1;
+ m_currentChunkPart = SVGTextChunkPart();
+ ASSERT(!m_paintingResource);
+}
+
+bool SVGInlineTextBox::acquirePaintingResource(GraphicsContext*& context, RenderStyle* style)
+{
+ ASSERT(m_paintingResourceMode != ApplyToDefaultMode);
+
+ RenderObject* parentRenderer = parent()->renderer();
+ ASSERT(parentRenderer);
+
+ if (m_paintingResourceMode & ApplyToFillMode)
+ m_paintingResource = RenderSVGResource::fillPaintingResource(parentRenderer, style);
+ else if (m_paintingResourceMode & ApplyToStrokeMode)
+ m_paintingResource = RenderSVGResource::strokePaintingResource(parentRenderer, style);
+ else {
+ // We're either called for stroking or filling.
+ ASSERT_NOT_REACHED();
+ }
- // If we are past the last glyph of this box, don't mark it as 'hit'
- if (x >= charAtPos.x + glyphRect.width() && closestOffsetInBox == (int) end())
+ if (!m_paintingResource)
return false;
+ m_paintingResource->applyResource(parentRenderer, style, context, m_paintingResourceMode);
return true;
}
-int SVGInlineTextBox::offsetForPosition(int, bool) const
+void SVGInlineTextBox::releasePaintingResource(GraphicsContext*& context)
{
- // SVG doesn't use the offset <-> position selection system.
- ASSERT_NOT_REACHED();
- return 0;
+ ASSERT(m_paintingResource);
+
+ RenderObject* parentRenderer = parent()->renderer();
+ ASSERT(parentRenderer);
+
+ m_paintingResource->postApplyResource(parentRenderer, context, m_paintingResourceMode);
+ m_paintingResource = 0;
}
-int SVGInlineTextBox::positionForOffset(int) const
+bool SVGInlineTextBox::prepareGraphicsContextForTextPainting(GraphicsContext*& context, TextRun& textRun, RenderStyle* style)
{
- // SVG doesn't use the offset <-> position selection system.
- ASSERT_NOT_REACHED();
- return 0;
+ bool acquiredResource = acquirePaintingResource(context, style);
+
+#if ENABLE(SVG_FONTS)
+ // SVG Fonts need access to the painting resource used to draw the current text chunk.
+ if (acquiredResource)
+ textRun.setActivePaintingResource(m_paintingResource);
+#endif
+
+ return acquiredResource;
}
-bool SVGInlineTextBox::nodeAtPoint(const HitTestRequest&, HitTestResult& result, int x, int y, int tx, int ty)
+void SVGInlineTextBox::restoreGraphicsContextAfterTextPainting(GraphicsContext*& context, TextRun& textRun)
{
- ASSERT(!isLineBreak());
+ releasePaintingResource(context);
- IntRect rect = selectionRect(0, 0, 0, len());
- if (renderer()->style()->visibility() == VISIBLE && rect.contains(x, y)) {
- renderer()->updateHitTestResult(result, IntPoint(x - tx, y - ty));
- return true;
- }
+#if ENABLE(SVG_FONTS)
+ textRun.setActivePaintingResource(0);
+#endif
+}
- return false;
+TextRun SVGInlineTextBox::constructTextRun(RenderStyle* style) const
+{
+ ASSERT(m_currentChunkPart.isValid());
+ return svgTextRunForInlineTextBox(textRenderer()->text()->characters() + start() + m_currentChunkPart.offset, m_currentChunkPart.length, style, this);
}
-IntRect SVGInlineTextBox::selectionRect(int, int, int startPos, int endPos)
+void SVGInlineTextBox::mapStartEndPositionsIntoChunkPartCoordinates(int& startPos, int& endPos, const SVGTextChunkPart& part) const
{
if (startPos >= endPos)
- return IntRect();
+ return;
- // TODO: Actually respect startPos/endPos - we're returning the _full_ selectionRect
- // here. This won't lead to visible bugs, but to extra work being done. Investigate.
- SVGRootInlineBox* rootBox = svgRootInlineBox();
- if (!rootBox)
- return IntRect();
+ // Take <text x="10 50 100">ABC</text> as example. We're called three times from paint(), because all absolute positioned
+ // characters are drawn on their own. For each of them we want to find out whehter it's selected. startPos=0, endPos=1
+ // could mean A, B or C is hit, depending on which chunk part is processed at the moment. With the offset & length values
+ // of each chunk part we can easily find out which one is meant to be selected. Bail out for the other chunk parts.
+ // If starPos is behind the current chunk or the endPos ends before this text chunk part, we're not meant to be selected.
+ if (startPos >= part.offset + part.length || endPos <= part.offset) {
+ startPos = 0;
+ endPos = -1;
+ return;
+ }
+
+ // The current processed chunk part is hit. When painting the selection, constructTextRun() builds
+ // a TextRun object whose startPos is 0 and endPos is chunk part length. The code below maps the incoming
+ // startPos/endPos range into a [0, part length] coordinate system, relative to the current chunk part.
+ if (startPos < part.offset)
+ startPos = 0;
+ else
+ startPos -= part.offset;
- SVGInlineTextBoxSelectionRectWalker walkerCallback;
- SVGTextChunkWalker<SVGInlineTextBoxSelectionRectWalker> walker(&walkerCallback, &SVGInlineTextBoxSelectionRectWalker::chunkPortionCallback);
+ if (endPos > part.offset + part.length)
+ endPos = part.length;
+ else {
+ ASSERT(endPos >= part.offset);
+ endPos -= part.offset;
+ }
- rootBox->walkTextChunks(&walker, this);
- return enclosingIntRect(walkerCallback.selectionRect());
+ ASSERT(startPos < endPos);
}
-bool SVGInlineTextBox::chunkSelectionStartEnd(const UChar* chunk, int chunkLength, int& selectionStart, int& selectionEnd)
+void SVGInlineTextBox::selectionStartEnd(int& startPos, int& endPos)
{
- // NOTE: We ignore SVGInlineTextBox::m_start here because it is always 0.
- // Curently SVG doesn't use HTML block-level layout, in which m_start would be set.
-
- int chunkStart = chunk - textRenderer()->characters();
- ASSERT(0 <= chunkStart);
+ InlineTextBox::selectionStartEnd(startPos, endPos);
- selectionStartEnd(selectionStart, selectionEnd);
- if (selectionEnd <= chunkStart)
- return false;
- if (chunkStart + chunkLength <= selectionStart)
- return false;
-
- // Map indices from view-global to chunk-local.
- selectionStart -= chunkStart;
- selectionEnd -= chunkStart;
- // Then clamp with chunk range
- if (selectionStart < 0)
- selectionStart = 0;
- if (chunkLength < selectionEnd)
- selectionEnd = chunkLength;
+ if (!m_currentChunkPart.isValid())
+ return;
- return selectionStart < selectionEnd;
+ mapStartEndPositionsIntoChunkPartCoordinates(startPos, endPos, m_currentChunkPart);
}
-void SVGInlineTextBox::paintCharacters(RenderObject::PaintInfo& paintInfo, int tx, int ty, const SVGChar& svgChar, const UChar* chars, int length, SVGTextPaintInfo& textPaintInfo)
+void SVGInlineTextBox::computeTextMatchMarkerRect(RenderStyle* style)
{
- if (renderer()->style()->visibility() != VISIBLE || paintInfo.phase == PaintPhaseOutline)
+ ASSERT(!m_currentChunkPart.isValid());
+ Node* node = renderer()->node();
+ if (!node || !node->inDocument())
return;
- ASSERT(paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintPhaseChildOutlines);
+ Document* document = renderer()->document();
+ Vector<DocumentMarker> markers = document->markersForNode(renderer()->node());
- RenderText* text = textRenderer();
- ASSERT(text);
+ Vector<DocumentMarker>::iterator markerEnd = markers.end();
+ for (Vector<DocumentMarker>::iterator markerIt = markers.begin(); markerIt != markerEnd; ++markerIt) {
+ const DocumentMarker& marker = *markerIt;
- bool isPrinting = text->document()->printing();
+ // SVG is only interessted in the TextMatch marker, for now.
+ if (marker.type != DocumentMarker::TextMatch)
+ continue;
- // Determine whether or not we're selected.
- bool haveSelection = !isPrinting && selectionState() != RenderObject::SelectionNone;
- if (!haveSelection && paintInfo.phase == PaintPhaseSelection)
- // When only painting the selection, don't bother to paint if there is none.
- return;
+ FloatRect markerRect;
+ int partStartPos = max(marker.startOffset - start(), static_cast<unsigned>(0));
+ int partEndPos = min(marker.endOffset - start(), static_cast<unsigned>(len()));
- // Determine whether or not we have a composition.
- bool containsComposition = text->document()->frame()->editor()->compositionNode() == text->node();
- bool useCustomUnderlines = containsComposition && text->document()->frame()->editor()->compositionUsesCustomUnderlines();
-
- // Set our font
- RenderStyle* styleToUse = text->style(isFirstLineStyle());
- const Font& font = styleToUse->font();
-
- AffineTransform ctm = svgChar.characterTransform();
- if (!ctm.isIdentity())
- paintInfo.context->concatCTM(ctm);
-
- // 1. Paint backgrounds behind text if needed. Examples of such backgrounds include selection
- // and marked text.
- if (paintInfo.phase != PaintPhaseSelection && !isPrinting && textPaintInfo.subphase == SVGTextPaintSubphaseBackground) {
-#if PLATFORM(MAC)
- // Custom highlighters go behind everything else.
- if (styleToUse->highlight() != nullAtom && !paintInfo.context->paintingDisabled())
- paintCustomHighlight(tx, ty, styleToUse->highlight());
-#endif
+ // Iterate over all text chunk parts, to see which ones have to be highlighted
+ const Vector<SVGTextChunkPart>::const_iterator end = m_svgTextChunkParts.end();
+ for (Vector<SVGTextChunkPart>::const_iterator it = m_svgTextChunkParts.begin(); it != end; ++it)
+ markerRect.unite(selectionRectForTextChunkPart(*it, partStartPos, partEndPos, style));
- if (containsComposition && !useCustomUnderlines)
- paintCompositionBackground(paintInfo.context, tx, ty, styleToUse, font,
- text->document()->frame()->editor()->compositionStart(),
- text->document()->frame()->editor()->compositionEnd());
-
- paintDocumentMarkers(paintInfo.context, tx, ty, styleToUse, font, true);
+ if (!m_chunkTransformation.isIdentity())
+ markerRect = m_chunkTransformation.mapRect(markerRect);
- if (haveSelection && !useCustomUnderlines) {
- int boxStartOffset = chars - text->characters() - start();
- paintSelection(boxStartOffset, svgChar, chars, length, paintInfo.context, styleToUse, font);
- }
+ document->setRenderedRectForMarker(node, marker, renderer()->localToAbsoluteQuad(markerRect).enclosingBoundingBox());
}
+}
- bool isGlyphPhase = textPaintInfo.subphase == SVGTextPaintSubphaseGlyphFill || textPaintInfo.subphase == SVGTextPaintSubphaseGlyphStroke;
- bool isSelectionGlyphPhase = textPaintInfo.subphase == SVGTextPaintSubphaseGlyphFillSelection || textPaintInfo.subphase == SVGTextPaintSubphaseGlyphStrokeSelection;
-
- if (isGlyphPhase || isSelectionGlyphPhase) {
- // Set a text shadow if we have one.
- // FIXME: Support multiple shadow effects. See how it's done in InlineTextBox.cpp.
- bool setShadow = false;
- if (styleToUse->textShadow()) {
- paintInfo.context->setShadow(IntSize(styleToUse->textShadow()->x(), styleToUse->textShadow()->y()),
- styleToUse->textShadow()->blur(), styleToUse->textShadow()->color(),
- styleToUse->colorSpace());
- setShadow = true;
- }
-
- IntPoint origin((int) svgChar.x, (int) svgChar.y);
- TextRun run = svgTextRunForInlineTextBox(chars, length, styleToUse, this, svgChar.x);
+static inline float positionOffsetForDecoration(ETextDecoration decoration, const Font& font, float thickness)
+{
+ // FIXME: For SVG Fonts we need to use the attributes defined in the <font-face> if specified.
+ // Compatible with Batik/Opera.
+ if (decoration == UNDERLINE)
+ return font.ascent() + thickness * 1.5f;
+ if (decoration == OVERLINE)
+ return thickness;
+ if (decoration == LINE_THROUGH)
+ return font.ascent() * 5.0f / 8.0f;
-#if ENABLE(SVG_FONTS)
- // SVG Fonts need access to the painting resource used to draw the current text chunk.
- ASSERT(textPaintInfo.activePaintingResource);
- run.setActivePaintingResource(textPaintInfo.activePaintingResource);
-#endif
+ ASSERT_NOT_REACHED();
+ return 0.0f;
+}
- int selectionStart = 0;
- int selectionEnd = 0;
- bool haveSelectedRange = haveSelection && chunkSelectionStartEnd(chars, length, selectionStart, selectionEnd);
-
- if (isGlyphPhase) {
- if (haveSelectedRange) {
- paintInfo.context->drawText(font, run, origin, 0, selectionStart);
- paintInfo.context->drawText(font, run, origin, selectionEnd, run.length());
- } else
- paintInfo.context->drawText(font, run, origin);
- } else {
- ASSERT(isSelectionGlyphPhase);
- if (haveSelectedRange)
- paintInfo.context->drawText(font, run, origin, selectionStart, selectionEnd);
- }
+static inline float thicknessForDecoration(ETextDecoration, const Font& font)
+{
+ // FIXME: For SVG Fonts we need to use the attributes defined in the <font-face> if specified.
+ // Compatible with Batik/Opera
+ return font.size() / 20.0f;
+}
+
+static inline RenderObject* findRenderObjectDefininingTextDecoration(InlineFlowBox* parentBox, ETextDecoration decoration)
+{
+ // Lookup render object which has text-decoration set.
+ RenderObject* renderer = 0;
+ while (parentBox) {
+ renderer = parentBox->renderer();
- if (setShadow)
- paintInfo.context->clearShadow();
- }
+ // Explicitely check textDecoration() not textDecorationsInEffect(), which is inherited to
+ // children, as we want to lookup the render object whose style defined the text-decoration.
+ if (renderer->style() && renderer->style()->textDecoration() & decoration)
+ break;
- if (paintInfo.phase != PaintPhaseSelection && textPaintInfo.subphase == SVGTextPaintSubphaseForeground) {
- paintDocumentMarkers(paintInfo.context, tx, ty, styleToUse, font, false);
-
- if (useCustomUnderlines) {
- const Vector<CompositionUnderline>& underlines = text->document()->frame()->editor()->customCompositionUnderlines();
- size_t numUnderlines = underlines.size();
-
- for (size_t index = 0; index < numUnderlines; ++index) {
- const CompositionUnderline& underline = underlines[index];
-
- if (underline.endOffset <= start())
- // underline is completely before this run. This might be an underline that sits
- // before the first run we draw, or underlines that were within runs we skipped
- // due to truncation.
- continue;
-
- if (underline.startOffset <= end()) {
- // underline intersects this run. Paint it.
- paintCompositionUnderline(paintInfo.context, tx, ty, underline);
- if (underline.endOffset > end() + 1)
- // underline also runs into the next run. Bail now, no more marker advancement.
- break;
- } else
- // underline is completely after this run, bail. A later run will paint it.
- break;
- }
- }
-
+ parentBox = parentBox->parent();
}
- if (!ctm.isIdentity())
- paintInfo.context->concatCTM(ctm.inverse());
+ ASSERT(renderer);
+ return renderer;
}
-void SVGInlineTextBox::paintSelection(int boxStartOffset, const SVGChar& svgChar, const UChar*, int length, GraphicsContext* p, RenderStyle* style, const Font& font)
+void SVGInlineTextBox::paintDecoration(GraphicsContext* context, const FloatPoint& textOrigin, ETextDecoration decoration, bool hasSelection)
{
- if (selectionState() == RenderObject::SelectionNone)
- return;
-
- int startPos, endPos;
- selectionStartEnd(startPos, endPos);
-
- if (startPos >= endPos)
- return;
-
- Color textColor = style->visitedDependentColor(CSSPropertyColor);
- Color color = renderer()->selectionBackgroundColor();
- if (!color.isValid() || !color.alpha())
- return;
+ // Find out which render style defined the text-decoration, as its fill/stroke properties have to be used for drawing instead of ours.
+ RenderObject* decorationRenderer = findRenderObjectDefininingTextDecoration(parent(), decoration);
+ RenderStyle* decorationStyle = decorationRenderer->style();
+ ASSERT(decorationStyle);
- // If the text color ends up being the same as the selection background, invert the selection
- // background. This should basically never happen, since the selection has transparency.
- if (textColor == color)
- color = Color(0xff - color.red(), 0xff - color.green(), 0xff - color.blue());
+ const SVGRenderStyle* svgDecorationStyle = decorationStyle->svgStyle();
+ ASSERT(svgDecorationStyle);
- // Map from text box positions and a given start offset to chunk positions
- // 'boxStartOffset' represents the beginning of the text chunk.
- if ((startPos > boxStartOffset && endPos > boxStartOffset + length) || boxStartOffset >= endPos)
- return;
+ bool hasDecorationFill = svgDecorationStyle->hasFill();
+ bool hasDecorationStroke = svgDecorationStyle->hasStroke();
- if (endPos > boxStartOffset + length)
- endPos = boxStartOffset + length;
+ if (hasSelection) {
+ if (RenderStyle* pseudoStyle = decorationRenderer->getCachedPseudoStyle(SELECTION)) {
+ decorationStyle = pseudoStyle;
- if (startPos < boxStartOffset)
- startPos = boxStartOffset;
+ svgDecorationStyle = decorationStyle->svgStyle();
+ ASSERT(svgDecorationStyle);
- ASSERT(startPos >= boxStartOffset);
- ASSERT(endPos <= boxStartOffset + length);
- ASSERT(startPos < endPos);
+ if (!hasDecorationFill)
+ hasDecorationFill = svgDecorationStyle->hasFill();
+ if (!hasDecorationStroke)
+ hasDecorationStroke = svgDecorationStyle->hasStroke();
+ }
+ }
- p->save();
+ if (decorationStyle->visibility() == HIDDEN)
+ return;
- int adjust = startPos >= boxStartOffset ? boxStartOffset : 0;
- p->drawHighlightForText(font, svgTextRunForInlineTextBox(textRenderer()->characters() + start() + boxStartOffset, length, style, this, svgChar.x),
- IntPoint((int) svgChar.x, (int) svgChar.y - font.ascent()),
- font.ascent() + font.descent(), color, style->colorSpace(), startPos - adjust, endPos - adjust);
+ if (hasDecorationFill) {
+ m_paintingResourceMode = ApplyToFillMode;
+ paintDecorationWithStyle(context, textOrigin, decorationStyle, decoration);
+ }
- p->restore();
+ if (hasDecorationStroke) {
+ m_paintingResourceMode = ApplyToStrokeMode;
+ paintDecorationWithStyle(context, textOrigin, decorationStyle, decoration);
+ }
}
-static inline Path pathForDecoration(ETextDecoration decoration, RenderObject* object, float x, float y, float width)
+void SVGInlineTextBox::paintDecorationWithStyle(GraphicsContext* context, const FloatPoint& textOrigin, RenderStyle* decorationStyle, ETextDecoration decoration)
{
- float thickness = SVGRenderStyle::cssPrimitiveToLength(object, object->style()->svgStyle()->strokeWidth(), 1.0f);
+ ASSERT(!m_paintingResource);
+ ASSERT(m_paintingResourceMode != ApplyToDefaultMode);
+ ASSERT(m_currentChunkPart.isValid());
- const Font& font = object->style()->font();
- thickness = max(thickness * powf(font.size(), 2.0f) / font.unitsPerEm(), 1.0f);
+ const Font& font = decorationStyle->font();
- if (decoration == UNDERLINE)
- y += thickness * 1.5f; // For compatibility with Batik/Opera
- else if (decoration == OVERLINE)
- y += thickness;
+ // The initial y value refers to overline position.
+ float thickness = thicknessForDecoration(decoration, font);
+ float x = textOrigin.x();
+ float y = textOrigin.y() - font.ascent() + positionOffsetForDecoration(decoration, font, thickness);
+
+ context->save();
+ context->beginPath();
+ context->addPath(Path::createRectangle(FloatRect(x, y, m_currentChunkPart.width, thickness)));
- float halfThickness = thickness / 2.0f;
- return Path::createRectangle(FloatRect(x + halfThickness, y, width - 2.0f * halfThickness, thickness));
+ if (acquirePaintingResource(context, decorationStyle))
+ releasePaintingResource(context);
+
+ context->restore();
}
-void SVGInlineTextBox::paintDecoration(ETextDecoration decoration, GraphicsContext* context, int tx, int ty, int width, const SVGChar& svgChar, const SVGTextDecorationInfo& info)
+void SVGInlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& textOrigin, RenderStyle* style)
{
- if (renderer()->style()->visibility() != VISIBLE)
+ // See if we have a selection to paint at all.
+ int startPos, endPos;
+ selectionStartEnd(startPos, endPos);
+ if (startPos >= endPos)
return;
- // This function does NOT accept combinated text decorations. It's meant to be invoked for just one.
- ASSERT(decoration == TDNONE || decoration == UNDERLINE || decoration == OVERLINE || decoration == LINE_THROUGH || decoration == BLINK);
-
- bool isFilled = info.fillServerMap.contains(decoration);
- bool isStroked = info.strokeServerMap.contains(decoration);
-
- if (!isFilled && !isStroked)
+ Color backgroundColor = renderer()->selectionBackgroundColor();
+ if (!backgroundColor.isValid() || !backgroundColor.alpha())
return;
- int baseline = renderer()->style(m_firstLine)->font().ascent();
- if (decoration == UNDERLINE)
- ty += baseline;
- else if (decoration == LINE_THROUGH)
- ty += 2 * baseline / 3;
+ const Font& font = style->font();
+
+ FloatPoint selectionOrigin = textOrigin;
+ selectionOrigin.move(0, -font.ascent());
context->save();
- context->beginPath();
+ context->setFillColor(backgroundColor, style->colorSpace());
+ context->fillRect(font.selectionRectForText(constructTextRun(style), selectionOrigin, m_currentChunkPart.height, startPos, endPos), backgroundColor, style->colorSpace());
+ context->restore();
+}
- AffineTransform ctm = svgChar.characterTransform();
- if (!ctm.isIdentity())
- context->concatCTM(ctm);
+void SVGInlineTextBox::paintText(GraphicsContext* context, const FloatPoint& textOrigin, RenderStyle* style, RenderStyle* selectionStyle, bool hasSelection, bool paintSelectedTextOnly)
+{
+ ASSERT(style);
+ ASSERT(selectionStyle);
+ ASSERT(m_currentChunkPart.isValid());
- if (isFilled) {
- if (RenderObject* fillObject = info.fillServerMap.get(decoration)) {
- if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPaintingResource(fillObject, fillObject->style())) {
- context->addPath(pathForDecoration(decoration, fillObject, tx, ty, width));
- if (fillPaintingResource->applyResource(fillObject, fillObject->style(), context, ApplyToFillMode))
- fillPaintingResource->postApplyResource(fillObject, context, ApplyToFillMode);
- }
+ int startPos = 0;
+ int endPos = 0;
+ selectionStartEnd(startPos, endPos);
+
+ const Font& font = style->font();
+ TextRun textRun(constructTextRun(style));
+
+ // Fast path if there is no selection, just draw the whole chunk part using the regular style
+ if (!hasSelection || startPos >= endPos) {
+ if (prepareGraphicsContextForTextPainting(context, textRun, style)) {
+ font.drawText(context, textRun, textOrigin, 0, m_currentChunkPart.length);
+ restoreGraphicsContextAfterTextPainting(context, textRun);
}
+
+ return;
}
- if (isStroked) {
- if (RenderObject* strokeObject = info.strokeServerMap.get(decoration)) {
- if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strokePaintingResource(strokeObject, strokeObject->style())) {
- context->addPath(pathForDecoration(decoration, strokeObject, tx, ty, width));
- if (strokePaintingResource->applyResource(strokeObject, strokeObject->style(), context, ApplyToStrokeMode))
- strokePaintingResource->postApplyResource(strokeObject, context, ApplyToStrokeMode);
- }
+ // Eventually draw text using regular style until the start position of the selection
+ if (startPos > 0 && !paintSelectedTextOnly) {
+ if (prepareGraphicsContextForTextPainting(context, textRun, style)) {
+ font.drawText(context, textRun, textOrigin, 0, startPos);
+ restoreGraphicsContextAfterTextPainting(context, textRun);
}
}
- context->restore();
+ // Draw text using selection style from the start to the end position of the selection
+ TextRun selectionTextRun(constructTextRun(selectionStyle));
+ if (prepareGraphicsContextForTextPainting(context, selectionTextRun, selectionStyle)) {
+ selectionStyle->font().drawText(context, selectionTextRun, textOrigin, startPos, endPos);
+ restoreGraphicsContextAfterTextPainting(context, selectionTextRun);
+ }
+
+ // Eventually draw text using regular style from the end position of the selection to the end of the current chunk part
+ if (endPos < m_currentChunkPart.length && !paintSelectedTextOnly) {
+ if (prepareGraphicsContextForTextPainting(context, textRun, style)) {
+ font.drawText(context, textRun, textOrigin, endPos, m_currentChunkPart.length);
+ restoreGraphicsContextAfterTextPainting(context, textRun);
+ }
+ }
}
void SVGInlineTextBox::buildLayoutInformation(SVGCharacterLayoutInfo& info, SVGLastGlyphInfo& lastGlyph)
@@ -583,7 +614,7 @@ void SVGInlineTextBox::buildLayoutInformation(SVGCharacterLayoutInfo& info, SVGL
RenderText* textRenderer = this->textRenderer();
ASSERT(textRenderer);
- RenderStyle* style = textRenderer->style(isFirstLineStyle());
+ RenderStyle* style = textRenderer->style();
ASSERT(style);
const Font& font = style->font();
@@ -606,20 +637,9 @@ void SVGInlineTextBox::buildLayoutInformation(SVGCharacterLayoutInfo& info, SVGL
float glyphWidth = 0.0f;
float glyphHeight = 0.0f;
-
- int extraCharsAvailable = length - i - 1;
-
- String unicodeStr;
String glyphName;
- if (textDirection == RTL) {
- glyphWidth = calculateGlyphWidth(style, endPosition - i, extraCharsAvailable, charsConsumed, glyphName);
- glyphHeight = calculateGlyphHeight(style, endPosition - i, extraCharsAvailable);
- unicodeStr = String(characters + endPosition - i, charsConsumed);
- } else {
- glyphWidth = calculateGlyphWidth(style, startPosition + i, extraCharsAvailable, charsConsumed, glyphName);
- glyphHeight = calculateGlyphHeight(style, startPosition + i, extraCharsAvailable);
- unicodeStr = String(characters + startPosition + i, charsConsumed);
- }
+ String unicodeString;
+ measureCharacter(style, i, charsConsumed, glyphName, unicodeString, glyphWidth, glyphHeight);
bool assignedX = false;
bool assignedY = false;
@@ -682,7 +702,7 @@ void SVGInlineTextBox::buildLayoutInformation(SVGCharacterLayoutInfo& info, SVGL
}
// FIXME: SVG Kerning doesn't get applied on texts on path.
- bool appliedSVGKerning = applySVGKerning(info, style, lastGlyph, unicodeStr, glyphName, isVerticalText);
+ bool appliedSVGKerning = applySVGKerning(info, style, lastGlyph, unicodeString, glyphName, isVerticalText);
if (info.nextDrawnSeperated || spacing != 0.0f || appliedSVGKerning) {
info.nextDrawnSeperated = false;
svgChar.drawnSeperated = true;
@@ -805,6 +825,38 @@ void SVGInlineTextBox::buildLayoutInformation(SVGCharacterLayoutInfo& info, SVGL
}
}
+FloatRect SVGInlineTextBox::calculateGlyphBoundaries(RenderStyle* style, int position, const SVGChar& character) const
+{
+ int charsConsumed = 0;
+ String glyphName;
+ String unicodeString;
+ float glyphWidth = 0.0f;
+ float glyphHeight = 0.0f;
+ measureCharacter(style, position, charsConsumed, glyphName, unicodeString, glyphWidth, glyphHeight);
+
+ FloatRect glyphRect(character.x, character.y - style->font().ascent(), glyphWidth, glyphHeight);
+ glyphRect = character.characterTransform().mapRect(glyphRect);
+ if (m_chunkTransformation.isIdentity())
+ return glyphRect;
+
+ return m_chunkTransformation.mapRect(glyphRect);
+}
+
+IntRect SVGInlineTextBox::calculateBoundaries() const
+{
+ FloatRect textRect;
+ int baseline = baselinePosition(true);
+
+ const Vector<SVGTextChunkPart>::const_iterator end = m_svgTextChunkParts.end();
+ for (Vector<SVGTextChunkPart>::const_iterator it = m_svgTextChunkParts.begin(); it != end; ++it)
+ textRect.unite(it->firstCharacter->characterTransform().mapRect(FloatRect(it->firstCharacter->x, it->firstCharacter->y - baseline, it->width, it->height)));
+
+ if (m_chunkTransformation.isIdentity())
+ return enclosingIntRect(textRect);
+
+ return enclosingIntRect(m_chunkTransformation.mapRect(textRect));
+}
+
} // namespace WebCore
#endif
diff --git a/WebCore/rendering/SVGInlineTextBox.h b/WebCore/rendering/SVGInlineTextBox.h
index 77b6498..704b1f5 100644
--- a/WebCore/rendering/SVGInlineTextBox.h
+++ b/WebCore/rendering/SVGInlineTextBox.h
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2007 Rob Buis <buis@kde.org>
* (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -24,60 +25,77 @@
#if ENABLE(SVG)
#include "InlineTextBox.h"
-#include "RenderSVGResource.h"
+#include "SVGTextChunkLayoutInfo.h"
+#include "SVGTextLayoutUtilities.h"
namespace WebCore {
+class RenderSVGResource;
class SVGRootInlineBox;
-struct SVGChar;
struct SVGCharacterLayoutInfo;
struct SVGLastGlyphInfo;
-struct SVGTextDecorationInfo;
-struct SVGTextPaintInfo;
class SVGInlineTextBox : public InlineTextBox {
public:
- SVGInlineTextBox(RenderObject* obj);
+ SVGInlineTextBox(RenderObject*);
+
+ virtual bool isSVGInlineTextBox() const { return true; }
virtual int virtualHeight() const { return m_height; }
- void setHeight(int h) { m_height = h; }
+ void setHeight(int height) { m_height = height; }
virtual int selectionTop() { return m_y; }
virtual int selectionHeight() { return m_height; }
-
virtual int offsetForPosition(int x, bool includePartialGlyphs = true) const;
virtual int positionForOffset(int offset) const;
- virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty);
+ virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
virtual IntRect selectionRect(int absx, int absy, int startPos, int endPos);
- // SVGs custom paint text method
- void paintCharacters(RenderObject::PaintInfo&, int tx, int ty, const SVGChar&, const UChar* chars, int length, SVGTextPaintInfo&);
-
- // SVGs custom paint selection method
- void paintSelection(int boxStartOffset, const SVGChar&, const UChar*, int length, GraphicsContext*, RenderStyle*, const Font&);
+ virtual void selectionStartEnd(int& startPos, int& endPos);
+ void mapStartEndPositionsIntoChunkPartCoordinates(int& startPos, int& endPos, const SVGTextChunkPart&) const;
- // SVGs custom paint decoration method
- void paintDecoration(ETextDecoration, GraphicsContext*, int tx, int ty, int width, const SVGChar&, const SVGTextDecorationInfo&);
-
SVGRootInlineBox* svgRootInlineBox() const;
// Helper functions shared with SVGRootInlineBox
- float calculateGlyphWidth(RenderStyle* style, int offset, int extraCharsAvailable, int& charsConsumed, String& glyphName) const;
- float calculateGlyphHeight(RenderStyle*, int offset, int extraCharsAvailable) const;
-
- FloatRect calculateGlyphBoundaries(RenderStyle*, int offset, const SVGChar&) const;
- SVGChar* closestCharacterToPosition(int x, int y, int& offset) const;
+ void measureCharacter(RenderStyle*, int position, int& charsConsumed, String& glyphName, String& unicodeString, float& glyphWidth, float& glyphHeight) const;
+ FloatRect calculateGlyphBoundaries(RenderStyle*, int position, const SVGChar&) const;
void buildLayoutInformation(SVGCharacterLayoutInfo&, SVGLastGlyphInfo&);
+ const AffineTransform& chunkTransformation() const { return m_chunkTransformation; }
+ void setChunkTransformation(const AffineTransform& transform) { m_chunkTransformation = transform; }
+ void addChunkPartInformation(const SVGTextChunkPart& part) { m_svgTextChunkParts.append(part); }
+ const Vector<SVGTextChunkPart>& svgTextChunkParts() const { return m_svgTextChunkParts; }
+
+ virtual IntRect calculateBoundaries() const;
+
+private:
+ TextRun constructTextRun(RenderStyle*) const;
+ AffineTransform buildChunkTransformation(SVGChar& firstCharacter) const;
+
+ bool acquirePaintingResource(GraphicsContext*&, RenderStyle*);
+ void releasePaintingResource(GraphicsContext*&);
+
+ bool prepareGraphicsContextForTextPainting(GraphicsContext*&, TextRun&, RenderStyle*);
+ void restoreGraphicsContextAfterTextPainting(GraphicsContext*&, TextRun&);
+
+ void computeTextMatchMarkerRect(RenderStyle*);
+ void paintDecoration(GraphicsContext*, const FloatPoint& textOrigin, ETextDecoration, bool hasSelection);
+ void paintDecorationWithStyle(GraphicsContext*, const FloatPoint& textOrigin, RenderStyle*, ETextDecoration);
+ void paintSelection(GraphicsContext*, const FloatPoint& textOrigin, RenderStyle*);
+ void paintText(GraphicsContext*, const FloatPoint& textOrigin, RenderStyle*, RenderStyle* selectionStyle, bool hasSelection, bool paintSelectedTextOnly);
+
+ FloatRect selectionRectForTextChunkPart(const SVGTextChunkPart&, int partStartPos, int partEndPos, RenderStyle*);
+
private:
- friend class RenderSVGInlineText;
- bool svgCharacterHitsPosition(int x, int y, int& offset) const;
- bool chunkSelectionStartEnd(const UChar* chunk, int chunkLength, int& selectionStart, int& selectionEnd);
-
int m_height;
+ AffineTransform m_chunkTransformation;
+ Vector<SVGTextChunkPart> m_svgTextChunkParts;
+ mutable SVGTextChunkPart m_currentChunkPart;
+ RenderSVGResource* m_paintingResource;
+ int m_paintingResourceMode;
};
} // namespace WebCore
diff --git a/WebCore/rendering/SVGRenderSupport.h b/WebCore/rendering/SVGRenderSupport.h
index e961c73..dce8b8f 100644
--- a/WebCore/rendering/SVGRenderSupport.h
+++ b/WebCore/rendering/SVGRenderSupport.h
@@ -21,8 +21,8 @@
*
*/
-#ifndef SVGRenderBase_h
-#define SVGRenderBase_h
+#ifndef SVGRenderSupport_h
+#define SVGRenderSupport_h
#if ENABLE(SVG)
#include "DashArray.h"
@@ -55,9 +55,6 @@ public:
// Helper function determining wheter overflow is hidden
static bool isOverflowHidden(const RenderObject*);
- // strokeBoundingBox() includes the marker boundaries for a RenderPath object
- virtual FloatRect strokeBoundingBox() const { return FloatRect(); }
-
// Calculates the repaintRect in combination with filter, clipper and masker in local coordinates.
void intersectRepaintRectWithResources(const RenderObject*, FloatRect&) const;
@@ -93,4 +90,4 @@ const RenderObject* findTextRootObject(const RenderObject* start);
#endif // ENABLE(SVG)
-#endif // SVGRenderBase_h
+#endif // SVGRenderSupport_h
diff --git a/WebCore/rendering/SVGRenderTreeAsText.cpp b/WebCore/rendering/SVGRenderTreeAsText.cpp
index 2a71dee..e110ce6 100644
--- a/WebCore/rendering/SVGRenderTreeAsText.cpp
+++ b/WebCore/rendering/SVGRenderTreeAsText.cpp
@@ -598,7 +598,7 @@ void writeSVGResourceContainer(TextStream& ts, const RenderObject& object, int i
writeNameValuePair(ts, "filterUnits", filter->filterUnits());
writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits());
ts << "\n";
- if (OwnPtr<SVGFilterBuilder> builder = filter->buildPrimitives()) {
+ if (RefPtr<SVGFilterBuilder> builder = filter->buildPrimitives()) {
if (FilterEffect* lastEffect = builder->lastEffect())
lastEffect->externalRepresentation(ts, indent + 1);
}
diff --git a/WebCore/rendering/SVGRootInlineBox.cpp b/WebCore/rendering/SVGRootInlineBox.cpp
index 6b750be..8fd71ea 100644
--- a/WebCore/rendering/SVGRootInlineBox.cpp
+++ b/WebCore/rendering/SVGRootInlineBox.cpp
@@ -22,643 +22,44 @@
*/
#include "config.h"
-
-#if ENABLE(SVG)
#include "SVGRootInlineBox.h"
+#if ENABLE(SVG)
#include "GraphicsContext.h"
#include "RenderBlock.h"
#include "RenderSVGResourceFilter.h"
-#include "RenderSVGRoot.h"
#include "SVGInlineFlowBox.h"
#include "SVGInlineTextBox.h"
#include "SVGRenderSupport.h"
#include "SVGTextLayoutUtilities.h"
#include "SVGTextPositioningElement.h"
-// Text chunk creation is complex and the whole process
-// can easily be traced by setting this variable > 0.
-#define DEBUG_CHUNK_BUILDING 0
+// Text chunk part propagation can be traced by setting this variable > 0.
+#define DEBUG_CHUNK_PART_PROPAGATION 0
namespace WebCore {
-static inline void startTextChunk(SVGTextChunkLayoutInfo& info)
+void SVGRootInlineBox::paint(RenderObject::PaintInfo& paintInfo, int, int)
{
- info.chunk.boxes.clear();
- info.chunk.boxes.append(SVGInlineBoxCharacterRange());
-
- info.chunk.start = info.it;
- info.assignChunkProperties = true;
-}
-
-static inline void closeTextChunk(SVGTextChunkLayoutInfo& info)
-{
- ASSERT(!info.chunk.boxes.last().isOpen());
- ASSERT(info.chunk.boxes.last().isClosed());
-
- info.chunk.end = info.it;
- ASSERT(info.chunk.end >= info.chunk.start);
-
- info.svgTextChunks.append(info.chunk);
-}
-
-RenderSVGRoot* findSVGRootObject(RenderObject* start)
-{
- // Find associated root inline box.
- while (start && !start->isSVGRoot())
- start = start->parent();
- ASSERT(start);
- return toRenderSVGRoot(start);
-}
-
-// Helper class for paint()
-struct SVGRootInlineBoxPaintWalker {
- SVGRootInlineBoxPaintWalker(SVGRootInlineBox* rootBox, RenderObject::PaintInfo paintInfo, int tx, int ty)
- : m_rootBox(rootBox)
- , m_chunkStarted(false)
- , m_paintInfo(paintInfo)
- , m_savedInfo(paintInfo)
- , m_boundingBox(tx + rootBox->x(), ty + rootBox->y(), rootBox->width(), rootBox->height())
- , m_filter(0)
- , m_fillPaintingResource(0)
- , m_strokePaintingResource(0)
- , m_fillPaintingResourceObject(0)
- , m_strokePaintingResourceObject(0)
- , m_tx(tx)
- , m_ty(ty)
- {
- }
-
- ~SVGRootInlineBoxPaintWalker()
- {
- ASSERT(!m_filter);
- ASSERT(!m_fillPaintingResource);
- ASSERT(!m_fillPaintingResourceObject);
- ASSERT(!m_strokePaintingResource);
- ASSERT(!m_strokePaintingResourceObject);
- ASSERT(!m_chunkStarted);
- }
-
- bool mayHaveSelection(SVGInlineTextBox* box) const
- {
- int selectionStart = 0, selectionEnd = 0;
- box->selectionStartEnd(selectionStart, selectionEnd);
- return selectionStart < selectionEnd;
- }
-
- void teardownFillPaintServer()
- {
- if (!m_fillPaintingResource)
- return;
-
- m_fillPaintingResource->postApplyResource(m_fillPaintingResourceObject, m_paintInfo.context, ApplyToFillMode | ApplyToTextMode);
- m_fillPaintingResource = 0;
- m_fillPaintingResourceObject = 0;
- }
-
- void teardownStrokePaintServer()
- {
- if (!m_strokePaintingResource)
- return;
-
- m_strokePaintingResource->postApplyResource(m_strokePaintingResourceObject, m_paintInfo.context, ApplyToStrokeMode | ApplyToTextMode);
- m_strokePaintingResource = 0;
- m_strokePaintingResourceObject = 0;
- }
-
- void chunkStartCallback(InlineBox* box)
- {
- ASSERT(!m_chunkStarted);
- m_chunkStarted = true;
-
- InlineFlowBox* flowBox = box->parent();
-
- // Initialize text rendering
- RenderObject* object = flowBox->renderer();
- ASSERT(object);
-
- m_savedInfo = m_paintInfo;
- m_paintInfo.context->save();
-
- // FIXME: Why is this done here instead of in RenderSVGText?
- if (!flowBox->isRootInlineBox())
- SVGRenderBase::prepareToRenderSVGContent(object, m_paintInfo, m_boundingBox, m_filter);
- }
-
- void chunkEndCallback(InlineBox* box)
- {
- ASSERT(m_chunkStarted);
- m_chunkStarted = false;
-
- InlineFlowBox* flowBox = box->parent();
-
- RenderObject* object = flowBox->renderer();
- ASSERT(object);
-
- // Clean up last used paint server
- teardownFillPaintServer();
- teardownStrokePaintServer();
-
- // Finalize text rendering
- if (!flowBox->isRootInlineBox()) {
- SVGRenderBase::finishRenderSVGContent(object, m_paintInfo, m_filter, m_savedInfo.context);
- m_filter = 0;
- }
-
- // Restore context & repaint rect
- m_paintInfo.context->restore();
- m_paintInfo.rect = m_savedInfo.rect;
- }
-
- bool setupBackground(SVGInlineTextBox*)
- {
- m_textPaintInfo.subphase = SVGTextPaintSubphaseBackground;
- return true;
- }
-
- bool setupFill(SVGInlineTextBox* box)
- {
- InlineFlowBox* flowBox = box->parent();
-
- // Setup fill paint server
- RenderObject* object = flowBox->renderer();
- ASSERT(object);
-
- ASSERT(!m_strokePaintingResource);
- teardownFillPaintServer();
-
- m_textPaintInfo.subphase = SVGTextPaintSubphaseGlyphFill;
- m_fillPaintingResource = RenderSVGResource::fillPaintingResource(object, object->style());
- if (m_fillPaintingResource) {
- m_fillPaintingResource->applyResource(object, object->style(), m_paintInfo.context, ApplyToFillMode | ApplyToTextMode);
- m_fillPaintingResourceObject = object;
- return true;
- }
-
- return false;
- }
-
- bool setupFillSelection(SVGInlineTextBox* box)
- {
- InlineFlowBox* flowBox = box->parent();
-
- // Setup fill paint server
- RenderObject* object = flowBox->renderer();
- ASSERT(object);
- RenderStyle* style = object->getCachedPseudoStyle(SELECTION);
- if (!style)
- style = object->style();
-
- ASSERT(!m_strokePaintingResource);
- teardownFillPaintServer();
-
- if (!mayHaveSelection(box))
- return false;
-
- m_textPaintInfo.subphase = SVGTextPaintSubphaseGlyphFillSelection;
- m_fillPaintingResource = RenderSVGResource::fillPaintingResource(object, style);
- if (m_fillPaintingResource) {
- m_fillPaintingResource->applyResource(object, style, m_paintInfo.context, ApplyToFillMode | ApplyToTextMode);
- m_fillPaintingResourceObject = object;
- return true;
- }
-
- return false;
- }
-
- bool setupStroke(SVGInlineTextBox* box)
- {
- InlineFlowBox* flowBox = box->parent();
-
- // Setup stroke paint server
- RenderObject* object = flowBox->renderer();
- ASSERT(object);
-
- // If we're both stroked & filled, teardown fill paint server before stroking.
- teardownFillPaintServer();
- teardownStrokePaintServer();
-
- m_textPaintInfo.subphase = SVGTextPaintSubphaseGlyphStroke;
- m_strokePaintingResource = RenderSVGResource::strokePaintingResource(object, object->style());
- if (m_strokePaintingResource) {
- m_strokePaintingResource->applyResource(object, object->style(), m_paintInfo.context, ApplyToStrokeMode | ApplyToTextMode);
- m_strokePaintingResourceObject = object;
- return true;
- }
-
- return false;
- }
-
- bool setupStrokeSelection(SVGInlineTextBox* box)
- {
- InlineFlowBox* flowBox = box->parent();
-
- // Setup stroke paint server
- RenderObject* object = flowBox->renderer();
- ASSERT(object);
- RenderStyle* style = object->getCachedPseudoStyle(SELECTION);
- if (!style)
- style = object->style();
-
- // If we're both stroked & filled, teardown fill paint server before stroking.
- teardownFillPaintServer();
- teardownStrokePaintServer();
-
- if (!mayHaveSelection(box))
- return false;
-
- m_textPaintInfo.subphase = SVGTextPaintSubphaseGlyphStrokeSelection;
- m_strokePaintingResource = RenderSVGResource::strokePaintingResource(object, style);
- if (m_strokePaintingResource) {
- m_strokePaintingResource->applyResource(object, style, m_paintInfo.context, ApplyToStrokeMode | ApplyToTextMode);
- m_strokePaintingResourceObject = object;
- return true;
- }
-
- return false;
- }
-
- bool setupForeground(SVGInlineTextBox*)
- {
- teardownFillPaintServer();
- teardownStrokePaintServer();
-
- m_textPaintInfo.subphase = SVGTextPaintSubphaseForeground;
-
- return true;
- }
-
- RenderSVGResource* activePaintingResource() const
- {
- switch (m_textPaintInfo.subphase) {
- case SVGTextPaintSubphaseGlyphFill:
- case SVGTextPaintSubphaseGlyphFillSelection:
- ASSERT(m_fillPaintingResource);
- return m_fillPaintingResource;
- case SVGTextPaintSubphaseGlyphStroke:
- case SVGTextPaintSubphaseGlyphStrokeSelection:
- ASSERT(m_strokePaintingResource);
- return m_strokePaintingResource;
- case SVGTextPaintSubphaseBackground:
- case SVGTextPaintSubphaseForeground:
- default:
- return 0;
- }
- }
-
- void chunkPortionCallback(SVGInlineTextBox* textBox, int startOffset, const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end)
- {
- if (setupBackground(textBox))
- paintChunk(textBox, startOffset, chunkCtm, start, end);
-
- if (setupFill(textBox))
- paintChunk(textBox, startOffset, chunkCtm, start, end);
-
- if (setupFillSelection(textBox))
- paintChunk(textBox, startOffset, chunkCtm, start, end);
+ ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
+ ASSERT(!paintInfo.context->paintingDisabled());
- if (setupStroke(textBox))
- paintChunk(textBox, startOffset, chunkCtm, start, end);
+ RenderObject* boxRenderer = renderer();
+ ASSERT(boxRenderer);
- if (setupStrokeSelection(textBox))
- paintChunk(textBox, startOffset, chunkCtm, start, end);
+ RenderObject::PaintInfo childPaintInfo(paintInfo);
+ childPaintInfo.context->save();
- if (setupForeground(textBox))
- paintChunk(textBox, startOffset, chunkCtm, start, end);
- }
-
- void paintChunk(SVGInlineTextBox* textBox, int startOffset, const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end)
- {
- RenderText* text = textBox->textRenderer();
- ASSERT(text);
-
- RenderStyle* styleToUse = text->style(textBox->isFirstLineStyle());
- ASSERT(styleToUse);
-
- startOffset += textBox->start();
-
- int textDecorations = styleToUse->textDecorationsInEffect();
-
- int textWidth = 0;
- IntPoint decorationOrigin;
- SVGTextDecorationInfo info;
-
- if (!chunkCtm.isIdentity())
- m_paintInfo.context->concatCTM(chunkCtm);
-
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (it->isHidden())
- continue;
-
- // Determine how many characters - starting from the current - can be drawn at once.
- Vector<SVGChar>::iterator itSearch = it + 1;
- while (itSearch != end) {
- if (itSearch->drawnSeperated || itSearch->isHidden())
- break;
-
- itSearch++;
- }
-
- const UChar* stringStart = text->characters() + startOffset + (it - start);
- unsigned int stringLength = itSearch - it;
-
- // Paint decorations, that have to be drawn before the text gets drawn
- if (textDecorations != TDNONE && m_paintInfo.phase != PaintPhaseSelection) {
- textWidth = styleToUse->font().width(svgTextRunForInlineTextBox(stringStart, stringLength, styleToUse, textBox, (*it).x));
- decorationOrigin = IntPoint((int) (*it).x, (int) (*it).y - styleToUse->font().ascent());
- info = m_rootBox->retrievePaintServersForTextDecoration(text);
- }
-
- if (textDecorations & UNDERLINE && textWidth != 0.0f)
- textBox->paintDecoration(UNDERLINE, m_paintInfo.context, decorationOrigin.x(), decorationOrigin.y(), textWidth, *it, info);
-
- if (textDecorations & OVERLINE && textWidth != 0.0f)
- textBox->paintDecoration(OVERLINE, m_paintInfo.context, decorationOrigin.x(), decorationOrigin.y(), textWidth, *it, info);
-
- // Paint text
- m_textPaintInfo.activePaintingResource = activePaintingResource();
- textBox->paintCharacters(m_paintInfo, m_tx, m_ty, *it, stringStart, stringLength, m_textPaintInfo);
-
- // Paint decorations, that have to be drawn afterwards
- if (textDecorations & LINE_THROUGH && textWidth != 0.0f)
- textBox->paintDecoration(LINE_THROUGH, m_paintInfo.context, decorationOrigin.x(), decorationOrigin.y(), textWidth, *it, info);
-
- // Skip processed characters
- it = itSearch - 1;
- }
-
- if (!chunkCtm.isIdentity())
- m_paintInfo.context->concatCTM(chunkCtm.inverse());
- }
-
-private:
- SVGRootInlineBox* m_rootBox;
- bool m_chunkStarted : 1;
-
- RenderObject::PaintInfo m_paintInfo;
- RenderObject::PaintInfo m_savedInfo;
-
- FloatRect m_boundingBox;
- RenderSVGResourceFilter* m_filter;
-
- RenderSVGResource* m_fillPaintingResource;
- RenderSVGResource* m_strokePaintingResource;
-
- RenderObject* m_fillPaintingResourceObject;
- RenderObject* m_strokePaintingResourceObject;
-
- int m_tx;
- int m_ty;
-
- SVGTextPaintInfo m_textPaintInfo;
-};
-
-void SVGRootInlineBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
-{
- if (paintInfo.context->paintingDisabled() || paintInfo.phase != PaintPhaseForeground)
- return;
-
- RenderObject::PaintInfo savedInfo(paintInfo);
- paintInfo.context->save();
+ FloatRect repaintRect = boxRenderer->repaintRectInLocalCoordinates();
RenderSVGResourceFilter* filter = 0;
- FloatRect boundingBox(tx + x(), ty + y(), width(), height());
-
- // Initialize text rendering
- if (SVGRenderBase::prepareToRenderSVGContent(renderer(), paintInfo, boundingBox, filter)) {
- // Render text, chunk-by-chunk
- SVGRootInlineBoxPaintWalker walkerCallback(this, paintInfo, tx, ty);
- SVGTextChunkWalker<SVGRootInlineBoxPaintWalker> walker(&walkerCallback,
- &SVGRootInlineBoxPaintWalker::chunkPortionCallback,
- &SVGRootInlineBoxPaintWalker::chunkStartCallback,
- &SVGRootInlineBoxPaintWalker::chunkEndCallback);
-
- walkTextChunks(&walker);
- }
-
- // Finalize text rendering
- SVGRenderBase::finishRenderSVGContent(renderer(), paintInfo, filter, savedInfo.context);
- paintInfo.context->restore();
-}
-
-int SVGRootInlineBox::placeBoxesHorizontally(int, int& leftPosition, int& rightPosition, bool&, GlyphOverflowAndFallbackFontsMap&)
-{
- // Remove any offsets caused by RTL text layout
- leftPosition = 0;
- rightPosition = 0;
- return 0;
-}
-
-int SVGRootInlineBox::verticallyAlignBoxes(int, GlyphOverflowAndFallbackFontsMap&)
-{
- // height is set by layoutInlineBoxes.
- return height();
-}
-
-static float cummulatedWidthOrHeightOfTextChunk(SVGTextChunk& chunk, bool calcWidthOnly)
-{
- float length = 0.0f;
- Vector<SVGChar>::iterator charIt = chunk.start;
-
- Vector<SVGInlineBoxCharacterRange>::iterator it = chunk.boxes.begin();
- Vector<SVGInlineBoxCharacterRange>::iterator end = chunk.boxes.end();
-
- for (; it != end; ++it) {
- SVGInlineBoxCharacterRange& range = *it;
-
- SVGInlineTextBox* box = static_cast<SVGInlineTextBox*>(range.box);
- RenderStyle* style = box->renderer()->style();
-
- for (int i = range.startOffset; i < range.endOffset; ++i) {
- ASSERT(charIt <= chunk.end);
-
- // Determine how many characters - starting from the current - can be measured at once.
- // Important for non-absolute positioned non-latin1 text (ie. Arabic) where ie. the width
- // of a string is not the sum of the boundaries of all contained glyphs.
- Vector<SVGChar>::iterator itSearch = charIt + 1;
- Vector<SVGChar>::iterator endSearch = charIt + range.endOffset - i;
- while (itSearch != endSearch) {
- // No need to check for 'isHidden()' here as this function is not called for text paths.
- if (itSearch->drawnSeperated)
- break;
-
- itSearch++;
- }
-
- unsigned int positionOffset = itSearch - charIt;
-
- // Calculate width/height of subrange
- SVGInlineBoxCharacterRange subRange;
- subRange.box = range.box;
- subRange.startOffset = i;
- subRange.endOffset = i + positionOffset;
-
- if (calcWidthOnly)
- length += cummulatedWidthOfInlineBoxCharacterRange(subRange);
- else
- length += cummulatedHeightOfInlineBoxCharacterRange(subRange);
-
- // Calculate gap between the previous & current range
- // <text x="10 50 70">ABCD</text> - we need to take the gaps between A & B into account
- // so add "40" as width, and analogous for B & C, add "20" as width.
- if (itSearch > chunk.start && itSearch < chunk.end) {
- SVGChar& lastCharacter = *(itSearch - 1);
- SVGChar& currentCharacter = *itSearch;
-
- int offset = box->direction() == RTL ? box->end() - i - positionOffset + 1 : box->start() + i + positionOffset - 1;
-
- // FIXME: does this need to change to handle multichar glyphs?
- int charsConsumed = 1;
- String glyphName;
- if (calcWidthOnly) {
- float lastGlyphWidth = box->calculateGlyphWidth(style, offset, 0, charsConsumed, glyphName);
- length += currentCharacter.x - lastCharacter.x - lastGlyphWidth;
- } else {
- float lastGlyphHeight = box->calculateGlyphHeight(style, offset, 0);
- length += currentCharacter.y - lastCharacter.y - lastGlyphHeight;
- }
- }
-
- // Advance processed characters
- i += positionOffset - 1;
- charIt = itSearch;
- }
- }
-
- ASSERT(charIt == chunk.end);
- return length;
-}
-
-static float cummulatedWidthOfTextChunk(SVGTextChunk& chunk)
-{
- return cummulatedWidthOrHeightOfTextChunk(chunk, true);
-}
-
-static float cummulatedHeightOfTextChunk(SVGTextChunk& chunk)
-{
- return cummulatedWidthOrHeightOfTextChunk(chunk, false);
-}
-
-static float calculateTextAnchorShiftForTextChunk(SVGTextChunk& chunk, ETextAnchor anchor)
-{
- float shift = 0.0f;
-
- if (chunk.isVerticalText)
- shift = cummulatedHeightOfTextChunk(chunk);
- else
- shift = cummulatedWidthOfTextChunk(chunk);
-
- if (anchor == TA_MIDDLE)
- shift *= -0.5f;
- else
- shift *= -1.0f;
-
- return shift;
-}
-
-static void applyTextAnchorToTextChunk(SVGTextChunk& chunk)
-{
- // This method is not called for chunks containing chars aligned on a path.
- // -> all characters are visible, no need to check for "isHidden()" anywhere.
-
- if (chunk.anchor == TA_START)
- return;
-
- float shift = calculateTextAnchorShiftForTextChunk(chunk, chunk.anchor);
-
- // Apply correction to chunk
- Vector<SVGChar>::iterator chunkIt = chunk.start;
- for (; chunkIt != chunk.end; ++chunkIt) {
- SVGChar& curChar = *chunkIt;
-
- if (chunk.isVerticalText)
- curChar.y += shift;
- else
- curChar.x += shift;
- }
-
- // Move inline boxes
- Vector<SVGInlineBoxCharacterRange>::iterator boxIt = chunk.boxes.begin();
- Vector<SVGInlineBoxCharacterRange>::iterator boxEnd = chunk.boxes.end();
-
- for (; boxIt != boxEnd; ++boxIt) {
- SVGInlineBoxCharacterRange& range = *boxIt;
-
- InlineBox* curBox = range.box;
- ASSERT(curBox->isInlineTextBox());
-
- // Move target box
- if (chunk.isVerticalText)
- curBox->setY(curBox->y() + static_cast<int>(shift));
- else
- curBox->setX(curBox->x() + static_cast<int>(shift));
- }
-}
-
-static float calculateTextLengthCorrectionForTextChunk(SVGTextChunk& chunk, ELengthAdjust lengthAdjust, float& computedLength)
-{
- if (chunk.textLength <= 0.0f)
- return 0.0f;
-
- float computedWidth = cummulatedWidthOfTextChunk(chunk);
- float computedHeight = cummulatedHeightOfTextChunk(chunk);
-
- if ((computedWidth <= 0.0f && !chunk.isVerticalText)
- || (computedHeight <= 0.0f && chunk.isVerticalText))
- return 0.0f;
-
- if (chunk.isVerticalText)
- computedLength = computedHeight;
- else
- computedLength = computedWidth;
-
- if (lengthAdjust == SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS) {
- if (chunk.isVerticalText)
- chunk.ctm.scaleNonUniform(1.0f, chunk.textLength / computedLength);
- else
- chunk.ctm.scaleNonUniform(chunk.textLength / computedLength, 1.0f);
-
- return 0.0f;
+ if (SVGRenderBase::prepareToRenderSVGContent(boxRenderer, childPaintInfo, repaintRect, filter)) {
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine())
+ child->paint(childPaintInfo, 0, 0);
}
- return (chunk.textLength - computedLength) / float(chunk.end - chunk.start);
-}
-
-static void applyTextLengthCorrectionToTextChunk(SVGTextChunk& chunk)
-{
- // This method is not called for chunks containing chars aligned on a path.
- // -> all characters are visible, no need to check for "isHidden()" anywhere.
-
- // lengthAdjust="spacingAndGlyphs" is handled by modifying chunk.ctm
- float computedLength = 0.0f;
- float spacingToApply = calculateTextLengthCorrectionForTextChunk(chunk, chunk.lengthAdjust, computedLength);
-
- if (!chunk.ctm.isIdentity() && chunk.lengthAdjust == SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS) {
- SVGChar& firstChar = *(chunk.start);
-
- // Assure we apply the chunk scaling in the right origin
- AffineTransform newChunkCtm(chunk.ctm);
- newChunkCtm.translateRight(firstChar.x, firstChar.y);
- newChunkCtm.translate(-firstChar.x, -firstChar.y);
-
- chunk.ctm = newChunkCtm;
- }
-
- // Apply correction to chunk
- if (spacingToApply != 0.0f) {
- Vector<SVGChar>::iterator chunkIt = chunk.start;
- for (; chunkIt != chunk.end; ++chunkIt) {
- SVGChar& curChar = *chunkIt;
- curChar.drawnSeperated = true;
-
- if (chunk.isVerticalText)
- curChar.y += (chunkIt - chunk.start) * spacingToApply;
- else
- curChar.x += (chunkIt - chunk.start) * spacingToApply;
- }
- }
+ SVGRenderBase::finishRenderSVGContent(boxRenderer, childPaintInfo, filter, paintInfo.context);
+ childPaintInfo.context->restore();
}
void SVGRootInlineBox::computePerCharacterLayoutInformation()
@@ -668,26 +69,29 @@ void SVGRootInlineBox::computePerCharacterLayoutInformation()
m_svgTextChunks.clear();
// Build layout information for all contained render objects
- SVGCharacterLayoutInfo info(m_svgChars);
- buildLayoutInformation(this, info);
+ SVGCharacterLayoutInfo charInfo;
+ buildLayoutInformation(this, charInfo);
+ m_svgChars = charInfo.svgChars;
// Now all layout information are available for every character
// contained in any of our child inline/flow boxes. Build list
// of text chunks now, to be able to apply text-anchor shifts.
- buildTextChunks(m_svgChars, m_svgTextChunks, this);
+ SVGTextChunkLayoutInfo chunkInfo;
+ chunkInfo.buildTextChunks(m_svgChars.begin(), m_svgChars.end(), this);
// Layout all text chunks
// text-anchor needs to be applied to individual chunks.
- layoutTextChunks();
+ chunkInfo.layoutTextChunks();
+ m_svgTextChunks = chunkInfo.textChunks();
- // Finally the top left position of our box is known.
- // Propogate this knownledge to our RenderSVGText parent.
- FloatPoint topLeft = topLeftPositionOfCharacterRange(m_svgChars.begin(), m_svgChars.end());
- block()->setLocation((int) floorf(topLeft.x()), (int) floorf(topLeft.y()));
+ // Propagate text chunk part information to all SVGInlineTextBoxes, see SVGTextChunkLayoutInfo.h for details
+ propagateTextChunkPartInformation();
- // Layout all InlineText/Flow boxes
- // BEWARE: This requires the root top/left position to be set correctly before!
- layoutInlineBoxes();
+ // Layout all child boxes.
+ layoutChildBoxes(this);
+
+ // Resize our root box and our RenderSVGText parent block
+ layoutRootBox();
}
void SVGRootInlineBox::buildLayoutInformation(InlineFlowBox* start, SVGCharacterLayoutInfo& info)
@@ -711,8 +115,9 @@ void SVGRootInlineBox::buildLayoutInformation(InlineFlowBox* start, SVGCharacter
ASSERT(curr->isInlineFlowBox());
InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(curr);
+ // Skip generated content.
if (!flowBox->renderer()->node())
- continue; // Skip generated content.
+ continue;
bool isAnchor = flowBox->renderer()->node()->hasTagName(SVGNames::aTag);
bool isTextPath = flowBox->renderer()->node()->hasTagName(SVGNames::textPathTag);
@@ -740,13 +145,14 @@ void SVGRootInlineBox::buildLayoutInformation(InlineFlowBox* start, SVGCharacter
// Initialize sub-layout. We need to create text chunks from the textPath
// children using our standard layout code, to be able to measure the
// text length using our normal methods and not textPath specific hacks.
- Vector<SVGChar> tempChars;
Vector<SVGTextChunk> tempChunks;
- SVGCharacterLayoutInfo tempInfo(tempChars);
- buildLayoutInformation(flowBox, tempInfo);
+ SVGCharacterLayoutInfo tempCharInfo;
+ buildLayoutInformation(flowBox, tempCharInfo);
- buildTextChunks(tempChars, tempChunks, flowBox);
+ SVGTextChunkLayoutInfo tempChunkInfo;
+ tempChunkInfo.buildTextChunks(tempCharInfo.svgChars.begin(), tempCharInfo.svgChars.end(), flowBox);
+ tempChunks = tempChunkInfo.textChunks();
Vector<SVGTextChunk>::iterator it = tempChunks.begin();
Vector<SVGTextChunk>::iterator end = tempChunks.end();
@@ -786,467 +192,175 @@ void SVGRootInlineBox::buildLayoutInformation(InlineFlowBox* start, SVGCharacter
}
}
-void SVGRootInlineBox::layoutInlineBoxes()
+void SVGRootInlineBox::layoutChildBoxes(InlineFlowBox* start)
{
- int lowX = INT_MAX;
- int lowY = INT_MAX;
- int highX = INT_MIN;
- int highY = INT_MIN;
-
- // Layout all child boxes
- Vector<SVGChar>::iterator it = m_svgChars.begin();
- layoutInlineBoxes(this, it, lowX, highX, lowY, highY);
- ASSERT(it == m_svgChars.end());
-}
-
-void SVGRootInlineBox::layoutInlineBoxes(InlineFlowBox* start, Vector<SVGChar>::iterator& it, int& lowX, int& highX, int& lowY, int& highY)
-{
- for (InlineBox* curr = start->firstChild(); curr; curr = curr->nextOnLine()) {
- RenderStyle* style = curr->renderer()->style();
- if (curr->renderer()->isText()) {
- SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(curr);
- unsigned length = textBox->len();
-
- SVGChar curChar = *it;
- ASSERT(it != m_svgChars.end());
-
- FloatRect stringRect;
- for (unsigned i = 0; i < length; ++i) {
- ASSERT(it != m_svgChars.end());
-
- if (it->isHidden()) {
- ++it;
- continue;
- }
-
- stringRect.unite(textBox->calculateGlyphBoundaries(style, textBox->start() + i, *it));
- ++it;
- }
-
- IntRect enclosedStringRect = enclosingIntRect(stringRect);
-
- int minX = enclosedStringRect.x();
- int maxX = minX + enclosedStringRect.width();
-
- int minY = enclosedStringRect.y();
- int maxY = minY + enclosedStringRect.height();
-
- curr->setX(minX - block()->x());
- curr->setWidth(enclosedStringRect.width());
-
- curr->setY(minY - block()->y());
- textBox->setHeight(enclosedStringRect.height());
-
- if (minX < lowX)
- lowX = minX;
-
- if (maxX > highX)
- highX = maxX;
-
- if (minY < lowY)
- lowY = minY;
-
- if (maxY > highY)
- highY = maxY;
+ for (InlineBox* child = start->firstChild(); child; child = child->nextOnLine()) {
+ if (child->renderer()->isText()) {
+ SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(child);
+ IntRect boxRect = textBox->calculateBoundaries();
+ textBox->setX(boxRect.x());
+ textBox->setY(boxRect.y());
+ textBox->setWidth(boxRect.width());
+ textBox->setHeight(boxRect.height());
} else {
- ASSERT(curr->isInlineFlowBox());
-
- int minX = INT_MAX;
- int minY = INT_MAX;
- int maxX = INT_MIN;
- int maxY = INT_MIN;
-
- InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(curr);
-
- if (!flowBox->renderer()->node())
- continue; // Skip generated content.
-
- layoutInlineBoxes(flowBox, it, minX, maxX, minY, maxY);
-
- curr->setX(minX - block()->x());
- curr->setWidth(maxX - minX);
-
- curr->setY(minY - block()->y());
- static_cast<SVGInlineFlowBox*>(curr)->setHeight(maxY - minY);
-
- if (minX < lowX)
- lowX = minX;
-
- if (maxX > highX)
- highX = maxX;
+ ASSERT(child->isInlineFlowBox());
+
+ // Skip generated content.
+ if (!child->renderer()->node())
+ continue;
- if (minY < lowY)
- lowY = minY;
+ SVGInlineFlowBox* flowBox = static_cast<SVGInlineFlowBox*>(child);
+ layoutChildBoxes(flowBox);
- if (maxY > highY)
- highY = maxY;
+ IntRect boxRect = flowBox->calculateBoundaries();
+ flowBox->setX(boxRect.x());
+ flowBox->setY(boxRect.y());
+ flowBox->setWidth(boxRect.width());
+ flowBox->setHeight(boxRect.height());
}
}
+}
- if (start->isSVGRootInlineBox()) {
- int top = lowY - block()->y();
- int bottom = highY - block()->y();
+void SVGRootInlineBox::layoutRootBox()
+{
+ RenderBlock* parentBlock = block();
+ ASSERT(parentBlock);
- start->setX(lowX - block()->x());
- start->setY(top);
+ IntRect childRect;
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+ // Skip generated content.
+ if (!child->renderer()->node())
+ continue;
+ childRect.unite(child->calculateBoundaries());
+ }
- start->setWidth(highX - lowX);
- static_cast<SVGRootInlineBox*>(start)->setHeight(highY - lowY);
+ int xBlock = childRect.x();
+ int yBlock = childRect.y();
+ int widthBlock = childRect.width();
+ int heightBlock = childRect.height();
- GlyphOverflowAndFallbackFontsMap textBoxDataMap;
- start->computeVerticalOverflow(top, bottom, true, textBoxDataMap);
- static_cast<SVGRootInlineBox*>(start)->setLineTopBottomPositions(top, bottom);
- }
-}
+ // Finally, assign the root block position, now that all content is laid out.
+ parentBlock->setLocation(xBlock, yBlock);
+ parentBlock->setWidth(widthBlock);
+ parentBlock->setHeight(heightBlock);
-void SVGRootInlineBox::buildTextChunks(Vector<SVGChar>& svgChars, Vector<SVGTextChunk>& svgTextChunks, InlineFlowBox* start)
-{
- SVGTextChunkLayoutInfo info(svgTextChunks);
- info.it = svgChars.begin();
- info.chunk.start = svgChars.begin();
- info.chunk.end = svgChars.begin();
+ // Position all children relative to the parent block.
+ for (InlineBox* child = firstChild(); child; child = child->nextOnLine()) {
+ // Skip generated content.
+ if (!child->renderer()->node())
+ continue;
+ child->adjustPosition(-xBlock, -yBlock);
+ }
- buildTextChunks(svgChars, start, info);
- ASSERT(info.it == svgChars.end());
+ // Position ourselves.
+ setX(0);
+ setY(0);
+ setWidth(widthBlock);
+ setHeight(heightBlock);
+ setBlockHeight(heightBlock);
+ setLineTopBottomPositions(0, heightBlock);
}
-void SVGRootInlineBox::buildTextChunks(Vector<SVGChar>& svgChars, InlineFlowBox* start, SVGTextChunkLayoutInfo& info)
+void SVGRootInlineBox::propagateTextChunkPartInformation()
{
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> buildTextChunks(start=%p)\n", start);
+#if DEBUG_CHUNK_PART_PROPAGATION > 0
+ ListHashSet<SVGInlineTextBox*> boxes;
#endif
- for (InlineBox* curr = start->firstChild(); curr; curr = curr->nextOnLine()) {
- if (curr->renderer()->isText()) {
- InlineTextBox* textBox = static_cast<InlineTextBox*>(curr);
+ // Loop through all text chunks
+ const Vector<SVGTextChunk>::const_iterator end = m_svgTextChunks.end();
+ for (Vector<SVGTextChunk>::const_iterator it = m_svgTextChunks.begin(); it != end; ++it) {
+ const SVGTextChunk& chunk = *it;
+ int processedChunkCharacters = 0;
- unsigned length = textBox->len();
- if (!length)
- continue;
+ // Loop through all ranges contained in this chunk
+ const Vector<SVGInlineBoxCharacterRange>::const_iterator boxEnd = chunk.boxes.end();
+ for (Vector<SVGInlineBoxCharacterRange>::const_iterator boxIt = chunk.boxes.begin(); boxIt != boxEnd; ++boxIt) {
+ const SVGInlineBoxCharacterRange& range = *boxIt;
+ ASSERT(range.box->isSVGInlineTextBox());
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Handle inline text box (%p) with %i characters (start: %i, end: %i), handlingTextPath=%i\n",
- textBox, length, textBox->start(), textBox->end(), (int) info.handlingTextPath);
-#endif
+ // Access style & font information of this text box
+ SVGInlineTextBox* rangeTextBox = static_cast<SVGInlineTextBox*>(range.box);
+ rangeTextBox->setChunkTransformation(chunk.ctm);
- RenderText* text = textBox->textRenderer();
+ RenderText* text = rangeTextBox->textRenderer();
ASSERT(text);
- ASSERT(text->node());
- SVGTextContentElement* textContent = 0;
- Node* node = text->node()->parent();
- while (node && node->isSVGElement() && !textContent) {
- if (static_cast<SVGElement*>(node)->isTextContent())
- textContent = static_cast<SVGTextContentElement*>(node);
- else
- node = node->parentNode();
- }
- ASSERT(textContent);
-
- // Start new character range for the first chunk
- bool isFirstCharacter = info.svgTextChunks.isEmpty() && info.chunk.start == info.it && info.chunk.start == info.chunk.end;
- if (isFirstCharacter) {
- ASSERT(info.chunk.boxes.isEmpty());
- info.chunk.boxes.append(SVGInlineBoxCharacterRange());
- } else
- ASSERT(!info.chunk.boxes.isEmpty());
-
- // Walk string to find out new chunk positions, if existent
- for (unsigned i = 0; i < length; ++i) {
- ASSERT(info.it != svgChars.end());
-
- SVGInlineBoxCharacterRange& range = info.chunk.boxes.last();
- if (range.isOpen()) {
- range.box = curr;
- range.startOffset = i == 0 ? 0 : i - 1;
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " | -> Range is open! box=%p, startOffset=%i\n", range.box, range.startOffset);
-#endif
- }
+ RenderStyle* style = text->style();
+ ASSERT(style);
- // If a new (or the first) chunk has been started, record it's text-anchor and writing mode.
- if (info.assignChunkProperties) {
- info.assignChunkProperties = false;
-
- info.chunk.isVerticalText = isVerticalWritingMode(text->style()->svgStyle());
- info.chunk.isTextPath = info.handlingTextPath;
- info.chunk.anchor = text->style()->svgStyle()->textAnchor();
- info.chunk.textLength = textContent->textLength().value(textContent);
- info.chunk.lengthAdjust = (ELengthAdjust) textContent->lengthAdjust();
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " | -> Assign chunk properties, isVerticalText=%i, anchor=%i\n", info.chunk.isVerticalText, info.chunk.anchor);
-#endif
+ const Font& font = style->font();
+
+ // Figure out first and last character of this range in this chunk
+ int rangeLength = range.endOffset - range.startOffset;
+ Vector<SVGChar>::iterator itCharBegin = chunk.start + processedChunkCharacters;
+ Vector<SVGChar>::iterator itCharEnd = chunk.start + processedChunkCharacters + rangeLength;
+ ASSERT(itCharEnd <= chunk.end);
+
+ // Loop through all characters in range
+ int processedRangeCharacters = 0;
+ for (Vector<SVGChar>::iterator itChar = itCharBegin; itChar != itCharEnd; ++itChar) {
+ if (itChar->isHidden()) {
+ ++processedRangeCharacters;
+ continue;
}
- if (i > 0 && !isFirstCharacter && (*info.it).newTextChunk) {
- // Close mid chunk & character range
- ASSERT(!range.isOpen());
- ASSERT(!range.isClosed());
+ // Determine how many characters - starting from the current - can be drawn at once.
+ Vector<SVGChar>::iterator itSearch = itChar + 1;
+ while (itSearch != itCharEnd) {
+ if (itSearch->drawnSeperated || itSearch->isHidden())
+ break;
- range.endOffset = i;
- closeTextChunk(info);
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " | -> Close mid-text chunk, at endOffset: %i and starting new mid chunk!\n", range.endOffset);
-#endif
-
- // Prepare for next chunk, if we're not at the end
- startTextChunk(info);
- if (i + 1 == length) {
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " | -> Record last chunk of inline text box!\n");
-#endif
-
- startTextChunk(info);
- SVGInlineBoxCharacterRange& range = info.chunk.boxes.last();
-
- info.assignChunkProperties = false;
- info.chunk.isVerticalText = isVerticalWritingMode(text->style()->svgStyle());
- info.chunk.isTextPath = info.handlingTextPath;
- info.chunk.anchor = text->style()->svgStyle()->textAnchor();
- info.chunk.textLength = textContent->textLength().value(textContent);
- info.chunk.lengthAdjust = (ELengthAdjust) textContent->lengthAdjust();
-
- range.box = curr;
- range.startOffset = i;
-
- ASSERT(!range.isOpen());
- ASSERT(!range.isClosed());
- }
+ ++itSearch;
}
- // This should only hold true for the first character of the first chunk
- if (isFirstCharacter)
- isFirstCharacter = false;
-
- ++info.it;
- }
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Finished inline text box!\n");
-#endif
-
- SVGInlineBoxCharacterRange& range = info.chunk.boxes.last();
- if (!range.isOpen() && !range.isClosed()) {
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Last range not closed - closing with endOffset: %i\n", length);
-#endif
+ // Calculate text chunk part information for this chunk sub-range
+ const UChar* partStart = text->characters() + rangeTextBox->start() + range.startOffset + processedRangeCharacters;
- // Current text chunk is not yet closed. Finish the current range, but don't start a new chunk.
- range.endOffset = length;
+ SVGTextChunkPart part;
+ part.firstCharacter = itChar;
+ part.length = itSearch - itChar;
+ part.width = font.floatWidth(svgTextRunForInlineTextBox(partStart, part.length, style, rangeTextBox));
+ part.height = font.height();
+ part.offset = range.startOffset + processedRangeCharacters;
+ rangeTextBox->addChunkPartInformation(part);
+ processedRangeCharacters += part.length;
- if (info.it != svgChars.end()) {
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Not at last character yet!\n");
-#endif
-
- // If we're not at the end of the last box to be processed, and if the next
- // character starts a new chunk, then close the current chunk and start a new one.
- if ((*info.it).newTextChunk) {
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Next character starts new chunk! Closing current chunk, and starting a new one...\n");
-#endif
-
- closeTextChunk(info);
- startTextChunk(info);
- } else {
- // Just start a new character range
- info.chunk.boxes.append(SVGInlineBoxCharacterRange());
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Next character does NOT start a new chunk! Starting new character range...\n");
-#endif
- }
- } else {
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Closing final chunk! Finished processing!\n");
-#endif
-
- // Close final chunk, once we're at the end of the last box
- closeTextChunk(info);
- }
+ // Skip processed characters
+ itChar = itSearch - 1;
}
- } else {
- ASSERT(curr->isInlineFlowBox());
- InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(curr);
-
- if (!flowBox->renderer()->node())
- continue; // Skip generated content.
-
- bool isTextPath = flowBox->renderer()->node()->hasTagName(SVGNames::textPathTag);
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " -> Handle inline flow box (%p), isTextPath=%i\n", flowBox, (int) isTextPath);
-#endif
- if (isTextPath)
- info.handlingTextPath = true;
-
- buildTextChunks(svgChars, flowBox, info);
+ ASSERT(processedRangeCharacters == rangeLength);
+ processedChunkCharacters += rangeLength;
- if (isTextPath)
- info.handlingTextPath = false;
- }
- }
-
-#if DEBUG_CHUNK_BUILDING > 1
- fprintf(stderr, " <- buildTextChunks(start=%p)\n", start);
+#if DEBUG_CHUNK_PART_PROPAGATION > 0
+ boxes.add(rangeTextBox);
#endif
-}
-
-void SVGRootInlineBox::layoutTextChunks()
-{
- Vector<SVGTextChunk>::iterator it = m_svgTextChunks.begin();
- Vector<SVGTextChunk>::iterator end = m_svgTextChunks.end();
-
- for (; it != end; ++it) {
- SVGTextChunk& chunk = *it;
-
-#if DEBUG_CHUNK_BUILDING > 0
- {
- fprintf(stderr, "Handle TEXT CHUNK! anchor=%i, textLength=%f, lengthAdjust=%i, isVerticalText=%i, isTextPath=%i start=%p, end=%p -> dist: %i\n",
- (int) chunk.anchor, chunk.textLength, (int) chunk.lengthAdjust, (int) chunk.isVerticalText,
- (int) chunk.isTextPath, chunk.start, chunk.end, (unsigned int) (chunk.end - chunk.start));
-
- Vector<SVGInlineBoxCharacterRange>::iterator boxIt = chunk.boxes.begin();
- Vector<SVGInlineBoxCharacterRange>::iterator boxEnd = chunk.boxes.end();
-
- unsigned int i = 0;
- for (; boxIt != boxEnd; ++boxIt) {
- SVGInlineBoxCharacterRange& range = *boxIt;
- ++i;
- fprintf(stderr, " -> RANGE %i STARTOFFSET: %i, ENDOFFSET: %i, BOX: %p\n", i, range.startOffset, range.endOffset, range.box);
- }
- }
-#endif
-
- if (chunk.isTextPath)
- continue;
-
- // text-path & textLength, with lengthAdjust="spacing" is already handled for textPath layouts.
- applyTextLengthCorrectionToTextChunk(chunk);
-
- // text-anchor is already handled for textPath layouts.
- applyTextAnchorToTextChunk(chunk);
- }
-}
-
-static inline void addPaintServerToTextDecorationInfo(ETextDecoration decoration, SVGTextDecorationInfo& info, RenderObject* object)
-{
- if (object->style()->svgStyle()->hasFill())
- info.fillServerMap.set(decoration, object);
-
- if (object->style()->svgStyle()->hasStroke())
- info.strokeServerMap.set(decoration, object);
-}
-
-SVGTextDecorationInfo SVGRootInlineBox::retrievePaintServersForTextDecoration(RenderObject* start)
-{
- ASSERT(start);
-
- Vector<RenderObject*> parentChain;
- while ((start = start->parent())) {
- parentChain.prepend(start);
-
- // Stop at our direct <text> parent.
- if (start->isSVGText())
- break;
- }
-
- Vector<RenderObject*>::iterator it = parentChain.begin();
- Vector<RenderObject*>::iterator end = parentChain.end();
-
- SVGTextDecorationInfo info;
-
- for (; it != end; ++it) {
- RenderObject* object = *it;
- ASSERT(object);
-
- RenderStyle* style = object->style();
- ASSERT(style);
-
- int decorations = style->textDecoration();
- if (decorations != NONE) {
- if (decorations & OVERLINE)
- addPaintServerToTextDecorationInfo(OVERLINE, info, object);
-
- if (decorations & UNDERLINE)
- addPaintServerToTextDecorationInfo(UNDERLINE, info, object);
-
- if (decorations & LINE_THROUGH)
- addPaintServerToTextDecorationInfo(LINE_THROUGH, info, object);
}
}
- return info;
-}
-
-void SVGRootInlineBox::walkTextChunks(SVGTextChunkWalkerBase* walker, const SVGInlineTextBox* textBox)
-{
- ASSERT(walker);
-
- Vector<SVGTextChunk>::iterator it = m_svgTextChunks.begin();
- Vector<SVGTextChunk>::iterator itEnd = m_svgTextChunks.end();
-
- for (; it != itEnd; ++it) {
- SVGTextChunk& curChunk = *it;
-
- Vector<SVGInlineBoxCharacterRange>::iterator boxIt = curChunk.boxes.begin();
- Vector<SVGInlineBoxCharacterRange>::iterator boxEnd = curChunk.boxes.end();
-
- InlineBox* lastNotifiedBox = 0;
- InlineBox* prevBox = 0;
-
- unsigned int chunkOffset = 0;
- bool startedFirstChunk = false;
-
- for (; boxIt != boxEnd; ++boxIt) {
- SVGInlineBoxCharacterRange& range = *boxIt;
-
- ASSERT(range.box->isInlineTextBox());
- SVGInlineTextBox* rangeTextBox = static_cast<SVGInlineTextBox*>(range.box);
-
- if (textBox && rangeTextBox != textBox) {
- chunkOffset += range.endOffset - range.startOffset;
- continue;
- }
-
- // Eventually notify that we started a new chunk
- if (!textBox && !startedFirstChunk) {
- startedFirstChunk = true;
-
- lastNotifiedBox = range.box;
- walker->start(range.box);
- } else {
- // Eventually apply new style, as this chunk spans multiple boxes (with possible different styling)
- if (prevBox && prevBox != range.box) {
- lastNotifiedBox = range.box;
-
- walker->end(prevBox);
- walker->start(lastNotifiedBox);
- }
+#if DEBUG_CHUNK_PART_PROPAGATION > 0
+ {
+ fprintf(stderr, "Propagated text chunk part information:\n");
+
+ ListHashSet<SVGInlineTextBox*>::const_iterator it = boxes.begin();
+ const ListHashSet<SVGInlineTextBox*>::const_iterator end = boxes.end();
+
+ for (; it != end; ++it) {
+ const SVGInlineTextBox* box = *it;
+ const Vector<SVGTextChunkPart>& parts = box->svgTextChunkParts();
+
+ fprintf(stderr, " Box %p contains %i text chunk parts:\n", box, static_cast<int>(parts.size()));
+ Vector<SVGTextChunkPart>::const_iterator partIt = parts.begin();
+ const Vector<SVGTextChunkPart>::const_iterator partEnd = parts.end();
+ for (; partIt != partEnd; ++partIt) {
+ const SVGTextChunkPart& part = *partIt;
+ fprintf(stderr, " -> firstCharacter x=%lf, y=%lf, offset=%i, length=%i, width=%lf, height=%lf, textRenderer=%p\n"
+ , part.firstCharacter->x, part.firstCharacter->y, part.offset, part.length, part.width, part.height, box->textRenderer());
}
-
- unsigned int length = range.endOffset - range.startOffset;
-
- Vector<SVGChar>::iterator itCharBegin = curChunk.start + chunkOffset;
- Vector<SVGChar>::iterator itCharEnd = curChunk.start + chunkOffset + length;
- ASSERT(itCharEnd <= curChunk.end);
-
- // Process this chunk portion
- (*walker)(rangeTextBox, range.startOffset, curChunk.ctm, itCharBegin, itCharEnd);
-
- chunkOffset += length;
-
- if (!textBox)
- prevBox = range.box;
}
-
- if (!textBox && startedFirstChunk)
- walker->end(lastNotifiedBox);
}
+#endif
}
} // namespace WebCore
diff --git a/WebCore/rendering/SVGRootInlineBox.h b/WebCore/rendering/SVGRootInlineBox.h
index c3e1028..75e85fd 100644
--- a/WebCore/rendering/SVGRootInlineBox.h
+++ b/WebCore/rendering/SVGRootInlineBox.h
@@ -1,9 +1,8 @@
/*
- * This file is part of the WebKit project.
- *
* Copyright (C) 2006 Oliver Hunt <ojh16@student.canterbury.ac.nz>
* (C) 2006 Apple Computer Inc.
* (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -34,12 +33,10 @@
namespace WebCore {
-class InlineTextBox;
-class RenderSVGRoot;
class SVGInlineTextBox;
-struct SVGLastGlyphInfo;
-class SVGRootInlineBox : public RootInlineBox, protected SVGRenderBase {
+class SVGRootInlineBox : public RootInlineBox
+ , protected SVGRenderBase {
public:
SVGRootInlineBox(RenderObject* obj)
: RootInlineBox(obj)
@@ -47,39 +44,27 @@ public:
{
}
- virtual bool isSVGRootInlineBox() { return true; }
+ virtual bool isSVGRootInlineBox() const { return true; }
virtual int virtualHeight() const { return m_height; }
- void setHeight(int h) { m_height = h; }
-
- virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
+ void setHeight(int height) { m_height = height; }
- virtual int placeBoxesHorizontally(int x, int& leftPosition, int& rightPosition, bool& needsWordSpacing, GlyphOverflowAndFallbackFontsMap&);
- virtual int verticallyAlignBoxes(int heightOfBlock, GlyphOverflowAndFallbackFontsMap&);
+ virtual void paint(RenderObject::PaintInfo&, int tx, int ty);
- virtual void computePerCharacterLayoutInformation();
+ void computePerCharacterLayoutInformation();
virtual FloatRect objectBoundingBox() const { return FloatRect(); }
virtual FloatRect repaintRectInLocalCoordinates() const { return FloatRect(); }
- // Used by SVGInlineTextBox
+ // Used by SVGRenderTreeAsText
const Vector<SVGTextChunk>& svgTextChunks() const { return m_svgTextChunks; }
- void walkTextChunks(SVGTextChunkWalkerBase*, const SVGInlineTextBox* textBox = 0);
-
private:
- friend struct SVGRootInlineBoxPaintWalker;
-
- void layoutInlineBoxes();
- void layoutInlineBoxes(InlineFlowBox* start, Vector<SVGChar>::iterator& it, int& minX, int& maxX, int& minY, int& maxY);
-
+ void propagateTextChunkPartInformation();
void buildLayoutInformation(InlineFlowBox* start, SVGCharacterLayoutInfo&);
- void buildTextChunks(Vector<SVGChar>&, Vector<SVGTextChunk>&, InlineFlowBox* start);
- void buildTextChunks(Vector<SVGChar>&, InlineFlowBox* start, SVGTextChunkLayoutInfo&);
- void layoutTextChunks();
-
- SVGTextDecorationInfo retrievePaintServersForTextDecoration(RenderObject* start);
+ void layoutRootBox();
+ void layoutChildBoxes(InlineFlowBox* start);
private:
int m_height;
@@ -87,9 +72,6 @@ private:
Vector<SVGTextChunk> m_svgTextChunks;
};
-// Shared with SVGRenderTreeAsText / SVGInlineTextBox
-RenderSVGRoot* findSVGRootObject(RenderObject* start);
-
} // namespace WebCore
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGTextChunkLayoutInfo.cpp b/WebCore/rendering/SVGTextChunkLayoutInfo.cpp
new file mode 100644
index 0000000..a7a6d87
--- /dev/null
+++ b/WebCore/rendering/SVGTextChunkLayoutInfo.cpp
@@ -0,0 +1,493 @@
+/*
+ * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) Research In Motion Limited 2010. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "config.h"
+#include "SVGTextChunkLayoutInfo.h"
+
+#if ENABLE(SVG)
+#include "InlineFlowBox.h"
+#include "SVGInlineTextBox.h"
+#include "SVGRenderStyle.h"
+
+// Text chunk creation is complex and the whole process
+// can easily be traced by setting this variable > 0.
+#define DEBUG_CHUNK_BUILDING 0
+
+namespace WebCore {
+
+static float cummulatedWidthOrHeightOfTextChunk(SVGTextChunk& chunk, bool calcWidthOnly)
+{
+ float length = 0.0f;
+ Vector<SVGChar>::iterator charIt = chunk.start;
+
+ Vector<SVGInlineBoxCharacterRange>::iterator it = chunk.boxes.begin();
+ Vector<SVGInlineBoxCharacterRange>::iterator end = chunk.boxes.end();
+
+ for (; it != end; ++it) {
+ SVGInlineBoxCharacterRange& range = *it;
+
+ SVGInlineTextBox* box = static_cast<SVGInlineTextBox*>(range.box);
+ RenderStyle* style = box->renderer()->style();
+
+ for (int i = range.startOffset; i < range.endOffset; ++i) {
+ ASSERT(charIt <= chunk.end);
+
+ // Determine how many characters - starting from the current - can be measured at once.
+ // Important for non-absolute positioned non-latin1 text (ie. Arabic) where ie. the width
+ // of a string is not the sum of the boundaries of all contained glyphs.
+ Vector<SVGChar>::iterator itSearch = charIt + 1;
+ Vector<SVGChar>::iterator endSearch = charIt + range.endOffset - i;
+ while (itSearch != endSearch) {
+ // No need to check for 'isHidden()' here as this function is not called for text paths.
+ if (itSearch->drawnSeperated)
+ break;
+
+ itSearch++;
+ }
+
+ unsigned int positionOffset = itSearch - charIt;
+
+ // Calculate width/height of subrange
+ SVGInlineBoxCharacterRange subRange;
+ subRange.box = range.box;
+ subRange.startOffset = i;
+ subRange.endOffset = i + positionOffset;
+
+ if (calcWidthOnly)
+ length += cummulatedWidthOfInlineBoxCharacterRange(subRange);
+ else
+ length += cummulatedHeightOfInlineBoxCharacterRange(subRange);
+
+ // Calculate gap between the previous & current range
+ // <text x="10 50 70">ABCD</text> - we need to take the gaps between A & B into account
+ // so add "40" as width, and analogous for B & C, add "20" as width.
+ if (itSearch > chunk.start && itSearch < chunk.end) {
+ SVGChar& lastCharacter = *(itSearch - 1);
+ SVGChar& currentCharacter = *itSearch;
+
+ int charsConsumed = 0;
+ float glyphWidth = 0.0f;
+ float glyphHeight = 0.0f;
+ String glyphName;
+ String unicodeString;
+ box->measureCharacter(style, i + positionOffset - 1, charsConsumed, glyphName, unicodeString, glyphWidth, glyphHeight);
+
+ if (calcWidthOnly)
+ length += currentCharacter.x - lastCharacter.x - glyphWidth;
+ else
+ length += currentCharacter.y - lastCharacter.y - glyphHeight;
+ }
+
+ // Advance processed characters
+ i += positionOffset - 1;
+ charIt = itSearch;
+ }
+ }
+
+ ASSERT(charIt == chunk.end);
+ return length;
+}
+
+static float cummulatedWidthOfTextChunk(SVGTextChunk& chunk)
+{
+ return cummulatedWidthOrHeightOfTextChunk(chunk, true);
+}
+
+static float cummulatedHeightOfTextChunk(SVGTextChunk& chunk)
+{
+ return cummulatedWidthOrHeightOfTextChunk(chunk, false);
+}
+
+float calculateTextAnchorShiftForTextChunk(SVGTextChunk& chunk, ETextAnchor anchor)
+{
+ float shift = 0.0f;
+
+ if (chunk.isVerticalText)
+ shift = cummulatedHeightOfTextChunk(chunk);
+ else
+ shift = cummulatedWidthOfTextChunk(chunk);
+
+ if (anchor == TA_MIDDLE)
+ shift *= -0.5f;
+ else
+ shift *= -1.0f;
+
+ return shift;
+}
+
+static void applyTextAnchorToTextChunk(SVGTextChunk& chunk)
+{
+ // This method is not called for chunks containing chars aligned on a path.
+ // -> all characters are visible, no need to check for "isHidden()" anywhere.
+
+ if (chunk.anchor == TA_START)
+ return;
+
+ float shift = calculateTextAnchorShiftForTextChunk(chunk, chunk.anchor);
+
+ // Apply correction to chunk
+ Vector<SVGChar>::iterator chunkIt = chunk.start;
+ for (; chunkIt != chunk.end; ++chunkIt) {
+ SVGChar& curChar = *chunkIt;
+
+ if (chunk.isVerticalText)
+ curChar.y += shift;
+ else
+ curChar.x += shift;
+ }
+
+ // Move inline boxes
+ Vector<SVGInlineBoxCharacterRange>::iterator boxIt = chunk.boxes.begin();
+ Vector<SVGInlineBoxCharacterRange>::iterator boxEnd = chunk.boxes.end();
+
+ for (; boxIt != boxEnd; ++boxIt) {
+ SVGInlineBoxCharacterRange& range = *boxIt;
+
+ InlineBox* curBox = range.box;
+ ASSERT(curBox->isSVGInlineTextBox());
+
+ // Move target box
+ if (chunk.isVerticalText)
+ curBox->setY(curBox->y() + static_cast<int>(shift));
+ else
+ curBox->setX(curBox->x() + static_cast<int>(shift));
+ }
+}
+
+float calculateTextLengthCorrectionForTextChunk(SVGTextChunk& chunk, ELengthAdjust lengthAdjust, float& computedLength)
+{
+ if (chunk.textLength <= 0.0f)
+ return 0.0f;
+
+ computedLength = 0.0f;
+
+ float computedWidth = cummulatedWidthOfTextChunk(chunk);
+ float computedHeight = cummulatedHeightOfTextChunk(chunk);
+ if ((computedWidth <= 0.0f && !chunk.isVerticalText)
+ || (computedHeight <= 0.0f && chunk.isVerticalText))
+ return 0.0f;
+
+ computedLength = chunk.isVerticalText ? computedHeight : computedWidth;
+ if (lengthAdjust == SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS) {
+ if (chunk.isVerticalText)
+ chunk.ctm.scaleNonUniform(1.0f, chunk.textLength / computedLength);
+ else
+ chunk.ctm.scaleNonUniform(chunk.textLength / computedLength, 1.0f);
+
+ return 0.0f;
+ }
+
+ return (chunk.textLength - computedLength) / float(chunk.end - chunk.start);
+}
+
+static void applyTextLengthCorrectionToTextChunk(SVGTextChunk& chunk)
+{
+ // This method is not called for chunks containing chars aligned on a path.
+ // -> all characters are visible, no need to check for "isHidden()" anywhere.
+
+ // lengthAdjust="spacingAndGlyphs" is handled by setting a scale factor for the whole chunk
+ float textLength = 0.0f;
+ float spacingToApply = calculateTextLengthCorrectionForTextChunk(chunk, chunk.lengthAdjust, textLength);
+
+ if (!chunk.ctm.isIdentity() && chunk.lengthAdjust == SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS) {
+ SVGChar& firstChar = *(chunk.start);
+
+ // Assure we apply the chunk scaling in the right origin
+ AffineTransform newChunkCtm(chunk.ctm);
+ newChunkCtm.translateRight(firstChar.x, firstChar.y);
+ newChunkCtm.translate(-firstChar.x, -firstChar.y);
+
+ chunk.ctm = newChunkCtm;
+ }
+
+ // Apply correction to chunk
+ if (spacingToApply != 0.0f) {
+ Vector<SVGChar>::iterator chunkIt = chunk.start;
+ for (; chunkIt != chunk.end; ++chunkIt) {
+ SVGChar& curChar = *chunkIt;
+ curChar.drawnSeperated = true;
+
+ if (chunk.isVerticalText)
+ curChar.y += (chunkIt - chunk.start) * spacingToApply;
+ else
+ curChar.x += (chunkIt - chunk.start) * spacingToApply;
+ }
+ }
+}
+
+void SVGTextChunkLayoutInfo::startTextChunk()
+{
+ m_chunk.boxes.clear();
+ m_chunk.boxes.append(SVGInlineBoxCharacterRange());
+
+ m_chunk.start = m_charsIt;
+ m_assignChunkProperties = true;
+}
+
+void SVGTextChunkLayoutInfo::closeTextChunk()
+{
+ ASSERT(!m_chunk.boxes.last().isOpen());
+ ASSERT(m_chunk.boxes.last().isClosed());
+
+ m_chunk.end = m_charsIt;
+ ASSERT(m_chunk.end >= m_chunk.start);
+
+ m_svgTextChunks.append(m_chunk);
+}
+
+void SVGTextChunkLayoutInfo::buildTextChunks(Vector<SVGChar>::iterator begin, Vector<SVGChar>::iterator end, InlineFlowBox* start)
+{
+ m_charsBegin = begin;
+ m_charsEnd = end;
+
+ m_charsIt = begin;
+ m_chunk = SVGTextChunk(begin);
+
+ recursiveBuildTextChunks(start);
+ ASSERT(m_charsIt == m_charsEnd);
+}
+
+void SVGTextChunkLayoutInfo::recursiveBuildTextChunks(InlineFlowBox* start)
+{
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> buildTextChunks(start=%p)\n", start);
+#endif
+
+ for (InlineBox* curr = start->firstChild(); curr; curr = curr->nextOnLine()) {
+ if (curr->renderer()->isText()) {
+ InlineTextBox* textBox = static_cast<InlineTextBox*>(curr);
+
+ unsigned length = textBox->len();
+ ASSERT(length > 0);
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Handle inline text box (%p) with %i characters (start: %i, end: %i), handlingTextPath=%i\n",
+ textBox, length, textBox->start(), textBox->end(), (int) m_handlingTextPath);
+#endif
+
+ RenderText* text = textBox->textRenderer();
+ ASSERT(text);
+ ASSERT(text->node());
+
+ SVGTextContentElement* textContent = 0;
+ Node* node = text->node()->parent();
+ while (node && node->isSVGElement() && !textContent) {
+ if (static_cast<SVGElement*>(node)->isTextContent())
+ textContent = static_cast<SVGTextContentElement*>(node);
+ else
+ node = node->parentNode();
+ }
+ ASSERT(textContent);
+
+ // Start new character range for the first chunk
+ bool isFirstCharacter = m_svgTextChunks.isEmpty() && m_chunk.start == m_charsIt && m_chunk.start == m_chunk.end;
+ if (isFirstCharacter) {
+ ASSERT(m_chunk.boxes.isEmpty());
+ m_chunk.boxes.append(SVGInlineBoxCharacterRange());
+ } else
+ ASSERT(!m_chunk.boxes.isEmpty());
+
+ // Walk string to find out new chunk positions, if existent
+ for (unsigned i = 0; i < length; ++i) {
+ ASSERT(m_charsIt != m_charsEnd);
+
+ SVGInlineBoxCharacterRange& range = m_chunk.boxes.last();
+ if (range.isOpen()) {
+ range.box = curr;
+ range.startOffset = !i ? 0 : i - 1;
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " | -> Range is open! box=%p, startOffset=%i\n", range.box, range.startOffset);
+#endif
+ }
+
+ // If a new (or the first) chunk has been started, record it's text-anchor and writing mode.
+ if (m_assignChunkProperties) {
+ m_assignChunkProperties = false;
+
+ m_chunk.isVerticalText = isVerticalWritingMode(text->style()->svgStyle());
+ m_chunk.isTextPath = m_handlingTextPath;
+ m_chunk.anchor = text->style()->svgStyle()->textAnchor();
+ m_chunk.textLength = textContent->textLength().value(textContent);
+ m_chunk.lengthAdjust = (ELengthAdjust) textContent->lengthAdjust();
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " | -> Assign chunk properties, isVerticalText=%i, anchor=%i\n", m_chunk.isVerticalText, m_chunk.anchor);
+#endif
+ }
+
+ if (i > 0 && !isFirstCharacter && m_charsIt->newTextChunk) {
+ // Close mid chunk & character range
+ ASSERT(!range.isOpen());
+ ASSERT(!range.isClosed());
+
+ range.endOffset = i;
+ closeTextChunk();
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " | -> Close mid-text chunk, at endOffset: %i and starting new mid chunk!\n", range.endOffset);
+#endif
+
+ // Prepare for next chunk, if we're not at the end
+ startTextChunk();
+ if (i + 1 == length) {
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " | -> Record last chunk of inline text box!\n");
+#endif
+
+ startTextChunk();
+ SVGInlineBoxCharacterRange& range = m_chunk.boxes.last();
+
+ m_assignChunkProperties = false;
+ m_chunk.isVerticalText = isVerticalWritingMode(text->style()->svgStyle());
+ m_chunk.isTextPath = m_handlingTextPath;
+ m_chunk.anchor = text->style()->svgStyle()->textAnchor();
+ m_chunk.textLength = textContent->textLength().value(textContent);
+ m_chunk.lengthAdjust = (ELengthAdjust) textContent->lengthAdjust();
+
+ range.box = curr;
+ range.startOffset = i;
+
+ ASSERT(!range.isOpen());
+ ASSERT(!range.isClosed());
+ }
+ }
+
+ // This should only hold true for the first character of the first chunk
+ if (isFirstCharacter)
+ isFirstCharacter = false;
+
+ ++m_charsIt;
+ }
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Finished inline text box!\n");
+#endif
+
+ SVGInlineBoxCharacterRange& range = m_chunk.boxes.last();
+ if (!range.isOpen() && !range.isClosed()) {
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Last range not closed - closing with endOffset: %i\n", length);
+#endif
+
+ // Current text chunk is not yet closed. Finish the current range, but don't start a new chunk.
+ range.endOffset = length;
+
+ if (m_charsIt != m_charsEnd) {
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Not at last character yet!\n");
+#endif
+
+ // If we're not at the end of the last box to be processed, and if the next
+ // character starts a new chunk, then close the current chunk and start a new one.
+ if (m_charsIt->newTextChunk) {
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Next character starts new chunk! Closing current chunk, and starting a new one...\n");
+#endif
+
+ closeTextChunk();
+ startTextChunk();
+ } else {
+ // Just start a new character range
+ m_chunk.boxes.append(SVGInlineBoxCharacterRange());
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Next character does NOT start a new chunk! Starting new character range...\n");
+#endif
+ }
+ } else {
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Closing final chunk! Finished processing!\n");
+#endif
+
+ // Close final chunk, once we're at the end of the last box
+ closeTextChunk();
+ }
+ }
+ } else {
+ ASSERT(curr->isInlineFlowBox());
+ InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(curr);
+
+ // Skip generated content.
+ if (!flowBox->renderer()->node())
+ continue;
+
+ bool isTextPath = flowBox->renderer()->node()->hasTagName(SVGNames::textPathTag);
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " -> Handle inline flow box (%p), isTextPath=%i\n", flowBox, (int) isTextPath);
+#endif
+
+ if (isTextPath)
+ m_handlingTextPath = true;
+
+ recursiveBuildTextChunks(flowBox);
+
+ if (isTextPath)
+ m_handlingTextPath = false;
+ }
+ }
+
+#if DEBUG_CHUNK_BUILDING > 1
+ fprintf(stderr, " <- buildTextChunks(start=%p)\n", start);
+#endif
+}
+
+void SVGTextChunkLayoutInfo::layoutTextChunks()
+{
+ Vector<SVGTextChunk>::iterator it = m_svgTextChunks.begin();
+ Vector<SVGTextChunk>::iterator end = m_svgTextChunks.end();
+
+ for (; it != end; ++it) {
+ SVGTextChunk& chunk = *it;
+
+#if DEBUG_CHUNK_BUILDING > 0
+ {
+ fprintf(stderr, "Handle TEXT CHUNK! anchor=%i, textLength=%f, lengthAdjust=%i, isVerticalText=%i, isTextPath=%i start=%p, end=%p -> dist: %i\n",
+ (int) chunk.anchor, chunk.textLength, (int) chunk.lengthAdjust, (int) chunk.isVerticalText,
+ (int) chunk.isTextPath, chunk.start, chunk.end, (unsigned int) (chunk.end - chunk.start));
+
+ Vector<SVGInlineBoxCharacterRange>::iterator boxIt = chunk.boxes.begin();
+ Vector<SVGInlineBoxCharacterRange>::iterator boxEnd = chunk.boxes.end();
+
+ unsigned int i = 0;
+ for (; boxIt != boxEnd; ++boxIt) {
+ SVGInlineBoxCharacterRange& range = *boxIt;
+ ++i;
+ fprintf(stderr, " -> RANGE %i STARTOFFSET: %i, ENDOFFSET: %i, BOX: %p\n", i, range.startOffset, range.endOffset, range.box);
+ }
+ }
+#endif
+
+ if (chunk.isTextPath)
+ continue;
+
+ // text-path & textLength, with lengthAdjust="spacing" is already handled for textPath layouts.
+ applyTextLengthCorrectionToTextChunk(chunk);
+
+ // text-anchor is already handled for textPath layouts.
+ applyTextAnchorToTextChunk(chunk);
+ }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGTextChunkLayoutInfo.h b/WebCore/rendering/SVGTextChunkLayoutInfo.h
index 524c983..e06dd1a 100644
--- a/WebCore/rendering/SVGTextChunkLayoutInfo.h
+++ b/WebCore/rendering/SVGTextChunkLayoutInfo.h
@@ -24,6 +24,8 @@
#if ENABLE(SVG)
#include "AffineTransform.h"
+#include "SVGCharacterData.h"
+#include "SVGRenderStyle.h"
#include "SVGTextContentElement.h"
#include <wtf/Assertions.h>
@@ -32,8 +34,75 @@
namespace WebCore {
class InlineBox;
+class InlineFlowBox;
class SVGInlineTextBox;
+// A SVGTextChunk directly corresponds to the definition of a "text chunk" per SVG 1.1 specification
+// For example, each absolute positioned character starts a text chunk (much more to respect, see spec).
+// Each SVGTextChunk contains a Vector of SVGInlineBoxCharacterRange, describing how many boxes are spanned
+// by this chunk. Following two examples should clarify the code a bit:
+//
+// 1. <text x="10 20 30">ABC</text> - one InlineTextBox is created, three SVGTextChunks each with one SVGInlineBoxCharaterRange
+// [SVGTextChunk 1]
+// [SVGInlineBoxCharacterRange 1, startOffset=0, endOffset=1, box=0x1]
+// [SVGTextChunk 2]
+// [SVGInlineBoxCharacterRange 1, startOffset=1, endOffset=2, box=0x1]
+// [SVGTextChunk 3]
+// [SVGInlineBoxCharacterRange 1, startOffset=2, endOffset=3, box=0x1]
+//
+// 2. <text x="10">A<tspan>B</tspan>C</text> - three InlineTextBoxs are created, one SVGTextChunk, with three SVGInlineBoxCharacterRanges
+// [SVGTextChunk 1]
+// [SVGInlineBoxCharacterRange 1, startOffset=0, endOffset=1, box=0x1]
+// [SVGInlineBoxCharacterRange 2, startOffset=0, endOffset=1, box=0x2]
+// [SVGInlineBoxCharacterRange 3, startOffset=0, endOffset=1, box=0x3]
+//
+// High level overview of the SVG text layout code:
+// Step #1) - Build Vector of SVGChar objects starting from root <text> diving into children
+// Step #2) - Build Vector of SVGTextChunk objects, containing offsets into the InlineTextBoxes and SVGChar vectors
+// Step #3) - Apply chunk post processing (text-anchor / textLength support, which operate on text chunks!)
+// Step #4) - Propagate information, how many chunk "parts" are associated with each SVGInlineTextBox (see below)
+// Step #5) - Layout all InlineBoxes, only by measuring their context rect (x/y/width/height defined through SVGChars and transformations)
+// Step #6) - Layout SVGRootInlineBox, it's parent RenderSVGText block and fixup child positions, to be relative to the root box
+//
+// When painting a range of characters, we have to determine how many can be drawn in a row. Each absolute postioned
+// character is drawn individually. After step #2) we know all text chunks, and how they span across the SVGInlineTextBoxes.
+// In step #4) we build a list of text chunk "parts" and store it in each SVGInlineTextBox. A chunk "part" is a part of a
+// text chunk that lives in a SVGInlineTextBox (consists of a length, width, height and a monotonic offset from the chunk begin)
+// The SVGTextChunkPart object describes this information.
+// When painting we can follow the regular InlineBox flow, we start painting the SVGRootInlineBox, which just asks its children
+// to paint. They can paint on their own because all position information are known. Previously we used to draw _all_ characters
+// from the SVGRootInlineBox, which violates the whole concept of the multiple InlineBoxes, and made text selection very hard to
+// implement.
+
+struct SVGTextChunkPart {
+ SVGTextChunkPart()
+ : offset(-1)
+ , length(-1)
+ , width(0)
+ , height(0)
+ {
+ }
+
+ bool isValid() const
+ {
+ return offset != -1
+ && length != -1
+ && width
+ && height;
+ }
+
+ // First character of this text chunk part, defining the origin to be drawn
+ Vector<SVGChar>::const_iterator firstCharacter;
+
+ // Start offset in textRenderer()->characters() buffer.
+ int offset;
+
+ // length/width/height of chunk part
+ int length;
+ float width;
+ float height;
+};
+
struct SVGInlineBoxCharacterRange {
SVGInlineBoxCharacterRange()
: startOffset(INT_MIN)
@@ -57,16 +126,16 @@ struct SVGChar;
typedef SVGTextContentElement::SVGLengthAdjustType ELengthAdjust;
struct SVGTextChunk {
- SVGTextChunk()
+ SVGTextChunk(Vector<SVGChar>::iterator it)
: anchor(TA_START)
, textLength(0.0f)
, lengthAdjust(SVGTextContentElement::LENGTHADJUST_SPACING)
- , ctm()
, isVerticalText(false)
, isTextPath(false)
- , start(0)
- , end(0)
- { }
+ , start(it)
+ , end(it)
+ {
+ }
// text-anchor support
ETextAnchor anchor;
@@ -87,91 +156,42 @@ struct SVGTextChunk {
Vector<SVGInlineBoxCharacterRange> boxes;
};
-struct SVGTextChunkWalkerBase {
- virtual ~SVGTextChunkWalkerBase() { }
-
- virtual void operator()(SVGInlineTextBox* textBox, int startOffset, const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end) = 0;
-
- // Followings methods are only used for painting text chunks
- virtual void start(InlineBox*) = 0;
- virtual void end(InlineBox*) = 0;
-};
-
-template<typename CallbackClass>
-struct SVGTextChunkWalker : public SVGTextChunkWalkerBase {
-public:
- typedef void (CallbackClass::*SVGTextChunkWalkerCallback)(SVGInlineTextBox* textBox,
- int startOffset,
- const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start,
- const Vector<SVGChar>::iterator& end);
-
- // These callbacks are only used for painting!
- typedef void (CallbackClass::*SVGTextChunkStartCallback)(InlineBox* box);
- typedef void (CallbackClass::*SVGTextChunkEndCallback)(InlineBox* box);
-
- SVGTextChunkWalker(CallbackClass* object,
- SVGTextChunkWalkerCallback walker,
- SVGTextChunkStartCallback start = 0,
- SVGTextChunkEndCallback end = 0)
- : m_object(object)
- , m_walkerCallback(walker)
- , m_startCallback(start)
- , m_endCallback(end)
+struct SVGTextChunkLayoutInfo {
+ SVGTextChunkLayoutInfo()
+ : m_assignChunkProperties(true)
+ , m_handlingTextPath(false)
+ , m_charsIt(0)
+ , m_charsBegin(0)
+ , m_charsEnd(0)
+ , m_chunk(0)
{
- ASSERT(object);
- ASSERT(walker);
}
- virtual void operator()(SVGInlineTextBox* textBox, int startOffset, const AffineTransform& chunkCtm,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end)
- {
- (*m_object.*m_walkerCallback)(textBox, startOffset, chunkCtm, start, end);
- }
+ const Vector<SVGTextChunk>& textChunks() const { return m_svgTextChunks; }
- // Followings methods are only used for painting text chunks
- virtual void start(InlineBox* box)
- {
- if (m_startCallback)
- (*m_object.*m_startCallback)(box);
- else
- ASSERT_NOT_REACHED();
- }
-
- virtual void end(InlineBox* box)
- {
- if (m_endCallback)
- (*m_object.*m_endCallback)(box);
- else
- ASSERT_NOT_REACHED();
- }
+ void buildTextChunks(Vector<SVGChar>::iterator charsBegin, Vector<SVGChar>::iterator charsEnd, InlineFlowBox* start);
+ void layoutTextChunks();
private:
- CallbackClass* m_object;
- SVGTextChunkWalkerCallback m_walkerCallback;
- SVGTextChunkStartCallback m_startCallback;
- SVGTextChunkEndCallback m_endCallback;
-};
+ void startTextChunk();
+ void closeTextChunk();
+ void recursiveBuildTextChunks(InlineFlowBox* start);
-struct SVGTextChunkLayoutInfo {
- SVGTextChunkLayoutInfo(Vector<SVGTextChunk>& textChunks)
- : assignChunkProperties(true)
- , handlingTextPath(false)
- , svgTextChunks(textChunks)
- , it(0)
- {
- }
-
- bool assignChunkProperties : 1;
- bool handlingTextPath : 1;
+ bool m_assignChunkProperties : 1;
+ bool m_handlingTextPath : 1;
- Vector<SVGTextChunk>& svgTextChunks;
- Vector<SVGChar>::iterator it;
+ Vector<SVGChar>::iterator m_charsIt;
+ Vector<SVGChar>::iterator m_charsBegin;
+ Vector<SVGChar>::iterator m_charsEnd;
- SVGTextChunk chunk;
+ Vector<SVGTextChunk> m_svgTextChunks;
+ SVGTextChunk m_chunk;
};
+// Helper functions
+float calculateTextAnchorShiftForTextChunk(SVGTextChunk&, ETextAnchor);
+float calculateTextLengthCorrectionForTextChunk(SVGTextChunk&, ELengthAdjust, float& computedLength);
+
} // namespace WebCore
#endif // ENABLE(SVG)
diff --git a/WebCore/rendering/SVGTextLayoutUtilities.cpp b/WebCore/rendering/SVGTextLayoutUtilities.cpp
index 39705e9..4366498 100644
--- a/WebCore/rendering/SVGTextLayoutUtilities.cpp
+++ b/WebCore/rendering/SVGTextLayoutUtilities.cpp
@@ -272,40 +272,45 @@ float cummulatedWidthOfInlineBoxCharacterRange(SVGInlineBoxCharacterRange& range
{
ASSERT(!range.isOpen());
ASSERT(range.isClosed());
- ASSERT(range.box->isInlineTextBox());
+ ASSERT(range.box->isSVGInlineTextBox());
InlineTextBox* textBox = static_cast<InlineTextBox*>(range.box);
RenderText* text = textBox->textRenderer();
RenderStyle* style = text->style();
-
- return style->font().floatWidth(svgTextRunForInlineTextBox(text->characters() + textBox->start() + range.startOffset, range.endOffset - range.startOffset, style, textBox, 0));
+ return style->font().floatWidth(svgTextRunForInlineTextBox(text->characters() + textBox->start() + range.startOffset, range.endOffset - range.startOffset, style, textBox));
}
float cummulatedHeightOfInlineBoxCharacterRange(SVGInlineBoxCharacterRange& range)
{
ASSERT(!range.isOpen());
ASSERT(range.isClosed());
- ASSERT(range.box->isInlineTextBox());
+ ASSERT(range.box->isSVGInlineTextBox());
InlineTextBox* textBox = static_cast<InlineTextBox*>(range.box);
- RenderText* text = textBox->textRenderer();
- const Font& font = text->style()->font();
-
- return (range.endOffset - range.startOffset) * (font.ascent() + font.descent());
+ return (range.endOffset - range.startOffset) * textBox->textRenderer()->style()->font().height();
}
-TextRun svgTextRunForInlineTextBox(const UChar* characters, int length, const RenderStyle* style, const InlineTextBox* textBox, float xPosition)
+TextRun svgTextRunForInlineTextBox(const UChar* characters, int length, const RenderStyle* style, const InlineTextBox* textBox)
{
ASSERT(textBox);
ASSERT(style);
- TextRun run(characters, length, false, static_cast<int>(xPosition), textBox->toAdd(), textBox->direction() == RTL, textBox->m_dirOverride || style->visuallyOrdered());
+ TextRun run(characters
+ , length
+ , false /* allowTabs */
+ , 0 /* xPos, only relevant with allowTabs=true */
+ , 0 /* padding, only relevant for justified text, not relevant for SVG */
+ , textBox->direction() == RTL
+ , textBox->m_dirOverride || style->visuallyOrdered() /* directionalOverride */);
#if ENABLE(SVG_FONTS)
run.setReferencingRenderObject(textBox->textRenderer()->parent());
#endif
- // We handle letter & word spacing ourselves
+ // Disable any word/character rounding.
+ run.disableRoundingHacks();
+
+ // We handle letter & word spacing ourselves.
run.disableSpacing();
return run;
}
diff --git a/WebCore/rendering/SVGTextLayoutUtilities.h b/WebCore/rendering/SVGTextLayoutUtilities.h
index 196a09c..8c07f62 100644
--- a/WebCore/rendering/SVGTextLayoutUtilities.h
+++ b/WebCore/rendering/SVGTextLayoutUtilities.h
@@ -32,7 +32,6 @@ class Font;
class InlineTextBox;
class RenderObject;
class RenderStyle;
-class RenderSVGResource;
class SVGRenderStyle;
class TextRun;
@@ -40,26 +39,6 @@ struct SVGChar;
struct SVGCharacterLayoutInfo;
struct SVGInlineBoxCharacterRange;
-enum SVGTextPaintSubphase {
- SVGTextPaintSubphaseBackground,
- SVGTextPaintSubphaseGlyphFill,
- SVGTextPaintSubphaseGlyphFillSelection,
- SVGTextPaintSubphaseGlyphStroke,
- SVGTextPaintSubphaseGlyphStrokeSelection,
- SVGTextPaintSubphaseForeground
-};
-
-struct SVGTextPaintInfo {
- SVGTextPaintInfo()
- : activePaintingResource(0)
- , subphase(SVGTextPaintSubphaseBackground)
- {
- }
-
- RenderSVGResource* activePaintingResource;
- SVGTextPaintSubphase subphase;
-};
-
struct SVGLastGlyphInfo {
SVGLastGlyphInfo()
: isValid(false)
@@ -79,7 +58,7 @@ float applyGlyphAdvanceAndShiftRespectingOrientation(bool isVerticalText, float
FloatPoint topLeftPositionOfCharacterRange(Vector<SVGChar>::iterator start, Vector<SVGChar>::iterator end);
float cummulatedWidthOfInlineBoxCharacterRange(SVGInlineBoxCharacterRange&);
float cummulatedHeightOfInlineBoxCharacterRange(SVGInlineBoxCharacterRange&);
-TextRun svgTextRunForInlineTextBox(const UChar*, int length, const RenderStyle*, const InlineTextBox*, float xPos);
+TextRun svgTextRunForInlineTextBox(const UChar*, int length, const RenderStyle*, const InlineTextBox*);
float calculateCSSKerning(const RenderStyle*);
bool applySVGKerning(SVGCharacterLayoutInfo&, const RenderStyle*, SVGLastGlyphInfo&, const String& unicodeString, const String& glyphName, bool isVerticalText);
diff --git a/WebCore/rendering/SVGTextQuery.cpp b/WebCore/rendering/SVGTextQuery.cpp
new file mode 100644
index 0000000..35ca690
--- /dev/null
+++ b/WebCore/rendering/SVGTextQuery.cpp
@@ -0,0 +1,467 @@
+/*
+ Copyright (C) Research In Motion Limited 2010. All rights reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+#include "config.h"
+#include "SVGTextQuery.h"
+
+#if ENABLE(SVG)
+#include "FloatConversion.h"
+#include "InlineFlowBox.h"
+#include "RenderBlock.h"
+#include "RenderInline.h"
+#include "SVGInlineTextBox.h"
+#include "VisiblePosition.h"
+
+namespace WebCore {
+
+// Base structure for callback user data
+struct SVGTextQuery::Data {
+ Data()
+ : processedChunkCharacters(0)
+ {
+ }
+
+ unsigned processedChunkCharacters;
+};
+
+static inline InlineFlowBox* flowBoxForRenderer(RenderObject* renderer)
+{
+ if (!renderer)
+ return 0;
+
+ if (renderer->isRenderBlock()) {
+ // If we're given a block element, it has to be a RenderSVGText.
+ ASSERT(renderer->isSVGText());
+ RenderBlock* renderBlock = toRenderBlock(renderer);
+
+ // RenderSVGText only ever contains a single line box.
+ InlineFlowBox* flowBox = renderBlock->firstLineBox();
+ ASSERT(flowBox == renderBlock->lastLineBox());
+ return flowBox;
+ }
+
+ if (renderer->isRenderInline()) {
+ // We're given a RenderSVGInline or objects that derive from it (RenderSVGTSpan / RenderSVGTextPath)
+ RenderInline* renderInline = toRenderInline(renderer);
+
+ // RenderSVGInline only ever contains a single line box.
+ InlineFlowBox* flowBox = renderInline->firstLineBox();
+ ASSERT(flowBox == renderInline->lastLineBox());
+ return flowBox;
+ }
+
+ ASSERT_NOT_REACHED();
+ return 0;
+}
+
+static inline float mapLengthThroughChunkTransformation(const SVGInlineTextBox* textBox, bool isVerticalText, float length)
+{
+ const AffineTransform& transform = textBox->chunkTransformation();
+ if (transform.isIdentity())
+ return length;
+
+ return narrowPrecisionToFloat(static_cast<double>(length) * (isVerticalText ? transform.d() : transform.a()));
+}
+
+SVGTextQuery::SVGTextQuery(RenderObject* renderer)
+{
+ collectTextBoxesInFlowBox(flowBoxForRenderer(renderer));
+}
+
+void SVGTextQuery::collectTextBoxesInFlowBox(InlineFlowBox* flowBox)
+{
+ if (!flowBox)
+ return;
+
+ for (InlineBox* child = flowBox->firstChild(); child; child = child->nextOnLine()) {
+ if (child->isInlineFlowBox()) {
+ // Skip generated content.
+ if (!child->renderer()->node())
+ continue;
+
+ collectTextBoxesInFlowBox(static_cast<InlineFlowBox*>(child));
+ continue;
+ }
+
+ ASSERT(child->isSVGInlineTextBox());
+ m_textBoxes.append(static_cast<SVGInlineTextBox*>(child));
+ }
+}
+
+bool SVGTextQuery::executeQuery(Data* queryData, ProcessTextChunkPartCallback chunkPartCallback) const
+{
+ ASSERT(!m_textBoxes.isEmpty());
+ bool finished = false;
+
+ // Loop over all text boxes
+ const Vector<SVGInlineTextBox*>::const_iterator end = m_textBoxes.end();
+ for (Vector<SVGInlineTextBox*>::const_iterator it = m_textBoxes.begin(); it != end; ++it) {
+ const SVGInlineTextBox* textBox = *it;
+ const Vector<SVGTextChunkPart>& parts = textBox->svgTextChunkParts();
+
+ int processedCharacters = 0;
+
+ // Loop over all text chunk parts in this text box, firing a callback for each chunk part.
+ const Vector<SVGTextChunkPart>::const_iterator partEnd = parts.end();
+ for (Vector<SVGTextChunkPart>::const_iterator partIt = parts.begin(); partIt != partEnd; ++partIt) {
+ if ((this->*chunkPartCallback)(queryData, textBox, *partIt)) {
+ finished = true;
+ break;
+ }
+
+ processedCharacters += partIt->length;
+ }
+
+ if (finished)
+ break;
+
+ queryData->processedChunkCharacters += processedCharacters;
+ }
+
+ return finished;
+}
+
+bool SVGTextQuery::mapStartAndLengthIntoChunkPartCoordinates(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part, int& startPosition, int& endPosition) const
+{
+ // Reuse the same logic used for text selection & painting, to map our query start/length into start/endPositions of the current text chunk part.
+ startPosition -= queryData->processedChunkCharacters;
+ endPosition -= queryData->processedChunkCharacters;
+ textBox->mapStartEndPositionsIntoChunkPartCoordinates(startPosition, endPosition, part);
+
+ // If startPosition < endPosition, then the position we're supposed to measure lies in this chunk part.
+ return startPosition < endPosition;
+}
+
+float SVGTextQuery::measureCharacterRange(const SVGInlineTextBox* textBox, RenderStyle* style, bool isVerticalText, int startPosition, int length) const
+{
+ // FIXME: Vertical writing mode needs to be handled more accurate.
+ if (isVerticalText)
+ return length * style->font().height();
+
+ const UChar* startCharacter = textBox->textRenderer()->characters() + textBox->start() + startPosition;
+ return style->font().floatWidth(svgTextRunForInlineTextBox(startCharacter, length, style, textBox));
+}
+
+// numberOfCharacters() implementation
+struct NumberOfCharactersData : SVGTextQuery::Data {
+ NumberOfCharactersData()
+ : characters(0)
+ {
+ }
+
+ unsigned characters;
+};
+
+bool SVGTextQuery::numberOfCharactersCallback(Data* queryData, const SVGInlineTextBox*, const SVGTextChunkPart& part) const
+{
+ NumberOfCharactersData* data = static_cast<NumberOfCharactersData*>(queryData);
+ data->characters += part.length;
+ return false;
+}
+
+unsigned SVGTextQuery::numberOfCharacters() const
+{
+ if (m_textBoxes.isEmpty())
+ return 0;
+
+ NumberOfCharactersData data;
+ executeQuery(&data, &SVGTextQuery::numberOfCharactersCallback);
+ return data.characters;
+}
+
+// textLength() implementation
+struct TextLengthData : SVGTextQuery::Data {
+ TextLengthData()
+ : textLength(0.0f)
+ {
+ }
+
+ float textLength;
+};
+
+bool SVGTextQuery::textLengthCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ TextLengthData* data = static_cast<TextLengthData*>(queryData);
+
+ RenderStyle* style = textBox->textRenderer()->style();
+ ASSERT(style);
+
+ bool isVerticalText = isVerticalWritingMode(style->svgStyle());
+ float partLength = isVerticalText ? part.height : part.width;
+
+ data->textLength += mapLengthThroughChunkTransformation(textBox, isVerticalText, partLength);
+ return false;
+}
+
+float SVGTextQuery::textLength() const
+{
+ if (m_textBoxes.isEmpty())
+ return 0.0f;
+
+ TextLengthData data;
+ executeQuery(&data, &SVGTextQuery::textLengthCallback);
+ return data.textLength;
+}
+
+// subStringLength() implementation
+struct SubStringLengthData : SVGTextQuery::Data {
+ SubStringLengthData(unsigned queryStartPosition, unsigned queryLength)
+ : startPosition(queryStartPosition)
+ , length(queryLength)
+ , subStringLength(0.0f)
+ {
+ }
+
+ unsigned startPosition;
+ unsigned length;
+
+ float subStringLength;
+};
+
+bool SVGTextQuery::subStringLengthCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ SubStringLengthData* data = static_cast<SubStringLengthData*>(queryData);
+
+ int startPosition = data->startPosition;
+ int endPosition = startPosition + data->length;
+ if (!mapStartAndLengthIntoChunkPartCoordinates(queryData, textBox, part, startPosition, endPosition))
+ return false;
+
+ RenderStyle* style = textBox->textRenderer()->style();
+ ASSERT(style);
+
+ bool isVerticalText = isVerticalWritingMode(style->svgStyle());
+ float partLength = measureCharacterRange(textBox, style, isVerticalWritingMode(style->svgStyle()), part.offset + startPosition, endPosition - startPosition);
+
+ data->subStringLength += mapLengthThroughChunkTransformation(textBox, isVerticalText, partLength);
+ return false;
+}
+
+float SVGTextQuery::subStringLength(unsigned startPosition, unsigned length) const
+{
+ if (m_textBoxes.isEmpty())
+ return 0.0f;
+
+ SubStringLengthData data(startPosition, length);
+ executeQuery(&data, &SVGTextQuery::subStringLengthCallback);
+ return data.subStringLength;
+}
+
+// startPositionOfCharacter() implementation
+struct StartPositionOfCharacterData : SVGTextQuery::Data {
+ StartPositionOfCharacterData(unsigned queryPosition)
+ : position(queryPosition)
+ {
+ }
+
+ unsigned position;
+ FloatPoint startPosition;
+};
+
+bool SVGTextQuery::startPositionOfCharacterCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ StartPositionOfCharacterData* data = static_cast<StartPositionOfCharacterData*>(queryData);
+
+ int startPosition = data->position;
+ int endPosition = startPosition + 1;
+ if (!mapStartAndLengthIntoChunkPartCoordinates(queryData, textBox, part, startPosition, endPosition))
+ return false;
+
+ const SVGChar& character = *(part.firstCharacter + startPosition);
+ data->startPosition = textBox->chunkTransformation().mapPoint(FloatPoint(character.x, character.y));
+ return true;
+}
+
+FloatPoint SVGTextQuery::startPositionOfCharacter(unsigned position) const
+{
+ if (m_textBoxes.isEmpty())
+ return FloatPoint();
+
+ StartPositionOfCharacterData data(position);
+ executeQuery(&data, &SVGTextQuery::startPositionOfCharacterCallback);
+ return data.startPosition;
+}
+
+// endPositionOfCharacter() implementation
+struct EndPositionOfCharacterData : SVGTextQuery::Data {
+ EndPositionOfCharacterData(unsigned queryPosition)
+ : position(queryPosition)
+ {
+ }
+
+ unsigned position;
+ FloatPoint endPosition;
+};
+
+bool SVGTextQuery::endPositionOfCharacterCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ EndPositionOfCharacterData* data = static_cast<EndPositionOfCharacterData*>(queryData);
+
+ int startPosition = data->position;
+ int endPosition = startPosition + 1;
+ if (!mapStartAndLengthIntoChunkPartCoordinates(queryData, textBox, part, startPosition, endPosition))
+ return false;
+
+ const SVGChar& character = *(part.firstCharacter + startPosition);
+ data->endPosition = FloatPoint(character.x, character.y);
+
+ RenderStyle* style = textBox->textRenderer()->style();
+ ASSERT(style);
+
+ bool isVerticalText = isVerticalWritingMode(style->svgStyle());
+ float glyphAdvance = measureCharacterRange(textBox, style, isVerticalText, part.offset + startPosition, 1);
+
+ if (isVerticalText)
+ data->endPosition.move(0.0f, glyphAdvance);
+ else
+ data->endPosition.move(glyphAdvance, 0.0f);
+
+ data->endPosition = textBox->chunkTransformation().mapPoint(data->endPosition);
+ return true;
+}
+
+FloatPoint SVGTextQuery::endPositionOfCharacter(unsigned position) const
+{
+ if (m_textBoxes.isEmpty())
+ return FloatPoint();
+
+ EndPositionOfCharacterData data(position);
+ executeQuery(&data, &SVGTextQuery::endPositionOfCharacterCallback);
+ return data.endPosition;
+}
+
+// rotationOfCharacter() implementation
+struct RotationOfCharacterData : SVGTextQuery::Data {
+ RotationOfCharacterData(unsigned queryPosition)
+ : position(queryPosition)
+ , rotation(0.0f)
+ {
+ }
+
+ unsigned position;
+ float rotation;
+};
+
+bool SVGTextQuery::rotationOfCharacterCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ RotationOfCharacterData* data = static_cast<RotationOfCharacterData*>(queryData);
+
+ int startPosition = data->position;
+ int endPosition = startPosition + 1;
+ if (!mapStartAndLengthIntoChunkPartCoordinates(queryData, textBox, part, startPosition, endPosition))
+ return false;
+
+ const SVGChar& character = *(part.firstCharacter + startPosition);
+ data->rotation = character.angle;
+ return true;
+}
+
+float SVGTextQuery::rotationOfCharacter(unsigned position) const
+{
+ if (m_textBoxes.isEmpty())
+ return 0.0f;
+
+ RotationOfCharacterData data(position);
+ executeQuery(&data, &SVGTextQuery::rotationOfCharacterCallback);
+ return data.rotation;
+}
+
+// extentOfCharacter() implementation
+struct ExtentOfCharacterData : SVGTextQuery::Data {
+ ExtentOfCharacterData(unsigned queryPosition)
+ : position(queryPosition)
+ {
+ }
+
+ unsigned position;
+ FloatRect extent;
+};
+
+bool SVGTextQuery::extentOfCharacterCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ ExtentOfCharacterData* data = static_cast<ExtentOfCharacterData*>(queryData);
+
+ int startPosition = data->position;
+ int endPosition = startPosition + 1;
+ if (!mapStartAndLengthIntoChunkPartCoordinates(queryData, textBox, part, startPosition, endPosition))
+ return false;
+
+ RenderStyle* style = textBox->textRenderer()->style();
+ ASSERT(style);
+
+ const SVGChar& character = *(part.firstCharacter + startPosition);
+ data->extent = textBox->calculateGlyphBoundaries(style, part.offset + startPosition, character);
+ return true;
+}
+
+FloatRect SVGTextQuery::extentOfCharacter(unsigned position) const
+{
+ if (m_textBoxes.isEmpty())
+ return FloatRect();
+
+ ExtentOfCharacterData data(position);
+ executeQuery(&data, &SVGTextQuery::extentOfCharacterCallback);
+ return data.extent;
+}
+
+// characterNumberAtPosition() implementation
+struct CharacterNumberAtPositionData : SVGTextQuery::Data {
+ CharacterNumberAtPositionData(const FloatPoint& queryPosition)
+ : characterNumber(0)
+ , position(queryPosition)
+ {
+ }
+
+ unsigned characterNumber;
+ FloatPoint position;
+};
+
+bool SVGTextQuery::characterNumberAtPositionCallback(Data* queryData, const SVGInlineTextBox* textBox, const SVGTextChunkPart& part) const
+{
+ CharacterNumberAtPositionData* data = static_cast<CharacterNumberAtPositionData*>(queryData);
+
+ RenderStyle* style = textBox->textRenderer()->style();
+ ASSERT(style);
+
+ for (int i = 0; i < part.length; ++i) {
+ FloatRect extent(textBox->calculateGlyphBoundaries(style, part.offset + i, *(part.firstCharacter + i)));
+ if (extent.contains(data->position))
+ return true;
+
+ ++data->characterNumber;
+ }
+
+ return false;
+}
+
+int SVGTextQuery::characterNumberAtPosition(const FloatPoint& position) const
+{
+ if (m_textBoxes.isEmpty())
+ return -1;
+
+ CharacterNumberAtPositionData data(position);
+ if (!executeQuery(&data, &SVGTextQuery::characterNumberAtPositionCallback))
+ return -1;
+
+ return data.characterNumber;
+}
+
+}
+
+#endif
diff --git a/WebCore/rendering/SVGTextQuery.h b/WebCore/rendering/SVGTextQuery.h
new file mode 100644
index 0000000..f19c72e
--- /dev/null
+++ b/WebCore/rendering/SVGTextQuery.h
@@ -0,0 +1,76 @@
+/*
+ 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 SVGTextQuery_h
+#define SVGTextQuery_h
+
+#if ENABLE(SVG)
+#include "FloatRect.h"
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class InlineFlowBox;
+class RenderObject;
+class RenderStyle;
+class SVGInlineTextBox;
+struct SVGTextChunkPart;
+
+class SVGTextQuery {
+public:
+ SVGTextQuery(RenderObject*);
+
+ unsigned numberOfCharacters() const;
+ float textLength() const;
+ float subStringLength(unsigned startPosition, unsigned length) const;
+ FloatPoint startPositionOfCharacter(unsigned position) const;
+ FloatPoint endPositionOfCharacter(unsigned position) const;
+ float rotationOfCharacter(unsigned position) const;
+ FloatRect extentOfCharacter(unsigned position) const;
+ int characterNumberAtPosition(const FloatPoint&) const;
+
+ // Public helper struct. Private classes in SVGTextQuery inherit from it.
+ struct Data;
+
+private:
+ typedef bool (SVGTextQuery::*ProcessTextChunkPartCallback)(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool executeQuery(Data*, ProcessTextChunkPartCallback) const;
+
+ void collectTextBoxesInFlowBox(InlineFlowBox*);
+ float measureCharacterRange(const SVGInlineTextBox*, RenderStyle*, bool isVerticalText, int startPosition, int length) const;
+ bool mapStartAndLengthIntoChunkPartCoordinates(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&, int& startPosition, int& endPosition) const;
+
+private:
+ bool numberOfCharactersCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool textLengthCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool subStringLengthCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool startPositionOfCharacterCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool endPositionOfCharacterCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool rotationOfCharacterCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool extentOfCharacterCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+ bool characterNumberAtPositionCallback(Data*, const SVGInlineTextBox*, const SVGTextChunkPart&) const;
+
+private:
+ Vector<SVGInlineTextBox*> m_textBoxes;
+};
+
+}
+
+#endif
+#endif
diff --git a/WebCore/rendering/ShadowElement.cpp b/WebCore/rendering/ShadowElement.cpp
index dea9233..62b37e1 100644
--- a/WebCore/rendering/ShadowElement.cpp
+++ b/WebCore/rendering/ShadowElement.cpp
@@ -22,17 +22,85 @@
#include "ShadowElement.h"
#include "HTMLNames.h"
+#include "RenderTheme.h"
+#include "RenderView.h"
namespace WebCore {
+using namespace HTMLNames;
+
PassRefPtr<ShadowBlockElement> ShadowBlockElement::create(Node* shadowParent)
{
return new ShadowBlockElement(shadowParent);
}
ShadowBlockElement::ShadowBlockElement(Node* shadowParent)
- : ShadowElement<HTMLDivElement>(HTMLNames::divTag, shadowParent)
+ : ShadowElement<HTMLDivElement>(divTag, shadowParent)
+{
+}
+
+void ShadowBlockElement::layoutAsPart(const IntRect& partRect)
+{
+ RenderBox* parentRenderer = toRenderBox(renderer()->parent());
+ RenderBox* selfRenderer = toRenderBox(renderer());
+ IntRect oldRect = selfRenderer->frameRect();
+
+ LayoutStateMaintainer statePusher(parentRenderer->view(), parentRenderer, parentRenderer->size());
+
+ if (oldRect.size() != partRect.size())
+ selfRenderer->setChildNeedsLayout(true, false);
+
+ selfRenderer->layoutIfNeeded();
+ selfRenderer->setFrameRect(partRect);
+
+ if (selfRenderer->checkForRepaintDuringLayout())
+ selfRenderer->repaintDuringLayoutIfMoved(oldRect);
+
+ statePusher.pop();
+ parentRenderer->addOverflowFromChild(selfRenderer);
+}
+
+void ShadowBlockElement::updateStyleForPart(PseudoId pseudoId)
+{
+ if (renderer()->style()->styleType() != pseudoId)
+ renderer()->setStyle(createStyleForPart(renderer()->parent(), pseudoId));
+}
+
+PassRefPtr<ShadowBlockElement> ShadowBlockElement::createForPart(Node* shadowParent, PseudoId pseudoId)
+{
+ RenderObject* parentRenderer = shadowParent->renderer();
+ RefPtr<RenderStyle> styleForPart = createStyleForPart(parentRenderer, pseudoId);
+ RefPtr<ShadowBlockElement> part = create(shadowParent);
+ part->setRenderer(part->createRenderer(parentRenderer->renderArena(), styleForPart.get()));
+ part->renderer()->setStyle(styleForPart.release());
+ part->setAttached();
+ part->setInDocument();
+ return part.release();
+}
+
+PassRefPtr<RenderStyle> ShadowBlockElement::createStyleForPart(RenderObject* parentRenderer, PseudoId pseudoId)
+{
+ RefPtr<RenderStyle> styleForPart;
+ RenderStyle* pseudoStyle = parentRenderer->getCachedPseudoStyle(pseudoId);
+ if (pseudoStyle)
+ styleForPart = RenderStyle::clone(pseudoStyle);
+ else
+ styleForPart = RenderStyle::create();
+
+ styleForPart->inheritFrom(parentRenderer->style());
+ styleForPart->setDisplay(BLOCK);
+ styleForPart->setAppearance(NoControlPart);
+ return styleForPart.release();
+}
+
+bool ShadowBlockElement::partShouldHaveStyle(const RenderObject* parentRenderer, PseudoId pseudoId)
{
+ // We have some -webkit-appearance values for default styles of parts and
+ // that appearance get turned off during RenderStyle creation
+ // if they have background styles specified.
+ // So !hasAppearance() implies that there are something to be styled.
+ RenderStyle* pseudoStyle = parentRenderer->getCachedPseudoStyle(pseudoId);
+ return !(pseudoStyle && pseudoStyle->hasAppearance());
}
PassRefPtr<ShadowInputElement> ShadowInputElement::create(Node* shadowParent)
@@ -41,7 +109,7 @@ PassRefPtr<ShadowInputElement> ShadowInputElement::create(Node* shadowParent)
}
ShadowInputElement::ShadowInputElement(Node* shadowParent)
- : ShadowElement<HTMLInputElement>(HTMLNames::inputTag, shadowParent)
+ : ShadowElement<HTMLInputElement>(inputTag, shadowParent)
{
}
diff --git a/WebCore/rendering/ShadowElement.h b/WebCore/rendering/ShadowElement.h
index 90030ee..b8aacfd 100644
--- a/WebCore/rendering/ShadowElement.h
+++ b/WebCore/rendering/ShadowElement.h
@@ -40,20 +40,31 @@ protected:
ShadowElement(const QualifiedName& name, Node* shadowParent)
: BaseElement(name, shadowParent->document())
, m_shadowParent(shadowParent)
- {}
+ {
+ }
+ Node* shadowParent() const { return m_shadowParent; }
+
+private:
virtual bool isShadowNode() const { return true; }
virtual Node* shadowParentNode() { return m_shadowParent; }
-private:
Node* m_shadowParent;
};
class ShadowBlockElement : public ShadowElement<HTMLDivElement> {
public:
static PassRefPtr<ShadowBlockElement> create(Node*);
+ static PassRefPtr<ShadowBlockElement> createForPart(Node*, PseudoId);
+ static bool partShouldHaveStyle(const RenderObject* parentRenderer, PseudoId pseudoId);
+ void layoutAsPart(const IntRect& partRect);
+ void updateStyleForPart(PseudoId);
+
protected:
ShadowBlockElement(Node*);
+
+private:
+ static PassRefPtr<RenderStyle> createStyleForPart(RenderObject*, PseudoId);
};
class ShadowInputElement : public ShadowElement<HTMLInputElement> {
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index ed12611..61c85e7 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -89,7 +90,7 @@ TextControlInnerElement::TextControlInnerElement(Document* document, Node* shado
PassRefPtr<TextControlInnerElement> TextControlInnerElement::create(Node* shadowParent)
{
- return new TextControlInnerElement(shadowParent->document(), shadowParent);
+ return adoptRef(new TextControlInnerElement(shadowParent->document(), shadowParent));
}
void TextControlInnerElement::attachInnerElement(Node* parent, PassRefPtr<RenderStyle> style, RenderArena* arena)
@@ -126,7 +127,7 @@ inline TextControlInnerTextElement::TextControlInnerTextElement(Document* docume
PassRefPtr<TextControlInnerTextElement> TextControlInnerTextElement::create(Document* document, Node* shadowParent)
{
- return new TextControlInnerTextElement(document, shadowParent);
+ return adoptRef(new TextControlInnerTextElement(document, shadowParent));
}
void TextControlInnerTextElement::defaultEventHandler(Event* event)
@@ -162,7 +163,7 @@ inline SearchFieldResultsButtonElement::SearchFieldResultsButtonElement(Document
PassRefPtr<SearchFieldResultsButtonElement> SearchFieldResultsButtonElement::create(Document* document)
{
- return new SearchFieldResultsButtonElement(document);
+ return adoptRef(new SearchFieldResultsButtonElement(document));
}
void SearchFieldResultsButtonElement::defaultEventHandler(Event* event)
@@ -194,7 +195,7 @@ inline SearchFieldCancelButtonElement::SearchFieldCancelButtonElement(Document*
PassRefPtr<SearchFieldCancelButtonElement> SearchFieldCancelButtonElement::create(Document* document)
{
- return new SearchFieldCancelButtonElement(document);
+ return adoptRef(new SearchFieldCancelButtonElement(document));
}
void SearchFieldCancelButtonElement::detach()
@@ -251,7 +252,7 @@ inline SpinButtonElement::SpinButtonElement(Node* shadowParent)
PassRefPtr<SpinButtonElement> SpinButtonElement::create(Node* shadowParent)
{
- return new SpinButtonElement(shadowParent);
+ return adoptRef(new SpinButtonElement(shadowParent));
}
void SpinButtonElement::defaultEventHandler(Event* event)
@@ -269,20 +270,27 @@ void SpinButtonElement::defaultEventHandler(Event* event)
return;
}
+ RenderBox* box = renderBox();
+ if (!box) {
+ if (!event->defaultHandled())
+ HTMLDivElement::defaultEventHandler(event);
+ return;
+ }
+
HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
- IntPoint local = roundedIntPoint(renderBox()->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
+ IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
if (event->type() == eventNames().clickEvent) {
- if (renderBox()->borderBoxRect().contains(local)) {
+ if (box->borderBoxRect().contains(local)) {
input->focus();
input->select();
- if (local.y() < renderBox()->y() + renderBox()->height() / 2)
+ if (local.y() < box->y() + box->height() / 2)
input->stepUpFromRenderer(1);
else
input->stepUpFromRenderer(-1);
event->setDefaultHandled();
}
} else if (event->type() == eventNames().mousemoveEvent) {
- if (renderBox()->borderBoxRect().contains(local)) {
+ if (box->borderBoxRect().contains(local)) {
if (!m_capturing) {
if (Frame* frame = document()->frame()) {
frame->eventHandler()->setCapturingMouseEventsNode(input);
@@ -290,7 +298,7 @@ void SpinButtonElement::defaultEventHandler(Event* event)
}
}
bool oldOnUpButton = m_onUpButton;
- m_onUpButton = local.y() < renderBox()->y() + renderBox()->height() / 2;
+ m_onUpButton = local.y() < box->y() + box->height() / 2;
if (m_onUpButton != oldOnUpButton)
renderer()->repaint();
} else {
@@ -307,4 +315,26 @@ void SpinButtonElement::defaultEventHandler(Event* event)
HTMLDivElement::defaultEventHandler(event);
}
+// ----------------------------
+
+#if ENABLE(INPUT_SPEECH)
+
+inline InputFieldSpeechButtonElement::InputFieldSpeechButtonElement(Document* document)
+ : TextControlInnerElement(document)
+{
+}
+
+PassRefPtr<InputFieldSpeechButtonElement> InputFieldSpeechButtonElement::create(Document* document)
+{
+ return adoptRef(new InputFieldSpeechButtonElement(document));
+}
+
+void InputFieldSpeechButtonElement::defaultEventHandler(Event* event)
+{
+ // FIXME: Start speech recognition here.
+ HTMLDivElement::defaultEventHandler(event);
+}
+
+#endif // ENABLE(INPUT_SPEECH)
+
}
diff --git a/WebCore/rendering/TextControlInnerElements.h b/WebCore/rendering/TextControlInnerElements.h
index ed1887e..1884a34 100644
--- a/WebCore/rendering/TextControlInnerElements.h
+++ b/WebCore/rendering/TextControlInnerElements.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006, 2008, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -104,6 +105,20 @@ private:
bool m_onUpButton;
};
+#if ENABLE(INPUT_SPEECH)
+
+class InputFieldSpeechButtonElement : public TextControlInnerElement {
+public:
+ static PassRefPtr<InputFieldSpeechButtonElement> create(Document*);
+
+ virtual void defaultEventHandler(Event*);
+
+private:
+ InputFieldSpeechButtonElement(Document*);
+};
+
+#endif // ENABLE(INPUT_SPEECH)
+
} // namespace
#endif
diff --git a/WebCore/rendering/style/RenderStyle.cpp b/WebCore/rendering/style/RenderStyle.cpp
index af4e055..40f7a27 100644
--- a/WebCore/rendering/style/RenderStyle.cpp
+++ b/WebCore/rendering/style/RenderStyle.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -386,7 +386,9 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
rareInheritedData->wordWrap != other->rareInheritedData->wordWrap ||
rareInheritedData->nbspMode != other->rareInheritedData->nbspMode ||
rareInheritedData->khtmlLineBreak != other->rareInheritedData->khtmlLineBreak ||
- rareInheritedData->textSecurity != other->rareInheritedData->textSecurity)
+ rareInheritedData->textSecurity != other->rareInheritedData->textSecurity ||
+ rareInheritedData->hyphens != other->rareInheritedData->hyphens ||
+ rareInheritedData->hyphenateCharacter != other->rareInheritedData->hyphenateCharacter)
return StyleDifferenceLayout;
if (!rareInheritedData->shadowDataEquivalent(*other->rareInheritedData.get()))
@@ -802,6 +804,19 @@ CounterDirectiveMap& RenderStyle::accessCounterDirectives()
return *map.get();
}
+const AtomicString& RenderStyle::hyphenString() const
+{
+ ASSERT(hyphens() == HyphensAuto);
+
+ const AtomicString& hyphenateCharacter = rareInheritedData.get()->hyphenateCharacter;
+ if (!hyphenateCharacter.isNull())
+ return hyphenateCharacter;
+
+ // FIXME: This should depend on locale.
+ DEFINE_STATIC_LOCAL(AtomicString, hyphenMinusString, (&hyphen, 1));
+ return hyphenMinusString;
+}
+
#if ENABLE(DASHBOARD_SUPPORT)
const Vector<StyleDashboardRegion>& RenderStyle::initialDashboardRegions()
{
diff --git a/WebCore/rendering/style/RenderStyle.h b/WebCore/rendering/style/RenderStyle.h
index 16dcae8..2914fcf 100644
--- a/WebCore/rendering/style/RenderStyle.h
+++ b/WebCore/rendering/style/RenderStyle.h
@@ -2,7 +2,7 @@
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* (C) 2000 Antti Koivisto (koivisto@kde.org)
* (C) 2000 Dirk Mueller (mueller@kde.org)
- * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2003, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
* Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
*
* This library is free software; you can redistribute it and/or
@@ -647,6 +647,8 @@ public:
EKHTMLLineBreak khtmlLineBreak() const { return static_cast<EKHTMLLineBreak>(rareInheritedData->khtmlLineBreak); }
EMatchNearestMailBlockquoteColor matchNearestMailBlockquoteColor() const { return static_cast<EMatchNearestMailBlockquoteColor>(rareNonInheritedData->matchNearestMailBlockquoteColor); }
const AtomicString& highlight() const { return rareInheritedData->highlight; }
+ Hyphens hyphens() const { return static_cast<Hyphens>(rareInheritedData->hyphens); }
+ const AtomicString& hyphenateCharacter() const { return rareInheritedData->hyphenateCharacter; }
EBorderFit borderFit() const { return static_cast<EBorderFit>(rareNonInheritedData->m_borderFit); }
EResize resize() const { return static_cast<EResize>(rareInheritedData->resize); }
float columnWidth() const { return rareNonInheritedData->m_multiCol->m_width; }
@@ -701,6 +703,7 @@ public:
bool hasPerspective() const { return rareNonInheritedData->m_perspective > 0; }
Length perspectiveOriginX() const { return rareNonInheritedData->m_perspectiveOriginX; }
Length perspectiveOriginY() const { return rareNonInheritedData->m_perspectiveOriginY; }
+ LengthSize pageSize() const { return rareNonInheritedData->m_pageSize; }
#if USE(ACCELERATED_COMPOSITING)
// When set, this ensures that styles compare as different. Used during accelerated animations.
@@ -826,6 +829,7 @@ public:
void setClipTop(Length v) { SET_VAR(visual, clip.m_top, v) }
void setClipBottom(Length v) { SET_VAR(visual, clip.m_bottom, v) }
void setClip(Length top, Length right, Length bottom, Length left);
+ void setClip(LengthBox box) { SET_VAR(visual, clip, box) }
void setUnicodeBidi(EUnicodeBidi b) { noninherited_flags._unicodeBidi = b; }
@@ -982,6 +986,8 @@ public:
void setKHTMLLineBreak(EKHTMLLineBreak b) { SET_VAR(rareInheritedData, khtmlLineBreak, b); }
void setMatchNearestMailBlockquoteColor(EMatchNearestMailBlockquoteColor c) { SET_VAR(rareNonInheritedData, matchNearestMailBlockquoteColor, c); }
void setHighlight(const AtomicString& h) { SET_VAR(rareInheritedData, highlight, h); }
+ void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
+ void setHyphenateCharacter(const AtomicString& h) { SET_VAR(rareInheritedData, hyphenateCharacter, h); }
void setBorderFit(EBorderFit b) { SET_VAR(rareNonInheritedData, m_borderFit, b); }
void setResize(EResize r) { SET_VAR(rareInheritedData, resize, r); }
void setColumnWidth(float f) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_autoWidth, false); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_width, f); }
@@ -1028,6 +1034,7 @@ public:
void setPerspective(float p) { SET_VAR(rareNonInheritedData, m_perspective, p); }
void setPerspectiveOriginX(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginX, l); }
void setPerspectiveOriginY(Length l) { SET_VAR(rareNonInheritedData, m_perspectiveOriginY, l); }
+ void setPageSize(LengthSize s) { SET_VAR(rareNonInheritedData, m_pageSize, s); }
#if USE(ACCELERATED_COMPOSITING)
void setIsRunningAcceleratedAnimation(bool b = true) { SET_VAR(rareNonInheritedData, m_runningAcceleratedAnimation, b); }
@@ -1065,6 +1072,8 @@ public:
const CounterDirectiveMap* counterDirectives() const;
CounterDirectiveMap& accessCounterDirectives();
+ const AtomicString& hyphenString() const;
+
bool inheritedNotEqual(const RenderStyle*) const;
StyleDifference diff(const RenderStyle*, unsigned& changedContextSensitiveProperties) const;
@@ -1188,6 +1197,8 @@ public:
static EKHTMLLineBreak initialKHTMLLineBreak() { return LBNORMAL; }
static EMatchNearestMailBlockquoteColor initialMatchNearestMailBlockquoteColor() { return BCNORMAL; }
static const AtomicString& initialHighlight() { return nullAtom; }
+ static Hyphens initialHyphens() { return HyphensManual; }
+ static const AtomicString& initialHyphenateCharacter() { return nullAtom; }
static EBorderFit initialBorderFit() { return BorderFitBorder; }
static EResize initialResize() { return RESIZE_NONE; }
static ControlPart initialAppearance() { return NoControlPart; }
diff --git a/WebCore/rendering/style/RenderStyleConstants.h b/WebCore/rendering/style/RenderStyleConstants.h
index b6dce18..dd82433 100644
--- a/WebCore/rendering/style/RenderStyleConstants.h
+++ b/WebCore/rendering/style/RenderStyleConstants.h
@@ -74,8 +74,9 @@ enum PseudoId {
MEDIA_CONTROLS_SEEK_BACK_BUTTON, MEDIA_CONTROLS_SEEK_FORWARD_BUTTON, MEDIA_CONTROLS_FULLSCREEN_BUTTON, MEDIA_CONTROLS_REWIND_BUTTON,
MEDIA_CONTROLS_RETURN_TO_REALTIME_BUTTON, MEDIA_CONTROLS_TOGGLE_CLOSED_CAPTIONS_BUTTON,
MEDIA_CONTROLS_STATUS_DISPLAY, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER, RESIZER,
- INPUT_LIST_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK, PROGRESS_BAR_VALUE,
-
+ INPUT_LIST_BUTTON, INPUT_SPEECH_BUTTON, INNER_SPIN_BUTTON, OUTER_SPIN_BUTTON, VISITED_LINK, PROGRESS_BAR_VALUE,
+ METER_HORIZONTAL_BAR, METER_HORIZONTAL_OPTIMUM, METER_HORIZONTAL_SUBOPTIMAL, METER_HORIZONTAL_EVEN_LESS_GOOD,
+ METER_VERTICAL_BAR, METER_VERTICAL_OPTIMUM, METER_VERTICAL_SUBOPTIMAL, METER_VERTICAL_EVEN_LESS_GOOD,
AFTER_LAST_INTERNAL_PSEUDOID,
FIRST_PUBLIC_PSEUDOID = FIRST_LINE,
FIRST_INTERNAL_PSEUDOID = FILE_UPLOAD_BUTTON,
@@ -405,6 +406,8 @@ enum EBackfaceVisibility {
enum ELineClampType { LineClampLineCount, LineClampPercentage };
+enum Hyphens { HyphensNone, HyphensManual, HyphensAuto };
+
} // namespace WebCore
#endif // RenderStyleConstants_h
diff --git a/WebCore/rendering/style/StyleRareInheritedData.cpp b/WebCore/rendering/style/StyleRareInheritedData.cpp
index 04923d5..cb6edf3 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.cpp
+++ b/WebCore/rendering/style/StyleRareInheritedData.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1999 Antti Koivisto (koivisto@kde.org)
- * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -47,6 +47,7 @@ StyleRareInheritedData::StyleRareInheritedData()
, resize(RenderStyle::initialResize())
, userSelect(RenderStyle::initialUserSelect())
, colorSpace(DeviceColorSpace)
+ , hyphens(HyphensManual)
{
}
@@ -75,6 +76,8 @@ StyleRareInheritedData::StyleRareInheritedData(const StyleRareInheritedData& o)
, resize(o.resize)
, userSelect(o.userSelect)
, colorSpace(o.colorSpace)
+ , hyphens(o.hyphens)
+ , hyphenateCharacter(o.hyphenateCharacter)
{
}
@@ -116,7 +119,9 @@ bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
#endif
&& resize == o.resize
&& userSelect == o.userSelect
- && colorSpace == o.colorSpace;
+ && colorSpace == o.colorSpace
+ && hyphens == o.hyphens
+ && hyphenateCharacter == o.hyphenateCharacter;
}
bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const
diff --git a/WebCore/rendering/style/StyleRareInheritedData.h b/WebCore/rendering/style/StyleRareInheritedData.h
index 3ad8b0b..f6e3bf4 100644
--- a/WebCore/rendering/style/StyleRareInheritedData.h
+++ b/WebCore/rendering/style/StyleRareInheritedData.h
@@ -80,7 +80,10 @@ public:
unsigned resize : 2; // EResize
unsigned userSelect : 1; // EUserSelect
unsigned colorSpace : 1; // ColorSpace
-
+ unsigned hyphens : 2; // Hyphens
+
+ AtomicString hyphenateCharacter;
+
private:
StyleRareInheritedData();
StyleRareInheritedData(const StyleRareInheritedData&);
diff --git a/WebCore/rendering/style/StyleRareNonInheritedData.h b/WebCore/rendering/style/StyleRareNonInheritedData.h
index d6fe96e..74e736c 100644
--- a/WebCore/rendering/style/StyleRareNonInheritedData.h
+++ b/WebCore/rendering/style/StyleRareNonInheritedData.h
@@ -40,6 +40,7 @@ namespace WebCore {
class AnimationList;
class CSSStyleSelector;
+class LengthSize;
class ShadowData;
class StyleFlexibleBoxData;
class StyleMarqueeData;
@@ -50,7 +51,7 @@ class StyleTransformData;
struct ContentData;
#if ENABLE(DASHBOARD_SUPPORT)
-class StyleDashboardRegion;
+struct StyleDashboardRegion;
#endif
#if ENABLE(XBL)
@@ -123,6 +124,8 @@ public:
Length m_perspectiveOriginX;
Length m_perspectiveOriginY;
+ LengthSize m_pageSize;
+
#if ENABLE(XBL)
OwnPtr<BindingURI> bindingURI; // The XBL binding URI list.
#endif
diff --git a/WebCore/storage/AbstractDatabase.cpp b/WebCore/storage/AbstractDatabase.cpp
index c795189..dc3e8e2 100644
--- a/WebCore/storage/AbstractDatabase.cpp
+++ b/WebCore/storage/AbstractDatabase.cpp
@@ -33,6 +33,22 @@
namespace WebCore {
+static bool isDatabaseAvailable = true;
+
+bool AbstractDatabase::isAvailable()
+{
+ return isDatabaseAvailable;
+}
+
+void AbstractDatabase::setIsAvailable(bool available)
+{
+ isDatabaseAvailable = available;
+}
+
+AbstractDatabase::~AbstractDatabase()
+{
+}
+
} // namespace WebCore
#endif // ENABLE(DATABASE)
diff --git a/WebCore/storage/AbstractDatabase.h b/WebCore/storage/AbstractDatabase.h
index 962be61..5e4e0fa 100644
--- a/WebCore/storage/AbstractDatabase.h
+++ b/WebCore/storage/AbstractDatabase.h
@@ -31,9 +31,30 @@
#if ENABLE(DATABASE)
+#include "PlatformString.h"
+#include <wtf/ThreadSafeShared.h>
+
namespace WebCore {
-class AbstractDatabase {
+class ScriptExecutionContext;
+class SecurityOrigin;
+
+class AbstractDatabase : public ThreadSafeShared<AbstractDatabase> {
+public:
+ static bool isAvailable();
+ static void setIsAvailable(bool available);
+
+ virtual ~AbstractDatabase();
+
+ virtual ScriptExecutionContext* scriptExecutionContext() const = 0;
+ virtual SecurityOrigin* securityOrigin() const = 0;
+ virtual String stringIdentifier() const = 0;
+ virtual String displayName() const = 0;
+ virtual unsigned long estimatedSize() const = 0;
+ virtual String fileName() const = 0;
+
+ virtual void markAsDeletedAndClose() = 0;
+ virtual void closeImmediately() = 0;
};
} // namespace WebCore
diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp
index c96dfba..ad6b92c 100644
--- a/WebCore/storage/Database.cpp
+++ b/WebCore/storage/Database.cpp
@@ -73,18 +73,6 @@ const String& Database::databaseInfoTableName()
return name;
}
-static bool isDatabaseAvailable = true;
-
-void Database::setIsAvailable(bool available)
-{
- isDatabaseAvailable = available;
-}
-
-bool Database::isAvailable()
-{
- return isDatabaseAvailable;
-}
-
static Mutex& guidMutex()
{
// Note: We don't have to use AtomicallyInitializedStatic here because
@@ -451,6 +439,15 @@ void Database::close(ClosePolicy policy)
m_scriptExecutionContext->postTask(ContextRemoveOpenDatabaseTask::create(this));
}
+void Database::closeImmediately()
+{
+ DatabaseThread* databaseThread = scriptExecutionContext()->databaseThread();
+ if (databaseThread && !databaseThread->terminationRequested()) {
+ stop();
+ databaseThread->scheduleTask(DatabaseCloseTask::create(this, Database::RemoveDatabaseFromContext, 0));
+ }
+}
+
void Database::stop()
{
// FIXME: The net effect of the following code is to remove all pending transactions and statements, but allow the current statement
diff --git a/WebCore/storage/Database.h b/WebCore/storage/Database.h
index f9fd3cd..495f98f 100644
--- a/WebCore/storage/Database.h
+++ b/WebCore/storage/Database.h
@@ -30,6 +30,7 @@
#define Database_h
#if ENABLE(DATABASE)
+#include "AbstractDatabase.h"
#include "PlatformString.h"
#include "SQLiteDatabase.h"
#ifndef NDEBUG
@@ -55,12 +56,9 @@ class VoidCallback;
typedef int ExceptionCode;
-class Database : public ThreadSafeShared<Database> {
+class Database : public AbstractDatabase {
public:
- static void setIsAvailable(bool);
- static bool isAvailable();
-
- ~Database();
+ virtual ~Database();
// Direct support for the DOM API
static PassRefPtr<Database> openDatabase(ScriptExecutionContext*, const String& name, const String& expectedVersion, const String& displayName,
@@ -84,24 +82,25 @@ public:
Vector<String> tableNames();
- ScriptExecutionContext* scriptExecutionContext() const { return m_scriptExecutionContext.get(); }
- SecurityOrigin* securityOrigin() const;
+ virtual ScriptExecutionContext* scriptExecutionContext() const { return m_scriptExecutionContext.get(); }
+ virtual SecurityOrigin* securityOrigin() const;
SQLiteDatabase& sqliteDatabase() { return m_sqliteDatabase; }
- String stringIdentifier() const;
- String displayName() const;
- unsigned long estimatedSize() const;
- String fileName() const;
+ virtual String stringIdentifier() const;
+ virtual String displayName() const;
+ virtual unsigned long estimatedSize() const;
+ virtual String fileName() const;
bool getVersionFromDatabase(String&);
bool setVersionInDatabase(const String&);
void setExpectedVersion(const String&);
bool versionMatchesExpected() const;
- void markAsDeletedAndClose();
+ virtual void markAsDeletedAndClose();
bool deleted() const { return m_deleted; }
enum ClosePolicy { DoNotRemoveDatabaseFromContext, RemoveDatabaseFromContext };
void close(ClosePolicy);
+ virtual void closeImmediately();
bool opened() const { return m_opened; }
void stop();
diff --git a/WebCore/storage/DatabaseSync.cpp b/WebCore/storage/DatabaseSync.cpp
index 224a75d..0d3bed5 100644
--- a/WebCore/storage/DatabaseSync.cpp
+++ b/WebCore/storage/DatabaseSync.cpp
@@ -46,18 +46,6 @@ const String& DatabaseSync::databaseInfoTableName()
return name;
}
-static bool isSyncDatabaseAvailable = true;
-
-void DatabaseSync::setIsAvailable(bool available)
-{
- isSyncDatabaseAvailable = available;
-}
-
-bool DatabaseSync::isAvailable()
-{
- return isSyncDatabaseAvailable;
-}
-
PassRefPtr<DatabaseSync> DatabaseSync::openDatabaseSync(ScriptExecutionContext*, const String&, const String&, const String&,
unsigned long, PassRefPtr<DatabaseCallback>, ExceptionCode& ec)
{
@@ -110,4 +98,3 @@ ScriptExecutionContext* DatabaseSync::scriptExecutionContext() const
} // namespace WebCore
#endif // ENABLE(DATABASE)
-
diff --git a/WebCore/storage/DatabaseSync.h b/WebCore/storage/DatabaseSync.h
index 4b9985c..321b620 100644
--- a/WebCore/storage/DatabaseSync.h
+++ b/WebCore/storage/DatabaseSync.h
@@ -44,9 +44,6 @@ typedef int ExceptionCode;
// Instances of this class should be created and used only on the worker's context thread.
class DatabaseSync : public RefCounted<DatabaseSync> {
public:
- static void setIsAvailable(bool);
- static bool isAvailable();
-
~DatabaseSync();
// Direct support for the DOM API
diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp
index 752dbe6..cf56ff6 100644
--- a/WebCore/storage/DatabaseTracker.cpp
+++ b/WebCore/storage/DatabaseTracker.cpp
@@ -31,9 +31,9 @@
#if ENABLE(DATABASE)
+#include "AbstractDatabase.h"
#include "Chrome.h"
#include "ChromeClient.h"
-#include "Database.h"
#include "DatabaseThread.h"
#include "DatabaseTrackerClient.h"
#include "Logging.h"
@@ -219,7 +219,7 @@ bool DatabaseTracker::hasEntryForDatabase(SecurityOrigin* origin, const String&
return statement.step() == SQLResultRow;
}
-unsigned long long DatabaseTracker::getMaxSizeForDatabase(const Database* database)
+unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase* database)
{
ASSERT(currentThread() == database->scriptExecutionContext()->databaseThread()->getThreadID());
// The maximum size for a database is the full quota for its origin, minus the current usage within the origin,
@@ -230,7 +230,7 @@ unsigned long long DatabaseTracker::getMaxSizeForDatabase(const Database* databa
return quotaForOriginNoLock(origin) - originQuotaManager().diskUsage(origin) + SQLiteFileSystem::getDatabaseFileSize(database->fileName());
}
-void DatabaseTracker::databaseChanged(Database* database)
+void DatabaseTracker::databaseChanged(AbstractDatabase* database)
{
Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager());
originQuotaManager().markDatabase(database);
@@ -479,7 +479,7 @@ unsigned long long DatabaseTracker::usageForDatabase(const String& name, Securit
return SQLiteFileSystem::getDatabaseFileSize(path);
}
-void DatabaseTracker::addOpenDatabase(Database* database)
+void DatabaseTracker::addOpenDatabase(AbstractDatabase* database)
{
if (!database)
return;
@@ -512,7 +512,7 @@ void DatabaseTracker::addOpenDatabase(Database* database)
doneCreatingDatabase(database->securityOrigin(), database->stringIdentifier());
}
-void DatabaseTracker::removeOpenDatabase(Database* database)
+void DatabaseTracker::removeOpenDatabase(AbstractDatabase* database)
{
if (!database)
return;
@@ -559,7 +559,7 @@ void DatabaseTracker::removeOpenDatabase(Database* database)
originQuotaManager().removeOrigin(database->securityOrigin());
}
-void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<Database> >* databases)
+void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<AbstractDatabase> >* databases)
{
MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap)
@@ -973,7 +973,7 @@ bool DatabaseTracker::deleteDatabaseFile(SecurityOrigin* origin, const String& n
}
#endif
- Vector<RefPtr<Database> > deletedDatabases;
+ Vector<RefPtr<AbstractDatabase> > deletedDatabases;
// Make sure not to hold the any locks when calling
// Database::markAsDeletedAndClose(), since that can cause a deadlock
diff --git a/WebCore/storage/DatabaseTracker.h b/WebCore/storage/DatabaseTracker.h
index 223d4f2..b1267bc 100644
--- a/WebCore/storage/DatabaseTracker.h
+++ b/WebCore/storage/DatabaseTracker.h
@@ -44,7 +44,7 @@
namespace WebCore {
-class Database;
+class AbstractDatabase;
class ScriptExecutionContext;
class SecurityOrigin;
@@ -70,17 +70,17 @@ public:
void setDatabaseDetails(SecurityOrigin*, const String& name, const String& displayName, unsigned long estimatedSize);
String fullPathForDatabase(SecurityOrigin*, const String& name, bool createIfDoesNotExist = true);
- void addOpenDatabase(Database*);
- void removeOpenDatabase(Database*);
- void getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<Database> >* databases);
+ void addOpenDatabase(AbstractDatabase*);
+ void removeOpenDatabase(AbstractDatabase*);
+ void getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<AbstractDatabase> >* databases);
- unsigned long long getMaxSizeForDatabase(const Database*);
- void databaseChanged(Database*);
+ unsigned long long getMaxSizeForDatabase(const AbstractDatabase*);
+ void databaseChanged(AbstractDatabase*);
private:
DatabaseTracker(const String& databasePath);
- typedef HashSet<Database*> DatabaseSet;
+ typedef HashSet<AbstractDatabase*> DatabaseSet;
typedef HashMap<String, DatabaseSet*> DatabaseNameMap;
typedef HashMap<RefPtr<SecurityOrigin>, DatabaseNameMap*, SecurityOriginHash> DatabaseOriginMap;
diff --git a/WebCore/storage/IDBObjectStoreImpl.h b/WebCore/storage/IDBObjectStoreImpl.h
index 89a06db..89a06db 100755..100644
--- a/WebCore/storage/IDBObjectStoreImpl.h
+++ b/WebCore/storage/IDBObjectStoreImpl.h
diff --git a/WebCore/storage/IndexedDatabaseImpl.cpp b/WebCore/storage/IndexedDatabaseImpl.cpp
index 793af9e..e6af901 100644
--- a/WebCore/storage/IndexedDatabaseImpl.cpp
+++ b/WebCore/storage/IndexedDatabaseImpl.cpp
@@ -40,7 +40,7 @@ namespace WebCore {
PassRefPtr<IndexedDatabaseImpl> IndexedDatabaseImpl::create()
{
- return new IndexedDatabaseImpl();
+ return adoptRef(new IndexedDatabaseImpl);
}
IndexedDatabaseImpl::IndexedDatabaseImpl()
diff --git a/WebCore/storage/LocalStorageTask.cpp b/WebCore/storage/LocalStorageTask.cpp
index 12cc083..d31c991 100644
--- a/WebCore/storage/LocalStorageTask.cpp
+++ b/WebCore/storage/LocalStorageTask.cpp
@@ -39,7 +39,7 @@ LocalStorageTask::LocalStorageTask(Type type, StorageAreaSync* area)
, m_thread(0)
{
ASSERT(m_area);
- ASSERT(m_type == AreaImport || m_type == AreaSync);
+ ASSERT(m_type == AreaImport || m_type == AreaSync || m_type == DeleteEmptyDatabase);
}
LocalStorageTask::LocalStorageTask(Type type, LocalStorageThread* thread)
@@ -64,6 +64,9 @@ void LocalStorageTask::performTask()
case AreaSync:
m_area->performSync();
break;
+ case DeleteEmptyDatabase:
+ m_area->deleteEmptyDatabase();
+ break;
case TerminateThread:
m_thread->performTerminate();
break;
diff --git a/WebCore/storage/LocalStorageTask.h b/WebCore/storage/LocalStorageTask.h
index dc3e7e2..8d53ce4 100644
--- a/WebCore/storage/LocalStorageTask.h
+++ b/WebCore/storage/LocalStorageTask.h
@@ -39,12 +39,13 @@ namespace WebCore {
// FIXME: Rename this class to StorageTask
class LocalStorageTask : public Noncopyable {
public:
- enum Type { AreaImport, AreaSync, TerminateThread };
+ enum Type { AreaImport, AreaSync, DeleteEmptyDatabase, TerminateThread };
~LocalStorageTask();
static PassOwnPtr<LocalStorageTask> createImport(StorageAreaSync* area) { return new LocalStorageTask(AreaImport, area); }
static PassOwnPtr<LocalStorageTask> createSync(StorageAreaSync* area) { return new LocalStorageTask(AreaSync, area); }
+ static PassOwnPtr<LocalStorageTask> createDeleteEmptyDatabase(StorageAreaSync* area) { return new LocalStorageTask(DeleteEmptyDatabase, area); }
static PassOwnPtr<LocalStorageTask> createTerminate(LocalStorageThread* thread) { return new LocalStorageTask(TerminateThread, thread); }
void performTask();
diff --git a/WebCore/storage/OriginQuotaManager.cpp b/WebCore/storage/OriginQuotaManager.cpp
index 88f75b8..0f415c1 100644
--- a/WebCore/storage/OriginQuotaManager.cpp
+++ b/WebCore/storage/OriginQuotaManager.cpp
@@ -30,7 +30,7 @@
#if ENABLE(DATABASE)
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "OriginUsageRecord.h"
namespace WebCore {
@@ -112,7 +112,7 @@ void OriginQuotaManager::removeOrigin(SecurityOrigin* origin)
}
}
-void OriginQuotaManager::markDatabase(Database* database)
+void OriginQuotaManager::markDatabase(AbstractDatabase* database)
{
ASSERT(database);
ASSERT(m_usageRecordGuardLocked);
diff --git a/WebCore/storage/OriginQuotaManager.h b/WebCore/storage/OriginQuotaManager.h
index 33c201a..c904737 100644
--- a/WebCore/storage/OriginQuotaManager.h
+++ b/WebCore/storage/OriginQuotaManager.h
@@ -38,7 +38,7 @@
namespace WebCore {
-class Database;
+class AbstractDatabase;
class OriginUsageRecord;
class OriginQuotaManager : public Noncopyable {
@@ -55,7 +55,7 @@ public:
void removeDatabase(SecurityOrigin*, const String& databaseIdentifier);
void removeOrigin(SecurityOrigin*);
- void markDatabase(Database*); // Mark dirtiness of a specific database.
+ void markDatabase(AbstractDatabase*); // Mark dirtiness of a specific database.
unsigned long long diskUsage(SecurityOrigin*) const;
private:
diff --git a/WebCore/storage/SQLError.h b/WebCore/storage/SQLError.h
index 4414e6b..efbe4ec 100644
--- a/WebCore/storage/SQLError.h
+++ b/WebCore/storage/SQLError.h
@@ -43,6 +43,17 @@ public:
unsigned code() const { return m_code; }
String message() const { return m_message.threadsafeCopy(); }
+ enum SQLErrorCode {
+ UNKNOWN_ERR = 0,
+ DATABASE_ERR = 1,
+ VERSION_ERR = 2,
+ TOO_LARGE_ERR = 3,
+ QUOTA_ERR = 4,
+ SYNTAX_ERR = 5,
+ CONSTRAINT_ERR = 6,
+ TIMEOUT_ERR = 7
+ };
+
private:
SQLError(unsigned code, const String& message) : m_code(code), m_message(message.threadsafeCopy()) { }
unsigned m_code;
diff --git a/WebCore/storage/SQLError.idl b/WebCore/storage/SQLError.idl
index b50a8bc..87be8c7 100644
--- a/WebCore/storage/SQLError.idl
+++ b/WebCore/storage/SQLError.idl
@@ -35,5 +35,15 @@ module storage {
] SQLError {
readonly attribute unsigned long code;
readonly attribute DOMString message;
+
+ // SQLErrorCode: used only in the async DB API
+ const unsigned short UNKNOWN_ERR = 0;
+ const unsigned short DATABASE_ERR = 1;
+ const unsigned short VERSION_ERR = 2;
+ const unsigned short TOO_LARGE_ERR = 3;
+ const unsigned short QUOTA_ERR = 4;
+ const unsigned short SYNTAX_ERR = 5;
+ const unsigned short CONSTRAINT_ERR = 6;
+ const unsigned short TIMEOUT_ERR = 7;
};
}
diff --git a/WebCore/storage/SQLException.h b/WebCore/storage/SQLException.h
new file mode 100644
index 0000000..a0f118d
--- /dev/null
+++ b/WebCore/storage/SQLException.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef SQLException_h
+#define SQLException_h
+
+#if ENABLE(DATABASE)
+
+#include "ExceptionBase.h"
+
+namespace WebCore {
+
+class SQLException : public ExceptionBase {
+public:
+ static PassRefPtr<SQLException> create(const ExceptionCodeDescription& description)
+ {
+ return adoptRef(new SQLException(description));
+ }
+
+ static const int SQLExceptionOffset = 1000;
+ static const int SQLExceptionMax = 1099;
+
+ enum SQLExceptionCode {
+ UNKNOWN_ERR = SQLExceptionOffset,
+ DATABASE_ERR = SQLExceptionOffset + 1,
+ VERSION_ERR = SQLExceptionOffset + 2,
+ TOO_LARGE_ERR = SQLExceptionOffset + 3,
+ QUOTA_ERR = SQLExceptionOffset + 4,
+ SYNTAX_ERR = SQLExceptionOffset + 5,
+ CONSTRAINT_ERR = SQLExceptionOffset + 6,
+ TIMEOUT_ERR = SQLExceptionOffset + 7
+ };
+
+private:
+ SQLException(const ExceptionCodeDescription& description)
+ : ExceptionBase(description)
+ {
+ }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(DATABASE)
+
+#endif // SQLException_h
diff --git a/WebCore/storage/SQLException.idl b/WebCore/storage/SQLException.idl
new file mode 100644
index 0000000..9830142
--- /dev/null
+++ b/WebCore/storage/SQLException.idl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+module storage {
+
+ interface [
+ Conditional=DATABASE,
+ NoStaticTables
+ ] SQLException {
+ readonly attribute unsigned long code;
+ readonly attribute DOMString message;
+
+ // SQLExceptionCode: used only in the sync DB API
+ const unsigned short UNKNOWN_ERR = 0;
+ const unsigned short DATABASE_ERR = 1;
+ const unsigned short VERSION_ERR = 2;
+ const unsigned short TOO_LARGE_ERR = 3;
+ const unsigned short QUOTA_ERR = 4;
+ const unsigned short SYNTAX_ERR = 5;
+ const unsigned short CONSTRAINT_ERR = 6;
+ const unsigned short TIMEOUT_ERR = 7;
+ };
+}
diff --git a/WebCore/storage/SQLStatement.cpp b/WebCore/storage/SQLStatement.cpp
index cd96535..2d7d78e 100644
--- a/WebCore/storage/SQLStatement.cpp
+++ b/WebCore/storage/SQLStatement.cpp
@@ -78,7 +78,7 @@ bool SQLStatement::execute(Database* db)
if (result != SQLResultOk) {
LOG(StorageAPI, "Unable to verify correctness of statement %s - error %i (%s)", m_statement.ascii().data(), result, database->lastErrorMsg());
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, database->lastErrorMsg());
return false;
}
@@ -86,7 +86,7 @@ bool SQLStatement::execute(Database* db)
// If this is the case, they might be trying to do something fishy or malicious
if (statement.bindParameterCount() != m_arguments.size()) {
LOG(StorageAPI, "Bind parameter count doesn't match number of question marks");
- m_error = SQLError::create(1, "number of '?'s in statement string does not match argument count");
+ m_error = SQLError::create(SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
return false;
}
@@ -99,7 +99,7 @@ bool SQLStatement::execute(Database* db)
if (result != SQLResultOk) {
LOG(StorageAPI, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, database->lastErrorMsg());
return false;
}
}
@@ -123,7 +123,7 @@ bool SQLStatement::execute(Database* db)
} while (result == SQLResultRow);
if (result != SQLResultDone) {
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, database->lastErrorMsg());
return false;
}
} else if (result == SQLResultDone) {
@@ -135,7 +135,7 @@ bool SQLStatement::execute(Database* db)
setFailureDueToQuota();
return false;
} else {
- m_error = SQLError::create(1, database->lastErrorMsg());
+ m_error = SQLError::create(SQLError::DATABASE_ERR, database->lastErrorMsg());
return false;
}
@@ -151,13 +151,13 @@ bool SQLStatement::execute(Database* db)
void SQLStatement::setDatabaseDeletedError()
{
ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(0, "unable to execute statement, because the user deleted the database");
+ m_error = SQLError::create(SQLError::UNKNOWN_ERR, "unable to execute statement, because the user deleted the database");
}
void SQLStatement::setVersionMismatchedError()
{
ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(2, "current version of the database and `oldVersion` argument do not match");
+ m_error = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
}
bool SQLStatement::performCallback(SQLTransaction* transaction)
@@ -184,7 +184,7 @@ bool SQLStatement::performCallback(SQLTransaction* transaction)
void SQLStatement::setFailureDueToQuota()
{
ASSERT(!m_error && !m_resultSet);
- m_error = SQLError::create(4, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
+ m_error = SQLError::create(SQLError::QUOTA_ERR, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
}
void SQLStatement::clearFailureDueToQuota()
@@ -195,7 +195,7 @@ void SQLStatement::clearFailureDueToQuota()
bool SQLStatement::lastExecutionFailedDueToQuota() const
{
- return m_error && m_error->code() == 4;
+ return m_error && m_error->code() == SQLError::QUOTA_ERR;
}
} // namespace WebCore
diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp
index b06d865..5a1e2b0 100644
--- a/WebCore/storage/SQLTransaction.cpp
+++ b/WebCore/storage/SQLTransaction.cpp
@@ -241,7 +241,7 @@ void SQLTransaction::openTransactionAndPreflight()
// If the database was deleted, jump to the error callback
if (m_database->deleted()) {
- m_transactionError = SQLError::create(0, "unable to open a transaction, because the user deleted the database");
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to open a transaction, because the user deleted the database");
handleTransactionError(false);
return;
}
@@ -262,7 +262,7 @@ void SQLTransaction::openTransactionAndPreflight()
if (!m_sqliteTransaction->inProgress()) {
ASSERT(!m_database->sqliteDatabase().transactionInProgress());
m_sqliteTransaction.clear();
- m_transactionError = SQLError::create(0, "unable to open a transaction to the database");
+ m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to open a transaction to the database");
handleTransactionError(false);
return;
}
@@ -273,7 +273,7 @@ void SQLTransaction::openTransactionAndPreflight()
m_sqliteTransaction.clear();
m_transactionError = m_wrapper->sqlError();
if (!m_transactionError)
- m_transactionError = SQLError::create(0, "unknown error occured setting up transaction");
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unknown error occured setting up transaction");
handleTransactionError(false);
return;
@@ -298,7 +298,7 @@ void SQLTransaction::deliverTransactionCallback()
// Transaction Step 5 - If the transaction callback was null or raised an exception, jump to the error callback
if (shouldDeliverErrorCallback) {
- m_transactionError = SQLError::create(0, "the SQLTransactionCallback was null or threw an exception");
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "the SQLTransactionCallback was null or threw an exception");
deliverTransactionErrorCallback();
} else
scheduleToRunStatements();
@@ -405,7 +405,7 @@ void SQLTransaction::handleCurrentStatementError()
} else {
m_transactionError = m_currentStatement->sqlError();
if (!m_transactionError)
- m_transactionError = SQLError::create(1, "the statement failed to execute");
+ m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "the statement failed to execute");
handleTransactionError(false);
}
}
@@ -421,7 +421,7 @@ void SQLTransaction::deliverStatementCallback()
m_executeSqlAllowed = false;
if (result) {
- m_transactionError = SQLError::create(0, "the statement callback raised an exception or statement error callback did not return false");
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "the statement callback raised an exception or statement error callback did not return false");
handleTransactionError(true);
} else
scheduleToRunStatements();
@@ -447,7 +447,7 @@ void SQLTransaction::postflightAndCommit()
if (m_wrapper && !m_wrapper->performPostflight(this)) {
m_transactionError = m_wrapper->sqlError();
if (!m_transactionError)
- m_transactionError = SQLError::create(0, "unknown error occured setting up transaction");
+ m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unknown error occured setting up transaction");
handleTransactionError(false);
return;
}
@@ -461,7 +461,7 @@ void SQLTransaction::postflightAndCommit()
// If the commit failed, the transaction will still be marked as "in progress"
if (m_sqliteTransaction->inProgress()) {
- m_transactionError = SQLError::create(0, "failed to commit the transaction");
+ m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "failed to commit the transaction");
handleTransactionError(false);
return;
}
diff --git a/WebCore/storage/StorageAreaImpl.cpp b/WebCore/storage/StorageAreaImpl.cpp
index aa04781..dc25e54 100644
--- a/WebCore/storage/StorageAreaImpl.cpp
+++ b/WebCore/storage/StorageAreaImpl.cpp
@@ -44,12 +44,7 @@ StorageAreaImpl::~StorageAreaImpl()
ASSERT(isMainThread());
}
-PassRefPtr<StorageAreaImpl> StorageAreaImpl::create(StorageType storageType, PassRefPtr<SecurityOrigin> origin, PassRefPtr<StorageSyncManager> syncManager, unsigned quota)
-{
- return adoptRef(new StorageAreaImpl(storageType, origin, syncManager, quota));
-}
-
-StorageAreaImpl::StorageAreaImpl(StorageType storageType, PassRefPtr<SecurityOrigin> origin, PassRefPtr<StorageSyncManager> syncManager, unsigned quota)
+inline StorageAreaImpl::StorageAreaImpl(StorageType storageType, PassRefPtr<SecurityOrigin> origin, PassRefPtr<StorageSyncManager> syncManager, unsigned quota)
: m_storageType(storageType)
, m_securityOrigin(origin)
, m_storageMap(StorageMap::create(quota))
@@ -61,13 +56,20 @@ StorageAreaImpl::StorageAreaImpl(StorageType storageType, PassRefPtr<SecurityOri
ASSERT(isMainThread());
ASSERT(m_securityOrigin);
ASSERT(m_storageMap);
+}
+
+PassRefPtr<StorageAreaImpl> StorageAreaImpl::create(StorageType storageType, PassRefPtr<SecurityOrigin> origin, PassRefPtr<StorageSyncManager> syncManager, unsigned quota)
+{
+ RefPtr<StorageAreaImpl> area = adoptRef(new StorageAreaImpl(storageType, origin, syncManager, quota));
// FIXME: If there's no backing storage for LocalStorage, the default WebKit behavior should be that of private browsing,
- // not silently ignoring it. https://bugs.webkit.org/show_bug.cgi?id=25894
- if (m_storageSyncManager) {
- m_storageAreaSync = StorageAreaSync::create(m_storageSyncManager, this, m_securityOrigin->databaseIdentifier());
- ASSERT(m_storageAreaSync);
+ // not silently ignoring it. https://bugs.webkit.org/show_bug.cgi?id=25894
+ if (area->m_storageSyncManager) {
+ area->m_storageAreaSync = StorageAreaSync::create(area->m_storageSyncManager, area.get(), area->m_securityOrigin->databaseIdentifier());
+ ASSERT(area->m_storageAreaSync);
}
+
+ return area.release();
}
PassRefPtr<StorageAreaImpl> StorageAreaImpl::copy()
diff --git a/WebCore/storage/StorageAreaSync.cpp b/WebCore/storage/StorageAreaSync.cpp
index 59f558b..e20f11c 100644
--- a/WebCore/storage/StorageAreaSync.cpp
+++ b/WebCore/storage/StorageAreaSync.cpp
@@ -31,8 +31,9 @@
#include "EventNames.h"
#include "FileSystem.h"
#include "HTMLElement.h"
-#include "SecurityOrigin.h"
+#include "SQLiteFileSystem.h"
#include "SQLiteStatement.h"
+#include "SecurityOrigin.h"
#include "StorageAreaImpl.h"
#include "StorageSyncManager.h"
#include "SuddenTermination.h"
@@ -101,6 +102,7 @@ void StorageAreaSync::scheduleFinalSync()
// we should do it safely.
m_finalSyncScheduled = true;
syncTimerFired(&m_syncTimer);
+ m_syncManager->scheduleDeleteEmptyDatabase(this);
}
void StorageAreaSync::scheduleItemForSync(const String& key, const String& value)
@@ -306,6 +308,8 @@ void StorageAreaSync::sync(bool clearItems, const HashMap<String, String>& items
{
ASSERT(!isMainThread());
+ if (items.isEmpty() && !clearItems)
+ return;
if (m_databaseOpenFailed)
return;
if (!m_database.isOpen())
@@ -393,6 +397,34 @@ void StorageAreaSync::performSync()
enableSuddenTermination();
}
+void StorageAreaSync::deleteEmptyDatabase()
+{
+ ASSERT(!isMainThread());
+ if (!m_database.isOpen())
+ return;
+
+ SQLiteStatement query(m_database, "SELECT COUNT(*) FROM ItemTable");
+ if (query.prepare() != SQLResultOk) {
+ LOG_ERROR("Unable to count number of rows in ItemTable for local storage");
+ return;
+ }
+
+ int result = query.step();
+ if (result != SQLResultRow) {
+ LOG_ERROR("No results when counting number of rows in ItemTable for local storage");
+ return;
+ }
+
+ int count = query.getColumnInt(0);
+ if (!count) {
+ query.finalize();
+ m_database.close();
+ String databaseFilename = m_syncManager->fullDatabaseFilename(m_databaseIdentifier);
+ if (!SQLiteFileSystem::deleteDatabaseFile(databaseFilename))
+ LOG_ERROR("Failed to delete database file %s\n", databaseFilename.utf8().data());
+ }
+}
+
} // namespace WebCore
#endif // ENABLE(DOM_STORAGE)
diff --git a/WebCore/storage/StorageAreaSync.h b/WebCore/storage/StorageAreaSync.h
index d26d399..a26b041 100644
--- a/WebCore/storage/StorageAreaSync.h
+++ b/WebCore/storage/StorageAreaSync.h
@@ -73,6 +73,7 @@ namespace WebCore {
// Called from the background thread
void performImport();
void performSync();
+ void deleteEmptyDatabase();
private:
enum OpenDatabaseParamType {
diff --git a/WebCore/storage/StorageNamespaceImpl.cpp b/WebCore/storage/StorageNamespaceImpl.cpp
index b505d1d..557dd76 100644
--- a/WebCore/storage/StorageNamespaceImpl.cpp
+++ b/WebCore/storage/StorageNamespaceImpl.cpp
@@ -108,7 +108,7 @@ PassRefPtr<StorageArea> StorageNamespaceImpl::storageArea(PassRefPtr<SecurityOri
RefPtr<SecurityOrigin> origin = prpOrigin;
RefPtr<StorageAreaImpl> storageArea;
- if (storageArea = m_storageAreaMap.get(origin))
+ if ((storageArea = m_storageAreaMap.get(origin)))
return storageArea.release();
storageArea = StorageAreaImpl::create(m_storageType, origin, m_syncManager, m_quota);
diff --git a/WebCore/storage/StorageSyncManager.cpp b/WebCore/storage/StorageSyncManager.cpp
index ebf35bd..1cf8306 100644
--- a/WebCore/storage/StorageSyncManager.cpp
+++ b/WebCore/storage/StorageSyncManager.cpp
@@ -100,6 +100,13 @@ void StorageSyncManager::scheduleSync(PassRefPtr<StorageAreaSync> area)
m_thread->scheduleTask(LocalStorageTask::createSync(area.get()));
}
+void StorageSyncManager::scheduleDeleteEmptyDatabase(PassRefPtr<StorageAreaSync> area)
+{
+ ASSERT(isMainThread());
+ ASSERT(m_thread);
+ if (m_thread)
+ m_thread->scheduleTask(LocalStorageTask::createDeleteEmptyDatabase(area.get()));
+}
} // namespace WebCore
#endif // ENABLE(DOM_STORAGE)
diff --git a/WebCore/storage/StorageSyncManager.h b/WebCore/storage/StorageSyncManager.h
index e2dfa76..6fbb75d 100644
--- a/WebCore/storage/StorageSyncManager.h
+++ b/WebCore/storage/StorageSyncManager.h
@@ -47,6 +47,7 @@ namespace WebCore {
bool scheduleImport(PassRefPtr<StorageAreaSync>);
void scheduleSync(PassRefPtr<StorageAreaSync>);
+ void scheduleDeleteEmptyDatabase(PassRefPtr<StorageAreaSync>);
void close();
diff --git a/WebCore/storage/chromium/DatabaseObserver.h b/WebCore/storage/chromium/DatabaseObserver.h
index 4e266c1..e2e5184 100644
--- a/WebCore/storage/chromium/DatabaseObserver.h
+++ b/WebCore/storage/chromium/DatabaseObserver.h
@@ -33,7 +33,7 @@
namespace WebCore {
-class Database;
+class AbstractDatabase;
class ScriptExecutionContext;
class String;
@@ -42,9 +42,9 @@ class String;
class DatabaseObserver {
public:
static bool canEstablishDatabase(ScriptExecutionContext*, const String&, const String&, unsigned long);
- static void databaseOpened(Database*);
- static void databaseModified(Database*);
- static void databaseClosed(Database*);
+ static void databaseOpened(AbstractDatabase*);
+ static void databaseModified(AbstractDatabase*);
+ static void databaseClosed(AbstractDatabase*);
};
}
diff --git a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
index 9d2a942..13c65cc 100644
--- a/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
+++ b/WebCore/storage/chromium/DatabaseTrackerChromium.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "DatabaseTracker.h"
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "DatabaseObserver.h"
#include "DatabaseThread.h"
#include "QuotaTracker.h"
@@ -72,7 +72,7 @@ String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String
return origin->databaseIdentifier() + "/" + name + "#";
}
-void DatabaseTracker::addOpenDatabase(Database* database)
+void DatabaseTracker::addOpenDatabase(AbstractDatabase* database)
{
ASSERT(database->scriptExecutionContext()->isContextThread());
MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
@@ -99,7 +99,7 @@ void DatabaseTracker::addOpenDatabase(Database* database)
class TrackerRemoveOpenDatabaseTask : public ScriptExecutionContext::Task {
public:
- static PassOwnPtr<TrackerRemoveOpenDatabaseTask> create(PassRefPtr<Database> database)
+ static PassOwnPtr<TrackerRemoveOpenDatabaseTask> create(PassRefPtr<AbstractDatabase> database)
{
return new TrackerRemoveOpenDatabaseTask(database);
}
@@ -110,15 +110,15 @@ public:
}
private:
- TrackerRemoveOpenDatabaseTask(PassRefPtr<Database> database)
+ TrackerRemoveOpenDatabaseTask(PassRefPtr<AbstractDatabase> database)
: m_database(database)
{
}
- RefPtr<Database> m_database;
+ RefPtr<AbstractDatabase> m_database;
};
-void DatabaseTracker::removeOpenDatabase(Database* database)
+void DatabaseTracker::removeOpenDatabase(AbstractDatabase* database)
{
if (!database->scriptExecutionContext()->isContextThread()) {
database->scriptExecutionContext()->postTask(TrackerRemoveOpenDatabaseTask::create(database));
@@ -147,7 +147,7 @@ void DatabaseTracker::removeOpenDatabase(Database* database)
}
-void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<Database> >* databases)
+void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& name, HashSet<RefPtr<AbstractDatabase> >* databases)
{
MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap)
@@ -165,7 +165,7 @@ void DatabaseTracker::getOpenDatabases(SecurityOrigin* origin, const String& nam
databases->add(*it);
}
-unsigned long long DatabaseTracker::getMaxSizeForDatabase(const Database* database)
+unsigned long long DatabaseTracker::getMaxSizeForDatabase(const AbstractDatabase* database)
{
ASSERT(currentThread() == database->scriptExecutionContext()->databaseThread()->getThreadID());
unsigned long long spaceAvailable = 0;
diff --git a/WebCore/svg/SVGDocument.cpp b/WebCore/svg/SVGDocument.cpp
index 2264a11..b449390 100644
--- a/WebCore/svg/SVGDocument.cpp
+++ b/WebCore/svg/SVGDocument.cpp
@@ -35,8 +35,8 @@
namespace WebCore {
-SVGDocument::SVGDocument(Frame* frame)
- : Document(frame, false, false)
+SVGDocument::SVGDocument(Frame* frame, const KURL& url)
+ : Document(frame, url, false, false)
{
}
diff --git a/WebCore/svg/SVGDocument.h b/WebCore/svg/SVGDocument.h
index c7006f9..49e2746 100644
--- a/WebCore/svg/SVGDocument.h
+++ b/WebCore/svg/SVGDocument.h
@@ -33,9 +33,9 @@ namespace WebCore {
class SVGDocument : public Document {
public:
- static PassRefPtr<SVGDocument> create(Frame* frame)
+ static PassRefPtr<SVGDocument> create(Frame* frame, const KURL& url)
{
- return adoptRef(new SVGDocument(frame));
+ return adoptRef(new SVGDocument(frame, url));
}
virtual ~SVGDocument();
@@ -51,7 +51,7 @@ namespace WebCore {
void updatePan(const FloatPoint& pos) const;
private:
- SVGDocument(Frame*);
+ SVGDocument(Frame*, const KURL&);
virtual bool isSVGDocument() const { return true; }
diff --git a/WebCore/svg/SVGElement.idl b/WebCore/svg/SVGElement.idl
index 27fcb8d..cecaa18 100644
--- a/WebCore/svg/SVGElement.idl
+++ b/WebCore/svg/SVGElement.idl
@@ -23,10 +23,8 @@
module svg {
interface [GenerateNativeConverter, Conditional=SVG] SVGElement : Element {
- attribute [ConvertNullToNullString, Reflect] DOMString id
- setter raises(DOMException);
- attribute [ConvertNullToNullString] DOMString xmlbase
- setter raises(DOMException);
+ attribute [Reflect] DOMString id setter raises(DOMException);
+ attribute [ConvertNullToNullString] DOMString xmlbase setter raises(DOMException);
readonly attribute SVGSVGElement ownerSVGElement;
readonly attribute SVGElement viewportElement;
};
diff --git a/WebCore/svg/SVGFont.cpp b/WebCore/svg/SVGFont.cpp
index 049d35e..5436688 100644
--- a/WebCore/svg/SVGFont.cpp
+++ b/WebCore/svg/SVGFont.cpp
@@ -571,7 +571,7 @@ void Font::drawTextUsingSVGFont(GraphicsContext* context, const TextRun& run,
}
}
-FloatRect Font::selectionRectForTextUsingSVGFont(const TextRun& run, const IntPoint& point, int height, int from, int to) const
+FloatRect Font::selectionRectForTextUsingSVGFont(const TextRun& run, const FloatPoint& point, int height, int from, int to) const
{
int charsConsumed;
String glyphName;
@@ -580,7 +580,7 @@ FloatRect Font::selectionRectForTextUsingSVGFont(const TextRun& run, const IntPo
point.y(), floatWidthOfSubStringUsingSVGFont(this, run, 0, from, to, charsConsumed, glyphName), height);
}
-int Font::offsetForPositionForTextUsingSVGFont(const TextRun&, int, bool) const
+int Font::offsetForPositionForTextUsingSVGFont(const TextRun&, float, bool) const
{
// TODO: Fix text selection when HTML text is drawn using a SVG Font
// We need to integrate the SVG text selection code in the offsetForPosition() framework.
diff --git a/WebCore/svg/SVGForeignObjectElement.cpp b/WebCore/svg/SVGForeignObjectElement.cpp
index 9dc61c9..e3e8fab 100644
--- a/WebCore/svg/SVGForeignObjectElement.cpp
+++ b/WebCore/svg/SVGForeignObjectElement.cpp
@@ -131,6 +131,10 @@ RenderObject* SVGForeignObjectElement::createRenderer(RenderArena* arena, Render
bool SVGForeignObjectElement::childShouldCreateRenderer(Node* child) const
{
+ // Disallow arbitary SVG content. Only allow proper <svg xmlns="svgNS"> subdocuments.
+ if (child->isSVGElement())
+ return child->hasTagName(SVGNames::svgTag);
+
// Skip over SVG rules which disallow non-SVG kids
return StyledElement::childShouldCreateRenderer(child);
}
diff --git a/WebCore/svg/SVGPaint.cpp b/WebCore/svg/SVGPaint.cpp
index 3b39b91..82a5fe4 100644
--- a/WebCore/svg/SVGPaint.cpp
+++ b/WebCore/svg/SVGPaint.cpp
@@ -66,14 +66,14 @@ SVGPaint::~SVGPaint()
SVGPaint* SVGPaint::defaultFill()
{
- static SVGPaint* _defaultFill = new SVGPaint(Color::black);
- return _defaultFill;
+ static SVGPaint* staticDefaultFill = create(Color::black).releaseRef();
+ return staticDefaultFill;
}
SVGPaint* SVGPaint::defaultStroke()
{
- static SVGPaint* _defaultStroke = new SVGPaint(SVG_PAINTTYPE_NONE);
- return _defaultStroke;
+ static SVGPaint* staticDefaultStroke = create(SVG_PAINTTYPE_NONE).releaseRef();
+ return staticDefaultStroke;
}
String SVGPaint::uri() const
diff --git a/WebCore/svg/SVGSVGElement.cpp b/WebCore/svg/SVGSVGElement.cpp
index 4b14a1f..154ad7a 100644
--- a/WebCore/svg/SVGSVGElement.cpp
+++ b/WebCore/svg/SVGSVGElement.cpp
@@ -522,6 +522,10 @@ bool SVGSVGElement::isOutermostSVG() const
if (!parentNode())
return true;
+ // We act like an outermost SVG element, if we're a direct child of a <foreignObject> element.
+ if (parentNode()->hasTagName(SVGNames::foreignObjectTag))
+ return true;
+
// This is true whenever this is the outermost SVG, even if there are HTML elements outside it
return !parentNode()->isSVGElement();
}
diff --git a/WebCore/svg/SVGScriptElement.cpp b/WebCore/svg/SVGScriptElement.cpp
index 61c68b6..abe77a9 100644
--- a/WebCore/svg/SVGScriptElement.cpp
+++ b/WebCore/svg/SVGScriptElement.cpp
@@ -199,6 +199,16 @@ String SVGScriptElement::eventAttributeValue() const
return String();
}
+bool SVGScriptElement::asyncAttributeValue() const
+{
+ return false;
+}
+
+bool SVGScriptElement::deferAttributeValue() const
+{
+ return false;
+}
+
void SVGScriptElement::dispatchLoadEvent()
{
bool externalResourcesRequired = externalResourcesRequiredBaseValue();
diff --git a/WebCore/svg/SVGScriptElement.h b/WebCore/svg/SVGScriptElement.h
index b864ad5..770dc89 100644
--- a/WebCore/svg/SVGScriptElement.h
+++ b/WebCore/svg/SVGScriptElement.h
@@ -67,6 +67,8 @@ namespace WebCore {
virtual String languageAttributeValue() const;
virtual String forAttributeValue() const;
virtual String eventAttributeValue() const;
+ virtual bool asyncAttributeValue() const;
+ virtual bool deferAttributeValue() const;
virtual void dispatchLoadEvent();
virtual void dispatchErrorEvent();
diff --git a/WebCore/svg/SVGStyledElement.cpp b/WebCore/svg/SVGStyledElement.cpp
index bd461c0..10cc793 100644
--- a/WebCore/svg/SVGStyledElement.cpp
+++ b/WebCore/svg/SVGStyledElement.cpp
@@ -228,12 +228,7 @@ void SVGStyledElement::parseMappedAttribute(Attribute* attr)
bool SVGStyledElement::isKnownAttribute(const QualifiedName& attrName)
{
- // Recognize all style related SVG CSS properties
- int propId = SVGStyledElement::cssPropertyIdForSVGAttributeName(attrName);
- if (propId > 0)
- return true;
-
- return isIdAttributeName(attrName) || attrName == HTMLNames::styleAttr;
+ return isIdAttributeName(attrName);
}
void SVGStyledElement::svgAttributeChanged(const QualifiedName& attrName)
diff --git a/WebCore/svg/SVGTextContentElement.cpp b/WebCore/svg/SVGTextContentElement.cpp
index 4fef0ee..12b9b31 100644
--- a/WebCore/svg/SVGTextContentElement.cpp
+++ b/WebCore/svg/SVGTextContentElement.cpp
@@ -23,23 +23,12 @@
#if ENABLE(SVG)
#include "SVGTextContentElement.h"
-#include "Attribute.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
-#include "ExceptionCode.h"
-#include "FloatPoint.h"
-#include "FloatRect.h"
#include "Frame.h"
-#include "Position.h"
-#include "RenderSVGText.h"
-#include "SVGCharacterData.h"
-#include "SVGInlineTextBox.h"
-#include "SVGLength.h"
-#include "SVGNames.h"
-#include "SVGRootInlineBox.h"
+#include "SVGTextQuery.h"
#include "SelectionController.h"
#include "XMLNames.h"
-#include <wtf/StdLibExtras.h>
namespace WebCore {
@@ -57,330 +46,16 @@ SVGTextContentElement::~SVGTextContentElement()
{
}
-static inline float cumulativeCharacterRangeLength(const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end, SVGInlineTextBox* textBox,
- int startOffset, long startPosition, long length, bool isVerticalText, long& atCharacter)
-{
- if (!length)
- return 0.0f;
-
- float textLength = 0.0f;
- RenderStyle* style = textBox->textRenderer()->style();
-
- bool usesFullRange = (startPosition == -1 && length == -1);
-
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (usesFullRange || (atCharacter >= startPosition && atCharacter <= startPosition + length)) {
- unsigned int newOffset = textBox->start() + (it - start) + startOffset;
-
- // Take RTL text into account and pick right glyph width/height.
- if (textBox->direction() == RTL)
- newOffset = textBox->start() + textBox->end() - newOffset;
-
- // FIXME: does this handle multichar glyphs ok? not sure
- int charsConsumed = 0;
- String glyphName;
- if (isVerticalText)
- textLength += textBox->calculateGlyphHeight(style, newOffset, 0);
- else
- textLength += textBox->calculateGlyphWidth(style, newOffset, 0, charsConsumed, glyphName);
- }
-
- if (!usesFullRange) {
- if (atCharacter == startPosition + length - 1)
- break;
-
- atCharacter++;
- }
- }
-
- return textLength;
-}
-
-// Helper class for querying certain glyph information
-struct SVGInlineTextBoxQueryWalker {
- typedef enum {
- NumberOfCharacters,
- TextLength,
- SubStringLength,
- StartPosition,
- EndPosition,
- Extent,
- Rotation,
- CharacterNumberAtPosition
- } QueryMode;
-
- SVGInlineTextBoxQueryWalker(const SVGTextContentElement* reference, QueryMode mode)
- : m_reference(reference)
- , m_mode(mode)
- , m_queryStartPosition(0)
- , m_queryLength(0)
- , m_queryPointInput()
- , m_queryLongResult(0)
- , m_queryFloatResult(0.0f)
- , m_queryPointResult()
- , m_queryRectResult()
- , m_stopProcessing(true)
- , m_atCharacter(0)
- {
- }
-
- void chunkPortionCallback(SVGInlineTextBox* textBox, int startOffset, const AffineTransform&,
- const Vector<SVGChar>::iterator& start, const Vector<SVGChar>::iterator& end)
- {
- RenderStyle* style = textBox->textRenderer()->style();
- bool isVerticalText = style->svgStyle()->writingMode() == WM_TBRL || style->svgStyle()->writingMode() == WM_TB;
-
- switch (m_mode) {
- case NumberOfCharacters:
- {
- m_queryLongResult += (end - start);
- m_stopProcessing = false;
- return;
- }
- case TextLength:
- {
- float textLength = cumulativeCharacterRangeLength(start, end, textBox, startOffset, -1, -1, isVerticalText, m_atCharacter);
-
- if (isVerticalText)
- m_queryFloatResult += textLength;
- else
- m_queryFloatResult += textLength;
-
- m_stopProcessing = false;
- return;
- }
- case SubStringLength:
- {
- long startPosition = m_queryStartPosition;
- long length = m_queryLength;
-
- float textLength = cumulativeCharacterRangeLength(start, end, textBox, startOffset, startPosition, length, isVerticalText, m_atCharacter);
-
- if (isVerticalText)
- m_queryFloatResult += textLength;
- else
- m_queryFloatResult += textLength;
-
- if (m_atCharacter == startPosition + length)
- m_stopProcessing = true;
- else
- m_stopProcessing = false;
-
- return;
- }
- case StartPosition:
- {
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (m_atCharacter == m_queryStartPosition) {
- m_queryPointResult = FloatPoint(it->x, it->y);
- m_stopProcessing = true;
- return;
- }
-
- m_atCharacter++;
- }
-
- m_stopProcessing = false;
- return;
- }
- case EndPosition:
- {
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (m_atCharacter == m_queryStartPosition) {
- unsigned int newOffset = textBox->start() + (it - start) + startOffset;
-
- // Take RTL text into account and pick right glyph width/height.
- if (textBox->direction() == RTL)
- newOffset = textBox->start() + textBox->end() - newOffset;
-
- int charsConsumed;
- String glyphName;
- // calculateGlyph{Height,Width} will consume at least one character. This is the number of characters available
- // to them beyond that first one.
- int extraCharactersAvailable = end - it - 1;
- if (isVerticalText)
- m_queryPointResult.move(it->x, it->y + textBox->calculateGlyphHeight(style, newOffset, extraCharactersAvailable));
- else
- m_queryPointResult.move(it->x + textBox->calculateGlyphWidth(style, newOffset, extraCharactersAvailable, charsConsumed, glyphName), it->y);
-
- m_stopProcessing = true;
- return;
- }
-
- m_atCharacter++;
- }
-
- m_stopProcessing = false;
- return;
- }
- case Extent:
- {
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (m_atCharacter == m_queryStartPosition) {
- unsigned int newOffset = textBox->start() + (it - start) + startOffset;
- m_queryRectResult = textBox->calculateGlyphBoundaries(style, newOffset, *it);
- m_stopProcessing = true;
- return;
- }
-
- m_atCharacter++;
- }
-
- m_stopProcessing = false;
- return;
- }
- case Rotation:
- {
- for (Vector<SVGChar>::iterator it = start; it != end; ++it) {
- if (m_atCharacter == m_queryStartPosition) {
- m_queryFloatResult = it->angle;
- m_stopProcessing = true;
- return;
- }
-
- m_atCharacter++;
- }
-
- m_stopProcessing = false;
- return;
- }
- case CharacterNumberAtPosition:
- {
- int offset = 0;
- SVGChar* charAtPos = textBox->closestCharacterToPosition(m_queryPointInput.x(), m_queryPointInput.y(), offset);
-
- offset += m_atCharacter;
- if (charAtPos && offset > m_queryLongResult)
- m_queryLongResult = offset;
-
- m_atCharacter += end - start;
- m_stopProcessing = false;
- return;
- }
- default:
- ASSERT_NOT_REACHED();
- m_stopProcessing = true;
- return;
- }
- }
-
- void setQueryInputParameters(long startPosition, long length, FloatPoint referencePoint)
- {
- m_queryStartPosition = startPosition;
- m_queryLength = length;
- m_queryPointInput = referencePoint;
- }
-
- long longResult() const { return m_queryLongResult; }
- float floatResult() const { return m_queryFloatResult; }
- FloatPoint pointResult() const { return m_queryPointResult; }
- FloatRect rectResult() const { return m_queryRectResult; }
- bool stopProcessing() const { return m_stopProcessing; }
-
-private:
- const SVGTextContentElement* m_reference;
- QueryMode m_mode;
-
- long m_queryStartPosition;
- long m_queryLength;
- FloatPoint m_queryPointInput;
-
- long m_queryLongResult;
- float m_queryFloatResult;
- FloatPoint m_queryPointResult;
- FloatRect m_queryRectResult;
-
- bool m_stopProcessing;
- long m_atCharacter;
-};
-
-static Vector<SVGInlineTextBox*> findInlineTextBoxInTextChunks(const SVGTextContentElement* element, const Vector<SVGTextChunk>& chunks)
-{
- Vector<SVGTextChunk>::const_iterator it = chunks.begin();
- const Vector<SVGTextChunk>::const_iterator end = chunks.end();
-
- Vector<SVGInlineTextBox*> boxes;
-
- for (; it != end; ++it) {
- Vector<SVGInlineBoxCharacterRange>::const_iterator boxIt = it->boxes.begin();
- const Vector<SVGInlineBoxCharacterRange>::const_iterator boxEnd = it->boxes.end();
-
- for (; boxIt != boxEnd; ++boxIt) {
- SVGInlineTextBox* textBox = static_cast<SVGInlineTextBox*>(boxIt->box);
-
- Node* textElement = textBox->textRenderer()->parent()->node();
- ASSERT(textElement);
-
- if (textElement == element || textElement->parent() == element)
- boxes.append(textBox);
- }
- }
-
- return boxes;
-}
-
-static inline SVGRootInlineBox* rootInlineBoxForTextContentElement(const SVGTextContentElement* element)
-{
- RenderObject* object = element->renderer();
-
- if (!object || !object->isSVGText() || object->isText())
- return 0;
-
- RenderBlock* svgText = toRenderBlock(object);
-
- // Find root inline box
- SVGRootInlineBox* rootBox = static_cast<SVGRootInlineBox*>(svgText->firstRootBox());
- if (!rootBox) {
- // Layout is not sync yet!
- element->document()->updateLayoutIgnorePendingStylesheets();
- rootBox = static_cast<SVGRootInlineBox*>(svgText->firstRootBox());
- }
-
- ASSERT(rootBox);
- return rootBox;
-}
-
-static inline SVGInlineTextBoxQueryWalker executeTextQuery(const SVGTextContentElement* element, SVGInlineTextBoxQueryWalker::QueryMode mode,
- long startPosition = 0, long length = 0, FloatPoint referencePoint = FloatPoint())
-{
- SVGRootInlineBox* rootBox = rootInlineBoxForTextContentElement(element);
- if (!rootBox)
- return SVGInlineTextBoxQueryWalker(0, mode);
-
- // Find all inline text box associated with our renderer
- Vector<SVGInlineTextBox*> textBoxes = findInlineTextBoxInTextChunks(element, rootBox->svgTextChunks());
-
- // Walk text chunks to find chunks associated with our inline text box
- SVGInlineTextBoxQueryWalker walkerCallback(element, mode);
- walkerCallback.setQueryInputParameters(startPosition, length, referencePoint);
-
- SVGTextChunkWalker<SVGInlineTextBoxQueryWalker> walker(&walkerCallback, &SVGInlineTextBoxQueryWalker::chunkPortionCallback);
-
- Vector<SVGInlineTextBox*>::iterator it = textBoxes.begin();
- Vector<SVGInlineTextBox*>::iterator end = textBoxes.end();
-
- for (; it != end; ++it) {
- rootBox->walkTextChunks(&walker, *it);
-
- if (walkerCallback.stopProcessing())
- break;
- }
-
- return walkerCallback;
-}
-
unsigned SVGTextContentElement::getNumberOfChars() const
{
document()->updateLayoutIgnorePendingStylesheets();
-
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::NumberOfCharacters).longResult();
+ return SVGTextQuery(renderer()).numberOfCharacters();
}
float SVGTextContentElement::getComputedTextLength() const
{
document()->updateLayoutIgnorePendingStylesheets();
-
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::TextLength).floatResult();
+ return SVGTextQuery(renderer()).textLength();
}
float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchars, ExceptionCode& ec) const
@@ -393,7 +68,7 @@ float SVGTextContentElement::getSubStringLength(unsigned charnum, unsigned nchar
return 0.0f;
}
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::SubStringLength, charnum, nchars).floatResult();
+ return SVGTextQuery(renderer()).subStringLength(charnum, nchars);
}
FloatPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, ExceptionCode& ec) const
@@ -405,7 +80,7 @@ FloatPoint SVGTextContentElement::getStartPositionOfChar(unsigned charnum, Excep
return FloatPoint();
}
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::StartPosition, charnum).pointResult();
+ return SVGTextQuery(renderer()).startPositionOfCharacter(charnum);
}
FloatPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, ExceptionCode& ec) const
@@ -417,7 +92,7 @@ FloatPoint SVGTextContentElement::getEndPositionOfChar(unsigned charnum, Excepti
return FloatPoint();
}
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::EndPosition, charnum).pointResult();
+ return SVGTextQuery(renderer()).endPositionOfCharacter(charnum);
}
FloatRect SVGTextContentElement::getExtentOfChar(unsigned charnum, ExceptionCode& ec) const
@@ -429,7 +104,7 @@ FloatRect SVGTextContentElement::getExtentOfChar(unsigned charnum, ExceptionCode
return FloatRect();
}
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::Extent, charnum).rectResult();
+ return SVGTextQuery(renderer()).extentOfCharacter(charnum);
}
float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionCode& ec) const
@@ -441,14 +116,13 @@ float SVGTextContentElement::getRotationOfChar(unsigned charnum, ExceptionCode&
return 0.0f;
}
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::Rotation, charnum).floatResult();
+ return SVGTextQuery(renderer()).rotationOfCharacter(charnum);
}
int SVGTextContentElement::getCharNumAtPosition(const FloatPoint& point) const
{
document()->updateLayoutIgnorePendingStylesheets();
-
- return executeTextQuery(this, SVGInlineTextBoxQueryWalker::CharacterNumberAtPosition, 0.0f, 0.0f, point).longResult();
+ return SVGTextQuery(renderer()).characterNumberAtPosition(point);
}
void SVGTextContentElement::selectSubString(unsigned charnum, unsigned nchars, ExceptionCode& ec) const
diff --git a/WebCore/svg/SVGTextElement.cpp b/WebCore/svg/SVGTextElement.cpp
index f62dc68..0aba04b 100644
--- a/WebCore/svg/SVGTextElement.cpp
+++ b/WebCore/svg/SVGTextElement.cpp
@@ -132,16 +132,6 @@ void SVGTextElement::synchronizeProperty(const QualifiedName& attrName)
synchronizeTransform();
}
-void SVGTextElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
-{
- SVGTextPositioningElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
-
- if (!renderer())
- return;
-
- renderer()->setNeedsLayout(true);
-}
-
}
#endif // ENABLE(SVG)
diff --git a/WebCore/svg/SVGTextElement.h b/WebCore/svg/SVGTextElement.h
index 4c7db90..1bb8f5a 100644
--- a/WebCore/svg/SVGTextElement.h
+++ b/WebCore/svg/SVGTextElement.h
@@ -50,7 +50,6 @@ namespace WebCore {
virtual void svgAttributeChanged(const QualifiedName&);
virtual void synchronizeProperty(const QualifiedName&);
- virtual void childrenChanged(bool changedByParser = false, Node* beforeChange = 0, Node* afterChange = 0, int childCountDelta = 0);
private:
DECLARE_ANIMATED_PROPERTY(SVGTextElement, SVGNames::transformAttr, SVGTransformList*, Transform, transform)
diff --git a/WebCore/svg/animation/SMILTimeContainer.h b/WebCore/svg/animation/SMILTimeContainer.h
index e11cc6f..1e1007e 100644
--- a/WebCore/svg/animation/SMILTimeContainer.h
+++ b/WebCore/svg/animation/SMILTimeContainer.h
@@ -23,8 +23,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef SMILTimeContainer_H
-#define SMILTimeContainer_H
+#ifndef SMILTimeContainer_h
+#define SMILTimeContainer_h
#if ENABLE(SVG)
diff --git a/WebCore/svg/graphics/filters/SVGFilterBuilder.h b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
index 89d55e1..1cf583d 100644
--- a/WebCore/svg/graphics/filters/SVGFilterBuilder.h
+++ b/WebCore/svg/graphics/filters/SVGFilterBuilder.h
@@ -34,7 +34,7 @@ namespace WebCore {
class SVGFilterBuilder : public RefCounted<SVGFilterBuilder> {
public:
- SVGFilterBuilder();
+ static PassRefPtr<SVGFilterBuilder> create() { return adoptRef(new SVGFilterBuilder); }
void add(const AtomicString& id, RefPtr<FilterEffect> effect);
@@ -46,6 +46,8 @@ namespace WebCore {
void clearEffects();
private:
+ SVGFilterBuilder();
+
HashMap<AtomicString, RefPtr<FilterEffect> > m_builtinEffects;
HashMap<AtomicString, RefPtr<FilterEffect> > m_namedEffects;
diff --git a/WebCore/svg/svgtags.in b/WebCore/svg/svgtags.in
index 4ab6c5c..5d44e03 100644
--- a/WebCore/svg/svgtags.in
+++ b/WebCore/svg/svgtags.in
@@ -1,7 +1,7 @@
namespace="SVG"
namespaceURI="http://www.w3.org/2000/svg"
guardFactoryWith="ENABLE(SVG)"
-
+
a createWithNew
#if ENABLE_SVG_FONTS
altGlyph createWithNew
diff --git a/WebCore/websockets/WebSocket.idl b/WebCore/websockets/WebSocket.idl
index cc4a07b..6850d36 100644
--- a/WebCore/websockets/WebSocket.idl
+++ b/WebCore/websockets/WebSocket.idl
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,7 +33,10 @@ module websockets {
interface [
Conditional=WEB_SOCKETS,
- CustomConstructor,
+ CanBeConstructed,
+ CustomConstructFunction,
+ ConstructorParameters=1,
+ V8CustomConstructor,
EventTarget,
NoStaticTables
] WebSocket {
@@ -52,8 +56,7 @@ module websockets {
attribute EventListener onerror;
attribute EventListener onclose;
- [Custom] boolean send(in DOMString data)
- raises(DOMException);
+ [RequiresAllArguments] boolean send(in DOMString data) raises(DOMException);
void close();
// EventTarget interface
diff --git a/WebCore/websockets/WebSocketChannel.cpp b/WebCore/websockets/WebSocketChannel.cpp
index 9ca2b20..5859fd7 100644
--- a/WebCore/websockets/WebSocketChannel.cpp
+++ b/WebCore/websockets/WebSocketChannel.cpp
@@ -58,6 +58,7 @@ WebSocketChannel::WebSocketChannel(ScriptExecutionContext* context, WebSocketCha
, m_handshake(url, protocol, context)
, m_buffer(0)
, m_bufferSize(0)
+ , m_resumeTimer(this, &WebSocketChannel::resumeTimerFired)
, m_suspended(false)
, m_closed(false)
, m_unhandledBufferedAmount(0)
@@ -125,12 +126,8 @@ void WebSocketChannel::suspend()
void WebSocketChannel::resume()
{
m_suspended = false;
- RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
- while (!m_suspended && m_client && m_buffer)
- if (!processBuffer())
- break;
- if (!m_suspended && m_client && m_closed && m_handle)
- didClose(m_handle.get());
+ if ((m_buffer || m_closed) && m_client && !m_resumeTimer.isActive())
+ m_resumeTimer.startOneShot(0);
}
void WebSocketChannel::didOpen(SocketStreamHandle* handle)
@@ -234,6 +231,7 @@ bool WebSocketChannel::processBuffer()
ASSERT(!m_suspended);
ASSERT(m_client);
ASSERT(m_buffer);
+
if (m_handshake.mode() == WebSocketHandshake::Incomplete) {
int headerLength = m_handshake.readServerHandshake(m_buffer, m_bufferSize);
if (headerLength <= 0)
@@ -318,6 +316,18 @@ bool WebSocketChannel::processBuffer()
return false;
}
+void WebSocketChannel::resumeTimerFired(Timer<WebSocketChannel>* timer)
+{
+ ASSERT_UNUSED(timer, timer == &m_resumeTimer);
+
+ RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
+ while (!m_suspended && m_client && m_buffer)
+ if (!processBuffer())
+ break;
+ if (!m_suspended && m_client && m_closed && m_handle)
+ didClose(m_handle.get());
+}
+
} // namespace WebCore
#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/websockets/WebSocketChannel.h b/WebCore/websockets/WebSocketChannel.h
index 0cb411d..a90c6dc 100644
--- a/WebCore/websockets/WebSocketChannel.h
+++ b/WebCore/websockets/WebSocketChannel.h
@@ -82,6 +82,7 @@ namespace WebCore {
bool appendToBuffer(const char* data, int len);
void skipBuffer(int len);
bool processBuffer();
+ void resumeTimerFired(Timer<WebSocketChannel>* timer);
ScriptExecutionContext* m_context;
WebSocketChannelClient* m_client;
@@ -90,6 +91,7 @@ namespace WebCore {
char* m_buffer;
int m_bufferSize;
+ Timer<WebSocketChannel> m_resumeTimer;
bool m_suspended;
bool m_closed;
unsigned long m_unhandledBufferedAmount;
diff --git a/WebCore/websockets/WebSocketHandshake.cpp b/WebCore/websockets/WebSocketHandshake.cpp
index ea4f5e5..ba14732 100644
--- a/WebCore/websockets/WebSocketHandshake.cpp
+++ b/WebCore/websockets/WebSocketHandshake.cpp
@@ -35,6 +35,7 @@
#include "WebSocketHandshake.h"
#include "AtomicString.h"
+#include "CharacterNames.h"
#include "Cookie.h"
#include "CookieJar.h"
#include "Document.h"
@@ -56,28 +57,6 @@ namespace WebCore {
static const char randomCharacterInSecWebSocketKey[] = "!\"#$%&'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
-static String extractResponseCode(const char* header, int len, size_t& lineLength)
-{
- const char* space1 = 0;
- const char* space2 = 0;
- const char* p;
- lineLength = 0;
- for (p = header; p - header < len; p++, lineLength++) {
- if (*p == ' ') {
- if (!space1)
- space1 = p;
- else if (!space2)
- space2 = p;
- } else if (*p == '\n')
- break;
- }
- if (p - header == len)
- return String();
- if (!space1 || !space2)
- return "";
- return String(space1 + 1, space2 - space1 - 1);
-}
-
static String resourceName(const KURL& url)
{
String name = url.path();
@@ -102,11 +81,12 @@ static String hostName(const KURL& url, bool secure)
return builder.toString();
}
+static const size_t maxConsoleMessageSize = 128;
static String trimConsoleMessage(const char* p, size_t len)
{
- String s = String(p, std::min<size_t>(len, 128));
- if (len > 128)
- s += "...";
+ String s = String(p, std::min<size_t>(len, maxConsoleMessageSize));
+ if (len > maxConsoleMessageSize)
+ s.append(horizontalEllipsis);
return s;
}
@@ -279,17 +259,27 @@ WebSocketHandshakeRequest WebSocketHandshake::clientHandshakeRequest() const
// Keep the following consistent with clientHandshakeMessage().
// FIXME: do we need to store m_secWebSocketKey1, m_secWebSocketKey2 and
// m_key3 in WebSocketHandshakeRequest?
- WebSocketHandshakeRequest request(m_url, clientOrigin(), m_clientProtocol);
+ WebSocketHandshakeRequest request("GET", m_url);
+ request.addHeaderField("Upgrade", "WebSocket");
+ request.addHeaderField("Connection", "Upgrade");
+ request.addHeaderField("Host", hostName(m_url, m_secure));
+ request.addHeaderField("Origin", clientOrigin());
+ if (!m_clientProtocol.isEmpty())
+ request.addHeaderField("Sec-WebSocket-Protocol:", m_clientProtocol);
KURL url = httpURLForAuthenticationAndCookies();
if (m_context->isDocument()) {
Document* document = static_cast<Document*>(m_context);
String cookie = cookieRequestHeaderFieldValue(document, url);
if (!cookie.isEmpty())
- request.addExtraHeaderField("Cookie", cookie);
+ request.addHeaderField("Cookie", cookie);
// Set "Cookie2: <cookie>" if cookies 2 exists for url?
}
+ request.addHeaderField("Sec-WebSocket-Key1", m_secWebSocketKey1);
+ request.addHeaderField("Sec-WebSocket-Key2", m_secWebSocketKey2);
+ request.setKey3(m_key3);
+
return request;
}
@@ -312,21 +302,21 @@ void WebSocketHandshake::clearScriptExecutionContext()
int WebSocketHandshake::readServerHandshake(const char* header, size_t len)
{
m_mode = Incomplete;
- size_t lineLength;
- const String& code = extractResponseCode(header, len, lineLength);
- if (code.isNull()) {
- // Just hasn't been received yet.
+ int statusCode;
+ String statusText;
+ int lineLength = readStatusLine(header, len, statusCode, statusText);
+ if (lineLength == -1)
return -1;
- }
- if (code.isEmpty()) {
+ if (statusCode == -1) {
m_mode = Failed;
- m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength), 0, clientOrigin());
return len;
}
- LOG(Network, "response code: %s", code.utf8().data());
- if (code != "101") {
+ LOG(Network, "response code: %d", statusCode);
+ m_response.setStatusCode(statusCode);
+ m_response.setStatusText(statusText);
+ if (statusCode != 101) {
m_mode = Failed;
- m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Unexpected response code:" + code, 0, clientOrigin());
+ m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, String::format("Unexpected response code: %d", statusCode), 0, clientOrigin());
return len;
}
m_mode = Normal;
@@ -335,17 +325,14 @@ int WebSocketHandshake::readServerHandshake(const char* header, size_t len)
m_mode = Incomplete;
return -1;
}
- HTTPHeaderMap headers;
- const char* headerFields = strnstr(header, "\r\n", len); // skip status line
- ASSERT(headerFields);
- headerFields += 2; // skip "\r\n".
- const char* p = readHTTPHeaders(headerFields, header + len, &headers);
+ const char* p = readHTTPHeaders(header + lineLength, header + len);
if (!p) {
LOG(Network, "readHTTPHeaders failed");
m_mode = Failed;
return len;
}
- if (!processHeaders(headers) || !checkResponseHeaders()) {
+ processHeaders();
+ if (!checkResponseHeaders()) {
LOG(Network, "header process failed");
m_mode = Failed;
return p - header;
@@ -355,6 +342,7 @@ int WebSocketHandshake::readServerHandshake(const char* header, size_t len)
m_mode = Incomplete;
return -1;
}
+ m_response.setChallengeResponse(static_cast<const unsigned char*>(static_cast<const void*>(p)));
if (memcmp(p, m_expectedChallengeResponse, sizeof(m_expectedChallengeResponse))) {
m_mode = Failed;
return (p - header) + sizeof(m_expectedChallengeResponse);
@@ -418,6 +406,11 @@ void WebSocketHandshake::setServerSetCookie2(const String& setCookie2)
m_setCookie2 = setCookie2;
}
+const WebSocketHandshakeResponse& WebSocketHandshake::serverHandshakeResponse() const
+{
+ return m_response;
+}
+
KURL WebSocketHandshake::httpURLForAuthenticationAndCookies() const
{
KURL url = m_url.copy();
@@ -426,8 +419,70 @@ KURL WebSocketHandshake::httpURLForAuthenticationAndCookies() const
return url;
}
-const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* end, HTTPHeaderMap* headers)
+// Returns the header length (including "\r\n"), or -1 if we have not received enough data yet.
+// If the line is malformed or the status code is not a 3-digit number,
+// statusCode and statusText will be set to -1 and a null string, respectively.
+int WebSocketHandshake::readStatusLine(const char* header, size_t headerLength, int& statusCode, String& statusText)
{
+ statusCode = -1;
+ statusText = String();
+
+ const char* space1 = 0;
+ const char* space2 = 0;
+ const char* p;
+ size_t consumedLength;
+
+ for (p = header, consumedLength = 0; consumedLength < headerLength; p++, consumedLength++) {
+ if (*p == ' ') {
+ if (!space1)
+ space1 = p;
+ else if (!space2)
+ space2 = p;
+ } else if (*p == '\n')
+ break;
+ }
+ if (consumedLength == headerLength)
+ return -1; // We have not received '\n' yet.
+
+ const char* end = p + 1;
+ if (end - header > INT_MAX) {
+ m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line is too long: " + trimConsoleMessage(header, maxConsoleMessageSize + 1), 0, clientOrigin());
+ return INT_MAX;
+ }
+ int lineLength = end - header;
+
+ if (!space1 || !space2) {
+ m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "No response code found: " + trimConsoleMessage(header, lineLength - 1), 0, clientOrigin());
+ return lineLength;
+ }
+
+ // The line must end with "\r\n".
+ if (*(end - 2) != '\r') {
+ m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Status line does not end with CRLF", 0, clientOrigin());
+ return lineLength;
+ }
+
+ String statusCodeString(space1 + 1, space2 - space1 - 1);
+ if (statusCodeString.length() != 3) // Status code must consist of three digits.
+ return lineLength;
+ for (int i = 0; i < 3; ++i)
+ if (statusCodeString[i] < '0' || statusCodeString[i] > '9') {
+ m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Invalid status code: " + statusCodeString, 0, clientOrigin());
+ return lineLength;
+ }
+
+ bool ok = false;
+ statusCode = statusCodeString.toInt(&ok);
+ ASSERT(ok);
+
+ statusText = String(space2 + 1, end - space2 - 3); // Exclude "\r\n".
+ return lineLength;
+}
+
+const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* end)
+{
+ m_response.clearHeaderFields();
+
Vector<char> name;
Vector<char> value;
for (const char* p = start; p < end; p++) {
@@ -451,10 +506,7 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
case ':':
break;
default:
- if (*p >= 0x41 && *p <= 0x5a)
- name.append(*p + 0x20);
- else
- name.append(*p);
+ name.append(*p);
continue;
}
if (*p == ':') {
@@ -495,36 +547,21 @@ const char* WebSocketHandshake::readHTTPHeaders(const char* start, const char* e
return 0;
}
LOG(Network, "name=%s value=%s", nameStr.string().utf8().data(), valueStr.utf8().data());
- headers->add(nameStr, valueStr);
+ m_response.addHeaderField(nameStr, valueStr);
}
ASSERT_NOT_REACHED();
return 0;
}
-bool WebSocketHandshake::processHeaders(const HTTPHeaderMap& headers)
-{
- for (HTTPHeaderMap::const_iterator it = headers.begin(); it != headers.end(); ++it) {
- switch (m_mode) {
- case Normal:
- if (it->first == "sec-websocket-origin")
- m_wsOrigin = it->second;
- else if (it->first == "sec-websocket-location")
- m_wsLocation = it->second;
- else if (it->first == "sec-websocket-protocol")
- m_wsProtocol = it->second;
- else if (it->first == "set-cookie")
- m_setCookie = it->second;
- else if (it->first == "set-cookie2")
- m_setCookie2 = it->second;
- continue;
- case Incomplete:
- case Failed:
- case Connected:
- ASSERT_NOT_REACHED();
- }
- ASSERT_NOT_REACHED();
- }
- return true;
+void WebSocketHandshake::processHeaders()
+{
+ ASSERT(m_mode == Normal);
+ const HTTPHeaderMap& headers = m_response.headerFields();
+ m_wsOrigin = headers.get("sec-websocket-origin");
+ m_wsLocation = headers.get("sec-websocket-location");
+ m_wsProtocol = headers.get("sec-websocket-protocol");
+ m_setCookie = headers.get("set-cookie");
+ m_setCookie2 = headers.get("set-cookie2");
}
bool WebSocketHandshake::checkResponseHeaders()
diff --git a/WebCore/websockets/WebSocketHandshake.h b/WebCore/websockets/WebSocketHandshake.h
index 3e0c66a..a5b4260 100644
--- a/WebCore/websockets/WebSocketHandshake.h
+++ b/WebCore/websockets/WebSocketHandshake.h
@@ -36,11 +36,11 @@
#include "KURL.h"
#include "PlatformString.h"
#include "WebSocketHandshakeRequest.h"
+#include "WebSocketHandshakeResponse.h"
#include <wtf/Noncopyable.h>
namespace WebCore {
- class HTTPHeaderMap;
class ScriptExecutionContext;
class WebSocketHandshake : public Noncopyable {
@@ -86,12 +86,16 @@ namespace WebCore {
const String& serverSetCookie2() const;
void setServerSetCookie2(const String& setCookie2);
+ const WebSocketHandshakeResponse& serverHandshakeResponse() const;
+
private:
KURL httpURLForAuthenticationAndCookies() const;
+ int readStatusLine(const char* header, size_t headerLength, int& statusCode, String& statusText);
+
// Reads all headers except for the two predefined ones.
- const char* readHTTPHeaders(const char* start, const char* end, HTTPHeaderMap* headers);
- bool processHeaders(const HTTPHeaderMap& headers);
+ const char* readHTTPHeaders(const char* start, const char* end);
+ void processHeaders();
bool checkResponseHeaders();
KURL m_url;
@@ -111,6 +115,8 @@ namespace WebCore {
String m_secWebSocketKey2;
unsigned char m_key3[8];
unsigned char m_expectedChallengeResponse[16];
+
+ WebSocketHandshakeResponse m_response;
};
} // namespace WebCore
diff --git a/WebCore/websockets/WebSocketHandshakeRequest.cpp b/WebCore/websockets/WebSocketHandshakeRequest.cpp
index 9a41167..1132a44 100644
--- a/WebCore/websockets/WebSocketHandshakeRequest.cpp
+++ b/WebCore/websockets/WebSocketHandshakeRequest.cpp
@@ -34,60 +34,60 @@
#include "WebSocketHandshakeRequest.h"
-#include "AtomicString.h"
-#include "StringBuilder.h"
-#include <utility>
-#include <wtf/Assertions.h>
+#include <cstring>
using namespace std;
namespace WebCore {
-WebSocketHandshakeRequest::WebSocketHandshakeRequest(const KURL& url, const String& origin, const String& webSocketProtocol)
+WebSocketHandshakeRequest::Key3::Key3()
+{
+ memset(value, 0, sizeof(value));
+}
+
+void WebSocketHandshakeRequest::Key3::set(const unsigned char key3[8])
+{
+ memcpy(value, key3, sizeof(value));
+}
+
+WebSocketHandshakeRequest::WebSocketHandshakeRequest(const String& requestMethod, const KURL& url)
: m_url(url)
- , m_secure(m_url.protocolIs("wss"))
- , m_origin(origin)
- , m_webSocketProtocol(webSocketProtocol)
+ , m_requestMethod(requestMethod)
{
- ASSERT(!origin.isNull());
}
WebSocketHandshakeRequest::~WebSocketHandshakeRequest()
{
}
-void WebSocketHandshakeRequest::addExtraHeaderField(const AtomicString& name, const String& value)
+String WebSocketHandshakeRequest::requestMethod() const
+{
+ return m_requestMethod;
+}
+
+KURL WebSocketHandshakeRequest::url() const
+{
+ return m_url;
+}
+
+void WebSocketHandshakeRequest::addHeaderField(const char* name, const String& value)
{
- m_extraHeaderFields.append(HeaderField(name, value));
+ m_headerFields.add(name, value);
}
-void WebSocketHandshakeRequest::addExtraHeaderField(const char* name, const String& value)
+const HTTPHeaderMap& WebSocketHandshakeRequest::headerFields() const
{
- m_extraHeaderFields.append(HeaderField(name, value));
+ return m_headerFields;
}
-Vector<WebSocketHandshakeRequest::HeaderField> WebSocketHandshakeRequest::headerFields() const
+WebSocketHandshakeRequest::Key3 WebSocketHandshakeRequest::key3() const
{
- Vector<HeaderField> fields;
- fields.append(HeaderField("Upgrade", "WebSocket"));
- fields.append(HeaderField("Connection", "Upgrade"));
- fields.append(HeaderField("Host", host()));
- fields.append(HeaderField("Origin", m_origin));
- if (!m_webSocketProtocol.isEmpty())
- fields.append(HeaderField("WebSocket-Protocol", m_webSocketProtocol));
- fields.append(m_extraHeaderFields);
- return fields;
+ return m_key3;
}
-String WebSocketHandshakeRequest::host() const
+void WebSocketHandshakeRequest::setKey3(const unsigned char key3[8])
{
- StringBuilder builder;
- builder.append(m_url.host().lower());
- if ((!m_secure && m_url.port() != 80) || (m_secure && m_url.port() != 443)) {
- builder.append(":");
- builder.append(String::number(m_url.port()));
- }
- return builder.toString();
+ m_key3.set(key3);
}
} // namespace WebCore
diff --git a/WebCore/websockets/WebSocketHandshakeRequest.h b/WebCore/websockets/WebSocketHandshakeRequest.h
index d488135..792f67e 100644
--- a/WebCore/websockets/WebSocketHandshakeRequest.h
+++ b/WebCore/websockets/WebSocketHandshakeRequest.h
@@ -33,37 +33,37 @@
#if ENABLE(WEB_SOCKETS)
+#include "HTTPHeaderMap.h"
#include "KURL.h"
#include "PlatformString.h"
-#include <wtf/Vector.h>
namespace WebCore {
-class AtomicString;
-
class WebSocketHandshakeRequest {
public:
- WebSocketHandshakeRequest(const KURL&, const String& origin, const String& webSocketProtocol);
+ WebSocketHandshakeRequest(const String& requestMethod, const KURL&);
~WebSocketHandshakeRequest();
- // According to current Web Socket protocol specification, four mandatory headers (Upgrade, Connection, Host, and Origin) and
- // one optional header (WebSocket-Protocol) should be sent in this order, at the beginning of the handshake request.
- // The remaining headers can be set by using the following function.
- void addExtraHeaderField(const AtomicString& name, const String& value);
- void addExtraHeaderField(const char* name, const String& value);
+ String requestMethod() const;
+ KURL url() const;
- // Returns the list of header fields including five special ones.
- typedef std::pair<AtomicString, String> HeaderField;
- Vector<HeaderField> headerFields() const;
+ const HTTPHeaderMap& headerFields() const;
+ void addHeaderField(const char* name, const String& value);
-private:
- String host() const;
+ struct Key3 {
+ unsigned char value[8];
+ Key3();
+ void set(const unsigned char key3[8]);
+ };
+ Key3 key3() const;
+ void setKey3(const unsigned char key3[8]);
+
+private:
KURL m_url;
- bool m_secure;
- String m_origin;
- String m_webSocketProtocol;
- Vector<HeaderField> m_extraHeaderFields;
+ String m_requestMethod;
+ HTTPHeaderMap m_headerFields;
+ Key3 m_key3;
};
} // namespace WebCore
diff --git a/WebCore/websockets/WebSocketHandshakeResponse.cpp b/WebCore/websockets/WebSocketHandshakeResponse.cpp
new file mode 100644
index 0000000..753cecf
--- /dev/null
+++ b/WebCore/websockets/WebSocketHandshakeResponse.cpp
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(WEB_SOCKETS)
+
+#include "WebSocketHandshakeResponse.h"
+
+#include "AtomicString.h"
+#include <wtf/Assertions.h>
+
+using namespace std;
+
+namespace WebCore {
+
+WebSocketHandshakeResponse::ChallengeResponse::ChallengeResponse()
+{
+ memset(value, 0, sizeof(value));
+}
+
+void WebSocketHandshakeResponse::ChallengeResponse::set(const unsigned char challengeResponse[16])
+{
+ memcpy(value, challengeResponse, sizeof(value));
+}
+
+WebSocketHandshakeResponse::WebSocketHandshakeResponse()
+{
+}
+
+WebSocketHandshakeResponse::~WebSocketHandshakeResponse()
+{
+}
+
+int WebSocketHandshakeResponse::statusCode() const
+{
+ return m_statusCode;
+}
+
+void WebSocketHandshakeResponse::setStatusCode(int statusCode)
+{
+ ASSERT(statusCode >= 100 && statusCode < 600);
+ m_statusCode = statusCode;
+}
+
+const String& WebSocketHandshakeResponse::statusText() const
+{
+ return m_statusText;
+}
+
+void WebSocketHandshakeResponse::setStatusText(const String& statusText)
+{
+ m_statusText = statusText;
+}
+
+const HTTPHeaderMap& WebSocketHandshakeResponse::headerFields() const
+{
+ return m_headerFields;
+}
+
+void WebSocketHandshakeResponse::addHeaderField(const AtomicString& name, const String& value)
+{
+ m_headerFields.add(name, value);
+}
+
+void WebSocketHandshakeResponse::clearHeaderFields()
+{
+ m_headerFields.clear();
+}
+
+const WebSocketHandshakeResponse::ChallengeResponse& WebSocketHandshakeResponse::challengeResponse() const
+{
+ return m_challengeResponse;
+}
+
+void WebSocketHandshakeResponse::setChallengeResponse(const unsigned char challengeResponse[16])
+{
+ m_challengeResponse.set(challengeResponse);
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_SOCKETS)
diff --git a/WebCore/websockets/WebSocketHandshakeResponse.h b/WebCore/websockets/WebSocketHandshakeResponse.h
new file mode 100644
index 0000000..c385a1b
--- /dev/null
+++ b/WebCore/websockets/WebSocketHandshakeResponse.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 WebSocketHandshakeResponse_h
+#define WebSocketHandshakeResponse_h
+
+#if ENABLE(WEB_SOCKETS)
+
+#include "HTTPHeaderMap.h"
+#include "PlatformString.h"
+
+namespace WebCore {
+
+class AtomicString;
+
+class WebSocketHandshakeResponse {
+public:
+ WebSocketHandshakeResponse();
+ ~WebSocketHandshakeResponse();
+
+ int statusCode() const;
+ void setStatusCode(int statusCode);
+ const String& statusText() const;
+ void setStatusText(const String& statusText);
+ const HTTPHeaderMap& headerFields() const;
+ void addHeaderField(const AtomicString& name, const String& value);
+ void clearHeaderFields();
+
+ struct ChallengeResponse {
+ unsigned char value[16];
+
+ ChallengeResponse();
+ void set(const unsigned char challengeResponse[16]);
+ };
+ const ChallengeResponse& challengeResponse() const;
+ void setChallengeResponse(const unsigned char challengeResponse[16]);
+
+private:
+ int m_statusCode;
+ String m_statusText;
+ HTTPHeaderMap m_headerFields;
+ ChallengeResponse m_challengeResponse;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEB_SOCKETS)
+
+#endif // WebSocketHandshakeResponse_h
diff --git a/WebCore/wml/WMLErrorHandling.h b/WebCore/wml/WMLErrorHandling.h
index 3005803..8277be4 100644
--- a/WebCore/wml/WMLErrorHandling.h
+++ b/WebCore/wml/WMLErrorHandling.h
@@ -18,8 +18,8 @@
*
*/
-#ifndef WMLErrorCodes_h
-#define WMLErrorCodes_h
+#ifndef WMLErrorHandling_h
+#define WMLErrorHandling_h
#if ENABLE(WML)
namespace WebCore {
diff --git a/WebCore/workers/SharedWorker.idl b/WebCore/workers/SharedWorker.idl
index c04f7cf..748adc3 100644
--- a/WebCore/workers/SharedWorker.idl
+++ b/WebCore/workers/SharedWorker.idl
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -32,7 +33,10 @@ module threads {
interface [
Conditional=SHARED_WORKERS,
- CustomConstructor,
+ CanBeConstructed,
+ CustomConstructFunction,
+ ConstructorParameters=2,
+ V8CustomConstructor,
CustomMarkFunction,
GenerateNativeConverter,
GenerateToJS
diff --git a/WebCore/workers/Worker.idl b/WebCore/workers/Worker.idl
index 54d406d..e53de93 100644
--- a/WebCore/workers/Worker.idl
+++ b/WebCore/workers/Worker.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,7 +28,10 @@ module threads {
interface [
Conditional=WORKERS,
- CustomConstructor,
+ CanBeConstructed,
+ CustomConstructFunction,
+ ConstructorParameters=1,
+ V8CustomConstructor,
GenerateNativeConverter,
GenerateToJS
] Worker : AbstractWorker {
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index bf893d2..c710ba6 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -31,11 +31,14 @@
#include "WorkerContext.h"
+#include "AbstractDatabase.h"
#include "ActiveDOMObject.h"
+#include "Database.h"
+#include "DatabaseCallback.h"
+#include "DatabaseSync.h"
#include "DatabaseTracker.h"
#include "DOMTimer.h"
#include "DOMWindow.h"
-#include "Database.h"
#include "ErrorEvent.h"
#include "Event.h"
#include "EventException.h"
@@ -271,7 +274,7 @@ NotificationCenter* WorkerContext::webkitNotifications() const
#if ENABLE(DATABASE)
PassRefPtr<Database> WorkerContext::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
{
- if (!securityOrigin()->canAccessDatabase() || !Database::isAvailable()) {
+ if (!securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) {
ec = SECURITY_ERR;
return 0;
}
@@ -290,15 +293,11 @@ void WorkerContext::databaseExceededQuota(const String&)
PassRefPtr<DatabaseSync> WorkerContext::openDatabaseSync(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
{
- if (!securityOrigin()->canAccessDatabase()) {
+ if (!securityOrigin()->canAccessDatabase() || !AbstractDatabase::isAvailable()) {
ec = SECURITY_ERR;
return 0;
}
- ASSERT(DatabaseSync::isAvailable());
- if (!DatabaseSync::isAvailable())
- return 0;
-
return DatabaseSync::openDatabaseSync(this, name, version, displayName, estimatedSize, creationCallback, ec);
}
#endif
diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h
index d05329e..4091db1 100644
--- a/WebCore/workers/WorkerContext.h
+++ b/WebCore/workers/WorkerContext.h
@@ -30,9 +30,6 @@
#if ENABLE(WORKERS)
#include "AtomicStringHash.h"
-#include "Database.h"
-#include "DatabaseSync.h"
-#include "DatabaseCallback.h"
#include "EventListener.h"
#include "EventNames.h"
#include "EventTarget.h"
@@ -47,6 +44,8 @@
namespace WebCore {
class Database;
+ class DatabaseCallback;
+ class DatabaseSync;
class NotificationCenter;
class ScheduledAction;
class WorkerLocation;
diff --git a/WebCore/xml/DOMParser.cpp b/WebCore/xml/DOMParser.cpp
index 448dcb1..7e04be7 100644
--- a/WebCore/xml/DOMParser.cpp
+++ b/WebCore/xml/DOMParser.cpp
@@ -29,7 +29,7 @@ PassRefPtr<Document> DOMParser::parseFromString(const String& str, const String&
if (!DOMImplementation::isXMLMIMEType(contentType))
return 0;
- RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, false);
+ RefPtr<Document> doc = DOMImplementation::createDocument(contentType, 0, KURL(), false);
doc->open();
doc->write(str);
diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 831ada9..da95d32 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -240,9 +240,8 @@ Document* XMLHttpRequest::responseXML() const
// The W3C spec requires this.
m_responseXML = 0;
} else {
- m_responseXML = Document::create(0);
+ m_responseXML = Document::create(0, m_url);
m_responseXML->open();
- m_responseXML->setURL(m_url);
// FIXME: Set Last-Modified.
m_responseXML->write(String(m_responseText));
m_responseXML->finishParsing();
@@ -512,11 +511,11 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
// The presence of upload event listeners forces us to use preflighting because POSTing to an URL that does not
// permit cross origin requests should look exactly like POSTing to an URL that does not respond at all.
// Also, only async requests support upload progress events.
- bool forcePreflight = false;
+ bool uploadEvents = false;
if (m_async) {
m_progressEventThrottle.dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
if (m_requestEntityBody && m_upload) {
- forcePreflight = m_upload->hasEventListeners();
+ uploadEvents = m_upload->hasEventListeners();
m_upload->dispatchEvent(XMLHttpRequestProgressEvent::create(eventNames().loadstartEvent));
}
}
@@ -525,7 +524,7 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
// We also remember whether upload events should be allowed for this request in case the upload listeners are
// added after the request is started.
- m_uploadEventsAllowed = m_sameOriginRequest || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders);
+ m_uploadEventsAllowed = m_sameOriginRequest || uploadEvents || !isSimpleCrossOriginAccessRequest(m_method, m_requestHeaders);
ResourceRequest request(m_url);
request.setHTTPMethod(m_method);
@@ -542,7 +541,7 @@ void XMLHttpRequest::createRequest(ExceptionCode& ec)
ThreadableLoaderOptions options;
options.sendLoadCallbacks = true;
options.sniffContent = false;
- options.forcePreflight = forcePreflight;
+ options.forcePreflight = uploadEvents;
options.allowCredentials = m_sameOriginRequest || m_includeCredentials;
options.crossOriginRequestPolicy = UseAccessControl;
@@ -900,7 +899,7 @@ void XMLHttpRequest::didFinishLoading(unsigned long identifier)
#if ENABLE(INSPECTOR)
if (InspectorController* inspector = scriptExecutionContext()->inspectorController())
- inspector->resourceRetrievedByXMLHttpRequest(identifier, m_responseText);
+ inspector->resourceRetrievedByXMLHttpRequest(identifier, m_responseText, m_url, m_lastSendURL, m_lastSendLineNumber);
#endif
bool hadLoader = m_loader;
diff --git a/WebCore/xml/XSLTProcessor.cpp b/WebCore/xml/XSLTProcessor.cpp
index 97b5466..61f414e 100644
--- a/WebCore/xml/XSLTProcessor.cpp
+++ b/WebCore/xml/XSLTProcessor.cpp
@@ -33,13 +33,12 @@
#include "FrameLoader.h"
#include "FrameView.h"
#include "HTMLDocument.h"
-#include "HTMLDocumentParser.h" // for parseHTMLDocumentFragment
#include "Page.h"
#include "Text.h"
#include "TextResourceDecoder.h"
-#include "XMLDocumentParser.h"
#include "loader.h"
#include "markup.h"
+
#include <wtf/Assertions.h>
#include <wtf/Vector.h>
@@ -69,10 +68,10 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
RefPtr<Document> result;
if (sourceMIMEType == "text/plain") {
- result = Document::create(frame);
+ result = Document::create(frame, sourceIsDocument ? ownerDocument->url() : KURL());
transformTextStringToXHTMLDocumentString(documentSource);
} else
- result = DOMImplementation::createDocument(sourceMIMEType, frame, false);
+ result = DOMImplementation::createDocument(sourceMIMEType, frame, sourceIsDocument ? ownerDocument->url() : KURL(), false);
// Before parsing, we need to save & detach the old document and get the new document
// in place. We have to do this only if we're rendering the result document.
@@ -83,8 +82,6 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
frame->setDocument(result);
}
- if (sourceIsDocument)
- result->setURL(ownerDocument->url());
result->open();
RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIMEType);
@@ -100,14 +97,14 @@ PassRefPtr<Document> XSLTProcessor::createDocumentFromSource(const String& sourc
static inline RefPtr<DocumentFragment> createFragmentFromSource(const String& sourceString, const String& sourceMIMEType, Document* outputDoc)
{
- RefPtr<DocumentFragment> fragment = DocumentFragment::create(outputDoc);
+ RefPtr<DocumentFragment> fragment = outputDoc->createDocumentFragment();
if (sourceMIMEType == "text/html")
- parseHTMLDocumentFragment(sourceString, fragment.get());
+ fragment->parseHTML(sourceString);
else if (sourceMIMEType == "text/plain")
fragment->addChild(Text::create(outputDoc, sourceString));
else {
- bool successfulParse = parseXMLDocumentFragment(sourceString, fragment.get(), outputDoc->documentElement());
+ bool successfulParse = fragment->parseXML(sourceString, outputDoc->documentElement());
if (!successfulParse)
return 0;
}
diff --git a/WebCore/xml/XSLTProcessor.idl b/WebCore/xml/XSLTProcessor.idl
index 28bd878..dac4b21 100644
--- a/WebCore/xml/XSLTProcessor.idl
+++ b/WebCore/xml/XSLTProcessor.idl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,7 +34,9 @@ module xml {
interface [
Conditional=XSLT,
- CustomConstructor
+ CanBeConstructed,
+ CustomConstructFunction,
+ V8CustomConstructor
] XSLTProcessor {
[Custom] void importStylesheet(in Node stylesheet);
diff --git a/WebKit/CMakeListsEfl.txt b/WebKit/CMakeListsEfl.txt
index cbc0d92..7eeddeb 100644
--- a/WebKit/CMakeListsEfl.txt
+++ b/WebKit/CMakeListsEfl.txt
@@ -39,6 +39,7 @@ LIST(APPEND WebKit_SOURCES
efl/ewk/ewk_util.cpp
efl/ewk/ewk_view.cpp
efl/ewk/ewk_view_single.c
+ efl/ewk/ewk_window_features.cpp
)
LIST(APPEND WebKit_LIBRARIES
@@ -95,6 +96,12 @@ ADD_EXECUTABLE(../Programs/EWebLauncher ${EWebLauncher_SOURCES})
TARGET_LINK_LIBRARIES(../Programs/EWebLauncher ${EWebLauncher_LIBRARIES})
ADD_TARGET_PROPERTIES(../Programs/EWebLauncher LINK_FLAGS ${EWebLauncher_LINK_FLAGS})
+IF (SHARED_CORE)
+ SET(LIBS_PRIVATE "-l${WTF_LIBRARY_NAME} -l${JavaScriptCore_LIBRARY_NAME} -l${WebCore_LIBRARY_NAME}")
+ELSE ()
+ SET(LIBS_PRIVATE "")
+ENDIF ()
+
CONFIGURE_FILE(
efl/ewebkit.pc.in
${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc
@@ -102,6 +109,8 @@ CONFIGURE_FILE(
INSTALL(FILES ${CMAKE_BINARY_DIR}/WebKit/efl/ewebkit.pc
DESTINATION lib/pkgconfig)
+UNSET(LIBS_PRIVATE)
+
FILE(GLOB EWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/*.h")
LIST(REMOVE_ITEM EWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/efl/ewk/ewk_private.h")
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 77dc9cf..fc1195b 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,184 @@
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Stop frame loaders when deleting view.
+ Frame loaders were still alive after view is deleted, causing
+ segmentation fault when libsoup had something to deliver yet.
+ https://bugs.webkit.org/show_bug.cgi?id=41007
+
+ * efl/ewk/ewk_view.cpp:
+ (_ewk_view_smart_del): stop loaders.
+
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Fix warnings about printf format
+ When printing uint64_t the macro PRIu64 is needed in order to be
+ portable across 32 and 64 bits. It was previously showing warning
+ messages on 32-bits systems.
+ https://bugs.webkit.org/show_bug.cgi?id=40965
+
+ * efl/ewk/ewk_view.cpp:
+ (ewk_view_exceeded_database_quota):
+
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Do not load error message for download and cancellation.
+ When a download is made or a request is cancelled an error page should
+ not be shown.
+ https://bugs.webkit.org/show_bug.cgi?id=40956
+
+ * efl/WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchDidFailLoading): return if it
+ should not fallback.
+ (WebCore::FrameLoaderClientEfl::dispatchDidFailLoad): return if it
+ should not fallback.
+ (WebCore::FrameLoaderClientEfl::interruptForPolicyChangeError): fix
+ typo in related error message.
+ (WebCore::FrameLoaderClientEfl::shouldFallBack): if user cancelled the
+ request or the policy changed (for example, because the request is a
+ download) then it should not fallback.
+
+2010-06-25 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [EFL] Implement runOpenPanel method. The interface with browser was
+ already implemented. Now we are actually calling it.
+ https://bugs.webkit.org/show_bug.cgi?id=40923
+
+ * efl/WebCoreSupport/ChromeClientEfl.cpp:
+ (WebCore::ChromeClientEfl::runOpenPanel): implement method.
+ * efl/ewk/ewk_private.h: export to WebCoreSupport the needed method
+
+2010-06-24 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Full-screened content doesn't keep the display on: Safari not grabbing a power assertion?
+ https://bugs.webkit.org/show_bug.cgi?id=40939
+ rdar://problem/7996172
+
+ Add IOKit.framework to the list of linked frameworks.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2010-06-23 Leandro Pereira <leandro@profusion.mobi>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [EFL] Add Libs.private to ewebkit.pc when building with SHARED_CORE.
+ https://bugs.webkit.org/show_bug.cgi?id=40862
+
+ * CMakeListsEfl.txt:
+ * efl/ewebkit.pc.in:
+
+2010-06-23 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ Add implementaion of new windows for EFL port. Both cases of a link
+ with target="_blank" and a javascript that does window.open() are
+ treated, delegating to browser the role of actually creating the
+ window (or blocking it).
+ https://bugs.webkit.org/show_bug.cgi?id=40930
+
+ * CMakeListsEfl.txt: add new file that wraps the WindowFeatures struct
+ * efl/WebCoreSupport/ChromeClientEfl.cpp:
+ (WebCore::ChromeClientEfl::createWindow): implement method for
+ creating new window by delegating to browser its creation. Browser
+ might decide to continue on the same window by returning the same
+ view object.
+ * efl/WebCoreSupport/FrameLoaderClientEfl.cpp:
+ (WebCore::FrameLoaderClientEfl::dispatchCreatePage): implement method
+ for creating new window when its creation is done by a javascript
+ script.
+ * efl/ewk/EWebKit.h: new header for WindowFeatures.
+ * efl/ewk/ewk_private.h:
+ * efl/ewk/ewk_view.cpp:
+ (ewk_view_window_create): call the method implemented by browser.
+ * efl/ewk/ewk_view.h:
+ * efl/ewk/ewk_window_features.cpp: Added.
+ (ewk_window_features_unref):
+ (ewk_window_features_ref):
+ (ewk_window_features_bool_property_get):
+ (ewk_window_features_int_property_get):
+ (ewk_window_features_new_from_core): create and wrapped struct
+ containing the core struct.
+ * efl/ewk/ewk_window_features.h: Added.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Rename WebPluginPackage.m to make it an Objective-C++ file.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Make WebCoreSystemInterface.h a C++ only header
+ https://bugs.webkit.org/show_bug.cgi?id=40867
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add stubbed out WebPlatformStrategies class to WebKit.
+ https://bugs.webkit.org/show_bug.cgi?id=40851
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2010-06-18 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [qt] Better check for the declarative plugin inclusion.
+
+ * WebKit.pro:
+
+2010-06-17 Lucas De Marchi <lucas.demarchi@profusion.mobi>
+
+ Reviewed by Eric Seidel.
+
+ Clean EFL header files in order to diminish the compilation time with
+ EFL from subversion. We remove the EFL includes from header files and use
+ forward declarations, including the headers in correspondent source
+ files when needed. This causes only the needed source files to be
+ recompiled in case a new version of EFL is installed instead of
+ triggering a recompilation of almost all WebCore/WebKit.
+ https://bugs.webkit.org/show_bug.cgi?id=40575
+
+ * efl/WebCoreSupport/ChromeClientEfl.cpp: include needed header.
+ * efl/WebCoreSupport/ChromeClientEfl.h: forward declaration.
+ * efl/WebCoreSupport/EditorClientEfl.h: forward declaration.
+
+2010-06-15 Gustavo Noronha Silva <gns@gnome.org>
+
+ Unreviewed EFL build fix. Simple typo.
+
+ * efl/WebCoreSupport/InspectorClientEfl.cpp:
+ (WebCore::InspectorClientEfl::sendMessageToFrontend):
+
+2010-06-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Chromium shouldn't build inside the source directory
+ https://bugs.webkit.org/show_bug.cgi?id=40489
+
+ Ignore directories fetched by chromium and chromium mac output dir.
+
+ * chromium: Added property svn:ignore.
+
2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/WebKit.xcodeproj/project.pbxproj b/WebKit/WebKit.xcodeproj/project.pbxproj
index 2972a3d..66d2cd3 100644
--- a/WebKit/WebKit.xcodeproj/project.pbxproj
+++ b/WebKit/WebKit.xcodeproj/project.pbxproj
@@ -42,6 +42,8 @@
1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */; };
1A8DED500EE88B8A00F25022 /* HostedNetscapePluginStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */; };
1A8DED510EE88B8A00F25022 /* HostedNetscapePluginStream.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */; };
+ 1AA879B611CBE9BF003C664F /* WebPlatformStrategies.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */; };
+ 1AA879B711CBE9BF003C664F /* WebPlatformStrategies.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */; };
1AAF58940EDCCF15008D883D /* WebKitPluginAgent.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */; settings = {ATTRIBUTES = (Private, ); }; };
1AAF58950EDCCF15008D883D /* WebKitPluginAgentReply.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */; settings = {ATTRIBUTES = (Private, ); }; };
1AAF58960EDCCF15008D883D /* WebKitPluginClient.defs in Headers */ = {isa = PBXBuildFile; fileRef = 1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -262,7 +264,7 @@
939810D60824BF01008DF038 /* WebNetscapePluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F7171F0288493C018635CA /* WebNetscapePluginPackage.mm */; };
939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8467275D0367158500CA2ACA /* WebPluginController.mm */; };
939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717210288493C018635CA /* WebPluginDatabase.mm */; };
- 939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.m */; };
+ 939810DC0824BF01008DF038 /* WebPluginPackage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83E4AF4C036659440000E506 /* WebPluginPackage.mm */; };
939810DD0824BF01008DF038 /* npapi.mm in Sources */ = {isa = PBXBuildFile; fileRef = F5F717230288493C018635CA /* npapi.mm */; };
939810E30824BF01008DF038 /* WebImageRendererFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 9CE1F8A302A5C6F30ECA2ACD /* WebImageRendererFactory.m */; };
939810E40824BF01008DF038 /* WebJavaScriptTextInputPanel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9345D4EB0365C5B2008635CE /* WebJavaScriptTextInputPanel.m */; };
@@ -309,7 +311,7 @@
9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F738C9EA03FAD3DF0321FBE0 /* WebCore.framework */; };
9398112E0824BF01008DF038 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 93D623DD051E791F002F47DD /* libicucore.dylib */; };
9398112F0824BF01008DF038 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830E81E005853AC000AD0891 /* Security.framework */; };
- 93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.m */; };
+ 93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */; };
93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = 93EB178E09F88D510091F8FF /* WebSystemInterface.h */; };
93FDE9330D79CAF30074F029 /* WebHistoryInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */; };
A70936AF0B5608DC00CDB48E /* WebDragClient.h in Headers */ = {isa = PBXBuildFile; fileRef = A70936AD0B5608DC00CDB48E /* WebDragClient.h */; };
@@ -340,6 +342,7 @@
C0B88E8B10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */ = {isa = PBXBuildFile; fileRef = C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */; settings = {ATTRIBUTES = (Private, ); }; };
C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */; };
+ CD8EAC7311CAC9A300774075 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD8EAC7211CAC9A300774075 /* IOKit.framework */; };
DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */; };
DD89682009AA87240097E7F0 /* WebElementDictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = DD89681E09AA87240097E7F0 /* WebElementDictionary.h */; };
DD89682109AA87240097E7F0 /* WebElementDictionary.mm in Sources */ = {isa = PBXBuildFile; fileRef = DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */; };
@@ -392,6 +395,8 @@
1A77B02D0EE7730500C8A1F9 /* WebPluginRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginRequest.m; sourceTree = "<group>"; };
1A8DED4E0EE88B8A00F25022 /* HostedNetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HostedNetscapePluginStream.h; sourceTree = "<group>"; };
1A8DED4F0EE88B8A00F25022 /* HostedNetscapePluginStream.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HostedNetscapePluginStream.mm; sourceTree = "<group>"; };
+ 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPlatformStrategies.h; sourceTree = "<group>"; };
+ 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPlatformStrategies.mm; sourceTree = "<group>"; };
1AAF588A0EDCCEA3008D883D /* WebKitPluginAgent.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgent.defs; sourceTree = "<group>"; };
1AAF588B0EDCCEA3008D883D /* WebKitPluginAgentReply.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginAgentReply.defs; sourceTree = "<group>"; };
1AAF588C0EDCCEA3008D883D /* WebKitPluginClient.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = WebKitPluginClient.defs; sourceTree = "<group>"; };
@@ -546,7 +551,7 @@
83E4AF46036652150000E506 /* WebBasePluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebBasePluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
83E4AF47036652150000E506 /* WebBasePluginPackage.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebBasePluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
83E4AF4B036659440000E506 /* WebPluginPackage.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginPackage.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
- 83E4AF4C036659440000E506 /* WebPluginPackage.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPluginPackage.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 83E4AF4C036659440000E506 /* WebPluginPackage.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPluginPackage.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPluginViewFactoryPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
84311A1205EAAAF00088EDA4 /* WebResource.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResource.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
84311A1305EAAAF00088EDA4 /* WebResource.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebResource.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -592,7 +597,7 @@
93C6F14507920B93002449CD /* WebFrameViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93D1FE13067EB10B009CE68A /* WebNSObjectExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebNSObjectExtras.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93D623DD051E791F002F47DD /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
- 93EB178C09F88D460091F8FF /* WebSystemInterface.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebSystemInterface.m; sourceTree = "<group>"; };
+ 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSystemInterface.mm; sourceTree = "<group>"; };
93EB178E09F88D510091F8FF /* WebSystemInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemInterface.h; sourceTree = "<group>"; };
93FDE9320D79CAF30074F029 /* WebHistoryInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryInternal.h; sourceTree = "<group>"; };
9CAE9D070252A4130ECA16EA /* WebPreferencesPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPreferencesPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -638,6 +643,7 @@
C0B88E8A10A08F3D00FBB3F5 /* WebFrameLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoadDelegatePrivate.h; sourceTree = "<group>"; };
C0C5B3EC1177A4A0002B0AEF /* WebUserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentURLPattern.h; sourceTree = "<group>"; };
C0C5B3ED1177A4A0002B0AEF /* WebUserContentURLPattern.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebUserContentURLPattern.mm; sourceTree = "<group>"; };
+ CD8EAC7211CAC9A300774075 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebTypesInternal.h; sourceTree = "<group>"; };
DD89681E09AA87240097E7F0 /* WebElementDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebElementDictionary.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
DD89681F09AA87240097E7F0 /* WebElementDictionary.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebElementDictionary.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
@@ -726,6 +732,7 @@
1A20D08B0ED384F20043FA9F /* QuartzCore.framework in Frameworks */,
9398112F0824BF01008DF038 /* Security.framework in Frameworks */,
9398112C0824BF01008DF038 /* WebCore.framework in Frameworks */,
+ CD8EAC7311CAC9A300774075 /* IOKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -771,6 +778,7 @@
0867D69AFE84028FC02AAC07 /* Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
+ CD8EAC7211CAC9A300774075 /* IOKit.framework */,
F5C2869402846DCD018635CA /* Carbon.framework */,
F5C2869502846DCD018635CA /* Cocoa.framework */,
F738C9E903FAD3DF0321FBE0 /* JavaScriptCore.framework */,
@@ -1081,7 +1089,7 @@
8467275C0367158500CA2ACA /* WebPluginController.h */,
8467275D0367158500CA2ACA /* WebPluginController.mm */,
83E4AF4B036659440000E506 /* WebPluginPackage.h */,
- 83E4AF4C036659440000E506 /* WebPluginPackage.m */,
+ 83E4AF4C036659440000E506 /* WebPluginPackage.mm */,
225F881409F97E8A00423A40 /* WebPluginPrivate.h */,
848DFF860365FE6A00CA2ACA /* WebPluginViewFactory.h */,
83E679780726D7CF006C7A36 /* WebPluginViewFactoryPrivate.h */,
@@ -1242,10 +1250,12 @@
84723BE4056D719E0044BFEA /* WebKeyGenerator.m */,
A7D3C5BA0B5773C5002CA450 /* WebPasteboardHelper.h */,
A7D3C5BB0B5773C5002CA450 /* WebPasteboardHelper.mm */,
+ 1AA879B411CBE9BF003C664F /* WebPlatformStrategies.h */,
+ 1AA879B511CBE9BF003C664F /* WebPlatformStrategies.mm */,
0A2D87FB107AF52B00CDDEE3 /* WebPluginHalterClient.h */,
0A2D87FC107AF52B00CDDEE3 /* WebPluginHalterClient.mm */,
93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
- 93EB178C09F88D460091F8FF /* WebSystemInterface.m */,
+ 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */,
F5F7174C02885C5B018635CA /* WebViewFactory.h */,
F5F7174D02885C5B018635CA /* WebViewFactory.mm */,
);
@@ -1539,6 +1549,7 @@
0FD3B0F81076C3F700039B96 /* WebWindowAnimation.h in Headers */,
41F4484F10338E8C0030E55E /* WebWorkersPrivate.h in Headers */,
C0C5B3EE1177A4A0002B0AEF /* WebUserContentURLPattern.h in Headers */,
+ 1AA879B611CBE9BF003C664F /* WebPlatformStrategies.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1869,7 +1880,7 @@
939810DA0824BF01008DF038 /* WebPluginController.mm in Sources */,
939810DB0824BF01008DF038 /* WebPluginDatabase.mm in Sources */,
0A2D87FE107AF52B00CDDEE3 /* WebPluginHalterClient.mm in Sources */,
- 939810DC0824BF01008DF038 /* WebPluginPackage.m in Sources */,
+ 939810DC0824BF01008DF038 /* WebPluginPackage.mm in Sources */,
1A77B02F0EE7730500C8A1F9 /* WebPluginRequest.m in Sources */,
224100F90918190100D2D266 /* WebPluginsPrivate.m in Sources */,
939811080824BF01008DF038 /* WebPolicyDelegate.mm in Sources */,
@@ -1882,7 +1893,7 @@
51079D170CED11B00077247D /* WebSecurityOrigin.mm in Sources */,
BC26C6A510B7447A00B687ED /* WebSerializedJSValue.mm in Sources */,
939810CC0824BF01008DF038 /* WebStringTruncator.mm in Sources */,
- 93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */,
+ 93EB178D09F88D460091F8FF /* WebSystemInterface.mm in Sources */,
936A2DE80FD2D08000D312DB /* WebTextCompletionController.mm in Sources */,
1A74A28F0F4F75400082E228 /* WebTextInputWindowController.m in Sources */,
F834AAD80E64B1C700E2737C /* WebTextIterator.mm in Sources */,
@@ -1896,6 +1907,7 @@
0FD3B0F91076C3F700039B96 /* WebWindowAnimation.m in Sources */,
41F4485010338E8C0030E55E /* WebWorkersPrivate.mm in Sources */,
C0C5B3EF1177A4A0002B0AEF /* WebUserContentURLPattern.mm in Sources */,
+ 1AA879B711CBE9BF003C664F /* WebPlatformStrategies.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 452c79d..2a56d9d 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,826 @@
+2010-06-25 Lei Zheng <lzheng@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Add a flag to the ResourceResponse for tracking if a request was fetched
+ when Alternate-Protocol is available.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41001
+
+ * public/WebURLResponse.h:
+ * src/WebURLResponse.cpp:
+ (WebKit::WebURLResponse::wasAlternateProtocolAvailable):
+ (WebKit::WebURLResponse::setWasAlternateProtocolAvailable):
+
+2010-06-25 Michael Nordman <michaeln@google.com>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Additional API to pass additional info needed for AppCache progress events.
+ https://bugs.webkit.org/show_bug.cgi?id=37602
+
+ Also, delete an obsolete method from the worker API.
+
+ * public/WebApplicationCacheHostClient.h: define a new method
+ * public/WebSharedWorker.h: remove an obsolte method
+ * src/ApplicationCacheHostInternal.h: implement the new method
+ (WebCore::ApplicationCacheHostInternal::notifyProgressEventListener):
+
+2010-06-25 John Gregg <johnnyg@google.com>
+
+ Reviewed by Darin Fisher.
+
+ Notification should expose ltr/rtl as TextDirection, not String
+ https://bugs.webkit.org/show_bug.cgi?id=40871
+
+ * public/WebNotification.h:
+ * src/WebNotification.cpp:
+ (WebKit::WebNotification::direction):
+
+2010-06-24 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Clean up and document DocumentWriter::replaceDocument code path
+ https://bugs.webkit.org/show_bug.cgi?id=41182
+
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::loadJavaScriptURL):
+ - Make Chromium use DocumentWriter like it should.
+
+2010-06-24 Vangelis Kokkevis <vangelis@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] A WebView can now own a GLES2Context which gets created on
+ demand. This context will typically be created for the gpu compositor
+ and used as a parent context for any elements on the page that use the
+ gpu for rendering (e.g. WebGL) and need to pass their backbuffer directly
+ to the compositor.
+ https://bugs.webkit.org/show_bug.cgi?id=41010
+
+ * public/WebGLES2Context.h:
+ * src/GLES2Context.cpp:
+ (WebCore::GLES2ContextInternal::getWebGLES2Context):
+ (WebCore::GLES2ContextInternal::initialize):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::gles2Context):
+ * src/WebViewImpl.h:
+
+2010-06-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Inspector cleanup + better DevTools alignment with Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41094
+
+ - Merged InspectorClient implementation into WebDevToolsAgent
+ - Changed the way WebDevToolsAgent is initialized (will break chromium bot, needs coordinated landing)
+ - Removed a lot of legacy code from WebDevToolsAgentImpl
+ - Removed a lot of overrides from DevTools.js
+ - Simplified devtools stubs
+ - Got rid of all logic from within InjectDispatch.js
+
+ * public/WebView.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad):
+ * src/InspectorClientImpl.cpp:
+ (WebKit::InspectorClientImpl::inspectorDestroyed):
+ (WebKit::InspectorClientImpl::openInspectorFrontend):
+ (WebKit::InspectorClientImpl::highlight):
+ (WebKit::InspectorClientImpl::hideHighlight):
+ (WebKit::InspectorClientImpl::populateSetting):
+ (WebKit::InspectorClientImpl::storeSetting):
+ (WebKit::InspectorClientImpl::sendMessageToFrontend):
+ (WebKit::InspectorClientImpl::resourceTrackingWasEnabled):
+ (WebKit::InspectorClientImpl::resourceTrackingWasDisabled):
+ (WebKit::InspectorClientImpl::timelineProfilerWasStarted):
+ (WebKit::InspectorClientImpl::timelineProfilerWasStopped):
+ (WebKit::InspectorClientImpl::devToolsAgent):
+ * src/InspectorClientImpl.h:
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::inspectedURLChanged):
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::):
+ (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost):
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+ (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient):
+ (WebKit::WebDevToolsAgentImpl::inspectorDestroyed):
+ (WebKit::WebDevToolsAgentImpl::openInspectorFrontend):
+ (WebKit::WebDevToolsAgentImpl::highlight):
+ (WebKit::WebDevToolsAgentImpl::hideHighlight):
+ (WebKit::WebDevToolsAgentImpl::populateSetting):
+ (WebKit::WebDevToolsAgentImpl::storeSetting):
+ (WebKit::WebDevToolsAgentImpl::sendMessageToFrontend):
+ (WebKit::WebDevToolsAgentImpl::resourceTrackingWasEnabled):
+ (WebKit::WebDevToolsAgentImpl::resourceTrackingWasDisabled):
+ (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStarted):
+ (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStopped):
+ * src/WebDevToolsAgentImpl.h:
+ * src/WebDevToolsAgentPrivate.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::create):
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+ * src/js/DevTools.js:
+ (devtools.ToolsAgent):
+ ():
+ (devtools):
+ * src/js/DevToolsHostStub.js:
+ (.window.setDebuggerScriptSource):
+ (.window.dispatchOnInjectedScript):
+ * src/js/InjectDispatch.js:
+ (dispatch):
+ * src/js/InspectorControllerImpl.js:
+
+2010-06-24 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: revert 61766.
+
+ * WebKit.gyp:
+ * public/WebView.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad):
+ * src/InspectorClientImpl.cpp: Added.
+ (WebKit::InspectorClientImpl::InspectorClientImpl):
+ (WebKit::InspectorClientImpl::~InspectorClientImpl):
+ (WebKit::InspectorClientImpl::inspectorDestroyed):
+ (WebKit::InspectorClientImpl::openInspectorFrontend):
+ (WebKit::invalidateNodeBoundingRect):
+ (WebKit::InspectorClientImpl::highlight):
+ (WebKit::InspectorClientImpl::hideHighlight):
+ (WebKit::InspectorClientImpl::populateSetting):
+ (WebKit::InspectorClientImpl::storeSetting):
+ (WebKit::InspectorClientImpl::sendMessageToFrontend):
+ * src/InspectorClientImpl.h: Added.
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::inspectedURLChanged):
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::):
+ (WebKit::WebDevToolsAgentImpl::didCommitProvisionalLoad):
+ (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost):
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+ (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient):
+ (WebKit::WebDevToolsAgentImpl::jsDispatchToApu):
+ (WebKit::WebDevToolsAgentImpl::jsEvaluateOnSelf):
+ (WebKit::WebDevToolsAgentImpl::jsOnRuntimeFeatureStateChanged):
+ * src/WebDevToolsAgentImpl.h:
+ * src/WebDevToolsAgentPrivate.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::create):
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::setDevToolsAgent):
+ * src/WebViewImpl.h:
+ * src/WebWorkerBase.cpp:
+ (WebKit::WebWorkerBase::initializeLoader):
+ * src/js/DevTools.js:
+ (devtools.ToolsAgent):
+ (devtools.ToolsAgent.prototype.frameNavigate_):
+ ():
+ * src/js/DevToolsHostStub.js:
+ (.RemoteDebuggerAgentStub):
+ (.RemoteDebuggerAgentStub.prototype.getContextId):
+ (.RemoteDebuggerAgentStub.prototype.processDebugCommands):
+ (.RemoteProfilerAgentStub):
+ (.RemoteProfilerAgentStub.prototype.getActiveProfilerModules):
+ (.RemoteProfilerAgentStub.prototype.getLogLines):
+ (.RemoteToolsAgentStub):
+ (.RemoteToolsAgentStub.prototype.dispatchOnInjectedScript):
+ (.RemoteToolsAgentStub.prototype.dispatchOnInspectorController):
+ (.ProfilerStubHelper):
+ (.ProfilerStubHelper.GetInstance):
+ (.ProfilerStubHelper.prototype.StopProfiling):
+ (.ProfilerStubHelper.prototype.StartProfiling):
+ (.ProfilerStubHelper.prototype.getActiveProfilerModules):
+ (.ProfilerStubHelper.prototype.getLogLines):
+ (.RemoteDebuggerCommandExecutorStub):
+ (.RemoteDebuggerCommandExecutorStub.prototype.DebuggerCommand):
+ (.RemoteDebuggerCommandExecutorStub.prototype.DebuggerPauseScript):
+ (.RemoteDebuggerCommandExecutorStub.prototype.sendResponse_):
+ (.DevToolsHostStub):
+ (.DevToolsHostStub.prototype.reset):
+ (.DevToolsHostStub.prototype.setting):
+ (.DevToolsHostStub.prototype.setSetting):
+ * src/js/InjectDispatch.js:
+ (ApuAgentDispatcher.dispatchToApu):
+ (dispatch):
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl.prototype.debuggerEnabled):
+ (devtools.InspectorBackendImpl.prototype.profilerEnabled):
+
+2010-06-23 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: Inspector cleanup + better DevTools alignment with Inspector.
+
+ https://bugs.webkit.org/show_bug.cgi?id=41094
+
+ - Merged InspectorClient implementation into WebDevToolsAgent
+ - Changed the way WebDevToolsAgent is initialized (will break chromium bot, needs coordinated landing)
+ - Removed a lot of legacy code from WebDevToolsAgentImpl
+ - Removed a lot of overrides from DevTools.js
+ - Simplified devtools stubs
+ - Got rid of all logic from within InjectDispatch.js
+
+ * WebKit.gyp:
+ * public/WebDevToolsAgent.h:
+ * public/WebView.h:
+ * src/FrameLoaderClientImpl.cpp:
+ (WebKit::FrameLoaderClientImpl::dispatchDidCommitLoad):
+ * src/InspectorFrontendClientImpl.cpp:
+ (WebKit::InspectorFrontendClientImpl::inspectedURLChanged):
+ * src/ToolsAgent.h:
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::):
+ (WebKit::WebDevToolsAgentImpl::initDevToolsAgentHost):
+ (WebKit::WebDevToolsAgentImpl::setApuAgentEnabled):
+ (WebKit::WebDevToolsAgentImpl::jsDispatchOnClient):
+ (WebKit::WebDevToolsAgentImpl::inspectorDestroyed):
+ (WebKit::WebDevToolsAgentImpl::openInspectorFrontend):
+ (WebKit::WebDevToolsAgentImpl::highlight):
+ (WebKit::WebDevToolsAgentImpl::hideHighlight):
+ (WebKit::WebDevToolsAgentImpl::populateSetting):
+ (WebKit::WebDevToolsAgentImpl::storeSetting):
+ (WebKit::WebDevToolsAgentImpl::sendMessageToFrontend):
+ (WebKit::WebDevToolsAgentImpl::resourceTrackingWasEnabled):
+ (WebKit::WebDevToolsAgentImpl::resourceTrackingWasDisabled):
+ (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStarted):
+ (WebKit::WebDevToolsAgentImpl::timelineProfilerWasStopped):
+ * src/WebDevToolsAgentImpl.h:
+ * src/WebDevToolsAgentPrivate.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebView::create):
+ (WebKit::WebViewImpl::WebViewImpl):
+ * src/WebViewImpl.h:
+ * src/WebWorkerBase.cpp:
+ (WebKit::WebWorkerBase::initializeLoader):
+ * src/js/DevTools.js:
+ (devtools.ToolsAgent):
+ ():
+ (devtools):
+ * src/js/DevToolsHostStub.js:
+ (.window.setDebuggerScriptSource):
+ (.window.dispatchOnInjectedScript):
+ * src/js/InjectDispatch.js:
+ (dispatch):
+ * src/js/InspectorControllerImpl.js:
+
+2010-06-24 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ Web Inspector: implement layout tests for debugger
+ https://bugs.webkit.org/show_bug.cgi?id=40774
+
+ * src/WebDevToolsFrontendImpl.cpp:
+ (WebKit::WebDevToolsFrontendImpl::WebDevToolsFrontendImpl):
+
+2010-06-23 Tony Chang <tony@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ layout test for a crash in chromium multipart request handling
+ https://bugs.webkit.org/show_bug.cgi?id=41050
+
+ Also roll DEPS to pick up the crash fix.
+
+ * DEPS:
+
+2010-06-23 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Make page format data methods accessible from Chromium
+ https://bugs.webkit.org/show_bug.cgi?id=41056
+
+ * public/WebFrame.h:
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::isPageBoxVisible):
+ (WebKit::WebFrameImpl::pageAreaRectInPixels):
+ (WebKit::WebFrameImpl::preferredPageSizeInPixels):
+ * src/WebFrameImpl.h:
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename HTMLDocumentParser to LegacyHTMLDocumentParser
+ https://bugs.webkit.org/show_bug.cgi?id=41043
+
+ * src/WebEntities.cpp:
+
+2010-06-22 Pavel Feldman <pfeldman@chromium.org>
+
+ Not reviewed: follow up to r61655 to make Chromium tests happy.
+
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-06-22 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [Chromium] Clean up after removal of static WebDevToolsAgentClient::sendMessageToFrontendOnIOThread.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40914
+
+ * public/WebDevToolsAgentClient.h:
+
+2010-06-22 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [Chromium] Add a sanity test for heap profiler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40917
+
+ * src/js/Tests.js:
+ (.TestSuite.prototype.testHeapProfiler.findDisplayedNode):
+ (.TestSuite.prototype.testHeapProfiler.findVisibleView):
+ (.TestSuite.prototype.testHeapProfiler):
+
+2010-06-21 MORITA Hajime <morrita@google.com>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Dragging outside the frame immediately causes page to scroll
+ http://webkit.org/b/40461
+
+ This is regression that was introduced at http://webkit.org/b/39725.
+
+ There are 2 problems:
+ 1. It starts auto-scrolling immediately. We should have some delay.
+ 2. The scroll continues even after a mouse cursor goes outside a frame.
+ The scroll should be stopped when the curosr has left.
+
+ This change introduced DragScrollTimer to handle 1.
+ At the same time, it fixed DragScrollTimer::scrollDistanceFor() to
+ handle 2, We now stop scrolling when the cursor gone.
+
+ * WebKit.gyp:
+ * src/DragScrollTimer.cpp: Added.
+ (WebKit::distanceToRect):
+ (WebKit::DragScrollTimer::DragScrollTimer):
+ (WebKit::DragScrollTimer::~DragScrollTimer):
+ (WebKit::DragScrollTimer::stop):
+ (WebKit::DragScrollTimer::scroll):
+ (WebKit::DragScrollTimer::update):
+ (WebKit::DragScrollTimer::triggerScroll):
+ (WebKit::DragScrollTimer::scrollDistanceFor):
+ * src/DragScrollTimer.h: Added.
+ (WebKit::DragScrollTimer::fired):
+ (WebKit::DragScrollTimer::shouldScroll):
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::WebViewImpl):
+ (WebKit::WebViewImpl::dragSourceEndedAt):
+ (WebKit::WebViewImpl::dragSourceMovedTo):
+ (WebKit::WebViewImpl::dragTargetDrop):
+ (WebKit::WebViewImpl::dragTargetDragEnterOrOver):
+ * src/WebViewImpl.h:
+
+2010-06-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] Enable EVENTSOURCE, FILE_WRITER, and IMAGE_RESIZER
+ https://bugs.webkit.org/show_bug.cgi?id=40905
+
+ EVENTSOURCE: It is already enabled in Chromium browser. This fixes
+ some tests with Chromium DRT.
+
+ FILE_WRITER and IMAGE_RESIZER: Enable experimental features in
+ order to test them before enabling them in Chromium browser.
+
+ * features.gypi:
+
+2010-06-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
+
+ * features.gypi:
+
+2010-06-21 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ [Chromium] Remove usage of static WebDevToolsAgentClient::sendMessageToFrontendOnIOThread.
+
+ Also, move WebDevToolsMessageTransport to its own header file.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40913
+
+ * DEPS:
+ * WebKit.gyp:
+ * public/WebDevToolsAgent.h:
+ * public/WebDevToolsAgentClient.h:
+ * public/WebDevToolsMessageTransport.h: Added.
+ (WebKit::WebDevToolsMessageTransport::~WebDevToolsMessageTransport):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::):
+
+2010-06-20 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [v8] Web Inspector: don't add ScriptDebugServer as v8 listener if browser exposes
+ v8 debugging protocol.
+
+ * src/DebuggerAgentManager.cpp:
+ (WebKit::DebuggerAgentManager::setExposeV8DebuggerProtocol):
+
+2010-06-19 Jay Civelli <jcivelli@chromium.org>
+
+ Reviewed by David Levin.
+
+ Adding a < operator to WebURLs so they can be used in std::maps.
+ https://bugs.webkit.org/show_bug.cgi?id=40632
+
+ * public/WebCString.h:
+ (WebKit::operator<):
+ * public/WebURL.h:
+ (WebKit::operator<):
+ * src/WebCString.cpp:
+ (WebKit::WebCString::compare):
+
+2010-06-19 Kent Tamura <tkent@chromium.org>
+
+ Unreviewed. Build fix for r61488.
+
+ * features.gypi: Define use_accelerated_compositing.
+
+2010-06-19 Thomas Van Lenten <thomasvl@chromium.org>
+
+ Reviewed by David Levin.
+
+ Warnings from -Wextra in a Chromium Mac build
+ 1. checks of unsigned >= 0
+ 2. enumeral and non-enumeral type in conditional expression
+ 3. copy ctors that don't call the super copy ctor or ctor
+
+ https://bugs.webkit.org/show_bug.cgi?id=40791
+
+ * src/AutoFillPopupMenuClient.cpp:
+ (WebKit::AutoFillPopupMenuClient::getSuggestion):
+ (WebKit::AutoFillPopupMenuClient::removeSuggestionAtIndex):
+ (WebKit::AutoFillPopupMenuClient::valueChanged):
+ (WebKit::AutoFillPopupMenuClient::selectionChanged):
+ * src/AutocompletePopupMenuClient.cpp:
+ (WebKit::AutocompletePopupMenuClient::getSuggestion):
+ (WebKit::AutocompletePopupMenuClient::removeSuggestionAtIndex):
+
+2010-06-19 Zhe Su <suzhe@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium]Refactor input method related APIs.
+ https://bugs.webkit.org/show_bug.cgi?id=40608
+
+ * WebKit.gyp:
+ * public/WebCompositionCommand.h:
+ * public/WebCompositionUnderline.h: Added.
+ (WebKit::WebCompositionUnderline::WebCompositionUnderline):
+ * public/WebTextInputType.h: Added.
+ (WebKit::):
+ * public/WebViewClient.h:
+ * public/WebWidget.h:
+ * public/WebWidgetClient.h:
+ (WebKit::WebWidgetClient::resetInputMethod):
+ * src/CompositionUnderlineBuilder.h: Added.
+ (WebKit::CompositionUnderlineBuilder::CompositionUnderlineBuilder):
+ * src/CompositionUnderlineVectorBuilder.cpp: Added.
+ (WebKit::CompositionUnderlineVectorBuilder::CompositionUnderlineVectorBuilder):
+ * src/CompositionUnderlineVectorBuilder.h: Added.
+ * src/EditorClientImpl.cpp:
+ (WebKit::EditorClientImpl::setInputMethodState):
+ * src/WebPopupMenuImpl.cpp:
+ (WebKit::WebPopupMenuImpl::setComposition):
+ (WebKit::WebPopupMenuImpl::confirmComposition):
+ (WebKit::WebPopupMenuImpl::textInputType):
+ (WebKit::WebPopupMenuImpl::caretOrSelectionBounds):
+ * src/WebPopupMenuImpl.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::handleCompositionEvent):
+ (WebKit::WebViewImpl::setComposition):
+ (WebKit::WebViewImpl::confirmComposition):
+ (WebKit::WebViewImpl::textInputType):
+ (WebKit::WebViewImpl::caretOrSelectionBounds):
+ * src/WebViewImpl.h:
+
+2010-06-19 Victoria Kirst <vrk@google.com>
+
+ Reviewed by David Levin.
+
+ Modifying the WebMediaPlayer interface to be compatible with
+ a change in chrome.
+ This is a part 2 of 3 one-sided changes to chrome and WebKit. Chrome
+ has been updated, so this commit should NOT break chromium anymore,
+ nor should it cause any test failures.
+ https://bugs.webkit.org/show_bug.cgi?id=39445
+
+ * public/WebMediaPlayer.h: Changed buffered() to be non-const.
+
+2010-06-19 Zhenyao Mo <zmo@google.com>
+
+ Reviewed by Dimitri Glazkov.
+
+ fast/canvas/webgl/get-active-test.html failed in Chrome Mac
+ https://bugs.webkit.org/show_bug.cgi?id=40496
+
+ * src/WebGraphicsContext3DDefaultImpl.cpp: Call makeContextCurrent().
+ (WebKit::WebGraphicsContext3DDefaultImpl::getActiveAttrib):
+ (WebKit::WebGraphicsContext3DDefaultImpl::getActiveUniform):
+ (WebKit::WebGraphicsContext3DDefaultImpl::readPixels):
+
+2010-06-18 Aaron Boodman <aa@chromium.org>
+
+ Remove WebKit::WebDocument::isXHTMLDocument.
+ https://bugs.webkit.org/show_bug.cgi?id=40815
+
+ * public/WebDocument.h: Remove isXHTMLDocument().
+ * src/WebDocument.cpp: Ditto.
+
+2010-06-19 Aaron Boodman <aa@chromium.org>
+
+ Unreviewed, rolling out r61466.
+ http://trac.webkit.org/changeset/61466
+ https://bugs.webkit.org/show_bug.cgi?id=40816
+
+ Landed wrong change
+
+ * src/WebKit.cpp:
+ (WebKit::shutdown):
+
+2010-06-18 Aaron Boodman <aa@chromium.org>
+
+ WebKit API: Undo static hooks into V8 when WebKit is shut downm
+ https://bugs.webkit.org/show_bug.cgi?id=40816
+
+ * src/WebKit.cpp:
+ (WebKit::shutdown): Call new WebCore::V8DOMWindowShell::uninitializeV8IfNeeded().
+
+2010-06-18 Drew Wilson <atwilson@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Plumbing for top-level frame names
+ https://bugs.webkit.org/show_bug.cgi?id=40430
+
+ * public/WebFrame.h:
+ Removed obsolete clearName() API and added better documentation for
+ setName().
+ * src/WebFrameImpl.cpp:
+ Removed clearName() API.
+ * src/WebFrameImpl.h:
+ Removed clearName() API.
+
+2010-06-18 Drew Wilson <atwilson@chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Roll chromium DEPS 50089:50171
+ https://bugs.webkit.org/show_bug.cgi?id=40842
+
+ * DEPS:
+ Update chromium_rev to r50171 to remove downstream reference to WebFrame::clearName().
+
+2010-06-18 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Implement 'takeHeapSnapshot' in InspectorController.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40834
+
+ * src/js/HeapProfilerPanel.js:
+ (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+ * src/js/ProfilerAgent.js:
+ (devtools.ProfilerAgent.prototype.startProfiling):
+
+2010-06-18 Anton Muhin <antonm@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [v8] Finish migration to new named property query API
+ https://bugs.webkit.org/show_bug.cgi?id=40771
+ Remove definition which allowed gradual transition to new API.
+ See https://bugs.webkit.org/show_bug.cgi?id=40303 for first phase.
+ Requires V8 roll.
+
+ * DEPS:
+
+2010-06-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Reviewed by Yury Semikhatsky.
+
+ Web Inspector: bring XHR console records back.
+ - adds "Enable XHR Monitor" / "Disable XHR Monitor" actions to the console's context menu
+ - make the chosen option persist in the settings.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40799
+
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableDatabase):
+ (WebKit::WebRuntimeFeatures::isDatabaseEnabled):
+
+2010-06-17 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] cleanup redundant DEPS value and remove buildbot cleanup code
+ https://bugs.webkit.org/show_bug.cgi?id=40615
+
+ * DEPS: tools/data_pack was listed twice for linux (harmless, but unnecessary)
+
+2010-06-17 Jeremy Moskovich <jeremy@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium API] Implement WebSandboxSupport on OS X and add stubs to allow
+ OOP loading of fonts.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40544
+
+ * WebKit.gyp: Add mac WebSandboxSupport.h
+ * public/mac/WebSandboxSupport.h: Added.
+ * src/ChromiumBridge.cpp:
+ (WebCore::ChromiumBridge::loadFont):
+
+2010-06-17 Pavel Feldman <pfeldman@chromium.org>
+
+ Unreviewed: chromium tests fix. Added InspectorBackend delegates for new inspector methods.
+
+ * src/js/InspectorControllerImpl.js:
+ (devtools.InspectorBackendImpl):
+
+2010-06-17 Mikhail Naganov <mnaganov@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [Chromium] Prepare to making WebDevToolsAgentClient::sendMessageToFrontendOnIOThread virtual
+
+ https://bugs.webkit.org/show_bug.cgi?id=39302
+
+ * public/WebDevToolsAgent.h:
+ * public/WebDevToolsAgentClient.h:
+ (WebKit::WebDevToolsMessageTransport::~WebDevToolsMessageTransport):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::):
+ (WebKit::WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread):
+
+2010-06-17 John Gregg <johnnyg@google.com>
+
+ Reviewed by David Levin.
+
+ Undo the build fix with the correct patch: Chromium NotificationPresenter
+ is now informed of the destruction before it actually happens, so this
+ use of the Notification object is correct.
+ https://bugs.webkit.org/show_bug.cgi?id=40097
+
+ * src/NotificationPresenterImpl.cpp:
+ (WebKit::NotificationPresenterImpl::notificationObjectDestroyed):
+
+2010-06-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Set current working directory for each of tests
+ https://bugs.webkit.org/show_bug.cgi?id=40668
+
+ * DEPS: Update Chromium to r49915 to have
+ webkit_support::SetCurrentDirectoryForFileURL().
+
+2010-06-16 Drew Wilson <atwilson@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ Added plumbing to Chromium WebKit API to allow setting/getting the name
+ of top level frames.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40430
+ * public/WebFrame.h:
+ Added setName() API.
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::createView):
+ Now takes a "name" parameter.
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::createWindow):
+ Passes a name parameter.
+ * src/WebFrameImpl.cpp:
+ (WebKit::WebFrameImpl::setName):
+ Allows setting the frame name by calling through to the WebCore API.
+ * src/WebFrameImpl.h:
+
+2010-06-15 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions out of Frame class that were marked "move to Chrome"
+ https://bugs.webkit.org/show_bug.cgi?id=39636
+
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::dispatchBeforeUnloadEvent): Call shouldClose
+ on FrameLoader instead of going through Frame.
+
+2010-06-11 Darin Fisher <darin@chromium.org>
+
+ Reviewed by Brady Eidson.
+
+ Expose WebHistoryItem::itemSequenceNumber.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40451
+
+ * public/WebHistoryItem.h:
+ * src/WebHistoryItem.cpp:
+ (WebKit::WebHistoryItem::itemSequenceNumber):
+ (WebKit::WebHistoryItem::setItemSequenceNumber):
+
+2010-06-15 Yury Semikhatsky <yurys@chromium.org>
+
+ Reviewed by Pavel Feldman.
+
+ [v8] Web Inspector: make ui tests pass when ScriptDebugServer is used
+ https://bugs.webkit.org/show_bug.cgi?id=40623
+
+ * src/js/DebuggerAgent.js:
+ (devtools.DebuggerAgent.prototype.formatCallFrame_): return empty function name for anonymous functions.
+ * src/js/DebuggerScript.js:
+ * src/js/Tests.js:
+ (.TestSuite.prototype.testProfilerTab.findVisibleView):
+ (.TestSuite.prototype.testProfilerTab):
+ (.TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh.waitUntilScriptIsParsed):
+ (.TestSuite.prototype.testSetBreakpoint.this):
+ (.TestSuite.prototype.testSetBreakpoint):
+ (.TestSuite.prototype.testEvalOnCallFrame.waitForBreakpointHit):
+ (.TestSuite.prototype._executeCodeWhenScriptsAreParsed.executeFunctionInInspectedPage):
+ (.TestSuite.prototype.testExpandScope.examineScopes):
+ (.TestSuite.prototype.testExpandScope):
+ (.TestSuite.prototype.testDebugIntrinsicProperties):
+
+2010-06-14 Anders Carlsson <andersca@apple.com>
+
+ Fix Chromium build.
+
+ * src/WebPluginListBuilderImpl.cpp:
+ (WebKit::WebPluginListBuilderImpl::addFileExtensionToLastMediaType):
+
+2010-06-14 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Get DatabaseTracker ready for sync DBs.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * public/WebDatabase.h:
+ * src/DatabaseObserver.cpp:
+ (WebCore::DatabaseObserver::databaseOpened):
+ (WebCore::DatabaseObserver::databaseModified):
+ (WebCore::DatabaseObserver::databaseClosed):
+ * src/WebDatabase.cpp:
+ (WebKit::WebDatabase::closeDatabaseImmediately):
+ (WebKit::WebDatabase::WebDatabase):
+ (WebKit::WebDatabase::operator=):
+ (WebKit::WebDatabase::operator WTF::PassRefPtr<AbstractDatabase>):
+
+2010-06-14 Chris Fleizach <cfleizach@apple.com>
+
+ Reviewed by Darin Adler.
+
+ AX: need ListItemRole and PresentationalRole
+ https://bugs.webkit.org/show_bug.cgi?id=40133
+
+ * public/WebAccessibilityRole.h:
+ * src/AssertMatchingEnums.cpp:
+
+2010-06-14 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove pluginIndex from MimeClassInfo
+ https://bugs.webkit.org/show_bug.cgi?id=40588
+
+ * src/WebPluginListBuilderImpl.cpp:
+ (WebKit::WebPluginListBuilderImpl::addMediaTypeToLastPlugin):
+
2010-06-14 Jeremy Orlow <jorlow@chromium.org>
Build fix.
@@ -23,6 +846,15 @@
2010-06-13 Tony Chang <tony@chromium.org>
+ Reviewed by Darin Fisher.
+
+ [chromium] checkout chromium third_party directly
+ https://bugs.webkit.org/show_bug.cgi?id=40556
+
+ * DEPS:
+
+2010-06-13 Tony Chang <tony@chromium.org>
+
Build fix, not reviewed.
fix chromium compile after r61094 (id attribute refactor)
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 973e78d..b6b35a5 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
vars = {
'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
- 'chromium_rev': '49521',
+ 'chromium_rev': '50676',
}
deps = {
@@ -91,70 +91,26 @@ deps = {
Var('chromium_svn')+'/media@'+Var('chromium_rev'),
'third_party/angle': # needed by the gpu process
From('chromium_deps', 'src/third_party/angle'),
- 'third_party/glew': # webgl related
- Var('chromium_svn')+'/third_party/glew@'+Var('chromium_rev'),
'third_party/ffmpeg': # needed by webkit/media
From('chromium_deps', 'src/third_party/ffmpeg'),
'third_party/libvpx/include':
From('chromium_deps', 'src/third_party/libvpx/include'),
'third_party/libvpx/lib':
From('chromium_deps', 'src/third_party/libvpx/lib'),
- 'third_party/mesa':
- Var('chromium_svn')+'/third_party/mesa@'+Var('chromium_rev'),
- 'third_party/yasm': # needed by ffmpeg
- Var('chromium_svn')+'/third_party/yasm@'+Var('chromium_rev'),
- 'third_party/openmax': # needed by webkit/media
- Var('chromium_svn')+'/third_party/openmax@'+Var('chromium_rev'),
'tools/grit':
Var('chromium_svn')+'/tools/grit@'+Var('chromium_rev'),
'tools/generate_stubs':
Var('chromium_svn')+'/tools/generate_stubs@'+Var('chromium_rev'),
# other third party
+ 'third_party':
+ Var('chromium_svn')+'/third_party@'+Var('chromium_rev'),
'third_party/icu':
From('chromium_deps', 'src/third_party/icu'),
-
- 'third_party/bzip2':
- Var('chromium_svn')+'/third_party/bzip2@'+Var('chromium_rev'),
-
- 'third_party/libevent':
- Var('chromium_svn')+'/third_party/libevent@'+Var('chromium_rev'),
-
- 'third_party/libjpeg':
- Var('chromium_svn')+'/third_party/libjpeg@'+Var('chromium_rev'),
-
- 'third_party/libpng':
- Var('chromium_svn')+'/third_party/libpng@'+Var('chromium_rev'),
-
- 'third_party/libxml':
- Var('chromium_svn')+'/third_party/libxml@'+Var('chromium_rev'),
-
- 'third_party/libxslt':
- Var('chromium_svn')+'/third_party/libxslt@'+Var('chromium_rev'),
-
- 'third_party/modp_b64':
- Var('chromium_svn')+'/third_party/modp_b64@'+Var('chromium_rev'),
-
- 'third_party/npapi':
- Var('chromium_svn')+'/third_party/npapi@'+Var('chromium_rev'),
-
'third_party/ppapi':
From('chromium_deps', 'src/third_party/ppapi'),
-
'third_party/ots':
From('chromium_deps', 'src/third_party/ots'),
-
- 'third_party/sqlite':
- Var('chromium_svn')+'/third_party/sqlite@'+Var('chromium_rev'),
-
- 'third_party/tcmalloc':
- Var('chromium_svn')+'/third_party/tcmalloc@'+Var('chromium_rev'),
-
- 'third_party/zlib':
- Var('chromium_svn')+'/third_party/zlib@'+Var('chromium_rev'),
-
- 'third_party/mozilla':
- Var('chromium_svn')+'/third_party/mozilla@'+Var('chromium_rev'),
}
deps_os = {
@@ -169,8 +125,6 @@ deps_os = {
From('chromium_deps', 'src/third_party/lighttpd'),
'third_party/nss':
From('chromium_deps', 'src/third_party/nss'),
- 'third_party/wtl':
- Var('chromium_svn')+'/third_party/wtl@'+Var('chromium_rev'),
},
'mac': {
# needed by ffmpeg
@@ -181,12 +135,8 @@ deps_os = {
},
'unix': {
# Linux, actually.
- 'third_party/harfbuzz':
- Var('chromium_svn')+'/third_party/harfbuzz@'+Var('chromium_rev'),
'tools/xdisplaycheck':
Var('chromium_svn')+'/tools/xdisplaycheck@'+Var('chromium_rev'),
- 'tools/data_pack':
- Var('chromium_svn')+'/tools/data_pack@'+Var('chromium_rev'),
'third_party/yasm/source/patched-yasm':
From('chromium_deps', 'src/third_party/yasm/source/patched-yasm'),
},
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index 83ae631..a53dd28 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -77,6 +77,7 @@
'public/linux/WebRenderTheme.h',
'public/x11/WebScreenInfoFactory.h',
'public/mac/WebInputEventFactory.h',
+ 'public/mac/WebSandboxSupport.h',
'public/mac/WebScreenInfoFactory.h',
'public/WebAccessibilityCache.h',
'public/WebAccessibilityObject.h',
@@ -93,6 +94,7 @@
'public/WebCommon.h',
'public/WebCommonWorkerClient.h',
'public/WebCompositionCommand.h',
+ 'public/WebCompositionUnderline.h',
'public/WebConsoleMessage.h',
'public/WebContextMenuData.h',
'public/WebCookie.h',
@@ -110,6 +112,7 @@
'public/WebDevToolsFrontend.h',
'public/WebDevToolsFrontendClient.h',
'public/WebDevToolsMessageData.h',
+ 'public/WebDevToolsMessageTransport.h',
'public/WebDocument.h',
'public/WebDragData.h',
'public/WebEditingAction.h',
@@ -205,6 +208,7 @@
'public/WebTextAffinity.h',
'public/WebTextCaseSensitivity.h',
'public/WebTextDirection.h',
+ 'public/WebTextInputType.h',
'public/WebThemeEngine.h',
'public/WebURL.h',
'public/WebURLError.h',
@@ -240,6 +244,9 @@
'src/ChromiumBridge.cpp',
'src/ChromiumCurrentTime.cpp',
'src/ChromiumThreading.cpp',
+ 'src/CompositionUnderlineBuilder.h',
+ 'src/CompositionUnderlineVectorBuilder.cpp',
+ 'src/CompositionUnderlineVectorBuilder.h',
'src/ContextMenuClientImpl.cpp',
'src/ContextMenuClientImpl.h',
'src/DatabaseObserver.cpp',
@@ -254,6 +261,8 @@
'src/DOMUtilitiesPrivate.h',
'src/DragClientImpl.cpp',
'src/DragClientImpl.h',
+ 'src/DragScrollTimer.cpp',
+ 'src/DragScrollTimer.h',
'src/EditorClientImpl.cpp',
'src/EditorClientImpl.h',
'src/EventListenerWrapper.cpp',
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index 9a23949..256192b 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -46,13 +46,15 @@
'ENABLE_DATABASE=1',
'ENABLE_DATAGRID=0',
'ENABLE_DOM_STORAGE=1',
+ 'ENABLE_EVENTSOURCE=1',
'ENABLE_FILE_READER=1',
- 'ENABLE_FILE_WRITER=0',
+ 'ENABLE_FILE_WRITER=1',
'ENABLE_FILTERS=1',
'ENABLE_GEOLOCATION=1',
'ENABLE_ICONDATABASE=0',
- 'ENABLE_IMAGE_RESIZER=0',
+ 'ENABLE_IMAGE_RESIZER=1',
'ENABLE_INDEXED_DATABASE=1',
+ 'ENABLE_INPUT_SPEECH=1',
'ENABLE_JAVASCRIPT_DEBUGGER=1',
'ENABLE_JSC_MULTIPLE_THREADS=0',
'ENABLE_METER_TAG=1',
@@ -80,10 +82,12 @@
'WTF_USE_ACCELERATED_COMPOSITING=0',
],
+ 'use_accelerated_compositing%': 0,
'enable_svg%': 1,
},
'feature_defines%': '<(feature_defines)',
+ 'use_accelerated_compositing%': '<(use_accelerated_compositing)',
'enable_svg%': '<(enable_svg)',
},
}
diff --git a/WebKit/chromium/public/WebAccessibilityRole.h b/WebKit/chromium/public/WebAccessibilityRole.h
index ec041e0..b0748a7 100644
--- a/WebKit/chromium/public/WebAccessibilityRole.h
+++ b/WebKit/chromium/public/WebAccessibilityRole.h
@@ -102,6 +102,7 @@ enum WebAccessibilityRole {
WebAccessibilityRoleAnnotation,
WebAccessibilityRoleSliderThumb,
WebAccessibilityRoleIgnored,
+ WebAccessibilityRolePresentational,
WebAccessibilityRoleTab,
WebAccessibilityRoleTabList,
WebAccessibilityRoleTabPanel,
diff --git a/WebKit/chromium/public/WebApplicationCacheHostClient.h b/WebKit/chromium/public/WebApplicationCacheHostClient.h
index 4e830e3..39b7fa2 100644
--- a/WebKit/chromium/public/WebApplicationCacheHostClient.h
+++ b/WebKit/chromium/public/WebApplicationCacheHostClient.h
@@ -39,8 +39,9 @@ namespace WebKit {
// This interface is used by the embedder to call into webkit.
class WebApplicationCacheHostClient {
public:
- // Called to fire the event in the scriptable interface.
+ // Called to fire events in the scriptable interface.
virtual void notifyEventListener(WebApplicationCacheHost::EventID) = 0;
+ virtual void notifyProgressEventListener(const WebURL&, int num_total, int num_complete) = 0;
protected:
// Should not be deleted by the embedder.
diff --git a/WebKit/chromium/public/WebCString.h b/WebKit/chromium/public/WebCString.h
index d24916b..2c1e137 100644
--- a/WebKit/chromium/public/WebCString.h
+++ b/WebKit/chromium/public/WebCString.h
@@ -68,6 +68,11 @@ public:
return *this;
}
+ // Returns 0 if both strings are equals, a value greater than zero if the
+ // first character that does not match has a greater value in this string
+ // than in |other|, or a value less than zero to indicate the opposite.
+ WEBKIT_API int compare(const WebCString& other) const;
+
WEBKIT_API void reset();
WEBKIT_API void assign(const WebCString&);
WEBKIT_API void assign(const char* data, size_t len);
@@ -117,6 +122,11 @@ private:
WebCStringPrivate* m_private;
};
+inline bool operator<(const WebCString& a, const WebCString& b)
+{
+ return a.compare(b) < 0;
+}
+
} // namespace WebKit
#endif
diff --git a/WebKit/chromium/public/WebCompositionCommand.h b/WebKit/chromium/public/WebCompositionCommand.h
index fa89529..bda1eb1 100644
--- a/WebKit/chromium/public/WebCompositionCommand.h
+++ b/WebKit/chromium/public/WebCompositionCommand.h
@@ -33,6 +33,7 @@
namespace WebKit {
+// DEPRECATED.
enum WebCompositionCommand {
WebCompositionCommandDiscard,
WebCompositionCommandSet,
diff --git a/WebKit/chromium/public/WebCompositionUnderline.h b/WebKit/chromium/public/WebCompositionUnderline.h
new file mode 100644
index 0000000..d8b0d63
--- /dev/null
+++ b/WebKit/chromium/public/WebCompositionUnderline.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebCompositionUnderline_h
+#define WebCompositionUnderline_h
+
+#include "WebColor.h"
+
+namespace WebKit {
+
+// Class WebCompositionUnderline is intended to be used with WebWidget's
+// setComposition() method.
+struct WebCompositionUnderline {
+ WebCompositionUnderline()
+ : startOffset(0)
+ , endOffset(0)
+ , color(0)
+ , thick(false) { }
+
+ WebCompositionUnderline(unsigned s, unsigned e, WebColor c, bool t)
+ : startOffset(s)
+ , endOffset(e)
+ , color(c)
+ , thick(t) { }
+
+ unsigned startOffset;
+ unsigned endOffset;
+ WebColor color;
+ bool thick;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebDatabase.h b/WebKit/chromium/public/WebDatabase.h
index 108201d..4679f68 100644
--- a/WebKit/chromium/public/WebDatabase.h
+++ b/WebKit/chromium/public/WebDatabase.h
@@ -35,7 +35,7 @@
#include "WebSecurityOrigin.h"
#if WEBKIT_IMPLEMENTATION
-namespace WebCore { class Database; }
+namespace WebCore { class AbstractDatabase; }
namespace WTF { template <typename T> class PassRefPtr; }
#endif
@@ -76,9 +76,9 @@ public:
const WebString& originIdentifier, const WebString& databaseName);
#if WEBKIT_IMPLEMENTATION
- WebDatabase(const WTF::PassRefPtr<WebCore::Database>&);
- WebDatabase& operator=(const WTF::PassRefPtr<WebCore::Database>&);
- operator WTF::PassRefPtr<WebCore::Database>() const;
+ WebDatabase(const WTF::PassRefPtr<WebCore::AbstractDatabase>&);
+ WebDatabase& operator=(const WTF::PassRefPtr<WebCore::AbstractDatabase>&);
+ operator WTF::PassRefPtr<WebCore::AbstractDatabase>() const;
#endif
private:
diff --git a/WebKit/chromium/public/WebDevToolsAgent.h b/WebKit/chromium/public/WebDevToolsAgent.h
index e3b5186..d1ad23c 100644
--- a/WebKit/chromium/public/WebDevToolsAgent.h
+++ b/WebKit/chromium/public/WebDevToolsAgent.h
@@ -35,6 +35,7 @@
namespace WebKit {
class WebDevToolsAgentClient;
+class WebDevToolsMessageTransport;
class WebFrame;
class WebString;
class WebURLRequest;
@@ -73,7 +74,7 @@ public:
// Asynchronously request debugger to pause immediately.
WEBKIT_API static void debuggerPauseScript();
- WEBKIT_API static bool dispatchMessageFromFrontendOnIOThread(const WebDevToolsMessageData&);
+ WEBKIT_API static bool dispatchMessageFromFrontendOnIOThread(WebDevToolsMessageTransport*, const WebDevToolsMessageData&);
typedef void (*MessageLoopDispatchHandler)();
diff --git a/WebKit/chromium/public/WebDevToolsAgentClient.h b/WebKit/chromium/public/WebDevToolsAgentClient.h
index 622f788..91fd3e8 100644
--- a/WebKit/chromium/public/WebDevToolsAgentClient.h
+++ b/WebKit/chromium/public/WebDevToolsAgentClient.h
@@ -51,8 +51,6 @@ public:
// Notifies host upon runtime feature being enabled/disabled.
virtual void runtimeFeatureStateChanged(const WebString& feature, bool enabled) { }
- WEBKIT_API static void sendMessageToFrontendOnIOThread(const WebDevToolsMessageData&);
-
virtual WebCString injectedScriptSource() { return WebCString(); }
virtual WebCString injectedScriptDispatcherSource() { return WebCString(); }
virtual WebCString debuggerScriptSource() { return WebCString(); }
diff --git a/WebKit/chromium/public/WebDevToolsMessageTransport.h b/WebKit/chromium/public/WebDevToolsMessageTransport.h
new file mode 100644
index 0000000..54c07f1
--- /dev/null
+++ b/WebKit/chromium/public/WebDevToolsMessageTransport.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebDevToolsMessageTransport_h
+#define WebDevToolsMessageTransport_h
+
+#include "WebCString.h"
+#include "WebCommon.h"
+
+namespace WebKit {
+struct WebDevToolsMessageData;
+
+class WebDevToolsMessageTransport {
+public:
+ virtual ~WebDevToolsMessageTransport() { }
+ virtual void sendMessageToFrontendOnIOThread(const WebDevToolsMessageData&) = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebFrame.h b/WebKit/chromium/public/WebFrame.h
index 772db75..319ce38 100644
--- a/WebKit/chromium/public/WebFrame.h
+++ b/WebKit/chromium/public/WebFrame.h
@@ -102,7 +102,11 @@ public:
// The name of this frame.
virtual WebString name() const = 0;
- virtual void clearName() = 0;
+
+ // Sets the name of this frame. For child frames (frames that are not a
+ // top-most frame) the actual name may have a suffix appended to make the
+ // frame name unique within the hierarchy.
+ virtual void setName(const WebString&) = 0;
// The url of the document loaded in this frame. This is equivalent to
// dataSource()->request().url().
@@ -399,6 +403,17 @@ public:
// Reformats the WebFrame for screen display.
virtual void printEnd() = 0;
+ // CSS3 Paged Media ----------------------------------------------------
+
+ // Returns true if page box (margin boxes and page borders) is visible.
+ virtual bool isPageBoxVisible(int pageIndex) = 0;
+
+ // Returns the page area rectangle in pixels, assuming 96 pixels per inch.
+ virtual WebRect pageAreaRectInPixels(int pageIndex) = 0;
+
+ // Returns the preferred page size in pixels, assuming 96 pixels per inch.
+ virtual WebSize preferredPageSizeInPixels(int pageIndex) = 0;
+
// Find-in-page --------------------------------------------------------
diff --git a/WebKit/chromium/public/WebGLES2Context.h b/WebKit/chromium/public/WebGLES2Context.h
index bd63060..a7e9560 100644
--- a/WebKit/chromium/public/WebGLES2Context.h
+++ b/WebKit/chromium/public/WebGLES2Context.h
@@ -45,7 +45,7 @@ class WebGLES2Context : public WebNonCopyable {
public:
virtual ~WebGLES2Context() {}
- virtual bool initialize(WebView*) = 0;
+ virtual bool initialize(WebView*, WebGLES2Context* parent) = 0;
virtual bool makeCurrent() = 0;
virtual bool destroy() = 0;
virtual bool swapBuffers() = 0;
diff --git a/WebKit/chromium/public/WebHistoryItem.h b/WebKit/chromium/public/WebHistoryItem.h
index 015f5d7..1b4863e 100644
--- a/WebKit/chromium/public/WebHistoryItem.h
+++ b/WebKit/chromium/public/WebHistoryItem.h
@@ -34,6 +34,9 @@
#include "WebCommon.h"
#include "WebPrivatePtr.h"
+// FIXME: Remove this once Chromium starts using itemSequenceNumber.
+#define WEBKIT_BUG_40451_IS_FIXED
+
namespace WebCore { class HistoryItem; }
namespace WebKit {
@@ -102,6 +105,9 @@ public:
WEBKIT_API WebVector<WebString> documentState() const;
WEBKIT_API void setDocumentState(const WebVector<WebString>&);
+ WEBKIT_API long long itemSequenceNumber() const;
+ WEBKIT_API void setItemSequenceNumber(long long);
+
WEBKIT_API long long documentSequenceNumber() const;
WEBKIT_API void setDocumentSequenceNumber(long long);
diff --git a/WebKit/chromium/public/WebMediaPlayer.h b/WebKit/chromium/public/WebMediaPlayer.h
index 0b658f9..6f51345 100644
--- a/WebKit/chromium/public/WebMediaPlayer.h
+++ b/WebKit/chromium/public/WebMediaPlayer.h
@@ -95,7 +95,7 @@ public:
virtual void setVisible(bool) = 0;
virtual bool setAutoBuffer(bool) = 0;
virtual bool totalBytesKnown() = 0;
- virtual const WebTimeRanges& buffered() const = 0;
+ virtual const WebTimeRanges& buffered() = 0;
virtual float maxTimeSeekable() const = 0;
virtual void setSize(const WebSize&) = 0;
diff --git a/WebKit/chromium/public/WebNotification.h b/WebKit/chromium/public/WebNotification.h
index ab747e3..787d4f3 100644
--- a/WebKit/chromium/public/WebNotification.h
+++ b/WebKit/chromium/public/WebNotification.h
@@ -32,6 +32,7 @@
#define WebNotification_h
#include "WebCommon.h"
+#include "WebTextDirection.h"
#if WEBKIT_IMPLEMENTATION
namespace WebCore { class Notification; }
@@ -75,7 +76,11 @@ public:
WEBKIT_API WebString title() const;
WEBKIT_API WebString body() const;
+ // FIXME: Remove dir() when no longer referenced.
+ // dir() is deprecated; use direction().
WEBKIT_API WebString dir() const;
+ WEBKIT_API WebTextDirection direction() const;
+
WEBKIT_API WebString replaceId() const;
// Called to indicate the notification has been displayed.
diff --git a/WebKit/chromium/public/WebSharedWorker.h b/WebKit/chromium/public/WebSharedWorker.h
index 01c8391..9492a4f 100644
--- a/WebKit/chromium/public/WebSharedWorker.h
+++ b/WebKit/chromium/public/WebSharedWorker.h
@@ -63,15 +63,6 @@ public:
const WebString& sourceCode,
long long scriptResourceAppCacheID) = 0;
- // FIXME(michaeln): Remove this after the roll and adjusting to it.
- virtual void startWorkerContext(const WebURL& scriptURL,
- const WebString& name,
- const WebString& userAgent,
- const WebString& sourceCode)
- {
- startWorkerContext(scriptURL, name, userAgent, sourceCode, 0);
- }
-
class ConnectListener {
public:
// Invoked once the connect event has been sent so the caller can free this object.
diff --git a/WebKit/chromium/public/WebTextInputType.h b/WebKit/chromium/public/WebTextInputType.h
new file mode 100644
index 0000000..2592f6f
--- /dev/null
+++ b/WebKit/chromium/public/WebTextInputType.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 WebTextInputType_h
+#define WebTextInputType_h
+
+namespace WebKit {
+
+enum WebTextInputType {
+ // Input caret is not in an editable node, no input method shall be used.
+ WebTextInputTypeNone,
+
+ // Input caret is in a normal editable node, any input method can be used.
+ WebTextInputTypeText,
+
+ // Input caret is in a password box, an input method may be used only if
+ // it's suitable for password input.
+ WebTextInputTypePassword,
+
+ // FIXME: Add more text input types when necessary, eg. Number,
+ // Date, Email, URL, etc.
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/public/WebURL.h b/WebKit/chromium/public/WebURL.h
index 78a16a8..bb90e32 100644
--- a/WebKit/chromium/public/WebURL.h
+++ b/WebKit/chromium/public/WebURL.h
@@ -138,6 +138,11 @@ private:
bool m_isValid;
};
+inline bool operator<(const WebURL& a, const WebURL& b)
+{
+ return a.spec() < b.spec();
+}
+
} // namespace WebKit
#endif
diff --git a/WebKit/chromium/public/WebURLResponse.h b/WebKit/chromium/public/WebURLResponse.h
index 4462394..293d955 100644
--- a/WebKit/chromium/public/WebURLResponse.h
+++ b/WebKit/chromium/public/WebURLResponse.h
@@ -131,6 +131,11 @@ public:
WEBKIT_API bool wasNpnNegotiated() const;
WEBKIT_API void setWasNpnNegotiated(bool);
+ // Flag whether this request was made when "Alternate-Protocol: xxx"
+ // is present in server's response.
+ WEBKIT_API bool wasAlternateProtocolAvailable() const;
+ WEBKIT_API void setWasAlternateProtocolAvailable(bool);
+
// Flag whether this request was loaded via an explicit proxy (HTTP, SOCKS, etc).
WEBKIT_API bool wasFetchedViaProxy() const;
WEBKIT_API void setWasFetchedViaProxy(bool);
diff --git a/WebKit/chromium/public/WebView.h b/WebKit/chromium/public/WebView.h
index 9054d8c..eadfc26 100644
--- a/WebKit/chromium/public/WebView.h
+++ b/WebKit/chromium/public/WebView.h
@@ -38,6 +38,7 @@ namespace WebKit {
class WebAccessibilityObject;
class WebDevToolsAgent;
+class WebDevToolsAgentClient;
class WebDragData;
class WebFrame;
class WebFrameClient;
@@ -55,8 +56,8 @@ public:
// Creates a WebView that is NOT yet initialized. You will need to
// call initializeMainFrame to finish the initialization. It is valid
- // to pass a null WebViewClient pointer.
- WEBKIT_API static WebView* create(WebViewClient*);
+ // to pass null WebViewClient and WebDevToolsAgentClient pointers.
+ WEBKIT_API static WebView* create(WebViewClient*, WebDevToolsAgentClient* = 0);
// After creating a WebView, you should immediately call this method.
// You can optionally modify the settings before calling this method.
diff --git a/WebKit/chromium/public/WebViewClient.h b/WebKit/chromium/public/WebViewClient.h
index 31ef028..0712815 100644
--- a/WebKit/chromium/public/WebViewClient.h
+++ b/WebKit/chromium/public/WebViewClient.h
@@ -73,7 +73,8 @@ public:
// so any subsequent calls to createSessionStorageNamespace conform to the
// WebStorage specification.
virtual WebView* createView(WebFrame* creator,
- const WebWindowFeatures& features) { return 0; }
+ const WebWindowFeatures& features,
+ const WebString& name) { return 0; }
// Create a new WebPopupMenu. In the second form, the client is
// responsible for rendering the contents of the popup menu.
@@ -124,6 +125,8 @@ public:
virtual bool isSmartInsertDeleteEnabled() { return true; }
virtual bool isSelectTrailingWhitespaceEnabled() { return true; }
+
+ // DEPRECATED: replaced by WebWidgetClient::resetInputMethod().
virtual void setInputMethodEnabled(bool enabled) { }
virtual void didBeginEditing() { }
diff --git a/WebKit/chromium/public/WebWidget.h b/WebKit/chromium/public/WebWidget.h
index b1feee9..3da245b 100644
--- a/WebKit/chromium/public/WebWidget.h
+++ b/WebKit/chromium/public/WebWidget.h
@@ -34,6 +34,8 @@
#include "WebCanvas.h"
#include "WebCommon.h"
#include "WebCompositionCommand.h"
+#include "WebCompositionUnderline.h"
+#include "WebTextInputType.h"
#include "WebTextDirection.h"
namespace WebKit {
@@ -42,6 +44,7 @@ class WebInputEvent;
class WebString;
struct WebRect;
struct WebSize;
+template <typename T> class WebVector;
class WebWidget {
public:
@@ -76,17 +79,39 @@ public:
// Called to inform the WebWidget that it has gained or lost keyboard focus.
virtual void setFocus(bool) = 0;
- // Called to inform the WebWidget of a composition event.
+ // DEPRECATED. It's replaced by setComposition() and confirmComposition().
virtual bool handleCompositionEvent(WebCompositionCommand command,
int cursorPosition,
int targetStart,
int targetEnd,
const WebString& text) = 0;
- // Retrieve the status of this WebWidget required by IME APIs. Upon
- // success enabled and caretBounds are set.
+ // Called to inform the WebWidget of a new composition text.
+ // If selectionStart and selectionEnd has the same value, then it indicates
+ // the input caret position. If the text is empty, then the existing
+ // composition text will be cancelled.
+ // Returns true if the composition text was set successfully.
+ virtual bool setComposition(
+ const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart,
+ int selectionEnd) = 0;
+
+ // Called to inform the WebWidget to confirm an ongoing composition.
+ // Returns true if there is an ongoing composition.
+ virtual bool confirmComposition() = 0;
+
+ // DEPRECATED. It's replaced by textInputType() and
+ // caretOrSelectionBounds().
virtual bool queryCompositionStatus(bool* enabled, WebRect* caretBounds) = 0;
+ // Returns the current text input type of this WebWidget.
+ virtual WebTextInputType textInputType() = 0;
+
+ // Returns the current caret bounds of this WebWidget. The selection bounds
+ // will be returned if a selection range is available.
+ virtual WebRect caretOrSelectionBounds() = 0;
+
// Changes the text direction of the selected input node.
virtual void setTextDirection(WebTextDirection) = 0;
diff --git a/WebKit/chromium/public/WebWidgetClient.h b/WebKit/chromium/public/WebWidgetClient.h
index 06d9eba..bd7bd6a 100644
--- a/WebKit/chromium/public/WebWidgetClient.h
+++ b/WebKit/chromium/public/WebWidgetClient.h
@@ -83,6 +83,10 @@ public:
// displayed.
virtual WebScreenInfo screenInfo() { return WebScreenInfo(); }
+ // When this method gets called, WebWidgetClient implementation should
+ // reset the input method by cancelling any ongoing composition.
+ virtual void resetInputMethod() { }
+
protected:
~WebWidgetClient() { }
};
diff --git a/WebKit/chromium/public/mac/WebSandboxSupport.h b/WebKit/chromium/public/mac/WebSandboxSupport.h
new file mode 100644
index 0000000..57d48aa
--- /dev/null
+++ b/WebKit/chromium/public/mac/WebSandboxSupport.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 WebSandboxSupport_h
+#define WebSandboxSupport_h
+
+typedef uintptr_t ATSFontContainerRef;
+
+#ifdef __OBJC__
+@class NSFont;
+#else
+class NSFont;
+#endif
+
+namespace WebKit {
+
+// Put methods here that are required due to sandbox restrictions.
+class WebSandboxSupport {
+public:
+ // Given an input font - |srcFont| [which can't be loaded due to sandbox
+ // restrictions]. Return a font container belonging to an equivalent
+ // font file that can be used to access the font.
+ //
+ // Note that a font container may contain multiple fonts, the caller is
+ // responsible for retreiving the appropriate font from the container.
+ //
+ // If this function succeeds, the caller assumes ownership of the |out|
+ // parameter and must call ATSFontDeactivate() to unload it when done.
+ //
+ // Returns: true on success, false on error.
+ virtual bool loadFont(NSFont* srcFont, ATSFontContainerRef* out) = 0;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/ApplicationCacheHostInternal.h b/WebKit/chromium/src/ApplicationCacheHostInternal.h
index bf6c4ae..edaaca9 100644
--- a/WebKit/chromium/src/ApplicationCacheHostInternal.h
+++ b/WebKit/chromium/src/ApplicationCacheHostInternal.h
@@ -39,6 +39,7 @@
#include "WebFrameImpl.h"
#include "WebKit.h"
#include "WebKitClient.h"
+#include "WebURL.h"
namespace WebCore {
@@ -57,6 +58,17 @@ public:
m_innerHost->notifyDOMApplicationCache(static_cast<ApplicationCacheHost::EventID>(eventID));
}
+ virtual void notifyProgressEventListener(const WebKit::WebURL&, int num_total, int num_complete)
+ {
+ // FIXME: Modify webcore's progress event handling to carry the extra info and alter the
+ // layout tests to not fail when the more recently specified 'final' event is raised.
+ // For now, we're eating the extra info and that last event.
+ // See https://bugs.webkit.org/show_bug.cgi?id=37602
+ if (num_complete == num_total)
+ return;
+ notifyEventListener(WebKit::WebApplicationCacheHost::ProgressEvent);
+ }
+
static WebKit::WebApplicationCacheHost* toWebApplicationCacheHost(ApplicationCacheHost* innerHost)
{
if (innerHost && innerHost->m_internal.get())
diff --git a/WebKit/chromium/src/AssertMatchingEnums.cpp b/WebKit/chromium/src/AssertMatchingEnums.cpp
index fa7d73a..819339d 100644
--- a/WebKit/chromium/src/AssertMatchingEnums.cpp
+++ b/WebKit/chromium/src/AssertMatchingEnums.cpp
@@ -127,6 +127,7 @@ COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleDefinitionListDefinition, Defin
COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleAnnotation, AnnotationRole);
COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleSliderThumb, SliderThumbRole);
COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleIgnored, IgnoredRole);
+COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRolePresentational, PresentationalRole);
COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTab, TabRole);
COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTabList, TabListRole);
COMPILE_ASSERT_MATCHING_ENUM(WebAccessibilityRoleTabPanel, TabPanelRole);
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index 8084aad..04c02f2 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -56,7 +56,7 @@ WebString AutoFillPopupMenuClient::getSuggestion(unsigned listIndex) const
--listIndex;
// FIXME: Modify the PopupMenu to add the label in gray right-justified.
- ASSERT(listIndex >= 0 && listIndex < m_names.size());
+ ASSERT(listIndex < m_names.size());
WebString suggestion = m_names[listIndex];
if (m_labels[listIndex].isEmpty())
@@ -68,7 +68,7 @@ WebString AutoFillPopupMenuClient::getSuggestion(unsigned listIndex) const
void AutoFillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex)
{
// FIXME: Do we want to remove AutoFill suggestions?
- ASSERT(listIndex >= 0 && listIndex < m_names.size());
+ ASSERT(listIndex < m_names.size());
m_names.remove(listIndex);
m_labels.remove(listIndex);
}
@@ -82,7 +82,7 @@ void AutoFillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)
if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
--listIndex;
- ASSERT(listIndex >= 0 && listIndex < m_names.size());
+ ASSERT(listIndex < m_names.size());
webView->client()->didAcceptAutoFillSuggestion(WebNode(getTextField()),
m_names[listIndex],
@@ -99,7 +99,7 @@ void AutoFillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEven
if (m_separatorIndex != -1 && listIndex > static_cast<unsigned>(m_separatorIndex))
--listIndex;
- ASSERT(listIndex >= 0 && listIndex < m_names.size());
+ ASSERT(listIndex < m_names.size());
webView->client()->didSelectAutoFillSuggestion(WebNode(getTextField()),
m_names[listIndex],
diff --git a/WebKit/chromium/src/AutocompletePopupMenuClient.cpp b/WebKit/chromium/src/AutocompletePopupMenuClient.cpp
index 9620ffc..ed4f670 100644
--- a/WebKit/chromium/src/AutocompletePopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutocompletePopupMenuClient.cpp
@@ -46,13 +46,13 @@ unsigned AutocompletePopupMenuClient::getSuggestionsCount() const
WebString AutocompletePopupMenuClient::getSuggestion(unsigned listIndex) const
{
- ASSERT(listIndex >= 0 && listIndex < m_suggestions.size());
+ ASSERT(listIndex < m_suggestions.size());
return m_suggestions[listIndex];
}
void AutocompletePopupMenuClient::removeSuggestionAtIndex(unsigned listIndex)
{
- ASSERT(listIndex >= 0 && listIndex < m_suggestions.size());
+ ASSERT(listIndex < m_suggestions.size());
m_suggestions.remove(listIndex);
}
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 559a62b..54c81aa 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -231,7 +231,7 @@ Page* ChromeClientImpl::createWindow(
return 0;
WebViewImpl* newView = static_cast<WebViewImpl*>(
- m_webView->client()->createView(WebFrameImpl::fromFrame(frame), features));
+ m_webView->client()->createView(WebFrameImpl::fromFrame(frame), features, r.frameName()));
if (!newView)
return 0;
diff --git a/WebKit/chromium/src/ChromiumBridge.cpp b/WebKit/chromium/src/ChromiumBridge.cpp
index 3b8e5fa..4963f78 100644
--- a/WebKit/chromium/src/ChromiumBridge.cpp
+++ b/WebKit/chromium/src/ChromiumBridge.cpp
@@ -49,6 +49,7 @@
#include "WebMimeRegistry.h"
#include "WebPluginContainerImpl.h"
#include "WebPluginListBuilderImpl.h"
+#include "WebSandboxSupport.h"
#include "WebScreenInfo.h"
#include "WebString.h"
#include "WebURL.h"
@@ -59,12 +60,10 @@
#if OS(WINDOWS)
#include "WebRect.h"
-#include "WebSandboxSupport.h"
#include "WebThemeEngine.h"
#endif
#if OS(LINUX)
-#include "WebSandboxSupport.h"
#include "WebFontInfo.h"
#include "WebFontRenderStyle.h"
#endif
@@ -404,6 +403,22 @@ void ChromiumBridge::getRenderStyleForStrike(const char* font, int sizeAndStyle,
}
#endif
+#if OS(DARWIN)
+bool ChromiumBridge::loadFont(NSFont* srcFont, ATSFontContainerRef* out)
+{
+ WebSandboxSupport* ss = webKitClient()->sandboxSupport();
+ if (ss)
+ return ss->loadFont(srcFont, out);
+
+ // This function should only be called in response to an error loading a
+ // font due to being blocked by the sandbox.
+ // This by definition shouldn't happen if there is no sandbox support.
+ ASSERT_NOT_REACHED();
+ *out = 0;
+ return false;
+}
+#endif
+
// Geolocation ----------------------------------------------------------------
GeolocationServiceBridge* ChromiumBridge::createGeolocationServiceBridge(GeolocationServiceChromium* geolocationServiceChromium)
diff --git a/WebKit/chromium/src/CompositionUnderlineBuilder.h b/WebKit/chromium/src/CompositionUnderlineBuilder.h
new file mode 100644
index 0000000..ce62474
--- /dev/null
+++ b/WebKit/chromium/src/CompositionUnderlineBuilder.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 CompositionUnderlineBuilder_h
+#define CompositionUnderlineBuilder_h
+
+#include "Editor.h"
+#include "Vector.h"
+#include "WebCompositionUnderline.h"
+#include "WebVector.h"
+
+namespace WebKit {
+
+// This class is used for converting from WebCompositionUnderline to
+// WebCore::CompositionUnderline.
+
+class CompositionUnderlineBuilder : public WebCore::CompositionUnderline {
+public:
+ CompositionUnderlineBuilder(const WebCompositionUnderline& u)
+ : WebCore::CompositionUnderline(u.startOffset, u.endOffset,
+ WebCore::Color(u.color), u.thick) { }
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp
new file mode 100644
index 0000000..55dca85
--- /dev/null
+++ b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "CompositionUnderlineVectorBuilder.h"
+
+#include "CompositionUnderlineBuilder.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+CompositionUnderlineVectorBuilder::CompositionUnderlineVectorBuilder(
+ const WebVector<WebCompositionUnderline>& underlines)
+{
+ size_t size = underlines.size();
+ reserveCapacity(size);
+ for (size_t i = 0; i < size; ++i)
+ append(CompositionUnderlineBuilder(underlines[i]));
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h
new file mode 100644
index 0000000..8050f02
--- /dev/null
+++ b/WebKit/chromium/src/CompositionUnderlineVectorBuilder.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 CompositionUnderlineVectorBuilder_h
+#define CompositionUnderlineVectorBuilder_h
+
+#include "Editor.h"
+#include "Vector.h"
+#include "WebCompositionUnderline.h"
+#include "WebVector.h"
+
+namespace WebKit {
+
+// This classes are used for converting from std::vector<WebCompositionUnderline>
+// to Vector<WebCore::CompositionUnderline>.
+
+class CompositionUnderlineVectorBuilder :
+ public Vector<WebCore::CompositionUnderline> {
+public:
+ CompositionUnderlineVectorBuilder(
+ const WebVector<WebCompositionUnderline>&);
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/DatabaseObserver.cpp b/WebKit/chromium/src/DatabaseObserver.cpp
index be658fe..e1b7cbe 100644
--- a/WebKit/chromium/src/DatabaseObserver.cpp
+++ b/WebKit/chromium/src/DatabaseObserver.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "DatabaseObserver.h"
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "Document.h"
#include "ScriptExecutionContext.h"
#include "WebDatabase.h"
@@ -65,19 +65,19 @@ bool DatabaseObserver::canEstablishDatabase(ScriptExecutionContext* scriptExecut
return true;
}
-void DatabaseObserver::databaseOpened(Database* database)
+void DatabaseObserver::databaseOpened(AbstractDatabase* database)
{
ASSERT(database->scriptExecutionContext()->isContextThread());
WebDatabase::observer()->databaseOpened(WebDatabase(database));
}
-void DatabaseObserver::databaseModified(Database* database)
+void DatabaseObserver::databaseModified(AbstractDatabase* database)
{
ASSERT(database->scriptExecutionContext()->isContextThread());
WebDatabase::observer()->databaseModified(WebDatabase(database));
}
-void DatabaseObserver::databaseClosed(Database* database)
+void DatabaseObserver::databaseClosed(AbstractDatabase* database)
{
ASSERT(database->scriptExecutionContext()->isContextThread());
WebDatabase::observer()->databaseClosed(WebDatabase(database));
diff --git a/WebKit/chromium/src/DebuggerAgentManager.cpp b/WebKit/chromium/src/DebuggerAgentManager.cpp
index a30675d..939f4ed 100644
--- a/WebKit/chromium/src/DebuggerAgentManager.cpp
+++ b/WebKit/chromium/src/DebuggerAgentManager.cpp
@@ -265,9 +265,9 @@ void DebuggerAgentManager::setMessageLoopDispatchHandler(WebDevToolsAgent::Messa
void DebuggerAgentManager::setExposeV8DebuggerProtocol(bool value)
{
s_exposeV8DebuggerProtocol = value;
+ WebCore::ScriptDebugServer::shared().setEnabled(!s_exposeV8DebuggerProtocol);
}
-
void DebuggerAgentManager::setHostId(WebFrameImpl* webframe, int hostId)
{
ASSERT(hostId > 0);
diff --git a/WebKit/chromium/src/DragScrollTimer.cpp b/WebKit/chromium/src/DragScrollTimer.cpp
new file mode 100644
index 0000000..83b81b7
--- /dev/null
+++ b/WebKit/chromium/src/DragScrollTimer.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DragScrollTimer.h"
+
+#include "FrameView.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+// Computes the distance from a point outside a rect to the nearest edge of the rect.
+static IntSize distanceToRect(const IntPoint& point, const IntRect& rect)
+{
+ int dx = 0, dy = 0;
+ if (point.x() < rect.x())
+ dx = point.x() - rect.x();
+ else if (rect.right() < point.x())
+ dx = point.x() - rect.right();
+ if (point.y() < rect.y())
+ dy = point.y() - rect.y();
+ else if (rect.bottom() < point.y())
+ dy = point.y() - rect.bottom();
+ return IntSize(dx, dy);
+}
+
+DragScrollTimer::DragScrollTimer()
+ : m_timer(this, &DragScrollTimer::fired)
+ , m_view(0)
+ , m_scrolling(false)
+{
+}
+
+DragScrollTimer::~DragScrollTimer()
+{
+ // We do this for detecting dead object earlier
+ stop();
+}
+
+void DragScrollTimer::stop()
+{
+ m_timer.stop();
+ m_view = 0;
+ m_scrolling = false;
+}
+
+void DragScrollTimer::scroll()
+{
+ m_view->scrollBy(m_lastDistance);
+ m_scrolling = true;
+}
+
+void DragScrollTimer::update()
+{
+ if (shouldScroll())
+ scroll();
+ else
+ stop();
+}
+
+void DragScrollTimer::triggerScroll(FrameView* view, const WebPoint& location)
+{
+ if (!view)
+ return;
+
+ // Approximates Safari
+ static const double scrollStartDelay = 0.2;
+
+ m_view = view;
+ m_lastDistance = scrollDistanceFor(view, location);
+
+ if (m_scrolling)
+ update();
+ else if (shouldScroll() && !m_timer.isActive())
+ m_timer.startOneShot(scrollStartDelay);
+}
+
+IntSize DragScrollTimer::scrollDistanceFor(FrameView* view, const WebPoint& location) const
+{
+ static const int scrollMargin = 30;
+
+ IntRect bounds(0, 0, view->visibleWidth(), view->visibleHeight());
+ if (!bounds.contains(location))
+ return IntSize(0, 0); // The location is outside the border belt.
+
+ bounds.setY(bounds.y() + scrollMargin);
+ bounds.setHeight(bounds.height() - scrollMargin * 2);
+ bounds.setX(bounds.x() + scrollMargin);
+ bounds.setWidth(bounds.width() - scrollMargin * 2);
+
+ if (bounds.contains(location))
+ return IntSize(0, 0); // The location is inside the border belt.
+
+ // The location is over the border belt.
+ return distanceToRect(location, bounds);
+}
+
+} // namespace WebKit
diff --git a/WebKit/chromium/src/DragScrollTimer.h b/WebKit/chromium/src/DragScrollTimer.h
new file mode 100644
index 0000000..a4090e0
--- /dev/null
+++ b/WebKit/chromium/src/DragScrollTimer.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * 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 DragScrollTimer_h
+#define DragScrollTimer_h
+
+#include "IntSize.h"
+#include "Timer.h"
+#include "WebPoint.h"
+
+namespace WebCore { class FrameView; }
+
+namespace WebKit {
+
+//
+// Encapsulating a timer and associated state management for
+// scroll-on-drag behaviour.
+//
+class DragScrollTimer {
+public:
+ DragScrollTimer();
+ ~DragScrollTimer();
+
+ void fired(WebCore::Timer<DragScrollTimer>*) { update(); }
+ void triggerScroll(WebCore::FrameView*, const WebPoint&);
+ void stop();
+
+private:
+ void scroll();
+ void update();
+ WebCore::IntSize scrollDistanceFor(WebCore::FrameView*, const WebPoint&) const;
+ bool shouldScroll() const { return !m_lastDistance.isZero(); }
+
+ WebCore::Timer<DragScrollTimer> m_timer;
+ WebCore::FrameView* m_view;
+ WebCore::IntSize m_lastDistance;
+ bool m_scrolling;
+};
+
+} // namespace WebKit
+
+#endif
diff --git a/WebKit/chromium/src/EditorClientImpl.cpp b/WebKit/chromium/src/EditorClientImpl.cpp
index 4eda1f6..2a40d78 100644
--- a/WebKit/chromium/src/EditorClientImpl.cpp
+++ b/WebKit/chromium/src/EditorClientImpl.cpp
@@ -921,8 +921,13 @@ void EditorClientImpl::getGuessesForWord(const String&,
void EditorClientImpl::setInputMethodState(bool enabled)
{
- if (m_webView->client())
+ if (m_webView->client()) {
+ m_webView->client()->resetInputMethod();
+
+ // Remove this line when WebViewClient::setInputMethodEnabled() gets
+ // removed.
m_webView->client()->setInputMethodEnabled(enabled);
+ }
}
} // namesace WebKit
diff --git a/WebKit/chromium/src/FrameLoaderClientImpl.cpp b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
index 694d7c2..dae9348 100644
--- a/WebKit/chromium/src/FrameLoaderClientImpl.cpp
+++ b/WebKit/chromium/src/FrameLoaderClientImpl.cpp
@@ -735,9 +735,6 @@ void FrameLoaderClientImpl::dispatchDidCommitLoad()
if (m_webFrame->client())
m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, isNewNavigation);
-
- if (webview->devToolsAgentPrivate())
- webview->devToolsAgentPrivate()->didCommitProvisionalLoad(m_webFrame, isNewNavigation);
}
void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad(
diff --git a/WebKit/chromium/src/GLES2Context.cpp b/WebKit/chromium/src/GLES2Context.cpp
index 9dd4eff..b6d619c 100644
--- a/WebKit/chromium/src/GLES2Context.cpp
+++ b/WebKit/chromium/src/GLES2Context.cpp
@@ -47,6 +47,8 @@
// WebGLES2Context. This is done so we have a place to inject an
// implementation which creates the GL ES context.
+using namespace WebKit;
+
namespace WebCore {
class GLES2ContextInternal {
@@ -56,23 +58,20 @@ public:
bool initialize(Page*);
- WebKit::WebGLES2Context* getWebGLES2Context() { return m_impl.get(); }
+ WebGLES2Context* getWebGLES2Context() { return m_impl; }
private:
- OwnPtr<WebKit::WebGLES2Context> m_impl;
+ WebGLES2Context* m_impl;
};
bool GLES2ContextInternal::initialize(Page* page)
{
- m_impl = WebKit::webKitClient()->createGLES2Context();
+ ASSERT(page);
+ WebViewImpl* webView = WebViewImpl::fromPage(page);
+ m_impl = webView->gles2Context();
if (!m_impl)
return false;
- WebKit::WebViewImpl* webView = WebKit::WebViewImpl::fromPage(page);
- if (!m_impl->initialize(webView)) {
- m_impl.clear();
- return false;
- }
return true;
}
@@ -94,7 +93,7 @@ GLES2Context::~GLES2Context()
bool GLES2Context::makeCurrent()
{
- WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context();
+ WebGLES2Context* webContext = m_internal->getWebGLES2Context();
if (!webContext)
return false;
return webContext->makeCurrent();
@@ -102,7 +101,7 @@ bool GLES2Context::makeCurrent()
bool GLES2Context::destroy()
{
- WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context();
+ WebGLES2Context* webContext = m_internal->getWebGLES2Context();
if (!webContext)
return false;
return webContext->destroy();
@@ -110,7 +109,7 @@ bool GLES2Context::destroy()
bool GLES2Context::swapBuffers()
{
- WebKit::WebGLES2Context* webContext = m_internal->getWebGLES2Context();
+ WebGLES2Context* webContext = m_internal->getWebGLES2Context();
if (!webContext)
return false;
return webContext->swapBuffers();
diff --git a/WebKit/chromium/src/InspectorClientImpl.cpp b/WebKit/chromium/src/InspectorClientImpl.cpp
index 91d10d5..cf491f7 100644
--- a/WebKit/chromium/src/InspectorClientImpl.cpp
+++ b/WebKit/chromium/src/InspectorClientImpl.cpp
@@ -60,64 +60,74 @@ InspectorClientImpl::~InspectorClientImpl()
void InspectorClientImpl::inspectorDestroyed()
{
- // Our lifetime is bound to the WebViewImpl.
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->inspectorDestroyed();
}
-void InspectorClientImpl::openInspectorFrontend(InspectorController*)
+void InspectorClientImpl::openInspectorFrontend(InspectorController* controller)
{
-}
-
-static void invalidateNodeBoundingRect(WebViewImpl* webView)
-{
- // FIXME: Is it important to just invalidate the rect of the node region
- // given that this is not on a critical codepath? In order to do so, we'd
- // have to take scrolling into account.
- const WebSize& size = webView->size();
- WebRect damagedRect(0, 0, size.width, size.height);
- if (webView->client())
- webView->client()->didInvalidateRect(damagedRect);
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->openInspectorFrontend(controller);
}
void InspectorClientImpl::highlight(Node* node)
{
- // InspectorController does the actually tracking of the highlighted node
- // and the drawing of the highlight. Here we just make sure to invalidate
- // the rects of the old and new nodes.
- hideHighlight();
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->highlight(node);
}
void InspectorClientImpl::hideHighlight()
{
- // FIXME: able to invalidate a smaller rect.
- invalidateNodeBoundingRect(m_inspectedWebView);
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->hideHighlight();
}
void InspectorClientImpl::populateSetting(const String& key, String* value)
{
- WebString string;
- m_inspectedWebView->inspectorSetting(key, &string);
- *value = string;
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->populateSetting(key, value);
}
void InspectorClientImpl::storeSetting(const String& key, const String& value)
{
- m_inspectedWebView->setInspectorSetting(key, value);
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->storeSetting(key, value);
}
bool InspectorClientImpl::sendMessageToFrontend(const WebCore::String& message)
{
- WebDevToolsAgentImpl* devToolsAgent = static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent());
- if (!devToolsAgent)
- return false;
-
- WebVector<WebString> arguments(size_t(1));
- arguments[0] = message;
- WebDevToolsMessageData data;
- data.className = "ToolsAgentDelegate";
- data.methodName = "dispatchOnClient";
- data.arguments.swap(arguments);
- devToolsAgent->sendRpcMessage(data);
- return true;
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ return agent->sendMessageToFrontend(message);
+ return false;
+}
+
+void InspectorClientImpl::resourceTrackingWasEnabled()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->resourceTrackingWasEnabled();
+}
+
+void InspectorClientImpl::resourceTrackingWasDisabled()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->resourceTrackingWasDisabled();
+}
+
+void InspectorClientImpl::timelineProfilerWasStarted()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->timelineProfilerWasStarted();
+}
+
+void InspectorClientImpl::timelineProfilerWasStopped()
+{
+ if (WebDevToolsAgentImpl* agent = devToolsAgent())
+ agent->timelineProfilerWasStopped();
+}
+
+WebDevToolsAgentImpl* InspectorClientImpl::devToolsAgent()
+{
+ return static_cast<WebDevToolsAgentImpl*>(m_inspectedWebView->devToolsAgent());
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/InspectorClientImpl.h b/WebKit/chromium/src/InspectorClientImpl.h
index f4994e3..0605ccd 100644
--- a/WebKit/chromium/src/InspectorClientImpl.h
+++ b/WebKit/chromium/src/InspectorClientImpl.h
@@ -38,6 +38,7 @@
namespace WebKit {
class WebDevToolsAgentClient;
+class WebDevToolsAgentImpl;
class WebViewImpl;
class InspectorClientImpl : public WebCore::InspectorClient {
@@ -56,7 +57,13 @@ public:
virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
virtual bool sendMessageToFrontend(const WebCore::String&);
+
+ virtual void resourceTrackingWasEnabled();
+ virtual void resourceTrackingWasDisabled();
+ virtual void timelineProfilerWasStarted();
+ virtual void timelineProfilerWasStopped();
private:
+ WebDevToolsAgentImpl* devToolsAgent();
// The WebViewImpl of the page being inspected; gets passed to the constructor
WebViewImpl* m_inspectedWebView;
diff --git a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
index 6f7ed95..83b925a 100644
--- a/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
+++ b/WebKit/chromium/src/InspectorFrontendClientImpl.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "InspectorFrontendClientImpl.h"
+#include "Document.h"
+#include "Frame.h"
#include "InspectorFrontendHost.h"
#include "Page.h"
#include "PlatformString.h"
@@ -120,9 +122,9 @@ void InspectorFrontendClientImpl::changeAttachedWindowHeight(unsigned)
// Do nothing;
}
-void InspectorFrontendClientImpl::inspectedURLChanged(const String&)
+void InspectorFrontendClientImpl::inspectedURLChanged(const String& url)
{
- // Do nothing;
+ m_frontendPage->mainFrame()->document()->setTitle("Developer Tools - " + url);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/NotificationPresenterImpl.cpp b/WebKit/chromium/src/NotificationPresenterImpl.cpp
index c928c91..dca1856 100644
--- a/WebKit/chromium/src/NotificationPresenterImpl.cpp
+++ b/WebKit/chromium/src/NotificationPresenterImpl.cpp
@@ -88,10 +88,7 @@ void NotificationPresenterImpl::cancel(Notification* notification)
void NotificationPresenterImpl::notificationObjectDestroyed(Notification* notification)
{
- // TODO(pkasting): We cannot ref an object that's being destroyed. Either
- // this function needs to be called earlier than in ~Notification(), or it
- // needs to not ref this object.
- //m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
+ m_presenter->objectDestroyed(PassRefPtr<Notification>(notification));
}
NotificationPresenter::Permission NotificationPresenterImpl::checkPermission(const KURL& sourceURL)
diff --git a/WebKit/chromium/src/ToolsAgent.h b/WebKit/chromium/src/ToolsAgent.h
index ab48153..c748c8a 100644
--- a/WebKit/chromium/src/ToolsAgent.h
+++ b/WebKit/chromium/src/ToolsAgent.h
@@ -50,9 +50,6 @@ namespace WebKit {
DEFINE_RPC_CLASS(ToolsAgent, TOOLS_AGENT_STRUCT)
#define TOOLS_AGENT_DELEGATE_STRUCT(METHOD0, METHOD1, METHOD2, METHOD3, METHOD4, METHOD5) \
- /* Updates focused node on the client. */ \
- METHOD1(frameNavigate, String /* url */) \
- \
/* Response to the DispatchOn*. */ \
METHOD3(didDispatchOn, int /* call_id */, String /* result */, String /* exception */) \
\
diff --git a/WebKit/chromium/src/WebCString.cpp b/WebKit/chromium/src/WebCString.cpp
index b484b19..f81d7f4 100644
--- a/WebKit/chromium/src/WebCString.cpp
+++ b/WebKit/chromium/src/WebCString.cpp
@@ -41,6 +41,18 @@ namespace WebKit {
class WebCStringPrivate : public WTF::CStringBuffer {
};
+int WebCString::compare(const WebCString& other) const
+{
+ // A null string is always less than a non null one.
+ if (isNull() != other.isNull())
+ return isNull() ? -1 : 1;
+
+ if (isNull())
+ return 0; // Both WebStrings are null.
+
+ return strcmp(m_private->data(), other.m_private->data());
+}
+
void WebCString::reset()
{
if (m_private) {
diff --git a/WebKit/chromium/src/WebDatabase.cpp b/WebKit/chromium/src/WebDatabase.cpp
index 1479eb0..376509d 100644
--- a/WebKit/chromium/src/WebDatabase.cpp
+++ b/WebKit/chromium/src/WebDatabase.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "WebDatabase.h"
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "DatabaseTask.h"
#include "DatabaseThread.h"
#include "DatabaseTracker.h"
@@ -50,7 +50,7 @@ namespace WebKit {
static WebDatabaseObserver* databaseObserver = 0;
-class WebDatabasePrivate : public Database {
+class WebDatabasePrivate : public AbstractDatabase {
};
void WebDatabase::reset()
@@ -110,34 +110,27 @@ void WebDatabase::updateDatabaseSize(
void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, const WebString& databaseName)
{
- HashSet<RefPtr<Database> > databaseHandles;
- PassRefPtr<SecurityOrigin> originPrp(WebSecurityOrigin::createFromDatabaseIdentifier(originIdentifier));
- RefPtr<SecurityOrigin> origin = originPrp;
+ HashSet<RefPtr<AbstractDatabase> > databaseHandles;
+ RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
DatabaseTracker::tracker().getOpenDatabases(origin.get(), databaseName, &databaseHandles);
- for (HashSet<RefPtr<Database> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it) {
- Database* database = it->get();
- DatabaseThread* databaseThread = database->scriptExecutionContext()->databaseThread();
- if (databaseThread && !databaseThread->terminationRequested()) {
- database->stop();
- databaseThread->scheduleTask(DatabaseCloseTask::create(database, Database::RemoveDatabaseFromContext, 0));
- }
- }
+ for (HashSet<RefPtr<AbstractDatabase> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it)
+ it->get()->closeImmediately();
}
-WebDatabase::WebDatabase(const WTF::PassRefPtr<Database>& database)
+WebDatabase::WebDatabase(const WTF::PassRefPtr<AbstractDatabase>& database)
: m_private(static_cast<WebDatabasePrivate*>(database.releaseRef()))
{
}
-WebDatabase& WebDatabase::operator=(const WTF::PassRefPtr<Database>& database)
+WebDatabase& WebDatabase::operator=(const WTF::PassRefPtr<AbstractDatabase>& database)
{
assign(static_cast<WebDatabasePrivate*>(database.releaseRef()));
return *this;
}
-WebDatabase::operator WTF::PassRefPtr<Database>() const
+WebDatabase::operator WTF::PassRefPtr<AbstractDatabase>() const
{
- return PassRefPtr<Database>(const_cast<WebDatabasePrivate*>(m_private));
+ return PassRefPtr<AbstractDatabase>(const_cast<WebDatabasePrivate*>(m_private));
}
void WebDatabase::assign(WebDatabasePrivate* d)
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
index c4bbbfa..c0e9b44 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
@@ -60,12 +60,15 @@
#include "WebDataSource.h"
#include "WebDevToolsAgentClient.h"
#include "WebDevToolsMessageData.h"
+#include "WebDevToolsMessageTransport.h"
#include "WebFrameImpl.h"
+#include "WebRect.h"
#include "WebString.h"
#include "WebURL.h"
#include "WebURLError.h"
#include "WebURLRequest.h"
#include "WebURLResponse.h"
+#include "WebViewClient.h"
#include "WebViewImpl.h"
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
@@ -103,32 +106,23 @@ void InspectorBackendWeakReferenceCallback(v8::Persistent<v8::Value> object, voi
object.Dispose();
}
-void SetApuAgentEnabledInUtilityContext(v8::Handle<v8::Context> context, bool enabled)
-{
- v8::HandleScope handleScope;
- v8::Context::Scope contextScope(context);
- v8::Handle<v8::Object> dispatcher = v8::Local<v8::Object>::Cast(
- context->Global()->Get(v8::String::New("ApuAgentDispatcher")));
- if (dispatcher.IsEmpty())
- return;
- dispatcher->Set(v8::String::New("enabled"), v8::Boolean::New(enabled));
-}
-
-// TODO(pfeldman): Make this public in WebDevToolsAgent API.
-static const char kApuAgentFeatureName[] = "apu-agent";
-
-// Keep these in sync with the ones in inject_dispatch.js.
-static const char kTimelineFeatureName[] = "timeline-profiler";
static const char kResourceTrackingFeatureName[] = "resource-tracking";
+static const char kTimelineFeatureName[] = "timeline-profiler";
+static const char kApuAgentFeatureName[] = "apu-agent";
class IORPCDelegate : public DevToolsRPC::Delegate, public Noncopyable {
public:
- IORPCDelegate() { }
+ IORPCDelegate() : m_transport(0) { }
+ explicit IORPCDelegate(WebDevToolsMessageTransport* transport) : m_transport(transport) { }
virtual ~IORPCDelegate() { }
virtual void sendRpcMessage(const WebDevToolsMessageData& data)
{
- WebDevToolsAgentClient::sendMessageToFrontendOnIOThread(data);
+ if (m_transport)
+ m_transport->sendMessageToFrontendOnIOThread(data);
}
+
+private:
+ WebDevToolsMessageTransport* m_transport;
};
class ClientMessageLoopAdapter : public WebCore::ScriptDebugServer::ClientMessageLoop {
@@ -306,21 +300,6 @@ void WebDevToolsAgentImpl::didNavigate()
DebuggerAgentManager::onNavigate();
}
-void WebDevToolsAgentImpl::didCommitProvisionalLoad(WebFrameImpl* webframe, bool isNewNavigation)
-{
- if (!m_attached)
- return;
- WebDataSource* ds = webframe->dataSource();
- const WebURLRequest& request = ds->request();
- WebURL url = ds->hasUnreachableURL() ?
- ds->unreachableURL() :
- request.url();
- if (!webframe->parent()) {
- m_toolsAgentDelegateStub->frameNavigate(WebCore::KURL(url).string());
- SetApuAgentEnabledInUtilityContext(m_utilityContext, m_apuAgentEnabled);
- }
-}
-
void WebDevToolsAgentImpl::didClearWindowObject(WebFrameImpl* webframe)
{
DebuggerAgentManager::setHostId(webframe, m_hostId);
@@ -412,15 +391,6 @@ void WebDevToolsAgentImpl::initDevToolsAgentHost()
devtoolsAgentHost.addProtoFunction(
"dispatch",
WebDevToolsAgentImpl::jsDispatchOnClient);
- devtoolsAgentHost.addProtoFunction(
- "dispatchToApu",
- WebDevToolsAgentImpl::jsDispatchToApu);
- devtoolsAgentHost.addProtoFunction(
- "evaluateOnSelf",
- WebDevToolsAgentImpl::jsEvaluateOnSelf);
- devtoolsAgentHost.addProtoFunction(
- "runtimeFeatureStateChanged",
- WebDevToolsAgentImpl::jsOnRuntimeFeatureStateChanged);
devtoolsAgentHost.build();
v8::HandleScope scope;
@@ -481,7 +451,6 @@ void WebDevToolsAgentImpl::setInspectorFrontendProxyToInspectorController()
void WebDevToolsAgentImpl::setApuAgentEnabled(bool enabled)
{
m_apuAgentEnabled = enabled;
- SetApuAgentEnabledInUtilityContext(m_utilityContext, enabled);
InspectorController* ic = m_webViewImpl->page()->inspectorController();
if (enabled) {
m_resourceTrackingWasEnabled = ic->resourceTrackingEnabled();
@@ -510,55 +479,25 @@ v8::Handle<v8::Value> WebDevToolsAgentImpl::jsDispatchOnClient(const v8::Argumen
String message = WebCore::toWebCoreStringWithNullCheck(args[0]);
if (message.isEmpty() || exceptionCatcher.HasCaught())
return v8::Undefined();
+
WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value());
- agent->m_toolsAgentDelegateStub->dispatchOnClient(message);
- return v8::Undefined();
-}
-// static
-v8::Handle<v8::Value> WebDevToolsAgentImpl::jsDispatchToApu(const v8::Arguments& args)
-{
- v8::TryCatch exceptionCatcher;
- String message = WebCore::toWebCoreStringWithNullCheck(args[0]);
- if (message.isEmpty() || exceptionCatcher.HasCaught())
+ if (!agent->m_apuAgentEnabled) {
+ agent->m_toolsAgentDelegateStub->dispatchOnClient(message);
return v8::Undefined();
- WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(
- v8::External::Cast(*args.Data())->Value());
- agent->m_apuAgentDelegateStub->dispatchToApu(message);
- return v8::Undefined();
-}
-
-// static
-v8::Handle<v8::Value> WebDevToolsAgentImpl::jsEvaluateOnSelf(const v8::Arguments& args)
-{
- String code;
- {
- v8::TryCatch exceptionCatcher;
- code = WebCore::toWebCoreStringWithNullCheck(args[0]);
- if (code.isEmpty() || exceptionCatcher.HasCaught())
- return v8::Undefined();
}
- WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value());
- v8::Context::Scope(agent->m_utilityContext);
- V8Proxy* proxy = V8Proxy::retrieve(agent->m_webViewImpl->page()->mainFrame());
- v8::Local<v8::Value> result = proxy->runScript(v8::Script::Compile(v8::String::New(code.utf8().data())), true);
- return result;
-}
-// static
-v8::Handle<v8::Value> WebDevToolsAgentImpl::jsOnRuntimeFeatureStateChanged(const v8::Arguments& args)
-{
- v8::TryCatch exceptionCatcher;
- String feature = WebCore::toWebCoreStringWithNullCheck(args[0]);
- bool enabled = args[1]->ToBoolean()->Value();
- if (feature.isEmpty() || exceptionCatcher.HasCaught())
+ String method = WebCore::toWebCoreStringWithNullCheck(args[1]);
+ if (method.isEmpty() || exceptionCatcher.HasCaught())
return v8::Undefined();
- WebDevToolsAgentImpl* agent = static_cast<WebDevToolsAgentImpl*>(v8::External::Cast(*args.Data())->Value());
- agent->m_client->runtimeFeatureStateChanged(feature, enabled);
+
+ if (method != "addRecordToTimeline" && method != "updateResource" && method != "addResource")
+ return v8::Undefined();
+
+ agent->m_apuAgentDelegateStub->dispatchToApu(message);
return v8::Undefined();
}
-
WebCore::InspectorController* WebDevToolsAgentImpl::inspectorController()
{
if (Page* page = m_webViewImpl->page())
@@ -612,6 +551,83 @@ void WebDevToolsAgentImpl::didFailLoading(unsigned long resourceId, const WebURL
ic->didFailLoading(resourceId, resourceError);
}
+void WebDevToolsAgentImpl::inspectorDestroyed()
+{
+ // Our lifetime is bound to the WebViewImpl.
+}
+
+void WebDevToolsAgentImpl::openInspectorFrontend(InspectorController*)
+{
+}
+
+void WebDevToolsAgentImpl::highlight(Node* node)
+{
+ // InspectorController does the actuall tracking of the highlighted node
+ // and the drawing of the highlight. Here we just make sure to invalidate
+ // the rects of the old and new nodes.
+ hideHighlight();
+}
+
+void WebDevToolsAgentImpl::hideHighlight()
+{
+ // FIXME: able to invalidate a smaller rect.
+ // FIXME: Is it important to just invalidate the rect of the node region
+ // given that this is not on a critical codepath? In order to do so, we'd
+ // have to take scrolling into account.
+ const WebSize& size = m_webViewImpl->size();
+ WebRect damagedRect(0, 0, size.width, size.height);
+ if (m_webViewImpl->client())
+ m_webViewImpl->client()->didInvalidateRect(damagedRect);
+}
+
+void WebDevToolsAgentImpl::populateSetting(const String& key, String* value)
+{
+ WebString string;
+ m_webViewImpl->inspectorSetting(key, &string);
+ *value = string;
+}
+
+void WebDevToolsAgentImpl::storeSetting(const String& key, const String& value)
+{
+ m_webViewImpl->setInspectorSetting(key, value);
+}
+
+bool WebDevToolsAgentImpl::sendMessageToFrontend(const WebCore::String& message)
+{
+ WebDevToolsAgentImpl* devToolsAgent = static_cast<WebDevToolsAgentImpl*>(m_webViewImpl->devToolsAgent());
+ if (!devToolsAgent)
+ return false;
+
+ WebVector<WebString> arguments(size_t(1));
+ arguments[0] = message;
+ WebDevToolsMessageData data;
+ data.className = "ToolsAgentDelegate";
+ data.methodName = "dispatchOnClient";
+ data.arguments.swap(arguments);
+ devToolsAgent->sendRpcMessage(data);
+ return true;
+}
+
+void WebDevToolsAgentImpl::resourceTrackingWasEnabled()
+{
+ m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, true);
+}
+
+void WebDevToolsAgentImpl::resourceTrackingWasDisabled()
+{
+ m_client->runtimeFeatureStateChanged(kResourceTrackingFeatureName, false);
+}
+
+void WebDevToolsAgentImpl::timelineProfilerWasStarted()
+{
+ m_client->runtimeFeatureStateChanged(kTimelineFeatureName, true);
+}
+
+void WebDevToolsAgentImpl::timelineProfilerWasStopped()
+{
+ m_client->runtimeFeatureStateChanged(kTimelineFeatureName, false);
+}
+
void WebDevToolsAgentImpl::evaluateInWebInspector(long callId, const WebString& script)
{
InspectorController* ic = inspectorController();
@@ -647,10 +663,10 @@ void WebDevToolsAgent::setMessageLoopDispatchHandler(MessageLoopDispatchHandler
DebuggerAgentManager::setMessageLoopDispatchHandler(handler);
}
-bool WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(const WebDevToolsMessageData& data)
+bool WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(WebDevToolsMessageTransport* transport, const WebDevToolsMessageData& data)
{
- IORPCDelegate transport;
- ProfilerAgentDelegateStub stub(&transport);
+ IORPCDelegate delegate(transport);
+ ProfilerAgentDelegateStub stub(&delegate);
ProfilerAgentImpl agent(&stub);
return ProfilerAgentDispatch::dispatch(&agent, data);
}
diff --git a/WebKit/chromium/src/WebDevToolsAgentImpl.h b/WebKit/chromium/src/WebDevToolsAgentImpl.h
index 455dcef..c97b21f 100644
--- a/WebKit/chromium/src/WebDevToolsAgentImpl.h
+++ b/WebKit/chromium/src/WebDevToolsAgentImpl.h
@@ -31,6 +31,8 @@
#ifndef WebDevToolsAgentImpl_h
#define WebDevToolsAgentImpl_h
+#include "InspectorClient.h"
+
#include "APUAgentDelegate.h"
#include "DevToolsRPC.h"
#include "ToolsAgent.h"
@@ -41,6 +43,7 @@
namespace WebCore {
class Document;
+class InspectorClient;
class InspectorController;
class Node;
class String;
@@ -62,7 +65,8 @@ struct WebDevToolsMessageData;
class WebDevToolsAgentImpl : public WebDevToolsAgentPrivate,
public ToolsAgent,
- public DevToolsRPC::Delegate {
+ public DevToolsRPC::Delegate,
+ public WebCore::InspectorClient {
public:
WebDevToolsAgentImpl(WebViewImpl* webViewImpl, WebDevToolsAgentClient* client);
virtual ~WebDevToolsAgentImpl();
@@ -73,7 +77,6 @@ public:
// WebDevToolsAgentPrivate implementation.
virtual void didClearWindowObject(WebFrameImpl* frame);
- virtual void didCommitProvisionalLoad(WebFrameImpl* frame, bool isNewNavigation);
// WebDevToolsAgent implementation.
virtual void attach();
@@ -92,6 +95,19 @@ public:
virtual void didFinishLoading(unsigned long);
virtual void didFailLoading(unsigned long, const WebURLError&);
+ // InspectorClient implementation.
+ virtual void inspectorDestroyed();
+ virtual void openInspectorFrontend(WebCore::InspectorController*);
+ virtual void highlight(WebCore::Node*);
+ virtual void hideHighlight();
+ virtual void populateSetting(const WebCore::String& key, WebCore::String* value);
+ virtual void storeSetting(const WebCore::String& key, const WebCore::String& value);
+ virtual void resourceTrackingWasEnabled();
+ virtual void resourceTrackingWasDisabled();
+ virtual void timelineProfilerWasStarted();
+ virtual void timelineProfilerWasStopped();
+ virtual bool sendMessageToFrontend(const WebCore::String&);
+
// DevToolsRPC::Delegate implementation.
virtual void sendRpcMessage(const WebDevToolsMessageData& data);
@@ -101,9 +117,6 @@ public:
private:
static v8::Handle<v8::Value> jsDispatchOnClient(const v8::Arguments& args);
- static v8::Handle<v8::Value> jsDispatchToApu(const v8::Arguments& args);
- static v8::Handle<v8::Value> jsEvaluateOnSelf(const v8::Arguments& args);
- static v8::Handle<v8::Value> jsOnRuntimeFeatureStateChanged(const v8::Arguments& args);
void disposeUtilityContext();
diff --git a/WebKit/chromium/src/WebDevToolsAgentPrivate.h b/WebKit/chromium/src/WebDevToolsAgentPrivate.h
index 446f647..7038a5e 100644
--- a/WebKit/chromium/src/WebDevToolsAgentPrivate.h
+++ b/WebKit/chromium/src/WebDevToolsAgentPrivate.h
@@ -43,11 +43,6 @@ public:
// The window object for the frame has been cleared of any extra properties
// that may have been set by script from the previously loaded document.
virtual void didClearWindowObject(WebFrameImpl*) = 0;
-
- // The provisional datasource is now committed. The first part of the
- // response body has been received, and the encoding of the response body
- // is known.
- virtual void didCommitProvisionalLoad(WebFrameImpl*, bool isNewNavigation) = 0;
};
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
index 0a6c8de..eda2f77 100644
--- a/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
+++ b/WebKit/chromium/src/WebDevToolsFrontendImpl.cpp
@@ -105,6 +105,10 @@ WebDevToolsFrontendImpl::WebDevToolsFrontendImpl(
InspectorController* ic = m_webViewImpl->page()->inspectorController();
ic->setInspectorFrontendClient(new InspectorFrontendClientImpl(m_webViewImpl->page(), m_client, this));
+ // Put DevTools frontend Page into its own group so that it's not
+ // deferred along with inspected page.
+ m_webViewImpl->page()->setGroupName("DevToolsFrontend");
+
WebFrameImpl* frame = m_webViewImpl->mainFrameImpl();
v8::HandleScope scope;
v8::Handle<v8::Context> frameContext = V8Proxy::context(frame->frame());
diff --git a/WebKit/chromium/src/WebEntities.cpp b/WebKit/chromium/src/WebEntities.cpp
index 2b8ae3c..665d8d9 100644
--- a/WebKit/chromium/src/WebEntities.cpp
+++ b/WebKit/chromium/src/WebEntities.cpp
@@ -42,7 +42,7 @@
using namespace WebCore;
namespace {
-// Note that this file is also included by HTMLDocumentParser.cpp so we are getting
+// Note that this file is also included by LegacyHTMLDocumentParser.cpp so we are getting
// two copies of the data in memory. We can fix this by changing the script
// that generated the array to create a static const that is its length, but
// this is low priority since the data is less than 4K. We use anonymous
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index bb1f6ce..c5fa1fe 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -472,9 +472,9 @@ WebString WebFrameImpl::name() const
return m_frame->tree()->name();
}
-void WebFrameImpl::clearName()
+void WebFrameImpl::setName(const WebString& name)
{
- m_frame->tree()->clearName();
+ m_frame->tree()->setName(name);
}
WebURL WebFrameImpl::url() const
@@ -1279,6 +1279,21 @@ void WebFrameImpl::printEnd()
m_printContext.clear();
}
+bool WebFrameImpl::isPageBoxVisible(int pageIndex)
+{
+ return frame()->document()->isPageBoxVisible(pageIndex);
+}
+
+WebRect WebFrameImpl::pageAreaRectInPixels(int pageIndex)
+{
+ return frame()->document()->pageAreaRectInPixels(pageIndex);
+}
+
+WebSize WebFrameImpl::preferredPageSizeInPixels(int pageIndex)
+{
+ return frame()->document()->preferredPageSizeInPixels(pageIndex);
+}
+
bool WebFrameImpl::find(int identifier,
const WebString& searchText,
const WebFindOptions& options,
@@ -2135,14 +2150,8 @@ void WebFrameImpl::loadJavaScriptURL(const KURL& url)
if (!result.getString(scriptResult))
return;
- SecurityOrigin* securityOrigin = m_frame->document()->securityOrigin();
-
- if (!m_frame->redirectScheduler()->locationChangePending()) {
- m_frame->loader()->stopAllLoaders();
- m_frame->loader()->writer()->begin(m_frame->loader()->url(), true, securityOrigin);
- m_frame->loader()->writer()->addData(scriptResult);
- m_frame->loader()->writer()->end();
- }
+ if (!m_frame->redirectScheduler()->locationChangePending())
+ m_frame->loader()->writer()->replaceDocument(scriptResult);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebFrameImpl.h b/WebKit/chromium/src/WebFrameImpl.h
index a8b272f..c14ad9b 100644
--- a/WebKit/chromium/src/WebFrameImpl.h
+++ b/WebKit/chromium/src/WebFrameImpl.h
@@ -64,7 +64,7 @@ class WebFrameImpl : public WebFrame, public RefCounted<WebFrameImpl> {
public:
// WebFrame methods:
virtual WebString name() const;
- virtual void clearName();
+ virtual void setName(const WebString&);
virtual WebURL url() const;
virtual WebURL favIconURL() const;
virtual WebURL openSearchDescriptionURL() const;
@@ -149,6 +149,9 @@ public:
virtual float printPage(int pageToPrint, WebCanvas*);
virtual float getPrintPageShrink(int page);
virtual void printEnd();
+ virtual bool isPageBoxVisible(int pageIndex);
+ virtual WebRect pageAreaRectInPixels(int pageIndex);
+ virtual WebSize preferredPageSizeInPixels(int pageIndex);
virtual bool find(
int identifier, const WebString& searchText, const WebFindOptions&,
bool wrapWithinFrame, WebRect* selectionRect);
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 4d24ea9..b23dc35 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -1001,6 +1001,7 @@ void WebGraphicsContext3DDefaultImpl::generateMipmap(unsigned long target)
bool WebGraphicsContext3DDefaultImpl::getActiveAttrib(WebGLId program, unsigned long index, ActiveInfo& info)
{
+ makeContextCurrent();
if (!program) {
synthesizeGLError(GL_INVALID_VALUE);
return false;
@@ -1032,6 +1033,7 @@ bool WebGraphicsContext3DDefaultImpl::getActiveAttrib(WebGLId program, unsigned
bool WebGraphicsContext3DDefaultImpl::getActiveUniform(WebGLId program, unsigned long index, ActiveInfo& info)
{
+ makeContextCurrent();
GLint maxNameLength = -1;
glGetProgramiv(program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxNameLength);
if (maxNameLength < 0)
@@ -1223,6 +1225,7 @@ DELEGATE_TO_GL_2(polygonOffset, PolygonOffset, double, double)
void WebGraphicsContext3DDefaultImpl::readPixels(long x, long y, unsigned long width, unsigned long height, unsigned long format, unsigned long type, void* pixels)
{
+ makeContextCurrent();
// FIXME: remove the two glFlush calls when the driver bug is fixed, i.e.,
// all previous rendering calls should be done before reading pixels.
glFlush();
diff --git a/WebKit/chromium/src/WebHistoryItem.cpp b/WebKit/chromium/src/WebHistoryItem.cpp
index 45e4472..99ebce8 100644
--- a/WebKit/chromium/src/WebHistoryItem.cpp
+++ b/WebKit/chromium/src/WebHistoryItem.cpp
@@ -201,6 +201,17 @@ void WebHistoryItem::setDocumentState(const WebVector<WebString>& state)
m_private->setDocumentState(ds);
}
+long long WebHistoryItem::itemSequenceNumber() const
+{
+ return m_private->itemSequenceNumber();
+}
+
+void WebHistoryItem::setItemSequenceNumber(long long itemSequenceNumber)
+{
+ ensureMutable();
+ m_private->setItemSequenceNumber(itemSequenceNumber);
+}
+
long long WebHistoryItem::documentSequenceNumber() const
{
return m_private->documentSequenceNumber();
diff --git a/WebKit/chromium/src/WebNotification.cpp b/WebKit/chromium/src/WebNotification.cpp
index 5ae1557..38d91df 100644
--- a/WebKit/chromium/src/WebNotification.cpp
+++ b/WebKit/chromium/src/WebNotification.cpp
@@ -36,6 +36,7 @@
#include "Notification.h"
#include "WebString.h"
+#include "WebTextDirection.h"
#include "WebURL.h"
#include <wtf/PassRefPtr.h>
@@ -94,11 +95,19 @@ WebString WebNotification::body() const
return m_private->contents().body();
}
+// FIXME: remove dir() when unreferenced. Being replaced by direction().
WebString WebNotification::dir() const
{
return m_private->dir();
}
+WebTextDirection WebNotification::direction() const
+{
+ return (m_private->direction() == RTL) ?
+ WebTextDirectionRightToLeft :
+ WebTextDirectionLeftToRight;
+}
+
WebString WebNotification::replaceId() const
{
return m_private->replaceId();
diff --git a/WebKit/chromium/src/WebPluginListBuilderImpl.cpp b/WebKit/chromium/src/WebPluginListBuilderImpl.cpp
index 8f5a1f7..d0f7324 100644
--- a/WebKit/chromium/src/WebPluginListBuilderImpl.cpp
+++ b/WebKit/chromium/src/WebPluginListBuilderImpl.cpp
@@ -53,16 +53,13 @@ void WebPluginListBuilderImpl::addMediaTypeToLastPlugin(const WebString& name, c
MimeClassInfo info;
info.type = name;
info.desc = description;
- info.pluginIndex = m_results->size() - 1;
m_results->last().mimes.append(info);
}
void WebPluginListBuilderImpl::addFileExtensionToLastMediaType(const WebString& extension)
{
MimeClassInfo& info = m_results->last().mimes.last();
- if (!info.suffixes.isEmpty())
- info.suffixes.append(',');
- info.suffixes.append(extension);
+ info.extensions.append(extension);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.cpp b/WebKit/chromium/src/WebPopupMenuImpl.cpp
index f9da394..9ac4d34 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.cpp
+++ b/WebKit/chromium/src/WebPopupMenuImpl.cpp
@@ -230,6 +230,7 @@ void WebPopupMenuImpl::setFocus(bool enable)
{
}
+// DEPRECATED, will be removed later.
bool WebPopupMenuImpl::handleCompositionEvent(
WebCompositionCommand command, int cursorPosition, int targetStart,
int targetEnd, const WebString& imeString)
@@ -237,11 +238,34 @@ bool WebPopupMenuImpl::handleCompositionEvent(
return false;
}
+bool WebPopupMenuImpl::setComposition(
+ const WebString& text, const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart, int selectionEnd)
+{
+ return false;
+}
+
+bool WebPopupMenuImpl::confirmComposition()
+{
+ return false;
+}
+
+// DEPRECATED, will be removed later.
bool WebPopupMenuImpl::queryCompositionStatus(bool* enabled, WebRect* caretRect)
{
return false;
}
+WebTextInputType WebPopupMenuImpl::textInputType()
+{
+ return WebTextInputTypeNone;
+}
+
+WebRect WebPopupMenuImpl::caretOrSelectionBounds()
+{
+ return WebRect();
+}
+
void WebPopupMenuImpl::setTextDirection(WebTextDirection direction)
{
}
diff --git a/WebKit/chromium/src/WebPopupMenuImpl.h b/WebKit/chromium/src/WebPopupMenuImpl.h
index a2602b0..95f776e 100644
--- a/WebKit/chromium/src/WebPopupMenuImpl.h
+++ b/WebKit/chromium/src/WebPopupMenuImpl.h
@@ -66,10 +66,21 @@ public:
virtual bool handleInputEvent(const WebInputEvent&);
virtual void mouseCaptureLost();
virtual void setFocus(bool enable);
+
+ // DEPRECATED, will be removed later.
virtual bool handleCompositionEvent(
WebCompositionCommand command, int cursorPosition,
int targetStart, int targetEnd, const WebString& text);
+ virtual bool setComposition(
+ const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart, int selectionEnd);
+ virtual bool confirmComposition();
+
+ // DEPRECATED, will be removed later.
virtual bool queryCompositionStatus(bool* enabled, WebRect* caretRect);
+ virtual WebTextInputType textInputType();
+ virtual WebRect caretOrSelectionBounds();
virtual void setTextDirection(WebTextDirection direction);
virtual bool isAcceleratedCompositingActive() const { return false; }
diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp
index 8e73d6f..595a47f 100644
--- a/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -31,7 +31,7 @@
#include "config.h"
#include "WebRuntimeFeatures.h"
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "RuntimeEnabledFeatures.h"
#include "WebMediaPlayerClientImpl.h"
#include "WebSocket.h"
@@ -43,14 +43,14 @@ namespace WebKit {
void WebRuntimeFeatures::enableDatabase(bool enable)
{
#if ENABLE(DATABASE)
- Database::setIsAvailable(enable);
+ AbstractDatabase::setIsAvailable(enable);
#endif
}
bool WebRuntimeFeatures::isDatabaseEnabled()
{
#if ENABLE(DATABASE)
- return Database::isAvailable();
+ return AbstractDatabase::isAvailable();
#else
return false;
#endif
diff --git a/WebKit/chromium/src/WebURLResponse.cpp b/WebKit/chromium/src/WebURLResponse.cpp
index d5ba707..3f3ddba 100644
--- a/WebKit/chromium/src/WebURLResponse.cpp
+++ b/WebKit/chromium/src/WebURLResponse.cpp
@@ -287,6 +287,16 @@ void WebURLResponse::setWasNpnNegotiated(bool value)
m_private->m_resourceResponse->setWasNpnNegotiated(value);
}
+bool WebURLResponse::wasAlternateProtocolAvailable() const
+{
+ return m_private->m_resourceResponse->wasAlternateProtocolAvailable();
+}
+
+void WebURLResponse::setWasAlternateProtocolAvailable(bool value)
+{
+ m_private->m_resourceResponse->setWasAlternateProtocolAvailable(value);
+}
+
bool WebURLResponse::wasFetchedViaProxy() const
{
return m_private->m_resourceResponse->wasFetchedViaProxy();
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 5adc35c..257d646 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -35,6 +35,7 @@
#include "AutocompletePopupMenuClient.h"
#include "AXObjectCache.h"
#include "Chrome.h"
+#include "CompositionUnderlineVectorBuilder.h"
#include "ContextMenu.h"
#include "ContextMenuController.h"
#include "ContextMenuItem.h"
@@ -45,6 +46,7 @@
#include "DocumentLoader.h"
#include "DOMUtilitiesPrivate.h"
#include "DragController.h"
+#include "DragScrollTimer.h"
#include "DragData.h"
#include "Editor.h"
#include "EventHandler.h"
@@ -81,14 +83,18 @@
#include "SecurityOrigin.h"
#include "SelectionController.h"
#include "Settings.h"
+#include "Timer.h"
#include "TypingCommand.h"
#include "WebAccessibilityObject.h"
#include "WebDevToolsAgentPrivate.h"
+#include "WebDevToolsAgentImpl.h"
#include "WebDragData.h"
#include "WebFrameImpl.h"
#include "WebImage.h"
#include "WebInputEvent.h"
#include "WebInputEventConversion.h"
+#include "WebKit.h"
+#include "WebKitClient.h"
#include "WebMediaPlayerAction.h"
#include "WebNode.h"
#include "WebPoint.h"
@@ -160,9 +166,9 @@ static const PopupContainerSettings suggestionsPopupSettings = {
// WebView ----------------------------------------------------------------
-WebView* WebView::create(WebViewClient* client)
+WebView* WebView::create(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
{
- return new WebViewImpl(client);
+ return new WebViewImpl(client, devToolsClient);
}
void WebView::updateVisitedLinkState(unsigned long long linkHash)
@@ -209,7 +215,7 @@ void WebViewImpl::initializeMainFrame(WebFrameClient* frameClient)
SecurityOrigin::setLocalLoadPolicy(SecurityOrigin::AllowLocalLoadsForLocalOnly);
}
-WebViewImpl::WebViewImpl(WebViewClient* client)
+WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient)
: m_client(client)
, m_backForwardListClientImpl(this)
, m_chromeClientImpl(this)
@@ -238,10 +244,12 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_suggestionsPopup(0)
, m_isTransparent(false)
, m_tabsToLinks(false)
+ , m_dragScrollTimer(new DragScrollTimer())
#if USE(ACCELERATED_COMPOSITING)
, m_layerRenderer(0)
, m_isAcceleratedCompositingActive(false)
#endif
+ , m_gles2Context(0)
{
// WebKit/win/WebView.cpp does the same thing, except they call the
// KJS specific wrapper around this method. We need to have threading
@@ -252,9 +260,13 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
// set to impossible point so we always get the first mouse pos
m_lastMousePosition = WebPoint(-1, -1);
- // the page will take ownership of the various clients
+ if (devToolsClient)
+ m_devToolsAgent = static_cast<WebDevToolsAgentImpl*>(WebDevToolsAgent::create(this, devToolsClient));
+
m_page.set(new Page(&m_chromeClientImpl, &m_contextMenuClientImpl, &m_editorClientImpl, &m_dragClientImpl, &m_inspectorClientImpl, 0, 0, 0));
+ // the page will take ownership of the various clients
+
m_page->backForwardList()->setClient(&m_backForwardListClientImpl);
m_page->setGroupName(pageGroupName);
@@ -827,45 +839,6 @@ bool WebViewImpl::mapKeyCodeForScroll(int keyCode,
return true;
}
-// Computes the distance from a point outside a rect to the nearest edge of the rect.
-static IntSize distanceToRect(const IntPoint& point, const IntRect& rect)
-{
- int dx = 0, dy = 0;
- if (point.x() < rect.x())
- dx = point.x() - rect.x();
- else if (rect.right() < point.x())
- dx = point.x() - rect.right();
- if (point.y() < rect.y())
- dy = point.y() - rect.y();
- else if (rect.bottom() < point.y())
- dy = point.y() - rect.bottom();
- return IntSize(dx, dy);
-}
-
-void WebViewImpl::scrollForDragging(const WebPoint& clientPoint)
-{
- // This margin approximates Safari behavior, derived from an observation.
- static const int scrollMargin = 30;
-
- FrameView* view = mainFrameImpl()->frameView();
- if (!view)
- return;
-
- IntRect bounds(0, 0, view->visibleWidth(), view->visibleHeight());
- bounds.setY(bounds.y() + scrollMargin);
- bounds.setHeight(bounds.height() - scrollMargin * 2);
- bounds.setX(bounds.x() + scrollMargin);
- bounds.setWidth(bounds.width() - scrollMargin * 2);
-
- IntPoint point = clientPoint;
- if (bounds.contains(point))
- return;
-
- IntSize toScroll = distanceToRect(point, bounds);
- if (!toScroll.isZero())
- view->scrollBy(toScroll);
-}
-
void WebViewImpl::hideSelectPopup()
{
if (m_selectPopup.get())
@@ -1191,25 +1164,66 @@ void WebViewImpl::setFocus(bool enable)
}
}
+// DEPRECATED, will be removed later.
bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command,
int cursorPosition,
int targetStart,
int targetEnd,
const WebString& imeString)
{
+ if (command == WebKit::WebCompositionCommandSet) {
+ if (targetStart < 0)
+ targetStart = 0;
+ if (targetEnd < 0)
+ targetEnd = static_cast<int>(imeString.length());
+
+ // Create custom underlines.
+ // To emphasize the selection, the selected region uses a solid black
+ // for its underline while other regions uses a pale gray for theirs.
+ WebVector<WebCompositionUnderline> underlines(static_cast<size_t>(3));
+ underlines[0].startOffset = 0;
+ underlines[0].endOffset = targetStart;
+ underlines[0].thick = true;
+ underlines[0].color = 0xffd3d3d3;
+ underlines[1].startOffset = targetStart;
+ underlines[1].endOffset = targetEnd;
+ underlines[1].thick = true;
+ underlines[1].color = 0xff000000;
+ underlines[2].startOffset = targetEnd;
+ underlines[2].endOffset = static_cast<unsigned>(imeString.length());
+ underlines[2].thick = true;
+ underlines[2].color = 0xffd3d3d3;
+ return setComposition(imeString, underlines, cursorPosition, cursorPosition);
+ }
+
+ if (command == WebKit::WebCompositionCommandDiscard)
+ setComposition(WebString(), WebVector<WebCompositionUnderline>(), 0, 0);
+ else if (command == WebKit::WebCompositionCommandConfirm) {
+ setComposition(imeString, WebVector<WebCompositionUnderline>(), 0, 0);
+ confirmComposition();
+ }
+
+ return true;
+}
+
+bool WebViewImpl::setComposition(
+ const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart,
+ int selectionEnd)
+{
Frame* focused = focusedWebCoreFrame();
if (!focused || !m_imeAcceptEvents)
return false;
Editor* editor = focused->editor();
if (!editor)
return false;
- if (!editor->canEdit()) {
- // The input focus has been moved to another WebWidget object.
- // We should use this |editor| object only to complete the ongoing
- // composition.
- if (!editor->hasComposition())
- return false;
- }
+
+ // The input focus has been moved to another WebWidget object.
+ // We should use this |editor| object only to complete the ongoing
+ // composition.
+ if (!editor->canEdit() && !editor->hasComposition())
+ return false;
// We should verify the parent node of this IME composition node are
// editable because JavaScript may delete a parent node of the composition
@@ -1224,9 +1238,7 @@ bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command,
// If we're not going to fire a keypress event, then the keydown event was
// canceled. In that case, cancel any existing composition.
- // FIXME: Ideally, we would only cancel a single keypress, rather than the
- // whole composition.
- if ((command == WebCompositionCommandDiscard) || m_suppressNextKeypressEvent) {
+ if (text.isEmpty() || m_suppressNextKeypressEvent) {
// A browser process sent an IPC message which does not contain a valid
// string, which means an ongoing composition has been canceled.
// If the ongoing composition has been canceled, replace the ongoing
@@ -1234,49 +1246,45 @@ bool WebViewImpl::handleCompositionEvent(WebCompositionCommand command,
String emptyString;
Vector<CompositionUnderline> emptyUnderlines;
editor->setComposition(emptyString, emptyUnderlines, 0, 0);
- } else {
- // A browser process sent an IPC message which contains a string to be
- // displayed in this Editor object.
- // To display the given string, set the given string to the
- // m_compositionNode member of this Editor object and display it.
- if (targetStart < 0)
- targetStart = 0;
- if (targetEnd < 0)
- targetEnd = static_cast<int>(imeString.length());
- String compositionString(imeString);
- // Create custom underlines.
- // To emphasize the selection, the selected region uses a solid black
- // for its underline while other regions uses a pale gray for theirs.
- Vector<CompositionUnderline> underlines(3);
- underlines[0].startOffset = 0;
- underlines[0].endOffset = targetStart;
- underlines[0].thick = true;
- underlines[0].color.setRGB(0xd3, 0xd3, 0xd3);
- underlines[1].startOffset = targetStart;
- underlines[1].endOffset = targetEnd;
- underlines[1].thick = true;
- underlines[1].color.setRGB(0x00, 0x00, 0x00);
- underlines[2].startOffset = targetEnd;
- underlines[2].endOffset = static_cast<int>(imeString.length());
- underlines[2].thick = true;
- underlines[2].color.setRGB(0xd3, 0xd3, 0xd3);
- // When we use custom underlines, WebKit ("InlineTextBox.cpp" Line 282)
- // prevents from writing a text in between 'selectionStart' and
- // 'selectionEnd' somehow.
- // Therefore, we use the 'cursorPosition' for these arguments so that
- // there are not any characters in the above region.
- editor->setComposition(compositionString, underlines,
- cursorPosition, cursorPosition);
- // The given string is a result string, which means the ongoing
- // composition has been completed. I have to call the
- // Editor::confirmCompletion() and complete this composition.
- if (command == WebCompositionCommandConfirm)
- editor->confirmComposition();
+ return text.isEmpty();
}
+ // When the range of composition underlines overlap with the range between
+ // selectionStart and selectionEnd, WebKit somehow won't paint the selection
+ // at all (see InlineTextBox::paint() function in InlineTextBox.cpp).
+ // But the selection range actually takes effect.
+ editor->setComposition(String(text),
+ CompositionUnderlineVectorBuilder(underlines),
+ selectionStart, selectionEnd);
+
return editor->hasComposition();
}
+bool WebViewImpl::confirmComposition()
+{
+ Frame* focused = focusedWebCoreFrame();
+ if (!focused || !m_imeAcceptEvents)
+ return false;
+ Editor* editor = focused->editor();
+ if (!editor || !editor->hasComposition())
+ return false;
+
+ // We should verify the parent node of this IME composition node are
+ // editable because JavaScript may delete a parent node of the composition
+ // node. In this case, WebKit crashes while deleting texts from the parent
+ // node, which doesn't exist any longer.
+ PassRefPtr<Range> range = editor->compositionRange();
+ if (range) {
+ const Node* node = range->startPosition().node();
+ if (!node || !node->isContentEditable())
+ return false;
+ }
+
+ editor->confirmComposition();
+ return true;
+}
+
+// DEPRECATED, will be removed later.
bool WebViewImpl::queryCompositionStatus(bool* enableIME, WebRect* caretRect)
{
// Store whether the selected node needs IME and the caret rectangle.
@@ -1311,6 +1319,59 @@ bool WebViewImpl::queryCompositionStatus(bool* enableIME, WebRect* caretRect)
return true;
}
+WebTextInputType WebViewImpl::textInputType()
+{
+ WebTextInputType type = WebTextInputTypeNone;
+ const Frame* focused = focusedWebCoreFrame();
+ if (!focused)
+ return type;
+
+ const Editor* editor = focused->editor();
+ if (!editor || !editor->canEdit())
+ return type;
+
+ SelectionController* controller = focused->selection();
+ if (!controller)
+ return type;
+
+ const Node* node = controller->start().node();
+ if (!node)
+ return type;
+
+ // FIXME: Support more text input types when necessary, eg. Number,
+ // Date, Email, URL, etc.
+ if (controller->isInPasswordField())
+ type = WebTextInputTypePassword;
+ else if (node->shouldUseInputMethod())
+ type = WebTextInputTypeText;
+
+ return type;
+}
+
+WebRect WebViewImpl::caretOrSelectionBounds()
+{
+ WebRect rect;
+ const Frame* focused = focusedWebCoreFrame();
+ if (!focused)
+ return rect;
+
+ SelectionController* controller = focused->selection();
+ if (!controller)
+ return rect;
+
+ const FrameView* view = focused->view();
+ if (!view)
+ return rect;
+
+ if (controller->isCaret())
+ rect = view->contentsToWindow(controller->absoluteCaretBounds());
+ else if (controller->isRange()) {
+ RefPtr<Range> range = controller->toNormalizedRange();
+ rect = view->contentsToWindow(focused->firstRectForRange(range.get()));
+ }
+ return rect;
+}
+
void WebViewImpl::setTextDirection(WebTextDirection direction)
{
// The Editor::setBaseWritingDirection() function checks if we can change
@@ -1393,7 +1454,7 @@ bool WebViewImpl::dispatchBeforeUnloadEvent()
if (!frame)
return true;
- return frame->shouldClose();
+ return frame->loader()->shouldClose();
}
void WebViewImpl::dispatchUnloadEvent()
@@ -1576,6 +1637,7 @@ void WebViewImpl::dragSourceEndedAt(
false, 0);
m_page->mainFrame()->eventHandler()->dragSourceEndedAt(pme,
static_cast<DragOperation>(operation));
+ m_dragScrollTimer->stop();
}
void WebViewImpl::dragSourceMovedTo(
@@ -1583,7 +1645,7 @@ void WebViewImpl::dragSourceMovedTo(
const WebPoint& screenPoint,
WebDragOperation operation)
{
- scrollForDragging(clientPoint);
+ m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint);
}
void WebViewImpl::dragSourceSystemDragEnded()
@@ -1672,6 +1734,7 @@ void WebViewImpl::dragTargetDrop(const WebPoint& clientPoint,
m_dropEffect = DropEffectDefault;
m_dragOperation = WebDragOperationNone;
m_dragIdentity = 0;
+ m_dragScrollTimer->stop();
}
int WebViewImpl::dragIdentity()
@@ -1707,7 +1770,10 @@ WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(const WebPoint& clientPo
m_dragOperation = static_cast<WebDragOperation>(effect);
if (dragAction == DragOver)
- scrollForDragging(clientPoint);
+ m_dragScrollTimer->triggerScroll(mainFrameImpl()->frameView(), clientPoint);
+ else
+ m_dragScrollTimer->stop();
+
return m_dragOperation;
}
@@ -2221,7 +2287,23 @@ void WebViewImpl::setRootLayerNeedsDisplay()
if (m_layerRenderer)
m_layerRenderer->setNeedsDisplay();
}
+#endif // USE(ACCELERATED_COMPOSITING)
-#endif
+// Returns the GLES2 context associated with this View. If one doesn't exist
+// it will get created first.
+WebGLES2Context* WebViewImpl::gles2Context()
+{
+ if (!m_gles2Context) {
+ m_gles2Context = webKitClient()->createGLES2Context();
+ if (!m_gles2Context)
+ return 0;
+
+ if (!m_gles2Context->initialize(this, 0)) {
+ m_gles2Context.clear();
+ return 0;
+ }
+ }
+ return m_gles2Context.get();
+}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 8b15f8a..a6fa131 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -31,6 +31,7 @@
#ifndef WebViewImpl_h
#define WebViewImpl_h
+#include "WebGLES2Context.h"
#include "WebNavigationPolicy.h"
#include "WebPoint.h"
#include "WebSize.h"
@@ -68,8 +69,10 @@ namespace WebKit {
class AutocompletePopupMenuClient;
class AutoFillPopupMenuClient;
class ContextMenuClientImpl;
+class DragScrollTimer;
class SuggestionsPopupMenuClient;
class WebAccessibilityObject;
+class WebDevToolsAgentClient;
class WebDevToolsAgentPrivate;
class WebFrameImpl;
class WebImage;
@@ -90,13 +93,24 @@ public:
virtual bool handleInputEvent(const WebInputEvent&);
virtual void mouseCaptureLost();
virtual void setFocus(bool enable);
+
+ // DEPRECATED, will be removed later.
virtual bool handleCompositionEvent(WebCompositionCommand command,
int cursorPosition,
int targetStart,
int targetEnd,
const WebString& text);
- virtual bool queryCompositionStatus(bool* enabled,
- WebRect* caretRect);
+ virtual bool setComposition(
+ const WebString& text,
+ const WebVector<WebCompositionUnderline>& underlines,
+ int selectionStart,
+ int selectionEnd);
+ virtual bool confirmComposition();
+
+ // DEPRECATED, will be removed later.
+ virtual bool queryCompositionStatus(bool* enabled, WebRect* caretRect);
+ virtual WebTextInputType textInputType();
+ virtual WebRect caretOrSelectionBounds();
virtual void setTextDirection(WebTextDirection direction);
virtual bool isAcceleratedCompositingActive() const;
@@ -322,6 +336,10 @@ public:
WebCore::ScrollDirection* scrollDirection,
WebCore::ScrollGranularity* scrollGranularity);
+ // Returns the GLES2Context associated with this WebView. One will be created
+ // if it doesn't already exist.
+ WebGLES2Context* gles2Context();
+
private:
friend class WebView; // So WebView::Create can call our constructor
friend class WTF::RefCounted<WebViewImpl>;
@@ -331,7 +349,7 @@ private:
DragOver
};
- WebViewImpl(WebViewClient* client);
+ WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devToolsClient);
~WebViewImpl();
// Returns true if the event was actually processed.
@@ -351,8 +369,6 @@ private:
// Returns true if the view was scrolled.
bool scrollViewWithKeyboard(int keyCode, int modifiers);
- void scrollForDragging(const WebPoint&);
-
void hideSelectPopup();
// Converts |pos| from window coordinates to contents coordinates and gets
@@ -496,6 +512,7 @@ private:
typedef HashMap<WebCore::String, WebCore::String> SettingsMap;
OwnPtr<SettingsMap> m_inspectorSettingsMap;
+ OwnPtr<DragScrollTimer> m_dragScrollTimer;
#if ENABLE(NOTIFICATIONS)
// The provider of desktop notifications;
@@ -510,6 +527,8 @@ private:
bool m_isAcceleratedCompositingActive;
#endif
static const WebInputEvent* m_currentInputEvent;
+
+ OwnPtr<WebGLES2Context> m_gles2Context;
};
} // namespace WebKit
diff --git a/WebKit/chromium/src/js/DebuggerAgent.js b/WebKit/chromium/src/js/DebuggerAgent.js
index 8d2457f..01d7627 100644
--- a/WebKit/chromium/src/js/DebuggerAgent.js
+++ b/WebKit/chromium/src/js/DebuggerAgent.js
@@ -1075,7 +1075,7 @@ devtools.DebuggerAgent.prototype.formatCallFrame_ = function(stackFrame)
WebInspector.parsedScriptSource(sourceId, null, null, 0, WebInspector.Script.WorldType.MAIN_WORLD);
}
- var funcName = func.name || func.inferredName || "(anonymous function)";
+ var funcName = func.name || func.inferredName;
var line = devtools.DebuggerAgent.v8ToWwebkitLineNumber_(stackFrame.line);
// Add basic scope chain info with scope variables.
diff --git a/WebKit/chromium/src/js/DebuggerScript.js b/WebKit/chromium/src/js/DebuggerScript.js
index 3ff3eb7..baddb7d 100644
--- a/WebKit/chromium/src/js/DebuggerScript.js
+++ b/WebKit/chromium/src/js/DebuggerScript.js
@@ -219,8 +219,6 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
var functionName;
if (func)
functionName = func.name() || func.inferredName();
- if (!functionName)
- functionName = "[anonymous]";
// Get script ID.
var script = func.script();
diff --git a/WebKit/chromium/src/js/DevTools.js b/WebKit/chromium/src/js/DevTools.js
index 398d358..851c934 100644
--- a/WebKit/chromium/src/js/DevTools.js
+++ b/WebKit/chromium/src/js/DevTools.js
@@ -61,7 +61,6 @@ devtools$$dispatch = function(remoteName, methodName, param1, param2, param3)
devtools.ToolsAgent = function()
{
RemoteToolsAgent.didDispatchOn = WebInspector.Callback.processCallback;
- RemoteToolsAgent.frameNavigate = this.frameNavigate_.bind(this);
RemoteToolsAgent.dispatchOnClient = this.dispatchOnClient_.bind(this);
this.debuggerAgent_ = new devtools.DebuggerAgent();
this.profilerAgent_ = new devtools.ProfilerAgent();
@@ -107,24 +106,14 @@ devtools.ToolsAgent.prototype.getProfilerAgent = function()
};
-/**
- * @param {string} url Url frame navigated to.
- * @see tools_agent.h
- * @private
- */
-devtools.ToolsAgent.prototype.frameNavigate_ = function(url)
+(function () {
+var orig = WebInspector.reset;
+WebInspector.reset = function()
{
- this.reset();
- // Do not reset Profiles panel.
- var profiles = null;
- if ("profiles" in WebInspector.panels) {
- profiles = WebInspector.panels["profiles"];
- delete WebInspector.panels["profiles"];
- }
- WebInspector.reset();
- if (profiles !== null)
- WebInspector.panels["profiles"] = profiles;
+ devtools.tools.reset();
+ orig.call(this);
};
+})();
/**
@@ -302,31 +291,6 @@ WebInspector.UIString = function(string)
return String.vsprintf(string, Array.prototype.slice.call(arguments, 1));
};
-// Activate window upon node search complete. This will go away once InspectorFrontendClient is landed.
-(function() {
- var original = WebInspector.searchingForNodeWasDisabled;
- WebInspector.searchingForNodeWasDisabled = function()
- {
- if (this.panels.elements._nodeSearchButton.toggled)
- InspectorFrontendHost.bringToFront();
- original.apply(this, arguments);
- }
-})();
-
-
-// There is no clear way of setting frame title yet. So sniffing main resource
-// load.
-(function OverrideUpdateResource() {
- var originalUpdateResource = WebInspector.updateResource;
- WebInspector.updateResource = function(identifier, payload)
- {
- originalUpdateResource.call(this, identifier, payload);
- var resource = this.resources[identifier];
- if (resource && resource.mainResource && resource.finished)
- document.title = WebInspector.UIString("Developer Tools - %s", resource.url);
- };
-})();
-
/** Pending WebKit upstream by apavlov). Fixes iframe vs drag problem. */
(function()
@@ -356,9 +320,10 @@ WebInspector.UIString = function(string)
})();
-// We need to have a place for postponed tasks
-// which should be executed when all the messages between agent and frontend
-// are processed.
+
+///////////////////////////////////////////
+// Chromium layout test harness support. //
+///////////////////////////////////////////
WebInspector.runAfterPendingDispatchesQueue = [];
@@ -375,19 +340,11 @@ WebInspector.queuesAreEmpty = function()
copy[i].call(this);
};
-(function()
-{
-var originalAddToFrame = InspectorFrontendHost.addResourceSourceToFrame;
-InspectorFrontendHost.addResourceSourceToFrame = function(identifier, element)
-{
- var resource = WebInspector.resources[identifier];
- if (!resource)
- return;
- originalAddToFrame.call(this, identifier, resource.mimeType, element);
-};
-})();
-// Chromium theme support.
+/////////////////////////////
+// Chromium theme support. //
+/////////////////////////////
+
WebInspector.setToolbarColors = function(backgroundColor, color)
{
if (!WebInspector._themeStyleElement) {
diff --git a/WebKit/chromium/src/js/DevToolsHostStub.js b/WebKit/chromium/src/js/DevToolsHostStub.js
index da5929a..806bf6a 100644
--- a/WebKit/chromium/src/js/DevToolsHostStub.js
+++ b/WebKit/chromium/src/js/DevToolsHostStub.js
@@ -34,277 +34,8 @@
*/
if (!window["RemoteDebuggerAgent"]) {
-
-/**
- * FIXME: change field naming style to use trailing underscore.
- * @constructor
- */
-RemoteDebuggerAgentStub = function()
-{
-};
-
-
-RemoteDebuggerAgentStub.prototype.getContextId = function()
-{
- RemoteDebuggerAgent.setContextId(3);
-};
-
-
-RemoteDebuggerAgentStub.prototype.processDebugCommands = function()
-{
-};
-
-
-
-/**
- * @constructor
- */
-RemoteProfilerAgentStub = function()
-{
-};
-
-
-RemoteProfilerAgentStub.prototype.getActiveProfilerModules = function()
-{
- ProfilerStubHelper.GetInstance().getActiveProfilerModules();
-};
-
-
-RemoteProfilerAgentStub.prototype.getLogLines = function(pos)
-{
- ProfilerStubHelper.GetInstance().getLogLines(pos);
-};
-
-
-/**
- * @constructor
- */
-RemoteToolsAgentStub = function()
-{
-};
-
-
-RemoteToolsAgentStub.prototype.dispatchOnInjectedScript = function()
-{
-};
-
-
-RemoteToolsAgentStub.prototype.dispatchOnInspectorController = function()
-{
-};
-
-
-/**
- * @constructor
- */
-ProfilerStubHelper = function()
-{
- this.activeProfilerModules_ = devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_NONE;
- this.heapProfSample_ = 0;
- this.log_ = '';
-};
-
-
-ProfilerStubHelper.GetInstance = function()
-{
- if (!ProfilerStubHelper.instance_)
- ProfilerStubHelper.instance_ = new ProfilerStubHelper();
- return ProfilerStubHelper.instance_;
-};
-
-
-ProfilerStubHelper.prototype.StopProfiling = function(modules)
-{
- this.activeProfilerModules_ &= ~modules;
-};
-
-
-ProfilerStubHelper.prototype.StartProfiling = function(modules)
-{
- var profModules = devtools.ProfilerAgent.ProfilerModules;
- if (modules & profModules.PROFILER_MODULE_HEAP_SNAPSHOT) {
- if (modules & profModules.PROFILER_MODULE_HEAP_STATS) {
- this.log_ +=
- 'heap-sample-begin,"Heap","allocated",' +
- (new Date()).getTime() + '\n' +
- 'heap-sample-stats,"Heap","allocated",10000,1000\n';
- this.log_ +=
- 'heap-sample-item,STRING_TYPE,100,1000\n' +
- 'heap-sample-item,CODE_TYPE,10,200\n' +
- 'heap-sample-item,MAP_TYPE,20,350\n';
- this.log_ += ProfilerStubHelper.HeapSamples[this.heapProfSample_++];
- this.heapProfSample_ %= ProfilerStubHelper.HeapSamples.length;
- this.log_ += 'heap-sample-end,"Heap","allocated"\n';
- }
- } else {
- if (modules & profModules.PROFILER_MODULE_CPU)
- this.log_ += ProfilerStubHelper.ProfilerLogBuffer;
- this.activeProfilerModules_ |= modules;
- }
-};
-
-
-ProfilerStubHelper.prototype.getActiveProfilerModules = function()
-{
- var self = this;
- setTimeout(function() {
- RemoteProfilerAgent.didGetActiveProfilerModules(self.activeProfilerModules_);
- }, 100);
-};
-
-
-ProfilerStubHelper.prototype.getLogLines = function(pos)
-{
- var profModules = devtools.ProfilerAgent.ProfilerModules;
- var logLines = this.log_.substr(pos);
- setTimeout(function() {
- RemoteProfilerAgent.didGetLogLines(pos + logLines.length, logLines);
- }, 100);
-};
-
-
-ProfilerStubHelper.ProfilerLogBuffer =
- 'profiler,begin,1\n' +
- 'profiler,resume\n' +
- 'code-creation,LazyCompile,0x1000,256,"test1 http://aaa.js:1"\n' +
- 'code-creation,LazyCompile,0x2000,256,"test2 http://bbb.js:2"\n' +
- 'code-creation,LazyCompile,0x3000,256,"test3 http://ccc.js:3"\n' +
- 'tick,0x1010,0x0,3\n' +
- 'tick,0x2020,0x0,3,0x1010\n' +
- 'tick,0x2020,0x0,3,0x1010\n' +
- 'tick,0x3010,0x0,3,0x2020, 0x1010\n' +
- 'tick,0x2020,0x0,3,0x1010\n' +
- 'tick,0x2030,0x0,3,0x2020, 0x1010\n' +
- 'tick,0x2020,0x0,3,0x1010\n' +
- 'tick,0x1010,0x0,3\n' +
- 'profiler,pause\n';
-
-
-ProfilerStubHelper.HeapSamples = [
- 'heap-js-cons-item,foo,1,100\n' +
- 'heap-js-cons-item,bar,20,2000\n' +
- 'heap-js-cons-item,Object,5,100\n' +
- 'heap-js-ret-item,foo,bar;3\n' +
- 'heap-js-ret-item,bar,foo;5\n' +
- 'heap-js-ret-item,Object:0x1234,(roots);1\n',
-
- 'heap-js-cons-item,foo,2000,200000\n' +
- 'heap-js-cons-item,bar,10,1000\n' +
- 'heap-js-cons-item,Object,6,120\n' +
- 'heap-js-ret-item,foo,bar;7,Object:0x1234;10\n' +
- 'heap-js-ret-item,bar,foo;10,Object:0x1234;10\n' +
- 'heap-js-ret-item,Object:0x1234,(roots);1\n',
-
- 'heap-js-cons-item,foo,15,1500\n' +
- 'heap-js-cons-item,bar,15,1500\n' +
- 'heap-js-cons-item,Object,5,100\n' +
- 'heap-js-cons-item,Array,3,1000\n' +
- 'heap-js-ret-item,foo,bar;3,Array:0x5678;1\n' +
- 'heap-js-ret-item,bar,foo;5,Object:0x1234;8,Object:0x5678;2\n' +
- 'heap-js-ret-item,Object:0x1234,(roots);1,Object:0x5678;2\n' +
- 'heap-js-ret-item,Object:0x5678,(global property);3,Object:0x1234;5\n' +
- 'heap-js-ret-item,Array:0x5678,(global property);3,Array:0x5678;2\n',
-
- 'heap-js-cons-item,bar,20,2000\n' +
- 'heap-js-cons-item,Object,6,120\n' +
- 'heap-js-ret-item,bar,foo;5,Object:0x1234;1,Object:0x1235;3\n' +
- 'heap-js-ret-item,Object:0x1234,(global property);3\n' +
- 'heap-js-ret-item,Object:0x1235,(global property);5\n',
-
- 'heap-js-cons-item,foo,15,1500\n' +
- 'heap-js-cons-item,bar,15,1500\n' +
- 'heap-js-cons-item,Array,10,1000\n' +
- 'heap-js-ret-item,foo,bar;1,Array:0x5678;1\n' +
- 'heap-js-ret-item,bar,foo;5\n' +
- 'heap-js-ret-item,Array:0x5678,(roots);3\n',
-
- 'heap-js-cons-item,bar,20,2000\n' +
- 'heap-js-cons-item,baz,15,1500\n' +
- 'heap-js-ret-item,bar,baz;3\n' +
- 'heap-js-ret-item,baz,bar;3\n'
-];
-
-
-/**
- * @constructor
- */
-RemoteDebuggerCommandExecutorStub = function()
-{
-};
-
-
-RemoteDebuggerCommandExecutorStub.prototype.DebuggerCommand = function(cmd)
-{
- if ('{"seq":2,"type":"request","command":"scripts","arguments":{"includeSource":false}}' === cmd) {
- var response1 =
- '{"seq":5,"request_seq":2,"type":"response","command":"scripts","' +
- 'success":true,"body":[{"handle":61,"type":"script","name":"' +
- 'http://www/~test/t.js","id":59,"lineOffset":0,"columnOffset":0,' +
- '"lineCount":1,"sourceStart":"function fib(n) {","sourceLength":300,' +
- '"scriptType":2,"compilationType":0,"context":{"ref":60}}],"refs":[{' +
- '"handle":60,"type":"context","data":"page,3"}],"running":false}';
- this.sendResponse_(response1);
- } else if ('{"seq":3,"type":"request","command":"scripts","arguments":{"ids":[59],"includeSource":true}}' === cmd) {
- this.sendResponse_(
- '{"seq":8,"request_seq":3,"type":"response","command":"scripts",' +
- '"success":true,"body":[{"handle":1,"type":"script","name":' +
- '"http://www/~test/t.js","id":59,"lineOffset":0,"columnOffset":0,' +
- '"lineCount":1,"source":"function fib(n) {return n+1;}",' +
- '"sourceLength":244,"scriptType":2,"compilationType":0,"context":{' +
- '"ref":0}}],"refs":[{"handle":0,"type":"context","data":"page,3}],"' +
- '"running":false}');
- } else if (cmd.indexOf('"command":"profile"') !== -1) {
- var cmdObj = JSON.parse(cmd);
- if (cmdObj.arguments.command === "resume")
- ProfilerStubHelper.GetInstance().StartProfiling(parseInt(cmdObj.arguments.modules));
- else if (cmdObj.arguments.command === "pause")
- ProfilerStubHelper.GetInstance().StopProfiling(parseInt(cmdObj.arguments.modules));
- else
- debugPrint("Unexpected profile command: " + cmdObj.arguments.command);
- } else
- debugPrint("Unexpected command: " + cmd);
-};
-
-
-RemoteDebuggerCommandExecutorStub.prototype.DebuggerPauseScript = function()
-{
-};
-
-
-RemoteDebuggerCommandExecutorStub.prototype.sendResponse_ = function(response)
-{
- setTimeout(function() {
- RemoteDebuggerAgent.debuggerOutput(response);
- }, 0);
-};
-
-
-DevToolsHostStub = function()
-{
- this.isStub = true;
-};
-DevToolsHostStub.prototype.__proto__ = WebInspector.InspectorFrontendHostStub.prototype;
-
-
-DevToolsHostStub.prototype.reset = function()
-{
-};
-
-
-DevToolsHostStub.prototype.setting = function()
-{
-};
-
-
-DevToolsHostStub.prototype.setSetting = function()
-{
-};
-
-
-window["RemoteDebuggerAgent"] = new RemoteDebuggerAgentStub();
-window["RemoteDebuggerCommandExecutor"] = new RemoteDebuggerCommandExecutorStub();
-window["RemoteProfilerAgent"] = new RemoteProfilerAgentStub();
-window["RemoteToolsAgent"] = new RemoteToolsAgentStub();
-InspectorFrontendHost = new DevToolsHostStub();
-
+ window["RemoteDebuggerAgent"] = { setDebuggerScriptSource: function() {} };
+ window["RemoteDebuggerCommandExecutor"] = {};
+ window["RemoteProfilerAgent"] = {};
+ window["RemoteToolsAgent"] = { dispatchOnInjectedScript: function() {} };
}
diff --git a/WebKit/chromium/src/js/HeapProfilerPanel.js b/WebKit/chromium/src/js/HeapProfilerPanel.js
index 0fc4418..bcb008f 100644
--- a/WebKit/chromium/src/js/HeapProfilerPanel.js
+++ b/WebKit/chromium/src/js/HeapProfilerPanel.js
@@ -932,7 +932,7 @@ WebInspector.HeapSnapshotProfileType.prototype = {
buttonClicked: function()
{
- InspectorBackend.takeHeapSnapshot();
+ devtools.tools.getProfilerAgent().startProfiling(devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT);
},
get welcomeMessage()
diff --git a/WebKit/chromium/src/js/InjectDispatch.js b/WebKit/chromium/src/js/InjectDispatch.js
index 30caaf2..cda84e5 100644
--- a/WebKit/chromium/src/js/InjectDispatch.js
+++ b/WebKit/chromium/src/js/InjectDispatch.js
@@ -49,60 +49,14 @@ InspectorControllerDispatcher.dispatch = function(functionName, json_args)
};
/**
- * Special controller object for APU related messages. Outgoing messages
- * are sent to this object if the ApuAgentDispatcher is enabled.
- **/
-var ApuAgentDispatcher = { enabled : false };
-
-/**
- * Dispatches messages to APU. This filters and transforms
- * outgoing messages that are used by APU.
- * @param {string} method name of the dispatch method.
- **/
-ApuAgentDispatcher.dispatchToApu = function(method, args)
-{
- if (method !== "addRecordToTimeline" && method !== "updateResource" && method !== "addResource")
- return;
- // TODO(knorton): Transform args so they can be used
- // by APU.
- DevToolsAgentHost.dispatchToApu(JSON.stringify(args));
-};
-
-/**
* This is called by the InspectorFrontend for serialization.
* We serialize the call and send it to the client over the IPC
* using dispatchOut bound method.
*/
function dispatch(method, var_args) {
- // Handle all messages with non-primitieve arguments here.
var args = Array.prototype.slice.call(arguments);
-
- if (method === "inspectedWindowCleared" || method === "reset" || method === "setAttachedWindow") {
- // Filter out messages we don't need here.
- // We do it on the sender side since they may have non-serializable
- // parameters.
- return;
- }
-
- // Sniff some inspector controller state changes in order to support
- // cross-navigation instrumentation. Keep names in sync with
- // webdevtoolsagent_impl.
- if (method === "timelineProfilerWasStarted")
- DevToolsAgentHost.runtimeFeatureStateChanged("timeline-profiler", true);
- else if (method === "timelineProfilerWasStopped")
- DevToolsAgentHost.runtimeFeatureStateChanged("timeline-profiler", false);
- else if (method === "resourceTrackingWasEnabled")
- DevToolsAgentHost.runtimeFeatureStateChanged("resource-tracking", true);
- else if (method === "resourceTrackingWasDisabled")
- DevToolsAgentHost.runtimeFeatureStateChanged("resource-tracking", false);
-
- if (ApuAgentDispatcher.enabled) {
- ApuAgentDispatcher.dispatchToApu(method, args);
- return;
- }
-
var call = JSON.stringify(args);
- DevToolsAgentHost.dispatch(call);
+ DevToolsAgentHost.dispatch(call, method);
};
function close() {
diff --git a/WebKit/chromium/src/js/InspectorControllerImpl.js b/WebKit/chromium/src/js/InspectorControllerImpl.js
index 327ca8f..cbe607d 100644
--- a/WebKit/chromium/src/js/InspectorControllerImpl.js
+++ b/WebKit/chromium/src/js/InspectorControllerImpl.js
@@ -38,14 +38,18 @@ if (!this.devtools)
devtools.InspectorBackendImpl = function()
{
WebInspector.InspectorBackendStub.call(this);
+ this.installInspectorControllerDelegate_("addInspectedNode");
this.installInspectorControllerDelegate_("addScriptToEvaluateOnLoad");
- this.installInspectorControllerDelegate_("clearMessages");
+ this.installInspectorControllerDelegate_("changeTagName");
+ this.installInspectorControllerDelegate_("clearConsoleMessages");
this.installInspectorControllerDelegate_("copyNode");
this.installInspectorControllerDelegate_("deleteCookie");
this.installInspectorControllerDelegate_("didEvaluateForTestInFrontend");
+ this.installInspectorControllerDelegate_("disableMonitoringXHR");
this.installInspectorControllerDelegate_("disableResourceTracking");
this.installInspectorControllerDelegate_("disableSearchingForNode");
this.installInspectorControllerDelegate_("disableTimeline");
+ this.installInspectorControllerDelegate_("enableMonitoringXHR");
this.installInspectorControllerDelegate_("enableResourceTracking");
this.installInspectorControllerDelegate_("enableSearchingForNode");
this.installInspectorControllerDelegate_("enableTimeline");
@@ -54,6 +58,7 @@ devtools.InspectorBackendImpl = function()
this.installInspectorControllerDelegate_("getDatabaseTableNames");
this.installInspectorControllerDelegate_("getDOMStorageEntries");
this.installInspectorControllerDelegate_("getEventListenersForNode");
+ this.installInspectorControllerDelegate_("getOuterHTML");
this.installInspectorControllerDelegate_("getProfile");
this.installInspectorControllerDelegate_("getProfileHeaders");
this.installInspectorControllerDelegate_("removeProfile");
@@ -62,6 +67,7 @@ devtools.InspectorBackendImpl = function()
this.installInspectorControllerDelegate_("highlightDOMNode");
this.installInspectorControllerDelegate_("hideDOMNodeHighlight");
this.installInspectorControllerDelegate_("performSearch");
+ this.installInspectorControllerDelegate_("pushNodeByPathToFrontend");
this.installInspectorControllerDelegate_("releaseWrapperObjectGroup");
this.installInspectorControllerDelegate_("removeAllScriptsToEvaluateOnLoad");
this.installInspectorControllerDelegate_("reloadPage");
@@ -74,12 +80,14 @@ devtools.InspectorBackendImpl = function()
this.installInspectorControllerDelegate_("setAttribute");
this.installInspectorControllerDelegate_("setDOMStorageItem");
this.installInspectorControllerDelegate_("setInjectedScriptSource");
+ this.installInspectorControllerDelegate_("setOuterHTML");
this.installInspectorControllerDelegate_("setTextNodeValue");
this.installInspectorControllerDelegate_("startProfiling");
this.installInspectorControllerDelegate_("startTimelineProfiler");
this.installInspectorControllerDelegate_("stopProfiling");
this.installInspectorControllerDelegate_("stopTimelineProfiler");
this.installInspectorControllerDelegate_("storeLastActivePanel");
+ this.installInspectorControllerDelegate_("takeHeapSnapshot");
this.installInspectorControllerDelegate_("getAllStyles");
this.installInspectorControllerDelegate_("getStyles");
@@ -113,24 +121,6 @@ devtools.InspectorBackendImpl = function()
devtools.InspectorBackendImpl.prototype.__proto__ = WebInspector.InspectorBackendStub.prototype;
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.debuggerEnabled = function()
-{
- return true;
-};
-
-
-/**
- * @override
- */
-devtools.InspectorBackendImpl.prototype.profilerEnabled = function()
-{
- return true;
-};
-
-
if (!window.v8ScriptDebugServerEnabled) {
devtools.InspectorBackendImpl.prototype.setBreakpoint = function(sourceID, line, enabled, condition)
@@ -248,17 +238,6 @@ devtools.InspectorBackendImpl.prototype.pauseInDebugger = function()
/**
* @override
*/
-devtools.InspectorBackendImpl.prototype.takeHeapSnapshot = function()
-{
- devtools.tools.getProfilerAgent().startProfiling(devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT
- | devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_STATS
- | devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_JS_CONSTRUCTORS);
-};
-
-
-/**
- * @override
- */
devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript = function(callId, injectedScriptId, methodName, argsString, async)
{
// Encode injectedScriptId into callId
diff --git a/WebKit/chromium/src/js/ProfilerAgent.js b/WebKit/chromium/src/js/ProfilerAgent.js
index 29de4a3..0b65ace 100644
--- a/WebKit/chromium/src/js/ProfilerAgent.js
+++ b/WebKit/chromium/src/js/ProfilerAgent.js
@@ -105,12 +105,8 @@ devtools.ProfilerAgent.prototype._getNextLogLines = function(immediately)
*/
devtools.ProfilerAgent.prototype.startProfiling = function(modules)
{
- var cmd = new devtools.DebugCommand("profile", {
- "modules": modules,
- "command": "resume"});
- devtools.DebuggerAgent.sendCommand_(cmd);
- RemoteDebuggerAgent.processDebugCommands();
if (modules & devtools.ProfilerAgent.ProfilerModules.PROFILER_MODULE_HEAP_SNAPSHOT) {
+ InspectorBackend.takeHeapSnapshot();
// Active modules will not change, instead, a snapshot will be logged.
this._getNextLogLines();
}
@@ -118,19 +114,6 @@ devtools.ProfilerAgent.prototype.startProfiling = function(modules)
/**
- * Stops profiling.
- */
-devtools.ProfilerAgent.prototype.stopProfiling = function(modules)
-{
- var cmd = new devtools.DebugCommand("profile", {
- "modules": modules,
- "command": "pause"});
- devtools.DebuggerAgent.sendCommand_(cmd);
- RemoteDebuggerAgent.processDebugCommands();
-};
-
-
-/**
* Handles current profiler status.
* @param {number} modules List of active (started) modules.
*/
diff --git a/WebKit/chromium/src/js/Tests.js b/WebKit/chromium/src/js/Tests.js
index fa910ab..893bc56 100644
--- a/WebKit/chromium/src/js/Tests.js
+++ b/WebKit/chromium/src/js/Tests.js
@@ -453,7 +453,7 @@ TestSuite.prototype.testProfilerTab = function()
setTimeout(findVisibleView, 0);
return;
}
- setTimeout(findDisplayedNode, 0);
+ setTimeout(findDisplayedNode, 0);
}
findVisibleView();
@@ -462,6 +462,51 @@ TestSuite.prototype.testProfilerTab = function()
/**
+ * Tests that heap profiler works.
+ */
+TestSuite.prototype.testHeapProfiler = function()
+{
+ this.showPanel("profiles");
+
+ var panel = WebInspector.panels.profiles;
+ var test = this;
+
+ function findDisplayedNode() {
+ var node = panel.visibleView.dataGrid.children[0];
+ if (!node) {
+ // Profile hadn't been queried yet, re-schedule.
+ window.setTimeout(findDisplayedNode, 100);
+ return;
+ }
+
+ // Iterate over displayed functions and find node called "A"
+ // If found, this will mean that we actually have taken heap snapshot.
+ while (node) {
+ if (node.constructorName.indexOf("A") !== -1) {
+ test.releaseControl();
+ return;
+ }
+ node = node.traverseNextNode(false, null, true);
+ }
+
+ test.fail();
+ }
+
+ function findVisibleView() {
+ if (!panel.visibleView) {
+ setTimeout(findVisibleView, 0);
+ return;
+ }
+ setTimeout(findDisplayedNode, 0);
+ }
+
+ WebInspector.HeapSnapshotProfileType.prototype.buttonClicked();
+ findVisibleView();
+ this.takeControl();
+};
+
+
+/**
* Tests that scripts tab can be open and populated with inspected scripts.
*/
TestSuite.prototype.testShowScriptsTab = function()
@@ -488,31 +533,19 @@ TestSuite.prototype.testScriptsTabIsPopulatedOnInspectedPageRefresh = function()
var test = this;
this.assertEquals(WebInspector.panels.elements, WebInspector.currentPanel, "Elements panel should be current one.");
- this.addSniffer(devtools.DebuggerAgent.prototype, "reset", waitUntilScriptIsParsed);
+ this.addSniffer(WebInspector.panels.scripts, "reset", waitUntilScriptIsParsed);
// Reload inspected page. It will reset the debugger agent.
test.evaluateInConsole_(
"window.location.reload(true);",
- function(resultText) {
- test.assertEquals("undefined", resultText, "Unexpected result of reload().");
- });
+ function(resultText) {});
function waitUntilScriptIsParsed() {
- var parsed = devtools.tools.getDebuggerAgent().parsedScripts_;
- for (var id in parsed) {
- var url = parsed[id].getUrl();
- if (url && url.search("debugger_test_page.html") !== -1) {
- checkScriptsPanel();
- return;
- }
- }
- test.addSniffer(devtools.DebuggerAgent.prototype, "addScriptInfo_", waitUntilScriptIsParsed);
- }
-
- function checkScriptsPanel() {
test.showPanel("scripts");
- test.assertTrue(test._scriptsAreParsed(["debugger_test_page.html"]), "Inspected script not found in the scripts list");
- test.releaseControl();
+ test._waitUntilScriptsAreParsed(["debugger_test_page.html"],
+ function() {
+ test.releaseControl();
+ });
}
// Wait until all scripts are added to the debugger.
@@ -603,7 +636,7 @@ TestSuite.prototype.testSetBreakpoint = function()
var test = this;
this.showPanel("scripts");
- var breakpointLine = 12;
+ var breakpointLine = 16
this._waitUntilScriptsAreParsed(["debugger_test_page.html"],
function() {
@@ -611,15 +644,25 @@ TestSuite.prototype.testSetBreakpoint = function()
"debugger_test_page.html",
function(view, url) {
view._addBreakpoint(breakpointLine);
- // Force v8 execution.
- RemoteDebuggerAgent.processDebugCommands();
- test.waitForSetBreakpointResponse_(url, breakpointLine,
- function() {
- test.releaseControl();
+
+ test.evaluateInConsole_(
+ 'setTimeout("calculate()" , 0)',
+ function(resultText) {
+ test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText);
});
});
});
+ this._waitForScriptPause(
+ {
+ functionsOnStack: ["calculate", ""],
+ lineNumber: breakpointLine,
+ lineText: " result = fib(lastVal++);"
+ },
+ function() {
+ test.releaseControl();
+ });
+
this.takeControl();
};
@@ -632,21 +675,13 @@ TestSuite.prototype.testPauseOnException = function()
this.showPanel("scripts");
var test = this;
- // TODO(yurys): remove else branch once the states are supported.
- if (WebInspector.ScriptsPanel.PauseOnExceptionsState) {
- while (WebInspector.currentPanel._pauseOnExceptionButton.state !== WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions)
- WebInspector.currentPanel._pauseOnExceptionButton.element.click();
- } else {
- // Make sure pause on exceptions is on.
- if (!WebInspector.currentPanel._pauseOnExceptionButton.toggled)
- WebInspector.currentPanel._pauseOnExceptionButton.element.click();
- }
+ InspectorBackend.setPauseOnExceptionsState(WebInspector.ScriptsPanel.PauseOnExceptionsState.PauseOnUncaughtExceptions);
this._executeCodeWhenScriptsAreParsed("handleClick()", ["pause_on_exception.html"]);
this._waitForScriptPause(
{
- functionsOnStack: ["throwAnException", "handleClick", "(anonymous function)"],
+ functionsOnStack: ["throwAnException", "handleClick", ""],
lineNumber: 6,
lineText: " return unknown_var;"
},
@@ -728,7 +763,7 @@ TestSuite.prototype.testPauseWhenScriptIsRunning = function()
test._waitForScriptPause(
{
- functionsOnStack: ["handleClick", "(anonymous function)"],
+ functionsOnStack: ["handleClick", ""],
lineNumber: 5,
lineText: " while(true) {"
},
@@ -861,36 +896,30 @@ TestSuite.prototype.testEvalOnCallFrame = function()
var breakpointLine = 16;
var test = this;
- this.addSniffer(devtools.DebuggerAgent.prototype, "handleScriptsResponse_",
- function(msg) {
+ this._waitUntilScriptsAreParsed(["debugger_test_page.html"],
+ function() {
test.showMainPageScriptSource_(
"debugger_test_page.html",
function(view, url) {
view._addBreakpoint(breakpointLine);
- // Force v8 execution.
- RemoteDebuggerAgent.processDebugCommands();
- test.waitForSetBreakpointResponse_(url, breakpointLine, setBreakpointCallback);
+
+ // Since breakpoints are ignored in evals' calculate() function is
+ // execute after zero-timeout so that the breakpoint is hit.
+ test.evaluateInConsole_(
+ 'setTimeout("calculate(123)" , 0)',
+ function(resultText) {
+ test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText);
+ waitForBreakpointHit();
+ });
});
});
- function setBreakpointCallback() {
- // Since breakpoints are ignored in evals' calculate() function is
- // execute after zero-timeout so that the breakpoint is hit.
- test.evaluateInConsole_(
- 'setTimeout("calculate(123)" , 0)',
- function(resultText) {
- test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText);
- waitForBreakpointHit();
- });
- }
-
function waitForBreakpointHit() {
- test.addSniffer(
- devtools.DebuggerAgent.prototype,
- "handleBacktraceResponse_",
- function(msg) {
- test.assertEquals(2, this.callFrames_.length, "Unexpected stack depth on the breakpoint. " + JSON.stringify(msg));
- test.assertEquals("calculate", this.callFrames_[0].functionName, "Unexpected top frame function.");
+ test.addSniffer(WebInspector,
+ "pausedScript",
+ function(callFrames) {
+ test.assertEquals(2, callFrames.length, "Unexpected stack depth on the breakpoint. " + JSON.stringify(callFrames, null, 4));
+ test.assertEquals("calculate", callFrames[0].functionName, "Unexpected top frame function.");
// Evaluate "e+1" where "e" is an argument of "calculate" function.
test.evaluateInConsole_(
"e+1",
@@ -916,7 +945,7 @@ TestSuite.prototype.testCompletionOnPause = function()
this._waitForScriptPause(
{
- functionsOnStack: ["innerFunction", "handleClick", "(anonymous function)"],
+ functionsOnStack: ["innerFunction", "handleClick", ""],
lineNumber: 9,
lineText: " debugger;"
},
@@ -963,6 +992,9 @@ TestSuite.prototype.testCompletionOnPause = function()
*/
TestSuite.prototype.testAutoContinueOnSyntaxError = function()
{
+ if (window.v8ScriptDebugServerEnabled)
+ return;
+
this.showPanel("scripts");
var test = this;
@@ -978,6 +1010,7 @@ TestSuite.prototype.testAutoContinueOnSyntaxError = function()
}
}
+
this.addSniffer(devtools.DebuggerAgent.prototype, "handleScriptsResponse_",
function(msg) {
checkScriptsList();
@@ -1140,7 +1173,7 @@ TestSuite.prototype._executeCodeWhenScriptsAreParsed = function(code, expectedSc
test.evaluateInConsole_(
'setTimeout("' + code + '" , 0)',
function(resultText) {
- test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText);
+ test.assertTrue(!isNaN(resultText), "Failed to get timer id: " + resultText + ". Code: " + code);
});
}
@@ -1188,7 +1221,7 @@ TestSuite.prototype.testStepOver = function()
this._performSteps([
{
- functionsOnStack: ["d","a","(anonymous function)"],
+ functionsOnStack: ["d","a",""],
lineNumber: 3,
lineText: " debugger;"
},
@@ -1196,7 +1229,7 @@ TestSuite.prototype.testStepOver = function()
document.getElementById("scripts-step-over").click();
},
{
- functionsOnStack: ["d","a","(anonymous function)"],
+ functionsOnStack: ["d","a",""],
lineNumber: 5,
lineText: " var y = fact(10);"
},
@@ -1204,7 +1237,7 @@ TestSuite.prototype.testStepOver = function()
document.getElementById("scripts-step-over").click();
},
{
- functionsOnStack: ["d","a","(anonymous function)"],
+ functionsOnStack: ["d","a",""],
lineNumber: 6,
lineText: " return y;"
},
@@ -1229,7 +1262,7 @@ TestSuite.prototype.testStepOut = function()
this._performSteps([
{
- functionsOnStack: ["d","a","(anonymous function)"],
+ functionsOnStack: ["d","a",""],
lineNumber: 3,
lineText: " debugger;"
},
@@ -1237,7 +1270,7 @@ TestSuite.prototype.testStepOut = function()
document.getElementById("scripts-step-out").click();
},
{
- functionsOnStack: ["a","(anonymous function)"],
+ functionsOnStack: ["a",""],
lineNumber: 8,
lineText: " printResult(result);"
},
@@ -1262,7 +1295,7 @@ TestSuite.prototype.testStepIn = function()
this._performSteps([
{
- functionsOnStack: ["d","a","(anonymous function)"],
+ functionsOnStack: ["d","a",""],
lineNumber: 3,
lineText: " debugger;"
},
@@ -1270,7 +1303,7 @@ TestSuite.prototype.testStepIn = function()
document.getElementById("scripts-step-over").click();
},
{
- functionsOnStack: ["d","a","(anonymous function)"],
+ functionsOnStack: ["d","a",""],
lineNumber: 5,
lineText: " var y = fact(10);"
},
@@ -1278,7 +1311,7 @@ TestSuite.prototype.testStepIn = function()
document.getElementById("scripts-step-into").click();
},
{
- functionsOnStack: ["fact","d","a","(anonymous function)"],
+ functionsOnStack: ["fact","d","a",""],
lineNumber: 10,
lineText: " var r = 1;"
},
@@ -1440,7 +1473,7 @@ TestSuite.prototype.testExpandScope = function()
this._waitForScriptPause(
{
- functionsOnStack: ["innerFunction", "handleClick", "(anonymous function)"],
+ functionsOnStack: ["innerFunction", "handleClick", ""],
lineNumber: 8,
lineText: " debugger;"
},
@@ -1463,14 +1496,14 @@ TestSuite.prototype.testExpandScope = function()
properties: {
x:"2009",
innerFunctionLocalVar:"2011",
- "this": "global",
+ "this": (window.v8ScriptDebugServerEnabled ? "DOMWindow" : "global"),
}
},
{
title: "Closure",
properties: {
- n:"TextParam",
- makeClosureLocalVar:"local.TextParam",
+ n: (window.v8ScriptDebugServerEnabled ? '"TextParam"' : "TextParam"),
+ makeClosureLocalVar: (window.v8ScriptDebugServerEnabled ? '"local.TextParam"' : "local.TextParam"),
}
},
{
@@ -1554,7 +1587,7 @@ TestSuite.prototype.testDebugIntrinsicProperties = function()
this._waitForScriptPause(
{
- functionsOnStack: ["callDebugger", "handleClick", "(anonymous function)"],
+ functionsOnStack: ["callDebugger", "handleClick", ""],
lineNumber: 29,
lineText: " debugger;"
},
@@ -1574,6 +1607,15 @@ TestSuite.prototype.testDebugIntrinsicProperties = function()
}
function examineLocalScope() {
+ if (window.v8ScriptDebugServerEnabled) {
+ var scopeExpectations = [
+ "a", "Child", [
+ "constructor", "function Child(n) {", null,
+ "parentField", "10", null,
+ "childField", "20", null,
+ ]
+ ];
+ } else {
var scopeExpectations = [
"a", "Object", [
"constructor", "function Child()", [
@@ -1606,13 +1648,14 @@ TestSuite.prototype.testDebugIntrinsicProperties = function()
"childField", 20, null,
]
];
+ }
checkProperty(localScopeSection.propertiesTreeOutline, "<Local Scope>", scopeExpectations);
}
var propQueue = [];
var index = 0;
- var expectedFinalIndex = 8;
+ var expectedFinalIndex = (window.v8ScriptDebugServerEnabled ? 1 : 8);
function expandAndCheckNextProperty() {
if (index === propQueue.length) {
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
index c51befb..8ec65b9 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
@@ -38,6 +38,7 @@
#include "DatabaseTracker.h"
#endif
#include "EWebKit.h"
+#include "FileChooser.h"
#include "FloatRect.h"
#include "FrameLoader.h"
#include "FrameLoaderClientEfl.h"
@@ -50,6 +51,8 @@
#include "ewk_private.h"
#include <wtf/text/CString.h>
+#include <Evas.h>
+
using namespace WebCore;
static inline Evas_Object* kit(Frame* frame)
@@ -115,10 +118,16 @@ void ChromeClientEfl::unfocus()
evas_object_focus_set(m_view, EINA_FALSE);
}
-Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& features)
+Page* ChromeClientEfl::createWindow(Frame*, const FrameLoadRequest& frameLoadRequest, const WindowFeatures& features)
{
- notImplemented();
- return 0;
+ Evas_Object* newView = ewk_view_window_create(m_view, EINA_TRUE, &features);
+ if (!newView)
+ return 0;
+
+ if (!frameLoadRequest.isEmpty())
+ ewk_view_uri_set(newView, frameLoadRequest.resourceRequest().url().string().utf8().data());
+
+ return ewk_view_core_page_get(newView);
}
void ChromeClientEfl::show()
@@ -376,7 +385,35 @@ void ChromeClientEfl::exceededDatabaseQuota(Frame* frame, const String& database
void ChromeClientEfl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser)
{
- notImplemented();
+ RefPtr<FileChooser> chooser = prpFileChooser;
+ bool confirm;
+ Eina_List* selectedFilenames = 0;
+ Eina_List* suggestedFilenames = 0;
+ void* filename;
+ Vector<String> filenames;
+
+ for (unsigned i = 0; i < chooser->filenames().size(); i++) {
+ CString str = chooser->filenames()[i].utf8();
+ filename = strdup(str.data());
+ suggestedFilenames = eina_list_append(suggestedFilenames, filename);
+ }
+
+ confirm = ewk_view_run_open_panel(m_view, kit(frame), chooser->allowsMultipleFiles(), suggestedFilenames, &selectedFilenames);
+ EINA_LIST_FREE(suggestedFilenames, filename)
+ free(filename);
+
+ if (!confirm)
+ return;
+
+ EINA_LIST_FREE(selectedFilenames, filename) {
+ filenames.append((char *)filename);
+ free(filename);
+ }
+
+ if (chooser->allowsMultipleFiles())
+ chooser->chooseFiles(filenames);
+ else
+ chooser->chooseFile(filenames[0]);
}
void ChromeClientEfl::formStateDidChange(const Node*)
diff --git a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
index 399ef7f..fccf54f 100644
--- a/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
@@ -26,7 +26,8 @@
#include "ChromeClient.h"
#include "KURL.h"
#include "PopupMenu.h"
-#include <Evas.h>
+
+typedef struct _Evas_Object Evas_Object;
namespace WebCore {
diff --git a/WebKit/efl/WebCoreSupport/EditorClientEfl.h b/WebKit/efl/WebCoreSupport/EditorClientEfl.h
index ead1169..a53d624 100644
--- a/WebKit/efl/WebCoreSupport/EditorClientEfl.h
+++ b/WebKit/efl/WebCoreSupport/EditorClientEfl.h
@@ -34,10 +34,11 @@
#define EditorClientEfl_h
#include "EditorClient.h"
-#include <Evas.h>
#include <wtf/Forward.h>
+typedef struct _Evas_Object Evas_Object;
+
namespace WebCore {
class Page;
diff --git a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
index 2358fab..438d6a0 100644
--- a/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/FrameLoaderClientEfl.cpp
@@ -707,8 +707,11 @@ void FrameLoaderClientEfl::dispatchDidFinishLoading(DocumentLoader*, unsigned lo
notImplemented();
}
-void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError&)
+void FrameLoaderClientEfl::dispatchDidFailLoading(DocumentLoader* loader, unsigned long identifier, const ResourceError& err)
{
+ if (!shouldFallBack(err))
+ return;
+
if (m_firstData) {
FrameLoader* fl = loader->frameLoader();
fl->writer()->setEncoding(m_response.textEncodingName(), false);
@@ -735,6 +738,9 @@ void FrameLoaderClientEfl::dispatchDidFailProvisionalLoad(const ResourceError& e
void FrameLoaderClientEfl::dispatchDidFailLoad(const ResourceError& err)
{
+ if (!shouldFallBack(err))
+ return;
+
m_loadError = err;
ewk_frame_load_error(m_frame,
m_loadError.domain().utf8().data(),
@@ -782,7 +788,7 @@ ResourceError FrameLoaderClientEfl::cannotShowURLError(const ResourceRequest& re
ResourceError FrameLoaderClientEfl::interruptForPolicyChangeError(const ResourceRequest& request)
{
return ResourceError("Error", WebKitErrorFrameLoadInterruptedByPolicyChange,
- request.url().string(), "Frame load interruped by policy change");
+ request.url().string(), "Frame load interrupted by policy change");
}
ResourceError FrameLoaderClientEfl::cannotShowMIMETypeError(const ResourceResponse& response)
@@ -803,10 +809,9 @@ ResourceError FrameLoaderClientEfl::pluginWillHandleLoadError(const ResourceResp
return ResourceError("Error", 0, "", "");
}
-bool FrameLoaderClientEfl::shouldFallBack(const ResourceError&)
+bool FrameLoaderClientEfl::shouldFallBack(const ResourceError& error)
{
- notImplemented();
- return false;
+ return !(error.isCancellation() || (error.errorCode() == WebKitErrorFrameLoadInterruptedByPolicyChange));
}
bool FrameLoaderClientEfl::canCachePage() const
@@ -816,8 +821,17 @@ bool FrameLoaderClientEfl::canCachePage() const
Frame* FrameLoaderClientEfl::dispatchCreatePage()
{
- notImplemented();
- return 0;
+ if (!m_view)
+ return 0;
+
+ Evas_Object* newView = ewk_view_window_create(m_view, EINA_FALSE, 0);
+ Evas_Object* mainFrame;
+ if (!newView)
+ mainFrame = m_frame;
+ else
+ mainFrame = ewk_view_frame_main_get(newView);
+
+ return ewk_frame_core_get(mainFrame);
}
void FrameLoaderClientEfl::dispatchUnableToImplementPolicy(const ResourceError&)
diff --git a/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp b/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
index 2fa860a..6bfd6ad 100644
--- a/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
+++ b/WebKit/efl/WebCoreSupport/InspectorClientEfl.cpp
@@ -60,7 +60,7 @@ void InspectorClientEfl::storeSetting(const String&, const String&)
bool InspectorClientEfl::sendMessageToFrontend(const String&)
{
- notImpelemented();
+ notImplemented();
return false;
}
diff --git a/WebKit/efl/ewebkit.pc.in b/WebKit/efl/ewebkit.pc.in
index f58e5bf..d618e30 100644
--- a/WebKit/efl/ewebkit.pc.in
+++ b/WebKit/efl/ewebkit.pc.in
@@ -8,4 +8,5 @@ Description: Web content engine for EFL applications
Version: @PROJECT_VERSION@
Requires: cairo evas ecore
Libs: -L${libdir} -lewebkit @EXTRA_EWEBKIT_LINK@
+Libs.private: @LIBS_PRIVATE@
Cflags: -I${includedir}/EWebKit
diff --git a/WebKit/efl/ewk/EWebKit.h b/WebKit/efl/ewk/EWebKit.h
index a61cc9d..e08c4a5 100644
--- a/WebKit/efl/ewk/EWebKit.h
+++ b/WebKit/efl/ewk/EWebKit.h
@@ -29,6 +29,7 @@
#include "ewk_main.h"
#include "ewk_settings.h"
#include "ewk_view.h"
+#include "ewk_window_features.h"
#include <Evas.h>
diff --git a/WebKit/efl/ewk/ewk_private.h b/WebKit/efl/ewk/ewk_private.h
index 5f66fd8..facd6aa 100644
--- a/WebKit/efl/ewk/ewk_private.h
+++ b/WebKit/efl/ewk/ewk_private.h
@@ -56,6 +56,7 @@ void ewk_view_frame_main_load_started(Evas_Object *o);
void ewk_view_load_finished(Evas_Object *o, const Ewk_Frame_Load_Error *error);
void ewk_view_load_error(Evas_Object *o, const Ewk_Frame_Load_Error *error);
void ewk_view_load_progress_changed(Evas_Object *o);
+Evas_Object *ewk_view_window_create(Evas_Object *o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures);
void ewk_view_mouse_link_hover_in(Evas_Object *o, void *data);
void ewk_view_mouse_link_hover_out(Evas_Object *o);
@@ -83,6 +84,8 @@ Eina_Bool ewk_view_run_javascript_prompt(Evas_Object *o, Evas_Object *fra
Eina_Bool ewk_view_should_interrupt_javascript(Evas_Object *o);
uint64_t ewk_view_exceeded_database_quota(Evas_Object *o, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
+Eina_Bool ewk_view_run_open_panel(Evas_Object *o, Evas_Object *frame, Eina_Bool allows_multiple_files, const Eina_List *suggested_filenames, Eina_List **selected_filenames);
+
void ewk_view_repaint(Evas_Object *o, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
void ewk_view_scroll(Evas_Object *o, Evas_Coord dx, Evas_Coord dy, Evas_Coord sx, Evas_Coord sy, Evas_Coord sw, Evas_Coord sh, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch, Eina_Bool main_frame);
WebCore::Page *ewk_view_core_page_get(const Evas_Object *o);
@@ -102,6 +105,8 @@ void ewk_context_menu_item_append(Ewk_Context_Menu *o, WebCore::Con
Ewk_Context_Menu *ewk_context_menu_custom_get(Ewk_Context_Menu *o);
void ewk_context_menu_show(Ewk_Context_Menu *o);
+Ewk_Window_Features *ewk_window_features_new_from_core(const WebCore::WindowFeatures* core);
+
Evas_Object *ewk_frame_add(Evas *e);
Eina_Bool ewk_frame_init(Evas_Object *o, Evas_Object *view, WebCore::Frame *frame);
Evas_Object *ewk_frame_child_add(Evas_Object *o, WTF::PassRefPtr<WebCore::Frame> child, const WebCore::String& name, const WebCore::KURL& url, const WebCore::String& referrer);
diff --git a/WebKit/efl/ewk/ewk_view.cpp b/WebKit/efl/ewk/ewk_view.cpp
index d5920e5..8d66734 100644
--- a/WebKit/efl/ewk/ewk_view.cpp
+++ b/WebKit/efl/ewk/ewk_view.cpp
@@ -18,6 +18,7 @@
Boston, MA 02110-1301, USA.
*/
+#define __STDC_FORMAT_MACROS
#include "config.h"
#include "ewk_view.h"
@@ -43,6 +44,7 @@
#include <Eina.h>
#include <Evas.h>
#include <eina_safety_checks.h>
+#include <inttypes.h>
#include <sys/time.h>
#define ZOOM_MIN (0.05)
@@ -706,6 +708,7 @@ static void _ewk_view_smart_del(Evas_Object* o)
EWK_VIEW_SD_GET(o, sd);
Ewk_View_Private_Data* priv = sd ? sd->_priv : 0;
+ ewk_view_stop(o);
_parent_sc.del(o);
_ewk_view_priv_del(priv);
}
@@ -3150,21 +3153,36 @@ void ewk_view_restore_state(Evas_Object* o, Evas_Object* frame)
/**
* @internal
* Delegates to browser the creation of a new window. If it is not implemented,
- * current view is returned, so navigation might continue in same window.
+ * current view is returned, so navigation might continue in same window. If
+ * browser supports the creation of new windows, a new Ewk_Window_Features is
+ * created and passed to browser. If it intends to keep the request for opening
+ * the window later it must increments the Ewk_Winwdow_Features ref count by
+ * calling ewk_window_features_ref(window_features). Otherwise this struct will
+ * be freed after returning to this function.
*
* @param o Current view.
+ * @param javascript @c EINA_TRUE if the new window is originated from javascript,
+ * @c EINA_FALSE otherwise
+ * @param window_features Features of the new window being created. If it's @c
+ * NULL, it will be created a window with default features.
*
* @return New view, in case smart class implements the creation of new windows;
* else, current view @param o.
+ *
+ * @see ewk_window_features_ref().
*/
-Evas_Object* ewk_view_window_create(Evas_Object* o)
+Evas_Object* ewk_view_window_create(Evas_Object* o, Eina_Bool javascript, const WebCore::WindowFeatures* coreFeatures)
{
EWK_VIEW_SD_GET_OR_RETURN(o, sd, 0);
if (!sd->api->window_create)
return o;
- return sd->api->window_create(sd);
+ Ewk_Window_Features* window_features = ewk_window_features_new_from_core(coreFeatures);
+ Evas_Object* view = sd->api->window_create(sd, javascript, window_features);
+ ewk_window_features_unref(window_features);
+
+ return view;
}
/**
@@ -3449,7 +3467,7 @@ uint64_t ewk_view_exceeded_database_quota(Evas_Object* o, Evas_Object* frame, co
if (!sd->api->exceeded_database_quota)
return 0;
- ERR("##### %lu %lu", current_size, expected_size);
+ INF("current_size=%"PRIu64" expected_size="PRIu64, current_size, expected_size);
return sd->api->exceeded_database_quota(sd, frame, databaseName, current_size, expected_size);
}
diff --git a/WebKit/efl/ewk/ewk_view.h b/WebKit/efl/ewk/ewk_view.h
index b029a68..a8fe3b8 100644
--- a/WebKit/efl/ewk/ewk_view.h
+++ b/WebKit/efl/ewk/ewk_view.h
@@ -21,9 +21,11 @@
#ifndef ewk_view_h
#define ewk_view_h
+#include "ewk_history.h"
+#include "ewk_window_features.h"
+
#include <Evas.h>
#include <cairo.h>
-#include <ewk_history.h>
#ifdef __cplusplus
extern "C" {
@@ -95,7 +97,7 @@ struct _Ewk_View_Smart_Class {
Evas_Smart_Class sc; /**< all but 'data' is free to be changed. */
unsigned long version;
- Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd); /**< creates a new window, requested by webkit */
+ Evas_Object *(*window_create)(Ewk_View_Smart_Data *sd, Eina_Bool javascript, const Ewk_Window_Features *window_features); /**< creates a new window, requested by webkit */
// hooks to allow different backing stores
Evas_Object *(*backing_store_add)(Ewk_View_Smart_Data *sd); /**< must be defined */
Eina_Bool (*scrolls_process)(Ewk_View_Smart_Data *sd); /**< must be defined */
diff --git a/WebKit/efl/ewk/ewk_window_features.cpp b/WebKit/efl/ewk/ewk_window_features.cpp
new file mode 100644
index 0000000..3855e89
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_window_features.cpp
@@ -0,0 +1,156 @@
+/*
+ Copyright (C) 2010 ProFUSION embedded systems
+ Copyright (C) 2010 Samsung Electronics
+
+ 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 "ewk_window_features.h"
+
+#include "WindowFeatures.h"
+#include "ewk_private.h"
+
+#include <Eina.h>
+
+struct _Ewk_Window_Features {
+ unsigned int __ref;
+ WebCore::WindowFeatures* core;
+};
+
+/**
+ * Decrease the ref count of an Ewk_Window_Features, possibly freeing it.
+ *
+ * When its ref count reaches 0, @param window_features is freed.
+ *
+ * @param window_features The window's features.
+ */
+EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features)
+{
+ EINA_SAFETY_ON_NULL_RETURN(window_features);
+ EINA_SAFETY_ON_FALSE_RETURN(window_features->__ref > 0);
+
+ if (--window_features->__ref)
+ return;
+
+ delete window_features->core;
+ window_features->core = 0;
+ free(window_features);
+}
+
+/**
+ * Increase the ref count of an Ewk_Window_Features
+ *
+ * @param window_features The window's features.
+ */
+EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features)
+{
+ EINA_SAFETY_ON_NULL_RETURN(window_features);
+ window_features->__ref++;
+}
+
+/**
+ * Get boolean properties
+ *
+ * @param window_features A window_features.
+ * @param toolbar_visible pointer to store if toolbar is visible.
+ * @param statusbar_visible pointer to store if statusbar is visible.
+ * @param scrollbars_visible pointer to store if scrollbars is visible.
+ * @param menubar_visible pointer to store if menubar is visible.
+ * @param locationbar_visible pointer to store if locationbar is visible.
+ * @param fullscreen pointer to store if fullscreen is enabled.
+ */
+EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_features, Eina_Bool* toolbar_visible, Eina_Bool* statusbar_visible, Eina_Bool* scrollbars_visible, Eina_Bool* menubar_visible, Eina_Bool* locationbar_visible, Eina_Bool* fullscreen)
+{
+ EINA_SAFETY_ON_NULL_RETURN(window_features);
+ EINA_SAFETY_ON_NULL_RETURN(window_features->core);
+
+ if (toolbar_visible)
+ *toolbar_visible = window_features->core->toolBarVisible;
+
+ if (statusbar_visible)
+ *statusbar_visible = window_features->core->statusBarVisible;
+
+ if (scrollbars_visible)
+ *scrollbars_visible = window_features->core->scrollbarsVisible;
+
+ if (menubar_visible)
+ *menubar_visible = window_features->core->menuBarVisible;
+
+ if (locationbar_visible)
+ *locationbar_visible = window_features->core->locationBarVisible;
+
+ if (fullscreen)
+ *fullscreen = window_features->core->fullscreen;
+}
+
+/**
+ * Get int properties
+ *
+ * Properties are returned in the respective pointers. Passing NULL to any of
+ * these pointers will make that property to not be returned. Make sure to check
+ * if the value returned is less than 0 before using it, since in that case it
+ * means that property was not set in @param winwdow_features.
+ *
+ * @param window_features A window_features.
+ * @param x pointer to store x position or -1 if it's not set in window_features.
+ * @param y pointer to store y position or-1 if it's not set in window_features.
+ * @param w pointer to store width or-1 if it's not set in window_features.
+ * @param h pointer to store height or-1 if it's not set in window_features.
+ */
+EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_features, int* x, int* y, int* w, int* h)
+{
+ EINA_SAFETY_ON_NULL_RETURN(window_features);
+ EINA_SAFETY_ON_NULL_RETURN(window_features->core);
+
+ if (x)
+ *x = window_features->core->xSet ? static_cast<int>(window_features->core->x) : -1;
+
+ if (y)
+ *y = window_features->core->ySet ? static_cast<int>(window_features->core->y) : -1;
+
+ if (w)
+ *w = window_features->core->widthSet ? static_cast<int>(window_features->core->width) : -1;
+
+ if (h)
+ *h = window_features->core->heightSet ? static_cast<int>(window_features->core->height) : -1;
+}
+
+/* internal methods ****************************************************/
+
+/**
+ * @internal
+ * Create a new Ewk_Window_Features from a WebCore::WindowFeatures if @param
+ * core is not NULL or a new one with default features.
+ *
+ * A new WebCore::WindowFeatures is allocated copying @param core features and
+ * it is embedded inside an Ewk_Window_Features whose ref count is initialized.
+ *
+ * @returns a new allocated Ewk_Window_Features
+ */
+Ewk_Window_Features* ewk_window_features_new_from_core(const WebCore::WindowFeatures* core)
+{
+ Ewk_Window_Features* window_features = static_cast<Ewk_Window_Features*>(malloc(sizeof(*window_features)));
+
+ if (core)
+ window_features->core = new WebCore::WindowFeatures(*core);
+ else
+ window_features->core = new WebCore::WindowFeatures();
+
+ window_features->__ref = 1;
+
+ return window_features;
+}
diff --git a/WebKit/efl/ewk/ewk_window_features.h b/WebKit/efl/ewk/ewk_window_features.h
new file mode 100644
index 0000000..b579dc4
--- /dev/null
+++ b/WebKit/efl/ewk/ewk_window_features.h
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2010 ProFUSION embedded systems
+ Copyright (C) 2010 Samsung Electronics
+
+ 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 ewk_window_features_h
+#define ewk_window_features_h
+
+#include "ewk_eapi.h"
+
+#include <Eina.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _Ewk_Window_Features Ewk_Window_Features;
+
+EAPI void ewk_window_features_unref(Ewk_Window_Features* window_features);
+EAPI void ewk_window_features_ref(Ewk_Window_Features* window_features);
+
+EAPI void ewk_window_features_bool_property_get(Ewk_Window_Features* window_features, Eina_Bool* toolbar_visible, Eina_Bool* statusbar_visible, Eina_Bool* scrollbars_visible, Eina_Bool* menubar_visible, Eina_Bool* locationbar_visible, Eina_Bool* fullscreen);
+EAPI void ewk_window_features_int_property_get(Ewk_Window_Features* window_features, int* x, int* y, int* w, int* h);
+
+#ifdef __cplusplus
+}
+#endif
+#endif // ewk_window_features_h
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index d1652dc..e13e9ce 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,85 @@
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Cannot change the selection via the keyboard
+ https://bugs.webkit.org/show_bug.cgi?id=41162
+
+ Fix issue where the selection could not be extended via the keyboard by
+ adjusting the logic guarding against inserting text in non-editable nodes.
+
+ * WebCoreSupport/EditorClientGtk.cpp:
+ (WebKit::EditorClient::handleKeyboardEvent):
+ Allow editor commands that do not insert text in non-editable nodes. This
+ fixes keyboard selection extension in non-editable nodes. Move the existing
+ check to after the execution of any editor commands.
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_update_settings):
+ (webkit_web_view_settings_notify):
+ (webkit_get_cache_model):
+
+2010-06-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Remove the abuse of GDK_CURRENT_TIME in the DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40600
+
+ * WebCoreSupport/DragClientGtk.cpp:
+ (WebKit::DragClient::startDrag): Reset the click count after a drag starts.
+ * WebCoreSupport/FrameLoaderClientGtk.cpp:
+ (WebKit::postCommitFrameViewSetup): Reset the click count after a load is committed.
+ * webkit/webkitprivate.h: Move static click counting variables to be per-view.
+ * webkit/webkitwebview.cpp:
+ (getEventTime): Added.
+ (webkit_web_view_button_press_event): If the event time is zero, use the current time.
+ (webkit_web_view_finalize): Clean up click counting member.
+ (webkit_web_view_init): Initialize click counting member.
+
+2010-06-15 Xan Lopez <xlopez@igalia.com>
+
+ Fix compilation with older GTK+.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::pageRect):
+
+2010-06-15 Xan Lopez <xlopez@igalia.com>
+
+ Reviewed by Gustavo Noronha.
+
+ [GTK] Does not compile with -DGSEAL_ENABLE
+ https://bugs.webkit.org/show_bug.cgi?id=37851
+
+ Fix compilation with GSEAL_ENABLE.
+
+ * WebCoreSupport/ChromeClientGtk.cpp:
+ (WebKit::ChromeClient::pageRect):
+ (WebKit::ChromeClient::contentsSizeChanged):
+ * tests/testdomnode.c:
+ (test_dom_node_insertion):
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_realize):
+ (webkit_web_view_script_dialog):
+ (webkit_web_view_drag_end):
+ (webkit_web_view_init):
+
+2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
+
+ Unreviewed build fix.
+
+ This is a fix for flaky inspector tests at gtk-debug bots.
+
+ * WebCoreSupport/InspectorClientGtk.cpp:
+ (WebKit::InspectorFrontendClient::destroyInspectorWindow):
+
2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
index 5759601..fe5d9eb 100644
--- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
@@ -104,7 +104,12 @@ void ChromeClient::setWindowRect(const FloatRect& rect)
FloatRect ChromeClient::pageRect()
{
- GtkAllocation allocation = GTK_WIDGET(m_webView)->allocation;
+ GtkAllocation allocation;
+#if GTK_CHECK_VERSION(2, 18, 0)
+ gtk_widget_get_allocation(GTK_WIDGET(m_webView), &allocation);
+#else
+ allocation = GTK_WIDGET(m_webView)->allocation;
+#endif
return IntRect(allocation.x, allocation.y, allocation.width, allocation.height);
}
@@ -425,9 +430,15 @@ void ChromeClient::contentsSizeChanged(Frame* frame, const IntSize& size) const
// We need to queue a resize request only if the size changed,
// otherwise we get into an infinite loop!
GtkWidget* widget = GTK_WIDGET(m_webView);
+ GtkRequisition requisition;
+#if GTK_CHECK_VERSION(2, 20, 0)
+ gtk_widget_get_requisition(widget, &requisition);
+#else
+ requisition = widget->requisition;
+#endif
if (gtk_widget_get_realized(widget)
- && (widget->requisition.height != size.height())
- || (widget->requisition.width != size.width()))
+ && (requisition.height != size.height())
+ || (requisition.width != size.width()))
gtk_widget_queue_resize_no_redraw(widget);
}
diff --git a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
index 6c395c7..4bcc4c2 100644
--- a/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/DragClientGtk.cpp
@@ -79,6 +79,10 @@ void DragClient::startDrag(DragImageRef image, const IntPoint& dragImageOrigin,
GdkDragContext* context = gtk_drag_begin(GTK_WIDGET(m_webView), targetList.get(), dragOperationToGdkDragActions(clipboard->sourceOperation()), 1, currentEvent.get());
webView->priv->draggingDataObjects.set(context, dataObject);
+ // A drag starting should prevent a double-click from happening. This might
+ // happen if a drag is followed very quickly by another click (like in the DRT).
+ webView->priv->previousClickTime = 0;
+
if (image)
gtk_drag_set_icon_pixbuf(context, image, eventPos.x() - dragImageOrigin.x(), eventPos.y() - dragImageOrigin.y());
else
diff --git a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
index a5c36e8..77ed9b2 100644
--- a/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
@@ -3,7 +3,7 @@
* Copyright (C) 2008 Nuanti Ltd.
* Copyright (C) 2009 Diego Escalante Urrelo <diegoe@gnome.org>
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2009, Igalia S.L.
+ * Copyright (C) 2009, 2010 Igalia S.L.
* Copyright (C) 2010, Martin Robinson <mrobinson@webkit.org>
*
* This library is free software; you can redistribute it and/or
@@ -604,11 +604,6 @@ void EditorClient::handleKeyboardEvent(KeyboardEvent* event)
if (!platformEvent)
return;
- // Don't allow editor commands or text insertion for nodes that
- // cannot edit, unless we are in caret mode.
- if (!frame->editor()->canEdit() && !(frame->settings() && frame->settings()->caretBrowsingEnabled()))
- return;
-
generateEditorCommands(event);
if (m_pendingEditorCommands.size() > 0) {
@@ -622,12 +617,17 @@ void EditorClient::handleKeyboardEvent(KeyboardEvent* event)
return;
}
- if (executePendingEditorCommands(frame, true)) {
+ // Only allow text insertion commands if the current node is editable.
+ if (executePendingEditorCommands(frame, frame->editor()->canEdit())) {
event->setDefaultHandled();
return;
}
}
+ // Don't allow text insertion for nodes that cannot edit.
+ if (!frame->editor()->canEdit())
+ return;
+
// This is just a normal text insertion, so wait to execute the insertion
// until a keypress event happens. This will ensure that the insertion will not
// be reflected in the contents of the field until the keyup DOM event.
diff --git a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
index 021374c..17a3cd5 100644
--- a/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp
@@ -1145,6 +1145,9 @@ static void postCommitFrameViewSetup(WebKitWebFrame *frame, FrameView *view, boo
gtk_menu_popdown(menu);
g_object_unref(menu);
}
+
+ // Do not allow click counting between main frame loads.
+ priv->previousClickTime = 0;
}
void FrameLoaderClient::transitionToCommittedFromCachedFrame(CachedFrame* cachedFrame)
diff --git a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
index 5e69c31..4bc3c32 100644
--- a/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
+++ b/WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp
@@ -175,12 +175,15 @@ void InspectorFrontendClient::destroyInspectorWindow()
core(m_inspectedWebView)->inspectorController()->disconnectFrontend();
+ if (m_inspectorClient)
+ m_inspectorClient->releaseFrontendPage();
+
gboolean handled = FALSE;
g_signal_emit_by_name(webInspector, "close-window", &handled);
ASSERT(handled);
- if (m_inspectorClient)
- m_inspectorClient->releaseFrontendPage();
+ // Please do not use member variables here because InspectorFrontendClient object pointed by 'this'
+ // has been implicitly deleted by "close-window" function.
/* we should now dispose our own reference */
g_object_unref(webInspector);
diff --git a/WebKit/gtk/po/ChangeLog b/WebKit/gtk/po/ChangeLog
index b9f97fe..ec5330e 100644
--- a/WebKit/gtk/po/ChangeLog
+++ b/WebKit/gtk/po/ChangeLog
@@ -1,3 +1,12 @@
+2010-06-25 Fran Diéguez <fran.dieguez@mabishu.com>
+
+ Reviewed by Darin Adler.
+
+ Add Galician translation to webkitgtk
+ https://bugs.webkit.org/show_bug.cgi?id=39547
+
+ * gl.po: Added.
+
2010-04-05 Lucas Lommer <llommer@svn.gnome.org>
Reviewed by Gustavo Noronha.
diff --git a/WebKit/gtk/po/gl.po b/WebKit/gtk/po/gl.po
new file mode 100644
index 0000000..266f7f4
--- /dev/null
+++ b/WebKit/gtk/po/gl.po
@@ -0,0 +1,1117 @@
+# Galician translation for webkit.
+# Copyright (C) 2009 webkit's COPYRIGHT HOLDER
+# This file is distributed under the same license as the webkit package.
+# Fran Diéguez <frandieguez@ubuntu.com>, 2009, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: webkit HEAD\n"
+"Report-Msgid-Bugs-To: http://bugs.webkit.org/\n"
+"POT-Creation-Date: 2010-02-25 15:53-0300\n"
+"PO-Revision-Date: 2010-05-23 01:14+0200\n"
+"Last-Translator: Fran Diéguez <frandieguez@ubuntu.com>\n"
+"Language-Team: Galician <gnome@g11.net>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n!=1);\\\n"
+
+#: WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp:535
+msgid "Upload File"
+msgstr "Subir ficheiro"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:61
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:143
+msgid "Input _Methods"
+msgstr "_Métodos de entrada"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:78
+msgid "LRM _Left-to-right mark"
+msgstr "Marca de _esquerda-a-derita [LRM]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:79
+msgid "RLM _Right-to-left mark"
+msgstr "Marca de _dereita-a-esquerda [RLM]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:80
+msgid "LRE Left-to-right _embedding"
+msgstr "In_crustamento de esquerda-a-dereita [LRE]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:81
+msgid "RLE Right-to-left e_mbedding"
+msgstr "Inc_rustamento de dereita-a-esquerda [RLE]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:82
+msgid "LRO Left-to-right _override"
+msgstr "_Prevalencia de esquerda-a-dereita [LRO]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:83
+msgid "RLO Right-to-left o_verride"
+msgstr "Pre_valencia de dereita-a-esquerda [RLO]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:84
+msgid "PDF _Pop directional formatting"
+msgstr "Formatadeo d_ireccional emerxente de PDF"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:85
+msgid "ZWS _Zero width space"
+msgstr "Espazo de anchura _cero [ZWS]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:86
+msgid "ZWJ Zero width _joiner"
+msgstr "En_samblador de ancho cero [ZWJ]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:87
+msgid "ZWNJ Zero width _non-joiner"
+msgstr "_Non ensamblador de anchura cero [ZWNJ]"
+
+#: WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp:109
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:138
+msgid "_Insert Unicode Control Character"
+msgstr "_Insertar un carácter de control Unicode"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:266
+msgid "Network Request"
+msgstr "Solicitude de rede"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:267
+msgid "The network request for the URI that should be downloaded"
+msgstr "A solicitude de rede para o URI que debe descargarse"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:281
+#| msgid "Network Request"
+msgid "Network Response"
+msgstr "Resposta de rede"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:282
+#| msgid "The network request for the URI that should be downloaded"
+msgid "The network response for the URI that should be downloaded"
+msgstr "A resposta de rede do URI que debería ser descargado"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:296
+msgid "Destination URI"
+msgstr "URI de destino"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:297
+msgid "The destination URI where to save the file"
+msgstr "A URI de destino onde gardar o ficheiro"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:311
+msgid "Suggested Filename"
+msgstr "Nome do ficheiro suxerido"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:312
+msgid "The filename suggested as default when saving"
+msgstr "O nome de ficheiro suxerido como predefinido ao gardar"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:329
+msgid "Progress"
+msgstr "Progreso"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:330
+msgid "Determines the current progress of the download"
+msgstr "Determina o progreso actual da descarga"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:343
+msgid "Status"
+msgstr "Estado"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:344
+msgid "Determines the current status of the download"
+msgstr "Determina o estado actual da descarga"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:359
+msgid "Current Size"
+msgstr "Tamaño actual"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:360
+msgid "The length of the data already downloaded"
+msgstr "A lonxitude dos datos xa descargados"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:374
+msgid "Total Size"
+msgstr "Tamaño total"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:375
+msgid "The total size of the file"
+msgstr "O tamaño total do ficheiro"
+
+#: WebKit/gtk/webkit/webkitdownload.cpp:526
+msgid "User cancelled the download"
+msgstr "O usuario cancelou a descarga"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:248
+#, c-format
+msgid "A username and password are being requested by the site %s"
+msgstr "O sitio %s solicitou un nome de usuario e unha contrasinal"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:278
+msgid "Server message:"
+msgstr "Mensaxe do servidor:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:291
+msgid "Username:"
+msgstr "Nome de usuario:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:293
+msgid "Password:"
+msgstr "Contrasinal:"
+
+#: WebKit/gtk/webkit/webkitsoupauthdialog.c:302
+#| msgid "Remember password"
+msgid "_Remember password"
+msgstr "_Lembrar o contrasinal"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:298
+msgid "Name"
+msgstr "Nome"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:299
+msgid "The name of the frame"
+msgstr "O nome do marco"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:305
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:146
+#: WebKit/gtk/webkit/webkitwebview.cpp:2318
+msgid "Title"
+msgstr "Título"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:306
+msgid "The document title of the frame"
+msgstr "O título do documento do marco"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:312
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:178
+#: WebKit/gtk/webkit/webkitwebview.cpp:2332
+msgid "URI"
+msgstr "URI"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:313
+msgid "The current URI of the contents displayed by the frame"
+msgstr "O URI actual dos contidos mostrados no marco"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:344
+msgid "Horizontal Scrollbar Policy"
+msgstr "Normativa da barra de desprazamento horizontal"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:345
+#| msgid "Determines the current progress of the download"
+msgid ""
+"Determines the current policy for the horizontal scrollbar of the frame."
+msgstr ""
+"Determina a normativa actual para a barra de desprazamento horizontal para o "
+"marco."
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:362
+msgid "Vertical Scrollbar Policy"
+msgstr "Normativa da barra de desprazamento vertical"
+
+#: WebKit/gtk/webkit/webkitwebframe.cpp:363
+#| msgid "Determines the current progress of the download"
+msgid "Determines the current policy for the vertical scrollbar of the frame."
+msgstr ""
+"Determina a normativa actual para a barra de desprazamento vertical para o "
+"marco."
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:147
+msgid "The title of the history item"
+msgstr "O título do elemento do historial"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:162
+msgid "Alternate Title"
+msgstr "Título alternativo"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:163
+msgid "The alternate title of the history item"
+msgstr "O título alternativo do elemento do historial"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:179
+msgid "The URI of the history item"
+msgstr "O URI do elemento do historial"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:194
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:173
+msgid "Original URI"
+msgstr "URI orixinal"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:195
+msgid "The original URI of the history item"
+msgstr "O URI orixinal do elemento do historial"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:210
+msgid "Last visited Time"
+msgstr "Tempo da última visita"
+
+#: WebKit/gtk/webkit/webkitwebhistoryitem.cpp:211
+msgid "The time at which the history item was last visited"
+msgstr "O tempo no cal o elemento do historial foi visitado a última vez"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:268
+msgid "Web View"
+msgstr "Visualización web"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:269
+msgid "The Web View that renders the Web Inspector itself"
+msgstr "A visualización web que renderiza o propio Inspector web"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:282
+msgid "Inspected URI"
+msgstr "URI inspeccionada"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:283
+msgid "The URI that is currently being inspected"
+msgstr "O URI que está sendo inspeccionada actualmente"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:299
+msgid "Enable JavaScript profiling"
+msgstr "Activar o perfilado de JavaScript"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:300
+msgid "Profile the executed JavaScript."
+msgstr "Perfilar o JavaScript executado."
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:315
+#| msgid "Enable JavaScript profiling"
+msgid "Enable Timeline profiling"
+msgstr "Activar o perfilado da Liña de tempo"
+
+#: WebKit/gtk/webkit/webkitwebinspector.cpp:316
+msgid "Profile the WebCore instrumentation."
+msgstr "Perfilar a instrumentación de WebCore."
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:158
+msgid "Reason"
+msgstr "Razón"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:159
+msgid "The reason why this navigation is occurring"
+msgstr "A razón pola que esta navegación está ocorrendo"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:174
+msgid "The URI that was requested as the target for the navigation"
+msgstr "O URI que foi solicitado como destino para a navegación"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:188
+msgid "Button"
+msgstr "Botón"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:189
+msgid "The button used to click"
+msgstr "O botón empregado para premer"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:204
+msgid "Modifier state"
+msgstr "Estado dos modificadores"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:205
+msgid "A bitmask representing the state of the modifier keys"
+msgstr "A máscara de bits representa o estado das teclas modificadoras"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:220
+#| msgid "The name of the frame"
+msgid "Target frame"
+msgstr "Marco de destino"
+
+#: WebKit/gtk/webkit/webkitwebnavigationaction.cpp:221
+#| msgid "The URI that was requested as the target for the navigation"
+msgid "The target frame for the navigation"
+msgstr "O marco de destino para a navegación"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:237
+msgid "Default Encoding"
+msgstr "Codificación predefinida"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:238
+msgid "The default encoding used to display text."
+msgstr "A codificación predefinida empregada para mostrar o texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:246
+msgid "Cursive Font Family"
+msgstr "Familia de tipo de fonte cursiva"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:247
+msgid "The default Cursive font family used to display text."
+msgstr "A familia de tipo de fonte cursiva empregado para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:255
+msgid "Default Font Family"
+msgstr "Familia de tipo de fonte predefinida"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:256
+msgid "The default font family used to display text."
+msgstr "A familia de fonte predefinida para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:264
+msgid "Fantasy Font Family"
+msgstr "Familia de tipo de fonte Fantasy"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:265
+msgid "The default Fantasy font family used to display text."
+msgstr "A familia de tipo de fonte Fantasy empregado para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:273
+msgid "Monospace Font Family"
+msgstr "Familia de tipo de fonte Monospace"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:274
+msgid "The default font family used to display monospace text."
+msgstr "A familia de tipo de fonte predefinido empregado para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:282
+msgid "Sans Serif Font Family"
+msgstr "Familia de tipo de fonte Sans Serif"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:283
+msgid "The default Sans Serif font family used to display text."
+msgstr "A familia de tipo de fonte Sans Serif empregado para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:291
+msgid "Serif Font Family"
+msgstr "Familia de tipo de fonte Serif"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:292
+msgid "The default Serif font family used to display text."
+msgstr "A familia de tipo de fonte Serif empregado para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:300
+msgid "Default Font Size"
+msgstr "Tamaño do tipo de fonte predefinido"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:301
+msgid "The default font size used to display text."
+msgstr "O tamaño do tipo de fonte predefinido para mostrar o texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:309
+msgid "Default Monospace Font Size"
+msgstr "Tamaño predefinido do tipo de fonte monoespaciado"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:310
+msgid "The default font size used to display monospace text."
+msgstr ""
+"O tamaño predefinido de tipo de fonte para mostrar o texto monoespaciado"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:318
+msgid "Minimum Font Size"
+msgstr "Tamaño mínimo para o tipo de fonte"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:319
+msgid "The minimum font size used to display text."
+msgstr "Tamaño mínimo do tipo de fonte empregado para mostrar o texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:327
+msgid "Minimum Logical Font Size"
+msgstr "O tamaño lóxico de fonte mínimo"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:328
+msgid "The minimum logical font size used to display text."
+msgstr "O tamaño lóxico de fonte mínimo a empregar para mostrar texto."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:347
+msgid "Enforce 96 DPI"
+msgstr "Forzar 96 DPI."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:348
+msgid "Enforce a resolution of 96 DPI"
+msgstr "Forzar unha resolución de 96 DPI"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:356
+msgid "Auto Load Images"
+msgstr "Cargar imaxes automáticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:357
+msgid "Load images automatically."
+msgstr "Carga imaxes automaticamente."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:365
+msgid "Auto Shrink Images"
+msgstr "Recortar imaxes automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:366
+msgid "Automatically shrink standalone images to fit."
+msgstr "Recorta de forma automática as imaxes para que se axusten."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:374
+msgid "Print Backgrounds"
+msgstr "Imprimir fondos"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:375
+msgid "Whether background images should be printed."
+msgstr "Indica se se deben imprimir as imaxes de fondo."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:383
+msgid "Enable Scripts"
+msgstr "Activar scripts"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:384
+msgid "Enable embedded scripting languages."
+msgstr "Activa as linguaxes de scripting incrustadas."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:392
+msgid "Enable Plugins"
+msgstr "Activar complementos"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:393
+msgid "Enable embedded plugin objects."
+msgstr "Activar os obxectos de complementos incrustados."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:401
+msgid "Resizable Text Areas"
+msgstr "Áreas de texto retamañábeis"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:402
+msgid "Whether text areas are resizable."
+msgstr "Indica se as áreas de texto son retamañábeis."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:409
+msgid "User Stylesheet URI"
+msgstr "URI da folla de estilos do usuario"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:410
+msgid "The URI of a stylesheet that is applied to every page."
+msgstr "O URI dunha folla de estilos que se aplica en cada páxina."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:425
+msgid "Zoom Stepping Value"
+msgstr "Valor de salto do zoom"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:426
+msgid "The value by which the zoom level is changed when zooming in or out."
+msgstr ""
+"O valor polo cal o nivel de zoom se cambiará ao incrementar o zoom ou "
+"reducilo."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:444
+msgid "Enable Developer Extras"
+msgstr "Activar extras do desenvolvedor"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:445
+msgid "Enables special extensions that help developers"
+msgstr "Activa as extensións especiais que axudan aos desenvolvedores"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:465
+msgid "Enable Private Browsing"
+msgstr "Activar a navegación privada"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:466
+msgid "Enables private browsing mode"
+msgstr "Activa o modo privado de navegación"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:481
+msgid "Enable Spell Checking"
+msgstr "Activar a corrección ortográfica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:482
+#| msgid "Check Spelling While _Typing"
+msgid "Enables spell checking while typing"
+msgstr "Comprobar ortografía ao escribir"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:505
+msgid "Languages to use for spell checking"
+msgstr "Idiomas a usar na corrección ortográfica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:506
+msgid "Comma separated list of languages to use for spell checking"
+msgstr ""
+"Lista de separada por comas das linguaxes a usar na comprobación ortográfica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:520
+#| msgid "Enable Private Browsing"
+msgid "Enable Caret Browsing"
+msgstr "Activar a navegación cos cursores"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:521
+msgid "Whether to enable accesibility enhanced keyboard navigation"
+msgstr ""
+"Indica se activar a navegación mellorada por teclado para a accesibilidade"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:536
+msgid "Enable HTML5 Database"
+msgstr "Activar a base de datos de HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:537
+msgid "Whether to enable HTML5 database support"
+msgstr "Indica se activar a compatibilidade de HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:552
+msgid "Enable HTML5 Local Storage"
+msgstr "Activar o almacenamento local de HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:553
+msgid "Whether to enable HTML5 Local Storage support"
+msgstr "Indica se activar a compatibilidade de almacenamento local de HTML5"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:567
+#| msgid "Enable Scripts"
+msgid "Enable XSS Auditor"
+msgstr "Activar o auditor de XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:568
+msgid "Whether to enable teh XSS auditor"
+msgstr "Indica se activar o auditor de XSS"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:586
+msgid "User Agent"
+msgstr "Axente de usuario"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:587
+msgid "The User-Agent string used by WebKitGtk"
+msgstr "A cadea User-Agent usada polo WebKitGtk"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:602
+msgid "JavaScript can open windows automatically"
+msgstr "JavaScript pode abrir xanelas automáticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:603
+msgid "Whether JavaScript can open windows automatically"
+msgstr "Indica se JavaScript pode abrir xanelas automaticamente"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:618
+msgid "Enable offline web application cache"
+msgstr "Activar a caché de aplicativo web fóra de liña"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:619
+msgid "Whether to enable offline web application cache"
+msgstr "Indica"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:646
+msgid "Editing behavior"
+msgstr "Comportamento de edición"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:647
+msgid "The behavior mode to use in editing mode"
+msgstr "O modo de comportamento no modo de edición"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:663
+msgid "Enable universal access from file URIs"
+msgstr "Activar o acceso universal para os URIs de ficheiro"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:664
+msgid "Whether to allow universal access from file URIs"
+msgstr "Indica se permitir o acceso universal desde os URI de ficheiro"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:679
+#| msgid "Enable Scripts"
+msgid "Enable DOM paste"
+msgstr "Activar o pegado de DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:680
+msgid "Whether to enable DOM paste"
+msgstr "Indica se activar o pegado de DOM"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:698
+msgid "Tab key cycles through elements"
+msgstr "A tecla de tabulación móvese ciclicamente a través dos elementos"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:699
+msgid "Whether the tab key cycles through elements on the page."
+msgstr ""
+"Indica se a tecla de tabulación móvese ciclicamente a través dos elementos "
+"nunha da páxina."
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:719
+msgid "Enable Default Context Menu"
+msgstr "Activar o menú contextual predefinido"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:720
+msgid ""
+"Enables the handling of right-clicks for the creation of the default context "
+"menu"
+msgstr ""
+"Activa a xestión dos clic dereitos para a creación do menú contextual "
+"predefinido"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:740
+msgid "Enable Site Specific Quirks"
+msgstr "Activar as solucións específicas dun sitio"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:741
+msgid "Enables the site-specific compatibility workarounds"
+msgstr "Activa os arranxos de compatibilidade específicos dun sitio"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:763
+msgid "Enable page cache"
+msgstr "Activar a caché de páxina"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:764
+#| msgid "Whether background images should be printed."
+msgid "Whether the page cache should be used"
+msgstr "Indica se se debería usar a caché de páxina"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:784
+msgid "Auto Resize Window"
+msgstr "Autoredimentsionar a xanela"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:785
+msgid "Automatically resize the toplevel window when a page requests it"
+msgstr ""
+"Redimensionar automaticamente a xanela de nivel superior cando a páxina o "
+"solicite"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:817
+#| msgid "Enable JavaScript profiling"
+msgid "Enable Java Applet"
+msgstr "Activar os Applet de Java"
+
+#: WebKit/gtk/webkit/webkitwebsettings.cpp:818
+msgid "Whether Java Applet support through <applet> should be enabled"
+msgstr ""
+"Indica se se debería activar a compatibilidade dos Applet de Java a través "
+"de <applet>"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2319
+msgid "Returns the @web_view's document title"
+msgstr "Devolve o título do documento do @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2333
+msgid "Returns the current URI of the contents displayed by the @web_view"
+msgstr "Devolve o URI actual dos contidos mostrados polo @web_view"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2346
+msgid "Copy target list"
+msgstr "Copiar lista de destinos"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2347
+msgid "The list of targets this web view supports for clipboard copying"
+msgstr ""
+"A lista de destinos para os cales esta visualización web ten compatibilidade "
+"para copiar no portarretallos"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2360
+msgid "Paste target list"
+msgstr "Pegar lista de destinos"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2361
+msgid "The list of targets this web view supports for clipboard pasting"
+msgstr ""
+"A lista de destinos para os que esta visualización web ten compatibilidade "
+"para pegar no portarretallos"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2367
+msgid "Settings"
+msgstr "Configuracións"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2368
+msgid "An associated WebKitWebSettings instance"
+msgstr "Unha instancia de WebKitWebSettings asociada"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2381
+msgid "Web Inspector"
+msgstr "Inspector web"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2382
+msgid "The associated WebKitWebInspector instance"
+msgstr "A instancia de WebKitWebInspector asociada"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2402
+msgid "Editable"
+msgstr "Editábel"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2403
+msgid "Whether content can be modified by the user"
+msgstr "Indica se o contido pode ser modificado polo usuario"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2409
+msgid "Transparent"
+msgstr "Transparente"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2410
+msgid "Whether content has a transparent background"
+msgstr "Indica se o contido pode ter un fondo transparente"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2423
+msgid "Zoom level"
+msgstr "Nivel de zoom"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2424
+msgid "The level of zoom of the content"
+msgstr "O nivel de zoom do contido"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2439
+msgid "Full content zoom"
+msgstr "Zoom de contido completo"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2440
+msgid "Whether the full content is scaled when zooming"
+msgstr "Indica se o contido completo é escalado ao facer zoom"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2453
+msgid "Encoding"
+msgstr "Codificación"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2454
+msgid "The default encoding of the web view"
+msgstr "A codificación predefinida para a visualización web"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2467
+msgid "Custom Encoding"
+msgstr "Codificación personalizada"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2468
+msgid "The custom encoding of the web view"
+msgstr "A codificación personalizada para a visualización web"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2520
+msgid "Icon URI"
+msgstr "URI da icona"
+
+#: WebKit/gtk/webkit/webkitwebview.cpp:2521
+msgid "The URI for the favicon for the #WebKitWebView."
+msgstr "O URI do favicon para o #WebKitWebView."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:55
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:60
+msgid "Submit"
+msgstr "Enviar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:65
+msgid "Reset"
+msgstr "Restabelecer"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:70
+msgid "This is a searchable index. Enter search keywords: "
+msgstr "Este é un índice buscábel. Insira as palabras chave de búsqueda:"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:75
+msgid "Choose File"
+msgstr "Seleccionar ficheiro"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:80
+msgid "(None)"
+msgstr "(ningún)"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:85
+msgid "Open Link in New _Window"
+msgstr "Abrir a ligazón nunha nova _xanela"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:90
+msgid "_Download Linked File"
+msgstr "_Descargar o ficheiro ligado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:95
+msgid "Copy Link Loc_ation"
+msgstr "Copiar a loc_alización da ligazón"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:100
+msgid "Open _Image in New Window"
+msgstr "Abrir _imaxe nunha nova xanela"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:105
+msgid "Sa_ve Image As"
+msgstr "Gar_dar imaxe como"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:110
+msgid "Cop_y Image"
+msgstr "Co_piar imaxe"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:115
+msgid "Open _Frame in New Window"
+msgstr "Abrir _marco nunha nova xanela"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:166
+msgid "_Reload"
+msgstr "_Recargar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:183
+msgid "No Guesses Found"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:188
+msgid "_Ignore Spelling"
+msgstr "_Ignorar corrección ortográfica"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:193
+msgid "_Learn Spelling"
+msgstr "Apren_er corrección ortográfica"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:198
+msgid "_Search the Web"
+msgstr "_Buscar na web"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:203
+msgid "_Look Up in Dictionary"
+msgstr "_Buscar no dicionario"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:208
+msgid "_Open Link"
+msgstr "_Abrir ligazón"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:213
+msgid "Ignore _Grammar"
+msgstr "Ignorar _gramática"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:218
+msgid "Spelling and _Grammar"
+msgstr "Corrección ortográfica e _gramatical"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Show Spelling and Grammar"
+msgstr "_Mostrar corrección ortográfica e gramatical"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:223
+msgid "_Hide Spelling and Grammar"
+msgstr "_Agochar corrección ortográfica e gramatical"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:228
+msgid "_Check Document Now"
+msgstr "_Comprobar o documento agora"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:233
+msgid "Check Spelling While _Typing"
+msgstr "Comprobar ortografía ao _escribir"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:238
+msgid "Check _Grammar With Spelling"
+msgstr "Comprobar _gramática ao escribir"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:243
+msgid "_Font"
+msgstr "_Tipo de fonte"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:266
+msgid "_Outline"
+msgstr "_Contorno"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:271
+msgid "Inspect _Element"
+msgstr "Inspeccionar _elemento"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:276
+msgid "No recent searches"
+msgstr "Non hai buscas recentes"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:281
+msgid "Recent searches"
+msgstr "Buscas recentes"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:286
+msgid "_Clear recent searches"
+msgstr "_Limpar as buscas recentes"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:291
+msgid "term"
+msgstr "termo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:296
+msgid "definition"
+msgstr "definición"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:301
+msgid "press"
+msgstr "premer"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:306
+msgid "select"
+msgstr "seleccionar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:311
+msgid "activate"
+msgstr "activado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:316
+msgid "uncheck"
+msgstr "desmarcar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:321
+msgid "check"
+msgstr "marcar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:326
+msgid "jump"
+msgstr "saltar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:342
+msgid " files"
+msgstr " ficheiros"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:347
+msgid "Unknown"
+msgstr "Descoñecido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:364
+msgid "Loading..."
+msgstr "Cargando..."
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:369
+msgid "Live Broadcast"
+msgstr "Retransmisión en vivo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:375
+msgid "audio element controller"
+msgstr "controlador do elemento de son"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:377
+msgid "video element controller"
+msgstr "controlador de elemento de vídeo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:379
+msgid "mute"
+msgstr "enmudecer"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:381
+msgid "unmute"
+msgstr "desenmudecer"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:383
+msgid "play"
+msgstr "reproducir"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:385
+msgid "pause"
+msgstr "pausar"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:387
+msgid "movie time"
+msgstr "tempo do filme"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:389
+msgid "timeline slider thumb"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:391
+msgid "back 30 seconds"
+msgstr "abrás 30 segundos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:393
+msgid "return to realtime"
+msgstr "voltar ao tempo real"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:395
+msgid "elapsed time"
+msgstr "tempo transcorrido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:397
+msgid "remaining time"
+msgstr "tempo restante"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:399
+#| msgid "Status"
+msgid "status"
+msgstr "estado"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:401
+msgid "fullscreen"
+msgstr "pantalla completa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:403
+msgid "fast forward"
+msgstr "avance rápido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:405
+msgid "fast reverse"
+msgstr "retroceso rápido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:407
+msgid "show closed captions"
+msgstr "mostrar os subtítulos pechados"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:409
+msgid "hide closed captions"
+msgstr "ocultar os subtítulos pechados"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:418
+msgid "audio element playback controls and status display"
+msgstr "controis e xanela de estado de reprodución dos elementos de son"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:420
+msgid "video element playback controls and status display"
+msgstr "controis e xanela de estado de reprodución dos elementos de vídeo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:422
+msgid "mute audio tracks"
+msgstr "enmudecer as pistas de son"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:424
+msgid "unmute audio tracks"
+msgstr "desenmudecer as pistas de son"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:426
+msgid "begin playback"
+msgstr "comezar a reprodución"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:428
+msgid "pause playback"
+msgstr "pausar a reprodución"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:430
+msgid "movie time scrubber"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:432
+msgid "movie time scrubber thumb"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:434
+msgid "seek movie back 30 seconds"
+msgstr "buscar cara atrás no filme 30 segundos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:436
+msgid "return streaming movie to real time"
+msgstr "devolver a reprodución en vivo do filme ao tempo real"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:438
+msgid "current movie time in seconds"
+msgstr "tempo actual do filme en segundos"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:440
+msgid "number of seconds of movie remaining"
+msgstr "números de segundos que faltan do filme"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:442
+msgid "current movie status"
+msgstr "estado do filme actual"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:444
+msgid "seek quickly back"
+msgstr "buscar cara atrás rápidamente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:446
+msgid "seek quickly forward"
+msgstr "buscar cara adiante rápidamente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:448
+msgid "Play movie in fullscreen mode"
+msgstr "Reproducir o filme en pantalla completa"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:450
+msgid "start displaying closed captions"
+msgstr "comezar a mostrar os subtítulos pechados"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:452
+msgid "stop displaying closed captions"
+msgstr "parar de mostrar os subtítulos pechados"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:461
+#| msgid "definition"
+msgid "indefinite time"
+msgstr "tempo non definido"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:491
+msgid "value missing"
+msgstr "falta o valor"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:497
+msgid "type mismatch"
+msgstr "tipo non coincidente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:502
+msgid "pattern mismatch"
+msgstr "patron non coincidente"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:507
+msgid "too long"
+msgstr "demasiado longo"
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:512
+msgid "range underflow"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:517
+msgid "range overflow"
+msgstr ""
+
+#: WebCore/platform/gtk/LocalizedStringsGtk.cpp:522
+msgid "step mismatch"
+msgstr "paso non coincidente"
+
+#~ msgid "_Searchable Index"
+#~ msgstr "Índice bu_scábel"
diff --git a/WebKit/gtk/webkit/webkitprivate.h b/WebKit/gtk/webkit/webkitprivate.h
index 44ffc1e..556648d 100644
--- a/WebKit/gtk/webkit/webkitprivate.h
+++ b/WebKit/gtk/webkit/webkitprivate.h
@@ -56,6 +56,7 @@
#include "Page.h"
#include "Frame.h"
#include "InspectorClientGtk.h"
+#include "IntPoint.h"
#include "FrameLoaderClient.h"
#include "ResourceHandle.h"
#include "ResourceRequest.h"
@@ -152,6 +153,11 @@ extern "C" {
GHashTable* subResources;
char* tooltipText;
+ int currentClickCount;
+ WebCore::IntPoint* previousClickPoint;
+ guint previousClickButton;
+ guint32 previousClickTime;
+
HashMap<GdkDragContext*, RefPtr<WebCore::DataObjectGtk> > draggingDataObjects;
};
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 6744732..ce2bbc6 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -41,6 +41,7 @@
#include "webkitwebhistoryitem.h"
#include "AXObjectCache.h"
+#include "AbstractDatabase.h"
#include "BackForwardList.h"
#include "Cache.h"
#include "ChromeClientGtk.h"
@@ -49,7 +50,6 @@
#include "ContextMenuController.h"
#include "ContextMenu.h"
#include "Cursor.h"
-#include "Database.h"
#include "Document.h"
#include "DocumentLoader.h"
#include "DragClientGtk.h"
@@ -587,16 +587,25 @@ static gboolean webkit_web_view_key_release_event(GtkWidget* widget, GdkEventKey
return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->key_release_event(widget, event);
}
-static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventButton* event)
+static guint32 getEventTime(GdkEvent* event)
{
- // Eventually it may make sense for these to be per-view and per-device,
- // but at this time the implementation matches the Windows port.
- static int currentClickCount = 1;
- static IntPoint previousPoint;
- static guint previousButton;
- static guint32 previousTime;
+ guint32 time = gdk_event_get_time(event);
+ if (time)
+ return time;
+
+ // Real events always have a non-zero time, but events synthesized
+ // by the DRT do not and we must calculate a time manually. This time
+ // is not calculated in the DRT, because GTK+ does not work well with
+ // anything other than GDK_CURRENT_TIME on synthesized events.
+ GTimeVal timeValue;
+ g_get_current_time(&timeValue);
+ return (timeValue.tv_sec * 1000) + (timeValue.tv_usec / 1000);
+}
+static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventButton* event)
+{
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
+ WebKitWebViewPrivate* priv = webView->priv;
// FIXME: need to keep track of subframe focus for key events
gtk_widget_grab_focus(widget);
@@ -620,20 +629,21 @@ static gboolean webkit_web_view_button_press_event(GtkWidget* widget, GdkEventBu
// GTK+ only counts up to triple clicks, but WebCore wants to know about
// quadruple clicks, quintuple clicks, ad infinitum. Here, we replicate the
// GDK logic for counting clicks.
+ guint32 eventTime = getEventTime(reinterpret_cast<GdkEvent*>(event));
if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
- || ((abs(event->x - previousPoint.x()) < doubleClickDistance)
- && (abs(event->y - previousPoint.y()) < doubleClickDistance)
- && (event->time - previousTime < static_cast<guint>(doubleClickTime))
- && (event->button == previousButton)))
- currentClickCount++;
+ || ((abs(event->x - priv->previousClickPoint->x()) < doubleClickDistance)
+ && (abs(event->y - priv->previousClickPoint->y()) < doubleClickDistance)
+ && (eventTime - priv->previousClickTime < static_cast<guint>(doubleClickTime))
+ && (event->button == priv->previousClickButton)))
+ priv->currentClickCount++;
else
- currentClickCount = 1;
+ priv->currentClickCount = 1;
PlatformMouseEvent platformEvent(event);
- platformEvent.setClickCount(currentClickCount);
- previousPoint = platformEvent.pos();
- previousButton = event->button;
- previousTime = event->time;
+ platformEvent.setClickCount(priv->currentClickCount);
+ *priv->previousClickPoint = platformEvent.pos();
+ priv->previousClickButton = event->button;
+ priv->previousClickTime = eventTime;
if (event->button == 3)
return webkit_web_view_forward_context_menu_event(webView, PlatformMouseEvent(event));
@@ -799,17 +809,24 @@ static gboolean webkit_web_view_focus_out_event(GtkWidget* widget, GdkEventFocus
static void webkit_web_view_realize(GtkWidget* widget)
{
- GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED);
+ gtk_widget_set_realized(widget, TRUE);
+
+ GtkAllocation allocation;
+#if GTK_CHECK_VERSION(2, 18, 0)
+ gtk_widget_get_allocation(widget, &allocation);
+#else
+ allocation = widget->allocation;
+#endif
GdkWindowAttr attributes;
attributes.window_type = GDK_WINDOW_CHILD;
- attributes.x = widget->allocation.x;
- attributes.y = widget->allocation.y;
- attributes.width = widget->allocation.width;
- attributes.height = widget->allocation.height;
+ attributes.x = allocation.x;
+ attributes.y = allocation.y;
+ attributes.width = allocation.width;
+ attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.visual = gtk_widget_get_visual (widget);
- attributes.colormap = gtk_widget_get_colormap (widget);
+ attributes.visual = gtk_widget_get_visual(widget);
+ attributes.colormap = gtk_widget_get_colormap(widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK
| GDK_EXPOSURE_MASK
| GDK_BUTTON_PRESS_MASK
@@ -823,15 +840,20 @@ static void webkit_web_view_realize(GtkWidget* widget)
| GDK_BUTTON3_MOTION_MASK;
gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
- widget->window = gdk_window_new(gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
- gdk_window_set_user_data(widget->window, widget);
+ GdkWindow* window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, attributes_mask);
+ gtk_widget_set_window(widget, window);
+ gdk_window_set_user_data(window, widget);
- widget->style = gtk_style_attach(widget->style, widget->window);
- gtk_style_set_background(widget->style, widget->window, GTK_STATE_NORMAL);
+#if GTK_CHECK_VERSION(2, 20, 0)
+ gtk_widget_style_attach(widget);
+#else
+ widget->style = gtk_style_attach(gtk_widget_get_style(widget), window);
+#endif
+ gtk_style_set_background(gtk_widget_get_style(widget), window, GTK_STATE_NORMAL);
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
WebKitWebViewPrivate* priv = webView->priv;
- gtk_im_context_set_client_window(priv->imContext, widget->window);
+ gtk_im_context_set_client_window(priv->imContext, window);
}
static void webkit_web_view_set_scroll_adjustments(WebKitWebView* webView, GtkAdjustment* hadj, GtkAdjustment* vadj)
@@ -970,7 +992,7 @@ static gboolean webkit_web_view_script_dialog(WebKitWebView* webView, WebKitWebF
if (type == WEBKIT_SCRIPT_DIALOG_PROMPT) {
entry = gtk_entry_new();
gtk_entry_set_text(GTK_ENTRY(entry), defaultValue);
- gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), entry);
+ gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), entry);
gtk_entry_set_activates_default(GTK_ENTRY(entry), TRUE);
gtk_widget_show(entry);
}
@@ -1184,6 +1206,8 @@ static void webkit_web_view_finalize(GObject* object)
g_free(priv->customEncoding);
g_free(priv->iconURI);
+ delete priv->previousClickPoint;
+
G_OBJECT_CLASS(webkit_web_view_parent_class)->finalize(object);
}
@@ -1312,7 +1336,7 @@ static void webkit_web_view_drag_end(GtkWidget* widget, GdkDragContext* context)
event->button.state = modifiers;
PlatformMouseEvent platformEvent(&event->button);
- frame->eventHandler()->dragSourceEndedAt(platformEvent, gdkDragActionToDragOperation(context->action));
+ frame->eventHandler()->dragSourceEndedAt(platformEvent, gdkDragActionToDragOperation(gdk_drag_context_get_selected_action(context)));
gdk_event_free(event);
}
@@ -2730,7 +2754,7 @@ static void webkit_web_view_update_settings(WebKitWebView* webView)
settings->setPrivateBrowsingEnabled(enablePrivateBrowsing);
settings->setCaretBrowsingEnabled(enableCaretBrowsing);
#if ENABLE(DATABASE)
- Database::setIsAvailable(enableHTML5Database);
+ AbstractDatabase::setIsAvailable(enableHTML5Database);
#endif
settings->setLocalStorageEnabled(enableHTML5LocalStorage);
settings->setXSSAuditorEnabled(enableXSSAuditor);
@@ -2823,7 +2847,7 @@ static void webkit_web_view_settings_notify(WebKitWebSettings* webSettings, GPar
settings->setCaretBrowsingEnabled(g_value_get_boolean(&value));
#if ENABLE(DATABASE)
else if (name == g_intern_string("enable-html5-database")) {
- Database::setIsAvailable(g_value_get_boolean(&value));
+ AbstractDatabase::setIsAvailable(g_value_get_boolean(&value));
}
#endif
else if (name == g_intern_string("enable-html5-local-storage"))
@@ -2882,7 +2906,7 @@ static void webkit_web_view_init(WebKitWebView* webView)
g_object_ref_sink(priv->horizontalAdjustment);
g_object_ref_sink(priv->verticalAdjustment);
- GTK_WIDGET_SET_FLAGS(webView, GTK_CAN_FOCUS);
+ gtk_widget_set_can_focus(GTK_WIDGET(webView), TRUE);
priv->mainFrame = WEBKIT_WEB_FRAME(webkit_web_frame_new(webView));
priv->lastPopupXPosition = priv->lastPopupYPosition = -1;
priv->editable = false;
@@ -2900,6 +2924,10 @@ static void webkit_web_view_init(WebKitWebView* webView)
priv->subResources = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_object_unref);
priv->tooltipText = 0;
+ priv->currentClickCount = 0;
+ priv->previousClickPoint = new IntPoint(0, 0);
+ priv->previousClickButton = 0;
+ priv->previousClickTime = 0;
}
GtkWidget* webkit_web_view_new(void)
@@ -4450,4 +4478,3 @@ WebKitCacheModel webkit_get_cache_model()
webkit_init();
return cacheModel;
}
-
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index c6151ad..ea2393a 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,779 @@
+2010-06-24 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Full-screened content doesn't keep the display on: Safari not grabbing a power assertion?
+ https://bugs.webkit.org/show_bug.cgi?id=40939
+ rdar://problem/7996172
+
+ Take a IOKit power assertion when playing video in fullscreen mode. Release the
+ assertion when paused in fullscreen mode, and when exiting fullscreen mode.
+
+ * WebView/WebVideoFullscreenController.h:
+ * WebView/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController windowDidExitFullscreen]): Call updatePowerAssertions.
+ (-[WebVideoFullscreenController windowDidEnterFullscreen]): Call updatePowerAssertions.
+ (-[WebVideoFullscreenController _disableIdleDisplaySleep]):
+ (-[WebVideoFullscreenController _enableIdleDisplaySleep]):
+ (-[WebVideoFullscreenController _disableIdleSystemSleep]):
+ (-[WebVideoFullscreenController _enableIdleSystemSleep]):
+ (-[WebVideoFullscreenController updatePowerAssertions]): Call _(enable|disable)Idle(System|Display)sleep depending on current playback rate and fullscreen status.
+ (-[WebVideoFullscreenController rateChanged:]): Call updatePowerAssertions.
+
+2010-06-24 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Playing movie full screen on second monitor hides menu bar and title bar on main monitor
+ https://bugs.webkit.org/show_bug.cgi?id=40933
+ rdar://problem/7858452
+
+ Remove all references to GetSystemUIMode and SetSystemUIMode. Replace these calls with
+ [NSApplication setPresentationOptions:]. Do not auto-hide the menu bar if the fullscreen
+ screen is does not contain the menu-bar. Do not auto-hide the dock if the fullscreen screen
+ is both not the menu-bar screen and not the dock screen.
+
+ * WebView/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController windowDidLoad]): Register the applicationDidChangeScreenParameters: listener.
+ (-[WebVideoFullscreenController windowDidExitFullscreen]): Calls updateMenuAndDockForFullscreen.
+ (-[WebVideoFullscreenController windowDidEnterFullscreen]): Calls updateMenuAndDockForFullscreen.
+ (-[WebVideoFullscreenController applicationDidChangeScreenParameters:]): New notification handler; catches NSApplicationDidChangeScreenParameters.
+ (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Hide/show the menu-bar and dock according to the fullscreen window's screen.
+
+2010-06-24 Jer Noble <jer.noble@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Full screen video in Safari exits full-screen if you switch to another app
+ https://bugs.webkit.org/show_bug.cgi?id=40635
+ rdar://problem/7885101
+
+ Implement the following rules for exiting full screen when switching apps:
+ 1. If the system has a single screen, switching apps will cause Safari to exit full-screen.
+ 2. Otherwise, if the full-screen screen is the "main screen" (the one with the title bar),
+ switching apps will cause Safari to exit full-screen.
+ 3. Overriding rules 1 & 2, if the full-screen screen is not on the "current space",
+ switching apps will NOT cause Safari to exit full-screen.
+
+ * WebView/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController windowDidLoad]):
+ (-[WebVideoFullscreenController applicationDidResignActive:]):
+
+2010-06-24 Adele Peterson <adele@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Updated fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events
+ https://bugs.webkit.org/show_bug.cgi?id=41085
+
+ * WebView/WebHTMLView.mm: Use the WebCore command system for the pasteAsPlainText selector.
+ Also remove internal methods that no one is using.
+
+2010-06-24 Damian Kaleta <dkaleta@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Added an ObjC wrapper to Node::renderRect(bool&).
+
+ * DOM/WebDOMOperations.mm:
+ (-[DOMNode _renderRect:]):
+ * DOM/WebDOMOperationsPrivate.h:
+
+2010-06-24 Adele Peterson <adele@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ Fix for <rdar://problem/8093680> "Paste and Match Style" should fire paste events
+ https://bugs.webkit.org/show_bug.cgi?id=41085
+
+ * WebView/WebHTMLView.mm: (-[WebHTMLView pasteAsPlainText:]): Reuse code in WebCore
+ which does everything done here and also fires paste events.
+
+2010-06-23 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Implement page format data programming interface.
+ Add methods for testing.
+ https://bugs.webkit.org/show_bug.cgi?id=37538
+
+ * Misc/WebCoreStatistics.h:
+ * Misc/WebCoreStatistics.mm:
+ (-[WebFrame isPageBoxVisible:]):
+ (-[WebFrame pageAreaRectInPixels:]):
+ (-[WebFrame preferredPageSizeInPixels:]):
+
+2010-06-22 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Get rid of more USE_LIBDISPATCH code.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.h:
+
+2010-06-22 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Get rid of the USE_LIBDISPATCH code.
+
+ * Plugins/Hosted/NetscapePluginHostProxy.mm:
+ (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+ (WebKit::NetscapePluginHostProxy::~NetscapePluginHostProxy):
+
+2010-06-22 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Wean NetscapePluginHostManager of any knowledge about WebNetscapePluginPackage
+ https://bugs.webkit.org/show_bug.cgi?id=41006
+
+ * Plugins/Hosted/NetscapePluginHostManager.h:
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::hostForPlugin):
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ (WebKit::NetscapePluginHostManager::instantiatePlugin):
+ (WebKit::NetscapePluginHostManager::createPropertyListFile):
+ * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+ (-[WebHostedNetscapePluginView createPlugin]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage createPropertyListFile]):
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Fix an off-by-one bug I introduced.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+
+2010-06-21 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ FrameLoader cleanup: Split high level subframe and plugin
+ loading functions into a separate class.
+ https://bugs.webkit.org/show_bug.cgi?id=40453
+
+ * WebView/WebFrame.mm:
+ (-[WebFrame _cacheabilityDictionary]):
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Another Tiger build fix.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _tryLoad]):
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ More WebBasePluginPackage cleanup
+ https://bugs.webkit.org/show_bug.cgi?id=40944
+
+ * Plugins/Hosted/HostedNetscapePluginStream.mm:
+ (WebKit::HostedNetscapePluginStream::pluginCancelledConnectionError):
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ * Plugins/WebBaseNetscapePluginStream.mm:
+ (WebNetscapePluginStream::pluginCancelledConnectionError):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (WebHaltablePlugin::pluginName):
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage initWithPath:]):
+ (-[WebBasePluginPackage _objectForInfoDictionaryKey:]):
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage load]):
+ (-[WebBasePluginPackage dealloc]):
+ (-[WebBasePluginPackage finalize]):
+ (-[WebBasePluginPackage pluginInfo]):
+ (-[WebBasePluginPackage supportsExtension:]):
+ (-[WebBasePluginPackage supportsMIMEType:WebCore::]):
+ (-[WebBasePluginPackage MIMETypeForExtension:]):
+ (-[WebBasePluginPackage isJavaPlugIn]):
+ (-[WebBasePluginPackage versionNumber]):
+ (-[WebBasePluginPackage WebCore::]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage openResourceFile]):
+ (-[WebNetscapePluginPackage closeResourceFile:]):
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+ (-[WebNetscapePluginPackage _initWithPath:]):
+ (-[WebNetscapePluginPackage _applyDjVuWorkaround]):
+ (-[WebNetscapePluginPackage _tryLoad]):
+ (-[WebNetscapePluginPackage supportsSnapshotting]):
+ (-[WebNetscapePluginPackage _unloadWithShutdown:]):
+ * Plugins/WebPluginDatabase.mm:
+ (-[WebPluginDatabase refresh]):
+ (-[WebPluginDatabase _removePlugin:]):
+ * Plugins/WebPluginPackage.mm:
+ (-[WebPluginPackage initWithPath:]):
+ (-[WebPluginPackage load]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::getPluginInfo):
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Another PowerPC build fix.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage openResourceFile]):
+ (-[WebNetscapePluginPackage _tryLoad]):
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Try to fix the PowerPC build.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _tryLoad]):
+
+2010-06-21 Nate Chapin <japhet@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Update relevant calls into FrameLoader to make use of
+ FrameLoaderStateMachine.
+ https://bugs.webkit.org/show_bug.cgi?id=39695
+
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::transitionToCommittedForNewPage):
+ * WebView/WebFrame.mm:
+ (-[WebFrame _firstLayoutDone]):
+
+2010-06-21 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Dan Bernstein.
+
+ Chromium/Mac build fix.
+
+ * WebCoreSupport/WebSystemInterface.mm: Change the order of wtf/Platform.h include to let other
+ headers smell it.
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Make all of WebKit build with clang++
+
+ * DefaultDelegates/WebDefaultPolicyDelegate.m:
+ (-[WebDefaultPolicyDelegate webView:decidePolicyForMIMEType:request:frame:decisionListener:]):
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView resolvedURLStringForURL:target:]):
+ * WebView/WebDynamicScrollBarsView.mm:
+ (-[WebDynamicScrollBarsView setSuppressLayout:]):
+ * WebView/WebHTMLRepresentation.mm:
+ * WebView/WebNavigationData.mm:
+ (-[WebNavigationData initWithURLString:title:originalRequest:response:hasSubstituteData:clientRedirectSource:]):
+ * WebView/WebPDFRepresentation.mm:
+ (-[WebPDFRepresentation setDataSource:]):
+ (-[WebPDFRepresentation receivedData:withDataSource:]):
+ (-[WebPDFRepresentation receivedError:withDataSource:]):
+ * WebView/WebResource.mm:
+ (-[WebResource description]):
+ * WebView/WebSerializedJSValue.mm:
+ (-[WebSerializedJSValue initWithValue:context:exception:]):
+ * WebView/WebVideoFullscreenController.mm:
+ (-[WebVideoFullscreenController WebCore::]):
+ (-[WebVideoFullscreenController setMediaElement:WebCore::]):
+ (-[WebVideoFullscreenController setDelegate:]):
+ (-[WebVideoFullscreenController enterFullscreen:]):
+ * WebView/WebView.mm:
+ (-[WebView _openFrameInNewWindowFromMenu:]):
+ (-[WebView _geolocationDidChangePosition:]):
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove unused dictionary ivars from WebBasePluginPackage
+ https://bugs.webkit.org/show_bug.cgi?id=40928
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage dealloc]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Build fix
+
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface):
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ WebKit part of implementing the 'hyphens' and 'hyphenate-character' properties
+ https://bugs.webkit.org/show_bug.cgi?id=10228
+
+ * WebCoreSupport/WebSystemInterface.mm:
+ (InitWebCoreSystemInterface): Initialize wkGetHyphenationLocationBeforeIndex.
+
+2010-06-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
+
+ * Configurations/FeatureDefines.xcconfig:
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Fix Tiger build.
+
+ * Plugins/WebNetscapePluginPackage.mm:
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Get rid of the old MIMETypes getter method
+ https://bugs.webkit.org/show_bug.cgi?id=40898
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage supportsExtension:]):
+ (-[WebBasePluginPackage supportsMIMEType:WebCore::]):
+ (-[WebBasePluginPackage MIMETypeForExtension:]):
+ * Plugins/WebPluginDatabase.mm:
+ (-[WebPluginDatabase refresh]):
+ (-[WebPluginDatabase _removePlugin:]):
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Remove bogus const qualifiers.
+
+ * WebCoreSupport/WebPasteboardHelper.h:
+ * WebCoreSupport/WebPasteboardHelper.mm:
+ (WebPasteboardHelper::urlFromPasteboard):
+ (WebPasteboardHelper::plainTextFromPasteboard):
+ (WebPasteboardHelper::fragmentFromPasteboard):
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Get rid of the extensionToMIME mapping in WebBasePluginPackage
+ https://bugs.webkit.org/show_bug.cgi?id=40897
+
+ Instead of using the extensionToMIME mutable dictionary, use the MIME types vector.
+ While this makes lookup of MIME types based on extensions linear instead of constant,
+ the number of extensions per plug-in is too small for it to matter.
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage initWithPath:]):
+ (-[WebBasePluginPackage dealloc]):
+ (-[WebBasePluginPackage supportsExtension:]):
+ (-[WebBasePluginPackage MIMETypeForExtension:]):
+ (-[WebBasePluginPackage setMIMEToExtensionsDictionary:]):
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add a MimeClassInfo Vector to WebBasePluginPackage
+ https://bugs.webkit.org/show_bug.cgi?id=40896
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage WebCore::]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::getPluginInfo):
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Move the NSBundle ivar to WebPluginPackage
+ https://bugs.webkit.org/show_bug.cgi?id=40894
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage initWithPath:]):
+ (-[WebBasePluginPackage _objectForInfoDictionaryKey:]):
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage load]):
+ (-[WebBasePluginPackage dealloc]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage _initWithPath:]):
+ * Plugins/WebPluginPackage.h:
+ * Plugins/WebPluginPackage.mm:
+ (-[WebPluginPackage initWithPath:]):
+ (-[WebPluginPackage dealloc]):
+ (-[WebPluginPackage viewFactory]):
+ (-[WebPluginPackage load]):
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Remove -[WebBasePluginPackage bundle]
+ https://bugs.webkit.org/show_bug.cgi?id=40892
+
+ Add -[WebBasePluginPackage bundleIdentifier] and switch clients over to it.
+
+ Move the supportsSnapshotting method over to the plug-in package.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::hostForPackage):
+ * Plugins/WebBaseNetscapePluginView.mm:
+ (-[WebBaseNetscapePluginView initWithFrame:pluginPackage:URL:baseURL:MIMEType:attributeKeys:attributeValues:loadManually:element:WebCore::]):
+ (-[WebBaseNetscapePluginView supportsSnapshotting]):
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage isQuickTimePlugIn]):
+ (-[WebBasePluginPackage isJavaPlugIn]):
+ (-[WebBasePluginPackage WebCore::]):
+ Call bundleIdentifier directly instead of asking the bundle
+ * Plugins/WebNetscapePluginPackage.h:
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage supportsSnapshotting]):
+ * Plugins/WebNetscapePluginView.mm:
+ (-[WebNetscapePluginView setAttributeKeys:andValues:]):
+ (-[WebNetscapePluginView _createPlugin]):
+ * Plugins/WebPluginDatabase.mm:
+ (checkCandidate):
+
+2010-06-20 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Change some WebPluginDabase ivars to use WebCore::String instead of NSString.
+ https://bugs.webkit.org/show_bug.cgi?id=40869
+
+ Re-land r61459, with extra null-checks in WebFrameLoaderClient.
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage initWithPath:]):
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage dealloc]):
+ (-[WebBasePluginPackage name]):
+ (-[WebBasePluginPackage path]):
+ (-[WebBasePluginPackage filename]):
+ (-[WebBasePluginPackage pluginDescription]):
+ (-[WebBasePluginPackage description]):
+ (-[WebBasePluginPackage isJavaPlugIn]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+ (-[WebNetscapePluginPackage _tryLoad]):
+ (-[WebNetscapePluginPackage _unloadWithShutdown:]):
+ * Plugins/WebPluginPackage.mm:
+ (-[WebPluginPackage load]):
+ * WebCoreSupport/WebFrameLoaderClient.mm:
+ (WebFrameLoaderClient::createPlugin):
+
+2010-06-18 Adam Barth <abarth@webkit.org>
+
+ Unreviewed, rolling out r61459.
+ http://trac.webkit.org/changeset/61459
+ https://bugs.webkit.org/show_bug.cgi?id=40869
+
+ Seems to have broken two tests on the Tiger buildbot:
+
+ dom/html/level2/html/AppletsCollection.html
+ plugins/qt-qwidget-plugin.html
+
+ Anders wasn't on #webkit...
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage initWithPath:]):
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage dealloc]):
+ (-[WebBasePluginPackage name]):
+ (-[WebBasePluginPackage path]):
+ (-[WebBasePluginPackage filename]):
+ (-[WebBasePluginPackage pluginDescription]):
+ (-[WebBasePluginPackage setName:]):
+ (-[WebBasePluginPackage setPath:]):
+ (-[WebBasePluginPackage setPluginDescription:]):
+ (-[WebBasePluginPackage description]):
+ (-[WebBasePluginPackage isJavaPlugIn]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+ (-[WebNetscapePluginPackage _tryLoad]):
+ (-[WebNetscapePluginPackage _unloadWithShutdown:]):
+ * Plugins/WebPluginPackage.mm:
+ (-[WebPluginPackage load]):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Fix Tiger build.
+
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage isJavaPlugIn]):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Change some WebPluginDabase ivars to use WebCore::String instead of NSString.
+ https://bugs.webkit.org/show_bug.cgi?id=40869
+
+ * Plugins/Hosted/NetscapePluginHostManager.mm:
+ (WebKit::NetscapePluginHostManager::spawnPluginHost):
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage initWithPath:]):
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+ (-[WebBasePluginPackage dealloc]):
+ (-[WebBasePluginPackage name]):
+ (-[WebBasePluginPackage path]):
+ (-[WebBasePluginPackage filename]):
+ (-[WebBasePluginPackage pluginDescription]):
+ (-[WebBasePluginPackage description]):
+ (-[WebBasePluginPackage isJavaPlugIn]):
+ * Plugins/WebNetscapePluginPackage.mm:
+ (-[WebNetscapePluginPackage getPluginInfoFromResources]):
+ (-[WebNetscapePluginPackage _tryLoad]):
+ (-[WebNetscapePluginPackage _unloadWithShutdown:]):
+ * Plugins/WebPluginPackage.mm:
+ (-[WebPluginPackage load]):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Rename WebPluginPackage.m to make it an Objective-C++ file.
+
+ * Plugins/WebPluginPackage.m: Removed.
+ * Plugins/WebPluginPackage.mm: Copied from Plugins/WebPluginPackage.m.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Get rid of the NSEnumerators from WebBasePluginPackage
+ https://bugs.webkit.org/show_bug.cgi?id=40868
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage MIMETypes]):
+ (-[WebBasePluginPackage supportsExtension:]):
+ (-[WebBasePluginPackage supportsMIMEType:]):
+ * Plugins/WebPluginDatabase.mm:
+ (-[WebPluginDatabase pluginForMIMEType:]):
+ (-[WebPluginDatabase pluginForExtension:]):
+ (-[WebPluginDatabase refresh]):
+ (-[WebPluginDatabase _removePlugin:]):
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::getPluginInfo):
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Make WebCoreSystemInterface.h a C++ only header
+ https://bugs.webkit.org/show_bug.cgi?id=40867
+
+ * WebCoreSupport/WebSystemInterface.h:
+ * WebCoreSupport/WebSystemInterface.m: Removed.
+ * WebCoreSupport/WebSystemInterface.mm: Copied from WebKit/mac/WebCoreSupport/WebSystemInterface.m.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Clean up WebPluginDatabase.mm
+ https://bugs.webkit.org/show_bug.cgi?id=40866
+
+ * Plugins/WebBasePluginPackage.h:
+ * Plugins/WebBasePluginPackage.mm:
+ (pathByResolvingSymlinksAndAliases):
+ (-[WebBasePluginPackage initWithPath:]):
+ Change an instance method into a static function.
+
+ * Plugins/WebPluginDatabase.mm:
+ (PluginPackageCandidates::PluginPackageCandidates):
+ (PluginPackageCandidates::update):
+ (PluginPackageCandidates::bestCandidate):
+ Add a new PluginPackageCandidates class.
+
+ (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]):
+ Use PluginPackageCandidates here.
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Fix Tiger build.
+
+ * WebCoreSupport/WebPlatformStrategies.mm:
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Darin Adler.
+
+ Get rid of PluginDataMac.mm and use the plug-in strategy instead
+ https://bugs.webkit.org/show_bug.cgi?id=40860
+
+ * Plugins/WebBasePluginPackage.h:
+ * WebCoreSupport/WebPlatformStrategies.h:
+ * WebCoreSupport/WebPlatformStrategies.mm:
+ (WebPlatformStrategies::createPluginStrategy):
+ (WebPlatformStrategies::refreshPlugins):
+ (WebPlatformStrategies::getPluginInfo):
+ * WebCoreSupport/WebViewFactory.mm:
+
+2010-06-18 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add stubbed out WebPlatformStrategies class to WebKit.
+ https://bugs.webkit.org/show_bug.cgi?id=40851
+
+ * WebCoreSupport/WebPlatformStrategies.h: Added.
+ * WebCoreSupport/WebPlatformStrategies.mm: Added.
+ (WebPlatformStrategies::initialize):
+ (WebPlatformStrategies::WebPlatformStrategies):
+ (WebPlatformStrategies::createPluginStrategy):
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:usesDocumentViews:]):
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * WebView/WebView.mm:
+ (-[WebView _preferencesChangedNotification:]):
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Use adoptRef and create functions in more code paths
+ https://bugs.webkit.org/show_bug.cgi?id=40760
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.h: Made create no longer
+ be an inline function.
+
+ * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
+ (WebKit::NetscapePluginInstanceProxy::NetscapePluginInstanceProxy):
+ Moved the call to addPluginInstance out of here.
+ (WebKit::NetscapePluginInstanceProxy::create): Move it in here.
+ This makes sure we call adoptRef on the new proxy before any caller
+ calls ref on it.
+
+2010-06-16 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Enable HTML5 Parser in Safari on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=40739
+
+ The HTML5 parser is probably off on all webkit ports.
+ We should either flip the meaning of the default so that
+ "false" means HTML5 on all ports, or we'll have to write
+ more code like this for all the other ports.
+
+ * WebView/WebPreferences.mm:
+ (+[WebPreferences initialize]):
+
+2010-06-15 Mark Rowe <mrowe@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Don't leak WebGeolocationPositionInternal and GeolocationPosition instances for every WebGeolocationPosition created.
+
+ * WebView/WebGeolocationPosition.mm:
+ (-[WebGeolocationPosition dealloc]): Implement -dealloc and release our WebGeolocationPositionInternal instance.
+
+2010-06-10 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Implement render style selection for pages to support CSS3 Paged Media.
+ https://bugs.webkit.org/show_bug.cgi?id=35961
+
+ * Misc/WebCoreStatistics.h:
+ * Misc/WebCoreStatistics.mm:
+ (-[WebFrame pageProperty:propertyName:]):
+
+2010-06-15 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions out of Frame class that were marked "move to Chrome"
+ https://bugs.webkit.org/show_bug.cgi?id=39636
+
+ * WebView/WebView.mm:
+ (-[WebView shouldClose]): Call shouldClose on FrameLoader instead of
+ going through Frame.
+
+2010-06-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Remove getPluginInfoFromBundleAndMIMEDictionary:
+
+ * Plugins/WebBasePluginPackage.mm:
+
+2010-06-15 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Fold getPluginInfoFromBundleAndMIMEDictionary: into its sole caller.
+
+ * Plugins/WebBasePluginPackage.mm:
+ (-[WebBasePluginPackage getPluginInfoFromPLists]):
+
+2010-06-11 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/8084721> Pages using accelerated compositing fail to update correctly in Carbon apps
+
+ The run loop observer used to commit compositing layer changes does not do
+ updates if [window viewsNeedDisplay] is true, because this indicates that a delayed window
+ update is pending (added in r58623).
+
+ However, Carbon apps don't use the NSWindow updating mechanism, so [window viewsNeedDisplay] always returns YES.
+ This caused us to never sync compositing layers.
+
+ So detect if the current window is wrapping a carbon window, and in that case consult the root
+ HIView to detect if display is pending.
+
+ * WebView/WebView.mm:
+ (layerSyncRunLoopObserverCallBack):
+
+2010-06-15 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by John Sullivan.
+
+ <rdar://problem/8077032> REGRESSION (r50796): Black background on AppleScript generated email
+
+ Test: platform/mac/editing/input/NSBackgroundColor-transparent.html
+
+ r50796 changed the initial background color from invalid to transparent. As a result,
+ NSAttributedStrings returned from +_web_attributedStringFromRange started including the
+ NSBackgroundColor attribute, with a transparent color as the value. This caused problems for
+ components in the system that ignore the alpha component, turning the color into opaque black.
+
+ * Misc/WebNSAttributedStringExtras.mm:
+ (+[NSAttributedString _web_attributedStringFromRange:]): Change to not include the background
+ and foreground color attributes if the color are transparent.
+
2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/mac/Configurations/FeatureDefines.xcconfig b/WebKit/mac/Configurations/FeatureDefines.xcconfig
index 5b52793..08d9ef9 100644
--- a/WebKit/mac/Configurations/FeatureDefines.xcconfig
+++ b/WebKit/mac/Configurations/FeatureDefines.xcconfig
@@ -57,6 +57,7 @@ ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
ENABLE_IMAGE_RESIZER = ;
ENABLE_INDEXED_DATABASE = ;
+ENABLE_INPUT_SPEECH = ;
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
ENABLE_MATHML = ;
ENABLE_METER_TAG = ENABLE_METER_TAG;
@@ -81,4 +82,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_BLOB_SLICE) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_FILE_READER) $(ENABLE_FILE_WRITER) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_IMAGE_RESIZER) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_METER_TAG) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_PROGRESS_TAG) $(ENABLE_RUBY) $(ENABLE_SANDBOX) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebKit/mac/Configurations/Version.xcconfig b/WebKit/mac/Configurations/Version.xcconfig
index 6f999af..f775a54 100644
--- a/WebKit/mac/Configurations/Version.xcconfig
+++ b/WebKit/mac/Configurations/Version.xcconfig
@@ -22,7 +22,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MAJOR_VERSION = 534;
-MINOR_VERSION = 1;
+MINOR_VERSION = 2;
TINY_VERSION = 0;
FULL_VERSION = $(MAJOR_VERSION).$(MINOR_VERSION);
diff --git a/WebKit/mac/DOM/WebDOMOperations.mm b/WebKit/mac/DOM/WebDOMOperations.mm
index 2bda67a..194a000 100644
--- a/WebKit/mac/DOM/WebDOMOperations.mm
+++ b/WebKit/mac/DOM/WebDOMOperations.mm
@@ -53,11 +53,20 @@ using namespace WebCore;
return [[[WebArchive alloc] _initWithCoreLegacyWebArchive:LegacyWebArchive::create(core(self))] autorelease];
}
+@end
+
+@implementation DOMNode (WebDOMNodeOperationsPendingPublic)
+
- (NSString *)markupString
{
return createFullMarkup(core(self));
}
+- (NSRect)_renderRect:(bool *)isReplaced
+{
+ return NSRect(core(self)->renderRect(isReplaced));
+}
+
@end
/* This doesn't appear to be used by anyone. We should consider removing this. */
diff --git a/WebKit/mac/DOM/WebDOMOperationsPrivate.h b/WebKit/mac/DOM/WebDOMOperationsPrivate.h
index 013a687..826aa7d 100644
--- a/WebKit/mac/DOM/WebDOMOperationsPrivate.h
+++ b/WebKit/mac/DOM/WebDOMOperationsPrivate.h
@@ -34,4 +34,5 @@
@interface DOMNode (WebDOMNodeOperationsPendingPublic)
- (NSString *)markupString;
+- (NSRect)_renderRect:(bool *)isReplaced;
@end
diff --git a/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m b/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
index 6de2792..bad87d5 100644
--- a/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
+++ b/WebKit/mac/DefaultDelegates/WebDefaultPolicyDelegate.m
@@ -60,7 +60,7 @@ static WebDefaultPolicyDelegate *sharedDelegate = nil;
- (void)webView: (WebView *)wv decidePolicyForMIMEType:(NSString *)type
request:(NSURLRequest *)request
frame:(WebFrame *)frame
- decisionListener:(id <WebPolicyDecisionListener>)listener;
+ decisionListener:(id <WebPolicyDecisionListener>)listener
{
if ([[request URL] isFileURL]) {
BOOL isDirectory = NO;
diff --git a/WebKit/mac/Misc/WebCoreStatistics.h b/WebKit/mac/Misc/WebCoreStatistics.h
index a11c064..e357b72 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.h
+++ b/WebKit/mac/Misc/WebCoreStatistics.h
@@ -87,4 +87,8 @@
- (NSString *)counterValueForElement:(DOMElement*)element;
- (int)pageNumberForElement:(DOMElement*)element:(float)pageWidthInPixels:(float)pageHeightInPixels;
- (int)numberOfPages:(float)pageWidthInPixels:(float)pageHeightInPixels;
+- (NSString *)pageProperty:(const char*)propertyName:(int)pageNumber;
+- (bool)isPageBoxVisible:(int)pageNumber;
+- (NSString *)pageAreaRectInPixels:(int)pageNumber;
+- (NSString *)preferredPageSizeInPixels:(int)pageNumber;
@end
diff --git a/WebKit/mac/Misc/WebCoreStatistics.mm b/WebKit/mac/Misc/WebCoreStatistics.mm
index c3fc23e..9112d21 100644
--- a/WebKit/mac/Misc/WebCoreStatistics.mm
+++ b/WebKit/mac/Misc/WebCoreStatistics.mm
@@ -275,4 +275,23 @@ using namespace WebCore;
return PrintContext::numberOfPages(_private->coreFrame, FloatSize(pageWidthInPixels, pageHeightInPixels));
}
+- (NSString *)pageProperty:(const char *)propertyName:(int)pageNumber
+{
+ return PrintContext::pageProperty(_private->coreFrame, propertyName, pageNumber);
+}
+
+- (bool)isPageBoxVisible:(int)pageNumber
+{
+ return PrintContext::isPageBoxVisible(_private->coreFrame, pageNumber);
+}
+
+- (NSString *)pageAreaRectInPixels:(int)pageNumber
+{
+ return PrintContext::pageAreaRectInPixels(_private->coreFrame, pageNumber);
+}
+
+- (NSString *)preferredPageSizeInPixels:(int)pageNumber;
+{
+ return PrintContext::preferredPageSizeInPixels(_private->coreFrame, pageNumber);
+}
@end
diff --git a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm
index 35b2524..2469da8 100644
--- a/WebKit/mac/Misc/WebNSAttributedStringExtras.mm
+++ b/WebKit/mac/Misc/WebNSAttributedStringExtras.mm
@@ -154,11 +154,11 @@ static NSFileWrapper *fileWrapperForElement(Element* e)
RenderStyle* style = renderer->style();
NSFont *font = style->font().primaryFont()->getNSFont();
[attrs.get() setObject:font forKey:NSFontAttributeName];
- if (style->visitedDependentColor(CSSPropertyColor).isValid())
+ if (style->visitedDependentColor(CSSPropertyColor).alpha())
[attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyColor)) forKey:NSForegroundColorAttributeName];
else
[attrs.get() removeObjectForKey:NSForegroundColorAttributeName];
- if (style->visitedDependentColor(CSSPropertyBackgroundColor).isValid())
+ if (style->visitedDependentColor(CSSPropertyBackgroundColor).alpha())
[attrs.get() setObject:nsColor(style->visitedDependentColor(CSSPropertyBackgroundColor)) forKey:NSBackgroundColorAttributeName];
else
[attrs.get() removeObjectForKey:NSBackgroundColorAttributeName];
diff --git a/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm b/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
index 98b5a7e..25e5462 100644
--- a/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
@@ -256,7 +256,7 @@ NSError *HostedNetscapePluginStream::pluginCancelledConnectionError() const
return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection
contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get()
pluginPageURL:nil
- pluginName:[[m_instance->pluginView() pluginPackage] name]
+ pluginName:[[m_instance->pluginView() pluginPackage] pluginInfo].name
MIMEType:m_mimeType.get()] autorelease];
}
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
index e62d87a..e1f02ac 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.h
@@ -28,11 +28,12 @@
#ifndef NetscapePluginHostManager_h
#define NetscapePluginHostManager_h
+#import <WebCore/PlatformString.h>
+#import <WebCore/StringHash.h>
#import <wtf/HashMap.h>
#import <wtf/PassRefPtr.h>
@class WebHostedNetscapePluginView;
-@class WebNetscapePluginPackage;
namespace WebKit {
@@ -43,28 +44,28 @@ class NetscapePluginHostManager {
public:
static NetscapePluginHostManager& shared();
- PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(WebNetscapePluginPackage *, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled);
+ PassRefPtr<NetscapePluginInstanceProxy> instantiatePlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, WebHostedNetscapePluginView *, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled);
void pluginHostDied(NetscapePluginHostProxy*);
- static void createPropertyListFile(WebNetscapePluginPackage *);
+ static void createPropertyListFile(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture);
void didCreateWindow();
private:
- NetscapePluginHostProxy* hostForPackage(WebNetscapePluginPackage *, bool useProxiedOpenPanel);
+ NetscapePluginHostProxy* hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const WebCore::String& bundleIdentifier, bool useProxiedOpenPanel);
NetscapePluginHostManager();
~NetscapePluginHostManager();
- bool spawnPluginHost(WebNetscapePluginPackage *, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel);
+ bool spawnPluginHost(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel);
bool initializeVendorPort();
mach_port_t m_pluginVendorPort;
// FIXME: This should really be a HashMap of RetainPtrs, but that doesn't work right now.
- typedef HashMap<WebNetscapePluginPackage*, NetscapePluginHostProxy*> PluginHostMap;
+ typedef HashMap<WebCore::String, NetscapePluginHostProxy*> PluginHostMap;
PluginHostMap m_pluginHosts;
};
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
index e4177f5..baec6ba 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
@@ -48,6 +48,7 @@ extern "C" {
}
using namespace std;
+using namespace WebCore;
namespace WebKit {
@@ -58,7 +59,7 @@ NetscapePluginHostManager& NetscapePluginHostManager::shared()
return pluginHostManager;
}
-static const NSString *pluginHostAppName = @"WebKitPluginHost.app";
+static NSString * const pluginHostAppName = @"WebKitPluginHost.app";
NetscapePluginHostManager::NetscapePluginHostManager()
: m_pluginVendorPort(MACH_PORT_NULL)
@@ -69,9 +70,9 @@ NetscapePluginHostManager::~NetscapePluginHostManager()
{
}
-NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePluginPackage *package, bool useProxiedOpenPanel)
+NetscapePluginHostProxy* NetscapePluginHostManager::hostForPlugin(const WebCore::String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, bool useProxiedOpenPanel)
{
- pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(package, 0);
+ pair<PluginHostMap::iterator, bool> result = m_pluginHosts.add(pluginPath, 0);
// The package was already in the map, just return it.
if (!result.second)
@@ -85,7 +86,7 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePl
mach_port_t pluginHostPort;
ProcessSerialNumber pluginHostPSN;
- if (!spawnPluginHost(package, clientPort, pluginHostPort, pluginHostPSN, useProxiedOpenPanel)) {
+ if (!spawnPluginHost(pluginPath, pluginArchitecture, clientPort, pluginHostPort, pluginHostPSN, useProxiedOpenPanel)) {
mach_port_destroy(mach_task_self(), clientPort);
m_pluginHosts.remove(result.first);
return 0;
@@ -93,17 +94,16 @@ NetscapePluginHostProxy* NetscapePluginHostManager::hostForPackage(WebNetscapePl
// Since Flash NPObjects add methods dynamically, we don't want to cache when a property/method doesn't exist
// on an object because it could be added later.
- bool shouldCacheMissingPropertiesAndMethods = ![[[package bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"];
+ bool shouldCacheMissingPropertiesAndMethods = bundleIdentifier != "com.macromedia.Flash Player.plugin";
NetscapePluginHostProxy* hostProxy = new NetscapePluginHostProxy(clientPort, pluginHostPort, pluginHostPSN, shouldCacheMissingPropertiesAndMethods);
- CFRetain(package);
result.first->second = hostProxy;
return hostProxy;
}
-bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *package, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel)
+bool NetscapePluginHostManager::spawnPluginHost(const String& pluginPath, cpu_type_t pluginArchitecture, mach_port_t clientPort, mach_port_t& pluginHostPort, ProcessSerialNumber& pluginHostPSN, bool useProxiedOpenPanel)
{
if (m_pluginVendorPort == MACH_PORT_NULL) {
if (!initializeVendorPort())
@@ -121,7 +121,7 @@ bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *packag
NSDictionary *launchProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
pluginHostAppExecutablePath, @"pluginHostPath",
- [NSNumber numberWithInt:[package pluginHostArchitecture]], @"cpuType",
+ [NSNumber numberWithInt:pluginArchitecture], @"cpuType",
localization.get(), @"localization",
[NSNumber numberWithBool:useProxiedOpenPanel], @"useProxiedOpenPanel",
nil];
@@ -152,11 +152,11 @@ bool NetscapePluginHostManager::spawnPluginHost(WebNetscapePluginPackage *packag
NSString *visibleName = [NSString stringWithFormat:UI_STRING("%@ (%@ Internet plug-in)",
"visible name of the plug-in host process. The first argument is the plug-in name "
"and the second argument is the application name."),
- [[package filename] stringByDeletingPathExtension], [[NSProcessInfo processInfo] processName]];
+ [[(NSString*)pluginPath lastPathComponent] stringByDeletingPathExtension], [[NSProcessInfo processInfo] processName]];
NSDictionary *hostProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
visibleName, @"visibleName",
- [package path], @"bundlePath",
+ (NSString *)pluginPath, @"bundlePath",
nil];
data = [NSPropertyListSerialization dataFromPropertyList:hostProperties format:NSPropertyListBinaryFormat_v1_0 errorDescription:nil];
@@ -215,10 +215,10 @@ void NetscapePluginHostManager::pluginHostDied(NetscapePluginHostProxy* pluginHo
}
}
-PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(WebNetscapePluginPackage *pluginPackage, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled)
+PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePlugin(const String& pluginPath, cpu_type_t pluginArchitecture, const String& bundleIdentifier, WebHostedNetscapePluginView *pluginView, NSString *mimeType, NSArray *attributeKeys, NSArray *attributeValues, NSString *userAgent, NSURL *sourceURL, bool fullFrame, bool isPrivateBrowsingEnabled, bool isAcceleratedCompositingEnabled)
{
WebPreferences *preferences = [[pluginView webView] preferences];
- NetscapePluginHostProxy* hostProxy = hostForPackage(pluginPackage, [preferences usesProxiedOpenPanel]);
+ NetscapePluginHostProxy* hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier, [preferences usesProxiedOpenPanel]);
if (!hostProxy)
return 0;
@@ -257,7 +257,7 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl
pluginHostDied(hostProxy);
// Try to spawn it again.
- hostProxy = hostForPackage(pluginPackage, [preferences usesProxiedOpenPanel]);
+ hostProxy = hostForPlugin(pluginPath, pluginArchitecture, bundleIdentifier, [preferences usesProxiedOpenPanel]);
// Create a new instance.
instance = NetscapePluginInstanceProxy::create(hostProxy, pluginView, fullFrame);
@@ -277,11 +277,11 @@ PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginHostManager::instantiatePl
return instance.release();
}
-void NetscapePluginHostManager::createPropertyListFile(WebNetscapePluginPackage *package)
+void NetscapePluginHostManager::createPropertyListFile(const String& pluginPath, cpu_type_t pluginArchitecture)
{
NSString *pluginHostAppPath = [[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] pathForAuxiliaryExecutable:pluginHostAppName];
NSString *pluginHostAppExecutablePath = [[NSBundle bundleWithPath:pluginHostAppPath] executablePath];
- NSString *bundlePath = [package path];
+ NSString *bundlePath = pluginPath;
pid_t pid;
posix_spawnattr_t attr;
@@ -289,7 +289,7 @@ void NetscapePluginHostManager::createPropertyListFile(WebNetscapePluginPackage
// Set the architecture.
size_t ocount = 0;
- int cpuTypes[1] = { [package pluginHostArchitecture] };
+ int cpuTypes[] = { pluginArchitecture };
posix_spawnattr_setbinpref_np(&attr, 1, cpuTypes, &ocount);
// Spawn the plug-in host and tell it to call the registration function.
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
index d35503f..20db5d2 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.h
@@ -84,11 +84,7 @@ private:
mach_port_t m_clientPort;
mach_port_t m_portSet;
-#ifdef USE_LIBDISPATCH
- dispatch_source_t m_clientPortSource;
-#else
RetainPtr<CFRunLoopSourceRef> m_clientPortSource;
-#endif
mach_port_t m_pluginHostPort;
RetainPtr<CFMachPortRef> m_deadNameNotificationPort;
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
index 1d4cdad..8e1c2df 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
@@ -116,15 +116,9 @@ NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_po
CFRunLoopAddSource(CFRunLoopGetCurrent(), deathPortSource.get(), kCFRunLoopDefaultMode);
-#ifdef USE_LIBDISPATCH
- // FIXME: Unfortunately we can't use a dispatch source here until <rdar://problem/6393180> has been resolved.
- m_clientPortSource = dispatch_source_mig_create(m_clientPort, WKWebKitPluginClient_subsystem.maxsize, 0,
- dispatch_get_main_queue(), WebKitPluginClient_server);
-#else
m_clientPortSource.adoptCF(WKCreateMIGServerSource((mig_subsystem_t)&WKWebKitPluginClient_subsystem, m_clientPort));
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), kCFRunLoopDefaultMode);
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSEventTrackingRunLoopMode);
-#endif
}
NetscapePluginHostProxy::~NetscapePluginHostProxy()
@@ -139,12 +133,8 @@ NetscapePluginHostProxy::~NetscapePluginHostProxy()
}
ASSERT(m_clientPortSource);
-#ifdef USE_LIBDISPATCH
- dispatch_release(m_clientPortSource);
-#else
CFRunLoopSourceInvalidate(m_clientPortSource.get());
m_clientPortSource = 0;
-#endif
}
void NetscapePluginHostProxy::pluginHostDied()
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
index 7391c1e..5900b02 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.h
@@ -61,10 +61,7 @@ class ProxyInstance;
class NetscapePluginInstanceProxy : public RefCounted<NetscapePluginInstanceProxy> {
public:
- static PassRefPtr<NetscapePluginInstanceProxy> create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin)
- {
- return adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin));
- }
+ static PassRefPtr<NetscapePluginInstanceProxy> create(NetscapePluginHostProxy*, WebHostedNetscapePluginView *, bool fullFramePlugin);
~NetscapePluginInstanceProxy();
uint32_t pluginID() const
diff --git a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
index 9c90dae..ca012ee 100644
--- a/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
+++ b/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
@@ -237,14 +237,19 @@ NetscapePluginInstanceProxy::NetscapePluginInstanceProxy(NetscapePluginHostProxy
do {
m_pluginID = ++pluginIDCounter;
} while (pluginHostProxy->pluginInstance(m_pluginID) || !m_pluginID);
-
- pluginHostProxy->addPluginInstance(this);
#ifndef NDEBUG
netscapePluginInstanceProxyCounter.increment();
#endif
}
+PassRefPtr<NetscapePluginInstanceProxy> NetscapePluginInstanceProxy::create(NetscapePluginHostProxy* pluginHostProxy, WebHostedNetscapePluginView *pluginView, bool fullFramePlugin)
+{
+ RefPtr<NetscapePluginInstanceProxy> proxy = adoptRef(new NetscapePluginInstanceProxy(pluginHostProxy, pluginView, fullFramePlugin));
+ pluginHostProxy->addPluginInstance(proxy.get());
+ return proxy.release();
+}
+
NetscapePluginInstanceProxy::~NetscapePluginInstanceProxy()
{
ASSERT(!m_pluginHostProxy);
diff --git a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
index 6917e5f..e743722 100644
--- a/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
@@ -111,7 +111,7 @@ extern "C" {
accleratedCompositingEnabled = [[[self webView] preferences] acceleratedCompositingEnabled];
#endif
- _proxy = NetscapePluginHostManager::shared().instantiatePlugin(_pluginPackage.get(), self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(),
+ _proxy = NetscapePluginHostManager::shared().instantiatePlugin([_pluginPackage.get() path], [_pluginPackage.get() pluginHostArchitecture], [_pluginPackage.get() bundleIdentifier], self, _MIMEType.get(), _attributeKeys.get(), _attributeValues.get(), userAgent, _sourceURL.get(),
_mode == NP_FULL, _isPrivateBrowsingEnabled, accleratedCompositingEnabled);
if (!_proxy)
return NO;
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
index 7322d31..07d1d4f 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginStream.mm
@@ -104,7 +104,7 @@ NSError *WebNetscapePluginStream::pluginCancelledConnectionError() const
return [[[NSError alloc] _initWithPluginErrorCode:WebKitErrorPlugInCancelledConnection
contentURL:m_responseURL ? m_responseURL.get() : m_requestURL.get()
pluginPageURL:nil
- pluginName:[[m_pluginView.get() pluginPackage] name]
+ pluginName:[[m_pluginView.get() pluginPackage] pluginInfo].name
MIMEType:m_mimeType.get()] autorelease];
}
diff --git a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
index a75251e..bcef2a1 100644
--- a/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm
@@ -108,7 +108,7 @@ bool WebHaltablePlugin::isWindowed() const
String WebHaltablePlugin::pluginName() const
{
- return [[m_view pluginPackage] name];
+ return [[m_view pluginPackage] pluginInfo].name;
}
@implementation WebBaseNetscapePluginView
@@ -146,7 +146,7 @@ String WebHaltablePlugin::pluginName() const
#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
// Enable "kiosk mode" when instantiating the QT plug-in inside of Dashboard. See <rdar://problem/6878105>
if ([[[NSBundle mainBundle] bundleIdentifier] isEqualToString:@"com.apple.dashboard.client"] &&
- [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.apple.QuickTime Plugin.plugin"]) {
+ [_pluginPackage.get() bundleIdentifier] == "com.apple.QuickTime Plugin.plugin") {
RetainPtr<NSMutableArray> mutableKeys(AdoptNS, [keys mutableCopy]);
RetainPtr<NSMutableArray> mutableValues(AdoptNS, [values mutableCopy]);
@@ -578,20 +578,7 @@ String WebHaltablePlugin::pluginName() const
- (BOOL)supportsSnapshotting
{
- NSBundle *pluginBundle = [_pluginPackage.get() bundle];
- if (![[pluginBundle bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"])
- return YES;
-
- // Flash has a bogus Info.plist entry for CFBundleVersionString, so use CFBundleShortVersionString.
- NSString *versionString = [pluginBundle objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
-
- static const NSString *flash10dotOnePrefix = @"10.1";
- if (![versionString hasPrefix:flash10dotOnePrefix])
- return YES;
-
- // Some prerelease versions of Flash 10.1 crash when sent a drawRect event using the CA drawing model: <rdar://problem/7739922>
- static const CFStringRef knownGoodFlash10dot1Release = CFSTR("10.1.53.60");
- return CFStringCompare((CFStringRef)versionString, knownGoodFlash10dot1Release, kCFCompareNumerically) != kCFCompareLessThan;
+ return [_pluginPackage.get() supportsSnapshotting];
}
- (BOOL)hasBeenHalted
@@ -930,7 +917,7 @@ String WebHaltablePlugin::pluginName() const
}
-- (CString)resolvedURLStringForURL:(const char*)url target:(const char*)target;
+- (CString)resolvedURLStringForURL:(const char*)url target:(const char*)target
{
String relativeURLString = String::fromUTF8(url);
if (relativeURLString.isNull())
diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.h b/WebKit/mac/Plugins/WebBasePluginPackage.h
index 1082551..ca2ddcd 100644
--- a/WebKit/mac/Plugins/WebBasePluginPackage.h
+++ b/WebKit/mac/Plugins/WebBasePluginPackage.h
@@ -26,7 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import <WebCore/WebCoreViewFactory.h>
+#import <WebCore/PluginData.h>
+#import <wtf/RetainPtr.h>
#if ENABLE(NETSCAPE_PLUGIN_API)
#import <WebKit/npfunctions.h>
@@ -52,21 +53,15 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
#define WebPluginTypeDescriptionKey @"WebPluginTypeDescription"
#define WebPluginTypeEnabledKey @"WebPluginTypeEnabled"
-@interface WebBasePluginPackage : NSObject <WebCorePluginInfo>
+@interface WebBasePluginPackage : NSObject
{
NSMutableSet *pluginDatabases;
- NSString *name;
- NSString *path;
- NSString *pluginDescription;
+ WebCore::String path;
+ WebCore::PluginInfo pluginInfo;
- NSBundle *bundle;
- CFBundleRef cfBundle;
+ RetainPtr<CFBundleRef> cfBundle;
- NSDictionary *MIMEToDescription;
- NSDictionary *MIMEToExtensions;
- NSMutableDictionary *extensionToMIME;
-
BP_CreatePluginMIMETypesPreferencesFuncPtr BP_CreatePluginMIMETypesPreferences;
}
@@ -78,23 +73,16 @@ typedef void (*BP_CreatePluginMIMETypesPreferencesFuncPtr)(void);
- (BOOL)load;
- (void)unload;
-- (NSString *)name;
-- (NSString *)path;
-- (NSString *)filename;
-- (NSString *)pluginDescription;
-- (NSBundle *)bundle;
-
-- (NSEnumerator *)extensionEnumerator;
-- (NSEnumerator *)MIMETypeEnumerator;
-- (NSString *)descriptionForMIMEType:(NSString *)MIMEType;
-- (NSString *)MIMETypeForExtension:(NSString *)extension;
-- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType;
-
-- (void)setName:(NSString *)theName;
-- (void)setPath:(NSString *)thePath;
-- (void)setPluginDescription:(NSString *)description;
-- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary;
-- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary;
+- (const WebCore::String&)path;
+
+- (const WebCore::PluginInfo&)pluginInfo;
+
+- (WebCore::String)bundleIdentifier;
+
+- (BOOL)supportsExtension:(const WebCore::String&)extension;
+- (BOOL)supportsMIMEType:(const WebCore::String&)MIMEType;
+
+- (NSString *)MIMETypeForExtension:(const WebCore::String&)extension;
- (BOOL)isQuickTimePlugIn;
- (BOOL)isJavaPlugIn;
diff --git a/WebKit/mac/Plugins/WebBasePluginPackage.mm b/WebKit/mac/Plugins/WebBasePluginPackage.mm
index f186b81..70e5889 100644
--- a/WebKit/mac/Plugins/WebBasePluginPackage.mm
+++ b/WebKit/mac/Plugins/WebBasePluginPackage.mm
@@ -28,6 +28,7 @@
#import <WebKit/WebBasePluginPackage.h>
+#import <algorithm>
#import <WebCore/WebCoreObjCExtras.h>
#import <WebKit/WebKitNSStringExtras.h>
#import <WebKit/WebNSObjectExtras.h>
@@ -47,18 +48,20 @@
#import <mach-o/fat.h>
#import <mach-o/loader.h>
+#define JavaCocoaPluginIdentifier "com.apple.JavaPluginCocoa"
+#define JavaCarbonPluginIdentifier "com.apple.JavaAppletPlugin"
+#define JavaCFMPluginFilename "Java Applet Plugin Enabler"
-#define JavaCocoaPluginIdentifier @"com.apple.JavaPluginCocoa"
-#define JavaCarbonPluginIdentifier @"com.apple.JavaAppletPlugin"
-#define JavaCFMPluginFilename @"Java Applet Plugin Enabler"
-
-#define QuickTimeCarbonPluginIdentifier @"com.apple.QuickTime Plugin.plugin"
-#define QuickTimeCocoaPluginIdentifier @"com.apple.quicktime.webplugin"
+#define QuickTimeCarbonPluginIdentifier "com.apple.QuickTime Plugin.plugin"
+#define QuickTimeCocoaPluginIdentifier "com.apple.quicktime.webplugin"
@interface NSArray (WebPluginExtensions)
- (NSArray *)_web_lowercaseStrings;
@end;
+using namespace std;
+using namespace WebCore;
+
@implementation WebBasePluginPackage
+ (void)initialize
@@ -91,7 +94,7 @@
return WebCFAutorelease(WKCopyCFLocalizationPreferredName(NULL));
}
-- (NSString *)pathByResolvingSymlinksAndAliasesInPath:(NSString *)thePath
+static NSString *pathByResolvingSymlinksAndAliases(NSString *thePath)
{
NSString *newPath = [thePath stringByResolvingSymlinksInPath];
@@ -122,80 +125,20 @@
if (!(self = [super init]))
return nil;
- path = [[self pathByResolvingSymlinksAndAliasesInPath:pluginPath] retain];
- bundle = [[NSBundle alloc] initWithPath:path];
+ path = pathByResolvingSymlinksAndAliases(pluginPath);
+ cfBundle.adoptCF(CFBundleCreate(kCFAllocatorDefault, (CFURLRef)[NSURL fileURLWithPath:path]));
+
#ifndef __ppc__
// 32-bit PowerPC is the only platform where non-bundled CFM plugins are supported
- if (!bundle) {
+ if (!cfBundle) {
[self release];
return nil;
}
#endif
- cfBundle = CFBundleCreate(NULL, (CFURLRef)[NSURL fileURLWithPath:path]);
- extensionToMIME = [[NSMutableDictionary alloc] init];
return self;
}
-- (BOOL)getPluginInfoFromBundleAndMIMEDictionary:(NSDictionary *)MIMETypes
-{
- if (!bundle)
- return NO;
-
- if (!MIMETypes) {
- MIMETypes = [bundle objectForInfoDictionaryKey:WebPluginMIMETypesKey];
- if (!MIMETypes)
- return NO;
- }
-
- NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary];
- NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary];
- NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator];
- NSDictionary *MIMEDictionary;
- NSString *MIME, *description;
- NSArray *extensions;
-
- while ((MIME = [keyEnumerator nextObject]) != nil) {
- MIMEDictionary = [MIMETypes objectForKey:MIME];
-
- // FIXME: Consider storing disabled MIME types.
- NSNumber *isEnabled = [MIMEDictionary objectForKey:WebPluginTypeEnabledKey];
- if (isEnabled && [isEnabled boolValue] == NO)
- continue;
-
- extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings];
- if ([extensions count] == 0)
- extensions = [NSArray arrayWithObject:@""];
-
- MIME = [MIME lowercaseString];
-
- [MIMEToExtensionsDictionary setObject:extensions forKey:MIME];
-
- description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey];
- if (!description)
- description = @"";
-
- [MIMEToDescriptionDictionary setObject:description forKey:MIME];
- }
-
- [self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary];
- [self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary];
-
- NSString *filename = [self filename];
-
- NSString *theName = [bundle objectForInfoDictionaryKey:WebPluginNameKey];
- if (!theName)
- theName = filename;
- [self setName:theName];
-
- description = [bundle objectForInfoDictionaryKey:WebPluginDescriptionKey];
- if (!description)
- description = filename;
- [self setPluginDescription:description];
-
- return YES;
-}
-
- (void)unload
{
}
@@ -225,13 +168,22 @@
return pList;
}
+- (id)_objectForInfoDictionaryKey:(NSString *)key
+{
+ CFDictionaryRef bundleInfoDictionary = CFBundleGetInfoDictionary(cfBundle.get());
+ if (!bundleInfoDictionary)
+ return nil;
+
+ return (id)CFDictionaryGetValue(bundleInfoDictionary, key);
+}
+
- (BOOL)getPluginInfoFromPLists
{
- if (!bundle)
+ if (!cfBundle)
return NO;
NSDictionary *MIMETypes = nil;
- NSString *pListFilename = [bundle objectForInfoDictionaryKey:WebPluginMIMETypesFilenameKey];
+ NSString *pListFilename = [self _objectForInfoDictionaryKey:WebPluginMIMETypesFilenameKey];
// Check if the MIME types are claimed in a plist in the user's preferences directory.
if (pListFilename) {
@@ -247,15 +199,65 @@
// Plist doesn't exist, ask the plug-in to create it.
MIMETypes = [[self pListForPath:pListPath createFile:YES] objectForKey:WebPluginMIMETypesKey];
}
-
- // Pass the MIME dictionary to the superclass to parse it.
- return [self getPluginInfoFromBundleAndMIMEDictionary:MIMETypes];
+
+ if (!MIMETypes) {
+ MIMETypes = [self _objectForInfoDictionaryKey:WebPluginMIMETypesKey];
+ if (!MIMETypes)
+ return NO;
+ }
+
+ NSEnumerator *keyEnumerator = [MIMETypes keyEnumerator];
+ NSDictionary *MIMEDictionary;
+ NSString *MIME, *description;
+ NSArray *extensions;
+
+ while ((MIME = [keyEnumerator nextObject]) != nil) {
+ MIMEDictionary = [MIMETypes objectForKey:MIME];
+
+ // FIXME: Consider storing disabled MIME types.
+ NSNumber *isEnabled = [MIMEDictionary objectForKey:WebPluginTypeEnabledKey];
+ if (isEnabled && [isEnabled boolValue] == NO)
+ continue;
+
+ MimeClassInfo mimeClassInfo;
+
+ extensions = [[MIMEDictionary objectForKey:WebPluginExtensionsKey] _web_lowercaseStrings];
+ for (NSUInteger i = 0; i < [extensions count]; ++i)
+ mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:i]);
+
+ if ([extensions count] == 0)
+ extensions = [NSArray arrayWithObject:@""];
+
+ mimeClassInfo.type = String(MIME).lower();
+
+ description = [MIMEDictionary objectForKey:WebPluginTypeDescriptionKey];
+ mimeClassInfo.desc = description;
+
+ pluginInfo.mimes.append(mimeClassInfo);
+ if (!description)
+ description = @"";
+ }
+
+ NSString *filename = [(NSString *)path lastPathComponent];
+ pluginInfo.file = filename;
+
+ NSString *theName = [self _objectForInfoDictionaryKey:WebPluginNameKey];
+ if (!theName)
+ theName = filename;
+ pluginInfo.name = theName;
+
+ description = [self _objectForInfoDictionaryKey:WebPluginDescriptionKey];
+ if (!description)
+ description = filename;
+ pluginInfo.desc = description;
+
+ return YES;
}
- (BOOL)load
{
- if (bundle && !BP_CreatePluginMIMETypesPreferences)
- BP_CreatePluginMIMETypesPreferences = (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("BP_CreatePluginMIMETypesPreferences"));
+ if (cfBundle && !BP_CreatePluginMIMETypesPreferences)
+ BP_CreatePluginMIMETypesPreferences = (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("BP_CreatePluginMIMETypesPreferences"));
return YES;
}
@@ -265,18 +267,6 @@
ASSERT(!pluginDatabases || [pluginDatabases count] == 0);
[pluginDatabases release];
- [name release];
- [path release];
- [pluginDescription release];
-
- [MIMEToDescription release];
- [MIMEToExtensions release];
- [extensionToMIME release];
-
- [bundle release];
- if (cfBundle)
- CFRelease(cfBundle);
-
[super dealloc];
}
@@ -286,128 +276,71 @@
ASSERT(!pluginDatabases || [pluginDatabases count] == 0);
[pluginDatabases release];
- if (cfBundle)
- CFRelease(cfBundle);
-
[super finalize];
}
-- (NSString *)name
-{
- return name;
-}
-
-- (NSString *)path
+- (const String&)path
{
return path;
}
-- (NSString *)filename
-{
- return [path lastPathComponent];
-}
-
-- (NSString *)pluginDescription
+- (const PluginInfo&)pluginInfo
{
- return pluginDescription;
+ return pluginInfo;
}
-- (NSEnumerator *)extensionEnumerator
+- (BOOL)supportsExtension:(const String&)extension
{
- return [extensionToMIME keyEnumerator];
-}
-
-- (NSEnumerator *)MIMETypeEnumerator
-{
- return [MIMEToExtensions keyEnumerator];
-}
-
-- (NSString *)descriptionForMIMEType:(NSString *)MIMEType
-{
- return [MIMEToDescription objectForKey:MIMEType];
-}
-
-- (NSString *)MIMETypeForExtension:(NSString *)extension
-{
- return [extensionToMIME objectForKey:extension];
-}
-
-- (NSArray *)extensionsForMIMEType:(NSString *)MIMEType
-{
- return [MIMEToExtensions objectForKey:MIMEType];
-}
-
-- (NSBundle *)bundle
-{
- return bundle;
-}
-
-- (void)setName:(NSString *)theName
-{
- [name release];
- name = [theName retain];
-}
+ ASSERT(extension.lower() == extension);
+
+ for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) {
+ const Vector<String>& extensions = pluginInfo.mimes[i].extensions;
-- (void)setPath:(NSString *)thePath
-{
- [path release];
- path = [thePath retain];
-}
+ if (find(extensions.begin(), extensions.end(), extension) != extensions.end())
+ return YES;
+ }
-- (void)setPluginDescription:(NSString *)description
-{
- [pluginDescription release];
- pluginDescription = [description retain];
+ return NO;
}
-- (void)setMIMEToDescriptionDictionary:(NSDictionary *)MIMEToDescriptionDictionary
+- (BOOL)supportsMIMEType:(const WebCore::String&)mimeType
{
- [MIMEToDescription release];
- MIMEToDescription = [MIMEToDescriptionDictionary retain];
+ ASSERT(mimeType.lower() == mimeType);
+
+ for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) {
+ if (pluginInfo.mimes[i].type == mimeType)
+ return YES;
+ }
+
+ return NO;
}
-- (void)setMIMEToExtensionsDictionary:(NSDictionary *)MIMEToExtensionsDictionary
+- (NSString *)MIMETypeForExtension:(const String&)extension
{
- [MIMEToExtensions release];
- MIMEToExtensions = [MIMEToExtensionsDictionary retain];
-
- // Reverse the mapping
- [extensionToMIME removeAllObjects];
-
- NSEnumerator *MIMEEnumerator = [MIMEToExtensions keyEnumerator], *extensionEnumerator;
- NSString *MIME, *extension;
- NSArray *extensions;
+ ASSERT(extension.lower() == extension);
- while ((MIME = [MIMEEnumerator nextObject]) != nil) {
- extensions = [MIMEToExtensions objectForKey:MIME];
- extensionEnumerator = [extensions objectEnumerator];
-
- while ((extension = [extensionEnumerator nextObject]) != nil) {
- if (![extension isEqualToString:@""])
- [extensionToMIME setObject:MIME forKey:extension];
- }
+ for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) {
+ const MimeClassInfo& mimeClassInfo = pluginInfo.mimes[i];
+ const Vector<String>& extensions = mimeClassInfo.extensions;
+
+ if (find(extensions.begin(), extensions.end(), extension) != extensions.end())
+ return mimeClassInfo.type;
}
-}
-- (NSString *)description
-{
- return [NSString stringWithFormat:@"name: %@\npath: %@\nmimeTypes:\n%@\npluginDescription:%@",
- name, path, [MIMEToExtensions description], [MIMEToDescription description], pluginDescription];
+ return nil;
}
- (BOOL)isQuickTimePlugIn
{
- NSString *bundleIdentifier = [[self bundle] bundleIdentifier];
- return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:QuickTimeCarbonPluginIdentifier] ||
- [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:QuickTimeCocoaPluginIdentifier];
+ const String& bundleIdentifier = [self bundleIdentifier];
+ return bundleIdentifier == QuickTimeCocoaPluginIdentifier || bundleIdentifier == QuickTimeCocoaPluginIdentifier;
}
- (BOOL)isJavaPlugIn
{
- NSString *bundleIdentifier = [[self bundle] bundleIdentifier];
- return [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCocoaPluginIdentifier] ||
- [bundleIdentifier _webkit_isCaseInsensitiveEqualToString:JavaCarbonPluginIdentifier] ||
- [[path lastPathComponent] _webkit_isCaseInsensitiveEqualToString:JavaCFMPluginFilename];
+ const String& bundleIdentifier = [self bundleIdentifier];
+ return bundleIdentifier == JavaCocoaPluginIdentifier || bundleIdentifier == JavaCarbonPluginIdentifier ||
+ equalIgnoringCase(pluginInfo.file, JavaCFMPluginFilename);
}
static inline void swapIntsInHeader(uint8_t* bytes, unsigned length)
@@ -492,7 +425,7 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length)
- (UInt32)versionNumber
{
// CFBundleGetVersionNumber doesn't work with all possible versioning schemes, but we think for now it's good enough for us.
- return CFBundleGetVersionNumber(cfBundle);
+ return CFBundleGetVersionNumber(cfBundle.get());
}
- (void)wasAddedToPluginDatabase:(WebPluginDatabase *)database
@@ -512,6 +445,11 @@ static inline void swapIntsInHeader(uint8_t* bytes, unsigned length)
[pluginDatabases removeObject:database];
}
+- (WebCore::String)bundleIdentifier
+{
+ return CFBundleGetIdentifier(cfBundle.get());
+}
+
@end
@implementation NSArray (WebPluginExtensions)
diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.h b/WebKit/mac/Plugins/WebNetscapePluginPackage.h
index 1d4c893..445c3bb 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginPackage.h
+++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.h
@@ -77,6 +77,8 @@ typedef enum {
- (WebExecutableType)executableType;
- (NPPluginFuncs *)pluginFuncs;
+- (BOOL)supportsSnapshotting;
+
#if USE(PLUGIN_HOST_PROCESS)
- (cpu_type_t)pluginHostArchitecture;
#endif
diff --git a/WebKit/mac/Plugins/WebNetscapePluginPackage.mm b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
index 5651e7e..7ca1121 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginPackage.mm
@@ -29,12 +29,14 @@
#if ENABLE(NETSCAPE_PLUGIN_API)
#import "WebNetscapePluginPackage.h"
+#import "WebTypesInternal.h"
#import "WebKitLogging.h"
#import "WebKitNSStringExtras.h"
#import "WebNSFileManagerExtras.h"
#import "WebNSObjectExtras.h"
#import "WebNetscapeDeprecatedFunctions.h"
#import <WebCore/npruntime_impl.h>
+#import <wtf/RetainPtr.h>
#if USE(PLUGIN_HOST_PROCESS)
#import "NetscapePluginHostManager.h"
@@ -42,6 +44,8 @@
using namespace WebKit;
#endif
+using namespace WebCore;
+
#ifdef SUPPORT_CFM
typedef void (* FunctionPointer)(void);
typedef void (* TransitionVector)(void);
@@ -54,7 +58,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#define MIMEListStringStringNumber 128
#define RealPlayerAppIndentifier @"com.RealNetworks.RealOne Player"
-#define RealPlayerPluginFilename @"RealPlayer Plugin"
+#define RealPlayerPluginFilename "RealPlayer Plugin"
@interface WebNetscapePluginPackage (Internal)
- (void)_unloadWithShutdown:(BOOL)shutdown;
@@ -95,7 +99,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#ifdef SUPPORT_CFM
if (!isBundle) {
FSRef fref;
- OSErr err = FSPathMakeRef((const UInt8 *)[path fileSystemRepresentation], &fref, NULL);
+ OSErr err = FSPathMakeRef((const UInt8 *)[(NSString *)path fileSystemRepresentation], &fref, NULL);
if (err != noErr)
return -1;
@@ -103,7 +107,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
}
#endif
- return CFBundleOpenBundleResourceMap(cfBundle);
+ return CFBundleOpenBundleResourceMap(cfBundle.get());
}
- (void)closeResourceFile:(ResFileRefNum)resRef
@@ -115,7 +119,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
}
#endif
- CFBundleCloseBundleResourceMap(cfBundle, resRef);
+ CFBundleCloseBundleResourceMap(cfBundle.get(), resRef);
}
- (NSString *)stringForStringListID:(SInt16)stringListID andIndex:(SInt16)index
@@ -156,46 +160,42 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
NSArray *extensions;
unsigned i;
- NSMutableDictionary *MIMEToExtensionsDictionary = [NSMutableDictionary dictionary];
- NSMutableDictionary *MIMEToDescriptionDictionary = [NSMutableDictionary dictionary];
-
for (i=1; 1; i+=2) {
MIME = [[self stringForStringListID:MIMEListStringStringNumber
andIndex:i] lowercaseString];
if (!MIME)
break;
+ MimeClassInfo mimeClassInfo;
+ mimeClassInfo.type = String(MIME).lower();
+
extensionsList = [[self stringForStringListID:MIMEListStringStringNumber andIndex:i+1] lowercaseString];
if (extensionsList) {
extensions = [extensionsList componentsSeparatedByString:@","];
- [MIMEToExtensionsDictionary setObject:extensions forKey:MIME];
- } else
- // DRM and WMP claim MIMEs without extensions. Use a @"" extension in this case.
- [MIMEToExtensionsDictionary setObject:[NSArray arrayWithObject:@""] forKey:MIME];
+ for (NSUInteger j = 0; j < [extensions count]; ++j)
+ mimeClassInfo.extensions.append((NSString *)[extensions objectAtIndex:j]);
+ }
description = [self stringForStringListID:MIMEDescriptionStringNumber
- andIndex:[MIMEToExtensionsDictionary count]];
- if (description)
- [MIMEToDescriptionDictionary setObject:description forKey:MIME];
- else
- [MIMEToDescriptionDictionary setObject:@"" forKey:MIME];
- }
+ andIndex:pluginInfo.mimes.size() + 1];
+ mimeClassInfo.desc = description;
- [self setMIMEToDescriptionDictionary:MIMEToDescriptionDictionary];
- [self setMIMEToExtensionsDictionary:MIMEToExtensionsDictionary];
+ pluginInfo.mimes.append(mimeClassInfo);
+ }
- NSString *filename = [self filename];
+ NSString *filename = [(NSString *)path lastPathComponent];
+ pluginInfo.file = filename;
description = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:1];
if (!description)
description = filename;
- [self setPluginDescription:description];
+ pluginInfo.desc = description;
NSString *theName = [self stringForStringListID:PluginNameOrDescriptionStringNumber andIndex:2];
if (!theName)
theName = filename;
- [self setName:theName];
+ pluginInfo.name = theName;
[self closeResourceFile:resRef];
@@ -208,9 +208,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
OSType type = 0;
- if (bundle) {
+ if (cfBundle) {
// Bundle
- CFBundleGetPackageInfo(cfBundle, &type, NULL);
+ CFBundleGetPackageInfo(cfBundle.get(), &type, NULL);
#ifdef SUPPORT_CFM
isBundle = YES;
#endif
@@ -230,8 +230,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
return NO;
// Check if the executable is Mach-O or CFM.
- if (bundle) {
- NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]];
+ if (cfBundle) {
+ RetainPtr<CFURLRef> executableURL(AdoptCF, CFBundleCopyExecutableURL(cfBundle.get()));
+ if (!executableURL)
+ return NO;
+ NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[(NSURL *)executableURL.get() path]];
NSData *data = [executableFile readDataOfLength:512];
[executableFile closeFile];
// Check the length of the data before calling memcmp. We think this fixes 3782543.
@@ -246,11 +249,11 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#endif
#if USE(PLUGIN_HOST_PROCESS)
- NSArray *archs = [bundle executableArchitectures];
+ RetainPtr<CFArrayRef> archs(AdoptCF, CFBundleCopyExecutableArchitectures(cfBundle.get()));
- if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]])
+ if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureX86_64]])
pluginHostArchitecture = CPU_TYPE_X86_64;
- else if ([archs containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]])
+ else if ([(NSArray *)archs.get() containsObject:[NSNumber numberWithInteger:NSBundleExecutableArchitectureI386]])
pluginHostArchitecture = CPU_TYPE_X86;
else
return NO;
@@ -299,7 +302,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
- (void)createPropertyListFile
{
- NetscapePluginHostManager::createPropertyListFile(self);
+ NetscapePluginHostManager::createPropertyListFile(path, pluginHostArchitecture);
}
#endif
@@ -323,7 +326,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
if (!cfBundle)
return;
- if ([(NSString *)CFBundleGetIdentifier(cfBundle) isEqualToString:@"com.lizardtech.NPDjVu"]) {
+ if ([self bundleIdentifier] == "com.lizardtech.NPDjVu") {
// The DjVu plug-in will crash copying the vtable if it's too big so we cap it to
// what the plug-in expects here.
// size + version + 40 function pointers.
@@ -352,7 +355,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
CFAbsoluteTime currentTime;
CFAbsoluteTime duration;
#endif
- LOG(Plugins, "%f Load timing started for: %@", start, [self name]);
+ LOG(Plugins, "%f Load timing started for: %@", start, (NSString *)[self pluginInfo].name);
if (isLoaded)
return YES;
@@ -360,7 +363,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#ifdef SUPPORT_CFM
if (isBundle) {
#endif
- if (!CFBundleLoadExecutable(cfBundle))
+ if (!CFBundleLoadExecutable(cfBundle.get()))
return NO;
#if !LOG_DISABLED
currentTime = CFAbsoluteTimeGetCurrent();
@@ -371,14 +374,14 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
#ifdef SUPPORT_CFM
if (isCFM) {
- pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("main") );
+ pluginMainFunc = (MainFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("main") );
if (!pluginMainFunc)
return NO;
} else {
#endif
- NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Initialize"));
- NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_GetEntryPoints"));
- NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle, CFSTR("NP_Shutdown"));
+ NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("NP_Initialize"));
+ NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("NP_GetEntryPoints"));
+ NP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(cfBundle.get(), CFSTR("NP_Shutdown"));
if (!NP_Initialize || !NP_GetEntryPoints || !NP_Shutdown)
return NO;
#ifdef SUPPORT_CFM
@@ -389,7 +392,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
FSRef fref;
OSErr err;
- err = FSPathMakeRef((UInt8 *)[path fileSystemRepresentation], &fref, NULL);
+ err = FSPathMakeRef((UInt8 *)[(NSString *)path fileSystemRepresentation], &fref, NULL);
if (err != noErr) {
LOG_ERROR("FSPathMakeRef failed. Error=%d", err);
return NO;
@@ -503,7 +506,7 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
// Workaround for 3270576. The RealPlayer plug-in fails to load if its preference file is out of date.
// Launch the RealPlayer application to refresh the file.
if (npErr != NPERR_NO_ERROR) {
- if (npErr == NPERR_MODULE_LOAD_FAILED_ERROR && [[self filename] isEqualToString:RealPlayerPluginFilename])
+ if (npErr == NPERR_MODULE_LOAD_FAILED_ERROR && equalIgnoringCase(pluginInfo.file, RealPlayerPluginFilename))
[self launchRealPlayer];
return NO;
}
@@ -534,9 +537,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
// LiveConnect support
pluginFuncs.javaClass = (JRIGlobalRef)functionPointerForTVector((TransitionVector)pluginFuncs.javaClass);
if (pluginFuncs.javaClass) {
- LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass);
+ LOG(LiveConnect, "%@: CFM entry point for NPP_GetJavaClass = %p", (NSString *)[self pluginInfo].name, pluginFuncs.javaClass);
} else {
- LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]);
+ LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", (NSString *)[self pluginInfo].name);
}
} else {
@@ -625,9 +628,9 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
pluginVersion = pluginFuncs.version;
if (pluginFuncs.javaClass)
- LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", [self name], pluginFuncs.javaClass);
+ LOG(LiveConnect, "%@: mach-o entry point for NPP_GetJavaClass = %p", (NSString *)[self pluginInfo].name, pluginFuncs.javaClass);
else
- LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", [self name]);
+ LOG(LiveConnect, "%@: no entry point for NPP_GetJavaClass", (NSString *)[self pluginInfo].name);
#ifdef SUPPORT_CFM
}
@@ -689,6 +692,22 @@ static TransitionVector tVectorForFunctionPointer(FunctionPointer);
[self _unloadWithShutdown:YES];
}
+
+- (BOOL)supportsSnapshotting
+{
+ if ([self bundleIdentifier] != "com.macromedia.Flash Player.plugin")
+ return YES;
+
+ // Flash has a bogus Info.plist entry for CFBundleVersionString, so use CFBundleShortVersionString.
+ NSString *versionString = (NSString *)CFDictionaryGetValue(CFBundleGetInfoDictionary(cfBundle.get()), CFSTR("CFBundleShortVersionString"));
+
+ if (![versionString hasPrefix:@"10.1"])
+ return YES;
+
+ // Some prerelease versions of Flash 10.1 crash when sent a drawRect event using the CA drawing model: <rdar://problem/7739922>
+ return CFStringCompare((CFStringRef)versionString, CFSTR("10.1.53.60"), kCFCompareNumerically) != kCFCompareLessThan;
+}
+
@end
#ifdef SUPPORT_CFM
@@ -736,7 +755,7 @@ TransitionVector tVectorForFunctionPointer(FunctionPointer fp)
if (!isLoaded)
return;
- LOG(Plugins, "Unloading %@...", name);
+ LOG(Plugins, "Unloading %@...", (NSString *)pluginInfo.name);
// Cannot unload a plug-in package while an instance is still using it
if (instanceCount > 0) {
diff --git a/WebKit/mac/Plugins/WebNetscapePluginView.mm b/WebKit/mac/Plugins/WebNetscapePluginView.mm
index 8b4d998..f062f7c 100644
--- a/WebKit/mac/Plugins/WebNetscapePluginView.mm
+++ b/WebKit/mac/Plugins/WebNetscapePluginView.mm
@@ -1234,7 +1234,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
cValues = (char **)malloc([values count] * sizeof(char *));
}
- BOOL isWMP = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.WMP.defaultplugin"];
+ BOOL isWMP = [_pluginPackage.get() bundleIdentifier] == "com.microsoft.WMP.defaultplugin";
unsigned i;
unsigned count = [keys count];
@@ -2370,9 +2370,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
ASSERT(pluginFunctionCallDepth == 0);
PluginMainThreadScheduler::scheduler().registerPlugin(plugin);
-
- _isFlash = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.macromedia.Flash Player.plugin"];
- _isSilverlight = [[[_pluginPackage.get() bundle] bundleIdentifier] isEqualToString:@"com.microsoft.SilverlightPlugin"];
+
+ _isFlash = [_pluginPackage.get() bundleIdentifier] == "com.macromedia.Flash Player.plugin";
+ _isSilverlight = [_pluginPackage.get() bundleIdentifier] == "com.microsoft.SilverlightPlugin";
[[self class] setCurrentPluginView:self];
NPError npErr = [_pluginPackage.get() pluginFuncs]->newp((char *)[_MIMEType.get() cString], plugin, _mode, argsCount, cAttributes, cValues, NULL);
diff --git a/WebKit/mac/Plugins/WebPluginDatabase.mm b/WebKit/mac/Plugins/WebPluginDatabase.mm
index 34f5e0f..e7fae1b 100644
--- a/WebKit/mac/Plugins/WebPluginDatabase.mm
+++ b/WebKit/mac/Plugins/WebPluginDatabase.mm
@@ -45,6 +45,8 @@
#import <WebKitSystemInterface.h>
#import <wtf/Assertions.h>
+using namespace WebCore;
+
static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPackage **candidatePlugin);
@interface WebPluginDatabase (Internal)
@@ -82,78 +84,107 @@ static void checkCandidate(WebBasePluginPackage **currentPlugin, WebBasePluginPa
return;
}
- if ([[[*currentPlugin bundle] bundleIdentifier] isEqualToString:[[*candidatePlugin bundle] bundleIdentifier]] && [*candidatePlugin versionNumber] > [*currentPlugin versionNumber])
+ if ([*currentPlugin bundleIdentifier] == [*candidatePlugin bundleIdentifier] && [*candidatePlugin versionNumber] > [*currentPlugin versionNumber])
*currentPlugin = *candidatePlugin;
}
-- (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(SEL)enumeratorSelector
-{
- WebBasePluginPackage *plugin = nil;
- WebBasePluginPackage *webPlugin = nil;
+struct PluginPackageCandidates {
+ PluginPackageCandidates()
+ : webPlugin(nil)
+ , machoPlugin(nil)
#ifdef SUPPORT_CFM
- WebBasePluginPackage *CFMPlugin = nil;
+ , CFMPlugin(nil)
#endif
- WebBasePluginPackage *machoPlugin = nil;
-
- NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
- key = [key lowercaseString];
-
- while ((plugin = [pluginEnumerator nextObject]) != nil) {
- if ([[[plugin performSelector:enumeratorSelector] allObjects] containsObject:key]) {
- if ([plugin isKindOfClass:[WebPluginPackage class]])
- checkCandidate(&webPlugin, &plugin);
+ {
+ }
+
+ void update(WebBasePluginPackage *plugin)
+ {
+ if ([plugin isKindOfClass:[WebPluginPackage class]]) {
+ checkCandidate(&webPlugin, &plugin);
+ return;
+ }
+
#if ENABLE(NETSCAPE_PLUGIN_API)
- else if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) {
- WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType];
+ if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) {
+ WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType];
#ifdef SUPPORT_CFM
- if (executableType == WebCFMExecutableType) {
- checkCandidate(&CFMPlugin, &plugin);
- } else
+ if (executableType == WebCFMExecutableType) {
+ checkCandidate(&CFMPlugin, &plugin);
+ return;
+ }
#endif // SUPPORT_CFM
- if (executableType == WebMachOExecutableType) {
- checkCandidate(&machoPlugin, &plugin);
- } else {
- ASSERT_NOT_REACHED();
- }
- } else {
- ASSERT_NOT_REACHED();
+ if (executableType == WebMachOExecutableType) {
+ checkCandidate(&machoPlugin, &plugin);
+ return;
}
-#endif
}
+#endif
+ ASSERT_NOT_REACHED();
}
-
- // Allow other plug-ins to win over QT because if the user has installed a plug-in that can handle a type
- // that the QT plug-in can handle, they probably intended to override QT.
- if (webPlugin && ![webPlugin isQuickTimePlugIn])
- return webPlugin;
- else if (machoPlugin && ![machoPlugin isQuickTimePlugIn])
- return machoPlugin;
+ WebBasePluginPackage *bestCandidate()
+ {
+ // Allow other plug-ins to win over QT because if the user has installed a plug-in that can handle a type
+ // that the QT plug-in can handle, they probably intended to override QT.
+ if (webPlugin && ![webPlugin isQuickTimePlugIn])
+ return webPlugin;
+
+ if (machoPlugin && ![machoPlugin isQuickTimePlugIn])
+ return machoPlugin;
+
#ifdef SUPPORT_CFM
- else if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn])
- return CFMPlugin;
+ if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn])
+ return CFMPlugin;
#endif // SUPPORT_CFM
- else if (webPlugin)
- return webPlugin;
- else if (machoPlugin)
- return machoPlugin;
+
+ if (webPlugin)
+ return webPlugin;
+ if (machoPlugin)
+ return machoPlugin;
#ifdef SUPPORT_CFM
- else if (CFMPlugin)
- return CFMPlugin;
+ if (CFMPlugin)
+ return CFMPlugin;
#endif
- return nil;
-}
+ return nil;
+ }
+
+ WebBasePluginPackage *webPlugin;
+ WebBasePluginPackage *machoPlugin;
+#ifdef SUPPORT_CFM
+ WebBasePluginPackage *CFMPlugin;
+#endif
+};
- (WebBasePluginPackage *)pluginForMIMEType:(NSString *)MIMEType
{
- return [self pluginForKey:[MIMEType lowercaseString]
- withEnumeratorSelector:@selector(MIMETypeEnumerator)];
+ PluginPackageCandidates candidates;
+
+ MIMEType = [MIMEType lowercaseString];
+ NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
+
+ while (WebBasePluginPackage *plugin = [pluginEnumerator nextObject]) {
+ if ([plugin supportsMIMEType:MIMEType])
+ candidates.update(plugin);
+ }
+
+ return candidates.bestCandidate();
}
- (WebBasePluginPackage *)pluginForExtension:(NSString *)extension
{
- WebBasePluginPackage *plugin = [self pluginForKey:[extension lowercaseString]
- withEnumeratorSelector:@selector(extensionEnumerator)];
+ PluginPackageCandidates candidates;
+
+ extension = [extension lowercaseString];
+ NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
+
+ while (WebBasePluginPackage *plugin = [pluginEnumerator nextObject]) {
+ if ([plugin supportsExtension:extension])
+ candidates.update(plugin);
+ }
+
+ WebBasePluginPackage *plugin = candidates.bestCandidate();
+
if (!plugin) {
// If no plug-in was found from the extension, attempt to map from the extension to a MIME type
// and find the a plug-in from the MIME type. This is done in case the plug-in has not fully specified
@@ -275,8 +306,11 @@ static NSArray *additionalWebPlugInPaths;
// Build a list of MIME types.
NSMutableSet *MIMETypes = [[NSMutableSet alloc] init];
pluginEnumerator = [plugins objectEnumerator];
- while ((plugin = [pluginEnumerator nextObject]) != nil)
- [MIMETypes addObjectsFromArray:[[plugin MIMETypeEnumerator] allObjects]];
+ while ((plugin = [pluginEnumerator nextObject])) {
+ const PluginInfo& pluginInfo = [plugin pluginInfo];
+ for (size_t i = 0; i < pluginInfo.mimes.size(); ++i)
+ [MIMETypes addObject:pluginInfo.mimes[i].type];
+ }
// Register plug-in views and representations.
NSEnumerator *MIMEEnumerator = [MIMETypes objectEnumerator];
@@ -410,9 +444,10 @@ static NSArray *additionalWebPlugInPaths;
ASSERT(plugin);
// Unregister plug-in's MIME type registrations
- NSEnumerator *MIMETypeEnumerator = [plugin MIMETypeEnumerator];
- NSString *MIMEType;
- while ((MIMEType = [MIMETypeEnumerator nextObject])) {
+ const PluginInfo& pluginInfo = [plugin pluginInfo];
+ for (size_t i = 0; i < pluginInfo.mimes.size(); ++i) {
+ NSString *MIMEType = pluginInfo.mimes[i].type;
+
if ([registeredMIMETypes containsObject:MIMEType]) {
if (self == sharedDatabase)
[WebView _unregisterPluginMIMEType:MIMEType];
diff --git a/WebKit/mac/Plugins/WebPluginPackage.h b/WebKit/mac/Plugins/WebPluginPackage.h
index 290bb1b..f8c8146 100644
--- a/WebKit/mac/Plugins/WebPluginPackage.h
+++ b/WebKit/mac/Plugins/WebPluginPackage.h
@@ -32,7 +32,9 @@
@protocol WebPluginViewFactory;
-@interface WebPluginPackage : WebBasePluginPackage
+@interface WebPluginPackage : WebBasePluginPackage {
+ NSBundle *nsBundle;
+}
- (Class)viewFactory;
diff --git a/WebKit/mac/Plugins/WebPluginPackage.m b/WebKit/mac/Plugins/WebPluginPackage.mm
index d7f144e..a608068 100644
--- a/WebKit/mac/Plugins/WebPluginPackage.m
+++ b/WebKit/mac/Plugins/WebPluginPackage.mm
@@ -40,26 +40,28 @@ NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey"
@implementation WebPluginPackage
-- initWithPath:(NSString *)pluginPath
+- (id)initWithPath:(NSString *)pluginPath
{
if (!(self = [super initWithPath:pluginPath]))
return nil;
- if (bundle == nil) {
+ nsBundle = [[NSBundle alloc] initWithPath:path];
+
+ if (!nsBundle) {
[self release];
return nil;
}
if (![[pluginPath pathExtension] _webkit_isCaseInsensitiveEqualToString:@"webplugin"]) {
UInt32 type = 0;
- CFBundleGetPackageInfo(cfBundle, &type, NULL);
+ CFBundleGetPackageInfo(cfBundle.get(), &type, NULL);
if (type != FOUR_CHAR_CODE('WBPL')) {
[self release];
return nil;
}
}
- NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[bundle executablePath]];
+ NSFileHandle *executableFile = [NSFileHandle fileHandleForReadingAtPath:[nsBundle executablePath]];
NSData *data = [executableFile readDataOfLength:512];
[executableFile closeFile];
if (![self isNativeLibraryData:data]) {
@@ -75,9 +77,16 @@ NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey"
return self;
}
+- (void)dealloc
+{
+ [nsBundle release];
+
+ [super dealloc];
+}
+
- (Class)viewFactory
{
- return [bundle principalClass];
+ return [nsBundle principalClass];
}
- (BOOL)load
@@ -87,14 +96,14 @@ NSString *WebPlugInContainingElementKey = @"WebPlugInContainingElementKey"
#endif
// Load the bundle
- if (![bundle isLoaded]) {
- if (![bundle load])
+ if (![nsBundle isLoaded]) {
+ if (![nsBundle load])
return NO;
}
#if !LOG_DISABLED
CFAbsoluteTime duration = CFAbsoluteTimeGetCurrent() - start;
- LOG(Plugins, "principalClass took %f seconds for: %@", duration, [self name]);
+ LOG(Plugins, "principalClass took %f seconds for: %@", duration, (NSString *)[self pluginInfo].name);
#endif
return [super load];
}
diff --git a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
index cf4b03c..d72f4ed 100644
--- a/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
+++ b/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
@@ -84,6 +84,7 @@
#import <WebCore/FormState.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameLoaderStateMachine.h>
#import <WebCore/FrameLoaderTypes.h>
#import <WebCore/FrameTree.h>
#import <WebCore/FrameView.h>
@@ -1177,7 +1178,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
if (usesDocumentViews) {
// FIXME (Viewless): I assume we want the equivalent of this optimization for viewless mode too.
bool willProduceHTMLView = [m_webFrame->_private->webFrameView _viewClassForMIMEType:[dataSource _responseMIMEType]] == [WebHTMLView class];
- bool canSkipCreation = core(m_webFrame.get())->loader()->committingFirstRealLoad() && willProduceHTMLView;
+ bool canSkipCreation = core(m_webFrame.get())->loader()->stateMachine()->committingFirstRealLoad() && willProduceHTMLView;
if (canSkipCreation) {
[[m_webFrame->_private->webFrameView documentView] setDataSource:dataSource];
return;
@@ -1631,8 +1632,10 @@ PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLP
KURL pluginPageURL = document->completeURL(deprecatedParseURL(parameterValue(paramNames, paramValues, "pluginspage")));
if (!pluginPageURL.protocolInHTTPFamily())
pluginPageURL = KURL();
+ NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage pluginInfo].name : nil;
+
NSError *error = [[NSError alloc] _initWithPluginErrorCode:errorCode
- contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:[pluginPackage name] MIMEType:MIMEType];
+ contentURL:pluginURL pluginPageURL:pluginPageURL pluginName:pluginName MIMEType:MIMEType];
CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView],
@selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]);
[error release];
@@ -1721,7 +1724,8 @@ PassRefPtr<Widget> WebFrameLoaderClient::createJavaAppletWidget(const IntSize& s
if (!view) {
WebResourceDelegateImplementationCache* implementations = WebViewGetResourceLoadDelegateImplementations(getWebView(m_webFrame.get()));
if (implementations->plugInFailedWithErrorFunc) {
- NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:[pluginPackage name] MIMEType:MIMEType];
+ NSString *pluginName = pluginPackage ? (NSString *)[pluginPackage pluginInfo].name : nil;
+ NSError *error = [[NSError alloc] _initWithPluginErrorCode:WebKitErrorJavaUnavailable contentURL:nil pluginPageURL:nil pluginName:pluginName MIMEType:MIMEType];
CallResourceLoadDelegate(implementations->plugInFailedWithErrorFunc, [m_webFrame.get() webView],
@selector(webView:plugInFailedWithError:dataSource:), error, [m_webFrame.get() _dataSource]);
[error release];
diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h
index 94ff676..7092157 100644
--- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h
+++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.h
@@ -34,9 +34,9 @@ class WebPasteboardHelper : public WebCore::PasteboardHelper
{
public:
WebPasteboardHelper(WebHTMLView* view) : m_view(view) {}
- virtual WebCore::String urlFromPasteboard(const NSPasteboard*, WebCore::String* title) const;
- virtual WebCore::String plainTextFromPasteboard(const NSPasteboard*) const;
- virtual DOMDocumentFragment* fragmentFromPasteboard(const NSPasteboard*) const;
+ virtual WebCore::String urlFromPasteboard(NSPasteboard*, WebCore::String* title) const;
+ virtual WebCore::String plainTextFromPasteboard(NSPasteboard*) const;
+ virtual DOMDocumentFragment* fragmentFromPasteboard(NSPasteboard*) const;
virtual NSArray* insertablePasteboardTypes() const;
private:
WebHTMLView* m_view;
diff --git a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
index eb6a58d..fb93f8e 100644
--- a/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
+++ b/WebKit/mac/WebCoreSupport/WebPasteboardHelper.mm
@@ -37,7 +37,7 @@
using namespace WebCore;
-String WebPasteboardHelper::urlFromPasteboard(const NSPasteboard* pasteboard, String* title) const
+String WebPasteboardHelper::urlFromPasteboard(NSPasteboard* pasteboard, String* title) const
{
NSURL *URL = [pasteboard _web_bestURL];
if (title) {
@@ -48,7 +48,7 @@ String WebPasteboardHelper::urlFromPasteboard(const NSPasteboard* pasteboard, St
return [URL _web_originalDataAsString];
}
-String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboard) const
+String WebPasteboardHelper::plainTextFromPasteboard(NSPasteboard *pasteboard) const
{
NSArray *types = [pasteboard types];
@@ -85,7 +85,7 @@ String WebPasteboardHelper::plainTextFromPasteboard(const NSPasteboard *pasteboa
return String();
}
-DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(const NSPasteboard *pasteboard) const
+DOMDocumentFragment *WebPasteboardHelper::fragmentFromPasteboard(NSPasteboard *pasteboard) const
{
return [m_view _documentFragmentFromPasteboard:pasteboard];
}
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
new file mode 100644
index 0000000..ce8bf9d
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebPlatformStrategies_h
+#define WebPlatformStrategies_h
+
+#include <WebCore/PlatformStrategies.h>
+#include <WebCore/PluginStrategy.h>
+
+class WebPlatformStrategies : public WebCore::PlatformStrategies, private WebCore::PluginStrategy {
+public:
+ static void initialize();
+
+private:
+ WebPlatformStrategies();
+
+ // WebCore::PlatformStrategies
+ virtual WebCore::PluginStrategy* createPluginStrategy();
+
+ // WebCore::PluginStrategy
+ virtual void refreshPlugins();
+ virtual void getPluginInfo(Vector<WebCore::PluginInfo>&);
+};
+
+#endif // WebPlatformStrategies_h
diff --git a/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
new file mode 100644
index 0000000..d4bb684
--- /dev/null
+++ b/WebKit/mac/WebCoreSupport/WebPlatformStrategies.mm
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "WebPlatformStrategies.h"
+
+#import "WebPluginDatabase.h"
+#import "WebPluginPackage.h"
+#import <WebCore/BlockExceptions.h>
+#import <wtf/StdLibExtras.h>
+
+#ifdef BUILDING_ON_TIGER
+typedef unsigned NSUInteger;
+#endif
+
+using namespace WebCore;
+
+void WebPlatformStrategies::initialize()
+{
+ DEFINE_STATIC_LOCAL(WebPlatformStrategies, platformStrategies, ());
+ setPlatformStrategies(&platformStrategies);
+}
+
+WebPlatformStrategies::WebPlatformStrategies()
+{
+}
+
+// PluginStrategy
+
+PluginStrategy* WebPlatformStrategies::createPluginStrategy()
+{
+ return this;
+}
+
+void WebPlatformStrategies::refreshPlugins()
+{
+ [[WebPluginDatabase sharedDatabase] refresh];
+}
+
+void WebPlatformStrategies::getPluginInfo(Vector<WebCore::PluginInfo>& plugins)
+{
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+
+ NSArray* pluginsArray = [[WebPluginDatabase sharedDatabase] plugins];
+ for (unsigned int i = 0; i < [pluginsArray count]; ++i) {
+ WebPluginPackage *plugin = [pluginsArray objectAtIndex:i];
+
+ plugins.append([plugin pluginInfo]);
+ }
+
+ END_BLOCK_OBJC_EXCEPTIONS;
+}
+
+
diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.h b/WebKit/mac/WebCoreSupport/WebSystemInterface.h
index 6e20279..d460217 100644
--- a/WebKit/mac/WebCoreSupport/WebSystemInterface.h
+++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.h
@@ -26,12 +26,4 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void InitWebCoreSystemInterface(void);
-
-#ifdef __cplusplus
-}
-#endif
+void InitWebCoreSystemInterface();
diff --git a/WebKit/mac/WebCoreSupport/WebSystemInterface.m b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
index b792707..0b74dee 100644
--- a/WebKit/mac/WebCoreSupport/WebSystemInterface.m
+++ b/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
@@ -1,5 +1,5 @@
/*
- * Copyright 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
+ * Copyright 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,12 +28,12 @@
#import "WebSystemInterface.h"
-#import <WebCore/WebCoreSystemInterface.h>
-#import <WebKitSystemInterface.h>
-
// Needed for builds not using PCH to expose BUILDING_ macros, see bug 32753.
#include <wtf/Platform.h>
+#import <WebCore/WebCoreSystemInterface.h>
+#import <WebKitSystemInterface.h>
+
#define INIT(function) wk##function = WK##function
void InitWebCoreSystemInterface(void)
@@ -115,5 +115,9 @@ void InitWebCoreSystemInterface(void)
INIT(NoteOpenPanelFiles);
#endif
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+ INIT(GetHyphenationLocationBeforeIndex);
+#endif
+
didInit = true;
}
diff --git a/WebKit/mac/WebCoreSupport/WebViewFactory.mm b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
index fd6d5b0..a97d5a5 100644
--- a/WebKit/mac/WebCoreSupport/WebViewFactory.mm
+++ b/WebKit/mac/WebCoreSupport/WebViewFactory.mm
@@ -35,7 +35,6 @@
#import <WebKit/WebNSUserDefaultsExtras.h>
#import <WebKit/WebNSObjectExtras.h>
#import <WebKit/WebNSViewExtras.h>
-#import <WebKit/WebPluginDatabase.h>
#import <WebKitSystemInterface.h>
#import <wtf/Assertions.h>
@@ -65,16 +64,6 @@
ASSERT([[self sharedFactory] isKindOfClass:self]);
}
-- (NSArray *)pluginsInfo
-{
- return [[WebPluginDatabase sharedDatabase] plugins];
-}
-
-- (void)refreshPlugins
-{
- [[WebPluginDatabase sharedDatabase] refresh];
-}
-
- (NSString *)inputElementAltText
{
return UI_STRING_KEY("Submit", "Submit (input element)", "alt text for <input> elements with no alt, title, or value");
diff --git a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
index 86090be..74439dd 100644
--- a/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
+++ b/WebKit/mac/WebView/WebDynamicScrollBarsView.mm
@@ -174,7 +174,7 @@ struct WebDynamicScrollBarsViewPrivate {
[[self contentView] setFrame:[self contentViewFrame]];
}
-- (void)setSuppressLayout:(BOOL)flag;
+- (void)setSuppressLayout:(BOOL)flag
{
_private->suppressLayout = flag;
}
diff --git a/WebKit/mac/WebView/WebFrame.mm b/WebKit/mac/WebView/WebFrame.mm
index 7c59615..b71d501 100644
--- a/WebKit/mac/WebView/WebFrame.mm
+++ b/WebKit/mac/WebView/WebFrame.mm
@@ -66,6 +66,7 @@
#import <WebCore/EventNames.h>
#import <WebCore/Frame.h>
#import <WebCore/FrameLoader.h>
+#import <WebCore/FrameLoaderStateMachine.h>
#import <WebCore/FrameTree.h>
#import <WebCore/GraphicsContext.h>
#import <WebCore/HTMLFrameOwnerElement.h>
@@ -1051,7 +1052,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
- (BOOL)_firstLayoutDone
{
- return _private->coreFrame->loader()->firstLayoutDone();
+ return _private->coreFrame->loader()->stateMachine()->firstLayoutDone();
}
- (WebFrameLoadType)_loadType
@@ -1222,7 +1223,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
if (documentLoader && !documentLoader->mainDocumentError().isNull())
[result setObject:(NSError *)documentLoader->mainDocumentError() forKey:WebFrameMainDocumentError];
- if (frameLoader->containsPlugins())
+ if (frameLoader->subframeLoader()->containsPlugins())
[result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins];
if (DOMWindow* domWindow = _private->coreFrame->domWindow()) {
diff --git a/WebKit/mac/WebView/WebGeolocationPosition.mm b/WebKit/mac/WebView/WebGeolocationPosition.mm
index 46f62c1..c92b7f1 100644
--- a/WebKit/mac/WebView/WebGeolocationPosition.mm
+++ b/WebKit/mac/WebView/WebGeolocationPosition.mm
@@ -83,4 +83,10 @@ GeolocationPosition* core(WebGeolocationPosition *position)
return self;
}
+- (void)dealloc
+{
+ [_internal release];
+ [super dealloc];
+}
+
@end
diff --git a/WebKit/mac/WebView/WebHTMLRepresentation.mm b/WebKit/mac/WebView/WebHTMLRepresentation.mm
index 51fd5ba..c009f4a 100644
--- a/WebKit/mac/WebView/WebHTMLRepresentation.mm
+++ b/WebKit/mac/WebView/WebHTMLRepresentation.mm
@@ -29,6 +29,7 @@
#import "WebHTMLRepresentation.h"
#import "DOMElementInternal.h"
+#import "DOMNodeInternal.h"
#import "DOMRangeInternal.h"
#import "WebArchive.h"
#import "WebBasePluginPackage.h"
diff --git a/WebKit/mac/WebView/WebHTMLView.mm b/WebKit/mac/WebView/WebHTMLView.mm
index a60ae12..e40500c 100644
--- a/WebKit/mac/WebView/WebHTMLView.mm
+++ b/WebKit/mac/WebView/WebHTMLView.mm
@@ -353,7 +353,6 @@ static CachedResourceClient* promisedDataClient()
- (DOMDocumentFragment *)_documentFragmentFromPasteboard:(NSPasteboard *)pasteboard inContext:(DOMRange *)context allowPlainText:(BOOL)allowPlainText;
- (NSString *)_plainTextFromPasteboard:(NSPasteboard *)pasteboard;
- (void)_pasteWithPasteboard:(NSPasteboard *)pasteboard allowPlainText:(BOOL)allowPlainText;
-- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard;
- (void)_removeMouseMovedObserverUnconditionally;
- (void)_removeSuperviewObservers;
- (void)_removeWindowObservers;
@@ -874,19 +873,6 @@ static NSURL* uniqueURLWithRelativePart(NSString *relativePart)
[webView release];
}
-- (void)_pasteAsPlainTextWithPasteboard:(NSPasteboard *)pasteboard
-{
- WebView *webView = [[self _webView] retain];
- [webView _setInsertionPasteboard:pasteboard];
-
- NSString *text = [self _plainTextFromPasteboard:pasteboard];
- if ([self _shouldReplaceSelectionWithText:text givenAction:WebViewInsertActionPasted])
- [[self _frame] _replaceSelectionWithText:text selectReplacement:NO smartReplace:[self _canSmartReplaceWithPasteboard:pasteboard]];
-
- [webView _setInsertionPasteboard:nil];
- [webView release];
-}
-
- (void)_removeMouseMovedObserverUnconditionally
{
if (!_private || !_private->observingMouseMovedNotifications)
@@ -2576,6 +2562,7 @@ WEBCORE_COMMAND(pageDown)
WEBCORE_COMMAND(pageDownAndModifySelection)
WEBCORE_COMMAND(pageUp)
WEBCORE_COMMAND(pageUpAndModifySelection)
+WEBCORE_COMMAND(pasteAsPlainText)
WEBCORE_COMMAND(selectAll)
WEBCORE_COMMAND(selectLine)
WEBCORE_COMMAND(selectParagraph)
@@ -2615,18 +2602,6 @@ WEBCORE_COMMAND(yankAndSelect)
return YES;
}
-- (BOOL)readSelectionFromPasteboard:(NSPasteboard *)pasteboard
-{
- Frame* coreFrame = core([self _frame]);
- if (!coreFrame)
- return NO;
- if (coreFrame->selection()->isContentRichlyEditable())
- [self _pasteWithPasteboard:pasteboard allowPlainText:YES];
- else
- [self _pasteAsPlainTextWithPasteboard:pasteboard];
- return YES;
-}
-
- (id)validRequestorForSendType:(NSString *)sendType returnType:(NSString *)returnType
{
BOOL isSendTypeOK = !sendType || ([[self pasteboardTypesForSelection] containsObject:sendType] && [self _hasSelection]);
@@ -5162,15 +5137,6 @@ static BOOL writingDirectionKeyBindingsEnabled()
coreFrame->editor()->pasteAsPlainText();
}
-- (void)pasteAsPlainText:(id)sender
-{
- COMMAND_PROLOGUE
-
- if (![self _canEdit])
- return;
- [self _pasteAsPlainTextWithPasteboard:[NSPasteboard generalPasteboard]];
-}
-
- (void)closeIfNotCurrentView
{
if ([[[self _frame] frameView] documentView] != self)
diff --git a/WebKit/mac/WebView/WebNavigationData.mm b/WebKit/mac/WebView/WebNavigationData.mm
index 290d8b1..753a441 100644
--- a/WebKit/mac/WebView/WebNavigationData.mm
+++ b/WebKit/mac/WebView/WebNavigationData.mm
@@ -55,7 +55,7 @@
@implementation WebNavigationData
-- (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource;
+- (id)initWithURLString:(NSString *)url title:(NSString *)title originalRequest:(NSURLRequest *)request response:(NSURLResponse *)response hasSubstituteData:(BOOL)hasSubstituteData clientRedirectSource:(NSString *)redirectSource
{
_private = [[WebNavigationDataPrivate alloc] init];
diff --git a/WebKit/mac/WebView/WebPDFRepresentation.mm b/WebKit/mac/WebView/WebPDFRepresentation.mm
index 36449f3..44a1362 100644
--- a/WebKit/mac/WebView/WebPDFRepresentation.mm
+++ b/WebKit/mac/WebView/WebPDFRepresentation.mm
@@ -70,15 +70,15 @@
return PDFDocumentClass;
}
-- (void)setDataSource:(WebDataSource *)dataSource;
+- (void)setDataSource:(WebDataSource *)dataSource
{
}
-- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource;
+- (void)receivedData:(NSData *)data withDataSource:(WebDataSource *)dataSource
{
}
-- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource;
+- (void)receivedError:(NSError *)error withDataSource:(WebDataSource *)dataSource
{
}
diff --git a/WebKit/mac/WebView/WebPreferences.mm b/WebKit/mac/WebView/WebPreferences.mm
index 36aef1f..0a192f9 100644
--- a/WebKit/mac/WebView/WebPreferences.mm
+++ b/WebKit/mac/WebView/WebPreferences.mm
@@ -360,6 +360,7 @@ static WebCacheModel cacheModelForMainBundle(void)
[NSNumber numberWithBool:NO], WebKitUsesProxiedOpenPanelPreferenceKey,
[NSNumber numberWithUnsignedInt:4], WebKitPluginAllowedRunTimePreferenceKey,
[NSNumber numberWithBool:NO], WebKitFrameFlatteningEnabledPreferenceKey,
+ [NSNumber numberWithBool:YES], WebKitHTML5ParserEnabledPreferenceKey,
nil];
// This value shouldn't ever change, which is assumed in the initialization of WebKitPDFDisplayModePreferenceKey above
diff --git a/WebKit/mac/WebView/WebResource.mm b/WebKit/mac/WebView/WebResource.mm
index 73c0118..fd02212 100644
--- a/WebKit/mac/WebView/WebResource.mm
+++ b/WebKit/mac/WebView/WebResource.mm
@@ -277,7 +277,7 @@ static NSString * const WebResourceResponseKey = @"WebResourceResponse"
return frameName;
}
-- (id)description
+- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %@>", [self className], [self URL]];
}
diff --git a/WebKit/mac/WebView/WebSerializedJSValue.mm b/WebKit/mac/WebView/WebSerializedJSValue.mm
index af96aa4..05a316b 100644
--- a/WebKit/mac/WebView/WebSerializedJSValue.mm
+++ b/WebKit/mac/WebView/WebSerializedJSValue.mm
@@ -40,7 +40,7 @@ using namespace WebCore;
@implementation WebSerializedJSValue
-- (id)initWithValue:(JSValueRef)value context:(JSContextRef)sourceContext exception:(JSValueRef*)exception;
+- (id)initWithValue:(JSValueRef)value context:(JSContextRef)sourceContext exception:(JSValueRef*)exception
{
ASSERT_ARG(value, value);
ASSERT_ARG(sourceContext, sourceContext);
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.h b/WebKit/mac/WebView/WebVideoFullscreenController.h
index 2e0c4c3..3e7b6cf 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.h
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.h
@@ -48,6 +48,8 @@ namespace WebCore {
BOOL _isEndingFullscreen;
BOOL _isWindowLoaded;
BOOL _forceDisableAnimation;
+ uint32_t _idleDisplaySleepAssertion;
+ uint32_t _idleSystemSleepAssertion;
SystemUIMode _savedUIMode;
SystemUIOptions _savedUIOptions;
}
diff --git a/WebKit/mac/WebView/WebVideoFullscreenController.mm b/WebKit/mac/WebView/WebVideoFullscreenController.mm
index 8cbe0a0..69ded78 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenController.mm
@@ -30,6 +30,7 @@
#import "WebTypesInternal.h"
#import "WebVideoFullscreenHUDWindowController.h"
#import "WebWindowAnimation.h"
+#import <IOKit/pwr_mgt/IOPMLib.h>
#import <QTKit/QTKit.h>
#import <WebCore/HTMLMediaElement.h>
#import <WebCore/SoftLinking.h>
@@ -55,6 +56,13 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
@end
@interface WebVideoFullscreenController(HUDWindowControllerDelegate) <WebVideoFullscreenHUDWindowControllerDelegate>
+- (void)requestExitFullscreenWithAnimation:(BOOL)animation;
+- (void)updateMenuAndDockForFullscreen;
+- (void)updatePowerAssertions;
+@end
+
+@interface NSWindow(IsOnActiveSpaceAdditionForTigerAndLeopard)
+- (BOOL)isOnActiveSpace;
@end
@implementation WebVideoFullscreenController
@@ -98,15 +106,18 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
[window setHasShadow:YES]; // This is nicer with a shadow.
[window setLevel:NSPopUpMenuWindowLevel-1];
[layer release];
+
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidResignActive:) name:NSApplicationDidResignActiveNotification object:NSApp];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidChangeScreenParameters:) name:NSApplicationDidChangeScreenParametersNotification object:NSApp];
#endif
}
-- (WebCore::HTMLMediaElement*)mediaElement;
+- (WebCore::HTMLMediaElement*)mediaElement
{
return _mediaElement.get();
}
-- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement;
+- (void)setMediaElement:(WebCore::HTMLMediaElement*)mediaElement
{
#ifdef BUILDING_ON_TIGER
// WebVideoFullscreenController is not supported on Tiger:
@@ -133,7 +144,7 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
return _delegate;
}
-- (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate;
+- (void)setDelegate:(id <WebVideoFullscreenControllerDelegate>)delegate
{
_delegate = delegate;
}
@@ -153,7 +164,8 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
[self clearFadeAnimation];
[[self window] close];
[self setWindow:nil];
- SetSystemUIMode(_savedUIMode, _savedUIOptions);
+ [self updateMenuAndDockForFullscreen];
+ [self updatePowerAssertions];
[_hudController setDelegate:nil];
[_hudController release];
_hudController = nil;
@@ -173,8 +185,8 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
_hudController = [[WebVideoFullscreenHUDWindowController alloc] init];
[_hudController setDelegate:self];
- GetSystemUIMode(&_savedUIMode, &_savedUIOptions);
- SetSystemUIMode(kUIModeAllSuppressed , 0);
+ [self updateMenuAndDockForFullscreen];
+ [self updatePowerAssertions];
[NSCursor setHiddenUntilMouseMoves:YES];
// Give the HUD keyboard focus initially
@@ -186,6 +198,22 @@ SOFT_LINK_POINTER(QTKit, QTMovieRateDidChangeNotification, NSString *)
return _mediaElement->screenRect();
}
+- (void)applicationDidResignActive:(NSNotification*)notification
+{
+ // Check to see if the fullscreenWindow is on the active space; this function is available
+ // on 10.6 and later, so default to YES if the function is not available:
+ NSWindow* fullscreenWindow = [self fullscreenWindow];
+ BOOL isOnActiveSpace = ([fullscreenWindow respondsToSelector:@selector(isOnActiveSpace)] ? [fullscreenWindow isOnActiveSpace] : YES);
+
+ // Replicate the QuickTime Player (X) behavior when losing active application status:
+ // Is the fullscreen screen the main screen? (Note: this covers the case where only a
+ // single screen is available.) Is the fullscreen screen on the current space? IFF so,
+ // then exit fullscreen mode.
+ if ([fullscreenWindow screen] == [[NSScreen screens] objectAtIndex:0] && isOnActiveSpace)
+ [self requestExitFullscreenWithAnimation:NO];
+}
+
+
#pragma mark -
#pragma mark Exposed Interface
@@ -229,7 +257,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
_fadeAnimation = [[WebWindowFadeAnimation alloc] initWithDuration:0.2 window:_backgroundFullscreenWindow initialAlpha:initialAlpha finalAlpha:fadeIn ? 1 : 0];
}
-- (void)enterFullscreen:(NSScreen *)screen;
+- (void)enterFullscreen:(NSScreen *)screen
{
if (!screen)
screen = [NSScreen mainScreen];
@@ -277,6 +305,98 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
[[self fullscreenWindow] animateFromRect:[[self window] frame] toRect:endFrame withSubAnimation:_fadeAnimation controllerAction:@selector(windowDidExitFullscreen)];
}
+- (void)applicationDidChangeScreenParameters:(NSNotification*)notification
+{
+ // The user may have changed the main screen by moving the menu bar, or they may have changed
+ // the Dock's size or location, or they may have changed the fullscreen screen's dimensions.
+ // Update our presentation parameters, and ensure that the full screen window occupies the
+ // entire screen:
+ [self updateMenuAndDockForFullscreen];
+ [[self window] setFrame:[[[self window] screen] frame] display:YES];
+}
+
+- (void)updateMenuAndDockForFullscreen
+{
+ // NSApplicationPresentationOptions is available on > 10.6 only:
+#if !defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD)
+ NSApplicationPresentationOptions options = NSApplicationPresentationDefault;
+ NSScreen* fullscreenScreen = [[self window] screen];
+
+ if (!_isEndingFullscreen) {
+ // Auto-hide the menu bar if the fullscreenScreen contains the menu bar:
+ // NOTE: if the fullscreenScreen contains the menu bar but not the dock, we must still
+ // auto-hide the dock, or an exception will be thrown.
+ if ([[NSScreen screens] objectAtIndex:0] == fullscreenScreen)
+ options |= (NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock);
+ // Check if the current screen contains the dock by comparing the screen's frame to its
+ // visibleFrame; if a dock is present, the visibleFrame will differ. If the current screen
+ // contains the dock, hide it.
+ else if (!NSEqualRects([fullscreenScreen frame], [fullscreenScreen visibleFrame]))
+ options |= NSApplicationPresentationAutoHideDock;
+ }
+
+ if ([NSApp respondsToSelector:@selector(setPresentationOptions:)])
+ [NSApp setPresentationOptions:options];
+ else
+#endif
+ SetSystemUIMode(_isEndingFullscreen ? kUIModeNormal : kUIModeAllHidden, 0);
+}
+
+#if !defined(BUILDING_ON_TIGER) // IOPMAssertionCreateWithName not defined on < 10.5
+- (void)_disableIdleDisplaySleep
+{
+ if (_idleDisplaySleepAssertion == kIOPMNullAssertionID)
+#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK
+ IOPMAssertionCreate(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, &_idleDisplaySleepAssertion);
+#else // IOPMAssertionCreate is depreciated in > 10.5
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullscreen."), &_idleDisplaySleepAssertion);
+#endif
+}
+
+- (void)_enableIdleDisplaySleep
+{
+ if (_idleDisplaySleepAssertion != kIOPMNullAssertionID) {
+ IOPMAssertionRelease(_idleDisplaySleepAssertion);
+ _idleDisplaySleepAssertion = kIOPMNullAssertionID;
+ }
+}
+
+- (void)_disableIdleSystemSleep
+{
+ if (_idleSystemSleepAssertion == kIOPMNullAssertionID)
+#if defined(BUILDING_ON_LEOPARD) // IOPMAssertionCreateWithName is not defined in the 10.5 SDK
+ IOPMAssertionCreate(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, &_idleSystemSleepAssertion);
+#else // IOPMAssertionCreate is depreciated in > 10.5
+ IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR("WebKit playing a video fullscreen."), &_idleSystemSleepAssertion);
+#endif
+}
+
+- (void)_enableIdleSystemSleep
+{
+ if (_idleSystemSleepAssertion != kIOPMNullAssertionID) {
+ IOPMAssertionRelease(_idleSystemSleepAssertion);
+ _idleSystemSleepAssertion = kIOPMNullAssertionID;
+ }
+}
+#endif
+
+- (void)updatePowerAssertions
+{
+#if !defined(BUILDING_ON_TIGER)
+ float rate = 0;
+ if (_mediaElement && _mediaElement->platformMedia().type == WebCore::PlatformMedia::QTMovieType)
+ rate = [_mediaElement->platformMedia().media.qtMovie rate];
+
+ if (rate && !_isEndingFullscreen) {
+ [self _disableIdleSystemSleep];
+ [self _disableIdleDisplaySleep];
+ } else {
+ [self _enableIdleSystemSleep];
+ [self _enableIdleDisplaySleep];
+ }
+#endif
+}
+
#pragma mark -
#pragma mark Window callback
@@ -314,6 +434,7 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
{
UNUSED_PARAM(unusedNotification);
[_hudController updateRate];
+ [self updatePowerAssertions];
}
@end
@@ -453,12 +574,6 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
[[self windowController] fadeHUDIn];
}
-- (void)resignKeyWindow
-{
- [super resignKeyWindow];
- [[self windowController] requestExitFullscreenWithAnimation:NO];
-}
-
@end
#endif /* ENABLE(VIDEO) */
diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm
index 0023509..631dd63 100644
--- a/WebKit/mac/WebView/WebView.mm
+++ b/WebKit/mac/WebView/WebView.mm
@@ -86,6 +86,7 @@
#import "WebPDFView.h"
#import "WebPanelAuthenticationHandler.h"
#import "WebPasteboardHelper.h"
+#import "WebPlatformStrategies.h"
#import "WebPluginDatabase.h"
#import "WebPluginHalterClient.h"
#import "WebPolicyDelegate.h"
@@ -103,13 +104,13 @@
#import <Foundation/NSURLConnection.h>
#import <JavaScriptCore/APICast.h>
#import <JavaScriptCore/JSValueRef.h>
+#import <WebCore/AbstractDatabase.h>
#import <WebCore/ApplicationCacheStorage.h>
#import <WebCore/BackForwardList.h>
#import <WebCore/Cache.h>
#import <WebCore/ColorMac.h>
#import <WebCore/CSSComputedStyleDeclaration.h>
#import <WebCore/Cursor.h>
-#import <WebCore/Database.h>
#import <WebCore/Document.h>
#import <WebCore/DocumentLoader.h>
#import <WebCore/DragController.h>
@@ -190,6 +191,7 @@
@interface NSWindow (WebNSWindowDetails)
- (id)_oldFirstResponderBeforeBecoming;
- (void)_enableScreenUpdatesIfNeeded;
+- (BOOL)_wrapsCarbonWindow;
@end
using namespace WebCore;
@@ -654,6 +656,10 @@ static bool shouldEnableLoadDeferring()
#endif
WebKitInitializeApplicationCachePathIfNecessary();
patchMailRemoveAttributesMethod();
+
+ // Initialize our platform strategies.
+ WebPlatformStrategies::initialize();
+
didOneTimeInitialization = true;
}
@@ -1356,7 +1362,7 @@ static bool fastDocumentTeardownEnabled()
settings->setMinimumLogicalFontSize([preferences minimumLogicalFontSize]);
settings->setPluginsEnabled([preferences arePlugInsEnabled]);
#if ENABLE(DATABASE)
- Database::setIsAvailable([preferences databasesEnabled]);
+ AbstractDatabase::setIsAvailable([preferences databasesEnabled]);
#endif
settings->setLocalStorageEnabled([preferences localStorageEnabled]);
settings->setExperimentalNotificationsEnabled([preferences experimentalNotificationsEnabled]);
@@ -4209,7 +4215,7 @@ static WebFrame *incrementFrame(WebFrame *frame, BOOL forward, BOOL wrapFlag)
Frame* coreFrame = [self _mainCoreFrame];
if (!coreFrame)
return YES;
- return coreFrame->shouldClose();
+ return coreFrame->loader()->shouldClose();
}
static NSAppleEventDescriptor* aeDescFromJSValue(ExecState* exec, JSValue jsValue)
@@ -5389,7 +5395,7 @@ static WebFrameView *containingFrameView(NSView *view)
NSDictionary *element = [sender representedObject];
ASSERT([element isKindOfClass:[NSDictionary class]]);
- WebDataSource *dataSource = [[element objectForKey:WebElementFrameKey] dataSource];
+ WebDataSource *dataSource = [(WebFrame *)[element objectForKey:WebElementFrameKey] dataSource];
NSURLRequest *request = [[dataSource request] copy];
ASSERT(request);
@@ -5669,7 +5675,15 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
// An NSWindow may not display in the next runloop cycle after dirtying due to delayed window display logic,
// in which case this observer can fire first. So if the window is due for a display, don't commit
// layer changes, otherwise they'll show on screen before the view drawing.
- if ([window viewsNeedDisplay])
+ bool viewsNeedDisplay;
+#ifndef __LP64__
+ if (window && [window _wrapsCarbonWindow])
+ viewsNeedDisplay = HIViewGetNeedsDisplay(HIViewGetRoot(static_cast<WindowRef>([window windowRef])));
+ else
+#endif
+ viewsNeedDisplay = [window viewsNeedDisplay];
+
+ if (viewsNeedDisplay)
return;
if ([webView _syncCompositingChanges]) {
@@ -5766,7 +5780,7 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
return nil;
}
-- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position;
+- (void)_geolocationDidChangePosition:(WebGeolocationPosition *)position
{
#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (_private && _private->page)
diff --git a/WebKit/qt/Api/DerivedSources.pro b/WebKit/qt/Api/DerivedSources.pro
index 22d4c8d..62546f6 100644
--- a/WebKit/qt/Api/DerivedSources.pro
+++ b/WebKit/qt/Api/DerivedSources.pro
@@ -12,7 +12,7 @@ DOUBLE_ESCAPED_QUOTE = ""
ESCAPE = ""
win32-msvc*|symbian {
ESCAPE = "^"
-} else:win32-g++:isEmpty(QMAKE_SH) {
+} else:win32-g++*:isEmpty(QMAKE_SH) {
# MinGW's make will run makefile commands using sh, even if make
# was run from the Windows shell, if it finds sh in the path.
ESCAPE = "^"
diff --git a/WebKit/qt/Api/headers.pri b/WebKit/qt/Api/headers.pri
index 29bb125..e9fe28d 100644
--- a/WebKit/qt/Api/headers.pri
+++ b/WebKit/qt/Api/headers.pri
@@ -12,4 +12,5 @@ WEBKIT_API_HEADERS = $$PWD/qwebframe.h \
$$PWD/qwebpluginfactory.h \
$$PWD/qwebhistory.h \
$$PWD/qwebinspector.h \
- $$PWD/qwebkitversion.h
+ $$PWD/qwebkitversion.h \
+ $$PWD/qwebscriptworld.h
diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index 178f5c2..8361970 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -122,7 +122,7 @@ void QGraphicsWebViewPrivate::_q_pageDestroyed()
void QGraphicsWebViewPrivate::updateResizesToContentsForPage()
{
ASSERT(page);
-
+ static_cast<PageClientQGraphicsWidget*>(page->d->client)->viewResizesToContents = resizesToContents;
if (resizesToContents) {
// resizes to contents mode requires preferred contents size to be set
if (!page->preferredContentsSize().isValid())
@@ -821,10 +821,8 @@ void QGraphicsWebView::setResizesToContents(bool enabled)
if (d->resizesToContents == enabled)
return;
d->resizesToContents = enabled;
- if (d->page) {
- static_cast<PageClientQGraphicsWidget*>(d->page->d->client)->viewResizesToContents = enabled;
+ if (d->page)
d->updateResizesToContentsForPage();
- }
}
bool QGraphicsWebView::resizesToContents() const
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 3eba058..c42cfa3 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -71,6 +71,8 @@
#include "qwebpage_p.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
+#include "qwebscriptworld.h"
+#include "qwebscriptworld_p.h"
#include "runtime_object.h"
#include "runtime_root.h"
#include "wtf/HashMap.h"
@@ -1272,8 +1274,8 @@ void QWebFrame::print(QPrinter *printer) const
if (!painter.begin(printer))
return;
- const qreal zoomFactorX = printer->logicalDpiX() / qt_defaultDpi();
- const qreal zoomFactorY = printer->logicalDpiY() / qt_defaultDpi();
+ const qreal zoomFactorX = (qreal)printer->logicalDpiX() / qt_defaultDpi();
+ const qreal zoomFactorY = (qreal)printer->logicalDpiY() / qt_defaultDpi();
PrintContext printContext(d->frame);
float pageHeight = 0;
@@ -1376,6 +1378,22 @@ QVariant QWebFrame::evaluateJavaScript(const QString& scriptSource)
return rc;
}
+QVariant QWebFrame::evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource)
+{
+ ScriptController *proxy = d->frame->script();
+ QVariant rc;
+
+ if (proxy) {
+ JSC::JSValue v = proxy->executeScriptInWorld(scriptWorld->world(), scriptSource, true).jsValue();
+ if (!d->frame) // In case the script removed our frame from the page.
+ return QString();
+ int distance = 0;
+ rc = JSC::Bindings::convertValueToQVariant(proxy->globalObject(mainThreadNormalWorld())->globalExec(), v, QMetaType::Void, &distance);
+ }
+ return rc;
+}
+
+
/*!
\since 4.5
diff --git a/WebKit/qt/Api/qwebframe.h b/WebKit/qt/Api/qwebframe.h
index ecd31de..5f3dbd4 100644
--- a/WebKit/qt/Api/qwebframe.h
+++ b/WebKit/qt/Api/qwebframe.h
@@ -49,6 +49,7 @@ class QWebHistoryItem;
class QWebSecurityOrigin;
class QWebElement;
class QWebElementCollection;
+class QWebScriptWorld;
class DumpRenderTreeSupportQt;
namespace WebCore {
@@ -199,6 +200,7 @@ public:
public Q_SLOTS:
QVariant evaluateJavaScript(const QString& scriptSource);
+ QVariant evaluateScriptInIsolatedWorld(QWebScriptWorld* scriptWorld, const QString& scriptSource);
#ifndef QT_NO_PRINTER
void print(QPrinter *printer) const;
#endif
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index fcc37e7..62bd59e 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -71,6 +71,7 @@ public:
, allowsScrolling(true)
, marginWidth(-1)
, marginHeight(-1)
+ , initialLayoutComplete(false)
{}
void init(QWebFrame* qframe, QWebFrameData* frameData);
void setPage(QWebPage*);
@@ -98,6 +99,7 @@ public:
bool allowsScrolling;
int marginWidth;
int marginHeight;
+ bool initialLayoutComplete;
};
class QWebHitTestResultPrivate {
diff --git a/WebKit/qt/Api/qwebhistory.cpp b/WebKit/qt/Api/qwebhistory.cpp
index 0147f92..a6f3d0c 100644
--- a/WebKit/qt/Api/qwebhistory.cpp
+++ b/WebKit/qt/Api/qwebhistory.cpp
@@ -363,9 +363,8 @@ bool QWebHistory::canGoForward() const
void QWebHistory::back()
{
if (canGoBack()) {
- d->lst->goBack();
WebCore::Page* page = d->lst->page();
- page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ page->goToItem(d->lst->backItem(), WebCore::FrameLoadTypeIndexedBackForward);
}
}
@@ -378,9 +377,8 @@ void QWebHistory::back()
void QWebHistory::forward()
{
if (canGoForward()) {
- d->lst->goForward();
WebCore::Page* page = d->lst->page();
- page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ page->goToItem(d->lst->forwardItem(), WebCore::FrameLoadTypeIndexedBackForward);
}
}
@@ -391,9 +389,8 @@ void QWebHistory::forward()
*/
void QWebHistory::goToItem(const QWebHistoryItem &item)
{
- d->lst->goToItem(item.d->item);
WebCore::Page* page = d->lst->page();
- page->goToItem(currentItem().d->item, WebCore::FrameLoadTypeIndexedBackForward);
+ page->goToItem(item.d->item, WebCore::FrameLoadTypeIndexedBackForward);
}
/*!
diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h
index bac618c..32d22d4 100644
--- a/WebKit/qt/Api/qwebkitplatformplugin.h
+++ b/WebKit/qt/Api/qwebkitplatformplugin.h
@@ -31,7 +31,7 @@
class QWebSelectData
{
public:
- inline ~QWebSelectData() {}
+ virtual ~QWebSelectData() {}
enum ItemType { Option, Group, Separator };
@@ -48,7 +48,7 @@ class QWebSelectMethod : public QObject
{
Q_OBJECT
public:
- inline ~QWebSelectMethod() {}
+ virtual ~QWebSelectMethod() {}
virtual void show(const QWebSelectData&) = 0;
virtual void hide() = 0;
@@ -61,6 +61,8 @@ Q_SIGNALS:
class QWebNotificationData
{
public:
+ virtual ~QWebNotificationData() {}
+
virtual const QString title() const = 0;
virtual const QString message() const = 0;
virtual const QByteArray iconData() const = 0;
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index d49ac14..eab909c 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -593,7 +593,7 @@ void QWebPagePrivate::timerEvent(QTimerEvent *ev)
if (timerId == tripleClickTimer.timerId())
tripleClickTimer.stop();
else
- q->QObject::timerEvent(ev);
+ q->timerEvent(ev);
}
void QWebPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
@@ -1207,6 +1207,14 @@ void QWebPagePrivate::inputMethodEvent(QInputMethodEvent *ev)
}
#ifndef QT_NO_PROPERTIES
+typedef struct {
+ const char* name;
+ double deferredRepaintDelay;
+ double initialDeferredRepaintDelayDuringLoading;
+ double maxDeferredRepaintDelayDuringLoading;
+ double deferredRepaintDelayIncrementDuringLoading;
+} QRepaintThrottlingPreset;
+
void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* event)
{
if (event->propertyName() == "_q_viewMode") {
@@ -1224,7 +1232,42 @@ void QWebPagePrivate::dynamicPropertyChangeEvent(QDynamicPropertyChangeEvent* ev
} else if (event->propertyName() == "_q_HTMLTokenizerTimeDelay") {
double timeDelay = q->property("_q_HTMLTokenizerTimeDelay").toDouble();
q->handle()->page->setCustomHTMLTokenizerTimeDelay(timeDelay);
- }
+ } else if (event->propertyName() == "_q_RepaintThrottlingDeferredRepaintDelay") {
+ double p = q->property("_q_RepaintThrottlingDeferredRepaintDelay").toDouble();
+ FrameView::setRepaintThrottlingDeferredRepaintDelay(p);
+ } else if (event->propertyName() == "_q_RepaintThrottlingnInitialDeferredRepaintDelayDuringLoading") {
+ double p = q->property("_q_RepaintThrottlingnInitialDeferredRepaintDelayDuringLoading").toDouble();
+ FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(p);
+ } else if (event->propertyName() == "_q_RepaintThrottlingMaxDeferredRepaintDelayDuringLoading") {
+ double p = q->property("_q_RepaintThrottlingMaxDeferredRepaintDelayDuringLoading").toDouble();
+ FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(p);
+ } else if (event->propertyName() == "_q_RepaintThrottlingDeferredRepaintDelayIncrementDuringLoading") {
+ double p = q->property("_q_RepaintThrottlingDeferredRepaintDelayIncrementDuringLoading").toDouble();
+ FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(p);
+ } else if (event->propertyName() == "_q_RepaintThrottlingPreset") {
+ static const QRepaintThrottlingPreset presets[] = {
+ { "NoThrottling", 0, 0, 0, 0 },
+ { "Legacy", 0.025, 0, 2.5, 0.5 },
+ { "Minimal", 0.01, 0, 1, 0.2 },
+ { "Medium", 0.025, 1, 5, 0.5 },
+ { "Heavy", 0.1, 2, 10, 1 }
+ };
+
+ QString p = q->property("_q_RepaintThrottlingPreset").toString();
+ for(int i = 0; i < sizeof(presets) / sizeof(presets[0]); i++) {
+ if(p == presets[i].name) {
+ FrameView::setRepaintThrottlingDeferredRepaintDelay(
+ presets[i].deferredRepaintDelay);
+ FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(
+ presets[i].initialDeferredRepaintDelayDuringLoading);
+ FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(
+ presets[i].maxDeferredRepaintDelayDuringLoading);
+ FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(
+ presets[i].deferredRepaintDelayIncrementDuringLoading);
+ break;
+ }
+ }
+ }
#if ENABLE(TILED_BACKING_STORE)
else if (event->propertyName() == "_q_TiledBackingStoreTileSize") {
WebCore::Frame* frame = QWebFramePrivate::core(q->mainFrame());
@@ -1655,6 +1698,109 @@ InspectorController* QWebPagePrivate::inspectorController()
\value WebModalDialog The window acts as modal dialog.
*/
+
+/*!
+ \class QWebPage::ViewportHints
+ \since 4.7
+ \brief The QWebPage::ViewportHints class describes hints that can be applied to a viewport.
+
+ QWebPage::ViewportHints provides a description of a viewport, such as viewport geometry,
+ initial scale factor with limits, plus information about whether a user should be able
+ to scale the contents in the viewport or not, ie. by zooming.
+
+ ViewportHints can be set by a web author using the viewport meta tag extension, documented
+ at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}.
+
+ All values might not be set, as such when dealing with the hints, the developer needs to
+ check whether the values are valid. Negative values denote an invalid qreal value.
+
+ \inmodule QtWebKit
+*/
+
+/*!
+ Constructs an empty QWebPage::ViewportHints.
+*/
+QWebPage::ViewportHints::ViewportHints()
+ : d(0)
+ , m_initialScaleFactor(-1.0)
+ , m_minimumScaleFactor(-1.0)
+ , m_maximumScaleFactor(-1.0)
+ , m_isUserScalable(true)
+ , m_isValid(false)
+{
+
+}
+
+/*!
+ Constructs a QWebPage::ViewportHints which is a copy from \a other .
+*/
+QWebPage::ViewportHints::ViewportHints(const QWebPage::ViewportHints& other)
+ : d(other.d)
+ , m_initialScaleFactor(other.m_initialScaleFactor)
+ , m_minimumScaleFactor(other.m_minimumScaleFactor)
+ , m_maximumScaleFactor(other.m_maximumScaleFactor)
+ , m_isUserScalable(other.m_isUserScalable)
+ , m_isValid(other.m_isValid)
+ , m_size(other.m_size)
+{
+
+}
+
+/*!
+ Destroys the QWebPage::ViewportHints.
+*/
+QWebPage::ViewportHints::~ViewportHints()
+{
+
+}
+
+/*!
+ Assigns the given QWebPage::ViewportHints to this viewport hints and returns a
+ reference to this.
+*/
+QWebPage::ViewportHints& QWebPage::ViewportHints::operator=(const QWebPage::ViewportHints& other)
+{
+ if (this != &other) {
+ d = other.d;
+ m_initialScaleFactor = other.m_initialScaleFactor;
+ m_minimumScaleFactor = other.m_minimumScaleFactor;
+ m_maximumScaleFactor = other.m_maximumScaleFactor;
+ m_isUserScalable = other.m_isUserScalable;
+ m_isValid = other.m_isValid;
+ m_size = other.m_size;
+ }
+
+ return *this;
+}
+
+/*! \fn inline bool QWebPage::ViewportHints::isValid() const
+ Returns whether this is a valid ViewportHints or not.
+
+ An invalid ViewportHints will have an empty QSize, negative values for scale factors and
+ true for the boolean isUserScalable.
+*/
+
+/*! \fn inline QSize QWebPage::ViewportHints::size() const
+ Returns the size of the viewport.
+*/
+
+/*! \fn inline qreal QWebPage::ViewportHints::initialScaleFactor() const
+ Returns the initial scale of the viewport as a multiplier.
+*/
+
+/*! \fn inline qreal QWebPage::ViewportHints::minimumScaleFactor() const
+ Returns the minimum scale value of the viewport as a multiplier.
+*/
+
+/*! \fn inline qreal QWebPage::ViewportHints::maximumScaleFactor() const
+ Returns the maximum scale value of the viewport as a multiplier.
+*/
+
+/*! \fn inline bool QWebPage::ViewportHints::isUserScalable() const
+ Determines whether or not the scale can be modified by the user.
+*/
+
+
/*!
\class QWebPage
\since 4.4
@@ -1852,9 +1998,14 @@ QWidget *QWebPage::view() const
*/
void QWebPage::javaScriptConsoleMessage(const QString& message, int lineNumber, const QString& sourceID)
{
- Q_UNUSED(message)
- Q_UNUSED(lineNumber)
Q_UNUSED(sourceID)
+
+ // Catch plugin logDestroy message for LayoutTests/plugins/open-and-close-window-with-plugin.html
+ // At this point DRT's WebPage has already been destroyed
+ if (QWebPagePrivate::drtRun) {
+ if (message == "PLUGIN: NPP_Destroy")
+ fprintf (stdout, "CONSOLE MESSAGE: line %d: %s\n", lineNumber, message.toUtf8().constData());
+ }
}
/*!
@@ -2184,30 +2335,42 @@ QSize QWebPage::preferredContentsSize() const
/*!
\property QWebPage::preferredContentsSize
\since 4.6
- \brief the preferred size of the contents
+ \brief a custom size used for laying out the page contents.
+
+ By default all pages are laid out using the viewport of the page as the base.
+
+ As pages mostly are designed for desktop usage, they often do not layout properly
+ on small devices as the contents require a certain view width. For this reason
+ it is common to use a different layout size and then scale the contents to fit
+ within the actual view.
- If this property is set to a valid size, it is used to lay out the page.
- If it is not set (the default), the viewport size is used instead.
+ If this property is set to a valid size, this size is used for all layout needs
+ instead of the size of the viewport.
+
+ Setting an invalid size, makes the page fall back to using the viewport size for layout.
\sa viewportSize
*/
-void QWebPage::setPreferredContentsSize(const QSize &size) const
+void QWebPage::setPreferredContentsSize(const QSize& size) const
{
+ // FIXME: Rename this method to setCustomLayoutSize
+
d->fixedLayoutSize = size;
- QWebFrame *frame = mainFrame();
- if (frame->d->frame && frame->d->frame->view()) {
- WebCore::FrameView* view = frame->d->frame->view();
+ QWebFrame* frame = mainFrame();
+ if (!frame->d->frame || !frame->d->frame->view())
+ return;
- if (size.isValid()) {
- view->setUseFixedLayout(true);
- view->setFixedLayoutSize(size);
- view->layout();
- } else if (view->useFixedLayout()) {
- view->setUseFixedLayout(false);
- view->layout();
- }
- }
+ WebCore::FrameView* view = frame->d->frame->view();
+
+ if (size.isValid()) {
+ view->setUseFixedLayout(true);
+ view->setFixedLayoutSize(size);
+ } else if (view->useFixedLayout())
+ view->setUseFixedLayout(false);
+
+ if (frame->d->initialLayoutComplete)
+ view->layout();
}
/*!
@@ -3538,6 +3701,29 @@ quint64 QWebPage::bytesReceived() const
}
/*!
+ \since 4.7
+ \fn void QWebPage::viewportChangeRequested(const QWebPage::ViewportHints& hints)
+
+ This signal is emitted before any layout of the contents, giving you the viewport \a arguments
+ the web page would like you to use when laying out its contents, including elements fixed to the
+ viewport. This viewport might be larger that your actual viewport, meaning that a initialScaleFactor
+ should be applied. When no scale is given, it is assumed that the contents should be scaled
+ such that the width of the scaled contents fits within the actual viewport.
+
+ The minimum and maximum allowed scale represents the min and max values that the page
+ allows for scaling, and thus, affects the ability to zoom in on the page.
+
+ Invalid values are supplied for the values not explicitly set by the web author; thus an
+ invalid viewport size, and negative values for scale factor and limits. The boolean
+ ViewportHints::isUserScalable is set to true.
+
+ Page authors can provide the supplied values by using the viewport meta tag. More information
+ about this can be found at \l{http://developer.apple.com/safari/library/documentation/appleapplications/reference/safariwebcontent/usingtheviewport/usingtheviewport.html}{Safari Reference Library: Using the Viewport Meta Tag}.
+
+ \sa QWebPage::ViewportHints, setPreferredContentsSize(), QGraphicsWebView::setScale()
+*/
+
+/*!
\fn void QWebPage::loadStarted()
This signal is emitted when a new load of the page is started.
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index 721f4a8..fcaa302 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -42,12 +42,13 @@ class QWebFrame;
class QWebNetworkRequest;
class QWebHistory;
-class QWebPagePrivate;
class QWebFrameData;
+class QWebHistoryItem;
+class QWebHitTestResult;
class QWebNetworkInterface;
+class QWebPagePrivate;
class QWebPluginFactory;
-class QWebHitTestResult;
-class QWebHistoryItem;
+class QtViewportHintsPrivate;
namespace WebCore {
class ChromeClientQt;
@@ -194,6 +195,35 @@ public:
WebModalDialog
};
+ class ViewportHints {
+ public:
+ ViewportHints();
+ ViewportHints(const QWebPage::ViewportHints& other);
+
+ ~ViewportHints();
+
+ QWebPage::ViewportHints& operator=(const QWebPage::ViewportHints& other);
+
+ inline qreal initialScaleFactor() const { return m_initialScaleFactor; };
+ inline qreal minimumScaleFactor() const { return m_minimumScaleFactor; };
+ inline qreal maximumScaleFactor() const { return m_maximumScaleFactor; };
+ inline bool isUserScalable() const { return m_isUserScalable; };
+ inline bool isValid() const { return m_isValid; };
+ inline QSize size() const { return m_size; };
+
+ private:
+ QSharedDataPointer<QtViewportHintsPrivate> d;
+ qreal m_initialScaleFactor;
+ qreal m_minimumScaleFactor;
+ qreal m_maximumScaleFactor;
+ bool m_isUserScalable;
+ bool m_isValid;
+ QSize m_size;
+
+ friend class WebCore::ChromeClientQt;
+ };
+
+
explicit QWebPage(QObject *parent = 0);
~QWebPage();
@@ -339,6 +369,8 @@ Q_SIGNALS:
void saveFrameStateRequested(QWebFrame* frame, QWebHistoryItem* item);
void restoreFrameStateRequested(QWebFrame* frame);
+ void viewportChangeRequested(const QWebPage::ViewportHints& hints);
+
protected:
virtual QWebPage *createWindow(WebWindowType type);
virtual QObject *createPlugin(const QString &classid, const QUrl &url, const QStringList &paramNames, const QStringList &paramValues);
diff --git a/WebKit/qt/Api/qwebpage_p.h b/WebKit/qt/Api/qwebpage_p.h
index 272f96b..54a1523 100644
--- a/WebKit/qt/Api/qwebpage_p.h
+++ b/WebKit/qt/Api/qwebpage_p.h
@@ -58,6 +58,15 @@ QT_END_NAMESPACE
class QWebInspector;
class QWebPageClient;
+class QtViewportHintsPrivate : public QSharedData {
+public:
+ QtViewportHintsPrivate(QWebPage::ViewportHints* qq)
+ : q(qq)
+ { }
+
+ QWebPage::ViewportHints* q;
+};
+
class QWebPagePrivate {
public:
QWebPagePrivate(QWebPage*);
diff --git a/WebKit/qt/Api/qwebscriptworld.cpp b/WebKit/qt/Api/qwebscriptworld.cpp
new file mode 100644
index 0000000..5d912cc
--- /dev/null
+++ b/WebKit/qt/Api/qwebscriptworld.cpp
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+
+ 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 "qwebscriptworld.h"
+#include "qwebscriptworld_p.h"
+
+#include "KURL.h"
+#include "ScriptController.h"
+#include <QStringList>
+
+using namespace WebCore;
+
+/*!
+ Constructs a security origin from \a other.
+*/
+QWebScriptWorld::QWebScriptWorld()
+{
+ d = new QWebScriptWorldPrivate(ScriptController::createWorld());
+}
+
+DOMWrapperWorld* QWebScriptWorld::world() const
+{
+ return d->world.get();
+}
+
+/*!
+ Destroys the security origin.
+*/
+QWebScriptWorld::~QWebScriptWorld()
+{
+}
+
diff --git a/WebKit/qt/Api/qwebscriptworld.h b/WebKit/qt/Api/qwebscriptworld.h
new file mode 100644
index 0000000..6e728ab
--- /dev/null
+++ b/WebKit/qt/Api/qwebscriptworld.h
@@ -0,0 +1,48 @@
+/*
+ Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+
+ 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 QWebScriptWorld_h_
+#define QWebScriptWorld_h_
+
+#include <QtCore/qurl.h>
+#include <QtCore/qshareddata.h>
+
+#include "qwebkitglobal.h"
+
+namespace WebCore {
+ class DOMWrapperWorld;
+}
+
+class QWebScriptWorldPrivate;
+class QWebFrame;
+
+class QWEBKIT_EXPORT QWebScriptWorld {
+public:
+ QWebScriptWorld();
+ ~QWebScriptWorld();
+
+ WebCore::DOMWrapperWorld* world() const;
+
+private:
+ QExplicitlySharedDataPointer<QWebScriptWorldPrivate> d;
+
+ friend class QWebFrame;
+};
+
+#endif
diff --git a/WebKit/qt/Api/qwebscriptworld_p.h b/WebKit/qt/Api/qwebscriptworld_p.h
new file mode 100644
index 0000000..7115eb2
--- /dev/null
+++ b/WebKit/qt/Api/qwebscriptworld_p.h
@@ -0,0 +1,44 @@
+/*
+ Copyright (C) 2010 Robert Hogan <robert@roberthogan.net>
+
+ 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 _QWEBSCRIPTWORLD_P_H_
+#define _QWEBSCRIPTWORLD_P_H_
+
+#include "RefPtr.h"
+
+namespace WebCore {
+ class DOMWrapperWorld;
+}
+
+class QWebScriptWorldPrivate : public QSharedData {
+public:
+ QWebScriptWorldPrivate(WTF::PassRefPtr<WebCore::DOMWrapperWorld> o)
+ {
+ Q_ASSERT(o);
+ world = o;
+ }
+
+ ~QWebScriptWorldPrivate()
+ {
+ }
+
+ WTF::RefPtr<WebCore::DOMWrapperWorld> world;
+};
+
+#endif
diff --git a/WebKit/qt/Api/qwebsettings.cpp b/WebKit/qt/Api/qwebsettings.cpp
index 4881bac..b2766a7 100644
--- a/WebKit/qt/Api/qwebsettings.cpp
+++ b/WebKit/qt/Api/qwebsettings.cpp
@@ -24,9 +24,9 @@
#include "qwebpage_p.h"
#include "qwebplugindatabase_p.h"
+#include "AbstractDatabase.h"
#include "Cache.h"
#include "CrossOriginPreflightResultCache.h"
-#include "Database.h"
#include "FontCache.h"
#include "Page.h"
#include "PageCache.h"
@@ -217,7 +217,7 @@ void QWebSettingsPrivate::apply()
#if ENABLE(DATABASE)
value = attributes.value(QWebSettings::OfflineStorageDatabaseEnabled,
global->attributes.value(QWebSettings::OfflineStorageDatabaseEnabled));
- WebCore::Database::setIsAvailable(value);
+ WebCore::AbstractDatabase::setIsAvailable(value);
#endif
value = attributes.value(QWebSettings::OfflineWebApplicationCacheEnabled,
diff --git a/WebKit/qt/Api/qwebsettings.h b/WebKit/qt/Api/qwebsettings.h
index c063bcd..38a2b3f 100644
--- a/WebKit/qt/Api/qwebsettings.h
+++ b/WebKit/qt/Api/qwebsettings.h
@@ -74,8 +74,8 @@ public:
LocalContentCanAccessFileUrls,
TiledBackingStoreEnabled,
FrameFlatteningEnabled,
- WebGLEnabled,
- SiteSpecificQuirksEnabled
+ SiteSpecificQuirksEnabled,
+ WebGLEnabled
};
enum WebGraphic {
MissingImageGraphic,
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f83d64d..2e565ae 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,632 @@
+2010-06-24 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Symbian build fix.
+
+ The QML WebKit integration needs to be part of QtWebKit.sis
+
+ * declarative/declarative.pro: Removed non-working deployment.
+
+2010-06-23 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed, Symbian build fix.
+
+ [Qt] Update the def file after r61478.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-06-23 David Boddie <dboddie@trolltech.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Doc: Fixed documentation errors.
+
+ * docs/qtwebkit-bridge.qdoc:
+
+2010-06-23 Alessandro Portale <alessandro.portale@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Provide the Webkit Qml plugin with a UID3 on Symbian
+
+ ...otherwise we cannot Symbian sign it.
+
+ * declarative/declarative.pro:
+
+2010-06-23 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Qt package build fix.
+
+ When building without build-webkit, set OUTPUT_DIR if necessary, like
+ in the other .pro files.
+
+ * declarative/declarative.pro:
+
+2010-06-22 Tasuku Suzuki <tasuku.suzuki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix compilation with QT_NO_COMBOBOX.
+
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::createSelectPopup):
+
+2010-06-21 Robert Hogan <robert@webkit.org>
+
+ [Qt] Build fix for Qt on Windows MSVC2008
+
+ Unreviewed, build fix.
+
+ Fix by Jocelyn Turcotte.
+
+ * Api/qwebframe.cpp:
+
+2010-06-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Reviewed by nobody, build fix.
+
+ [Qt] Fix MSVC build.
+
+ The max macro was replacing the max function used in StringImpl.h
+ when compiling moc_NotificationPresenterClientQt.cpp.
+
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+
+2010-06-21 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed, Symbian build fix.
+
+ [Qt] Update the def file with recent new exports.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-06-21 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed build fix.
+
+ [Qt] Fix package builds
+
+ Don't use rpath unless we're building inside the trunk.
+
+ * declarative/declarative.pro:
+
+2010-06-20 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ The QWebHistory regression fix.
+
+ After change r51629 and r61207 QWebHistory's function back(),
+ forward(), goToItem() got broken.
+
+ Use page->goToItem() instead of direct actions on the BackForwardList.
+
+ [Qt] REGRESSION(r61207): qwebhistory unit test hangs
+ https://bugs.webkit.org/show_bug.cgi?id=40672
+
+ * Api/qwebhistory.cpp:
+ (QWebHistory::back):
+ (QWebHistory::forward):
+ (QWebHistory::goToItem):
+ * tests/qwebhistory/tst_qwebhistory.cpp:
+ (tst_QWebHistory::init):
+ (tst_QWebHistory::back):
+ (tst_QWebHistory::forward):
+
+2010-06-19 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Platform plugin's multi-select does not take OptGroup into account
+ https://bugs.webkit.org/show_bug.cgi?id=40718
+
+ Make sure that SelectData is valid throughout the lifetime of the dialog.
+ This is mostly important for the Orbt based plugin.
+ Added virtual desctructors where they were missing.
+
+ * Api/qwebkitplatformplugin.h:
+ (QWebSelectData::~QWebSelectData):
+ (QWebSelectMethod::~QWebSelectMethod):
+ (QWebNotificationData::~QWebNotificationData):
+ * WebCoreSupport/QtPlatformPlugin.cpp:
+ (WebCore::SelectInputMethodWrapper::SelectInputMethodWrapper):
+ (WebCore::SelectInputMethodWrapper::~SelectInputMethodWrapper):
+ (WebCore::SelectInputMethodWrapper::show):
+ * WebCoreSupport/QtPlatformPlugin.h:
+ * examples/platformplugin/WebPlugin.cpp:
+ * examples/platformplugin/qwebkitplatformplugin.h:
+ (QWebSelectData::~QWebSelectData):
+ (QWebSelectMethod::~QWebSelectMethod):
+ (QWebNotificationData::~QWebNotificationData):
+
+2010-06-19 No'am Rosenthal <noam.rosenthal@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Bridge documentation: some snippets have the wrong indentation
+ https://bugs.webkit.org/show_bug.cgi?id=40717
+
+ Fixed code snippets
+
+ * docs/webkitsnippets/qtwebkit_bridge_snippets.cpp:
+ (wrapInFunction):
+
+2010-06-02 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Support evaluateScriptInIsolatedWorld()
+
+ https://bugs.webkit.org/show_bug.cgi?id=40079
+
+ * Api/headers.pri:
+ * Api/qwebframe.cpp:
+ (QWebFrame::evaluateScriptInIsolatedWorld):
+ * Api/qwebframe.h:
+ * Api/qwebscriptworld.cpp: Added.
+ (QWebScriptWorld::QWebScriptWorld):
+ (QWebScriptWorld::world):
+ (QWebScriptWorld::~QWebScriptWorld):
+ * Api/qwebscriptworld.h: Added.
+ * Api/qwebscriptworld_p.h: Added.
+ (QWebScriptWorldPrivate::QWebScriptWorldPrivate):
+ (QWebScriptWorldPrivate::~QWebScriptWorldPrivate):
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+
+2010-06-19 Olivier Goffart <olivier.goffart@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Compilation in QWebPagePrivate::timerEvent with clang
+ https://bugs.webkit.org/show_bug.cgi?id=40714
+
+ QObject::timerEvent is protected and cannot be accessed by QWebPagePrivate
+ with clang
+
+ QWebPagePrivate is a friend of QWebPage and then should have access to
+ all protected members of parents of QWebPage, including QObject.
+ But the clang team do not want to conform to this aspect of the specification
+ because "It is either a drafting error or a horrible mistake."
+ See http://llvm.org/bugs/show_bug.cgi?id=6840
+
+ This change is better because QWebPage does not reimplement the timerEvent
+ (QWebPagePrivate::timerEvent is called from QWebPage::event)
+ So customers that would reimplement their own timerEvent
+ for their own timer now get a chance to catch them.
+
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::timerEvent):
+
+2010-06-19 Mirko Damiani <mirko@develer.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Avoid truncation of zoom factor in QWebFrame's print function.
+ https://bugs.webkit.org/show_bug.cgi?id=40662
+
+ The zoom factor is a qreal number but its value is truncated to an
+ integer. So a cast to qreal is needed to avoid this issue.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::print):
+
+2010-06-18 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] pass plugins/open-and-close-window-with-plugin.html on Qt
+
+ Capture logDestroy messages from the test plugin. DRT's WebPage
+ is already destroyed by the time they are emitted.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33333
+
+ Unskip:
+ plugins/open-and-close-window-with-plugin.html
+ plugins/geturlnotify-during-document-teardown.html
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptConsoleMessage):
+
+2010-06-18 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix documentation for the declarative module import.
+
+ * declarative/qdeclarativewebview.cpp:
+
+2010-06-18 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ Fix documentation issue on the onAlert handler.
+ Fix compilation issue with QT_NO_ACTION.
+
+ * declarative/qdeclarativewebview.cpp:
+ * declarative/qdeclarativewebview_p.h:
+
+2010-06-18 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Reviewed by Antti Koivisto.
+
+ REGRESSION(r60958) [Qt] qwebpage::inputMethods auto-test fails
+ https://bugs.webkit.org/show_bug.cgi?id=40830
+
+ When activating a regular input method field, always set or unset the ImhHiddenText
+ input method hint.
+
+ * WebCoreSupport/EditorClientQt.cpp:
+ (WebCore::EditorClientQt::setInputMethodState):
+
+2010-06-18 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Change the target path to QtWebKit.
+
+ * declarative/declarative.pro:
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * Api/qwebsettings.cpp:
+ (QWebSettingsPrivate::apply):
+
+2010-06-17 Robert Hogan <robert@webkit.org>
+
+ [Qt] Build fix
+
+ Unreviewed.
+
+ Remove includes in qdeclarativewebview*.* that rely on an installation
+ of QtWebKit.
+
+ * declarative/qdeclarativewebview.cpp:
+ * declarative/qdeclarativewebview_p.h:
+
+2010-06-17 Robert Hogan <robert@webkit.org>
+
+ Unreviewed, rolling out r61346.
+ http://trac.webkit.org/changeset/61346
+ https://bugs.webkit.org/show_bug.cgi?id=33333
+
+ Broke inspector tests on Qt
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptConsoleMessage):
+
+2010-06-17 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] pass plugins/open-and-close-window-with-plugin.html on Qt
+
+ Capture logDestroy messages from the test plugin. DRT's WebPage
+ is already destroyed by the time they are emitted.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33333
+
+ Unskip:
+ plugins/open-and-close-window-with-plugin.html
+ plugins/geturlnotify-during-document-teardown.html
+
+ * Api/qwebpage.cpp:
+ (QWebPage::javaScriptConsoleMessage):
+
+2010-06-17 Jesus Sanchez-Palencia <jesus@webkit.org>, Kenneth Rohde Christiansen <kenneth@webkit.org>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] QtWebKit does not support viewport meta tag
+ https://bugs.webkit.org/show_bug.cgi?id=39902
+
+ Add viewport meta tag support to QtWebKit API layer.
+
+ This implements didReceiveViewportArguments in our ChromeClientQt
+ which is hooked up with QWebPage::viewportChangeRequested().
+ This signal does not affect the current default behavior.
+ The documentation of the signal explains how to make use of this new feature.
+
+ * Api/qwebframe_p.h:
+ (QWebFramePrivate::QWebFramePrivate):
+ Store information about whether the page has been laid out or not.
+ * Api/qwebpage.cpp:
+ (QWebPage::viewportChangeRequested):
+ * Api/qwebpage_p.h:
+ Added class QtViewportHintsPrivate.
+ * Api/qwebpage.h:
+ (QWebPage::setPreferredContentsSize):
+ Improved documentation and now only layout if the page had already
+ passed layout phase.
+ Added class QWebPage::ViewportHints.
+ * WebCoreSupport/ChromeClientQt.cpp:
+ (WebCore::ChromeClientQt::windowRect):
+ Modified to work as intended by the DOM, for both QWebView
+ and QGraphicsWebView.
+ (WebCore::ChromeClientQt::didReceiveViewportArguments):
+ Emits the signal QWebPage::viewportChangeRequested.
+ * WebCoreSupport/ChromeClientQt.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::dispatchDidCommitLoad):
+ (WebCore::FrameLoaderClientQt::dispatchDidFirstLayout):
+ Update information about whether the page has been laid out or not.
+ If the page has been laid out we ignore any further viewport meta data.
+ * WebCoreSupport/PageClientQt.cpp:
+ (WebCore::PageClientQWidget::windowRect):
+ (WebCore::PageClientQGraphicsWidget::windowRect):
+ (WebCore::PageClientQGraphicsWidget::graphicsItemVisibleRect):
+ * WebCoreSupport/PageClientQt.h:
+ The PageClient is now responsible for providing the right window rect.
+
+2010-06-17 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Upstream the WebKit QML integration plugin
+ https://bugs.webkit.org/show_bug.cgi?id=40050
+
+ Add to the Qt port the QML WebKit integration plugin.
+ QDeclarativeWebView is creating the item and expose
+ properties. The C++ API is not public, only the
+ properties are.
+
+ * declarative/declarative.pro: Added.
+ * declarative/plugin.cpp: Added.
+ (WebKitQmlPlugin::registerTypes):
+ * declarative/qdeclarativewebview.cpp: Added.
+ (QDeclarativeWebViewPrivate::QDeclarativeWebViewPrivate):
+ (QDeclarativeWebViewPrivate::):
+ (QDeclarativeWebViewPrivate::windowObjectsAppend):
+ (GraphicsWebView::GraphicsWebView):
+ (GraphicsWebView::mousePressEvent):
+ (GraphicsWebView::mouseReleaseEvent):
+ (GraphicsWebView::mouseDoubleClickEvent):
+ (GraphicsWebView::timerEvent):
+ (GraphicsWebView::mouseMoveEvent):
+ (QDeclarativeWebView::QDeclarativeWebView):
+ (QDeclarativeWebView::~QDeclarativeWebView):
+ (QDeclarativeWebView::init):
+ (QDeclarativeWebView::componentComplete):
+ (QDeclarativeWebView::status):
+ (QDeclarativeWebView::progress):
+ (QDeclarativeWebView::doLoadStarted):
+ (QDeclarativeWebView::doLoadProgress):
+ (QDeclarativeWebView::pageUrlChanged):
+ (QDeclarativeWebView::doLoadFinished):
+ (QDeclarativeWebView::url):
+ (QDeclarativeWebView::setUrl):
+ (QDeclarativeWebView::preferredWidth):
+ (QDeclarativeWebView::setPreferredWidth):
+ (QDeclarativeWebView::preferredHeight):
+ (QDeclarativeWebView::setPreferredHeight):
+ (QDeclarativeWebView::evaluateJavaScript):
+ (QDeclarativeWebView::updateDeclarativeWebViewSize):
+ (QDeclarativeWebView::initialLayout):
+ (QDeclarativeWebView::updateContentsSize):
+ (QDeclarativeWebView::geometryChanged):
+ (QDeclarativeWebView::javaScriptWindowObjects):
+ (QDeclarativeWebView::qmlAttachedProperties):
+ (QDeclarativeWebViewPrivate::updateWindowObjects):
+ (QDeclarativeWebView::renderingEnabled):
+ (QDeclarativeWebView::setRenderingEnabled):
+ (QDeclarativeWebView::heuristicZoom):
+ (QDeclarativeWebView::pressGrabTime):
+ (QDeclarativeWebView::setPressGrabTime):
+ (QDeclarativeWebView::backAction):
+ (QDeclarativeWebView::forwardAction):
+ (QDeclarativeWebView::reloadAction):
+ (QDeclarativeWebView::stopAction):
+ (QDeclarativeWebView::title):
+ (QDeclarativeWebView::icon):
+ (QDeclarativeWebView::setStatusText):
+ (QDeclarativeWebView::windowObjectCleared):
+ (QDeclarativeWebView::statusText):
+ (QDeclarativeWebView::page):
+ (QDeclarativeWebView::settingsObject):
+ (QDeclarativeWebView::setPage):
+ (QDeclarativeWebView::load):
+ (QDeclarativeWebView::html):
+ (QDeclarativeWebView::setHtml):
+ (QDeclarativeWebView::setContent):
+ (QDeclarativeWebView::history):
+ (QDeclarativeWebView::settings):
+ (QDeclarativeWebView::createWindow):
+ (QDeclarativeWebView::newWindowComponent):
+ (QDeclarativeWebView::setNewWindowComponent):
+ (QDeclarativeWebView::newWindowParent):
+ (QDeclarativeWebView::setNewWindowParent):
+ (QDeclarativeWebView::contentsSize):
+ (QDeclarativeWebView::contentsScale):
+ (QDeclarativeWebView::setContentsScale):
+ (QDeclarativeWebView::elementAreaAt):
+ (QDeclarativeWebPage::QDeclarativeWebPage):
+ (QDeclarativeWebPage::~QDeclarativeWebPage):
+ (QDeclarativeWebPage::chooseFile):
+ (QDeclarativeWebPage::javaScriptAlert):
+ (QDeclarativeWebPage::javaScriptConfirm):
+ (QDeclarativeWebPage::javaScriptPrompt):
+ (QDeclarativeWebPage::viewItem):
+ (QDeclarativeWebPage::createWindow):
+ * declarative/qdeclarativewebview_p.h: Added.
+ (QDeclarativeWebView::):
+ (QDeclarativeWebView::isComponentCompletePublic):
+ (QDeclarativeWebViewAttached::QDeclarativeWebViewAttached):
+ (QDeclarativeWebViewAttached::windowObjectName):
+ (QDeclarativeWebViewAttached::setWindowObjectName):
+ (QDeclarativeWebSettings::QDeclarativeWebSettings):
+ (QDeclarativeWebSettings::standardFontFamily):
+ (QDeclarativeWebSettings::setStandardFontFamily):
+ (QDeclarativeWebSettings::fixedFontFamily):
+ (QDeclarativeWebSettings::setFixedFontFamily):
+ (QDeclarativeWebSettings::serifFontFamily):
+ (QDeclarativeWebSettings::setSerifFontFamily):
+ (QDeclarativeWebSettings::sansSerifFontFamily):
+ (QDeclarativeWebSettings::setSansSerifFontFamily):
+ (QDeclarativeWebSettings::cursiveFontFamily):
+ (QDeclarativeWebSettings::setCursiveFontFamily):
+ (QDeclarativeWebSettings::fantasyFontFamily):
+ (QDeclarativeWebSettings::setFantasyFontFamily):
+ (QDeclarativeWebSettings::minimumFontSize):
+ (QDeclarativeWebSettings::setMinimumFontSize):
+ (QDeclarativeWebSettings::minimumLogicalFontSize):
+ (QDeclarativeWebSettings::setMinimumLogicalFontSize):
+ (QDeclarativeWebSettings::defaultFontSize):
+ (QDeclarativeWebSettings::setDefaultFontSize):
+ (QDeclarativeWebSettings::defaultFixedFontSize):
+ (QDeclarativeWebSettings::setDefaultFixedFontSize):
+ (QDeclarativeWebSettings::autoLoadImages):
+ (QDeclarativeWebSettings::setAutoLoadImages):
+ (QDeclarativeWebSettings::javascriptEnabled):
+ (QDeclarativeWebSettings::setJavascriptEnabled):
+ (QDeclarativeWebSettings::javaEnabled):
+ (QDeclarativeWebSettings::setJavaEnabled):
+ (QDeclarativeWebSettings::pluginsEnabled):
+ (QDeclarativeWebSettings::setPluginsEnabled):
+ (QDeclarativeWebSettings::privateBrowsingEnabled):
+ (QDeclarativeWebSettings::setPrivateBrowsingEnabled):
+ (QDeclarativeWebSettings::javascriptCanOpenWindows):
+ (QDeclarativeWebSettings::setJavascriptCanOpenWindows):
+ (QDeclarativeWebSettings::javascriptCanAccessClipboard):
+ (QDeclarativeWebSettings::setJavascriptCanAccessClipboard):
+ (QDeclarativeWebSettings::developerExtrasEnabled):
+ (QDeclarativeWebSettings::setDeveloperExtrasEnabled):
+ (QDeclarativeWebSettings::linksIncludedInFocusChain):
+ (QDeclarativeWebSettings::setLinksIncludedInFocusChain):
+ (QDeclarativeWebSettings::zoomTextOnly):
+ (QDeclarativeWebSettings::setZoomTextOnly):
+ (QDeclarativeWebSettings::printElementBackgrounds):
+ (QDeclarativeWebSettings::setPrintElementBackgrounds):
+ (QDeclarativeWebSettings::offlineStorageDatabaseEnabled):
+ (QDeclarativeWebSettings::setOfflineStorageDatabaseEnabled):
+ (QDeclarativeWebSettings::offlineWebApplicationCacheEnabled):
+ (QDeclarativeWebSettings::setOfflineWebApplicationCacheEnabled):
+ (QDeclarativeWebSettings::localStorageDatabaseEnabled):
+ (QDeclarativeWebSettings::setLocalStorageDatabaseEnabled):
+ (QDeclarativeWebSettings::localContentCanAccessRemoteUrls):
+ (QDeclarativeWebSettings::setLocalContentCanAccessRemoteUrls):
+ * declarative/qmldir: Added.
+ * docs/qtwebkit.qdocconf:
+
+2010-06-17 Mark Brand <mabrand@mabrand.nl>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] use "win32-g++*" scope to match all MinGW makespecs
+
+ The scope "win32-g++" comes from the name of the makespec. However, it
+ is frequently used to check for MinGW. This works fine as long as
+ win32-g++ is the only makespec for MinGW. Now we need the wildcard
+ to cover "win32-g++-cross" as well.
+
+ * Api/DerivedSources.pro:
+
+2010-05-28 Viatcheslav Ostapenko <ostapenko.viatcheslav@nokia.com>
+
+ Reviewed by Simon Hausmann, Antti Koivisto
+
+ [Qt] Add internal Qt Api to configure repaint throttling parameters.
+ https://bugs.webkit.org/show_bug.cgi?id=38401
+
+ * Api/qwebpage.cpp:
+ (QWebPagePrivate::dynamicPropertyChangeEvent):
+
+2010-06-16 Alexis Menard <alexis.menard@nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Fix tiled backing store painting when calling QGraphicsWebView::setPage() after setResizesToContents(true)
+
+ When calling setPage() after setResizesToContents, the value of the property wasn't propagated
+ to the page client. Therefore the visible rect for the tiled backing store was incorrect.
+
+ Simply move the variable assignment into updateResizesToContentsForPage(), which is always called.
+
+ * Api/qgraphicswebview.cpp:
+ (QGraphicsWebViewPrivate::updateResizesToContentsForPage):
+ (QGraphicsWebView::setResizesToContents):
+
+2010-06-16 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Rubber-stamped by Tor Arne Vestbø.
+
+ Swap WebGL and SiteSpecificQuirks attributes in the QWebSettings
+ enum, to allow for binary compatibility with qtwebkit-2.0, where
+ WebGL is not in the settings but SiteSpecificQuirks will be.
+
+ * Api/qwebsettings.h:
+
+2010-06-15 Darin Adler <darin@apple.com>
+
+ Fix build.
+
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::shouldClose): Call loader()->shouldClose().
+
+2010-06-15 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Rename NotificatioIconWrapper to NotificationWrapper
+ https://bugs.webkit.org/show_bug.cgi?id=40571
+
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ (WebCore::NotificationWrapper::NotificationWrapper):
+ (WebCore::NotificationWrapper::close):
+ (WebCore::NotificationWrapper::title):
+ (WebCore::NotificationWrapper::message):
+ (WebCore::NotificationWrapper::iconData):
+ (WebCore::NotificationWrapper::notificationClosed):
+ (WebCore::NotificationPresenterClientQt::displayNotification):
+ (WebCore::NotificationPresenterClientQt::cancel):
+ (WebCore::NotificationPresenterClientQt::notificationForWrapper):
+ * WebCoreSupport/NotificationPresenterClientQt.h:
+ (WebCore::NotificationWrapper::~NotificationWrapper):
+
+2010-06-15 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed, Symbian build fix.
+
+ [Qt] Update the def file with recent new exports.
+
+ * symbian/eabi/QtWebKitu.def:
+
+2010-06-15 Yael Aharon <yael.aharon@nokia.com>
+
+ Unreviewed.
+
+ Fix typo in reviewer name in r61187
+
+2010-06-15 Yael Aharon <yael.aharon@nokia.com>
+
+ Reviewed by Simon Fraser.
+
+ [Qt] Build fix for Qt minimal after r61121
+ https://bugs.webkit.org/show_bug.cgi?id=40624
+
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ (WebCore::NotificationIconWrapper::NotificationIconWrapper):
+ (WebCore::NotificationIconWrapper::close):
+ (WebCore::NotificationIconWrapper::title):
+ (WebCore::NotificationIconWrapper::message):
+ (WebCore::NotificationIconWrapper::iconData):
+ (WebCore::NotificationIconWrapper::notificationClosed):
+ * WebCoreSupport/NotificationPresenterClientQt.h:
+ (WebCore::NotificationIconWrapper::~NotificationIconWrapper):
+
+2010-06-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
+
+ Unreviewed, Symbian build fix.
+
+ [Qt] Update the def file with recent new exports.
+
+ * symbian/eabi/QtWebKitu.def:
+
2010-06-13 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index 98ffd8a..faec705 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -37,36 +37,37 @@
#include "FrameLoaderClientQt.h"
#include "FrameView.h"
#include "Geolocation.h"
+#if USE(ACCELERATED_COMPOSITING)
+#include "GraphicsLayerQt.h"
+#endif
#include "HitTestResult.h"
#include "Icon.h"
#include "NotImplemented.h"
#include "NotificationPresenterClientQt.h"
-#include "ScrollbarTheme.h"
-#include "WindowFeatures.h"
+#include "PageClientQt.h"
#if defined(Q_WS_MAEMO_5)
#include "QtMaemoWebPopup.h"
#else
#include "QtFallbackWebPopup.h"
#endif
#include "QWebPageClient.h"
+#include "ScrollbarTheme.h"
#include "SecurityOrigin.h"
+#include "ViewportArguments.h"
+#include "WindowFeatures.h"
+#include "qgraphicswebview.h"
#include "qwebframe_p.h"
#include "qwebpage.h"
#include "qwebpage_p.h"
#include "qwebsecurityorigin.h"
#include "qwebsecurityorigin_p.h"
#include "qwebview.h"
-
#include <qdebug.h>
#include <qeventloop.h>
#include <qtextdocument.h>
#include <qtooltip.h>
-#if USE(ACCELERATED_COMPOSITING)
-#include "GraphicsLayerQt.h"
-#endif
-
namespace WebCore {
ChromeClientQt::ChromeClientQt(QWebPage* webPage)
@@ -90,19 +91,18 @@ void ChromeClientQt::setWindowRect(const FloatRect& rect)
qRound(rect.width()), qRound(rect.height())));
}
-
+/*!
+ windowRect represents the rect of the Window, including all interface elements
+ like toolbars/scrollbars etc. It is used by the viewport meta tag as well as
+ by the DOM Window object: outerHeight(), outerWidth(), screenX(), screenY().
+*/
FloatRect ChromeClientQt::windowRect()
{
- if (!m_webPage)
- return FloatRect();
-
- QWidget* view = m_webPage->view();
- if (!view)
+ if (!platformPageClient())
return FloatRect();
- return IntRect(view->window()->geometry());
+ return platformPageClient()->windowRect();
}
-
FloatRect ChromeClientQt::pageRect()
{
if (!m_webPage)
@@ -595,7 +595,7 @@ QtAbstractWebPopup* ChromeClientQt::createSelectPopup()
#elif !defined(QT_NO_COMBOBOX)
return new QtFallbackWebPopup;
#else
- return result;
+ return 0;
#endif
}
@@ -626,4 +626,23 @@ bool ChromeClientQt::isMinimized()
}
#endif
+void ChromeClientQt::didReceiveViewportArguments(Frame* frame, const ViewportArguments& arguments) const
+{
+ if (m_webPage->mainFrame()->d->initialLayoutComplete)
+ return;
+
+ QSize viewportSize(arguments.width, arguments.height);
+ bool isUserScalable = arguments.userScalable == 1;
+
+ QWebPage::ViewportHints hints;
+ hints.m_isValid = true;
+ hints.m_size = viewportSize;
+ hints.m_initialScaleFactor = arguments.initialScale;
+ hints.m_minimumScaleFactor = arguments.minimumScale;
+ hints.m_maximumScaleFactor = arguments.maximumScale;
+ hints.m_isUserScalable = isUserScalable;
+
+ emit m_webPage->viewportChangeRequested(hints);
}
+
+} // namespace WebCore
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
index 0396aef..4b55eb2 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h
@@ -48,6 +48,7 @@ namespace WebCore {
class Page;
struct FrameLoadRequest;
class QtAbstractWebPopup;
+ struct ViewportArguments;
class ChromeClientQt : public ChromeClient
{
@@ -177,6 +178,8 @@ namespace WebCore {
QtAbstractWebPopup* createSelectPopup();
+ virtual void didReceiveViewportArguments(Frame*, const ViewportArguments&) const;
+
QWebPage* m_webPage;
WebCore::KURL lastHoverURL;
WebCore::String lastHoverTitle;
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index c92e43f..0ae55d7 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -331,13 +331,6 @@ void DumpRenderTreeSupportQt::resumeActiveDOMObjects(QWebFrame* frame)
coreFrame->document()->resumeActiveDOMObjects();
}
-void DumpRenderTreeSupportQt::evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldId, const QString& script)
-{
- Frame* coreFrame = QWebFramePrivate::core(frame);
- if (coreFrame)
- JSC::JSValue result = coreFrame->script()->executeScriptInWorld(mainThreadNormalWorld(), script, true).jsValue();
-}
-
void DumpRenderTreeSupportQt::whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains)
{
SecurityOrigin::addOriginAccessWhitelistEntry(*SecurityOrigin::createFromString(sourceOrigin), destinationProtocol, destinationHost, allowDestinationSubdomains);
@@ -621,7 +614,7 @@ QList<QWebHistoryItem> DumpRenderTreeSupportQt::getChildHistoryItems(const QWebH
bool DumpRenderTreeSupportQt::shouldClose(QWebFrame* frame)
{
WebCore::Frame* coreFrame = QWebFramePrivate::core(frame);
- return coreFrame->shouldClose();
+ return coreFrame->loader()->shouldClose();
}
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index e3408e3..0b94a03 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -70,7 +70,6 @@ public:
static void setMediaType(QWebFrame* qframe, const QString& type);
static void setDumpRenderTreeModeEnabled(bool b);
- static void evaluateScriptInIsolatedWorld(QWebFrame* frame, int worldId, const QString& script);
static void garbageCollectorCollect();
static void garbageCollectorCollectOnAlternateThread(bool waitUntilDone);
static void setJavaScriptProfilingEnabled(QWebFrame*, bool enabled);
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 93e5745..e140968 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -611,6 +611,7 @@ void EditorClientQt::setInputMethodState(bool active)
webPageClient->setInputMethodHint(Qt::ImhDigitsOnly, inputElement->isNumberField());
webPageClient->setInputMethodHint(Qt::ImhEmailCharactersOnly, inputElement->isEmailField());
webPageClient->setInputMethodHint(Qt::ImhUrlCharactersOnly, inputElement->isUrlField());
+ webPageClient->setInputMethodHint(Qt::ImhHiddenText, inputElement->isPasswordField());
}
}
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index e86a84a..42b0c49 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -380,6 +380,8 @@ void FrameLoaderClientQt::dispatchDidCommitLoad()
if (m_frame->tree()->parent() || !m_webFrame)
return;
+ m_webFrame->d->initialLayoutComplete = false;
+
emit m_webFrame->urlChanged(m_webFrame->url());
m_webFrame->page()->d->updateNavigationActions();
@@ -387,6 +389,12 @@ void FrameLoaderClientQt::dispatchDidCommitLoad()
// will be called very soon with the correct title.
// This properly resets the title when we navigate to a URI without a title.
emit titleChanged(String());
+
+ bool isMainFrame = (m_frame == m_frame->page()->mainFrame());
+ if (!isMainFrame)
+ return;
+
+ emit m_webFrame->page()->viewportChangeRequested(QWebPage::ViewportHints());
}
@@ -424,7 +432,7 @@ void FrameLoaderClientQt::dispatchDidFinishLoad()
void FrameLoaderClientQt::dispatchDidFirstLayout()
{
- notImplemented();
+ m_webFrame->d->initialLayoutComplete = true;
}
void FrameLoaderClientQt::dispatchDidFirstVisuallyNonEmptyLayout()
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index 8bde5c4..c90b3b5 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -42,10 +42,10 @@
#include "qwebkitglobal.h"
#include <QtGui>
-#if ENABLE(NOTIFICATIONS)
-
namespace WebCore {
+#if ENABLE(NOTIFICATIONS)
+
const double notificationTimeout = 10.0;
bool NotificationPresenterClientQt::dumpNotification = false;
@@ -61,51 +61,69 @@ NotificationPresenterClientQt* NotificationPresenterClientQt::notificationPresen
return s_notificationPresenter;
}
-NotificationIconWrapper::NotificationIconWrapper()
- : m_closeTimer(this, &NotificationIconWrapper::close)
+#endif
+
+NotificationWrapper::NotificationWrapper()
+ : m_closeTimer(this, &NotificationWrapper::close)
{
+#if ENABLE(NOTIFICATIONS)
+
#ifndef QT_NO_SYSTEMTRAYICON
m_notificationIcon = 0;
#endif
m_presenter = 0;
+#endif
}
-NotificationIconWrapper::~NotificationIconWrapper()
-{
-}
-
-void NotificationIconWrapper::close(Timer<NotificationIconWrapper>*)
+void NotificationWrapper::close(Timer<NotificationWrapper>*)
{
+#if ENABLE(NOTIFICATIONS)
NotificationPresenterClientQt::notificationPresenter()->cancel(this);
+#endif
}
-const QString NotificationIconWrapper::title() const
+const QString NotificationWrapper::title() const
{
+#if ENABLE(NOTIFICATIONS)
Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
if (notification)
return notification->contents().title();
+#endif
return QString();
}
-const QString NotificationIconWrapper::message() const
+const QString NotificationWrapper::message() const
{
+#if ENABLE(NOTIFICATIONS)
Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
if (notification)
return notification->contents().body();
+#endif
return QString();
}
-const QByteArray NotificationIconWrapper::iconData() const
+const QByteArray NotificationWrapper::iconData() const
{
- Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
QByteArray iconData;
+#if ENABLE(NOTIFICATIONS)
+ Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
if (notification) {
if (notification->iconData())
iconData = QByteArray::fromRawData(notification->iconData()->data(), notification->iconData()->size());
}
+#endif
return iconData;
}
+void NotificationWrapper::notificationClosed()
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::notificationPresenter()->cancel(this);
+#endif
+}
+
+#if ENABLE(NOTIFICATIONS)
+
NotificationPresenterClientQt::NotificationPresenterClientQt() : m_clientCount(0)
{
}
@@ -127,11 +145,6 @@ void NotificationPresenterClientQt::removeClient()
}
}
-void NotificationIconWrapper::notificationClosed()
-{
- NotificationPresenterClientQt::notificationPresenter()->cancel(this);
-}
-
bool NotificationPresenterClientQt::show(Notification* notification)
{
// FIXME: workers based notifications are not supported yet.
@@ -152,7 +165,7 @@ bool NotificationPresenterClientQt::show(Notification* notification)
void NotificationPresenterClientQt::displayNotification(Notification* notification, const QByteArray& bytes)
{
- NotificationIconWrapper* wrapper = new NotificationIconWrapper();
+ NotificationWrapper* wrapper = new NotificationWrapper();
m_notifications.insert(notification, wrapper);
QString title;
QString message;
@@ -213,14 +226,14 @@ void NotificationPresenterClientQt::cancel(Notification* notification)
}
}
-void NotificationPresenterClientQt::cancel(NotificationIconWrapper* wrapper)
+void NotificationPresenterClientQt::cancel(NotificationWrapper* wrapper)
{
Notification* notification = notificationForWrapper(wrapper);
if (notification)
cancel(notification);
}
-Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationIconWrapper* wrapper) const
+Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationWrapper* wrapper) const
{
NotificationsQueue::ConstIterator end = m_notifications.end();
NotificationsQueue::ConstIterator iter = m_notifications.begin();
@@ -341,5 +354,7 @@ void NotificationPresenterClientQt::dumpShowText(Notification* notification)
}
}
-}
#endif // ENABLE(NOTIFICATIONS)
+}
+
+#include "moc_NotificationPresenterClientQt.cpp"
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
index 1630cd9..82c5f7c 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
@@ -47,14 +47,14 @@ namespace WebCore {
class Document;
class KURL;
-class NotificationIconWrapper : public QObject, public QWebNotificationData {
+class NotificationWrapper : public QObject, public QWebNotificationData {
Q_OBJECT
public:
- NotificationIconWrapper();
- ~NotificationIconWrapper();
+ NotificationWrapper();
+ ~NotificationWrapper() {}
void close();
- void close(Timer<NotificationIconWrapper>*);
+ void close(Timer<NotificationWrapper>*);
const QString title() const;
const QString message() const;
const QByteArray iconData() const;
@@ -68,12 +68,12 @@ public:
#endif
OwnPtr<QWebNotificationPresenter> m_presenter;
- Timer<NotificationIconWrapper> m_closeTimer;
+ Timer<NotificationWrapper> m_closeTimer;
};
#if ENABLE(NOTIFICATIONS)
-typedef QHash <Notification*, NotificationIconWrapper*> NotificationsQueue;
+typedef QHash <Notification*, NotificationWrapper*> NotificationsQueue;
class NotificationPresenterClientQt : public NotificationPresenter {
public:
@@ -87,7 +87,7 @@ public:
virtual void requestPermission(SecurityOrigin*, PassRefPtr<VoidCallback>);
virtual NotificationPresenter::Permission checkPermission(const KURL&);
- void cancel(NotificationIconWrapper*);
+ void cancel(NotificationWrapper*);
void allowNotificationForOrigin(const QString& origin);
@@ -99,7 +99,7 @@ public:
void removeClient();
static NotificationPresenterClientQt* notificationPresenter();
- Notification* notificationForWrapper(const NotificationIconWrapper*) const;
+ Notification* notificationForWrapper(const NotificationWrapper*) const;
private:
void sendEvent(Notification*, const AtomicString& eventName);
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 4ccf34a..f52c382 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -103,6 +103,11 @@ QStyle* PageClientQWidget::style() const
return view->style();
}
+QRectF PageClientQWidget::windowRect() const
+{
+ return QRectF(view->window()->geometry());
+}
+
PageClientQGraphicsWidget::~PageClientQGraphicsWidget()
{
#if USE(ACCELERATED_COMPOSITING)
@@ -292,14 +297,14 @@ QRect PageClientQGraphicsWidget::geometryRelativeToOwnerWidget() const
#if ENABLE(TILED_BACKING_STORE)
QRectF PageClientQGraphicsWidget::graphicsItemVisibleRect() const
-{
+{
if (!view->scene())
return QRectF();
QList<QGraphicsView*> views = view->scene()->views();
if (views.isEmpty())
return QRectF();
-
+
QGraphicsView* graphicsView = views.at(0);
int xOffset = graphicsView->horizontalScrollBar()->value();
int yOffset = graphicsView->verticalScrollBar()->value();
@@ -317,6 +322,13 @@ QStyle* PageClientQGraphicsWidget::style() const
return view->style();
}
+QRectF PageClientQGraphicsWidget::windowRect() const
+{
+ if (!view->scene())
+ return QRectF();
-
+ // The sceneRect is a good approximation of the size of the application, independent of the view.
+ return view->scene()->sceneRect();
}
+
+} // namespace WebCore
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.h b/WebKit/qt/WebCoreSupport/PageClientQt.h
index 818c67a..4d42ca1 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.h
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.h
@@ -76,9 +76,11 @@ public:
virtual QObject* pluginParent() const;
virtual QStyle* style() const;
-
+
virtual bool viewResizesToContentsEnabled() const { return false; }
+ virtual QRectF windowRect() const;
+
QWidget* view;
};
@@ -182,6 +184,8 @@ public:
virtual bool allowsAcceleratedCompositing() const { return true; }
#endif
+ virtual QRectF windowRect() const;
+
QGraphicsWidget* view;
QWebPage* page;
bool viewResizesToContents;
diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
index 5e7e6d1..cccb07c 100644
--- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
+++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.cpp
@@ -56,16 +56,24 @@ QWebSelectData::ItemType SelectData::itemType(int index) const
SelectInputMethodWrapper::SelectInputMethodWrapper(QWebSelectMethod* plugin)
: m_plugin(plugin)
+ , m_selectData(0)
{
m_plugin->setParent(this);
connect(m_plugin, SIGNAL(didHide()), this, SLOT(didHide()));
connect(m_plugin, SIGNAL(selectItem(int, bool, bool)), this, SLOT(selectItem(int, bool, bool)));
}
+SelectInputMethodWrapper::~SelectInputMethodWrapper()
+{
+ delete m_selectData;
+}
+
void SelectInputMethodWrapper::show()
{
- SelectData data(this);
- m_plugin->show(data);
+ if (m_selectData)
+ delete m_selectData;
+ m_selectData = new SelectData(this);
+ m_plugin->show(*m_selectData);
}
void SelectInputMethodWrapper::hide()
diff --git a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
index ff10d58..2de4859 100644
--- a/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
+++ b/WebKit/qt/WebCoreSupport/QtPlatformPlugin.h
@@ -28,6 +28,7 @@
class QWebSelectMethod;
class QWebKitPlatformPlugin;
class QWebNotificationPresenter;
+class QWebSelectData;
namespace WebCore {
@@ -35,6 +36,7 @@ class SelectInputMethodWrapper : public QObject, public QtAbstractWebPopup {
Q_OBJECT
public:
SelectInputMethodWrapper(QWebSelectMethod* plugin);
+ ~SelectInputMethodWrapper();
virtual void show();
virtual void hide();
@@ -45,6 +47,7 @@ private Q_SLOTS:
private:
QWebSelectMethod* m_plugin;
+ QWebSelectData* m_selectData;
};
class QtPlatformPlugin {
diff --git a/WebKit/qt/declarative/declarative.pro b/WebKit/qt/declarative/declarative.pro
new file mode 100644
index 0000000..75268f3
--- /dev/null
+++ b/WebKit/qt/declarative/declarative.pro
@@ -0,0 +1,72 @@
+TARGET = qmlwebkitplugin
+TARGETPATH = QtWebKit
+
+TEMPLATE = lib
+CONFIG += qt plugin
+
+win32|mac:!wince*:!win32-msvc:!macx-xcode:CONFIG += debug_and_release
+
+isEmpty(OUTPUT_DIR): OUTPUT_DIR = ../../..
+
+QMLDIRFILE = $${_PRO_FILE_PWD_}/qmldir
+copy2build.input = QMLDIRFILE
+CONFIG(QTDIR_build) {
+ copy2build.output = $$QT_BUILD_TREE/imports/$$TARGETPATH/qmldir
+} else {
+ copy2build.output = $$OUTPUT_DIR/imports/$$TARGETPATH/qmldir
+}
+!contains(TEMPLATE_PREFIX, vc):copy2build.variable_out = PRE_TARGETDEPS
+copy2build.commands = $$QMAKE_COPY ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT}
+copy2build.name = COPY ${QMAKE_FILE_IN}
+copy2build.CONFIG += no_link
+QMAKE_EXTRA_COMPILERS += copy2build
+
+TARGET = $$qtLibraryTarget($$TARGET)
+contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
+
+wince*:LIBS += $$QMAKE_LIBS_GUI
+
+symbian: {
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = All -Tcb
+ load(armcc_warnings)
+}
+
+include(../../../WebKit.pri)
+
+QT += declarative
+
+!CONFIG(standalone_package) {
+ linux-* {
+ # From Creator's src/rpath.pri:
+ # Do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR
+ # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var.
+ QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+ MY_RPATH = $$join(QMAKE_RPATHDIR, ":")
+
+ QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${MY_RPATH}\'
+ QMAKE_RPATHDIR =
+ } else {
+ QMAKE_RPATHDIR = $$OUTPUT_DIR/lib $$QMAKE_RPATHDIR
+ }
+}
+
+SOURCES += qdeclarativewebview.cpp plugin.cpp
+HEADERS += qdeclarativewebview_p.h
+
+CONFIG(QTDIR_build) {
+ DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+} else {
+ DESTDIR = $$OUTPUT_DIR/imports/$$TARGETPATH
+}
+target.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+
+qmldir.files += $$PWD/qmldir
+qmldir.path += $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+symbian:{
+ TARGET.UID3 = 0x20021321
+}
+
+INSTALLS += target qmldir
diff --git a/WebKit/qt/declarative/plugin.cpp b/WebKit/qt/declarative/plugin.cpp
new file mode 100644
index 0000000..f1f165e
--- /dev/null
+++ b/WebKit/qt/declarative/plugin.cpp
@@ -0,0 +1,43 @@
+/*
+ Copyright (C) 2009 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 "qdeclarativewebview_p.h"
+
+#include <QtDeclarative/qdeclarative.h>
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+
+QT_BEGIN_NAMESPACE
+
+class WebKitQmlPlugin : public QDeclarativeExtensionPlugin {
+ Q_OBJECT
+public:
+ virtual void registerTypes(const char* uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit"));
+ qmlRegisterType<QDeclarativeWebSettings>();
+ qmlRegisterType<QDeclarativeWebView>(uri, 1, 0, "WebView");
+ }
+};
+
+QT_END_NAMESPACE
+
+#include "plugin.moc"
+
+Q_EXPORT_PLUGIN2(qmlwebkitplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin));
+
diff --git a/WebKit/qt/declarative/qdeclarativewebview.cpp b/WebKit/qt/declarative/qdeclarativewebview.cpp
new file mode 100644
index 0000000..a349bec
--- /dev/null
+++ b/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -0,0 +1,1022 @@
+/*
+ Copyright (C) 2009 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 "qdeclarativewebview_p.h"
+
+#include <QtCore/QDebug>
+#include <QtCore/QEvent>
+#include <QtCore/QFile>
+#include <QtDeclarative/QDeclarativeContext>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/qdeclarative.h>
+#include <QtGui/QApplication>
+#include <QtGui/QGraphicsSceneMouseEvent>
+#include <QtGui/QKeyEvent>
+#include <QtGui/QMouseEvent>
+#include <QtGui/QPen>
+#include "qwebelement.h"
+#include "qwebframe.h"
+#include "qwebpage.h"
+#include "qwebsettings.h"
+
+QT_BEGIN_NAMESPACE
+
+class QDeclarativeWebViewPrivate {
+public:
+ QDeclarativeWebViewPrivate(QDeclarativeWebView* qq)
+ : q(qq)
+ , preferredwidth(0)
+ , preferredheight(0)
+ , progress(1.0)
+ , status(QDeclarativeWebView::Null)
+ , pending(PendingNone)
+ , newWindowComponent(0)
+ , newWindowParent(0)
+ , rendering(true)
+ {
+ }
+
+ QDeclarativeWebView* q;
+
+ QUrl url; // page url might be different if it has not loaded yet
+ GraphicsWebView* view;
+
+ int preferredwidth, preferredheight;
+ qreal progress;
+ QDeclarativeWebView::Status status;
+ QString statusText;
+ enum { PendingNone, PendingUrl, PendingHtml, PendingContent } pending;
+ QUrl pendingUrl;
+ QString pendingString;
+ QByteArray pendingData;
+ mutable QDeclarativeWebSettings settings;
+ QDeclarativeComponent* newWindowComponent;
+ QDeclarativeItem* newWindowParent;
+
+ static void windowObjectsAppend(QDeclarativeListProperty<QObject>* prop, QObject* o)
+ {
+ static_cast<QDeclarativeWebViewPrivate*>(prop->data)->windowObjects.append(o);
+ static_cast<QDeclarativeWebViewPrivate*>(prop->data)->updateWindowObjects();
+ }
+
+ void updateWindowObjects();
+ QObjectList windowObjects;
+
+ bool rendering;
+};
+
+GraphicsWebView::GraphicsWebView(QDeclarativeWebView* parent)
+ : QGraphicsWebView(parent)
+ , parent(parent)
+ , pressTime(400)
+{
+}
+
+void GraphicsWebView::mousePressEvent(QGraphicsSceneMouseEvent* event)
+{
+ setFocus();
+ pressPoint = event->pos();
+ if (pressTime) {
+ pressTimer.start(pressTime, this);
+ parent->setKeepMouseGrab(false);
+ } else {
+ grabMouse();
+ parent->setKeepMouseGrab(true);
+ }
+ QGraphicsWebView::mousePressEvent(event);
+}
+
+void GraphicsWebView::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+{
+ QGraphicsWebView::mouseReleaseEvent(event);
+ pressTimer.stop();
+ parent->setKeepMouseGrab(false);
+ ungrabMouse();
+}
+
+void GraphicsWebView::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
+{
+ QMouseEvent* me = new QMouseEvent(QEvent::MouseButtonDblClick, (event->pos() / parent->contentsScale()).toPoint(), event->button(), event->buttons(), 0);
+ emit doubleClick(event->pos().x(), event->pos().y());
+ delete me;
+}
+
+void GraphicsWebView::timerEvent(QTimerEvent* event)
+{
+ if (event->timerId() == pressTimer.timerId()) {
+ pressTimer.stop();
+ grabMouse();
+ parent->setKeepMouseGrab(true);
+ }
+}
+
+void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
+{
+ if (pressTimer.isActive()) {
+ if ((event->pos() - pressPoint).manhattanLength() > QApplication::startDragDistance())
+ pressTimer.stop();
+ }
+ if (parent->keepMouseGrab())
+ QGraphicsWebView::mouseMoveEvent(event);
+}
+
+/*!
+ \qmlclass WebView QDeclarativeWebView
+ \since 4.7
+ \brief The WebView item allows you to add web content to a canvas.
+ \inherits Item
+
+ A WebView renders web content based on a URL.
+
+ This type is made available by importing the \c QtWebKit module:
+
+ \bold{import QtWebKit 1.0}
+
+ If the width and height of the item is not set, they will
+ dynamically adjust to a size appropriate for the content.
+ This width may be large for typical online web pages.
+
+ If the width or height is explictly set, the rendered website
+ will be clipped, not scaled, to fit into the set dimensions.
+
+ If the preferredWidth is set, the width will be this amount or larger,
+ usually laying out the web content to fit the preferredWidth.
+
+ \qml
+ import QtWebKit 1.0
+
+ WebView {
+ url: "http://www.nokia.com"
+ preferredWidth: 490
+ preferredHeight: 400
+ scale: 0.5
+ smooth: false
+ smoothCache: true
+ }
+ \endqml
+
+ \image webview.png
+
+ The item includes no scrolling, scaling,
+ toolbars, etc., those must be implemented around WebView. See the WebBrowser example
+ for a demonstration of this.
+
+ When this item has keyboard focus, all keyboard input will be sent directly to the
+ web page within.
+*/
+
+/*!
+ \internal
+ \class QDeclarativeWebView
+ \brief The QDeclarativeWebView class allows you to add web content to a QDeclarativeView.
+
+ A WebView renders web content base on a URL.
+
+ \image webview.png
+
+ The item includes no scrolling, scaling,
+ toolbars, etc., those must be implemented around WebView. See the WebBrowser example
+ for a demonstration of this.
+
+ A QDeclarativeWebView object can be instantiated in Qml using the tag \l WebView.
+*/
+
+QDeclarativeWebView::QDeclarativeWebView(QDeclarativeItem *parent) : QDeclarativeItem(parent)
+{
+ init();
+}
+
+QDeclarativeWebView::~QDeclarativeWebView()
+{
+ delete d;
+}
+
+void QDeclarativeWebView::init()
+{
+ d = new QDeclarativeWebViewPrivate(this);
+
+ QWebSettings::enablePersistentStorage();
+
+ setAcceptedMouseButtons(Qt::LeftButton);
+ setFlag(QGraphicsItem::ItemHasNoContents, true);
+ setClip(true);
+
+ d->view = new GraphicsWebView(this);
+ d->view->setResizesToContents(true);
+ QWebPage* wp = new QDeclarativeWebPage(this);
+ setPage(wp);
+ connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize()));
+ connect(d->view, SIGNAL(doubleClick(int, int)), this, SIGNAL(doubleClick(int, int)));
+ connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged()));
+}
+
+void QDeclarativeWebView::componentComplete()
+{
+ QDeclarativeItem::componentComplete();
+ page()->setNetworkAccessManager(qmlEngine(this)->networkAccessManager());
+
+ switch (d->pending) {
+ case QDeclarativeWebViewPrivate::PendingUrl:
+ setUrl(d->pendingUrl);
+ break;
+ case QDeclarativeWebViewPrivate::PendingHtml:
+ setHtml(d->pendingString, d->pendingUrl);
+ break;
+ case QDeclarativeWebViewPrivate::PendingContent:
+ setContent(d->pendingData, d->pendingString, d->pendingUrl);
+ break;
+ default:
+ break;
+ }
+ d->pending = QDeclarativeWebViewPrivate::PendingNone;
+ d->updateWindowObjects();
+}
+
+QDeclarativeWebView::Status QDeclarativeWebView::status() const
+{
+ return d->status;
+}
+
+
+/*!
+ \qmlproperty real WebView::progress
+ This property holds the progress of loading the current URL, from 0 to 1.
+
+ If you just want to know when progress gets to 1, use
+ WebView::onLoadFinished() or WebView::onLoadFailed() instead.
+*/
+qreal QDeclarativeWebView::progress() const
+{
+ return d->progress;
+}
+
+void QDeclarativeWebView::doLoadStarted()
+{
+ if (!d->url.isEmpty()) {
+ d->status = Loading;
+ emit statusChanged(d->status);
+ }
+ emit loadStarted();
+}
+
+void QDeclarativeWebView::doLoadProgress(int p)
+{
+ if (d->progress == p / 100.0)
+ return;
+ d->progress = p / 100.0;
+ emit progressChanged();
+}
+
+void QDeclarativeWebView::pageUrlChanged()
+{
+ updateContentsSize();
+
+ if ((d->url.isEmpty() && page()->mainFrame()->url() != QUrl(QLatin1String("about:blank")))
+ || (d->url != page()->mainFrame()->url() && !page()->mainFrame()->url().isEmpty()))
+ {
+ d->url = page()->mainFrame()->url();
+ if (d->url == QUrl(QLatin1String("about:blank")))
+ d->url = QUrl();
+ emit urlChanged();
+ }
+}
+
+void QDeclarativeWebView::doLoadFinished(bool ok)
+{
+ if (ok) {
+ d->status = d->url.isEmpty() ? Null : Ready;
+ emit loadFinished();
+ } else {
+ d->status = Error;
+ emit loadFailed();
+ }
+ emit statusChanged(d->status);
+}
+
+/*!
+ \qmlproperty url WebView::url
+ This property holds the URL to the page displayed in this item. It can be set,
+ but also can change spontaneously (eg. because of network redirection).
+
+ If the url is empty, the page is blank.
+
+ The url is always absolute (QML will resolve relative URL strings in the context
+ of the containing QML document).
+*/
+QUrl QDeclarativeWebView::url() const
+{
+ return d->url;
+}
+
+void QDeclarativeWebView::setUrl(const QUrl& url)
+{
+ if (url == d->url)
+ return;
+
+ if (isComponentComplete()) {
+ d->url = url;
+ updateContentsSize();
+ QUrl seturl = url;
+ if (seturl.isEmpty())
+ seturl = QUrl(QLatin1String("about:blank"));
+
+ Q_ASSERT(!seturl.isRelative());
+
+ page()->mainFrame()->load(seturl);
+
+ emit urlChanged();
+ } else {
+ d->pending = d->PendingUrl;
+ d->pendingUrl = url;
+ }
+}
+
+/*!
+ \qmlproperty int WebView::preferredWidth
+ This property holds the ideal width for displaying the current URL.
+*/
+int QDeclarativeWebView::preferredWidth() const
+{
+ return d->preferredwidth;
+}
+
+void QDeclarativeWebView::setPreferredWidth(int width)
+{
+ if (d->preferredwidth == width)
+ return;
+ d->preferredwidth = width;
+ updateContentsSize();
+ emit preferredWidthChanged();
+}
+
+/*!
+ \qmlproperty int WebView::preferredHeight
+ This property holds the ideal height for displaying the current URL.
+ This only affects the area zoomed by heuristicZoom().
+*/
+int QDeclarativeWebView::preferredHeight() const
+{
+ return d->preferredheight;
+}
+
+void QDeclarativeWebView::setPreferredHeight(int height)
+{
+ if (d->preferredheight == height)
+ return;
+ d->preferredheight = height;
+ updateContentsSize();
+ emit preferredHeightChanged();
+}
+
+/*!
+ \qmlmethod bool WebView::evaluateJavaScript(string)
+
+ Evaluates the \a scriptSource JavaScript inside the context of the
+ main web frame, and returns the result of the last executed statement.
+
+ Note that this JavaScript does \e not have any access to QML objects
+ except as made available as windowObjects.
+*/
+QVariant QDeclarativeWebView::evaluateJavaScript(const QString& scriptSource)
+{
+ return this->page()->mainFrame()->evaluateJavaScript(scriptSource);
+}
+
+void QDeclarativeWebView::updateDeclarativeWebViewSize()
+{
+ QSizeF size = d->view->geometry().size() * contentsScale();
+ setImplicitWidth(size.width());
+ setImplicitHeight(size.height());
+}
+
+void QDeclarativeWebView::initialLayout()
+{
+ // nothing useful to do at this point
+}
+
+void QDeclarativeWebView::updateContentsSize()
+{
+ if (page()) {
+ page()->setPreferredContentsSize(QSize(
+ d->preferredwidth>0 ? d->preferredwidth : width(),
+ d->preferredheight>0 ? d->preferredheight : height()));
+ }
+}
+
+void QDeclarativeWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
+{
+ QWebPage* webPage = page();
+ if (newGeometry.size() != oldGeometry.size() && webPage) {
+ QSize contentSize = webPage->preferredContentsSize();
+ if (widthValid())
+ contentSize.setWidth(width());
+ if (heightValid())
+ contentSize.setHeight(height());
+ if (contentSize != webPage->preferredContentsSize())
+ webPage->setPreferredContentsSize(contentSize);
+ }
+ QDeclarativeItem::geometryChanged(newGeometry, oldGeometry);
+}
+
+/*!
+ \qmlproperty list<object> WebView::javaScriptWindowObjects
+
+ A list of QML objects to expose to the web page.
+
+ Each object will be added as a property of the web frame's window object. The
+ property name is controlled by the value of \c WebView.windowObjectName
+ attached property.
+
+ Exposing QML objects to a web page allows JavaScript executing in the web
+ page itself to communicate with QML, by reading and writing properties and
+ by calling methods of the exposed QML objects.
+
+ This example shows how to call into a QML method using a window object.
+
+ \qml
+ WebView {
+ javaScriptWindowObjects: QtObject {
+ WebView.windowObjectName: "qml"
+
+ function qmlCall() {
+ console.log("This call is in QML!");
+ }
+ }
+
+ html: "<script>console.log(\"This is in WebKit!\"); window.qml.qmlCall();</script>"
+ }
+ \endqml
+
+ The output of the example will be:
+ \code
+ This is in WebKit!
+ This call is in QML!
+ \endcode
+
+ If Javascript is not enabled for the page, then this property does nothing.
+*/
+QDeclarativeListProperty<QObject> QDeclarativeWebView::javaScriptWindowObjects()
+{
+ return QDeclarativeListProperty<QObject>(this, d, &QDeclarativeWebViewPrivate::windowObjectsAppend);
+}
+
+QDeclarativeWebViewAttached* QDeclarativeWebView::qmlAttachedProperties(QObject* o)
+{
+ return new QDeclarativeWebViewAttached(o);
+}
+
+void QDeclarativeWebViewPrivate::updateWindowObjects()
+{
+ if (!q->isComponentCompletePublic() || !q->page())
+ return;
+
+ for (int i = 0; i < windowObjects.count(); ++i) {
+ QObject* object = windowObjects.at(i);
+ QDeclarativeWebViewAttached* attached = static_cast<QDeclarativeWebViewAttached *>(qmlAttachedPropertiesObject<QDeclarativeWebView>(object));
+ if (attached && !attached->windowObjectName().isEmpty())
+ q->page()->mainFrame()->addToJavaScriptWindowObject(attached->windowObjectName(), object);
+ }
+}
+
+bool QDeclarativeWebView::renderingEnabled() const
+{
+ return d->rendering;
+}
+
+void QDeclarativeWebView::setRenderingEnabled(bool enabled)
+{
+ if (d->rendering == enabled)
+ return;
+ d->rendering = enabled;
+ emit renderingEnabledChanged();
+ d->view->setTiledBackingStoreFrozen(!enabled);
+}
+
+/*!
+ \qmlsignal WebView::onDoubleClick(clickx, clicky)
+
+ The WebView does not pass double-click events to the web engine, but rather
+ emits this signals.
+*/
+
+/*!
+ \qmlmethod bool WebView::heuristicZoom(clickX,clickY,maxzoom)
+
+ Finds a zoom that:
+ \list
+ \i shows a whole item
+ \i includes (\a clickX, \a clickY)
+ \i fits into the preferredWidth and preferredHeight
+ \i zooms by no more than \a maxZoom
+ \i is more than 10% above the current zoom
+ \endlist
+
+ If such a zoom exists, emits zoomTo(zoom,centerX,centerY) and returns true; otherwise,
+ no signal is emitted and returns false.
+*/
+bool QDeclarativeWebView::heuristicZoom(int clickX, int clickY, qreal maxZoom)
+{
+ if (contentsScale() >= maxZoom / scale())
+ return false;
+ qreal ozf = contentsScale();
+ QRect showArea = elementAreaAt(clickX, clickY, d->preferredwidth / maxZoom, d->preferredheight / maxZoom);
+ qreal z = qMin(qreal(d->preferredwidth) / showArea.width(), qreal(d->preferredheight) / showArea.height());
+ if (z > maxZoom / scale())
+ z = maxZoom / scale();
+ if (z / ozf > 1.2) {
+ QRectF r(showArea.left() * z, showArea.top() * z, showArea.width() * z, showArea.height() * z);
+ emit zoomTo(z, r.x() + r.width() / 2, r.y() + r.height() / 2);
+ return true;
+ }
+ return false;
+}
+
+/*!
+ \qmlproperty int WebView::pressGrabTime
+
+ The number of milliseconds the user must press before the WebView
+ starts passing move events through to the web engine (rather than
+ letting other QML elements such as a Flickable take them).
+
+ Defaults to 400ms. Set to 0 to always grab and pass move events to
+ the web engine.
+*/
+int QDeclarativeWebView::pressGrabTime() const
+{
+ return d->view->pressTime;
+}
+
+void QDeclarativeWebView::setPressGrabTime(int millis)
+{
+ if (d->view->pressTime == millis)
+ return;
+ d->view->pressTime = millis;
+ emit pressGrabTimeChanged();
+}
+
+#ifndef QT_NO_ACTION
+/*!
+ \qmlproperty action WebView::back
+ This property holds the action for causing the previous URL in the history to be displayed.
+*/
+QAction* QDeclarativeWebView::backAction() const
+{
+ return page()->action(QWebPage::Back);
+}
+
+/*!
+ \qmlproperty action WebView::forward
+ This property holds the action for causing the next URL in the history to be displayed.
+*/
+QAction* QDeclarativeWebView::forwardAction() const
+{
+ return page()->action(QWebPage::Forward);
+}
+
+/*!
+ \qmlproperty action WebView::reload
+ This property holds the action for reloading with the current URL
+*/
+QAction* QDeclarativeWebView::reloadAction() const
+{
+ return page()->action(QWebPage::Reload);
+}
+
+/*!
+ \qmlproperty action WebView::stop
+ This property holds the action for stopping loading with the current URL
+*/
+QAction* QDeclarativeWebView::stopAction() const
+{
+ return page()->action(QWebPage::Stop);
+}
+#endif // QT_NO_ACTION
+
+/*!
+ \qmlproperty real WebView::title
+ This property holds the title of the web page currently viewed
+
+ By default, this property contains an empty string.
+*/
+QString QDeclarativeWebView::title() const
+{
+ return page()->mainFrame()->title();
+}
+
+/*!
+ \qmlproperty pixmap WebView::icon
+ This property holds the icon associated with the web page currently viewed
+*/
+QPixmap QDeclarativeWebView::icon() const
+{
+ return page()->mainFrame()->icon().pixmap(QSize(256, 256));
+}
+
+/*!
+ \qmlproperty string WebView::statusText
+
+ This property is the current status suggested by the current web page. In a web browser,
+ such status is often shown in some kind of status bar.
+*/
+void QDeclarativeWebView::setStatusText(const QString& text)
+{
+ d->statusText = text;
+ emit statusTextChanged();
+}
+
+void QDeclarativeWebView::windowObjectCleared()
+{
+ d->updateWindowObjects();
+}
+
+QString QDeclarativeWebView::statusText() const
+{
+ return d->statusText;
+}
+
+QWebPage* QDeclarativeWebView::page() const
+{
+ return d->view->page();
+}
+
+// The QObject interface to settings().
+/*!
+ \qmlproperty string WebView::settings.standardFontFamily
+ \qmlproperty string WebView::settings.fixedFontFamily
+ \qmlproperty string WebView::settings.serifFontFamily
+ \qmlproperty string WebView::settings.sansSerifFontFamily
+ \qmlproperty string WebView::settings.cursiveFontFamily
+ \qmlproperty string WebView::settings.fantasyFontFamily
+
+ \qmlproperty int WebView::settings.minimumFontSize
+ \qmlproperty int WebView::settings.minimumLogicalFontSize
+ \qmlproperty int WebView::settings.defaultFontSize
+ \qmlproperty int WebView::settings.defaultFixedFontSize
+
+ \qmlproperty bool WebView::settings.autoLoadImages
+ \qmlproperty bool WebView::settings.javascriptEnabled
+ \qmlproperty bool WebView::settings.javaEnabled
+ \qmlproperty bool WebView::settings.pluginsEnabled
+ \qmlproperty bool WebView::settings.privateBrowsingEnabled
+ \qmlproperty bool WebView::settings.javascriptCanOpenWindows
+ \qmlproperty bool WebView::settings.javascriptCanAccessClipboard
+ \qmlproperty bool WebView::settings.developerExtrasEnabled
+ \qmlproperty bool WebView::settings.linksIncludedInFocusChain
+ \qmlproperty bool WebView::settings.zoomTextOnly
+ \qmlproperty bool WebView::settings.printElementBackgrounds
+ \qmlproperty bool WebView::settings.offlineStorageDatabaseEnabled
+ \qmlproperty bool WebView::settings.offlineWebApplicationCacheEnabled
+ \qmlproperty bool WebView::settings.localStorageDatabaseEnabled
+ \qmlproperty bool WebView::settings.localContentCanAccessRemoteUrls
+
+ These properties give access to the settings controlling the web view.
+
+ See QWebSettings for details of these properties.
+
+ \qml
+ WebView {
+ settings.pluginsEnabled: true
+ settings.standardFontFamily: "Arial"
+ ...
+ }
+ \endqml
+*/
+QDeclarativeWebSettings* QDeclarativeWebView::settingsObject() const
+{
+ d->settings.s = page()->settings();
+ return &d->settings;
+}
+
+void QDeclarativeWebView::setPage(QWebPage* page)
+{
+ if (d->view->page() == page)
+ return;
+
+ d->view->setPage(page);
+ updateContentsSize();
+ page->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+ page->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
+ connect(page->mainFrame(), SIGNAL(urlChanged(QUrl)), this, SLOT(pageUrlChanged()));
+ connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(titleChanged(QString)));
+ connect(page->mainFrame(), SIGNAL(titleChanged(QString)), this, SIGNAL(iconChanged()));
+ connect(page->mainFrame(), SIGNAL(iconChanged()), this, SIGNAL(iconChanged()));
+ connect(page->mainFrame(), SIGNAL(initialLayoutCompleted()), this, SLOT(initialLayout()));
+ connect(page->mainFrame(), SIGNAL(contentsSizeChanged(QSize)), this, SIGNAL(contentsSizeChanged(QSize)));
+
+ connect(page, SIGNAL(loadStarted()), this, SLOT(doLoadStarted()));
+ connect(page, SIGNAL(loadProgress(int)), this, SLOT(doLoadProgress(int)));
+ connect(page, SIGNAL(loadFinished(bool)), this, SLOT(doLoadFinished(bool)));
+ connect(page, SIGNAL(statusBarMessage(QString)), this, SLOT(setStatusText(QString)));
+
+ connect(page->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(windowObjectCleared()));
+
+ page->settings()->setAttribute(QWebSettings::TiledBackingStoreEnabled, true);
+
+}
+
+/*!
+ \qmlsignal WebView::onLoadStarted()
+
+ This handler is called when the web engine begins loading
+ a page. Later, WebView::onLoadFinished() or WebView::onLoadFailed()
+ will be emitted.
+*/
+
+/*!
+ \qmlsignal WebView::onLoadFinished()
+
+ This handler is called when the web engine \e successfully
+ finishes loading a page, including any component content
+ (WebView::onLoadFailed() will be emitted otherwise).
+
+ \sa progress
+*/
+
+/*!
+ \qmlsignal WebView::onLoadFailed()
+
+ This handler is called when the web engine fails loading
+ a page or any component content
+ (WebView::onLoadFinished() will be emitted on success).
+*/
+
+void QDeclarativeWebView::load(const QNetworkRequest& request, QNetworkAccessManager::Operation operation, const QByteArray& body)
+{
+ page()->mainFrame()->load(request, operation, body);
+}
+
+QString QDeclarativeWebView::html() const
+{
+ return page()->mainFrame()->toHtml();
+}
+
+/*!
+ \qmlproperty string WebView::html
+ This property holds HTML text set directly
+
+ The html property can be set as a string.
+
+ \qml
+ WebView {
+ html: "<p>This is <b>HTML</b>."
+ }
+ \endqml
+*/
+void QDeclarativeWebView::setHtml(const QString& html, const QUrl& baseUrl)
+{
+ updateContentsSize();
+ if (isComponentComplete())
+ page()->mainFrame()->setHtml(html, baseUrl);
+ else {
+ d->pending = d->PendingHtml;
+ d->pendingUrl = baseUrl;
+ d->pendingString = html;
+ }
+ emit htmlChanged();
+}
+
+void QDeclarativeWebView::setContent(const QByteArray& data, const QString& mimeType, const QUrl& baseUrl)
+{
+ updateContentsSize();
+
+ if (isComponentComplete())
+ page()->mainFrame()->setContent(data, mimeType, qmlContext(this)->resolvedUrl(baseUrl));
+ else {
+ d->pending = d->PendingContent;
+ d->pendingUrl = baseUrl;
+ d->pendingString = mimeType;
+ d->pendingData = data;
+ }
+}
+
+QWebHistory* QDeclarativeWebView::history() const
+{
+ return page()->history();
+}
+
+QWebSettings* QDeclarativeWebView::settings() const
+{
+ return page()->settings();
+}
+
+QDeclarativeWebView* QDeclarativeWebView::createWindow(QWebPage::WebWindowType type)
+{
+ switch (type) {
+ case QWebPage::WebBrowserWindow: {
+ if (!d->newWindowComponent && d->newWindowParent)
+ qWarning("WebView::newWindowComponent not set - WebView::newWindowParent ignored");
+ else if (d->newWindowComponent && !d->newWindowParent)
+ qWarning("WebView::newWindowParent not set - WebView::newWindowComponent ignored");
+ else if (d->newWindowComponent && d->newWindowParent) {
+ QDeclarativeWebView* webview = 0;
+ QDeclarativeContext* windowContext = new QDeclarativeContext(qmlContext(this));
+
+ QObject* newObject = d->newWindowComponent->create(windowContext);
+ if (newObject) {
+ windowContext->setParent(newObject);
+ QDeclarativeItem* item = qobject_cast<QDeclarativeItem *>(newObject);
+ if (!item)
+ delete newObject;
+ else {
+ webview = item->findChild<QDeclarativeWebView*>();
+ if (!webview)
+ delete item;
+ else {
+ newObject->setParent(d->newWindowParent);
+ static_cast<QGraphicsObject*>(item)->setParentItem(d->newWindowParent);
+ }
+ }
+ } else
+ delete windowContext;
+
+ return webview;
+ }
+ }
+ break;
+ case QWebPage::WebModalDialog: {
+ // Not supported
+ }
+ }
+ return 0;
+}
+
+/*!
+ \qmlproperty component WebView::newWindowComponent
+
+ This property holds the component to use for new windows.
+ The component must have a WebView somewhere in its structure.
+
+ When the web engine requests a new window, it will be an instance of
+ this component.
+
+ The parent of the new window is set by newWindowParent. It must be set.
+*/
+QDeclarativeComponent* QDeclarativeWebView::newWindowComponent() const
+{
+ return d->newWindowComponent;
+}
+
+void QDeclarativeWebView::setNewWindowComponent(QDeclarativeComponent* newWindow)
+{
+ if (newWindow == d->newWindowComponent)
+ return;
+ d->newWindowComponent = newWindow;
+ emit newWindowComponentChanged();
+}
+
+
+/*!
+ \qmlproperty item WebView::newWindowParent
+
+ The parent item for new windows.
+
+ \sa newWindowComponent
+*/
+QDeclarativeItem* QDeclarativeWebView::newWindowParent() const
+{
+ return d->newWindowParent;
+}
+
+void QDeclarativeWebView::setNewWindowParent(QDeclarativeItem* parent)
+{
+ if (parent == d->newWindowParent)
+ return;
+ if (d->newWindowParent && parent) {
+ QList<QGraphicsItem *> children = d->newWindowParent->childItems();
+ for (int i = 0; i < children.count(); ++i)
+ children.at(i)->setParentItem(parent);
+ }
+ d->newWindowParent = parent;
+ emit newWindowParentChanged();
+}
+
+QSize QDeclarativeWebView::contentsSize() const
+{
+ return page()->mainFrame()->contentsSize() * contentsScale();
+}
+
+qreal QDeclarativeWebView::contentsScale() const
+{
+ return d->view->scale();
+}
+
+void QDeclarativeWebView::setContentsScale(qreal scale)
+{
+ if (scale == d->view->scale())
+ return;
+ d->view->setScale(scale);
+ updateDeclarativeWebViewSize();
+ emit contentsScaleChanged();
+}
+
+/*!
+ Returns the area of the largest element at position (\a x,\a y) that is no larger
+ than \a maxWidth by \a maxHeight pixels.
+
+ May return an area larger in the case when no smaller element is at the position.
+*/
+QRect QDeclarativeWebView::elementAreaAt(int x, int y, int maxWidth, int maxHeight) const
+{
+ QWebHitTestResult hit = page()->mainFrame()->hitTestContent(QPoint(x, y));
+ QRect hitRect = hit.boundingRect();
+ QWebElement element = hit.enclosingBlockElement();
+ if (maxWidth <= 0)
+ maxWidth = INT_MAX;
+ if (maxHeight <= 0)
+ maxHeight = INT_MAX;
+ while (!element.parent().isNull() && element.geometry().width() <= maxWidth && element.geometry().height() <= maxHeight) {
+ hitRect = element.geometry();
+ element = element.parent();
+ }
+ return hitRect;
+}
+
+/*!
+ \internal
+ \class QDeclarativeWebPage
+ \brief The QDeclarativeWebPage class is a QWebPage that can create QML plugins.
+
+ \sa QDeclarativeWebView
+*/
+QDeclarativeWebPage::QDeclarativeWebPage(QDeclarativeWebView* parent) :
+ QWebPage(parent)
+{
+}
+
+QDeclarativeWebPage::~QDeclarativeWebPage()
+{
+}
+
+QString QDeclarativeWebPage::chooseFile(QWebFrame* originatingFrame, const QString& oldFile)
+{
+ // Not supported (it's modal)
+ Q_UNUSED(originatingFrame)
+ Q_UNUSED(oldFile)
+ return oldFile;
+}
+
+/*!
+ \qmlsignal WebView::onAlert(message)
+
+ The handler is called when the web engine sends a JavaScript alert. The \a message is the text
+ to be displayed in the alert to the user.
+*/
+
+
+void QDeclarativeWebPage::javaScriptAlert(QWebFrame* originatingFrame, const QString& msg)
+{
+ Q_UNUSED(originatingFrame)
+ emit viewItem()->alert(msg);
+}
+
+bool QDeclarativeWebPage::javaScriptConfirm(QWebFrame* originatingFrame, const QString& msg)
+{
+ // Not supported (it's modal)
+ Q_UNUSED(originatingFrame)
+ Q_UNUSED(msg)
+ return false;
+}
+
+bool QDeclarativeWebPage::javaScriptPrompt(QWebFrame* originatingFrame, const QString& msg, const QString& defaultValue, QString* result)
+{
+ // Not supported (it's modal)
+ Q_UNUSED(originatingFrame)
+ Q_UNUSED(msg)
+ Q_UNUSED(defaultValue)
+ Q_UNUSED(result)
+ return false;
+}
+
+
+QDeclarativeWebView* QDeclarativeWebPage::viewItem()
+{
+ return static_cast<QDeclarativeWebView*>(parent());
+}
+
+QWebPage* QDeclarativeWebPage::createWindow(WebWindowType type)
+{
+ QDeclarativeWebView* newView = viewItem()->createWindow(type);
+ if (newView)
+ return newView->page();
+ return 0;
+}
+
+QT_END_NAMESPACE
+
diff --git a/WebKit/qt/declarative/qdeclarativewebview_p.h b/WebKit/qt/declarative/qdeclarativewebview_p.h
new file mode 100644
index 0000000..b2055bf
--- /dev/null
+++ b/WebKit/qt/declarative/qdeclarativewebview_p.h
@@ -0,0 +1,371 @@
+/*
+ Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+*/
+
+
+#ifndef qdeclarativewebview_p_h
+#define qdeclarativewebview_p_h
+
+#include <QtCore/QBasicTimer>
+#include <QtCore/QUrl>
+#include <QtDeclarative/QDeclarativeItem>
+#include <QtGui/QAction>
+#include <QtNetwork/QNetworkAccessManager>
+#include "qgraphicswebview.h"
+#include "qwebpage.h"
+
+
+QT_BEGIN_HEADER
+
+class QWebHistory;
+class QWebSettings;
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+class QDeclarativeWebSettings;
+class QDeclarativeWebViewPrivate;
+class QNetworkRequest;
+class QDeclarativeWebView;
+class QDeclarativeWebViewPrivate;
+
+class QDeclarativeWebPage : public QWebPage {
+ Q_OBJECT
+public:
+ explicit QDeclarativeWebPage(QDeclarativeWebView *parent);
+ ~QDeclarativeWebPage();
+protected:
+ QWebPage *createWindow(WebWindowType type);
+ QString chooseFile(QWebFrame *originatingFrame, const QString& oldFile);
+ void javaScriptAlert(QWebFrame *originatingFrame, const QString& msg);
+ bool javaScriptConfirm(QWebFrame *originatingFrame, const QString& msg);
+ bool javaScriptPrompt(QWebFrame *originatingFrame, const QString& msg, const QString& defaultValue, QString* result);
+
+private:
+ QDeclarativeWebView *viewItem();
+};
+
+class GraphicsWebView : public QGraphicsWebView {
+ Q_OBJECT
+public:
+ GraphicsWebView(QDeclarativeWebView* parent = 0);
+protected:
+ void mousePressEvent(QGraphicsSceneMouseEvent* event);
+ void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
+ void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
+ void timerEvent(QTimerEvent* event);
+Q_SIGNALS:
+ void doubleClick(int clickX, int clickY);
+private:
+ QDeclarativeWebView *parent;
+ QPointF pressPoint;
+ QBasicTimer pressTimer;
+ int pressTime; // milliseconds before the touch event becomes a "tap and hold"
+ friend class QDeclarativeWebView;
+};
+
+class QDeclarativeWebViewAttached;
+
+// TODO: browser plugins
+
+class QDeclarativeWebView : public QDeclarativeItem {
+ Q_OBJECT
+
+ Q_ENUMS(Status SelectionMode)
+
+ Q_PROPERTY(QString title READ title NOTIFY titleChanged)
+ Q_PROPERTY(QPixmap icon READ icon NOTIFY iconChanged)
+ Q_PROPERTY(QString statusText READ statusText NOTIFY statusTextChanged)
+
+ Q_PROPERTY(QString html READ html WRITE setHtml NOTIFY htmlChanged)
+
+ Q_PROPERTY(int pressGrabTime READ pressGrabTime WRITE setPressGrabTime NOTIFY pressGrabTimeChanged)
+
+ Q_PROPERTY(int preferredWidth READ preferredWidth WRITE setPreferredWidth NOTIFY preferredWidthChanged)
+ Q_PROPERTY(int preferredHeight READ preferredHeight WRITE setPreferredHeight NOTIFY preferredHeightChanged)
+ Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged)
+ Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged)
+ Q_PROPERTY(Status status READ status NOTIFY statusChanged)
+
+#ifndef QT_NO_ACTION
+ Q_PROPERTY(QAction* reload READ reloadAction CONSTANT)
+ Q_PROPERTY(QAction* back READ backAction CONSTANT)
+ Q_PROPERTY(QAction* forward READ forwardAction CONSTANT)
+ Q_PROPERTY(QAction* stop READ stopAction CONSTANT)
+#endif
+
+ Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT)
+
+ Q_PROPERTY(QDeclarativeListProperty<QObject> javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT)
+
+ Q_PROPERTY(QDeclarativeComponent* newWindowComponent READ newWindowComponent WRITE setNewWindowComponent NOTIFY newWindowComponentChanged)
+ Q_PROPERTY(QDeclarativeItem* newWindowParent READ newWindowParent WRITE setNewWindowParent NOTIFY newWindowParentChanged)
+
+ Q_PROPERTY(bool renderingEnabled READ renderingEnabled WRITE setRenderingEnabled NOTIFY renderingEnabledChanged)
+
+ Q_PROPERTY(QSize contentsSize READ contentsSize NOTIFY contentsSizeChanged)
+ Q_PROPERTY(qreal contentsScale READ contentsScale WRITE setContentsScale NOTIFY contentsScaleChanged)
+
+public:
+ QDeclarativeWebView(QDeclarativeItem *parent = 0);
+ ~QDeclarativeWebView();
+
+ QUrl url() const;
+ void setUrl(const QUrl &);
+
+ QString title() const;
+
+ QPixmap icon() const;
+
+ Q_INVOKABLE bool heuristicZoom(int clickX, int clickY, qreal maxzoom);
+ QRect elementAreaAt(int x, int y, int minwidth, int minheight) const;
+
+ int pressGrabTime() const;
+ void setPressGrabTime(int);
+
+ int preferredWidth() const;
+ void setPreferredWidth(int);
+ int preferredHeight() const;
+ void setPreferredHeight(int);
+
+ enum Status { Null, Ready, Loading, Error };
+ Status status() const;
+ qreal progress() const;
+ QString statusText() const;
+
+#ifndef QT_NO_ACTION
+ QAction *reloadAction() const;
+ QAction *backAction() const;
+ QAction *forwardAction() const;
+ QAction *stopAction() const;
+#endif
+
+ QWebPage *page() const;
+ void setPage(QWebPage *page);
+
+ void load(const QNetworkRequest &request,
+ QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
+ const QByteArray &body = QByteArray());
+
+ QString html() const;
+
+ void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
+ void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
+
+ QWebHistory* history() const;
+ QWebSettings* settings() const;
+ QDeclarativeWebSettings *settingsObject() const;
+
+ bool renderingEnabled() const;
+ void setRenderingEnabled(bool);
+
+ QDeclarativeListProperty<QObject> javaScriptWindowObjects();
+
+ static QDeclarativeWebViewAttached* qmlAttachedProperties(QObject*);
+
+ QDeclarativeComponent *newWindowComponent() const;
+ void setNewWindowComponent(QDeclarativeComponent *newWindow);
+ QDeclarativeItem* newWindowParent() const;
+ void setNewWindowParent(QDeclarativeItem* newWindow);
+
+ bool isComponentCompletePublic() const { return isComponentComplete(); }
+
+ QSize contentsSize() const;
+
+ void setContentsScale(qreal scale);
+ qreal contentsScale() const;
+
+Q_SIGNALS:
+ void preferredWidthChanged();
+ void preferredHeightChanged();
+ void urlChanged();
+ void progressChanged();
+ void statusChanged(Status);
+ void titleChanged(const QString&);
+ void iconChanged();
+ void statusTextChanged();
+ void htmlChanged();
+ void pressGrabTimeChanged();
+ void newWindowComponentChanged();
+ void newWindowParentChanged();
+ void renderingEnabledChanged();
+ void contentsSizeChanged(const QSize&);
+ void contentsScaleChanged();
+
+ void loadStarted();
+ void loadFinished();
+ void loadFailed();
+
+ void doubleClick(int clickX, int clickY);
+
+ void zoomTo(qreal zoom, int centerX, int centerY);
+
+ void alert(const QString& message);
+
+public Q_SLOTS:
+ QVariant evaluateJavaScript(const QString&);
+
+private Q_SLOTS:
+ void doLoadStarted();
+ void doLoadProgress(int p);
+ void doLoadFinished(bool ok);
+ void setStatusText(const QString&);
+ void windowObjectCleared();
+ void pageUrlChanged();
+ void initialLayout();
+
+ void updateDeclarativeWebViewSize();
+
+ virtual void geometryChanged(const QRectF &newGeometry,
+ const QRectF &oldGeometry);
+ QDeclarativeWebView* createWindow(QWebPage::WebWindowType type);
+
+private:
+ void updateContentsSize();
+ void init();
+ virtual void componentComplete();
+ Q_DISABLE_COPY(QDeclarativeWebView)
+ QDeclarativeWebViewPrivate* d;
+ QMouseEvent* sceneMouseEventToMouseEvent(QGraphicsSceneMouseEvent*);
+ QMouseEvent* sceneHoverMoveEventToMouseEvent(QGraphicsSceneHoverEvent*);
+ friend class QDeclarativeWebPage;
+};
+
+class QDeclarativeWebViewAttached : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QString windowObjectName READ windowObjectName WRITE setWindowObjectName)
+public:
+ QDeclarativeWebViewAttached(QObject* parent)
+ : QObject(parent)
+ {
+ }
+
+ QString windowObjectName() const
+ {
+ return m_windowObjectName;
+ }
+
+ void setWindowObjectName(const QString &n)
+ {
+ m_windowObjectName = n;
+ }
+
+private:
+ QString m_windowObjectName;
+};
+
+class QDeclarativeWebSettings : public QObject {
+ Q_OBJECT
+
+ Q_PROPERTY(QString standardFontFamily READ standardFontFamily WRITE setStandardFontFamily)
+ Q_PROPERTY(QString fixedFontFamily READ fixedFontFamily WRITE setFixedFontFamily)
+ Q_PROPERTY(QString serifFontFamily READ serifFontFamily WRITE setSerifFontFamily)
+ Q_PROPERTY(QString sansSerifFontFamily READ sansSerifFontFamily WRITE setSansSerifFontFamily)
+ Q_PROPERTY(QString cursiveFontFamily READ cursiveFontFamily WRITE setCursiveFontFamily)
+ Q_PROPERTY(QString fantasyFontFamily READ fantasyFontFamily WRITE setFantasyFontFamily)
+
+ Q_PROPERTY(int minimumFontSize READ minimumFontSize WRITE setMinimumFontSize)
+ Q_PROPERTY(int minimumLogicalFontSize READ minimumLogicalFontSize WRITE setMinimumLogicalFontSize)
+ Q_PROPERTY(int defaultFontSize READ defaultFontSize WRITE setDefaultFontSize)
+ Q_PROPERTY(int defaultFixedFontSize READ defaultFixedFontSize WRITE setDefaultFixedFontSize)
+
+ Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages)
+ Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled)
+ Q_PROPERTY(bool javaEnabled READ javaEnabled WRITE setJavaEnabled)
+ Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled)
+ Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled)
+ Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows)
+ Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard)
+ Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled)
+ Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain)
+ Q_PROPERTY(bool zoomTextOnly READ zoomTextOnly WRITE setZoomTextOnly)
+ Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds)
+ Q_PROPERTY(bool offlineStorageDatabaseEnabled READ offlineStorageDatabaseEnabled WRITE setOfflineStorageDatabaseEnabled)
+ Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled)
+ Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled)
+ Q_PROPERTY(bool localContentCanAccessRemoteUrls READ localContentCanAccessRemoteUrls WRITE setLocalContentCanAccessRemoteUrls)
+
+public:
+ QDeclarativeWebSettings() {}
+
+ QString standardFontFamily() const { return s->fontFamily(QWebSettings::StandardFont); }
+ void setStandardFontFamily(const QString& f) { s->setFontFamily(QWebSettings::StandardFont, f); }
+ QString fixedFontFamily() const { return s->fontFamily(QWebSettings::FixedFont); }
+ void setFixedFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FixedFont, f); }
+ QString serifFontFamily() const { return s->fontFamily(QWebSettings::SerifFont); }
+ void setSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SerifFont, f); }
+ QString sansSerifFontFamily() const { return s->fontFamily(QWebSettings::SansSerifFont); }
+ void setSansSerifFontFamily(const QString& f) { s->setFontFamily(QWebSettings::SansSerifFont, f); }
+ QString cursiveFontFamily() const { return s->fontFamily(QWebSettings::CursiveFont); }
+ void setCursiveFontFamily(const QString& f) { s->setFontFamily(QWebSettings::CursiveFont, f); }
+ QString fantasyFontFamily() const { return s->fontFamily(QWebSettings::FantasyFont); }
+ void setFantasyFontFamily(const QString& f) { s->setFontFamily(QWebSettings::FantasyFont, f); }
+
+ int minimumFontSize() const { return s->fontSize(QWebSettings::MinimumFontSize); }
+ void setMinimumFontSize(int size) { s->setFontSize(QWebSettings::MinimumFontSize, size); }
+ int minimumLogicalFontSize() const { return s->fontSize(QWebSettings::MinimumLogicalFontSize); }
+ void setMinimumLogicalFontSize(int size) { s->setFontSize(QWebSettings::MinimumLogicalFontSize, size); }
+ int defaultFontSize() const { return s->fontSize(QWebSettings::DefaultFontSize); }
+ void setDefaultFontSize(int size) { s->setFontSize(QWebSettings::DefaultFontSize, size); }
+ int defaultFixedFontSize() const { return s->fontSize(QWebSettings::DefaultFixedFontSize); }
+ void setDefaultFixedFontSize(int size) { s->setFontSize(QWebSettings::DefaultFixedFontSize, size); }
+
+ bool autoLoadImages() const { return s->testAttribute(QWebSettings::AutoLoadImages); }
+ void setAutoLoadImages(bool on) { s->setAttribute(QWebSettings::AutoLoadImages, on); }
+ bool javascriptEnabled() const { return s->testAttribute(QWebSettings::JavascriptEnabled); }
+ void setJavascriptEnabled(bool on) { s->setAttribute(QWebSettings::JavascriptEnabled, on); }
+ bool javaEnabled() const { return s->testAttribute(QWebSettings::JavaEnabled); }
+ void setJavaEnabled(bool on) { s->setAttribute(QWebSettings::JavaEnabled, on); }
+ bool pluginsEnabled() const { return s->testAttribute(QWebSettings::PluginsEnabled); }
+ void setPluginsEnabled(bool on) { s->setAttribute(QWebSettings::PluginsEnabled, on); }
+ bool privateBrowsingEnabled() const { return s->testAttribute(QWebSettings::PrivateBrowsingEnabled); }
+ void setPrivateBrowsingEnabled(bool on) { s->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); }
+ bool javascriptCanOpenWindows() const { return s->testAttribute(QWebSettings::JavascriptCanOpenWindows); }
+ void setJavascriptCanOpenWindows(bool on) { s->setAttribute(QWebSettings::JavascriptCanOpenWindows, on); }
+ bool javascriptCanAccessClipboard() const { return s->testAttribute(QWebSettings::JavascriptCanAccessClipboard); }
+ void setJavascriptCanAccessClipboard(bool on) { s->setAttribute(QWebSettings::JavascriptCanAccessClipboard, on); }
+ bool developerExtrasEnabled() const { return s->testAttribute(QWebSettings::DeveloperExtrasEnabled); }
+ void setDeveloperExtrasEnabled(bool on) { s->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); }
+ bool linksIncludedInFocusChain() const { return s->testAttribute(QWebSettings::LinksIncludedInFocusChain); }
+ void setLinksIncludedInFocusChain(bool on) { s->setAttribute(QWebSettings::LinksIncludedInFocusChain, on); }
+ bool zoomTextOnly() const { return s->testAttribute(QWebSettings::ZoomTextOnly); }
+ void setZoomTextOnly(bool on) { s->setAttribute(QWebSettings::ZoomTextOnly, on); }
+ bool printElementBackgrounds() const { return s->testAttribute(QWebSettings::PrintElementBackgrounds); }
+ void setPrintElementBackgrounds(bool on) { s->setAttribute(QWebSettings::PrintElementBackgrounds, on); }
+ bool offlineStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled); }
+ void setOfflineStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, on); }
+ bool offlineWebApplicationCacheEnabled() const { return s->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); }
+ void setOfflineWebApplicationCacheEnabled(bool on) { s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, on); }
+ bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); }
+ void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); }
+ bool localContentCanAccessRemoteUrls() const { return s->testAttribute(QWebSettings::LocalContentCanAccessRemoteUrls); }
+ void setLocalContentCanAccessRemoteUrls(bool on) { s->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, on); }
+
+ QWebSettings *s;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(QDeclarativeWebView)
+QML_DECLARE_TYPE(QDeclarativeWebSettings)
+QML_DECLARE_TYPEINFO(QDeclarativeWebView, QML_HAS_ATTACHED_PROPERTIES)
+
+QT_END_HEADER
+
+#endif
diff --git a/WebKit/qt/declarative/qmldir b/WebKit/qt/declarative/qmldir
new file mode 100644
index 0000000..dcfdd06
--- /dev/null
+++ b/WebKit/qt/declarative/qmldir
@@ -0,0 +1 @@
+plugin qmlwebkitplugin
diff --git a/WebKit/qt/docs/qtwebkit-bridge.qdoc b/WebKit/qt/docs/qtwebkit-bridge.qdoc
index fa93293..c2a38fd 100644
--- a/WebKit/qt/docs/qtwebkit-bridge.qdoc
+++ b/WebKit/qt/docs/qtwebkit-bridge.qdoc
@@ -8,7 +8,7 @@
The QtWebKit bridge is a mechanism that extends WebKit's JavaScript environment to access native
objects that are represented as \l{QObject}s. It takes advantage of the \l{QObject} introspection,
- a part of the \l{Qt Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
+ a part of the \l{Object Model}, which makes it easy to integrate with the dynamic JavaScript environment,
for example \l{QObject} properties map directly to JavaScript properties.
For example, both JavaScript and QObjects have properties: a construct that represent a getter/setter
@@ -24,7 +24,7 @@
applications. For example, an application that contains a media-player, playlist manager, and music store.
The playlist manager is usually best authored as a classic desktop application,
with the native-looking robust \l{QWidget}s helping with producing that application.
- The media-player control, which usually looks custom, can be written using \l{The Graphics View framework}
+ The media-player control, which usually looks custom, can be written using the \l{Graphics View framework}
or with in a declarative way with \l{QtDeclarative}. The music store, which shows dynamic content
from the internet and gets modified rapidly, is best authored in HTML and maintained on the server.
diff --git a/WebKit/qt/docs/qtwebkit.qdocconf b/WebKit/qt/docs/qtwebkit.qdocconf
index 292c124..5f877c2 100644
--- a/WebKit/qt/docs/qtwebkit.qdocconf
+++ b/WebKit/qt/docs/qtwebkit.qdocconf
@@ -3,8 +3,8 @@
project = qtwebkit
description = "Qt WebKit API Documentation"
-headerdirs = $SRCDIR/WebKit/qt/Api
-sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/JavaScriptCore/qt/api
+headerdirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/declarative
+sourcedirs = $SRCDIR/WebKit/qt/Api $SRCDIR/WebKit/qt/docs $SRCDIR/JavaScriptCore/qt/api $SRCDIR/WebKit/qt/declarative
outputdir = $OUTPUT_DIR/doc/html
outputformats = HTML
sources.fileextensions = "*.cpp *.doc *.qdoc *.h"
diff --git a/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp b/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
index 62eeeca..6a517c2 100644
--- a/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
+++ b/WebKit/qt/docs/webkitsnippets/qtwebkit_bridge_snippets.cpp
@@ -12,10 +12,10 @@ void wrapInFunction()
//! [1]
{
width: ...,
- height: ...,
- toDataURL: function() { ... },
- assignToHTMLImageElement: function(element) { ... }
- }
+ height: ...,
+ toDataURL: function() { ... },
+ assignToHTMLImageElement: function(element) { ... }
+ }
//! [1]
#endif
//! [2]
@@ -24,7 +24,7 @@ void wrapInFunction()
Q_PROPERTY(QPixmap myPixmap READ getPixmap)
public:
- QPixmap getPixmap() const;
+ QPixmap getPixmap() const;
};
/* ... */
@@ -36,21 +36,22 @@ void wrapInFunction()
#if 0
//! [3]
<html>
- <head>
+ <head>
<script>
- function loadImage() {
- myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement"));
- }
- </script>
- </head>
- <body onload="loadImage()">
- <img id="imageElement" width="300" height="200" />
- </body>
- </html>
- //! [3]
+ function loadImage()
+ {
+ myObject.myPixmap.assignToHTMLImageElement(document.getElementById("imageElement"));
+ }
+ </script>
+ </head>
+ <body onload="loadImage()">
+ <img id="imageElement" width="300" height="200" />
+ </body>
+ </html>
+//! [3]
#endif
- //! [4]
- class MyObject : QObject {
+//! [4]
+class MyObject : QObject {
Q_OBJECT
public slots:
@@ -161,11 +162,7 @@ void wrapInFunction()
myQObject.enabled = !myQObject.enabled;
//! [24]
//! [25]
- myQObject.enabled = true;
-
- ...
-
- myQObject.enabled = !myQObject.enabled;
+ myDialog.okButton
//! [25]
//! [26]
myDialog.okButton
diff --git a/WebKit/qt/examples/platformplugin/WebPlugin.cpp b/WebKit/qt/examples/platformplugin/WebPlugin.cpp
index 1f3877c..c3efb80 100644
--- a/WebKit/qt/examples/platformplugin/WebPlugin.cpp
+++ b/WebKit/qt/examples/platformplugin/WebPlugin.cpp
@@ -221,4 +221,4 @@ bool WebPlugin::supportsExtension(Extension extension) const
return false;
}
-Q_EXPORT_PLUGIN2(qwebselectim, WebPlugin)
+Q_EXPORT_PLUGIN2(platformplugin, WebPlugin)
diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
index bac618c..32d22d4 100644
--- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
+++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
@@ -31,7 +31,7 @@
class QWebSelectData
{
public:
- inline ~QWebSelectData() {}
+ virtual ~QWebSelectData() {}
enum ItemType { Option, Group, Separator };
@@ -48,7 +48,7 @@ class QWebSelectMethod : public QObject
{
Q_OBJECT
public:
- inline ~QWebSelectMethod() {}
+ virtual ~QWebSelectMethod() {}
virtual void show(const QWebSelectData&) = 0;
virtual void hide() = 0;
@@ -61,6 +61,8 @@ Q_SIGNALS:
class QWebNotificationData
{
public:
+ virtual ~QWebNotificationData() {}
+
virtual const QString title() const = 0;
virtual const QString message() const = 0;
virtual const QByteArray iconData() const = 0;
diff --git a/WebKit/qt/symbian/eabi/QtWebKitu.def b/WebKit/qt/symbian/eabi/QtWebKitu.def
index 93fd33c..3fefb4d 100644
--- a/WebKit/qt/symbian/eabi/QtWebKitu.def
+++ b/WebKit/qt/symbian/eabi/QtWebKitu.def
@@ -760,7 +760,7 @@ EXPORTS
_ZN23DumpRenderTreeSupportQt27setTimelineProfilingEnabledEP8QWebPageb @759 NONAME
_ZN23DumpRenderTreeSupportQt28setDumpRenderTreeModeEnabledEb @760 NONAME
_ZN23DumpRenderTreeSupportQt29dumpResourceLoadCallbacksPathERK7QString @761 NONAME
- _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME
+ _ZN23DumpRenderTreeSupportQt29evaluateScriptInIsolatedWorldEP9QWebFrameiRK7QString @762 NONAME ABSENT
_ZN23DumpRenderTreeSupportQt29setJavaScriptProfilingEnabledEP9QWebFrameb @763 NONAME
_ZN23DumpRenderTreeSupportQt29setWillSendRequestReturnsNullEb @764 NONAME
_ZN23DumpRenderTreeSupportQt30setWillSendRequestClearHeadersERK11QStringList @765 NONAME
@@ -776,3 +776,9 @@ EXPORTS
_ZN23DumpRenderTreeSupportQt26setCheckPermissionFunctionEPFvP7QObjectRK4QUrlR22NotificationPermissionE @ 775 NONAME
_ZN23DumpRenderTreeSupportQt28setRequestPermissionFunctionEPFvP7QObjectRK7QStringE @ 776 NONAME
_ZN23DumpRenderTreeSupportQt31removeWhiteListAccessFromOriginERK7QStringS2_S2_b @ 777 NONAME
+ _ZN23DumpRenderTreeSupportQt11shouldCloseEP9QWebFrame @ 778 NONAME
+ _ZN23DumpRenderTreeSupportQt12isTargetItemERK15QWebHistoryItem @ 779 NONAME
+ _ZN23DumpRenderTreeSupportQt17historyItemTargetERK15QWebHistoryItem @ 780 NONAME
+ _ZN23DumpRenderTreeSupportQt20getChildHistoryItemsERK15QWebHistoryItem @ 781 NONAME
+ _ZN23DumpRenderTreeSupportQt23setMockGeolocationErrorEiRK7QString @ 782 NONAME
+ _ZN23DumpRenderTreeSupportQt26setMockGeolocationPositionEddd @ 783 NONAME
diff --git a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
index 49a606b..783214c 100644
--- a/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
+++ b/WebKit/qt/tests/qwebhistory/tst_qwebhistory.cpp
@@ -84,7 +84,7 @@ void tst_QWebHistory::init()
{
page = new QWebPage(this);
frame = page->mainFrame();
- connect(page, SIGNAL(loadFinished(bool)), &waitForLoadFinished, SLOT(quit()));
+ connect(page, SIGNAL(loadFinished(bool)), &waitForLoadFinished, SLOT(quit()), Qt::QueuedConnection);
for (int i = 1;i < 6;i++) {
loadPage(i);
@@ -126,6 +126,7 @@ void tst_QWebHistory::back()
}
//try one more time (too many). crash test
hist->back();
+ QCOMPARE(page->mainFrame()->toPlainText(), QString("page1"));
}
/**
@@ -146,6 +147,7 @@ void tst_QWebHistory::forward()
}
//try one more time (too many). crash test
hist->forward();
+ QCOMPARE(page->mainFrame()->toPlainText(), QString("page") + QString::number(histsize));
}
/**
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index 85f67b6..18f2d73 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,82 @@
+2010-06-21 Nate Chapin <japhet@chromium.org>
+
+ Unreviewed, Windows build fix.
+
+ Update WebFrame to use FrameLoaderStateMachine in
+ firstLayoutDone().
+
+ * WebFrame.cpp:
+ (WebFrame::firstLayoutDone):
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * WebView.cpp:
+ (WebView::notifyPreferencesChanged):
+
+2010-06-16 Adam Roben <aroben@apple.com>
+
+ Add a "forPrinting" boolean parameter to
+ IWebFramePrivate::renderTreeAsExternalRepresentation
+
+ Fixes <http://webkit.org/b/40727> Respect
+ LayoutTestController::isPrinting on Windows.
+
+ Reviewed by Dan Bernstein.
+
+ * Interfaces/IWebFramePrivate.idl: Renamed the current
+ renderTreeAsExternalRepresentation to unused1, and added a new version
+ that takes a boolean "forPrinting" parameter.
+
+ * Interfaces/WebKit.idl: Touched to force a build.
+
+ * WebFrame.cpp:
+ (WebFrame::renderTreeAsExternalRepresentation): Added a boolean
+ "forPrinting" parameter, and used it to tell externalRepresentation
+ what kind of behavior to use.
+
+ * WebFrame.h: Renamed the old renderTreeAsExternalRepresentation and
+ added the new one.
+
+2010-06-15 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions out of Frame class that were marked "move to Chrome"
+ https://bugs.webkit.org/show_bug.cgi?id=39636
+
+ * WebView.cpp:
+ (WebView::shouldClose): Call shouldClose on FrameLoader instead of
+ going through Frame.
+
+2010-06-14 Adam Roben <aroben@apple.com>
+
+ Add WebKitLauncherWin to WebKit.sln
+
+ Fixes <http://webkit.org/b/40583>.
+
+ Reviewed by Darin Adler.
+
+ * WebKit.vcproj/WebKit.sln: Added WebKitLauncherWin.vcproj. It depends
+ on WebKitAPITest, so is the last project to build. (Also removed
+ QTMovieWin's direct dependency on JavaScriptCore, since it already has
+ an indirect dependency on it.)
+
+2010-06-14 Chang Shu <chang.shu@nokia.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [win] Make windows compile after API changes.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40434
+
+ * WebKitGraphics.cpp:
+ (WebDrawText):
+
2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/win/Interfaces/IWebFramePrivate.idl b/WebKit/win/Interfaces/IWebFramePrivate.idl
index 1b7209d..b04edfe 100755
--- a/WebKit/win/Interfaces/IWebFramePrivate.idl
+++ b/WebKit/win/Interfaces/IWebFramePrivate.idl
@@ -57,7 +57,7 @@ typedef enum {
interface IWebFramePrivate : IUnknown
{
- HRESULT renderTreeAsExternalRepresentation([out, retval] BSTR* result);
+ HRESULT unused1([out, retval] BSTR*);
HRESULT scrollOffset([out, retval] SIZE* offset);
// FIXME: This shouldn't be needed once IWebDocumentView is implemented.
@@ -112,4 +112,6 @@ interface IWebFramePrivate : IUnknown
HRESULT layerTreeAsText([out, retval] BSTR* result);
HRESULT paintScrollViewRectToContextAtPoint([in] RECT rect, [in] POINT pt, [in] OLE_HANDLE deviceContext);
+
+ HRESULT renderTreeAsExternalRepresentation([in] BOOL forPrinting, [out, retval] BSTR* result);
}
diff --git a/WebKit/win/Interfaces/WebKit.idl b/WebKit/win/Interfaces/WebKit.idl
index d25cdfe..98f5da8 100644
--- a/WebKit/win/Interfaces/WebKit.idl
+++ b/WebKit/win/Interfaces/WebKit.idl
@@ -300,3 +300,4 @@ library WebKit
[default] interface IWebUserContentURLPattern;
}
}
+
diff --git a/WebKit/win/WebFrame.cpp b/WebKit/win/WebFrame.cpp
index 75a9c8d..5705f1e 100644
--- a/WebKit/win/WebFrame.cpp
+++ b/WebKit/win/WebFrame.cpp
@@ -845,8 +845,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::childFrames(
// IWebFramePrivate ------------------------------------------------------
-HRESULT STDMETHODCALLTYPE WebFrame::renderTreeAsExternalRepresentation(
- /* [retval][out] */ BSTR *result)
+HRESULT WebFrame::renderTreeAsExternalRepresentation(BOOL forPrinting, BSTR *result)
{
if (!result)
return E_POINTER;
@@ -855,7 +854,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::renderTreeAsExternalRepresentation(
if (!coreFrame)
return E_FAIL;
- *result = BString(externalRepresentation(coreFrame)).release();
+ *result = BString(externalRepresentation(coreFrame, forPrinting ? RenderAsTextPrintingMode : RenderAsTextBehaviorNormal)).release();
return S_OK;
}
@@ -964,7 +963,7 @@ HRESULT STDMETHODCALLTYPE WebFrame::firstLayoutDone(
if (!coreFrame)
return E_FAIL;
- *result = coreFrame->loader()->firstLayoutDone();
+ *result = coreFrame->loader()->stateMachine()->firstLayoutDone();
return S_OK;
}
diff --git a/WebKit/win/WebFrame.h b/WebKit/win/WebFrame.h
index d839f17..c14ddc9 100644
--- a/WebKit/win/WebFrame.h
+++ b/WebKit/win/WebFrame.h
@@ -155,8 +155,8 @@ public:
virtual /* [local] */ JSGlobalContextRef STDMETHODCALLTYPE globalContext();
// IWebFramePrivate
- virtual HRESULT STDMETHODCALLTYPE renderTreeAsExternalRepresentation(
- /* [retval][out] */ BSTR *result);
+ virtual HRESULT STDMETHODCALLTYPE unused1(BSTR*) { return E_NOTIMPL; }
+ virtual HRESULT STDMETHODCALLTYPE renderTreeAsExternalRepresentation(BOOL forPrinting, BSTR *result);
virtual HRESULT STDMETHODCALLTYPE counterValueForElementById(
/* [in] */ BSTR id,
diff --git a/WebKit/win/WebKit.vcproj/WebKit.sln b/WebKit/win/WebKit.vcproj/WebKit.sln
index 6f437f3..c205704 100644
--- a/WebKit/win/WebKit.vcproj/WebKit.sln
+++ b/WebKit/win/WebKit.vcproj/WebKit.sln
@@ -66,7 +66,6 @@ EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QTMovieWin", "..\..\..\WebCore\WebCore.vcproj\QTMovieWin.vcproj", "{E498CA9D-3BD2-4D52-8E37-C8DC76526325}"
ProjectSection(ProjectDependencies) = postProject
{0A324352-B3B6-496C-9E5B-4C7E923E628B} = {0A324352-B3B6-496C-9E5B-4C7E923E628B}
- {011D10F1-B656-4A1B-A0C3-3842F02122C5} = {011D10F1-B656-4A1B-A0C3-3842F02122C5}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinLauncher", "..\..\..\WebKitTools\WinLauncher\WinLauncher.vcproj", "{114FCA11-216B-4C8C-957E-30A75AE80443}"
@@ -86,6 +85,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitAPITest", "..\..\..\W
{6567DFD4-D6DE-4CD5-825D-17E353D160E1} = {6567DFD4-D6DE-4CD5-825D-17E353D160E1}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebKitLauncherWin", "..\..\..\WebKitTools\WebKitLauncherWin\WebKitLauncherWin.vcproj", "{D09806DB-E58B-4646-8C9B-61101906C1E2}"
+ ProjectSection(ProjectDependencies) = postProject
+ {626089A3-25D3-4883-A96C-B8C66E036397} = {626089A3-25D3-4883-A96C-B8C66E036397}
+ EndProjectSection
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_Cairo|Win32 = Debug_Cairo|Win32
@@ -236,6 +240,14 @@ Global
{626089A3-25D3-4883-A96C-B8C66E036397}.Release_Cairo|Win32.Build.0 = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.ActiveCfg = Debug|Win32
{626089A3-25D3-4883-A96C-B8C66E036397}.Release|Win32.Build.0 = Debug|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug_Cairo|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug_Cairo|Win32.Build.0 = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Debug|Win32.Build.0 = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release_Cairo|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release_Cairo|Win32.Build.0 = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release|Win32.ActiveCfg = Release|Win32
+ {D09806DB-E58B-4646-8C9B-61101906C1E2}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/WebKit/win/WebKitGraphics.cpp b/WebKit/win/WebKitGraphics.cpp
index d7123b4..e9e25ab 100644
--- a/WebKit/win/WebKitGraphics.cpp
+++ b/WebKit/win/WebKitGraphics.cpp
@@ -112,7 +112,7 @@ void WebDrawText(WebTextRenderInfo* info)
// Set shadow setting
if (info->structSize == sizeof(WebTextRenderInfo) &&
(info->shadowOffset.cx || info->shadowOffset.cy || info->shadowBlur || info->shadowColor))
- context.setShadow(info->shadowOffset, info->shadowBlur, info->shadowColor, DeviceColorSpace);
+ context.setShadow(FloatSize(info->shadowOffset.cx, info->shadowOffset.cy), info->shadowBlur, info->shadowColor, DeviceColorSpace);
WebCoreDrawTextAtPoint(context, drawString, info->pt, makeFont(*(info->description)), info->color, info->underlinedIndex);
context.restore();
diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp
index a85cc92..a1aa5c2 100644
--- a/WebKit/win/WebView.cpp
+++ b/WebKit/win/WebView.cpp
@@ -62,6 +62,7 @@
#include <JavaScriptCore/InitializeThreading.h>
#include <JavaScriptCore/JSLock.h>
#include <JavaScriptCore/JSValue.h>
+#include <WebCore/AbstractDatabase.h>
#include <WebCore/AXObjectCache.h>
#include <WebCore/ApplicationCacheStorage.h>
#include <WebCore/BString.h>
@@ -73,7 +74,6 @@
#include <WebCore/ContextMenuController.h>
#include <WebCore/CookieStorageWin.h>
#include <WebCore/Cursor.h>
-#include <WebCore/Database.h>
#include <WebCore/Document.h>
#include <WebCore/DragController.h>
#include <WebCore/DragData.h>
@@ -4710,7 +4710,7 @@ HRESULT WebView::notifyPreferencesChanged(IWebNotification* notification)
hr = prefsPrivate->databasesEnabled(&enabled);
if (FAILED(hr))
return hr;
- Database::setIsAvailable(enabled);
+ AbstractDatabase::setIsAvailable(enabled);
#endif
hr = prefsPrivate->localStorageEnabled(&enabled);
@@ -5197,7 +5197,7 @@ HRESULT STDMETHODCALLTYPE WebView::shouldClose(
*result = TRUE;
if (Frame* frame = m_page->mainFrame())
- *result = frame->shouldClose() ? TRUE : FALSE;
+ *result = frame->loader()->shouldClose();
return S_OK;
}
diff --git a/WebKit/wx/ChangeLog b/WebKit/wx/ChangeLog
index aefe2a1..36c9990 100644
--- a/WebKit/wx/ChangeLog
+++ b/WebKit/wx/ChangeLog
@@ -1,3 +1,32 @@
+2010-06-21 Kevin Ollivier <kevino@theolliviers.com>
+
+ Build fix after conversion of WebInterfaceSystem to Obj-C++.
+
+ * WebView.cpp:
+ * wscript:
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Adam Barth.
+
+ Move isAvailable()/setIsAvailable() from Database/DatabaseSync to AbstractDatabase.
+ https://bugs.webkit.org/show_bug.cgi?id=39041
+
+ * WebView.cpp:
+ (wxWebView::SetDatabasesEnabled):
+ (wxWebView::AreDatabasesEnabled):
+
+2010-06-15 Darin Adler <darin@apple.com>
+
+ Reviewed by Adam Barth.
+
+ Move functions out of Frame class that were marked "move to Chrome"
+ https://bugs.webkit.org/show_bug.cgi?id=39636
+
+ * WebFrame.cpp:
+ (wxWebFrame::ShouldClose): Call shouldClose on FrameLoader instead
+ of going through Frame.
+
2010-06-14 Ilya Tikhonovsky <loislo@chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/wx/WebFrame.cpp b/WebKit/wx/WebFrame.cpp
index cb66a72..e1f7ecc 100644
--- a/WebKit/wx/WebFrame.cpp
+++ b/WebKit/wx/WebFrame.cpp
@@ -414,7 +414,7 @@ wxWebViewDOMElementInfo wxWebFrame::HitTest(const wxPoint& pos) const
bool wxWebFrame::ShouldClose() const
{
if (m_impl->frame)
- return m_impl->frame->shouldClose();
+ return m_impl->frame->loader()->shouldClose();
return true;
}
diff --git a/WebKit/wx/WebView.cpp b/WebKit/wx/WebView.cpp
index d9a22cb..a2897b5 100644
--- a/WebKit/wx/WebView.cpp
+++ b/WebKit/wx/WebView.cpp
@@ -74,7 +74,7 @@
#include <wtf/text/CString.h>
#if ENABLE(DATABASE)
-#include "Database.h"
+#include "AbstractDatabase.h"
#include "DatabaseTracker.h"
#endif
@@ -258,10 +258,8 @@ wxWebViewCachePolicy wxWebView::GetCachePolicy()
}
#if OS(DARWIN)
-// prototype - function is in WebKitSystemInterface.mm
-extern "C" {
+// prototype - function is in WebSystemInterface.mm
void InitWebCoreSystemInterface(void);
-}
#endif
BEGIN_EVENT_TABLE(wxWebView, wxWindow)
@@ -995,7 +993,7 @@ wxString wxWebView::GetDatabaseDirectory()
void wxWebView::SetDatabasesEnabled(bool enabled)
{
#if ENABLE(DATABASE)
- WebCore::Database::setIsAvailable(enabled);
+ WebCore::AbstractDatabase::setIsAvailable(enabled);
#endif
}
@@ -1003,7 +1001,7 @@ void wxWebView::SetDatabasesEnabled(bool enabled)
bool wxWebView::AreDatabasesEnabled()
{
#if ENABLE(DATABASE)
- return WebCore::Database::isAvailable();
+ return WebCore::AbstractDatabase::isAvailable();
#endif
return false;
}
diff --git a/WebKit/wx/wscript b/WebKit/wx/wscript
index fe934f1..d0594b3 100644
--- a/WebKit/wx/wscript
+++ b/WebKit/wx/wscript
@@ -109,7 +109,7 @@ def build(bld):
if sys.platform.startswith('darwin'):
exts.append('.mm')
obj.includes += '../mac/WebCoreSupport ../../WebCore/platform/mac'
- obj.source = "../mac/WebCoreSupport/WebSystemInterface.m"
+ obj.source = "../mac/WebCoreSupport/WebSystemInterface.mm"
obj.find_sources_in_dirs(webkit_dirs)
if building_on_win32:
diff --git a/WebKitExamplePlugins/ChangeLog b/WebKitExamplePlugins/ChangeLog
index 07c3d8e..724bf26 100644
--- a/WebKitExamplePlugins/ChangeLog
+++ b/WebKitExamplePlugins/ChangeLog
@@ -1,3 +1,13 @@
+2010-06-16 Anders Carlsson <andersca@apple.com>
+
+ Fix build.
+
+ * NetscapeCoreAnimationMoviePlugin/main.m:
+ (NPP_New):
+ (NPP_WriteReady):
+ (NPP_Write):
+ (NPP_HandleEvent):
+
2010-06-10 Anders Carlsson <andersca@apple.com>
Fix build.
diff --git a/WebKitExamplePlugins/NetscapeCoreAnimationMoviePlugin/main.m b/WebKitExamplePlugins/NetscapeCoreAnimationMoviePlugin/main.m
index 6766bc6..b23283f 100644
--- a/WebKitExamplePlugins/NetscapeCoreAnimationMoviePlugin/main.m
+++ b/WebKitExamplePlugins/NetscapeCoreAnimationMoviePlugin/main.m
@@ -72,16 +72,16 @@ typedef struct PluginObject
QTMovie *movie;
} PluginObject;
-NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved);
+NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
NPError NPP_Destroy(NPP instance, NPSavedData** save);
NPError NPP_SetWindow(NPP instance, NPWindow* window);
NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16* stype);
NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason);
-int32 NPP_WriteReady(NPP instance, NPStream* stream);
-int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer);
+int32_t NPP_WriteReady(NPP instance, NPStream* stream);
+int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer);
void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname);
void NPP_Print(NPP instance, NPPrint* platformPrint);
-int16 NPP_HandleEvent(NPP instance, void* event);
+int16_t NPP_HandleEvent(NPP instance, void* event);
void NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData);
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value);
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value);
@@ -125,7 +125,7 @@ void NP_Shutdown(void)
}
-NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char* argn[], char* argv[], NPSavedData* saved)
+NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
{
// Create per-instance storage
PluginObject *obj = (PluginObject *)malloc(sizeof(PluginObject));
@@ -155,7 +155,7 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, ch
browser->setvalue(instance, NPPVpluginEventModel, (void *)NPEventModelCocoa);
- for (int16 i = 0; i < argc; i++) {
+ for (int16_t i = 0; i < argc; i++) {
if (strcasecmp(argn[i], "movieurl") == 0) {
NSString *urlString = [NSString stringWithUTF8String:argv[i]];
if (urlString)
@@ -201,12 +201,12 @@ NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
return NPERR_NO_ERROR;
}
-int32 NPP_WriteReady(NPP instance, NPStream* stream)
+int32_t NPP_WriteReady(NPP instance, NPStream* stream)
{
return 0;
}
-int32 NPP_Write(NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer)
+int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer)
{
return 0;
}
@@ -309,7 +309,7 @@ static int handleScrollEvent(PluginObject *obj, NPCocoaEvent *event)
-int16 NPP_HandleEvent(NPP instance, void* event)
+int16_t NPP_HandleEvent(NPP instance, void* event)
{
PluginObject *obj = instance->pdata;
diff --git a/WebKitLibraries/ChangeLog b/WebKitLibraries/ChangeLog
index 273a141..ed55485 100644
--- a/WebKitLibraries/ChangeLog
+++ b/WebKitLibraries/ChangeLog
@@ -1,3 +1,42 @@
+2010-06-21 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Update WebKitSystemInterface.
+
+ * WebKitSystemInterface.h:
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+ * libWebKitSystemInterfaceTiger.a:
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Speculative build fix.
+
+ * WebKitSystemInterface.h:
+
+2010-06-21 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ WebKitSystemInterface part of CSS3: Implement the 'hyphens' and 'hyphenate-character' properties
+ https://bugs.webkit.org/show_bug.cgi?id=10228
+
+ * WebKitSystemInterface.h: Added WKGetHyphenationLocationBeforeIndex().
+ * libWebKitSystemInterfaceLeopard.a:
+ * libWebKitSystemInterfaceSnowLeopard.a:
+ * libWebKitSystemInterfaceTiger.a:
+
+2010-06-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
+
+ * win/tools/vsprops/FeatureDefines.vsprops:
+ * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
2010-06-02 Sterling Swigart <sswigart@google.com>
Reviewed by David Levin.
diff --git a/WebKitLibraries/WebKitSystemInterface.h b/WebKitLibraries/WebKitSystemInterface.h
index 48defe0..a753b63 100644
--- a/WebKitLibraries/WebKitSystemInterface.h
+++ b/WebKitLibraries/WebKitSystemInterface.h
@@ -269,6 +269,14 @@ WKSoftwareCARendererRef WKSoftwareCARendererCreate(uint32_t contextID);
void WKSoftwareCARendererDestroy(WKSoftwareCARendererRef);
void WKSoftwareCARendererRender(WKSoftwareCARendererRef, CGContextRef, CGRect);
+typedef struct __WKCARemoteLayerClientRef *WKCARemoteLayerClientRef;
+
+WKCARemoteLayerClientRef WKCARemoteLayerClientMakeWithServerPort(mach_port_t port);
+void WKCARemoteLayerClientInvalidate(WKCARemoteLayerClientRef);
+uint32_t WKCARemoteLayerClientGetClientId(WKCARemoteLayerClientRef);
+void WKCARemoteLayerClientSetLayer(WKCARemoteLayerClientRef, CALayer *);
+CALayer *WKCARemoteLayerClientGetLayer(WKCARemoteLayerClientRef);
+
#import <mach/mig.h>
CFRunLoopSourceRef WKCreateMIGServerSource(mig_subsystem_t subsystem, mach_port_t serverPort);
@@ -300,6 +308,10 @@ NSMutableArray *WKNoteOpenPanelFiles(NSArray *paths);
void WKSyncSurfaceToView(NSView *view);
#endif
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
+CFIndex WKGetHyphenationLocationBeforeIndex(CFStringRef string, CFIndex index);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
index d99cf68..7146bbe 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
index ef9d346..cc684cc 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
Binary files differ
diff --git a/WebKitLibraries/libWebKitSystemInterfaceTiger.a b/WebKitLibraries/libWebKitSystemInterfaceTiger.a
index 65f874d..53ba34b 100644
--- a/WebKitLibraries/libWebKitSystemInterfaceTiger.a
+++ b/WebKitLibraries/libWebKitSystemInterfaceTiger.a
Binary files differ
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
index 83cf220..e7a98e8 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_RUBY);$(ENABLE_SANDBOX);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -102,6 +102,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_INPUT_SPEECH"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_JAVASCRIPT_DEBUGGER"
Value="ENABLE_JAVASCRIPT_DEBUGGER"
PerformEnvironmentSet="true"
diff --git a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
index 39dba67..71b402a 100644
--- a/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
+++ b/WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops
@@ -9,7 +9,7 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
+ PreprocessorDefinitions="$(ENABLE_3D_CANVAS);$(ENABLE_3D_RENDERING);$(ENABLE_BLOB_SLICE);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CLIENT_BASED_GEOLOCATION);$(ENABLE_DATABASE);$(ENABLE_DATAGRID);$(ENABLE_DATALIST);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DOM_STORAGE);$(ENABLE_EVENTSOURCE);$(ENABLE_FILTERS);$(ENABLE_FILE_READER);$(ENABLE_FILE_WRITER);$(ENABLE_GEOLOCATION);$(ENABLE_ICONDATABASE);$(ENABLE_IMAGE_RESIZER);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_SPEECH);$(ENABLE_JAVASCRIPT_DEBUGGER);$(ENABLE_MATHML);$(ENABLE_NOTIFICATIONS);$(ENABLE_OFFLINE_WEB_APPLICATIONS);$(ENABLE_SHARED_WORKERS);$(ENABLE_SVG);$(ENABLE_SVG_ANIMATION);$(ENABLE_SVG_AS_IMAGE);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_SVG_FOREIGN_OBJECT);$(ENABLE_SVG_USE);$(ENABLE_VIDEO);$(ENABLE_WEB_SOCKETS);$(ENABLE_WML);$(ENABLE_WORKERS);$(ENABLE_XHTMLMP);$(ENABLE_XPATH);$(ENABLE_XSLT)"
/>
<UserMacro
Name="ENABLE_3D_CANVAS"
@@ -102,6 +102,11 @@
PerformEnvironmentSet="true"
/>
<UserMacro
+ Name="ENABLE_INPUT_SPEECH"
+ Value=""
+ PerformEnvironmentSet="true"
+ />
+ <UserMacro
Name="ENABLE_JAVASCRIPT_DEBUGGER"
Value="ENABLE_JAVASCRIPT_DEBUGGER"
PerformEnvironmentSet="true"
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
index db7379d..81e3f91 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/config.json
@@ -38,6 +38,9 @@
{ "name": "google-windows-1", "platform": "chromium" },
{ "name": "google-mac-1", "platform": "chromium" },
{ "name": "google-linux-1", "platform": "chromium" },
+ { "name": "google-windows-2", "platform": "chromium" },
+ { "name": "google-mac-2", "platform": "chromium" },
+ { "name": "google-linux-2", "platform": "chromium" },
{ "name": "google-new-tests", "platform": "mac-leopard" }
],
@@ -165,11 +168,26 @@
"platform": "chromium", "configuration": "release", "architectures": ["i386"],
"slavenames": ["google-linux-1"]
},
- {
- "name": "New run-webkit-tests", "type": "NewBuildAndTest", "builddir": "google-new-tests",
- "platform": "mac-leopard", "configuration": "release", "architectures": ["i386"],
- "slavenames": ["google-new-tests"]
- }
+ {
+ "name": "Chromium Win Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-win-release-tests",
+ "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["google-windows-2"]
+ },
+ {
+ "name": "Chromium Mac Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-mac-release-tests",
+ "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["google-mac-2"]
+ },
+ {
+ "name": "Chromium Linux Release (Tests)", "type": "NewBuildAndTest", "builddir": "chromium-linux-release-tests",
+ "platform": "chromium", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["google-linux-2"]
+ },
+ {
+ "name": "New run-webkit-tests", "type": "NewBuildAndTest", "builddir": "google-new-tests",
+ "platform": "mac-leopard", "configuration": "release", "architectures": ["i386"],
+ "slavenames": ["google-new-tests"]
+ }
],
"schedulers": [ { "type": "AnyBranchScheduler", "name": "trunk", "branches": ["trunk"], "treeStableTimer": 45.0,
@@ -179,7 +197,8 @@
"GTK Linux 32-bit Release", "GTK Linux 32-bit Debug", "GTK Linux 64-bit Debug", "GTK Linux 64-bit Release",
"Qt Linux Release", "Qt Linux Release minimal", "Qt Linux ARMv5 Release", "Qt Linux ARMv7 Release",
"Qt Windows 32-bit Release", "Qt Windows 32-bit Debug",
- "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release"]
+ "Chromium Win Release", "Chromium Mac Release", "Chromium Linux Release",
+ "Chromium Win Release (Tests)", "Chromium Mac Release (Tests)", "Chromium Linux Release (Tests)"]
},
{ "type": "Triggerable", "name": "leopard-intel-release-tests",
"builderNames": ["Leopard Intel Release (Tests)"]
diff --git a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
index 151225f..bbc94ec 100644
--- a/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
+++ b/WebKitTools/BuildSlaveSupport/build.webkit.org-config/master.cfg
@@ -238,9 +238,9 @@ class RunWebKitTests(shell.Test):
class NewRunWebKitTests(RunWebKitTests):
- command = ["./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results",
+ command = ["perl", "./WebKitTools/Scripts/new-run-webkit-tests", "--noshow-results",
"--verbose", "--results-directory", "layout-test-results",
- WithProperties("--%(configuration)s")]
+ WithProperties("--%(configuration)s"), "--use-drt"]
class RunPythonTests(shell.Test):
@@ -376,7 +376,8 @@ class BuildAndTestFactory(Factory):
def __init__(self, platform, configuration, architectures):
Factory.__init__(self, platform, configuration, architectures, False)
self.addStep(CompileWebKit)
- self.addStep(RunJavaScriptCoreTests)
+ if platform != "chromium":
+ self.addStep(RunJavaScriptCoreTests)
self.addStep(self.TestClass)
# Tiger's Python 2.3 is too old. WebKit Python requires 2.5+.
# Sadly we have no way to detect the version on the slave from here.
diff --git a/WebKitTools/BuildSlaveSupport/test-result-archive b/WebKitTools/BuildSlaveSupport/test-result-archive
index 3b019c0..df02dbd 100644
--- a/WebKitTools/BuildSlaveSupport/test-result-archive
+++ b/WebKitTools/BuildSlaveSupport/test-result-archive
@@ -46,7 +46,7 @@ def main():
return archiveTestResults(options.configuration, options.platform)
def archiveTestResults(configuration, platform):
- assert platform in ('mac', 'win', 'gtk', 'qt')
+ assert platform in ('mac', 'win', 'gtk', 'qt', 'chromium')
try:
os.unlink(archiveFile)
@@ -66,7 +66,7 @@ def archiveTestResults(configuration, platform):
if platform == 'mac':
if subprocess.call(["ditto", "-c", "-k", "--sequesterRsrc", layoutTestResultsDir, archiveFile]):
return 1
- elif platform in ('win', 'gtk', 'qt'):
+ elif platform in ('win', 'gtk', 'qt', 'chromium'):
if subprocess.call(["zip", "-r", archiveFile, "."], cwd=layoutTestResultsDir):
return 1
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 13d9f20..e7d06cd 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,1025 @@
+2010-06-25 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Dan Bernstein.
+
+ Add a LOG macro that expands to a no-op by default.
+
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/AppDelegate.m:
+ (_didRecieveMessageFromInjectedBundle):
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (-[BrowserWindowController windowShouldClose:]):
+ (_didStartProvisionalLoadForFrame):
+ (_didReceiveServerRedirectForProvisionalLoadForFrame):
+ (_didFailProvisionalLoadWithErrorForFrame):
+ (_didCommitLoadForFrame):
+ (_didFinishLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
+ (_didReceiveTitleForFrame):
+ (_didFirstLayoutForFrame):
+ (_didFirstVisuallyNonEmptyLayoutForFrame):
+ (_didBecomeUnresponsive):
+ (_didBecomeResponsive):
+ (_decidePolicyForNavigationAction):
+ (_decidePolicyForNewWindowAction):
+ (_createNewPage):
+ (_showPage):
+ (_closePage):
+ (_didNavigateWithNavigationData):
+ (_didPerformClientRedirect):
+ (_didPerformServerRedirect):
+ (_didUpdateHistoryTitle):
+ * MiniBrowser/mac/MiniBrowser_Prefix.pch:
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindowForFrame):
+ (_didCreatePage):
+ (_willDestroyPage):
+ (_didRecieveMessage):
+
+2010-06-24 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ commit-queue is taking too long to land patches because of red trees
+ https://bugs.webkit.org/show_bug.cgi?id=41194
+
+ Instead of checking for the tree to be green, we'll just spin hot
+ trying to land patches. This is probably too extreme in ignoring the
+ tree, but I think we should try it for a while to see if we have
+ trouble. That will help us find the right balance.
+
+ * Scripts/webkitpy/tool/commands/queues.py:
+ * Scripts/webkitpy/tool/commands/queues_unittest.py:
+
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Clean up the use of gdk_window_get_root_coords in EventSender
+ https://bugs.webkit.org/show_bug.cgi?id=40843
+
+ Define the version for old GTK+s in a way that is forward-compatible
+ and clean up the logic a bit.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (gdk_window_get_root_coords): Renamed and cleaned up.
+ (prepareMouseButtonEvent): Remove #ifdefs.
+ (mouseMoveToCallback): Remove #ifdefs.
+
+2010-06-24 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix NewRunWebKitTests to work on Windows.
+ https://bugs.webkit.org/show_bug.cgi?id=41180
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg: Added "perl" as first arguments,
+ because Windows fails to understand what we're asking of it.
+
+2010-06-24 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] The url passed to the WebView during layout tests is invalid
+ https://bugs.webkit.org/show_bug.cgi?id=40832
+
+ Set the test URL to the full real file URL and do a small cleanup.
+ Previously a URL like file://relative/path/to/test.html was passed
+ to the WebView. This malformed file URL would be returned by
+ webkit_web_view_get_url and webkit_web_frame_get_url.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (shouldLogFrameLoadDelegates): Change to take a const string& as the argument.
+ (shouldOpenWebInspector): Change to take a const string& as the argument.
+ (shouldEnableDeveloperExtras): Change to take a const string& as the argument.
+ (runTest): Pass the full file:// URL to the view. Remove the superfluous url variable.
+
+2010-06-24 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix WebKitTestRunner Makefile typos.
+
+ * WebKitTestRunner/Makefile:
+
+2010-06-24 Adele Peterson <adele@apple.com>
+
+ Reviewed by Eric Carlson.
+
+ DumpRenderTree part of testing <rdar://problem/8093680> "Paste and Match Style" should fire paste events
+ https://bugs.webkit.org/show_bug.cgi?id=41085
+
+ * DumpRenderTree/mac/DumpRenderTree.mm: (resetWebViewToConsistentStateBeforeTesting):
+ Clear the general pasteboard in between tests so Cut,Copy, and setData on ClipboardData won't have lasting effects.
+
+2010-06-23 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=41086
+ Add new WebKitTestRunner project (ie. DRT for WebKit2).
+
+ - Mac only.
+ - run-webkit-tests has not been modified to call it yet.
+ - Only dumps the render tree at this time.
+
+ * WebKitTestRunner: Added.
+ * WebKitTestRunner/Configurations: Added.
+ * WebKitTestRunner/Configurations/Base.xcconfig: Added.
+ * WebKitTestRunner/Configurations/DebugRelease.xcconfig: Added.
+ * WebKitTestRunner/Configurations/InjectedBundle.xcconfig: Added.
+ * WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig: Added.
+ * WebKitTestRunner/InjectedBundle: Added.
+ * WebKitTestRunner/InjectedBundle-Info.plist: Added.
+ * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp: Added.
+ (_didStartProvisionalLoadForFrame):
+ (_didReceiveServerRedirectForProvisionalLoadForFrame):
+ (_didFailProvisionalLoadWithErrorForFrame):
+ (_didCommitLoadForFrame):
+ (_didFinishLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
+ (_didReceiveTitleForFrame):
+ (_didClearWindow):
+ (_didCreatePage):
+ (_willDestroyPage):
+ (_didRecieveMessage):
+ (WKBundleInitialize):
+ * WebKitTestRunner/Makefile: Added.
+ * WebKitTestRunner/PlatformWebView.h: Added.
+ (WTR::PlatformWebView::platformView):
+ * WebKitTestRunner/TestController.cpp: Added.
+ (WTR::TestController::shared):
+ (WTR::TestController::TestController):
+ (WTR::TestController::initialize):
+ (WTR::TestController::runTest):
+ (WTR::TestController::runTestingServerLoop):
+ (WTR::TestController::run):
+ * WebKitTestRunner/TestController.h: Added.
+ (WTR::TestController::verbose):
+ (WTR::TestController::injectedBundlePath):
+ * WebKitTestRunner/TestInvocation.cpp: Added.
+ (WTR::createWKURL):
+ (WTR::TestInvocation::TestInvocation):
+ (WTR::TestInvocation::~TestInvocation):
+ (WTR::TestInvocation::invoke):
+ (WTR::TestInvocation::dump):
+ (WTR::TestInvocation::initializeMainWebView):
+ (WTR::TestInvocation::didStartProvisionalLoadForFrame):
+ (WTR::TestInvocation::didReceiveServerRedirectForProvisionalLoadForFrame):
+ (WTR::TestInvocation::didFailProvisionalLoadWithErrorForFrame):
+ (WTR::TestInvocation::didCommitLoadForFrame):
+ (WTR::TestInvocation::didFinishLoadForFrame):
+ (WTR::TestInvocation::didFailLoadForFrame):
+ (WTR::TestInvocation::renderTreeExternalRepresentationFunction):
+ (WTR::TestInvocation::renderTreeExternalRepresentationDisposeFunction):
+ * WebKitTestRunner/TestInvocation.h: Added.
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj: Added.
+ * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Added.
+ * WebKitTestRunner/WebKitTestRunnerPrefix.h: Added.
+ * WebKitTestRunner/mac: Added.
+ * WebKitTestRunner/mac/PlatformWebViewMac.mm: Added.
+ (WTR::PlatformWebView::PlatformWebView):
+ (WTR::PlatformWebView::~PlatformWebView):
+ (WTR::PlatformWebView::page):
+ * WebKitTestRunner/mac/TestInvocationMac.mm: Added.
+ (WTR::TestInvocation::runUntil):
+ * WebKitTestRunner/mac/main.mm: Added.
+ (main):
+
+2010-06-24 Luiz Agostini <luiz.agostini@openbossa.org>
+
+ Unreviewed. Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-23 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix, adding new LayoutTestController methods and enabling SVG_FOREIGN_OBJECT.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::isPageBoxVisible):
+ (LayoutTestController::pageAreaRectInPixels):
+ (LayoutTestController::preferredPageSizeInPixels):
+ * wx/build/settings.py:
+
+2010-06-23 James Robinson <jamesr@chromium.org>
+
+ Unreviewed. Add my IRC handle to committers.py so the sheriffbot can yell at me.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-23 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Correct Chromium test configuration
+ https://bugs.webkit.org/show_bug.cgi?id=41057
+
+ * BuildSlaveSupport/build.webkit.org-config/master.cfg:
+ - Add "--use-drt" option for NRWT. It is required for Chromium and
+ ignored for other platforms.
+ - Skip JSC test on Chromium
+ * BuildSlaveSupport/test-result-archive:
+ Add Chromium support.
+
+2010-06-23 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=41073
+ WebKit2: Flesh out more of the InjectedBundle client API
+
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didStartProvisionalLoadForFrame):
+ (_didReceiveServerRedirectForProvisionalLoadForFrame):
+ (_didFailProvisionalLoadWithErrorForFrame):
+ (_didCommitLoadForFrame):
+ (_didFinishLoadForFrame):
+ (_didFailLoadWithErrorForFrame):
+ (_didReceiveTitleForFrame):
+ (_didClearWindowForFrame):
+ (_didCreatePage):
+ (_willDestroyPage):
+ (WKBundleInitialize):
+
+2010-06-23 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Implement page format data programming interface.
+ Add methods for testing.
+ https://bugs.webkit.org/show_bug.cgi?id=37538
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (parsePageNumber):
+ (isPageBoxVisibleCallback):
+ (pageAreaRectInPixelsCallback):
+ (preferredPageSizeInPixelsCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::isPageBoxVisible):
+ (LayoutTestController::pageAreaRectInPixels):
+ (LayoutTestController::preferredPageSizeInPixels):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::isPageBoxVisible):
+ (LayoutTestController::pageAreaRectInPixels):
+ (LayoutTestController::preferredPageSizeInPixels):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::isPageBoxVisible):
+ (LayoutTestController::pageAreaRectInPixels):
+ (LayoutTestController::preferredPageSizeInPixels):
+
+2010-06-23 Sam Magnuson <smagnuson@netflix.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Follow proper convention for if/switch/while as I've discovered
+ them to be through my review processes.
+ https://bugs.webkit.org/show_bug.cgi?id=40723
+
+ Modified test so that if( foo ) is not allowed as it appears not
+ to be the accepted convention.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Run clean-header-guards to fix some header guards
+ https://bugs.webkit.org/show_bug.cgi?id=41044
+
+ No functional changes, thus no tests.
+
+ This entire change was generated by running
+ clean-header-guards, and then reverting changes
+ to files which shouldn't be changed. Those which
+ are left all should be updated.
+
+ Some of these changes are just fixing 755 permissions
+ to be 644, since it seems various files have the wrong
+ execute bit which don't need it. clean-header-guards
+ made those (welcome) permission fixes unintentionally.
+
+ * DumpRenderTree/chromium/WebThemeControlDRT.h:
+ * DumpRenderTree/chromium/WebThemeEngineDRT.h:
+ * QtTestBrowser/fpstimer.h:
+
+2010-06-22 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Rename HTMLDocumentParser to LegacyHTMLDocumentParser
+ https://bugs.webkit.org/show_bug.cgi?id=41043
+
+ Update the hash.
+
+ * Scripts/do-webcore-rename:
+
+2010-06-22 Sam Magnuson <smagnuson@netflix.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Follow proper convention for variable declaration spacing.
+ https://bugs.webkit.org/show_bug.cgi?id=40724
+
+ Modified test so that 'int a;' is not allowed.
+
+ * Scripts/webkitpy/style/checkers/cpp.py:
+ * Scripts/webkitpy/style/checkers/cpp_unittest.py:
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Unreviewed. Add Tony Gentilcore now that he's a committer.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-22 Eric Seidel <eric@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Remove Gtk 64-Release bot from core since it's broken
+ https://bugs.webkit.org/show_bug.cgi?id=41022
+
+ This bot alone has been responsible for more than 72 hours of
+ commit-queue blockage in the last week. The bot is broken -- keeps
+ losing its display server or similar. Until the Gtk folks can fix the
+ bot, we need to remove it from core. The WebKit community can't keep
+ it green as is.
+
+ * Scripts/webkitpy/common/net/buildbot.py:
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-06-21 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ Fix the Windows build.
+ https://bugs.webkit.org/show_bug.cgi?id=40972
+
+ * DumpRenderTree/win/ImageDiff.vcproj:
+
+2010-06-21 Prasad Tammana <prasadt@chromium.org>
+
+ Reviewed by Darin Adler, Dmitry Titov.
+
+ DumpRenderTree should allow tests with modal dialogs
+ https://bugs.webkit.org/show_bug.cgi?id=35350
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (abortModalCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::abortModal):
+ Add abortModal method to LayoutTestController and make it available from script.
+
+ * DumpRenderTree/mac/UIDelegate.mm: Add support for showModalDialog.
+ (-[UIDelegate modalWindowWillClose:]): Observer for NSWindowWillCloseNotifications to call
+ abortModal from when modal window closes.
+ (-[UIDelegate webViewRunModal:]): Delegate method for showModalDialog to run the modal loop.
+
+2010-06-21 Simon Fraser <simon.fraser@apple.com>
+
+ Reviewed by Anders Carlsson.
+
+ Rename DrawingAreaProxyUpdateChunk to ChunkedUpdateDrawingArea
+ https://bugs.webkit.org/show_bug.cgi?id=40948
+
+ Have the script look in WebKit2.
+
+ * Scripts/do-webcore-rename:
+
+2010-06-21 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Unskip plugins/get-url-that-the-resource-load-delegate-will-disallow.html
+
+ It's a Mac-specific test so just add the required LayoutTestController
+ function as a no-op to avoid failing. Similar approach adopted by other
+ ports.
+
+ https://bugs.webkit.org/show_bug.cgi?id=33344
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+ (LayoutTestController::addDisallowedURL):
+
+2010-06-21 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Patch for https://bugs.webkit.org/show_bug.cgi?id=40940
+ Add message passing support to the WebKit2 API.
+
+ - Add some test messages.
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (_didRecieveMessageFromInjectedBundle):
+ (-[BrowserAppDelegate init]):
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+ (_didClearWindow):
+ (_didCreatePage):
+ (_didRecieveMessage):
+ (WKBundleInitialize):
+
+2010-06-21 Drew Wilson <atwilson@chromium.org>
+
+ Unreviewed.
+
+ Rolling back 61551 and 61555 due to test failures.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::setEditingBehavior):
+ * DumpRenderTree/mac/UIDelegate.mm:
+
+2010-06-21 Anders Carlsson <andersca@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Make DumpRenderTree build with clang++
+
+ * DumpRenderTree/mac/DumpRenderTreePasteboard.m:
+ (-[LocalPasteboard setPropertyList:forType:]):
+ * DumpRenderTree/mac/DumpRenderTreeWindow.mm:
+ (-[DumpRenderTreeWindow keyDown:]):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::elementDoesAutoCompleteForElementWithId):
+ (LayoutTestController::isCommandEnabled):
+
+2010-06-21 Satish Sampath <satish@chromium.org>
+
+ Reviewed by Steve Block.
+
+ Speech Input Patch 0: Added compilation argument to conditionally compile pending patches.
+ https://bugs.webkit.org/show_bug.cgi?id=40878
+
+ * Scripts/build-webkit:
+
+2010-06-21 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Initialization for http/tests/loading/
+ https://bugs.webkit.org/show_bug.cgi?id=40902
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::runFileTest):
+
+2010-06-21 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-20 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Add --allow-external-pages option
+ https://bugs.webkit.org/show_bug.cgi?id=40762
+
+ Add --allow-external-pages introduced by Chromium r45403.
+ http://src.chromium.org/viewvc/chrome?view=rev&revision=45403
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (main):
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ * DumpRenderTree/chromium/TestShell.h:
+ (TestShell::allowExternalPages):
+ (TestShell::setAllowExternalPages):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::willSendRequest):
+
+2010-06-20 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ Sheriffbot: Should allow "r" in SVN_REVISION
+ https://bugs.webkit.org/show_bug.cgi?id=40889
+
+ * Scripts/webkitpy/tool/bot/irc_command.py: remove a leading "r" from SVN_REVISION if it exists
+ * Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py: test an SVN_REVISION with a leading r.
+
+2010-06-20 Joseph Pecoraro <joepeck@webkit.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Python Tests Fail after r61508
+ https://bugs.webkit.org/show_bug.cgi?id=40891
+
+ Test's regex list needed to be updated to match the new
+ regex list in the source code. Added new bots to the
+ example_buildbots list.
+
+ Regex list fixed in r61512. Updated bot list.
+
+ * Scripts/webkitpy/common/net/buildbot_unittest.py:
+
+2010-06-20 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Unreviewed, build fix.
+
+ Tweak test regexp list to match the change in http://trac.webkit.org/changeset/61508.
+
+ * Scripts/webkitpy/common/net/buildbot_unittest.py: Tweaked regexp.
+
+2010-06-19 Justin Schuh <jschuh@chromium.org>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-19 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=40882
+ Add ability to have a WebProcess per WebContext.
+
+ Move to use new shared contexts API.
+
+ * MiniBrowser/mac/AppDelegate.h:
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate init]):
+ (-[BrowserAppDelegate getCurrentPageNamespace]):
+ (-[BrowserAppDelegate validateMenuItem:]):
+ (-[BrowserAppDelegate _setProcessModel:]):
+ (-[BrowserAppDelegate setSharedProcessProcessModel:]):
+ (-[BrowserAppDelegate setSharedThreadProcessModel:]):
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+
+2010-06-02 Robert Hogan <robert@webkit.org>
+
+ Reviewed by Adam Barth.
+
+ [Qt] Support evaluateScriptInIsolatedWorld()
+
+ https://bugs.webkit.org/show_bug.cgi?id=40079
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::evaluateScriptInIsolatedWorld):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
+2010-06-18 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Add three more non-core Chromium builders to start testing DumpRenderTree.
+ https://bugs.webkit.org/show_bug.cgi?id=40335
+
+ * BuildSlaveSupport/build.webkit.org-config/config.json: Added 3 builders.
+
+2010-06-18 Drew Wilson <atwilson@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [Chromium] Plumbing for top-level frame names
+ https://bugs.webkit.org/show_bug.cgi?id=40430
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::reset):
+ Changed obsolete call to clearName() to use setName(WebString()) instead.
+
+2010-06-18 Sam Weinig <weinig@apple.com>
+
+ Rolling http://trac.webkit.org/changeset/61297 back in.
+
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/WebBundle/WebBundleMain.c: Removed.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m: Added.
+ (_didClearWindow):
+ (_didCreatePage):
+ (WKBundleInitialize):
+
+2010-06-18 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40803
+ TestNetscapePlugin has an incorrect implementation of "property" property
+
+ * DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp: (pluginGetProperty): Don't
+ pass a static string back, it's going to be released by NPAPI implementation.
+
+2010-06-18 Leandro Pereira <leandro@profusion.mobi>
+
+ Unreviewed.
+
+ Adding myself to the committers list.
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-17 Tony Chang <tony@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [chromium] cleanup redundant DEPS value and remove buildbot cleanup code
+ https://bugs.webkit.org/show_bug.cgi?id=40615
+
+ * Scripts/update-webkit-chromium: remove directory removal of third_party in old checkouts
+
+2010-06-17 Ada Chan <adachan@apple.com>
+
+ Rolling out http://trac.webkit.org/changeset/61297 due to build errors.
+
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/mac/WebBundle/WebBundleMain.c: Copied from MiniBrowser/mac/WebBundle/WebBundleMain.c.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.m: Removed.
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ One more try at fix for Chromium build.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Use set again instead of =.
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Fix Chromium build.
+
+ I didn't realize that neither Chromium nor Qt share the DumpRenderTree
+ code with all the other platforms! Wow, that should be fixed at some point.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Changed back to using "new".
+ * DumpRenderTree/chromium/TestShell.h: Changed back to OwnPtr.
+
+2010-06-17 Simon Hausmann <simon.hausmann@nokia.com>
+
+ Unreviewed Qt build fix.
+
+ LayoutTestController in the Qt DRT is not using refs :)
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree):
+
+2010-06-17 Darin Adler <darin@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Use adoptRef and create functions in more code paths
+ https://bugs.webkit.org/show_bug.cgi?id=40760
+
+ * DumpRenderTree/DumpRenderTree.h: Change gLayoutTestController to a RefPtr.
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (LayoutTestController::create): Added.
+ * DumpRenderTree/LayoutTestController.h: Declare the create function.
+
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell): Use create instead of new.
+ * DumpRenderTree/chromium/TestShell.h: Use RefPtr instead of OwnPtr.
+
+ * DumpRenderTree/gtk/DumpRenderTree.cpp:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::DumpRenderTree::DumpRenderTree): Use create and releaseRef
+ instead of new.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
+
+ * DumpRenderTree/wx/DumpRenderTreeWx.cpp:
+ (runTest): Use RefPtr and create instead of OwnPtr and new.
+ (MyApp::OnInit): Removed unneeded code to delete the layout
+ test controller. This is done during each test.
+
+2010-06-17 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [DRT/Chromium] Fix a bug of Windows pixel tests
+ https://bugs.webkit.org/show_bug.cgi?id=40763
+
+ * DumpRenderTree/chromium/TestEventPrinter.cpp:
+ (TestShellPrinter::handleImage):
+
+2010-06-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Shinichiro Hamaji.
+
+ [DRT/Chromium] Fix crash on Mac Release
+ https://bugs.webkit.org/show_bug.cgi?id=40759
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::paintRect): We should not use m_canvas directly because
+ it is created lazily in canvas().
+
+2010-06-16 Kevin Ollivier <kevino@theolliviers.com>
+
+ [wx] Build fix after new method addition.
+
+ * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
+ (LayoutTestController::pageProperty):
+
+2010-06-16 Kent Tamura <tkent@chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [DRT/Chromium] Set current working directory for each of tests
+ https://bugs.webkit.org/show_bug.cgi?id=40668
+
+ This change fixes tests with eventSender.beginDragWithFiles().
+
+ * DumpRenderTree/chromium/DumpRenderTree.cpp:
+ (runTest):
+
+2010-06-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] r60803 broke media/controls-drag-timebar.html
+ https://bugs.webkit.org/show_bug.cgi?id=40269
+
+ Only queue events while the mouse button is down, if drag mode is enabled. Some
+ tests may disable drag mode, to prevent the queuing of events in this situation.
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (sendOrQueueEvent): Only queue events here if dragMode is true.
+
+2010-06-16 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Gustavo Noronha Silva.
+
+ [GTK] Remove the abuse of GDK_CURRENT_TIME in the DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40600
+
+ * DumpRenderTree/gtk/EventSender.cpp:
+ (prepareMouseButtonEvent): Remove logic adding an offset to GDK_CURRENT_TIME.
+
+2010-06-16 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ Add a hidden land-cowboy command to webkit-patch to help land quick
+ build fixes.
+
+ * Scripts/webkitpy/tool/commands/download.py:
+ * Scripts/webkitpy/tool/steps/preparechangelog.py:
+
+2010-06-16 Adam Roben <aroben@apple.com>
+
+ Convert console messages to UTF-8 before printing them
+
+ Speculative fix for <http://webkit.org/b/40731> REGRESSION (r61234):
+ http/tests/security/xssAuditor/embed-tag-null-char.html and
+ http/tests/security/xssAuditor/object-embed-tag-null-char.html fail on
+ Windows. (I can't test the fix because Apache is crashing on my
+ computer.)
+
+ Reviewed by Alexey Proskuryakov.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (toUTF8): Extracted the code into an overload that takes a wide string
+ and a length, then added an overload that takes a wstring.
+
+ * DumpRenderTree/win/DumpRenderTreeWin.h: Declare the new toUTF8
+ overload.
+
+ * DumpRenderTree/win/UIDelegate.cpp:
+ (UIDelegate::webViewAddMessageToConsole): Use toUTF8 to convert to
+ UTF-8 instead of letting printf convert to the current code page.
+
+2010-06-16 Drew Wilson <atwilson@chromium.org>
+
+ Reviewed by Kent Tamura.
+
+ [Chromium] Plumbing for top-level frame names
+ https://bugs.webkit.org/show_bug.cgi?id=40430
+
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::createView):
+ Migrate to new createView() API.
+ * DumpRenderTree/chromium/WebViewHost.h:
+ Remove obsolete createView() methods, add new createView() API that takes a frameName parameter.
+
+2010-06-16 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] Scroll wheel event support to graphics based DRT
+ https://bugs.webkit.org/show_bug.cgi?id=40577
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::continuousMouseScrollBy):
+ (EventSender::createGraphicsSceneWheelEvent):
+ * DumpRenderTree/qt/EventSenderQt.h:
+
+2010-06-16 Adam Roben <aroben@apple.com>
+
+ Remove a stray newline from the Windows version of TestNetscapePlugin
+
+ Reviewed by Alexey Proskuryakov.
+
+ Fixes <http://webkit.org/b/40728>
+ plugins/geturlnotify-during-document-teardown.html fails on Windows
+
+ * DumpRenderTree/win/TestNetscapePlugin/main.cpp:
+ (NPP_Destroy): Removed extra newline that the Mac version doesn't
+ have.
+
+2010-06-16 Adam Roben <aroben@apple.com>
+
+ Respect LayoutTestController::isPrinting on Windows
+
+ This gets some printing tests closer to passing (like
+ printing/page-rule-in-media-query.html).
+
+ Fixes <http://webkit.org/b/40727>.
+
+ Reviewed by Dan Bernstein.
+
+ * DumpRenderTree/win/DumpRenderTree.cpp:
+ (dump): Pass LayoutTestController::isPrinting to
+ IWebFramePrivate::renderTreeAsExternalRepresentation.
+
+2010-06-15 Adam Barth <abarth@webkit.org>
+
+ Reviewed by Eric Seidel.
+
+ Enable HTML5 lexer
+ https://bugs.webkit.org/show_bug.cgi?id=40650
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (initializeGlobalsFromCommandLineOptions):
+
+2010-06-10 Yuzo Fujishima <yuzo@google.com>
+
+ Reviewed by Shinichiro Hamaji.
+
+ Implement render style selection for pages to support CSS3 Paged Media.
+ https://bugs.webkit.org/show_bug.cgi?id=35961
+
+ * DumpRenderTree/LayoutTestController.cpp:
+ (parsePagePropertyParameters):
+ (pagePropertyCallback):
+ (LayoutTestController::staticFunctions):
+ * DumpRenderTree/LayoutTestController.h:
+ * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
+ (LayoutTestController::pageProperty):
+ * DumpRenderTree/mac/LayoutTestControllerMac.mm:
+ (LayoutTestController::pageProperty):
+ * DumpRenderTree/win/LayoutTestControllerWin.cpp:
+ (LayoutTestController::pageProperty):
+
+2010-06-15 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Fix for https://bugs.webkit.org/show_bug.cgi?id=40630
+ WebKit2: Add mechanism to inject code into the WebProcess on startup
+
+ Add initial InjectedBundle support.
+
+ * MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj:
+ * MiniBrowser/WebBundle-Info.plist: Added.
+ Add test InjectedBundle to the project.
+
+ * MiniBrowser/mac/AppDelegate.m:
+ (-[BrowserAppDelegate init]):
+ Get the path to the WebBundle from the the main bundle and pass it to the new
+ WKContextCreateWithInjectedBundlePath function.
+
+ * MiniBrowser/mac/BrowserWindowController.m:
+ (_didChangeProgress):
+ Fix the build. This has been broken for a while.
+
+ * MiniBrowser/mac/WebBundle: Added.
+ * MiniBrowser/mac/WebBundle/WebBundleMain.c: Added.
+ (_didCreatePage):
+ (WKBundleInitialize):
+ Add really basic InjectedBundle.
+
+ * MiniBrowser/win/BrowserView.cpp:
+ (BrowserView::create):
+ Switch from WKContextCreateWithProcessModel to WKContextCreate and remove commented out code.
+
+2010-06-15 Dumitru Daniliuc <dumi@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Adding myself to the reviewers list.
+ https://bugs.webkit.org/show_bug.cgi?id=40693
+
+ * Scripts/webkitpy/common/config/committers.py:
+
+2010-06-15 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Switch to using GIO methods instead of realpath in GtkLauncher to determine
+ the file URI. This should remove warnings about realpath being undefined
+ when compiling with '-ansi'.
+
+ * GtkLauncher/main.c:
+ (filenameToURL): Use GIO instead of realpath to determine file URI.
+
+2010-06-15 Adam Roben <aroben@apple.com>
+
+ Remove the redundant set-apple-windows-environment-variables script
+
+ Apparently update-webkit does this for you these days.
+
+ Rubber-stamped by Steve Falkenburg.
+
+ * Scripts/set-apple-windows-environment-variables: Removed.
+
+2010-06-14 Adam Roben <aroben@apple.com>
+
+ Add a script to set the WebKitOutputDir and WebKitLibrariesDir
+ environment variables
+
+ Fixes <http://webkit.org/b/40595>.
+
+ Reviewed by Steve Falkenburg.
+
+ * Scripts/set-apple-windows-environment-variables: Added.
+ (to_windows_path): Passes the passed-in path through cygpath to
+ generate a Windows-style path.
+ (main): Sets the WebKitOutputDir and WebKitLibrariesDir environment
+ variables to their defaults, if they aren't already set.
+
+2010-06-14 Adam Roben <aroben@apple.com>
+
+ Speed up run-safari/debug-safari on Windows
+
+ Fixes <http://webkit.org/b/40586>.
+
+ Reviewed by Steve Falkenburg.
+
+ * Scripts/webkitdirs.pm:
+ (runSafari): When debugging, set up the environment to run Safari
+ using the built WebKit.dll, then use "devenv /debugexe Safari.exe" to
+ actually launch the debugger. When not debugging, just run WebKit.exe
+ and it will do the rest for us.
+
+2010-06-15 Diego Gonzalez <diegohcg@webkit.org>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt] DRT EventSender support to graphics context events
+ https://bugs.webkit.org/show_bug.cgi?id=40324
+
+ * DumpRenderTree/qt/EventSenderQt.cpp:
+ (EventSender::contextClick):
+
+2010-06-14 Tony Chang <tony@chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ [chromium] checkout chromium third_party directly
+ https://bugs.webkit.org/show_bug.cgi?id=40556
+
+ * Scripts/update-webkit-chromium: some migration code for the bots
+
+2010-06-14 Alexey Proskuryakov <ap@apple.com>
+
+ Chromium build fix.
+
+ * DumpRenderTree/chromium/EventSender.cpp: (EventSender::keyDown): Chromium uses differently
+ named constants for Windows virtual key codes, replacing VK_DELETE with VKEY_DELETE.
+
+2010-06-14 Alexey Proskuryakov <ap@apple.com>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=40529
+ eventSender.keyDown("delete") incorrectly sends a backspace on some platforms
+
+ * DumpRenderTree/mac/EventSendingController.mm:
+ (-[EventSendingController keyDown:withModifiers:withLocation:]): We were sending a broken
+ event for "delete" - it had virtual key code from forward delete, and text from backspace.
+ Fixed "delete" to mean forward delete.
+
+ * DumpRenderTree/chromium/EventSender.cpp: (EventSender::keyDown):
+ * DumpRenderTree/gtk/EventSender.cpp: (keyDownCallback):
+ * DumpRenderTree/win/EventSender.cpp: (keyDownCallback):
+ Mac DRT confusion has propagated to other platforms, fixing those.
+
+2010-06-14 Martin Robinson <mrobinson@igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ Small GtkLauncher build fix for some systems.
+
+ * GtkLauncher/main.c: Add <limit.h> include.
+
2010-06-14 Mahesh Kulkarni <mahesh.kulkarni@nokia.com>
Reviewed by Laszlo Gombos.
diff --git a/WebKitTools/DumpRenderTree/DumpRenderTree.h b/WebKitTools/DumpRenderTree/DumpRenderTree.h
index 8366e89..7a862f7 100644
--- a/WebKitTools/DumpRenderTree/DumpRenderTree.h
+++ b/WebKitTools/DumpRenderTree/DumpRenderTree.h
@@ -45,6 +45,7 @@
#endif
#include <string>
+#include <wtf/RefPtr.h>
#if !OS(OPENBSD)
std::wstring urlSuitableForTestResult(const std::wstring& url);
@@ -55,7 +56,7 @@ class LayoutTestController;
extern volatile bool done;
// FIXME: This is a bad abstraction. We should insted pass this to other controller objects which need access to it.
-extern LayoutTestController* gLayoutTestController;
+extern RefPtr<LayoutTestController> gLayoutTestController;
void dump();
void displayWebView();
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
index b96a9c9..02c77a4 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.cpp
@@ -83,6 +83,11 @@ LayoutTestController::LayoutTestController(const std::string& testPathOrURL, con
{
}
+PassRefPtr<LayoutTestController> LayoutTestController::create(const std::string& testPathOrURL, const std::string& expectedPixelHash)
+{
+ return adoptRef(new LayoutTestController(testPathOrURL, expectedPixelHash));
+}
+
// Static Functions
static JSValueRef dumpAsPDFCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
@@ -521,6 +526,41 @@ static bool parsePageParameters(JSContextRef context, int argumentCount, const J
return true;
}
+// Caller needs to delete[] propertyName.
+static bool parsePagePropertyParameters(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, char*& propertyName, int& pageNumber)
+{
+ pageNumber = 0;
+ switch (argumentCount) {
+ case 2:
+ pageNumber = static_cast<float>(JSValueToNumber(context, arguments[1], exception));
+ if (*exception)
+ return false;
+ // Fall through.
+ case 1: {
+ JSRetainPtr<JSStringRef> propertyNameString(Adopt, JSValueToStringCopy(context, arguments[0], exception));
+ if (*exception)
+ return false;
+
+ size_t maxLength = JSStringGetMaximumUTF8CStringSize(propertyNameString.get());
+ propertyName = new char[maxLength + 1];
+ JSStringGetUTF8CString(propertyNameString.get(), propertyName, maxLength + 1);
+ return true;
+ }
+ case 0:
+ default:
+ return false;
+ }
+}
+
+static bool parsePageNumber(JSContextRef context, int argumentCount, const JSValueRef* arguments, JSValueRef* exception, int& pageNumber)
+{
+ pageNumber = 0;
+ if (argumentCount != 1)
+ return false;
+ pageNumber = static_cast<int>(JSValueToNumber(context, arguments[0], exception));
+ return !*exception;
+}
+
static JSValueRef pageNumberForElementByIdCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
float pageWidthInPixels = 0;
@@ -548,6 +588,50 @@ static JSValueRef numberOfPagesCallback(JSContextRef context, JSObjectRef functi
return JSValueMakeNumber(context, controller->numberOfPages(pageWidthInPixels, pageHeightInPixels));
}
+static JSValueRef pagePropertyCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ char* propertyName = 0;
+ int pageNumber = 0;
+ if (!parsePagePropertyParameters(context, argumentCount, arguments, exception, propertyName, pageNumber))
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ JSValueRef value = JSValueMakeString(context, controller->pageProperty(propertyName, pageNumber).get());
+
+ delete[] propertyName;
+ return value;
+}
+
+static JSValueRef isPageBoxVisibleCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int pageNumber = 0;
+ if (!parsePageNumber(context, argumentCount, arguments, exception, pageNumber))
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return JSValueMakeBoolean(context, controller->isPageBoxVisible(pageNumber));
+}
+
+static JSValueRef pageAreaRectInPixelsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int pageNumber = 0;
+ if (!parsePageNumber(context, argumentCount, arguments, exception, pageNumber))
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return JSValueMakeString(context, controller->pageAreaRectInPixels(pageNumber).get());
+}
+
+static JSValueRef preferredPageSizeInPixelsCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ int pageNumber = 0;
+ if (!parsePageNumber(context, argumentCount, arguments, exception, pageNumber))
+ return JSValueMakeUndefined(context);
+
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ return JSValueMakeString(context, controller->preferredPageSizeInPixels(pageNumber).get());
+}
+
static JSValueRef queueBackNavigationCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
// Has mac & windows implementation
@@ -1428,6 +1512,16 @@ static JSValueRef setWebViewEditableCallback(JSContextRef context, JSObjectRef f
return JSValueMakeUndefined(context);
}
+
+#if PLATFORM(MAC)
+static JSValueRef abortModalCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+ LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
+ controller->abortModal();
+ return JSValueMakeUndefined(context);
+}
+#endif
+
static JSValueRef markerTextForListItemCallback(JSContextRef context, JSObjectRef, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
LayoutTestController* controller = static_cast<LayoutTestController*>(JSObjectGetPrivate(thisObject));
@@ -1554,6 +1648,9 @@ JSStaticValue* LayoutTestController::staticValues()
JSStaticFunction* LayoutTestController::staticFunctions()
{
static JSStaticFunction staticFunctions[] = {
+#if PLATFORM(MAC)
+ { "abortModal", abortModalCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+#endif
{ "addDisallowedURL", addDisallowedURLCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addUserScript", addUserScriptCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "addUserStyleSheet", addUserStyleSheetCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1593,6 +1690,7 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "counterValueForElementById", counterValueForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "grantDesktopNotificationPermission", grantDesktopNotificationPermissionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "isPageBoxVisible", isPageBoxVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "numberOfPages", numberOfPagesCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
@@ -1601,9 +1699,12 @@ JSStaticFunction* LayoutTestController::staticFunctions()
{ "numberOfActiveAnimations", numberOfActiveAnimationsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "overridePreference", overridePreferenceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pageNumberForElementById", pageNumberForElementByIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "pageAreaRectInPixels", pageAreaRectInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "pageProperty", pagePropertyCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pathToLocalResource", pathToLocalResourceCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pauseAnimationAtTimeOnElementWithId", pauseAnimationAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "pauseTransitionAtTimeOnElementWithId", pauseTransitionAtTimeOnElementWithIdCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+ { "preferredPageSizeInPixels", preferredPageSizeInPixelsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "sampleSVGAnimationForElementAtTime", sampleSVGAnimationForElementAtTimeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "printToPDF", dumpAsPDFCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
{ "queueBackNavigation", queueBackNavigationCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
diff --git a/WebKitTools/DumpRenderTree/LayoutTestController.h b/WebKitTools/DumpRenderTree/LayoutTestController.h
index 8ff38d1..6af2c57 100644
--- a/WebKitTools/DumpRenderTree/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/LayoutTestController.h
@@ -34,11 +34,12 @@
#include <set>
#include <string>
#include <vector>
+#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
class LayoutTestController : public RefCounted<LayoutTestController> {
public:
- LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash);
+ static PassRefPtr<LayoutTestController> create(const std::string& testPathOrURL, const std::string& expectedPixelHash);
~LayoutTestController();
void makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception);
@@ -62,6 +63,10 @@ public:
int numberOfPages(float pageWidthInPixels, float pageHeightInPixels);
void overridePreference(JSStringRef key, JSStringRef value);
int pageNumberForElementById(JSStringRef id, float pageWidthInPixels, float pageHeightInPixels);
+ JSRetainPtr<JSStringRef> pageProperty(const char* propertyName, int pageNumber) const;
+ bool isPageBoxVisible(int pageNumber) const;
+ JSRetainPtr<JSStringRef> pageAreaRectInPixels(int pageNumber) const;
+ JSRetainPtr<JSStringRef> preferredPageSizeInPixels(int pageNumber) const;
JSStringRef pathToLocalResource(JSContextRef, JSStringRef url);
void queueBackNavigation(int howFarBackward);
void queueForwardNavigation(int howFarForward);
@@ -255,6 +260,11 @@ public:
void setWebViewEditable(bool);
+
+#if PLATFORM(MAC)
+ void abortModal();
+#endif
+
// The following API test functions should probably be moved to platform-specific
// unit tests outside of DRT once they exist.
void apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL);
@@ -271,6 +281,8 @@ public:
static const unsigned maxViewHeight;
private:
+ LayoutTestController(const std::string& testPathOrURL, const std::string& expectedPixelHash);
+
bool m_dumpAsPDF;
bool m_dumpAsText;
bool m_dumpBackForwardList;
diff --git a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
index 60103a5..477ca17 100644
--- a/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
+++ b/WebKitTools/DumpRenderTree/TestNetscapePlugIn.subproj/PluginObject.cpp
@@ -260,7 +260,10 @@ static bool pluginGetProperty(NPObject* obj, NPIdentifier name, NPVariant* resul
{
PluginObject* plugin = reinterpret_cast<PluginObject*>(obj);
if (name == pluginPropertyIdentifiers[ID_PROPERTY_PROPERTY]) {
- STRINGZ_TO_NPVARIANT("property", *result);
+ static const char* originalString = "property";
+ char* buf = static_cast<char*>(browser->memalloc(strlen(originalString) + 1));
+ strcpy(buf, originalString);
+ STRINGZ_TO_NPVARIANT(buf, *result);
return true;
} else if (name == pluginPropertyIdentifiers[ID_PROPERTY_EVENT_LOGGING]) {
BOOLEAN_TO_NPVARIANT(plugin->eventLogging, *result);
diff --git a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
index b0cff82..7194279 100644
--- a/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -47,6 +47,7 @@ static const char optionTree[] = "--tree";
static const char optionPixelTestsWithName[] = "--pixel-tests=";
static const char optionTestShell[] = "--test-shell";
+static const char optionAllowExternalPages[] = "--allow-external-pages";
static void runTest(TestShell& shell, TestParams& params, const string& testName, bool testShellMode)
{
@@ -74,6 +75,7 @@ static void runTest(TestShell& shell, TestParams& params, const string& testName
}
}
params.testUrl = webkit_support::CreateURLForPathOrURL(pathOrURL);
+ webkit_support::SetCurrentDirectoryForFileURL(params.testUrl);
shell.resetTestController();
shell.runFileTest(params);
shell.setLayoutTestTimeout(oldTimeoutMsec);
@@ -88,6 +90,7 @@ int main(int argc, char* argv[])
Vector<string> tests;
bool serverMode = false;
bool testShellMode = false;
+ bool allowExternalPages = false;
for (int i = 1; i < argc; ++i) {
string argument(argv[i]);
if (argument == "-")
@@ -102,7 +105,9 @@ int main(int argc, char* argv[])
} else if (argument == optionTestShell) {
testShellMode = true;
serverMode = true;
- } else if (argument.size() && argument[0] == '-')
+ } else if (argument == optionAllowExternalPages)
+ allowExternalPages = true;
+ else if (argument.size() && argument[0] == '-')
fprintf(stderr, "Unknown option: %s\n", argv[i]);
else
tests.append(argument);
@@ -114,6 +119,7 @@ int main(int argc, char* argv[])
{ // Explicit scope for the TestShell instance.
TestShell shell(testShellMode);
+ shell.setAllowExternalPages(allowExternalPages);
if (serverMode && !tests.size()) {
params.printSeparators = true;
char testString[2048]; // 2048 is the same as the sizes of other platforms.
diff --git a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
index 7695095..fd7ba2d 100644
--- a/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/EventSender.cpp
@@ -542,7 +542,7 @@ void EventSender::keyDown(const CppArgumentList& arguments, CppVariant* result)
else if ("upArrow" == codeStr)
code = base::VKEY_UP;
else if ("delete" == codeStr)
- code = base::VKEY_BACK;
+ code = base::VKEY_DELETE;
else if ("pageUp" == codeStr)
code = base::VKEY_PRIOR;
else if ("pageDown" == codeStr)
diff --git a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
index 929656d..d9e79a0 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestEventPrinter.cpp
@@ -142,7 +142,7 @@ void TestShellPrinter::handleImage(const char* actualHash, const char*, const un
if (imageData && imageSize) {
ASSERT(fileName);
FILE* fp = fopen(fileName, "wb");
- if (fp) {
+ if (!fp) {
perror(fileName);
exit(EXIT_FAILURE);
}
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
index 761f8d1..610248a 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.cpp
@@ -80,6 +80,7 @@ TestShell::TestShell(bool testShellMode)
, m_testIsPreparing(false)
, m_focusedWidget(0)
, m_testShellMode(testShellMode)
+ , m_allowExternalPages(false)
{
WebRuntimeFeatures::enableGeolocation(true);
m_accessibilityController.set(new AccessibilityController(this));
@@ -200,6 +201,11 @@ void TestShell::runFileTest(const TestParams& params)
bool inspectorTestMode = testUrl.find("/inspector/") != string::npos
|| testUrl.find("\\inspector\\") != string::npos;
m_webView->settings()->setDeveloperExtrasEnabled(inspectorTestMode);
+
+ if (testUrl.find("loading/") != string::npos
+ || testUrl.find("loading\\") != string::npos)
+ m_layoutTestController->setShouldDumpFrameLoadCallbacks(true);
+
m_printer->handleTestHeader(testUrl.c_str());
loadURL(m_params.testUrl);
diff --git a/WebKitTools/DumpRenderTree/chromium/TestShell.h b/WebKitTools/DumpRenderTree/chromium/TestShell.h
index 2b99b3d..2397246 100644
--- a/WebKitTools/DumpRenderTree/chromium/TestShell.h
+++ b/WebKitTools/DumpRenderTree/chromium/TestShell.h
@@ -107,6 +107,9 @@ public:
// the test results.
void testTimedOut();
+ bool allowExternalPages() const { return m_allowExternalPages; }
+ void setAllowExternalPages(bool allowExternalPages) { m_allowExternalPages = allowExternalPages; }
+
#if defined(OS_WIN)
// Access to the finished event. Used by the static WatchDog thread.
HANDLE finishedEvent() { return m_finishedEvent; }
@@ -140,15 +143,16 @@ private:
WebKit::WebWidget* m_focusedWidget;
bool m_testShellMode;
WebViewHost* m_webViewHost;
- OwnPtr<AccessibilityController*> m_accessibilityController;
- OwnPtr<EventSender*> m_eventSender;
- OwnPtr<LayoutTestController*> m_layoutTestController;
- OwnPtr<PlainTextController*> m_plainTextController;
- OwnPtr<TextInputController*> m_textInputController;
- OwnPtr<NotificationPresenter*> m_notificationPresenter;
- OwnPtr<TestEventPrinter*> m_printer;
+ OwnPtr<AccessibilityController> m_accessibilityController;
+ OwnPtr<EventSender> m_eventSender;
+ OwnPtr<LayoutTestController> m_layoutTestController;
+ OwnPtr<PlainTextController> m_plainTextController;
+ OwnPtr<TextInputController> m_textInputController;
+ OwnPtr<NotificationPresenter> m_notificationPresenter;
+ OwnPtr<TestEventPrinter> m_printer;
TestParams m_params;
int m_timeout; // timeout value in millisecond
+ bool m_allowExternalPages;
// List of all windows in this process.
// The main window should be put into windowList[0].
diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h
index 1f73610..1f73610 100755..100644
--- a/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebThemeControlDRT.h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h
index 89805b1..89805b1 100755..100644
--- a/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebThemeEngineDRT.h
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index d3aadc8..ef821ce 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -253,12 +253,7 @@ static string textAffinityDescription(WebTextAffinity affinity)
// WebViewClient -------------------------------------------------------------
-WebView* WebViewHost::createView(WebFrame* creator)
-{
- return createView(creator, WebWindowFeatures());
-}
-
-WebView* WebViewHost::createView(WebFrame*, const WebWindowFeatures&)
+WebView* WebViewHost::createView(WebFrame*, const WebWindowFeatures&, const WebString&)
{
if (!layoutTestController()->canOpenWindows())
return 0;
@@ -923,7 +918,8 @@ void WebViewHost::willSendRequest(WebFrame*, unsigned identifier, WebURLRequest&
if (!host.empty() && (url.SchemeIs("http") || url.SchemeIs("https"))
&& host != "127.0.0.1"
&& host != "255.255.255.255"
- && host != "localhost") {
+ && host != "localhost"
+ && !m_shell->allowExternalPages()) {
printf("Blocked access to external URL %s\n", requestURL.c_str());
// To block the request, we set its URL to an empty one.
@@ -1036,7 +1032,7 @@ void WebViewHost::reset()
this->~WebViewHost();
new (this) WebViewHost(shell);
setWebWidget(widget);
- webView()->mainFrame()->clearName();
+ webView()->mainFrame()->setName(WebString());
}
void WebViewHost::setSelectTrailingWhitespaceEnabled(bool enabled)
@@ -1284,7 +1280,7 @@ void WebViewHost::paintRect(const WebRect& rect)
ASSERT(canvas());
m_isPainting = true;
#if PLATFORM(CG)
- webWidget()->paint(m_canvas->getTopPlatformDevice().GetBitmapContext(), rect);
+ webWidget()->paint(canvas()->getTopPlatformDevice().GetBitmapContext(), rect);
#else
webWidget()->paint(canvas(), rect);
#endif
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index 8fb9d04..1e51be7 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -90,8 +90,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual bool navigate(const TestNavigationEntry&, bool reload);
// WebKit::WebViewClient
- virtual WebKit::WebView* createView(WebKit::WebFrame*);
- virtual WebKit::WebView* createView(WebKit::WebFrame*, const WebKit::WebWindowFeatures&);
+ virtual WebKit::WebView* createView(WebKit::WebFrame*, const WebKit::WebWindowFeatures&, const WebKit::WebString&);
virtual WebKit::WebWidget* createPopupMenu(WebKit::WebPopupType);
virtual WebKit::WebWidget* createPopupMenu(const WebKit::WebPopupMenuInfo&);
virtual WebKit::WebStorageNamespace* createSessionStorageNamespace(unsigned quota);
diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index 14577f1..d79addf 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -2,6 +2,7 @@
* Copyright (C) 2007 Eric Seidel <eric@webkit.org>
* Copyright (C) 2008 Alp Toker <alp@nuanti.com>
* Copyright (C) 2009 Jan Alonzo <jmalonzo@gmail.com>
+ * Copyright (C) 2010 Igalia S.L.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -77,7 +78,7 @@ static int dumpPixels;
static int dumpTree = 1;
AccessibilityController* axController = 0;
-LayoutTestController* gLayoutTestController = 0;
+RefPtr<LayoutTestController> gLayoutTestController;
static GCController* gcController = 0;
static WebKitWebView* webView;
static GtkWidget* window;
@@ -96,30 +97,19 @@ static WebKitWebHistoryItem* prevTestBFItem = NULL;
const unsigned historyItemIndent = 8;
-static gchar* autocorrectURL(const gchar* url)
+static bool shouldLogFrameLoadDelegates(const string& pathOrURL)
{
- if (strncmp("http://", url, 7) != 0 && strncmp("https://", url, 8) != 0) {
- GString* string = g_string_new("file://");
- g_string_append(string, url);
- return g_string_free(string, FALSE);
- }
-
- return g_strdup(url);
-}
-
-static bool shouldLogFrameLoadDelegates(const char* pathOrURL)
-{
- return strstr(pathOrURL, "loading/");
+ return pathOrURL.find("loading/") != string::npos;
}
-static bool shouldOpenWebInspector(const char* pathOrURL)
+static bool shouldOpenWebInspector(const string& pathOrURL)
{
- return strstr(pathOrURL, "inspector/");
+ return pathOrURL.find("inspector/") != string::npos;
}
-static bool shouldEnableDeveloperExtras(const char* pathOrURL)
+static bool shouldEnableDeveloperExtras(const string& pathOrURL)
{
- return shouldOpenWebInspector(pathOrURL) || strstr(pathOrURL, "inspector-enabled/");
+ return shouldOpenWebInspector(pathOrURL) || pathOrURL.find("inspector-enabled/") != string::npos;
}
void dumpFrameScrollPosition(WebKitWebFrame* frame)
@@ -474,39 +464,45 @@ static void runTest(const string& testPathOrURL)
ASSERT(!testPathOrURL.empty());
// Look for "'" as a separator between the path or URL, and the pixel dump hash that follows.
- string pathOrURL(testPathOrURL);
+ string testURL(testPathOrURL);
string expectedPixelHash;
-
- size_t separatorPos = pathOrURL.find("'");
+ size_t separatorPos = testURL.find("'");
if (separatorPos != string::npos) {
- pathOrURL = string(testPathOrURL, 0, separatorPos);
+ testURL = string(testPathOrURL, 0, separatorPos);
expectedPixelHash = string(testPathOrURL, separatorPos + 1);
}
- gchar* url = autocorrectURL(pathOrURL.c_str());
- const string testURL(url);
+ // Convert the path into a full file URL if it does not look
+ // like an HTTP/S URL (doesn't start with http:// or https://).
+ if (testURL.find("http://") && testURL.find("https://")) {
+ GFile* testFile = g_file_new_for_path(testURL.c_str());
+ gchar* testURLCString = g_file_get_uri(testFile);
+ testURL = testURLCString;
+ g_free(testURLCString);
+ g_object_unref(testFile);
+ }
resetDefaultsToConsistentValues();
- gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash);
+ gLayoutTestController = LayoutTestController::create(testURL, expectedPixelHash);
topLoadingFrame = 0;
done = false;
gLayoutTestController->setIconDatabaseEnabled(false);
- if (shouldLogFrameLoadDelegates(pathOrURL.c_str()))
+ if (shouldLogFrameLoadDelegates(testURL))
gLayoutTestController->setDumpFrameLoadCallbacks(true);
- if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+ if (shouldEnableDeveloperExtras(testURL)) {
gLayoutTestController->setDeveloperExtrasEnabled(true);
- if (shouldOpenWebInspector(pathOrURL.c_str()))
+ if (shouldOpenWebInspector(testURL))
gLayoutTestController->showWebInspector();
}
WorkQueue::shared()->clear();
WorkQueue::shared()->setFrozen(false);
- bool isSVGW3CTest = (gLayoutTestController->testPathOrURL().find("svg/W3C-SVG-1.1") != string::npos);
+ bool isSVGW3CTest = (testURL.find("svg/W3C-SVG-1.1") != string::npos);
GtkAllocation size;
size.x = size.y = 0;
size.width = isSVGW3CTest ? 480 : LayoutTestController::maxViewWidth;
@@ -527,15 +523,12 @@ static void runTest(const string& testPathOrURL)
// Focus the web view before loading the test to avoid focusing problems
gtk_widget_grab_focus(GTK_WIDGET(webView));
- webkit_web_view_open(webView, url);
-
- g_free(url);
- url = NULL;
+ webkit_web_view_open(webView, testURL.c_str());
gtk_main();
// If developer extras enabled Web Inspector may have been open by the test.
- if (shouldEnableDeveloperExtras(pathOrURL.c_str())) {
+ if (shouldEnableDeveloperExtras(testURL)) {
gLayoutTestController->closeWebInspector();
gLayoutTestController->setDeveloperExtrasEnabled(false);
}
@@ -553,8 +546,7 @@ static void runTest(const string& testPathOrURL)
// A blank load seems to be necessary to reset state after certain tests.
webkit_web_view_open(webView, "about:blank");
- gLayoutTestController->deref();
- gLayoutTestController = 0;
+ gLayoutTestController.clear();
// terminate the (possibly empty) pixels block after all the state reset
sendPixelResultsEOF();
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index 0ef4a42..7836ff0 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -87,6 +87,15 @@ static void sendOrQueueEvent(GdkEvent, bool = true);
static void dispatchEvent(GdkEvent event);
static guint getStateFlags();
+#if !GTK_CHECK_VERSION(2, 17, 3)
+static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
+{
+ gdk_window_get_root_origin(window, rootX, rootY);
+ *rootX = *rootX + x;
+ *rootY = *rootY + y;
+}
+#endif
+
static JSValueRef getDragModeCallback(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception)
{
return JSValueMakeBoolean(context, dragMode);
@@ -109,21 +118,6 @@ static JSValueRef leapForwardCallback(JSContextRef context, JSObjectRef function
return JSValueMakeUndefined(context);
}
-#if !GTK_CHECK_VERSION(2,17,3)
-static void getRootCoords(GtkWidget* view, int* rootX, int* rootY)
-{
- GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view));
- int tmpX, tmpY;
-
- gtk_widget_translate_coordinates(view, window, lastMousePositionX, lastMousePositionY, &tmpX, &tmpY);
-
- gdk_window_get_origin(window->window, rootX, rootY);
-
- *rootX += tmpX;
- *rootY += tmpY;
-}
-#endif
-
bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber)
{
WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
@@ -148,19 +142,10 @@ bool prepareMouseButtonEvent(GdkEvent* event, int eventSenderButtonNumber)
event->button.window = GTK_WIDGET(view)->window;
event->button.device = gdk_device_get_core_pointer();
event->button.state = getStateFlags();
-
- // Mouse up & down events dispatched via g_signal_emit_by_name must offset
- // their time value, so that WebKit can detect where sequences of mouse
- // clicks begin and end. This should not interfere with GDK or GTK+ event
- // processing, because the event is only seen by the widget.
- event->button.time = GDK_CURRENT_TIME + timeOffset;
+ event->button.time = GDK_CURRENT_TIME;
int xRoot, yRoot;
-#if GTK_CHECK_VERSION(2, 17, 3)
gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &xRoot, &yRoot);
-#else
- getRootCoords(GTK_WIDGET(view), &xRoot, &yRoot);
-#endif
event->button.x_root = xRoot;
event->button.y_root = yRoot;
@@ -286,11 +271,7 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function
event.motion.state = getStateFlags();
int xRoot, yRoot;
-#if GTK_CHECK_VERSION(2,17,3)
gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &xRoot, &yRoot);
-#else
- getRootCoords(GTK_WIDGET(view), &xRoot, &yRoot);
-#endif
event.motion.x_root = xRoot;
event.motion.y_root = yRoot;
@@ -350,7 +331,7 @@ static void sendOrQueueEvent(GdkEvent event, bool shouldReplaySavedEvents)
{
// Mouse move events are queued if the previous event was queued or if a
// delay was set up by leapForward().
- if (buttonCurrentlyDown || endOfQueue != startOfQueue || msgQueue[endOfQueue].delay) {
+ if ((dragMode && buttonCurrentlyDown) || endOfQueue != startOfQueue || msgQueue[endOfQueue].delay) {
msgQueue[endOfQueue++].event = event;
if (shouldReplaySavedEvents)
@@ -467,7 +448,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
else if (JSStringIsEqualToUTF8CString(character, "end"))
gdkKeySym = GDK_End;
else if (JSStringIsEqualToUTF8CString(character, "delete"))
- gdkKeySym = GDK_BackSpace;
+ gdkKeySym = GDK_Delete;
else if (JSStringIsEqualToUTF8CString(character, "F1"))
gdkKeySym = GDK_F1;
else if (JSStringIsEqualToUTF8CString(character, "F2"))
diff --git a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
index e8b8627..6f8e637 100644
--- a/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
@@ -171,6 +171,30 @@ int LayoutTestController::numberOfPages(float pageWidth, float pageHeight)
return webkit_web_frame_number_of_pages(mainFrame, pageWidth, pageHeight);
}
+JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+{
+ // FIXME: implement
+ return JSRetainPtr<JSStringRef>();
+}
+
+bool LayoutTestController::isPageBoxVisible(int pageNumber) const
+{
+ // FIXME: implement
+ return false;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const
+{
+ // FIXME: implement
+ return JSRetainPtr<JSStringRef>();
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const
+{
+ // FIXME: implement
+ return JSRetainPtr<JSStringRef>();
+}
+
size_t LayoutTestController::webHistoryItemCount()
{
// FIXME: implement
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
index 9e4b203..51ea004 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTree.mm
@@ -111,7 +111,7 @@ static void runTest(const string& testPathOrURL);
volatile bool done;
NavigationController* gNavigationController = 0;
-LayoutTestController* gLayoutTestController = 0;
+RefPtr<LayoutTestController> gLayoutTestController;
WebFrame *mainFrame = 0;
// This is the topmost frame that is loading, during a given load, or nil when no load is
@@ -136,7 +136,7 @@ static int dumpPixels;
static int threaded;
static int dumpTree = YES;
static int forceComplexText;
-static int useHTML5Parser;
+static int useHTML5Parser = YES;
static BOOL printSeparators;
static RetainPtr<CFStringRef> persistentUserStyleSheetLocation;
@@ -562,7 +562,7 @@ static void initializeGlobalsFromCommandLineOptions(int argc, const char *argv[]
{"tree", no_argument, &dumpTree, YES},
{"threaded", no_argument, &threaded, YES},
{"complex-text", no_argument, &forceComplexText, YES},
- {"html5-parser", no_argument, &useHTML5Parser, YES},
+ {"legacy-parser", no_argument, &useHTML5Parser, NO},
{NULL, 0, NULL, 0}
};
@@ -1185,6 +1185,9 @@ static void resetWebViewToConsistentStateBeforeTesting()
[WebView _resetOriginAccessWhitelists];
[[MockGeolocationProvider shared] stopTimer];
+
+ // Clear the contents of the general pasteboard
+ [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
}
static void runTest(const string& testPathOrURL)
@@ -1221,7 +1224,7 @@ static void runTest(const string& testPathOrURL)
resetWebViewToConsistentStateBeforeTesting();
- gLayoutTestController = new LayoutTestController(testURL, expectedPixelHash);
+ gLayoutTestController = LayoutTestController::create(testURL, expectedPixelHash);
topLoadingFrame = nil;
ASSERT(!draggingInfo); // the previous test should have called eventSender.mouseUp to drop!
releaseAndZero(&draggingInfo);
@@ -1311,8 +1314,7 @@ static void runTest(const string& testPathOrURL)
ASSERT(CFArrayGetCount(openWindowsRef) == 1);
ASSERT(CFArrayGetValueAtIndex(openWindowsRef, 0) == [[mainFrame webView] window]);
- gLayoutTestController->deref();
- gLayoutTestController = 0;
+ gLayoutTestController.clear();
if (ignoreWebCoreNodeLeaks)
[WebCoreStatistics stopIgnoringWebCoreNodeLeaks];
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m
index 75be9de..b1b3b86 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreePasteboard.m
@@ -177,7 +177,7 @@ static NSMutableDictionary *localPasteboards;
return [dataByType objectForKey:dataType];
}
-- (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType;
+- (BOOL)setPropertyList:(id)propertyList forType:(NSString *)dataType
{
CFDataRef data = NULL;
if (propertyList)
diff --git a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
index 8845ef0..e0cdc6b 100644
--- a/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
+++ b/WebKitTools/DumpRenderTree/mac/DumpRenderTreeWindow.mm
@@ -82,7 +82,7 @@ static CFArrayCallBacks NonRetainingArrayCallbacks = {
return gLayoutTestController ? gLayoutTestController->windowIsKey() : YES;
}
-- (void)keyDown:(id)sender
+- (void)keyDown:(NSEvent *)event
{
// Do nothing, avoiding the beep we'd otherwise get from NSResponder,
// once we get to the end of the responder chain.
diff --git a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
index 73831ff..9d2fc75 100644
--- a/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
+++ b/WebKitTools/DumpRenderTree/mac/EventSendingController.mm
@@ -598,7 +598,7 @@ static int buildModifierFlags(const WebScriptObject* modifiers)
eventCharacter = [NSString stringWithCharacters:&ch length:1];
keyCode = 0x77;
} else if ([character isEqualToString:@"delete"]) {
- const unichar ch = 0x7f;
+ const unichar ch = NSDeleteFunctionKey;
eventCharacter = [NSString stringWithCharacters:&ch length:1];
keyCode = 0x75;
}
diff --git a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
index eb01090..d0599e0 100644
--- a/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
+++ b/WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
@@ -212,6 +212,29 @@ int LayoutTestController::pageNumberForElementById(JSStringRef id, float pageWid
return [mainFrame pageNumberForElement:element:pageWidthInPixels:pageHeightInPixels];
}
+JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+{
+ JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageProperty:propertyName:pageNumber]));
+ return propertyValue;
+}
+
+bool LayoutTestController::isPageBoxVisible(int pageNumber) const
+{
+ return [mainFrame isPageBoxVisible:pageNumber];
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const
+{
+ JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame pageAreaRectInPixels:pageNumber]));
+ return propertyValue;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const
+{
+ JSRetainPtr<JSStringRef> propertyValue(Adopt, JSStringCreateWithCFString((CFStringRef)[mainFrame preferredPageSizeInPixels:pageNumber]));
+ return propertyValue;
+}
+
int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeightInPixels)
{
return [mainFrame numberOfPages:pageWidthInPixels:pageHeightInPixels];
@@ -487,9 +510,9 @@ int LayoutTestController::windowCount()
return CFArrayGetCount(openWindowsRef);
}
-bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef id)
+bool LayoutTestController::elementDoesAutoCompleteForElementWithId(JSStringRef jsString)
{
- RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, id));
+ RetainPtr<CFStringRef> idCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, jsString));
NSString *idNS = (NSString *)idCF.get();
DOMElement *element = [[mainFrame DOMDocument] getElementById:idNS];
@@ -520,7 +543,7 @@ void LayoutTestController::setCacheModel(int cacheModel)
bool LayoutTestController::isCommandEnabled(JSStringRef name)
{
RetainPtr<CFStringRef> nameCF(AdoptCF, JSStringCopyCFString(kCFAllocatorDefault, name));
- NSString *nameNS = reinterpret_cast<const NSString *>(nameCF.get());
+ NSString *nameNS = (NSString *)nameCF.get();
// Accept command strings with capital letters for first letter without trailing colon.
if (![nameNS hasSuffix:@":"] && [nameNS length]) {
@@ -860,3 +883,8 @@ void LayoutTestController::setEditingBehavior(const char* editingBehavior)
[[WebPreferences standardPreferences] setEditingBehavior:WebKitEditingWinBehavior];
[editingBehaviorNS release];
}
+
+void LayoutTestController::abortModal()
+{
+ [NSApp abortModal];
+}
diff --git a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
index e6754c1..83bf0c6 100644
--- a/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
+++ b/WebKitTools/DumpRenderTree/mac/UIDelegate.mm
@@ -67,6 +67,20 @@ DumpRenderTreeDraggingInfo *draggingInfo = nil;
printf ("CONSOLE MESSAGE: line %d: %s\n", [lineNumber intValue], [message UTF8String]);
}
+- (void)modalWindowWillClose:(NSNotification *)notification
+{
+ [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowWillCloseNotification object:nil];
+ [NSApp abortModal];
+}
+
+- (void)webViewRunModal:(WebView *)sender
+{
+ gLayoutTestController->setWindowIsKey(false);
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(modalWindowWillClose:) name:NSWindowWillCloseNotification object:nil];
+ [NSApp runModalForWindow:[sender window]];
+ gLayoutTestController->setWindowIsKey(true);
+}
+
- (void)webView:(WebView *)sender runJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame
{
if (!done)
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
index 7ec505f..5f340e9 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.cpp
@@ -191,11 +191,23 @@ void EventSender::continuousMouseScrollBy(int x, int y)
// continuousMouseScrollBy() mimics devices that send fine-grained scroll events where the 'delta' specified is not the usual
// multiple of 120. See http://doc.qt.nokia.com/4.6/qwheelevent.html#delta for a good explanation of this.
if (x) {
- QWheelEvent* event = new QWheelEvent(m_mousePos, m_mousePos, x, m_mouseButtons, Qt::NoModifier, Qt::Horizontal);
+ QEvent* event;
+ if (isGraphicsBased()) {
+ event = createGraphicsSceneWheelEvent(QEvent::GraphicsSceneWheel,
+ m_mousePos, m_mousePos, x, Qt::NoModifier, Qt::Horizontal);
+ } else
+ event = new QWheelEvent(m_mousePos, m_mousePos, x, m_mouseButtons, Qt::NoModifier, Qt::Horizontal);
+
sendOrQueueEvent(event);
}
if (y) {
- QWheelEvent* event = new QWheelEvent(m_mousePos, m_mousePos, y, m_mouseButtons, Qt::NoModifier, Qt::Vertical);
+ QEvent* event;
+ if (isGraphicsBased()) {
+ event = createGraphicsSceneWheelEvent(QEvent::GraphicsSceneWheel,
+ m_mousePos, m_mousePos, y, Qt::NoModifier, Qt::Vertical);
+ } else
+ event = new QWheelEvent(m_mousePos, m_mousePos, y, m_mouseButtons, Qt::NoModifier, Qt::Vertical);
+
sendOrQueueEvent(event);
}
}
@@ -339,8 +351,18 @@ void EventSender::contextClick()
sendEvent(m_page, &event);
QMouseEvent event2(QEvent::MouseButtonRelease, m_mousePos, Qt::RightButton, Qt::RightButton, Qt::NoModifier);
sendEvent(m_page, &event2);
- QContextMenuEvent event3(QContextMenuEvent::Mouse, m_mousePos);
- sendEvent(m_page->view(), &event3);
+
+ if (isGraphicsBased()) {
+ QGraphicsSceneContextMenuEvent ctxEvent(QEvent::GraphicsSceneContextMenu);
+ ctxEvent.setReason(QGraphicsSceneContextMenuEvent::Mouse);
+ ctxEvent.setPos(m_mousePos);
+ WebCore::WebViewGraphicsBased* view = qobject_cast<WebCore::WebViewGraphicsBased*>(m_page->view());
+ if (view)
+ sendEvent(view->graphicsView(), &ctxEvent);
+ } else {
+ QContextMenuEvent ctxEvent(QContextMenuEvent::Mouse, m_mousePos);
+ sendEvent(m_page->view(), &ctxEvent);
+ }
}
void EventSender::scheduleAsynchronousClick()
@@ -601,6 +623,19 @@ QGraphicsSceneMouseEvent* EventSender::createGraphicsSceneMouseEvent(QEvent::Typ
return event;
}
+QGraphicsSceneWheelEvent* EventSender::createGraphicsSceneWheelEvent(QEvent::Type type, const QPoint& pos, const QPoint& screenPos, int delta, Qt::KeyboardModifiers modifiers, Qt::Orientation orientation)
+{
+ QGraphicsSceneWheelEvent* event;
+ event = new QGraphicsSceneWheelEvent(type);
+ event->setPos(pos);
+ event->setScreenPos(screenPos);
+ event->setDelta(delta);
+ event->setModifiers(modifiers);
+ event->setOrientation(orientation);
+
+ return event;
+}
+
void EventSender::sendEvent(QObject* receiver, QEvent* event)
{
if (WebCore::WebViewGraphicsBased* view = qobject_cast<WebCore::WebViewGraphicsBased*>(receiver))
diff --git a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
index 51c8325..c2ff746 100644
--- a/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
+++ b/WebKitTools/DumpRenderTree/qt/EventSenderQt.h
@@ -88,6 +88,7 @@ protected:
private:
bool isGraphicsBased() const { return qobject_cast<WebCore::WebViewGraphicsBased*>(m_page->view()); }
QGraphicsSceneMouseEvent* createGraphicsSceneMouseEvent(QEvent::Type, const QPoint& pos, const QPoint& screenPos, Qt::MouseButton, Qt::MouseButtons, Qt::KeyboardModifiers);
+ QGraphicsSceneWheelEvent* createGraphicsSceneWheelEvent(QEvent::Type, const QPoint& pos, const QPoint& screenPos, int delta, Qt::KeyboardModifiers, Qt::Orientation);
void sendEvent(QObject* receiver, QEvent* event);
private:
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 8450376..3cced7d 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -35,6 +35,7 @@
#include "WorkQueueItemQt.h"
#include <QDir>
#include <QLocale>
+#include <qwebscriptworld.h>
#include <qwebsettings.h>
LayoutTestController::LayoutTestController(WebCore::DumpRenderTree* drt)
@@ -662,5 +663,19 @@ void LayoutTestController::setMockGeolocationPosition(double latitude, double lo
DumpRenderTreeSupportQt::setMockGeolocationPosition(latitude, longitude, accuracy);
}
+void LayoutTestController::evaluateScriptInIsolatedWorld(int worldID, const QString& script)
+{
+ QWebScriptWorld* scriptWorld;
+ if (!worldID) {
+ scriptWorld = new QWebScriptWorld();
+ } else if (!m_worldMap.contains(worldID)) {
+ scriptWorld = new QWebScriptWorld();
+ m_worldMap.insert(worldID, scriptWorld);
+ } else
+ scriptWorld = m_worldMap.value(worldID);
+
+ m_drt->webPage()->mainFrame()->evaluateScriptInIsolatedWorld(scriptWorld, script);
+}
+
const unsigned LayoutTestController::maxViewWidth = 800;
const unsigned LayoutTestController::maxViewHeight = 600;
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index a041ad0..b56f1c9 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -183,6 +183,10 @@ public slots:
// For now, this is a no-op. This may change depending on outcome of
// https://bugs.webkit.org/show_bug.cgi?id=33333
void setCallCloseOnWebViews() {}
+ // This is a no-op - it allows us to pass
+ // plugins/get-url-that-the-resource-load-delegate-will-disallow.html
+ // which is a Mac-specific test.
+ void addDisallowedURL(const QString&) {}
void setMockGeolocationError(int code, const QString& message);
void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
@@ -204,6 +208,8 @@ public slots:
void setEditingBehavior(const QString& editingBehavior);
+ void evaluateScriptInIsolatedWorld(int worldID, const QString& script);
+
private slots:
void processWork();
@@ -224,6 +230,7 @@ private:
bool m_isGeolocationPermissionSet;
bool m_geolocationPermission;
+ QMap<int, QWebScriptWorld*> m_worldMap;
QUrl m_userStyleSheetLocation;
QBasicTimer m_timeoutTimer;
QWebFrame* m_topLoadingFrame;
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
index 1ed54d5..451ff86 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp
@@ -104,7 +104,7 @@ COMPtr<HistoryDelegate> sharedHistoryDelegate;
IWebFrame* frame;
HWND webViewWindow;
-LayoutTestController* gLayoutTestController = 0;
+RefPtr<LayoutTestController> gLayoutTestController;
UINT_PTR waitToDumpWatchdog = 0;
@@ -140,17 +140,27 @@ wstring urlSuitableForTestResult(const wstring& url)
return PathFindFileNameW(url.c_str());
}
-string toUTF8(BSTR bstr)
+static string toUTF8(const wchar_t* wideString, size_t length)
{
- int result = WideCharToMultiByte(CP_UTF8, 0, bstr, SysStringLen(bstr) + 1, 0, 0, 0, 0);
+ int result = WideCharToMultiByte(CP_UTF8, 0, wideString, length + 1, 0, 0, 0, 0);
Vector<char> utf8Vector(result);
- result = WideCharToMultiByte(CP_UTF8, 0, bstr, SysStringLen(bstr) + 1, utf8Vector.data(), result, 0, 0);
+ result = WideCharToMultiByte(CP_UTF8, 0, wideString, length + 1, utf8Vector.data(), result, 0, 0);
if (!result)
return string();
return string(utf8Vector.data(), utf8Vector.size() - 1);
}
+string toUTF8(BSTR bstr)
+{
+ return toUTF8(bstr, SysStringLen(bstr));
+}
+
+string toUTF8(const wstring& wideString)
+{
+ return toUTF8(wideString.c_str(), wideString.length());
+}
+
static LRESULT CALLBACK DumpRenderTreeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
@@ -687,7 +697,7 @@ void dump()
COMPtr<IWebFramePrivate> framePrivate;
if (FAILED(frame->QueryInterface(&framePrivate)))
goto fail;
- framePrivate->renderTreeAsExternalRepresentation(&resultString);
+ framePrivate->renderTreeAsExternalRepresentation(gLayoutTestController->isPrinting(), &resultString);
}
if (!resultString)
@@ -903,7 +913,7 @@ static void runTest(const string& testPathOrURL)
CFRelease(url);
- ::gLayoutTestController = new LayoutTestController(pathOrURL, expectedPixelHash);
+ ::gLayoutTestController = LayoutTestController::create(pathOrURL, expectedPixelHash);
done = false;
topLoadingFrame = 0;
@@ -994,8 +1004,7 @@ static void runTest(const string& testPathOrURL)
exit:
SysFreeString(urlBStr);
- ::gLayoutTestController->deref();
- ::gLayoutTestController = 0;
+ ::gLayoutTestController.clear();
return;
}
diff --git a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
index eb5d312..cc4337b 100644
--- a/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
+++ b/WebKitTools/DumpRenderTree/win/DumpRenderTreeWin.h
@@ -50,6 +50,7 @@ extern HWND webViewWindow;
std::wstring urlSuitableForTestResult(const std::wstring& url);
std::string toUTF8(BSTR);
+std::string toUTF8(const std::wstring&);
IWebView* createWebViewAndOffscreenWindow(HWND* webViewWindow = 0);
Vector<HWND>& openWindows();
typedef HashMap<HWND, COMPtr<IWebView> > WindowToWebViewMap;
diff --git a/WebKitTools/DumpRenderTree/win/EventSender.cpp b/WebKitTools/DumpRenderTree/win/EventSender.cpp
index 2a36d8d..c9749e7 100644
--- a/WebKitTools/DumpRenderTree/win/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/win/EventSender.cpp
@@ -468,7 +468,7 @@ static JSValueRef keyDownCallback(JSContextRef context, JSObjectRef function, JS
else if (JSStringIsEqualToUTF8CString(character, "end"))
virtualKeyCode = VK_END;
else if (JSStringIsEqualToUTF8CString(character, "delete"))
- virtualKeyCode = VK_BACK;
+ virtualKeyCode = VK_DELETE;
else {
charCode = JSStringGetCharactersPtr(character)[0];
virtualKeyCode = LOBYTE(VkKeyScan(charCode));
diff --git a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj
index 73d541b..361069a 100644
--- a/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj
+++ b/WebKitTools/DumpRenderTree/win/ImageDiff.vcproj
@@ -51,7 +51,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
@@ -119,7 +119,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
@@ -186,7 +186,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
@@ -253,7 +253,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
+ AdditionalDependencies="JavaScriptCore$(WebKitDLLConfigSuffix).lib CoreGraphics$(LibraryConfigSuffix).lib CoreFoundation$(LibraryConfigSuffix).lib"
AdditionalLibraryDirectories=""
SubSystem="1"
/>
diff --git a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
index c70b517..e0d5731 100644
--- a/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
+++ b/WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
@@ -1237,11 +1237,35 @@ int LayoutTestController::numberOfPages(float pageWidthInPixels, float pageHeigh
return pageNumber;
}
+JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+{
+ // FIXME: Implement this.
+ return JSRetainPtr<JSStringRef>();
+}
+
void LayoutTestController::apiTestNewWindowDataLoadBaseURL(JSStringRef utf8Data, JSStringRef baseURL)
{
}
+bool LayoutTestController::isPageBoxVisible(int pageNumber) const
+{
+ // FIXME: implement
+ return false;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const
+{
+ // FIXME: implement
+ return JSRetainPtr<JSStringRef>();
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const
+{
+ // FIXME: implement
+ return JSRetainPtr<JSStringRef>();
+}
+
void LayoutTestController::apiTestGoToCurrentBackForwardItem()
{
COMPtr<IWebView> webView;
diff --git a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
index 321d9cf..24c6304 100644
--- a/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
+++ b/WebKitTools/DumpRenderTree/win/TestNetscapePlugin/main.cpp
@@ -142,7 +142,7 @@ NPError NPP_Destroy(NPP instance, NPSavedData **save)
}
if (obj->logDestroy)
- pluginLog(instance, "NPP_Destroy\n");
+ pluginLog(instance, "NPP_Destroy");
if (obj->onSetWindow)
free(obj->onSetWindow);
diff --git a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp
index 6637068..519b9e1 100755
--- a/WebKitTools/DumpRenderTree/win/UIDelegate.cpp
+++ b/WebKitTools/DumpRenderTree/win/UIDelegate.cpp
@@ -485,7 +485,7 @@ HRESULT STDMETHODCALLTYPE UIDelegate::webViewAddMessageToConsole(
newMessage = newMessage.substr(0, fileProtocol) + urlSuitableForTestResult(newMessage.substr(fileProtocol));
}
- printf("CONSOLE MESSAGE: line %d: %S\n", lineNumber, newMessage.c_str());
+ printf("CONSOLE MESSAGE: line %d: %s\n", lineNumber, toUTF8(newMessage).c_str());
return S_OK;
}
diff --git a/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp b/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
index f905786..c56f129 100644
--- a/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/DumpRenderTreeWx.cpp
@@ -58,7 +58,7 @@ using namespace std;
FILE* logOutput;
-LayoutTestController* gLayoutTestController = 0;
+RefPtr<LayoutTestController> gLayoutTestController;
static wxWebView* webView;
static wxTimer* idleTimer;
@@ -215,8 +215,7 @@ void dump()
fflush(stdout);
fflush(stderr);
- gLayoutTestController->deref();
- gLayoutTestController = 0;
+ gLayoutTestController.clear();
}
static void runTest(const wxString testPathOrURL)
@@ -238,7 +237,7 @@ static void runTest(const wxString testPathOrURL)
if (http == string::npos)
pathOrURL.insert(0, "file://");
- gLayoutTestController = new LayoutTestController(pathOrURL, expectedPixelHash);
+ gLayoutTestController = LayoutTestController::create(pathOrURL, expectedPixelHash);
if (!gLayoutTestController) {
wxTheApp->ExitMainLoop();
}
@@ -337,9 +336,6 @@ bool MyApp::OnInit()
delete logger;
fclose(logOutput);
- delete gLayoutTestController;
- gLayoutTestController = 0;
-
// returning false shuts the app down
return false;
}
diff --git a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
index 265802d..90ddea8 100644
--- a/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
+++ b/WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp
@@ -451,3 +451,26 @@ void LayoutTestController::setEditingBehavior(const char* editingBehavior)
{
// FIXME: Implement
}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageProperty(const char* propertyName, int pageNumber) const
+{
+
+}
+
+bool LayoutTestController::isPageBoxVisible(int pageNumber) const
+{
+ // FIXME: Implement
+ return true;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::pageAreaRectInPixels(int pageNumber) const
+{
+ // FIXME: Implement
+ return 0;
+}
+
+JSRetainPtr<JSStringRef> LayoutTestController::preferredPageSizeInPixels(int pageNumber) const
+{
+ // FIXME: Implement
+ return 0;
+}
diff --git a/WebKitTools/GtkLauncher/main.c b/WebKitTools/GtkLauncher/main.c
index e6d69a9..17ed40f 100644
--- a/WebKitTools/GtkLauncher/main.c
+++ b/WebKitTools/GtkLauncher/main.c
@@ -25,7 +25,6 @@
*/
#include <gtk/gtk.h>
-#include <stdlib.h>
#include <webkit/webkit.h>
static GtkWidget* main_window;
@@ -192,12 +191,9 @@ static gchar* filenameToURL(const char* filename)
if (!g_file_test(filename, G_FILE_TEST_EXISTS))
return 0;
- gchar *fullPath = realpath(filename, 0);
- if (!fullPath)
- return 0;
-
- gchar *fileURL = g_filename_to_uri(fullPath, 0, 0);
- free(fullPath);
+ GFile *gfile = g_file_new_for_path(filename);
+ gchar *fileURL = g_file_get_uri(gfile);
+ g_object_unref(gfile);
return fileURL;
}
diff --git a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
index 4518dd3..eeb70c9 100644
--- a/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
+++ b/WebKitTools/MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj
@@ -11,14 +11,42 @@
256AC3DA0F4B6AC300CF3369 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256AC3D90F4B6AC300CF3369 /* AppDelegate.m */; };
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
+ BC20545E11C96C92008F3375 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; };
BC329487116A92E2008635D0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = BC329486116A92E2008635D0 /* main.m */; };
BC329498116A941B008635D0 /* BrowserWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BC329497116A941B008635D0 /* BrowserWindowController.m */; };
BC3294A3116A9852008635D0 /* BrowserWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = BC3294A1116A9852008635D0 /* BrowserWindow.xib */; };
BC8FB5A8116AA1FE0080D413 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */; };
+ BCBD384011B08A6800E01E54 /* WebBundleMain.m in Sources */ = {isa = PBXBuildFile; fileRef = BCBD383D11B08A3100E01E54 /* WebBundleMain.m */; };
+ BCBD384411B08AAD00E01E54 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */; };
+ BCBD38D011B08C0200E01E54 /* WebBundle.bundle in Copy WebBundle */ = {isa = PBXBuildFile; fileRef = BCBD381D11B0898200E01E54 /* WebBundle.bundle */; };
BCE625EE117FC80E00572433 /* BrowserStatisticsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = BCE625ED117FC80E00572433 /* BrowserStatisticsWindow.xib */; };
BCE625F1117FC82700572433 /* BrowserStatisticsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = BCE625F0117FC82700572433 /* BrowserStatisticsWindowController.m */; };
/* End PBXBuildFile section */
+/* Begin PBXContainerItemProxy section */
+ BCBD38C511B08BA400E01E54 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BCBD381C11B0898200E01E54;
+ remoteInfo = WebBundle;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ BCBD38CF11B08C0100E01E54 /* Copy WebBundle */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = Contents;
+ dstSubfolderSpec = 1;
+ files = (
+ BCBD38D011B08C0200E01E54 /* WebBundle.bundle in Copy WebBundle */,
+ );
+ name = "Copy WebBundle";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
/* Begin PBXFileReference section */
089C165DFE840E0CC02AAC07 /* InfoPlist.strings */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = InfoPlist.strings; path = mac/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
@@ -37,6 +65,9 @@
BC329497116A941B008635D0 /* BrowserWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserWindowController.m; path = mac/BrowserWindowController.m; sourceTree = "<group>"; };
BC3294A2116A9852008635D0 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = mac/English.lproj/BrowserWindow.xib; sourceTree = "<group>"; };
BC8FB5A7116AA1FE0080D413 /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BCBD381D11B0898200E01E54 /* WebBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WebBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ BCBD381E11B0898200E01E54 /* WebBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "WebBundle-Info.plist"; sourceTree = "<group>"; };
+ BCBD383D11B08A3100E01E54 /* WebBundleMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WebBundleMain.m; sourceTree = "<group>"; };
BCE625ED117FC80E00572433 /* BrowserStatisticsWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = BrowserStatisticsWindow.xib; path = mac/BrowserStatisticsWindow.xib; sourceTree = "<group>"; };
BCE625EF117FC82700572433 /* BrowserStatisticsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BrowserStatisticsWindowController.h; path = mac/BrowserStatisticsWindowController.h; sourceTree = "<group>"; };
BCE625F0117FC82700572433 /* BrowserStatisticsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BrowserStatisticsWindowController.m; path = mac/BrowserStatisticsWindowController.m; sourceTree = "<group>"; };
@@ -52,6 +83,15 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ BCBD381B11B0898200E01E54 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC20545E11C96C92008F3375 /* Cocoa.framework in Frameworks */,
+ BCBD384411B08AAD00E01E54 /* WebKit2.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
@@ -91,6 +131,7 @@
isa = PBXGroup;
children = (
8D1107320486CEB800E47090 /* MiniBrowser.app */,
+ BCBD381D11B0898200E01E54 /* WebBundle.bundle */,
);
name = Products;
sourceTree = "<group>";
@@ -100,6 +141,7 @@
children = (
080E96DDFE201D6D7F000001 /* Classes */,
29B97315FDCFA39411CA2CEA /* Other Sources */,
+ BCBD382B11B089F700E01E54 /* WebBundle */,
29B97317FDCFA39411CA2CEA /* Resources */,
BC1770481188EB05007D9E9A /* Scripts */,
29B97323FDCFA39411CA2CEA /* Frameworks */,
@@ -121,6 +163,7 @@
isa = PBXGroup;
children = (
8D1107310486CEB800E47090 /* MiniBrowser-Info.plist */,
+ BCBD381E11B0898200E01E54 /* WebBundle-Info.plist */,
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */,
BC3294A1116A9852008635D0 /* BrowserWindow.xib */,
1DDD58140DA1D0A300B32029 /* MainMenu.xib */,
@@ -146,6 +189,15 @@
name = Scripts;
sourceTree = "<group>";
};
+ BCBD382B11B089F700E01E54 /* WebBundle */ = {
+ isa = PBXGroup;
+ children = (
+ BCBD383D11B08A3100E01E54 /* WebBundleMain.m */,
+ );
+ name = WebBundle;
+ path = mac/WebBundle;
+ sourceTree = "<group>";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@@ -154,6 +206,7 @@
buildConfigurationList = C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */;
buildPhases = (
8D1107290486CEB800E47090 /* Resources */,
+ BCBD38CF11B08C0100E01E54 /* Copy WebBundle */,
8D11072C0486CEB800E47090 /* Sources */,
8D11072E0486CEB800E47090 /* Frameworks */,
BC17701E1188DFB4007D9E9A /* Make Launchable */,
@@ -161,6 +214,7 @@
buildRules = (
);
dependencies = (
+ BCBD38C611B08BA400E01E54 /* PBXTargetDependency */,
);
name = MiniBrowser;
productInstallPath = "$(HOME)/Applications";
@@ -168,6 +222,23 @@
productReference = 8D1107320486CEB800E47090 /* MiniBrowser.app */;
productType = "com.apple.product-type.application";
};
+ BCBD381C11B0898200E01E54 /* WebBundle */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = BCBD382111B0898300E01E54 /* Build configuration list for PBXNativeTarget "WebBundle" */;
+ buildPhases = (
+ BCBD381911B0898200E01E54 /* Resources */,
+ BCBD381A11B0898200E01E54 /* Sources */,
+ BCBD381B11B0898200E01E54 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = WebBundle;
+ productName = WebBundle;
+ productReference = BCBD381D11B0898200E01E54 /* WebBundle.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
/* End PBXNativeTarget section */
/* Begin PBXProject section */
@@ -181,6 +252,7 @@
projectRoot = "";
targets = (
8D1107260486CEB800E47090 /* MiniBrowser */,
+ BCBD381C11B0898200E01E54 /* WebBundle */,
);
};
/* End PBXProject section */
@@ -197,6 +269,13 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ BCBD381911B0898200E01E54 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
@@ -228,8 +307,24 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
+ BCBD381A11B0898200E01E54 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BCBD384011B08A6800E01E54 /* WebBundleMain.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
/* End PBXSourcesBuildPhase section */
+/* Begin PBXTargetDependency section */
+ BCBD38C611B08BA400E01E54 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BCBD381C11B0898200E01E54 /* WebBundle */;
+ targetProxy = BCBD38C511B08BA400E01E54 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
/* Begin PBXVariantGroup section */
089C165CFE840E0CC02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
@@ -258,6 +353,36 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
+ BCBD381F11B0898300E01E54 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = NO;
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch;
+ INFOPLIST_FILE = "WebBundle-Info.plist";
+ PRODUCT_NAME = WebBundle;
+ WRAPPER_EXTENSION = bundle;
+ };
+ name = Debug;
+ };
+ BCBD382011B0898300E01E54 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_ENABLE_OBJC_GC = supported;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = mac/MiniBrowser_Prefix.pch;
+ INFOPLIST_FILE = "WebBundle-Info.plist";
+ PRODUCT_NAME = WebBundle;
+ WRAPPER_EXTENSION = bundle;
+ };
+ name = Release;
+ };
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -318,6 +443,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
+ BCBD382111B0898300E01E54 /* Build configuration list for PBXNativeTarget "WebBundle" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BCBD381F11B0898300E01E54 /* Debug */,
+ BCBD382011B0898300E01E54 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
C01FCF4A08A954540054247B /* Build configuration list for PBXNativeTarget "MiniBrowser" */ = {
isa = XCConfigurationList;
buildConfigurations = (
diff --git a/WebKitTools/MiniBrowser/WebBundle-Info.plist b/WebKitTools/MiniBrowser/WebBundle-Info.plist
new file mode 100644
index 0000000..c285a47
--- /dev/null
+++ b/WebKitTools/MiniBrowser/WebBundle-Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.h b/WebKitTools/MiniBrowser/mac/AppDelegate.h
index 73efe32..2173c93 100644
--- a/WebKitTools/MiniBrowser/mac/AppDelegate.h
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.h
@@ -23,8 +23,14 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+enum ProcessModel {
+ kProcessModelSharedSecondaryThread,
+ kProcessModelSharedSecondaryProcess
+};
+typedef unsigned long ProcessModel;
+
@interface BrowserAppDelegate : NSObject <NSApplicationDelegate> {
- WKProcessModel currentProcessModel;
+ ProcessModel currentProcessModel;
WKPageNamespaceRef threadPageNamespace;
WKPageNamespaceRef processPageNamespace;
}
diff --git a/WebKitTools/MiniBrowser/mac/AppDelegate.m b/WebKitTools/MiniBrowser/mac/AppDelegate.m
index 64037fa..efc9b37 100644
--- a/WebKitTools/MiniBrowser/mac/AppDelegate.m
+++ b/WebKitTools/MiniBrowser/mac/AppDelegate.m
@@ -28,26 +28,53 @@
#import "BrowserWindowController.h"
#import "BrowserStatisticsWindowController.h"
-static NSString *defaultURL = @"http://webkit.org/";
+#import <WebKit2/WKStringCF.h>
+#import <WebKit2/WKContextPrivate.h>
+
+static NSString *defaultURL = @"file:///Users/andersca/Desktop/t.html";
@implementation BrowserAppDelegate
+void _didRecieveMessageFromInjectedBundle(WKContextRef context, WKStringRef message, const void *clientInfo)
+{
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ LOG(@"ContextInjectedBundleClient - didRecieveMessage - message: %@", cfMessage);
+ CFRelease(cfMessage);
+
+ WKStringRef newMessage = WKStringCreateWithCFString(CFSTR("Roger that!"));
+ WKContextPostMessageToInjectedBundle(context, newMessage);
+ WKStringRelease(newMessage);
+}
+
- (id)init
{
self = [super init];
if (self) {
if ([NSEvent modifierFlags] & NSShiftKeyMask)
- currentProcessModel = kWKProcessModelSecondaryThread;
+ currentProcessModel = kProcessModelSharedSecondaryThread;
else
- currentProcessModel = kWKProcessModelSecondaryProcess;
+ currentProcessModel = kProcessModelSharedSecondaryProcess;
- WKContextRef threadContext = WKContextCreateWithProcessModel(kWKProcessModelSecondaryThread);
+ WKContextRef threadContext = WKContextGetSharedThreadContext();
threadPageNamespace = WKPageNamespaceCreate(threadContext);
WKContextRelease(threadContext);
- WKContextRef processContext = WKContextCreateWithProcessModel(kWKProcessModelSecondaryProcess);
+ CFStringRef bundlePathCF = (CFStringRef)[[NSBundle mainBundle] pathForAuxiliaryExecutable:@"WebBundle.bundle"];
+ WKStringRef bundlePath = WKStringCreateWithCFString(bundlePathCF);
+
+ WKContextRef processContext = WKContextCreateWithInjectedBundlePath(bundlePath);
+
+ WKContextInjectedBundleClient bundleClient = {
+ 0, /* version */
+ 0, /* clientInfo */
+ _didRecieveMessageFromInjectedBundle
+ };
+ WKContextSetInjectedBundleClient(processContext, &bundleClient);
+
processPageNamespace = WKPageNamespaceCreate(processContext);
WKContextRelease(processContext);
+
+ WKStringRelease(bundlePath);
}
return self;
@@ -63,19 +90,19 @@ static NSString *defaultURL = @"http://webkit.org/";
- (WKPageNamespaceRef)getCurrentPageNamespace
{
- return (currentProcessModel == kWKProcessModelSecondaryThread) ? threadPageNamespace : processPageNamespace;
+ return (currentProcessModel == kProcessModelSharedSecondaryThread) ? threadPageNamespace : processPageNamespace;
}
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
if ([menuItem action] == @selector(setSharedProcessProcessModel:))
- [menuItem setState:currentProcessModel == kWKProcessModelSecondaryProcess ? NSOnState : NSOffState];
+ [menuItem setState:currentProcessModel == kProcessModelSharedSecondaryProcess ? NSOnState : NSOffState];
else if ([menuItem action] == @selector(setSharedThreadProcessModel:))
- [menuItem setState:currentProcessModel == kWKProcessModelSecondaryThread ? NSOnState : NSOffState];
+ [menuItem setState:currentProcessModel == kProcessModelSharedSecondaryThread ? NSOnState : NSOffState];
return YES;
}
-- (void)_setProcessModel:(WKProcessModel)processModel
+- (void)_setProcessModel:(ProcessModel)processModel
{
if (processModel == currentProcessModel)
return;
@@ -85,12 +112,12 @@ static NSString *defaultURL = @"http://webkit.org/";
- (IBAction)setSharedProcessProcessModel:(id)sender
{
- [self _setProcessModel:kWKProcessModelSecondaryProcess];
+ [self _setProcessModel:kProcessModelSharedSecondaryProcess];
}
- (IBAction)setSharedThreadProcessModel:(id)sender
{
- [self _setProcessModel:kWKProcessModelSecondaryThread];
+ [self _setProcessModel:kProcessModelSharedSecondaryThread];
}
- (IBAction)showStatisticsWindow:(id)sender
diff --git a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
index b9306c0..11e51a0 100644
--- a/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
+++ b/WebKitTools/MiniBrowser/mac/BrowserWindowController.m
@@ -25,6 +25,7 @@
#import "BrowserWindowController.h"
+#import <WebKit2/WKPagePrivate.h>
#import <WebKit2/WKStringCF.h>
#import <WebKit2/WKURLCF.h>
@@ -99,7 +100,7 @@
- (BOOL)windowShouldClose:(id)sender
{
- NSLog(@"windowShouldClose");
+ LOG(@"windowShouldClose");
BOOL canCloseImmediately = WKPageTryClose(_webView.pageRef);
return canCloseImmediately;
}
@@ -120,49 +121,49 @@
static void _didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didStartProvisionalLoadForFrame");
+ LOG(@"didStartProvisionalLoadForFrame");
}
static void _didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didReceiveServerRedirectForProvisionalLoadForFrame");
+ LOG(@"didReceiveServerRedirectForProvisionalLoadForFrame");
}
static void _didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didFailProvisionalLoadWithErrorForFrame");
+ LOG(@"didFailProvisionalLoadWithErrorForFrame");
}
static void _didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didCommitLoadForFrame");
+ LOG(@"didCommitLoadForFrame");
}
static void _didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didFinishLoadForFrame");
+ LOG(@"didFinishLoadForFrame");
}
static void _didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didFailLoadWithErrorForFrame");
+ LOG(@"didFailLoadWithErrorForFrame");
}
static void _didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, const void *clientInfo)
{
CFStringRef cfTitle = WKStringCopyCFString(0, title);
- NSLog(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle);
+ LOG(@"didReceiveTitleForFrame \"%@\"", (NSString *)cfTitle);
CFRelease(cfTitle);
}
static void _didFirstLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didFirstLayoutForFrame");
+ LOG(@"didFirstLayoutForFrame");
}
static void _didFirstVisuallyNonEmptyLayoutForFrame(WKPageRef page, WKFrameRef frame, const void *clientInfo)
{
- NSLog(@"didFirstVisuallyNonEmptyLayoutForFrame");
+ LOG(@"didFirstVisuallyNonEmptyLayoutForFrame");
}
static void _didStartProgress(WKPageRef page, const void *clientInfo)
@@ -170,9 +171,9 @@ static void _didStartProgress(WKPageRef page, const void *clientInfo)
[(BrowserWindowController *)clientInfo didStartProgress];
}
-static void _didChangeProgress(WKPageRef page, double value, const void *clientInfo)
+static void _didChangeProgress(WKPageRef page, const void *clientInfo)
{
- [(BrowserWindowController *)clientInfo didChangeProgress:value];
+ [(BrowserWindowController *)clientInfo didChangeProgress:WKPageGetEstimatedProgress(page)];
}
static void _didFinishProgress(WKPageRef page, const void *clientInfo)
@@ -182,25 +183,25 @@ static void _didFinishProgress(WKPageRef page, const void *clientInfo)
static void _didBecomeUnresponsive(WKPageRef page, const void *clientInfo)
{
- NSLog(@"didBecomeUnresponsive");
+ LOG(@"didBecomeUnresponsive");
}
static void _didBecomeResponsive(WKPageRef page, const void *clientInfo)
{
- NSLog(@"didBecomeResponsive");
+ LOG(@"didBecomeResponsive");
}
#pragma mark Policy Client Callbacks
static void _decidePolicyForNavigationAction(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
- NSLog(@"decidePolicyForNavigationAction");
+ LOG(@"decidePolicyForNavigationAction");
WKFramePolicyListenerUse(listener);
}
static void _decidePolicyForNewWindowAction(WKPageRef page, uint32_t navigationType, WKURLRef url, WKFrameRef frame, WKFramePolicyListenerRef listener, const void *clientInfo)
{
- NSLog(@"decidePolicyForNewWindowAction");
+ LOG(@"decidePolicyForNewWindowAction");
WKFramePolicyListenerUse(listener);
}
@@ -213,7 +214,7 @@ static void _decidePolicyForMIMEType(WKPageRef page, WKStringRef MIMEType, WKURL
static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo)
{
- NSLog(@"createNewPage");
+ LOG(@"createNewPage");
BrowserWindowController *controller = [[BrowserWindowController alloc] initWithPageNamespace:WKPageGetPageNamespace(page)];
[controller loadWindow];
@@ -222,13 +223,13 @@ static WKPageRef _createNewPage(WKPageRef page, const void* clientInfo)
static void _showPage(WKPageRef page, const void *clientInfo)
{
- NSLog(@"showPage");
+ LOG(@"showPage");
[[(BrowserWindowController *)clientInfo window] orderFront:nil];
}
static void _closePage(WKPageRef page, const void *clientInfo)
{
- NSLog(@"closePage");
+ LOG(@"closePage");
WKPageClose(page);
[[(BrowserWindowController *)clientInfo window] close];
WKPageRelease(page);
@@ -259,7 +260,7 @@ static void _didNavigateWithNavigationData(WKPageRef page, WKNavigationDataRef n
{
CFStringRef title = WKStringCopyCFString(0, WKNavigationDataGetTitle(navigationData));
CFURLRef url = WKURLCopyCFURL(0, WKNavigationDataGetURL(navigationData));
- NSLog(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url);
+ LOG(@"HistoryClient - didNavigateWithNavigationData - title: %@ - url: %@", title, url);
CFRelease(title);
CFRelease(url);
}
@@ -268,7 +269,7 @@ static void _didPerformClientRedirect(WKPageRef page, WKURLRef sourceURL, WKURLR
{
CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
- NSLog(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+ LOG(@"HistoryClient - didPerformClientRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
CFRelease(cfSourceURL);
CFRelease(cfDestinationURL);
}
@@ -277,7 +278,7 @@ static void _didPerformServerRedirect(WKPageRef page, WKURLRef sourceURL, WKURLR
{
CFURLRef cfSourceURL = WKURLCopyCFURL(0, sourceURL);
CFURLRef cfDestinationURL = WKURLCopyCFURL(0, destinationURL);
- NSLog(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
+ LOG(@"HistoryClient - didPerformServerRedirect - sourceURL: %@ - destinationURL: %@", cfSourceURL, cfDestinationURL);
CFRelease(cfSourceURL);
CFRelease(cfDestinationURL);
}
@@ -286,7 +287,7 @@ static void _didUpdateHistoryTitle(WKPageRef page, WKStringRef title, WKURLRef U
{
CFStringRef cfTitle = WKStringCopyCFString(0, title);
CFURLRef cfURL = WKURLCopyCFURL(0, URL);
- NSLog(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL);
+ LOG(@"HistoryClient - didUpdateHistoryTitle - title: %@ - URL: %@", cfTitle, cfURL);
CFRelease(cfTitle);
CFRelease(cfURL);
}
diff --git a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
index af79d0f..faa14fc 100644
--- a/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
+++ b/WebKitTools/MiniBrowser/mac/MiniBrowser_Prefix.pch
@@ -28,3 +28,9 @@
#endif
#import <WebKit2/WebKit2.h>
+
+#if ENABLE_LOGGING
+#define LOG NSLog
+#else
+#define LOG(...) ((void)0)
+#endif \ No newline at end of file
diff --git a/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
new file mode 100644
index 0000000..f52c98e
--- /dev/null
+++ b/WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <Cocoa/Cocoa.h>
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundleInitialize.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKString.h>
+#include <WebKit2/WKStringCF.h>
+#include <WebKit2/WKURLCF.h>
+#include <stdio.h>
+
+static WKBundleRef globalBundle;
+
+// WKBundlePageClient
+
+void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
+{
+ CFURLRef cfURL = WKURLCopyCFURL(0, WKBundlePageGetMainFrameURL(page));
+ LOG(@"WKBundlePageClient - _didClearWindowForFrame %@", [(NSURL *)cfURL absoluteString]);
+ CFRelease(cfURL);
+
+ WKStringRef message = WKStringCreateWithCFString(CFSTR("Window was cleared"));
+ WKBundlePostMessage(globalBundle, message);
+ WKStringRelease(message);
+}
+
+
+// WKBundleClient
+
+void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ LOG(@"WKBundleClient - didCreatePage\n");
+
+ WKBundlePageClient client = {
+ 0,
+ 0,
+ _didStartProvisionalLoadForFrame,
+ _didReceiveServerRedirectForProvisionalLoadForFrame,
+ _didFailProvisionalLoadWithErrorForFrame,
+ _didCommitLoadForFrame,
+ _didFinishLoadForFrame,
+ _didFailLoadWithErrorForFrame,
+ _didReceiveTitleForFrame,
+ _didClearWindowForFrame
+ };
+ WKBundlePageSetClient(page, &client);
+}
+
+void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ LOG(@"WKBundleClient - willDestroyPage\n");
+}
+
+void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)
+{
+ CFStringRef cfMessage = WKStringCopyCFString(0, message);
+ LOG(@"WKBundleClient - didRecieveMessage %@\n", cfMessage);
+ CFRelease(cfMessage);
+}
+
+void WKBundleInitialize(WKBundleRef bundle)
+{
+ globalBundle = bundle;
+
+ WKBundleClient client = {
+ 0,
+ 0,
+ _didCreatePage,
+ _willDestroyPage,
+ _didRecieveMessage
+ };
+ WKBundleSetClient(bundle, &client);
+}
diff --git a/WebKitTools/MiniBrowser/win/BrowserView.cpp b/WebKitTools/MiniBrowser/win/BrowserView.cpp
index 95385ca..49e46bf 100644
--- a/WebKitTools/MiniBrowser/win/BrowserView.cpp
+++ b/WebKitTools/MiniBrowser/win/BrowserView.cpp
@@ -27,6 +27,7 @@
#include "BrowserView.h"
#include "BrowserWindow.h"
+#include <WebKit2/WKContextPrivate.h>
#include <WebKit2/WKURLCF.h>
static const unsigned short HIGH_BIT_MASK_SHORT = 0x8000;
@@ -66,8 +67,12 @@ void BrowserView::create(RECT webViewRect, BrowserWindow* parentWindow)
bool isShiftKeyDown = ::GetKeyState(VK_SHIFT) & HIGH_BIT_MASK_SHORT;
- //WKContextRef context = WKContextCreateWithProcessModel(isShiftKeyDown ? kWKProcessModelSecondaryThread : kWKProcessModelSecondaryProcess);
- WKContextRef context = WKContextCreateWithProcessModel(kWKProcessModelSecondaryThread);
+ WKContextRef context;
+ if (isShiftKeyDown)
+ context = WKContextGetSharedThreadContext();
+ else
+ context = WKContextGetSharedProcessContext();
+
WKPageNamespaceRef pageNamespace = WKPageNamespaceCreate(context);
m_webView = WKViewCreate(webViewRect, pageNamespace, parentWindow->window());
diff --git a/WebKitTools/QtTestBrowser/fpstimer.h b/WebKitTools/QtTestBrowser/fpstimer.h
index 66d38eb..accecd2 100644
--- a/WebKitTools/QtTestBrowser/fpstimer.h
+++ b/WebKitTools/QtTestBrowser/fpstimer.h
@@ -25,8 +25,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef fpsmeasure_h
-#define fpsmeasure_h
+#ifndef fpstimer_h
+#define fpstimer_h
#include <QObject>
#include <QSet>
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index a29a6fd..88765e8 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -56,7 +56,7 @@ my $makeArgs;
my $startTime = time();
my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $clientBasedGeolocationSupport, $databaseSupport, $datagridSupport, $datalistSupport,
- $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $imageResizerSupport, $indexedDatabaseSupport,
+ $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $imageResizerSupport, $indexedDatabaseSupport, $inputSpeechSupport,
$javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $rubySupport, $systemMallocSupport, $sandboxSupport, $sharedWorkersSupport,
$svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
$svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
@@ -112,6 +112,9 @@ my @features = (
{ option => "indexed-database", desc => "Toggle Indexed Database API support",
define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
+ { option => "input-speech", desc => "Speech Input API support",
+ define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
+
{ option => "javascript-debugger", desc => "Toggle JavaScript Debugger/Profiler support",
define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javaScriptDebuggerSupport },
diff --git a/WebKitTools/Scripts/do-webcore-rename b/WebKitTools/Scripts/do-webcore-rename
index e2ce019..54fb0af 100755
--- a/WebKitTools/Scripts/do-webcore-rename
+++ b/WebKitTools/Scripts/do-webcore-rename
@@ -73,6 +73,7 @@ find(\&wanted, "JavaScriptCore");
find(\&wanted, "JavaScriptGlue");
find(\&wanted, "WebCore");
find(\&wanted, "WebKit");
+find(\&wanted, "WebKit2");
sub wanted
{
@@ -95,7 +96,7 @@ sub wanted
my $isDOMTypeRename = 0;
my %renames = (
# Renames go here in the form of:
- # "Tokenizer" => "DocumentParser",
+ # "HTMLDocumentParser" => "LegacyHTMLDocumentParser",
);
my %renamesContemplatedForTheFuture = (
diff --git a/WebKitTools/Scripts/update-webkit-chromium b/WebKitTools/Scripts/update-webkit-chromium
index fa94f8c..836e30e 100755
--- a/WebKitTools/Scripts/update-webkit-chromium
+++ b/WebKitTools/Scripts/update-webkit-chromium
@@ -28,6 +28,8 @@
# Update script for the WebKit Chromium Port.
+use File::Path;
+
chdir("WebKit/chromium") or die $!;
# Find gclient or install it.
diff --git a/WebKitTools/Scripts/webkitdirs.pm b/WebKitTools/Scripts/webkitdirs.pm
index 33ae7da..46d2cbf 100644
--- a/WebKitTools/Scripts/webkitdirs.pm
+++ b/WebKitTools/Scripts/webkitdirs.pm
@@ -1553,17 +1553,18 @@ sub runSafari
}
if (isAppleWinWebKit()) {
- my $script = "run-webkit-nightly.cmd";
- my $result = system "cp", "$FindBin::Bin/$script", productDir();
+ my $result;
+ my $productDir = productDir();
+ if ($debugger) {
+ setupCygwinEnv();
+ chomp($ENV{WEBKITNIGHTLY} = `cygpath -wa "$productDir"`);
+ my $safariPath = safariPath();
+ chomp($safariPath = `cygpath -wa "$safariPath"`);
+ $result = system $vcBuildPath, "/debugexe", "\"$safariPath\"", @ARGV;
+ } else {
+ $result = system File::Spec->catfile(productDir(), "WebKit.exe"), @ARGV;
+ }
return $result if $result;
-
- my $cwd = getcwd();
- chdir productDir();
-
- my $debuggerFlag = $debugger ? "/debugger" : "";
- $result = system "cmd", "/c", "call $script $debuggerFlag";
- chdir $cwd;
- return $result;
}
return 1;
diff --git a/WebKitTools/Scripts/webkitpy/common/config/committers.py b/WebKitTools/Scripts/webkitpy/common/config/committers.py
index 37bd4eb..7b69815 100644
--- a/WebKitTools/Scripts/webkitpy/common/config/committers.py
+++ b/WebKitTools/Scripts/webkitpy/common/config/committers.py
@@ -97,7 +97,6 @@ committers_unable_to_review = [
Committer("Diego Gonzalez", ["diegohcg@webkit.org", "diego.gonzalez@openbossa.org"], "diegohcg"),
Committer("Dirk Pranke", "dpranke@chromium.org"),
Committer("Drew Wilson", "atwilson@chromium.org", "atwilson"),
- Committer("Dumitru Daniliuc", "dumi@chromium.org", "dumi"),
Committer("Eli Fidler", "eli@staikos.net", "QBin"),
Committer("Enrica Casucci", "enrica@apple.com"),
Committer("Erik Arvidsson", "arv@chromium.org", "arv"),
@@ -115,24 +114,28 @@ committers_unable_to_review = [
Committer("Jakob Petsovits", ["jpetsovits@rim.com", "jpetso@gmx.at"], "jpetso"),
Committer("Jakub Wieczorek", "jwieczorek@webkit.org", "fawek"),
Committer("James Hawkins", ["jhawkins@chromium.org", "jhawkins@google.com"], "jhawkins"),
- Committer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"]),
+ Committer("James Robinson", ["jamesr@chromium.org", "jamesr@google.com"], "jamesr"),
Committer("Jens Alfke", ["snej@chromium.org", "jens@apple.com"]),
Committer("Jer Noble", "jer.noble@apple.com", "jernoble"),
Committer("Jeremy Moskovich", ["playmobil@google.com", "jeremy@chromium.org"], "jeremymos"),
Committer("Jessie Berlin", ["jberlin@webkit.org", "jberlin@apple.com"]),
Committer("Jesus Sanchez-Palencia", ["jesus@webkit.org", "jesus.palencia@openbossa.org"], "jeez_"),
+ Committer("Jocelyn Turcotte", "jocelyn.turcotte@nokia.com", "jturcotte"),
Committer("John Abd-El-Malek", "jam@chromium.org", "jam"),
Committer("John Gregg", ["johnnyg@google.com", "johnnyg@chromium.org"], "johnnyg"),
Committer("Joost de Valk", ["joost@webkit.org", "webkit-dev@joostdevalk.nl"], "Altha"),
Committer("Julie Parent", ["jparent@google.com", "jparent@chromium.org"], "jparent"),
Committer("Julien Chaffraix", ["jchaffraix@webkit.org", "julien.chaffraix@gmail.com"]),
Committer("Jungshik Shin", "jshin@chromium.org"),
+ Committer("Justin Schuh", "jschuh@chromium.org", "jschuh"),
Committer("Keishi Hattori", "keishi@webkit.org", "keishi"),
Committer("Kelly Norton", "knorton@google.com"),
Committer("Kenneth Russell", "kbr@google.com"),
Committer("Kinuko Yasuda", "kinuko@chromium.org", "kinuko"),
Committer("Krzysztof Kowalczyk", "kkowalczyk@gmail.com"),
+ Committer("Leandro Pereira", ["leandro@profusion.mobi", "leandro@webkit.org"], "acidx"),
Committer("Levi Weintraub", "lweintraub@apple.com"),
+ Committer("Luiz Agostini", ["luiz@webkit.org", "luiz.agostini@openbossa.org"], "lca"),
Committer("Mads Ager", "ager@chromium.org"),
Committer("Marcus Voltis Bulach", "bulach@chromium.org"),
Committer("Matt Lilek", ["webkit@mattlilek.com", "pewtermoose@webkit.org"]),
@@ -157,6 +160,7 @@ committers_unable_to_review = [
Committer("Scott Violet", "sky@chromium.org", "sky"),
Committer("Stephen White", "senorblanco@chromium.org", "senorblanco"),
Committer("Tony Chang", "tony@chromium.org", "tony^work"),
+ Committer("Tony Gentilcore", "tonyg@chromium.org", "tonyg-cr"),
Committer("Trey Matteson", "trey@usa.net", "trey"),
Committer("Tristan O'Tierney", ["tristan@otierney.net", "tristan@apple.com"]),
Committer("Victor Wang", "victorw@chromium.org"),
@@ -209,6 +213,7 @@ reviewers_list = [
Reviewer("Dirk Schulze", "krit@webkit.org", "krit"),
Reviewer("Dmitry Titov", "dimich@chromium.org", "dimich"),
Reviewer("Don Melton", "gramps@apple.com", "gramps"),
+ Reviewer("Dumitru Daniliuc", "dumi@chromium.org", "dumi"),
Reviewer("Eric Carlson", "eric.carlson@apple.com"),
Reviewer("Eric Seidel", "eric@webkit.org", "eseidel"),
Reviewer("Gavin Barraclough", "barraclough@apple.com", "gbarra"),
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
index c849ef1..5078c55 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot.py
@@ -319,9 +319,10 @@ class BuildBot(object):
"Leopard",
"Tiger",
"Windows.*Build",
- "GTK",
+ "GTK.*32",
+ "GTK.*64.*Debug", # Disallow the 64-bit Release bot which is broken.
"Qt",
- "Chromium",
+ "Chromium.*Release$",
]
def _parse_last_build_cell(self, builder, cell):
diff --git a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
index 5384321..8fb4c2c 100644
--- a/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/common/net/buildbot_unittest.py
@@ -275,6 +275,9 @@ class BuildBotTest(unittest.TestCase):
{'name': u'Chromium Linux Release', },
{'name': u'Chromium Mac Release', },
{'name': u'Chromium Win Release', },
+ {'name': u'Chromium Linux Release (Tests)', },
+ {'name': u'Chromium Mac Release (Tests)', },
+ {'name': u'Chromium Win Release (Tests)', },
{'name': u'New run-webkit-tests', },
]
name_regexps = [
@@ -283,9 +286,10 @@ class BuildBotTest(unittest.TestCase):
"Leopard",
"Tiger",
"Windows.*Build",
- "GTK",
+ "GTK.*32",
+ "GTK.*64.*Debug", # Disallow the 64-bit Release bot which is broken.
"Qt",
- "Chromium",
+ "Chromium.*Release$",
]
expected_builders = [
{'name': u'Tiger Intel Release', },
@@ -300,7 +304,6 @@ class BuildBotTest(unittest.TestCase):
{'name': u'GTK Linux 32-bit Release', },
{'name': u'GTK Linux 32-bit Debug', },
{'name': u'GTK Linux 64-bit Debug', },
- {'name': u'GTK Linux 64-bit Release', },
{'name': u'Qt Linux Release', },
{'name': u'Qt Linux Release minimal', },
{'name': u'Qt Linux ARMv5 Release', },
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
index a77bff0..611afdc 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp.py
@@ -161,7 +161,7 @@ def up_to_unmatched_closing_paren(s):
Returns:
A pair of strings (prefix before first unmatched ')',
- reminder of s after first unmatched ')'), e.g.,
+ remainder of s after first unmatched ')'), e.g.,
up_to_unmatched_closing_paren("a == (b + c)) { ")
returns "a == (b + c)", " {".
Returns None, None if there is no unmatched ')'
@@ -1337,26 +1337,25 @@ def check_spacing(file_extension, clean_lines, line_number, error):
# there should either be zero or one spaces inside the parens.
# We don't want: "if ( foo)" or "if ( foo )".
# Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed.
- matched = search(r'\b(?P<statement>if|for|foreach|while|switch)\s*\((?P<reminder>.*)$', line)
+ matched = search(r'\b(?P<statement>if|for|foreach|while|switch)\s*\((?P<remainder>.*)$', line)
if matched:
statement = matched.group('statement')
- condition, rest = up_to_unmatched_closing_paren(matched.group('reminder'))
+ condition, rest = up_to_unmatched_closing_paren(matched.group('remainder'))
if condition is not None:
condition_match = search(r'(?P<leading>[ ]*)(?P<separator>.).*[^ ]+(?P<trailing>[ ]*)', condition)
if condition_match:
n_leading = len(condition_match.group('leading'))
n_trailing = len(condition_match.group('trailing'))
- if n_leading != n_trailing:
- for_exception = statement == 'for' and (
- (condition.startswith(' ;') and n_trailing == 0) or
- (condition.endswith('; ') and n_leading == 0))
+ if n_leading != 0:
+ for_exception = statement == 'for' and condition.startswith(' ;')
if not for_exception:
error(line_number, 'whitespace/parens', 5,
- 'Mismatching spaces inside () in %s' % statement)
- if n_leading > 1:
- error(line_number, 'whitespace/parens', 5,
- 'Should have zero or one spaces inside ( and ) in %s' %
- statement)
+ 'Extra space after ( in %s' % statement)
+ if n_trailing != 0:
+ for_exception = statement == 'for' and condition.endswith('; ')
+ if not for_exception:
+ error(line_number, 'whitespace/parens', 5,
+ 'Extra space before ) in %s' % statement)
# Do not check for more than one command in macros
in_macro = match(r'\s*#define', line)
@@ -1369,6 +1368,11 @@ def check_spacing(file_extension, clean_lines, line_number, error):
error(line_number, 'whitespace/comma', 3,
'Missing space after ,')
+ matched = search(r'^\s*(?P<token1>[a-zA-Z0-9_\*&]+)\s\s+(?P<token2>[a-zA-Z0-9_\*&]+)', line)
+ if matched:
+ error(line_number, 'whitespace/declaration', 3,
+ 'Extra space between %s and %s' % (matched.group('token1'), matched.group('token2')))
+
if file_extension == 'cpp':
# C++ should have the & or * beside the type not the variable name.
matched = match(r'\s*\w+(?<!\breturn|\bdelete)\s+(?P<pointer_operator>\*|\&)\w+', line)
diff --git a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
index d7cb876..2dde549 100644
--- a/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/style/checkers/cpp_unittest.py
@@ -1164,28 +1164,30 @@ class CppStyleTest(CppStyleTestBase):
'')
def test_mismatching_spaces_in_parens(self):
- self.assert_lint('if (foo ) {', 'Mismatching spaces inside () in if'
+ self.assert_lint('if (foo ) {', 'Extra space before ) in if'
' [whitespace/parens] [5]')
- self.assert_lint('switch ( foo) {', 'Mismatching spaces inside () in switch'
+ self.assert_lint('switch ( foo) {', 'Extra space after ( in switch'
' [whitespace/parens] [5]')
- self.assert_lint('for (foo; ba; bar ) {', 'Mismatching spaces inside () in for'
+ self.assert_lint('for (foo; ba; bar ) {', 'Extra space before ) in for'
' [whitespace/parens] [5]')
- self.assert_lint('for ((foo); (ba); (bar) ) {', 'Mismatching spaces inside () in for'
+ self.assert_lint('for ((foo); (ba); (bar) ) {', 'Extra space before ) in for'
' [whitespace/parens] [5]')
self.assert_lint('for (; foo; bar) {', '')
self.assert_lint('for (; (foo); (bar)) {', '')
self.assert_lint('for ( ; foo; bar) {', '')
self.assert_lint('for ( ; (foo); (bar)) {', '')
- self.assert_lint('for ( ; foo; bar ) {', '')
- self.assert_lint('for ( ; (foo); (bar) ) {', '')
+ self.assert_lint('for ( ; foo; bar ) {', 'Extra space before ) in for'
+ ' [whitespace/parens] [5]')
+ self.assert_lint('for ( ; (foo); (bar) ) {', 'Extra space before ) in for'
+ ' [whitespace/parens] [5]')
self.assert_lint('for (foo; bar; ) {', '')
self.assert_lint('for ((foo); (bar); ) {', '')
- self.assert_lint('foreach (foo, foos ) {', 'Mismatching spaces inside () in foreach'
+ self.assert_lint('foreach (foo, foos ) {', 'Extra space before ) in foreach'
' [whitespace/parens] [5]')
- self.assert_lint('foreach ( foo, foos) {', 'Mismatching spaces inside () in foreach'
+ self.assert_lint('foreach ( foo, foos) {', 'Extra space after ( in foreach'
+ ' [whitespace/parens] [5]')
+ self.assert_lint('while ( foo) {', 'Extra space after ( in while'
' [whitespace/parens] [5]')
- self.assert_lint('while ( foo ) {', 'Should have zero or one spaces inside'
- ' ( and ) in while [whitespace/parens] [5]')
def test_spacing_for_fncall(self):
self.assert_lint('if (foo) {', '')
@@ -1542,6 +1544,13 @@ class CppStyleTest(CppStyleTestBase):
self.assert_lint('f(a, /* name */ b);', '')
self.assert_lint('f(a, /* name */b);', '')
+ def test_declaration(self):
+ self.assert_lint('int a;', '')
+ self.assert_lint('int a;', 'Extra space between int and a [whitespace/declaration] [3]')
+ self.assert_lint('int* a;', 'Extra space between int* and a [whitespace/declaration] [3]')
+ self.assert_lint('else if { }', '')
+ self.assert_lint('else if { }', 'Extra space between else and if [whitespace/declaration] [3]')
+
def test_pointer_reference_marker_location(self):
self.assert_lint('int* b;', '', 'foo.cpp')
self.assert_lint('int *b;',
@@ -3059,7 +3068,7 @@ class WebKitStyleTest(CppStyleTestBase):
'')
self.assert_multi_line_lint(
'#define TEST_ASSERT(expression) do { if ( !(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0)\n',
- 'Mismatching spaces inside () in if [whitespace/parens] [5]')
+ 'Extra space after ( in if [whitespace/parens] [5]')
# FIXME: currently we only check first conditional, so we cannot detect errors in next ones.
# self.assert_multi_line_lint(
# '#define TEST_ASSERT(expression) do { if (!(expression)) { TestsController::shared().testFailed(__FILE__, __LINE__, #expression); return; } } while (0 )\n',
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
index ee8c669..a848472 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/irc_command.py
@@ -57,7 +57,7 @@ class Rollout(IRCCommand):
if len(args) < 2:
tool.irc().post("%s: Usage: SVN_REVISION REASON" % nick)
return
- svn_revision = args[0]
+ svn_revision = args[0].lstrip("r")
rollout_reason = " ".join(args[1:])
tool.irc().post("Preparing rollout for r%s..." % svn_revision)
try:
diff --git a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
index 21bff12..08023bd 100644
--- a/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/bot/sheriffircbot_unittest.py
@@ -62,6 +62,10 @@ class SheriffIRCBotTest(unittest.TestCase):
expected_stderr = "MOCK: irc.post: Preparing rollout for r21654...\nMOCK: irc.post: mock_nick: Created rollout: http://example.com/36936\n"
OutputCapture().assert_outputs(self, run, args=["rollout 21654 This patch broke the world"], expected_stderr=expected_stderr)
+ def test_rollout_with_r_in_svn_revision(self):
+ expected_stderr = "MOCK: irc.post: Preparing rollout for r21654...\nMOCK: irc.post: mock_nick: Created rollout: http://example.com/36936\n"
+ OutputCapture().assert_outputs(self, run, args=["rollout r21654 This patch broke the world"], expected_stderr=expected_stderr)
+
def test_rollout_bananas(self):
expected_stderr = "MOCK: irc.post: mock_nick: Usage: SVN_REVISION REASON\n"
OutputCapture().assert_outputs(self, run, args=["rollout bananas"], expected_stderr=expected_stderr)
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/download.py b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
index a85b09a..17fb12c 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/download.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/download.py
@@ -98,6 +98,19 @@ If a bug id is provided, or one can be found in the ChangeLog land will update t
}
+class LandCowboy(AbstractSequencedCommand):
+ name = "land-cowboy"
+ help_text = "Prepares a ChangeLog and lands the current working directory diff."
+ steps = [
+ steps.PrepareChangeLog,
+ steps.EditChangeLog,
+ steps.ConfirmDiff,
+ steps.Build,
+ steps.RunTests,
+ steps.Commit,
+ ]
+
+
class AbstractPatchProcessingCommand(AbstractDeclarativeCommand):
# Subclasses must implement the methods below. We don't declare them here
# because we want to be able to implement them with mix-ins.
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
index d14ac9e..5ff390c 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues.py
@@ -184,12 +184,8 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
patches = self._validate_patches_in_commit_queue()
patches = sorted(patches, self._patch_cmp)
self._update_work_items([patch.id() for patch in patches])
- builders_are_green = self._builders_are_green()
- if not builders_are_green:
- patches = filter(lambda patch: patch.is_rollout(), patches)
if not patches:
- queue_text = "queue" if builders_are_green else "rollout queue"
- self._update_status("Empty %s" % queue_text)
+ self._update_status("Empty queue")
return None
# Only bother logging if we have patches in the queue.
self.log_progress([patch.id() for patch in patches])
@@ -211,37 +207,18 @@ class CommitQueue(AbstractPatchQueue, StepSequenceErrorHandler):
return False
return True
- def _builders_are_green(self):
- red_builders_names = self.tool.buildbot.red_core_builders_names()
- if red_builders_names:
- red_builders_names = map(lambda name: "\"%s\"" % name, red_builders_names) # Add quotes around the names.
- self._update_status("Builders [%s] are red. See http://build.webkit.org" % ", ".join(red_builders_names), None)
- return False
- return True
-
def should_proceed_with_work_item(self, patch):
- if not patch.is_rollout():
- if not self._builders_are_green():
- return False
patch_text = "rollout patch" if patch.is_rollout() else "patch"
self._update_status("Landing %s" % patch_text, patch)
return True
def _land(self, patch, first_run=False):
try:
- # We need to check the builders, unless we're trying to land a
- # rollout (in which case the builders are probably red.)
- if not patch.is_rollout() and not self._builders_are_green():
- # We return true here because we want to return to the main
- # QueueEngine loop as quickly as possible.
- return True
args = [
"land-attachment",
"--force-clean",
"--build",
"--non-interactive",
- # The master process is responsible for checking the status
- # of the builders (see above call to _builders_are_green).
"--ignore-builders",
"--build-style=both",
"--quiet",
diff --git a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
index b32dfa8..f82eb19 100644
--- a/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
+++ b/WebKitTools/Scripts/webkitpy/tool/commands/queues_unittest.py
@@ -137,16 +137,19 @@ MOCK: update_work_items: commit-queue [106, 197]
tool.buildbot.light_tree_on_fire()
expected_stderr = {
"begin_work_queue" : "CAUTION: commit-queue will discard all local changes in \"%s\"\nRunning WebKit commit-queue.\n" % MockSCM.fake_checkout_root,
- "should_proceed_with_work_item": "MOCK: update_status: commit-queue Builders [\"Builder2\"] are red. See http://build.webkit.org\n",
+ "should_proceed_with_work_item": "MOCK: update_status: commit-queue Landing patch\n",
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
"next_work_item" : """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-MOCK setting flag \'commit-queue\' to \'-\' on attachment \'128\' with comment \'Rejecting patch 128 from commit-queue.\' and additional comment \'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.\n\n- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.\n\n- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.\'
+MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
+
+- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
+
+- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.'
MOCK: update_work_items: commit-queue [106, 197]
-MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://build.webkit.org
-1 patch in commit-queue [106]
+2 patches in commit-queue [106, 197]
""",
- "process_work_item" : "MOCK: update_status: commit-queue Builders [\"Builder2\"] are red. See http://build.webkit.org\n",
+ "process_work_item" : "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 1234, '--test']\nMOCK: update_status: commit-queue Pass\n",
"handle_unexpected_error" : "MOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'Mock error message'\n",
"handle_script_error": "MOCK: update_status: commit-queue ScriptError error message\nMOCK setting flag 'commit-queue' to '-' on attachment '1234' with comment 'Rejecting patch 1234 from commit-queue.' and additional comment 'ScriptError error message'\n",
}
@@ -162,10 +165,13 @@ MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://buil
# FIXME: The commit-queue warns about bad committers twice. This is due to the fact that we access Attachment.reviewer() twice and it logs each time.
"next_work_item": """Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
Warning, attachment 128 on bug 42 has invalid committer (non-committer@example.com)
-MOCK setting flag \'commit-queue\' to \'-\' on attachment \'128\' with comment \'Rejecting patch 128 from commit-queue.\' and additional comment \'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.\n\n- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.\n\n- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.\'
+MOCK setting flag 'commit-queue' to '-' on attachment '128' with comment 'Rejecting patch 128 from commit-queue.' and additional comment 'non-committer@example.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/common/config/committers.py.
+
+- If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.
+
+- If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/common/config/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.'
MOCK: update_work_items: commit-queue [106, 197]
-MOCK: update_status: commit-queue Builders ["Builder2"] are red. See http://build.webkit.org
-1 patch in commit-queue [106]
+2 patches in commit-queue [106, 197]
""",
"process_work_item": "MOCK run_and_throw_if_fail: ['echo', '--status-host=example.com', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 76543]\nMOCK: update_status: commit-queue Pass\n",
"handle_unexpected_error": "MOCK setting flag 'commit-queue' to '-' on attachment '76543' with comment 'Rejecting patch 76543 from commit-queue.' and additional comment 'Mock error message'\n",
diff --git a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
index 59048a3..7f0c1a8 100644
--- a/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
+++ b/WebKitTools/Scripts/webkitpy/tool/steps/preparechangelog.py
@@ -65,7 +65,7 @@ class PrepareChangeLog(AbstractStep):
return
os.chdir(self._tool.scm().checkout_root)
args = [self.port().script_path("prepare-ChangeLog")]
- if state["bug_id"]:
+ if state.get("bug_id"):
args.append("--bug=%s" % state["bug_id"])
if self._options.email:
args.append("--email=%s" % self._options.email)
diff --git a/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig
new file mode 100644
index 0000000..af3f4e6
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/Base.xcconfig
@@ -0,0 +1,68 @@
+// Copyright (C) 2010 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+HEADER_SEARCH_PATHS = ForwardingHeaders;
+FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks;
+GCC_PREPROCESSOR_DEFINITIONS = ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST;
+DEBUG_INFORMATION_FORMAT = dwarf
+PREBINDING = NO
+GCC_C_LANGUAGE_STANDARD = gnu99
+GCC_PRECOMPILE_PREFIX_HEADER = YES
+GCC_TREAT_WARNINGS_AS_ERRORS = YES
+GCC_WARN_UNUSED_FUNCTION = YES
+GCC_WARN_UNUSED_VARIABLE = YES
+GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO
+WARNING_CFLAGS = -Wall -W -Wno-unused-parameter
+LINKER_DISPLAYS_MANGLED_NAMES = YES;
+
+
+TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
+
+
+// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0.
+// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
+// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
+// XCODE_VERSION_ACTUAL for the full version number.
+TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+TARGET_GCC_VERSION_ = $(TARGET_GCC_VERSION_1040);
+TARGET_GCC_VERSION_1040 = GCC_40;
+TARGET_GCC_VERSION_1050 = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_MINOR));
+TARGET_GCC_VERSION_1050_ = $(TARGET_GCC_VERSION_1050_$(XCODE_VERSION_ACTUAL));
+TARGET_GCC_VERSION_1050_0310 = GCC_42;
+TARGET_GCC_VERSION_1050_0320 = GCC_42;
+TARGET_GCC_VERSION_1060 = GCC_42;
+TARGET_GCC_VERSION_1070 = LLVM_GCC_42;
+
+GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
+GCC_VERSION_GCC_40 = 4.0;
+GCC_VERSION_GCC_42 = 4.2;
+GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
+
+// If the target Mac OS X version does not match the current Mac OS X version then we'll want to build using the target version's SDK.
+SDKROOT = $(SDKROOT_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+SDKROOT_1050_1040 = macosx10.4;
+SDKROOT_1060_1040 = macosx10.4;
+SDKROOT_1060_1050 = macosx10.5;
+SDKROOT_1070_1040 = macosx10.4;
+SDKROOT_1070_1050 = macosx10.5;
+SDKROOT_1070_1060 = macosx10.6;
diff --git a/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
new file mode 100644
index 0000000..8b156e8
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
@@ -0,0 +1,40 @@
+// Copyright (C) 2010 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "Base.xcconfig"
+
+ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
+ARCHS_ = $(ARCHS_1040);
+ARCHS_1040 = $(NATIVE_ARCH);
+ARCHS_1050 = $(NATIVE_ARCH);
+ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT);
+ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT);
+
+ONLY_ACTIVE_ARCH = YES;
+
+MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR))
+MACOSX_DEPLOYMENT_TARGET_ = 10.4;
+MACOSX_DEPLOYMENT_TARGET_1040 = 10.4;
+MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
+MACOSX_DEPLOYMENT_TARGET_1060 = 10.6;
+MACOSX_DEPLOYMENT_TARGET_1070 = 10.7;
diff --git a/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
new file mode 100644
index 0000000..4d3d1ee
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/InjectedBundle.xcconfig
@@ -0,0 +1,24 @@
+// Copyright (C) 2010 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRODUCT_NAME = InjectedBundle
diff --git a/WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig b/WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig
new file mode 100644
index 0000000..e90edba
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig
@@ -0,0 +1,26 @@
+// Copyright (C) 2010 Apple Inc. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions
+// are met:
+// 1. Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRODUCT_NAME = WebKitTestRunner
+GCC_ENABLE_OBJC_EXCEPTIONS = YES
+GCC_PREFIX_HEADER = WebKitTestRunnerPrefix.h
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist b/WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist
new file mode 100644
index 0000000..a21fbde
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle-Info.plist
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>${EXECUTABLE_NAME}</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.apple.WebKitTestRunner.InjectedBundle</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundlePackageType</key>
+ <string>BNDL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+</dict>
+</plist>
diff --git a/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp
new file mode 100644
index 0000000..f108548
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundleInitialize.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WebKit2.h>
+
+static WKBundleRef globalBundle;
+
+// WKBundlePageClient
+
+void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didClearWindow(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
+{
+}
+
+// WKBundleClient
+
+void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+ WKBundlePageClient client = {
+ 0,
+ 0,
+ _didStartProvisionalLoadForFrame,
+ _didReceiveServerRedirectForProvisionalLoadForFrame,
+ _didFailProvisionalLoadWithErrorForFrame,
+ _didCommitLoadForFrame,
+ _didFinishLoadForFrame,
+ _didFailLoadWithErrorForFrame,
+ _didReceiveTitleForFrame,
+ _didClearWindow
+ };
+ WKBundlePageSetClient(page, &client);
+}
+
+void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+}
+
+void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)
+{
+}
+
+extern "C" void WKBundleInitialize(WKBundleRef bundle)
+{
+ globalBundle = bundle;
+
+ WKBundleClient client = {
+ 0,
+ 0,
+ _didCreatePage,
+ _willDestroyPage,
+ _didRecieveMessage
+ };
+ WKBundleSetClient(bundle, &client);
+}
diff --git a/WebKitTools/WebKitTestRunner/Makefile b/WebKitTools/WebKitTestRunner/Makefile
new file mode 100644
index 0000000..4648f98
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/Makefile
@@ -0,0 +1,21 @@
+# Build WebKitTestRunner only on Snow Leopard and later.
+
+OSX_VERSION ?= $(shell sw_vers -productVersion | cut -d. -f 2)
+BUILD_WEBKITTESTRUNNER = $(shell (( $(OSX_VERSION) >= 6 )) && echo "YES" )
+
+ifeq "$(BUILD_WEBKITTESTRUNNER)" "YES"
+
+SCRIPTS_PATH = ../Scripts
+include ../../Makefile.shared
+
+else
+
+all: ;
+
+debug d development dev develop: ;
+
+release r deployment dep deploy: ;
+
+clean: ;
+
+endif
diff --git a/WebKitTools/WebKitTestRunner/PlatformWebView.h b/WebKitTools/WebKitTestRunner/PlatformWebView.h
new file mode 100644
index 0000000..5506f33
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/PlatformWebView.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PlatformWebView_h
+#define PlatformWebView_h
+
+#if __APPLE__
+#if __OBJC__
+@class WKView;
+@class NSWindow;
+#else
+class WKView;
+class NSWindow;
+#endif
+typedef WKView* PlatformWKView;
+typedef NSWindow* PlatformWindow;
+#elif defined(WIN32) || defined(_WIN32)
+typedef WKViewRef PlatformWKView;
+typedef HWND PlatformWindow;
+#endif
+
+namespace WTR {
+
+class PlatformWebView {
+public:
+ PlatformWebView(WKPageNamespaceRef);
+ ~PlatformWebView();
+
+ WKPageRef page();
+ PlatformWKView platformView() { return m_view; }
+
+private:
+ PlatformWKView m_view;
+ PlatformWindow m_window;
+};
+
+} // namespace WTR
+
+#endif // PlatformWebView_h
diff --git a/WebKitTools/WebKitTestRunner/TestController.cpp b/WebKitTools/WebKitTestRunner/TestController.cpp
new file mode 100644
index 0000000..5355862
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestController.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestController.h"
+
+#include "TestInvocation.h"
+#include <getopt.h>
+
+namespace WTR {
+
+TestController& TestController::shared()
+{
+ static TestController& shared = *new TestController;
+ return shared;
+}
+
+TestController::TestController()
+ : m_dumpTree(false)
+ , m_dumpPixels(false)
+ , m_threaded(false)
+ , m_forceComplexText(false)
+ , m_verbose(false)
+ , m_printSeparators(false)
+ , m_usingServerMode(false)
+{
+}
+
+void TestController::initialize(int argc, const char *argv[])
+{
+ int dumpTree = 0;
+ int dumpPixels = 0;
+ int threaded = 0;
+ int forceComplexText = 0;
+ int useHTML5Parser = 0;
+ int verbose = 0;
+
+ struct option options[] = {
+ {"notree", no_argument, &dumpTree, false},
+ {"pixel-tests", no_argument, &dumpPixels, true},
+ {"tree", no_argument, &dumpTree, true},
+ {"threaded", no_argument, &threaded, true},
+ {"complex-text", no_argument, &forceComplexText, true},
+ {"legacy-parser", no_argument, &useHTML5Parser, false},
+ {"verbose", no_argument, &verbose, true},
+ {0, 0, 0, 0}
+ };
+
+ int option;
+ while ((option = getopt_long(argc, (char * const *)argv, "", options, 0)) != -1) {
+ switch (option) {
+ case '?': // unknown or ambiguous option
+ case ':': // missing argument
+ exit(1);
+ break;
+ }
+ }
+
+ m_dumpTree = dumpTree;
+ m_dumpPixels = dumpPixels;
+ m_threaded = threaded;
+ m_forceComplexText = forceComplexText;
+ m_verbose = verbose;
+
+ m_usingServerMode = (argc == optind + 1 && strcmp(argv[optind], "-") == 0);
+ if (m_usingServerMode)
+ m_printSeparators = true;
+ else {
+ m_printSeparators = (optind < argc - 1 || (m_dumpPixels && m_dumpTree));
+ for (int i = optind; i != argc; ++i)
+ m_paths.push_back(std::string(argv[i]));
+ }
+
+ initializeInjectedBundlePath();
+}
+
+void TestController::runTest(const char* test)
+{
+ TestInvocation invocation(test);
+ invocation.invoke();
+}
+
+void TestController::runTestingServerLoop()
+{
+ char filenameBuffer[2048];
+ while (fgets(filenameBuffer, sizeof(filenameBuffer), stdin)) {
+ char *newLineCharacter = strchr(filenameBuffer, '\n');
+ if (newLineCharacter)
+ *newLineCharacter = '\0';
+
+ if (strlen(filenameBuffer) == 0)
+ continue;
+
+ runTest(filenameBuffer);
+ }
+}
+
+bool TestController::run()
+{
+ if (m_usingServerMode)
+ runTestingServerLoop();
+ else {
+ for (size_t i = 0; i < m_paths.size(); ++i)
+ runTest(m_paths[i].c_str());
+ }
+
+ return true;
+}
+
+} // namespace WTR
+
diff --git a/WebKitTools/WebKitTestRunner/TestController.h b/WebKitTools/WebKitTestRunner/TestController.h
new file mode 100644
index 0000000..86eaa7c
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestController.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestController_h
+#define TestController_h
+
+#include <WebKit2/WKRetainPtr.h>
+#include <string>
+#include <vector>
+
+namespace WTR {
+
+class TestController {
+public:
+ static TestController& shared();
+
+ // Initialize the TestController.
+ void initialize(int argc, const char *argv[]);
+
+ // Returns true if all the tests passed, false otherwise.
+ bool run();
+
+ bool verbose() const { return m_verbose; }
+
+ WKStringRef injectedBundlePath() { return m_injectedBundlePath.get(); }
+
+private:
+ TestController();
+ ~TestController();
+
+ void runTestingServerLoop();
+ void runTest(const char* pathOrURL);
+
+ void initializeInjectedBundlePath();
+
+ bool m_dumpTree;
+ bool m_dumpPixels;
+ bool m_threaded;
+ bool m_forceComplexText;
+ bool m_verbose;
+ bool m_printSeparators;
+ bool m_usingServerMode;
+ std::vector<std::string> m_paths;
+ WKRetainPtr<WKStringRef> m_injectedBundlePath;
+};
+
+} // namespace WTR
+
+#endif // TestController_h
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.cpp b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
new file mode 100644
index 0000000..80efd62
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.cpp
@@ -0,0 +1,170 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestInvocation.h"
+
+#include "TestController.h"
+#include <JavaScriptCore/RetainPtr.h>
+#include <WebKit2/WKContextPrivate.h>
+#include <WebKit2/WKPagePrivate.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <WebKit2/WKStringCF.h>
+#include <WebKit2/WKURLCF.h>
+
+using namespace WebKit;
+
+namespace WTR {
+
+static WKURLRef createWKURL(const char* pathOrURL)
+{
+ RetainPtr<CFStringRef> pathOrURLCFString(AdoptCF, CFStringCreateWithCString(0, pathOrURL, kCFStringEncodingUTF8));
+ RetainPtr<CFURLRef> cfURL;
+ if (CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("http://")) || CFStringHasPrefix(pathOrURLCFString.get(), CFSTR("https://")))
+ cfURL.adoptCF(CFURLCreateWithString(0, pathOrURLCFString.get(), 0));
+ else
+ cfURL.adoptCF(CFURLCreateWithFileSystemPath(0, pathOrURLCFString.get(), kCFURLPOSIXPathStyle, false));
+ return WKURLCreateWithCFURL(cfURL.get());
+}
+
+TestInvocation::TestInvocation(const char* pathOrURL)
+ : m_url(AdoptWK, createWKURL(pathOrURL))
+ , m_mainWebView(0)
+ , m_loadDone(false)
+ , m_renderTreeFetchDone(false)
+ , m_failed(false)
+{
+}
+
+TestInvocation::~TestInvocation()
+{
+ delete m_mainWebView;
+ m_mainWebView = 0;
+}
+
+void TestInvocation::invoke()
+{
+ initializeMainWebView();
+
+ WKPageLoadURL(m_mainWebView->page(), m_url.get());
+ runUntil(m_loadDone);
+
+ if (m_failed)
+ return;
+
+ WKPageRenderTreeExternalRepresentation(m_mainWebView->page(), this, renderTreeExternalRepresentationFunction, renderTreeExternalRepresentationDisposeFunction);
+ runUntil(m_renderTreeFetchDone);
+}
+
+void TestInvocation::dump(const char* stringToDump)
+{
+ printf("Content-Type: text/plain\n");
+ printf("%s", stringToDump);
+ printf("#EOF\n");
+}
+
+void TestInvocation::initializeMainWebView()
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithInjectedBundlePath(TestController::shared().injectedBundlePath()));
+ WKRetainPtr<WKPageNamespaceRef> pageNamespace(AdoptWK, WKPageNamespaceCreate(context.get()));
+ m_mainWebView = new PlatformWebView(pageNamespace.get());
+
+ WKPageLoaderClient loaderClient = {
+ 0,
+ this,
+ didStartProvisionalLoadForFrame,
+ didReceiveServerRedirectForProvisionalLoadForFrame,
+ didFailProvisionalLoadWithErrorForFrame,
+ didCommitLoadForFrame,
+ didFinishLoadForFrame,
+ didFailLoadForFrame,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0
+ };
+ WKPageSetPageLoaderClient(m_mainWebView->page(), &loaderClient);
+}
+
+void TestInvocation::didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+void TestInvocation::didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+void TestInvocation::didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+ TestInvocation* self = reinterpret_cast<TestInvocation*>(const_cast<void*>(clientInfo));
+ self->m_loadDone = true;
+ self->m_failed = true;
+}
+
+void TestInvocation::didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+}
+
+void TestInvocation::didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+ TestInvocation* self = reinterpret_cast<TestInvocation*>(const_cast<void*>(clientInfo));
+ self->m_loadDone = true;
+}
+
+void TestInvocation::didFailLoadForFrame(WKPageRef page, WKFrameRef frame, const void* clientInfo)
+{
+ TestInvocation* self = reinterpret_cast<TestInvocation*>(const_cast<void*>(clientInfo));
+
+ self->m_loadDone = true;
+ self->m_failed = true;
+}
+
+void TestInvocation::renderTreeExternalRepresentationFunction(WKStringRef wkResult, void* context)
+{
+ TestInvocation* self = reinterpret_cast<TestInvocation*>(context);
+
+ RetainPtr<CFStringRef> result(AdoptCF, WKStringCopyCFString(0, wkResult));
+ CFIndex bufferLength = CFStringGetMaximumSizeForEncoding(CFStringGetLength(result.get()), kCFStringEncodingUTF8) + 1;
+ char* buffer = (char*)malloc(bufferLength);
+ CFStringGetCString(result.get(), buffer, bufferLength, kCFStringEncodingUTF8);
+
+ self->dump(buffer);
+ free(buffer);
+
+ self->m_renderTreeFetchDone = true;
+}
+
+void TestInvocation::renderTreeExternalRepresentationDisposeFunction(void* context)
+{
+ TestInvocation* self = reinterpret_cast<TestInvocation*>(context);
+
+ self->m_renderTreeFetchDone = true;
+ self->m_failed = true;
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/TestInvocation.h b/WebKitTools/WebKitTestRunner/TestInvocation.h
new file mode 100644
index 0000000..4552203
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/TestInvocation.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TestInvocation_h
+#define TestInvocation_h
+
+#include "PlatformWebView.h"
+#include <WebKit2/WKRetainPtr.h>
+#include <JavaScriptCore/Noncopyable.h>
+
+namespace WTR {
+
+class TestInvocation : Noncopyable {
+public:
+ TestInvocation(const char*);
+ ~TestInvocation();
+
+ void invoke();
+
+private:
+ void initializeMainWebView();
+ void dump(const char*);
+
+ // Helper
+ static void runUntil(bool& done);
+
+ // PageLoaderClient
+ static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef, const void*);
+ static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef, const void*);
+ static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, const void*);
+ static void didCommitLoadForFrame(WKPageRef, WKFrameRef, const void*);
+ static void didFinishLoadForFrame(WKPageRef, WKFrameRef, const void*);
+ static void didFailLoadForFrame(WKPageRef, WKFrameRef, const void*);
+
+ // RenderTreeExternalRepresentation callbacks
+ static void renderTreeExternalRepresentationFunction(WKStringRef, void*);
+ static void renderTreeExternalRepresentationDisposeFunction(void*);
+
+ WKStringRef injectedBundlePath();
+
+ WKRetainPtr<WKURLRef> m_url;
+ PlatformWebView* m_mainWebView;
+
+ // Invocation state
+ bool m_loadDone;
+ bool m_renderTreeFetchDone;
+ bool m_failed;
+};
+
+} // namespace WTR
+
+#endif // TestInvocation_h
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..bef50b5
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -0,0 +1,355 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 45;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ BC25193E11D15D8B002EBC01 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934A411906584005EA8E2 /* Cocoa.framework */; };
+ BC25193F11D15D8B002EBC01 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934AB1190658C005EA8E2 /* WebKit2.framework */; };
+ BC25194011D15D8B002EBC01 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
+ BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */; };
+ BC793400118F7C84005EA8E2 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC7933FF118F7C84005EA8E2 /* main.mm */; };
+ BC793431118F7F19005EA8E2 /* TestController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC793430118F7F19005EA8E2 /* TestController.cpp */; };
+ BC7934A511906584005EA8E2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934A411906584005EA8E2 /* Cocoa.framework */; };
+ BC7934AC1190658C005EA8E2 /* WebKit2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC7934AB1190658C005EA8E2 /* WebKit2.framework */; };
+ BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */; };
+ BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC8C795B11D2785D004535A1 /* TestControllerMac.mm */; };
+ BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCD7D2F711921278006DB7EE /* TestInvocation.cpp */; };
+ BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */; };
+ BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ BC25194111D15D94002EBC01 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = BC25186111D15D54002EBC01;
+ remoteInfo = InjectedBundle;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /usr/share/man/man1/;
+ dstSubfolderSpec = 0;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = WebKitTestRunner; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleMain.cpp; sourceTree = "<group>"; };
+ BC25186211D15D54002EBC01 /* InjectedBundle.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InjectedBundle.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "InjectedBundle-Info.plist"; sourceTree = "<group>"; };
+ BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = InjectedBundle.xcconfig; sourceTree = "<group>"; };
+ BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitTestRunnerPrefix.h; sourceTree = "<group>"; };
+ BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebKitTestRunner.xcconfig; sourceTree = "<group>"; };
+ BC7933FF118F7C84005EA8E2 /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
+ BC793426118F7D3C005EA8E2 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
+ BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
+ BC79342F118F7F19005EA8E2 /* TestController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestController.h; sourceTree = "<group>"; };
+ BC793430118F7F19005EA8E2 /* TestController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestController.cpp; sourceTree = "<group>"; };
+ BC7934A411906584005EA8E2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ BC7934AB1190658C005EA8E2 /* WebKit2.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ BC7934DD119066EC005EA8E2 /* PlatformWebView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWebView.h; sourceTree = "<group>"; };
+ BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformWebViewMac.mm; sourceTree = "<group>"; };
+ BC8C795B11D2785D004535A1 /* TestControllerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestControllerMac.mm; sourceTree = "<group>"; };
+ BCD7D2F611921278006DB7EE /* TestInvocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestInvocation.h; sourceTree = "<group>"; };
+ BCD7D2F711921278006DB7EE /* TestInvocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestInvocation.cpp; sourceTree = "<group>"; };
+ BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TestInvocationMac.mm; sourceTree = "<group>"; };
+ BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC7934A511906584005EA8E2 /* Cocoa.framework in Frameworks */,
+ BC7934AC1190658C005EA8E2 /* WebKit2.framework in Frameworks */,
+ BCDA2B9A1191051F00C3BC47 /* JavaScriptCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BC25186011D15D54002EBC01 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC25193E11D15D8B002EBC01 /* Cocoa.framework in Frameworks */,
+ BC25193F11D15D8B002EBC01 /* WebKit2.framework in Frameworks */,
+ BC25194011D15D8B002EBC01 /* JavaScriptCore.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* WebKitTestRunner */ = {
+ isa = PBXGroup;
+ children = (
+ 08FB7795FE84155DC02AAC07 /* Source */,
+ BC25183511D1571D002EBC01 /* InjectedBundle */,
+ BC793401118F7C8A005EA8E2 /* Configurations */,
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
+ BC25194411D15DBE002EBC01 /* Resources */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ name = WebKitTestRunner;
+ sourceTree = "<group>";
+ };
+ 08FB7795FE84155DC02AAC07 /* Source */ = {
+ isa = PBXGroup;
+ children = (
+ BC7933FE118F7C74005EA8E2 /* mac */,
+ BC251A1711D16774002EBC01 /* WebKitTestRunnerPrefix.h */,
+ BC7934DD119066EC005EA8E2 /* PlatformWebView.h */,
+ BC79342F118F7F19005EA8E2 /* TestController.h */,
+ BC793430118F7F19005EA8E2 /* TestController.cpp */,
+ BCD7D2F611921278006DB7EE /* TestInvocation.h */,
+ BCD7D2F711921278006DB7EE /* TestInvocation.cpp */,
+ );
+ name = Source;
+ sourceTree = "<group>";
+ };
+ 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
+ isa = PBXGroup;
+ children = (
+ BC7934A411906584005EA8E2 /* Cocoa.framework */,
+ BC7934AB1190658C005EA8E2 /* WebKit2.framework */,
+ BCDA2B991191051F00C3BC47 /* JavaScriptCore.framework */,
+ );
+ name = "External Frameworks and Libraries";
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */,
+ BC25186211D15D54002EBC01 /* InjectedBundle.bundle */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ BC25183511D1571D002EBC01 /* InjectedBundle */ = {
+ isa = PBXGroup;
+ children = (
+ BC25184611D15767002EBC01 /* InjectedBundleMain.cpp */,
+ );
+ path = InjectedBundle;
+ sourceTree = "<group>";
+ };
+ BC25194411D15DBE002EBC01 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ BC25186311D15D54002EBC01 /* InjectedBundle-Info.plist */,
+ );
+ name = Resources;
+ sourceTree = "<group>";
+ };
+ BC7933FE118F7C74005EA8E2 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ BC7933FF118F7C84005EA8E2 /* main.mm */,
+ BC7934E711906846005EA8E2 /* PlatformWebViewMac.mm */,
+ BCDA2ABE1190B51A00C3BC47 /* TestInvocationMac.mm */,
+ BC8C795B11D2785D004535A1 /* TestControllerMac.mm */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
+ BC793401118F7C8A005EA8E2 /* Configurations */ = {
+ isa = PBXGroup;
+ children = (
+ BC793426118F7D3C005EA8E2 /* Base.xcconfig */,
+ BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */,
+ BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */,
+ BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */,
+ );
+ path = Configurations;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 8DD76F960486AA7600D96B5E /* WebKitTestRunner */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WebKitTestRunner" */;
+ buildPhases = (
+ 8DD76F990486AA7600D96B5E /* Sources */,
+ 8DD76F9B0486AA7600D96B5E /* Frameworks */,
+ 8DD76F9E0486AA7600D96B5E /* CopyFiles */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ BC25194211D15D94002EBC01 /* PBXTargetDependency */,
+ );
+ name = WebKitTestRunner;
+ productInstallPath = "$(HOME)/bin";
+ productName = WebKitTestRunner;
+ productReference = 8DD76FA10486AA7600D96B5E /* WebKitTestRunner */;
+ productType = "com.apple.product-type.tool";
+ };
+ BC25186111D15D54002EBC01 /* InjectedBundle */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */;
+ buildPhases = (
+ BC25185E11D15D54002EBC01 /* Resources */,
+ BC25185F11D15D54002EBC01 /* Sources */,
+ BC25186011D15D54002EBC01 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = InjectedBundle;
+ productName = InjectedBundle;
+ productReference = BC25186211D15D54002EBC01 /* InjectedBundle.bundle */;
+ productType = "com.apple.product-type.bundle";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WebKitTestRunner" */;
+ compatibilityVersion = "Xcode 3.1";
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* WebKitTestRunner */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 8DD76F960486AA7600D96B5E /* WebKitTestRunner */,
+ BC25186111D15D54002EBC01 /* InjectedBundle */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ BC25185E11D15D54002EBC01 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 8DD76F990486AA7600D96B5E /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC793400118F7C84005EA8E2 /* main.mm in Sources */,
+ BC793431118F7F19005EA8E2 /* TestController.cpp in Sources */,
+ BC7934E811906846005EA8E2 /* PlatformWebViewMac.mm in Sources */,
+ BCDA2ABF1190B51A00C3BC47 /* TestInvocationMac.mm in Sources */,
+ BCD7D2F811921278006DB7EE /* TestInvocation.cpp in Sources */,
+ BC8C795C11D2785D004535A1 /* TestControllerMac.mm in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ BC25185F11D15D54002EBC01 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ BC251A3E11D16831002EBC01 /* InjectedBundleMain.cpp in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ BC25194211D15D94002EBC01 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = BC25186111D15D54002EBC01 /* InjectedBundle */;
+ targetProxy = BC25194111D15D94002EBC01 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB927508733DD40010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ 1DEB927608733DD40010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC251A1811D16795002EBC01 /* WebKitTestRunner.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ 1DEB927908733DD40010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */;
+ buildSettings = {
+ GCC_OPTIMIZATION_LEVEL = 0;
+ };
+ name = Debug;
+ };
+ 1DEB927A08733DD40010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC793427118F7DAF005EA8E2 /* DebugRelease.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+ BC25186411D15D55002EBC01 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */;
+ buildSettings = {
+ };
+ name = Debug;
+ };
+ BC25186511D15D55002EBC01 /* Release */ = {
+ isa = XCBuildConfiguration;
+ baseConfigurationReference = BC25197111D15E61002EBC01 /* InjectedBundle.xcconfig */;
+ buildSettings = {
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "WebKitTestRunner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB927508733DD40010E9CD /* Debug */,
+ 1DEB927608733DD40010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "WebKitTestRunner" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB927908733DD40010E9CD /* Debug */,
+ 1DEB927A08733DD40010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ BC25186611D15D55002EBC01 /* Build configuration list for PBXNativeTarget "InjectedBundle" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ BC25186411D15D55002EBC01 /* Debug */,
+ BC25186511D15D55002EBC01 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
diff --git a/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h b/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h
new file mode 100644
index 0000000..e8c85a4
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/WebKitTestRunnerPrefix.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef __OBJC__
+#include <Cocoa/Cocoa.h>
+#endif
+
+#include <WebKit2/WebKit2.h>
diff --git a/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
new file mode 100644
index 0000000..1a8696d
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/PlatformWebViewMac.mm
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "PlatformWebView.h"
+
+namespace WTR {
+
+PlatformWebView::PlatformWebView(WKPageNamespaceRef namespaceRef)
+{
+ NSRect rect = NSMakeRect(0, 0, 800, 600);
+ m_view = [[WKView alloc] initWithFrame:rect pageNamespaceRef:namespaceRef];
+
+ NSRect windowRect = NSOffsetRect(rect, -10000, [[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
+ m_window = [[NSWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
+ [m_window setColorSpace:[[NSScreen mainScreen] colorSpace]];
+ [[m_window contentView] addSubview:m_view];
+ [m_window orderBack:nil];
+ [m_window setAutodisplay:NO];
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ [m_window close];
+ [m_window release];
+ [m_view release];
+}
+
+WKPageRef PlatformWebView::page()
+{
+ return [m_view pageRef];
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
new file mode 100644
index 0000000..5957e0e
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/TestControllerMac.mm
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestController.h"
+
+#include <WebKit2/WKStringCF.h>
+#include <mach-o/dyld.h>
+
+namespace WTR {
+
+void TestController::initializeInjectedBundlePath()
+{
+ uint32_t pathLength = 0;
+ _NSGetExecutablePath(0, &pathLength);
+ char* path = (char*)malloc(pathLength);
+ _NSGetExecutablePath(path, &pathLength);
+ char* theRealPath = (char*)malloc(pathLength);
+ realpath(path, theRealPath);
+
+ NSString *pwd = [[NSString stringWithUTF8String:theRealPath] stringByDeletingLastPathComponent];
+ NSString *nsBundlePath = [pwd stringByAppendingPathComponent:@"InjectedBundle.bundle"];
+
+ free(path);
+ free(theRealPath);
+
+ m_injectedBundlePath.adopt(WKStringCreateWithCFString((CFStringRef)nsBundlePath));
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm b/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm
new file mode 100644
index 0000000..bd01029
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/TestInvocationMac.mm
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "TestInvocation.h"
+
+namespace WTR {
+
+void TestInvocation::runUntil(bool& done)
+{
+ while (!done)
+ [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
+}
+
+} // namespace WTR
diff --git a/WebKitTools/WebKitTestRunner/mac/main.mm b/WebKitTools/WebKitTestRunner/mac/main.mm
new file mode 100644
index 0000000..021c124
--- /dev/null
+++ b/WebKitTools/WebKitTestRunner/mac/main.mm
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "TestController.h"
+
+int main(int argc, const char* argv[])
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ [NSApplication sharedApplication];
+
+ WTR::TestController::shared().initialize(argc, argv);
+ WTR::TestController::shared().run();
+
+ [pool drain];
+
+ return 0;
+}
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index fc77a4e..aa5ca18 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -175,7 +175,7 @@ if building_on_win32:
create_hash_table = get_output('cygpath --unix "%s"' % create_hash_table)
os.environ['CREATE_HASH_TABLE'] = create_hash_table
-feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER', 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS', 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE']
+feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER', 'ENABLE_SVG', 'ENABLE_SVG_USE', 'ENABLE_FILTERS', 'ENABLE_SVG_FONTS', 'ENABLE_SVG_ANIMATION', 'ENABLE_SVG_AS_IMAGE', 'ENABLE_SVG_FOREIGN_OBJECT']
msvc_version = 'msvc2008'